claudekit-cli 3.39.3-dev.5 → 3.39.3-dev.6
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 +41 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14335,6 +14335,32 @@ function truncateField(value, field, warnings) {
|
|
|
14335
14335
|
}
|
|
14336
14336
|
return value;
|
|
14337
14337
|
}
|
|
14338
|
+
function parseFrontmatterFallback(content) {
|
|
14339
|
+
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
14340
|
+
if (!fmMatch)
|
|
14341
|
+
return null;
|
|
14342
|
+
const fmBlock = fmMatch[1];
|
|
14343
|
+
const body = content.slice(fmMatch[0].length);
|
|
14344
|
+
const frontmatter = {};
|
|
14345
|
+
const warnings = [];
|
|
14346
|
+
const lines = fmBlock.split(/\r?\n/);
|
|
14347
|
+
for (const line of lines) {
|
|
14348
|
+
const keyMatch = line.match(/^([a-zA-Z][\w-]*)\s*:\s*(.*)/);
|
|
14349
|
+
if (!keyMatch)
|
|
14350
|
+
continue;
|
|
14351
|
+
const [, rawKey, rawValue] = keyMatch;
|
|
14352
|
+
const value = rawValue.replace(/^(['"])(.*)\1$/, "$2").trim();
|
|
14353
|
+
if (!value)
|
|
14354
|
+
continue;
|
|
14355
|
+
const mappedKey = KNOWN_KEYS[rawKey];
|
|
14356
|
+
if (mappedKey) {
|
|
14357
|
+
frontmatter[mappedKey] = truncateField(value, String(mappedKey), warnings);
|
|
14358
|
+
} else {
|
|
14359
|
+
frontmatter[rawKey] = value;
|
|
14360
|
+
}
|
|
14361
|
+
}
|
|
14362
|
+
return { frontmatter, body: body.trim(), warnings };
|
|
14363
|
+
}
|
|
14338
14364
|
function parseFrontmatter(content) {
|
|
14339
14365
|
try {
|
|
14340
14366
|
const { data, content: body } = import_gray_matter3.default(content);
|
|
@@ -14359,6 +14385,11 @@ function parseFrontmatter(content) {
|
|
|
14359
14385
|
}
|
|
14360
14386
|
return { frontmatter, body: body.trim(), warnings };
|
|
14361
14387
|
} catch (error) {
|
|
14388
|
+
const fallback = parseFrontmatterFallback(content);
|
|
14389
|
+
if (fallback && Object.keys(fallback.frontmatter).length > 0) {
|
|
14390
|
+
logger.verbose(`Failed to parse frontmatter: ${error instanceof Error ? error.message : "Unknown error"} (recovered via fallback)`);
|
|
14391
|
+
return fallback;
|
|
14392
|
+
}
|
|
14362
14393
|
logger.warning(`Failed to parse frontmatter: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
14363
14394
|
return { frontmatter: {}, body: content.trim(), warnings: [] };
|
|
14364
14395
|
}
|
|
@@ -14367,7 +14398,7 @@ async function parseFrontmatterFile(filePath) {
|
|
|
14367
14398
|
const content = await readFile5(filePath, "utf-8");
|
|
14368
14399
|
return parseFrontmatter(content);
|
|
14369
14400
|
}
|
|
14370
|
-
var import_gray_matter3, FRONTMATTER_LIMITS;
|
|
14401
|
+
var import_gray_matter3, FRONTMATTER_LIMITS, KNOWN_KEYS;
|
|
14371
14402
|
var init_frontmatter_parser = __esm(() => {
|
|
14372
14403
|
init_logger();
|
|
14373
14404
|
import_gray_matter3 = __toESM(require_gray_matter(), 1);
|
|
@@ -14379,6 +14410,14 @@ var init_frontmatter_parser = __esm(() => {
|
|
|
14379
14410
|
memory: 50,
|
|
14380
14411
|
argumentHint: 500
|
|
14381
14412
|
};
|
|
14413
|
+
KNOWN_KEYS = {
|
|
14414
|
+
name: "name",
|
|
14415
|
+
description: "description",
|
|
14416
|
+
model: "model",
|
|
14417
|
+
tools: "tools",
|
|
14418
|
+
memory: "memory",
|
|
14419
|
+
"argument-hint": "argumentHint"
|
|
14420
|
+
};
|
|
14382
14421
|
});
|
|
14383
14422
|
|
|
14384
14423
|
// src/commands/agents/agents-discovery.ts
|
|
@@ -57245,7 +57284,7 @@ var package_default;
|
|
|
57245
57284
|
var init_package = __esm(() => {
|
|
57246
57285
|
package_default = {
|
|
57247
57286
|
name: "claudekit-cli",
|
|
57248
|
-
version: "3.39.3-dev.
|
|
57287
|
+
version: "3.39.3-dev.6",
|
|
57249
57288
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57250
57289
|
type: "module",
|
|
57251
57290
|
repository: {
|