@rayul/kordis 0.1.11 → 0.1.12
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 +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1401,8 +1401,10 @@ function pushCommand() {
|
|
|
1401
1401
|
let assets = [];
|
|
1402
1402
|
if (s.isDirectory()) {
|
|
1403
1403
|
({ content, assets } = await bundleDirectory(abs));
|
|
1404
|
+
content = ensureTypeField(content, "skill");
|
|
1404
1405
|
} else if (abs.endsWith(".skill")) {
|
|
1405
1406
|
({ content, assets } = await bundleSkillZip(abs));
|
|
1407
|
+
content = ensureTypeField(content, "skill");
|
|
1406
1408
|
} else {
|
|
1407
1409
|
content = await readFile3(abs, "utf8");
|
|
1408
1410
|
}
|
|
@@ -1489,6 +1491,16 @@ function pushCommand() {
|
|
|
1489
1491
|
}
|
|
1490
1492
|
);
|
|
1491
1493
|
}
|
|
1494
|
+
function ensureTypeField(content, defaultType) {
|
|
1495
|
+
const fmMatch = /^---\r?\n([\s\S]*?)\r?\n---/.exec(content);
|
|
1496
|
+
if (!fmMatch) return content;
|
|
1497
|
+
const fmBlock = fmMatch[1];
|
|
1498
|
+
if (/^type\s*:/m.test(fmBlock)) return content;
|
|
1499
|
+
const injected = fmMatch[0].replace(/^---\r?\n/, `---
|
|
1500
|
+
type: ${defaultType}
|
|
1501
|
+
`);
|
|
1502
|
+
return content.replace(fmMatch[0], injected);
|
|
1503
|
+
}
|
|
1492
1504
|
var EXCLUDE_NAMES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
1493
1505
|
var EXCLUDE_DIRS = /* @__PURE__ */ new Set(["__pycache__", "node_modules", ".git", "evals", "dist", ".turbo"]);
|
|
1494
1506
|
var EXCLUDE_EXTS = /* @__PURE__ */ new Set([".pyc", ".pyo", ".rbc"]);
|