@the-aico/cli 1.1.0 → 1.1.1
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 +24 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -623,7 +623,13 @@ function parseSkillFrontmatter(content) {
|
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
// src/schema/employee.ts
|
|
626
|
-
var fileTypeSchema = z4.enum([
|
|
626
|
+
var fileTypeSchema = z4.enum([
|
|
627
|
+
"skill",
|
|
628
|
+
"command",
|
|
629
|
+
"doc",
|
|
630
|
+
"script",
|
|
631
|
+
"asset"
|
|
632
|
+
]);
|
|
627
633
|
var employeeFileSourceSchema = z4.object({
|
|
628
634
|
path: z4.string().min(1),
|
|
629
635
|
type: fileTypeSchema
|
|
@@ -1027,12 +1033,18 @@ async function installEmployeeToPlatform(employee, config, cwd, platform, _optio
|
|
|
1027
1033
|
const skillDir = path4.join(skillsDir, skillDirName);
|
|
1028
1034
|
await fs3.ensureDir(skillDir);
|
|
1029
1035
|
for (const file of skill.files) {
|
|
1030
|
-
const
|
|
1036
|
+
const skillPrefix = `skills/${skill.name}/`;
|
|
1037
|
+
const relativePath = file.path.startsWith(skillPrefix) ? file.path.substring(skillPrefix.length) : path4.basename(file.path);
|
|
1038
|
+
const filePath = path4.join(skillDir, relativePath);
|
|
1039
|
+
await fs3.ensureDir(path4.dirname(filePath));
|
|
1031
1040
|
let content = file.content;
|
|
1032
|
-
if (
|
|
1041
|
+
if (relativePath.endsWith("SKILL.md")) {
|
|
1033
1042
|
content = updateSkillName(content, skillDirName);
|
|
1034
1043
|
}
|
|
1035
1044
|
await fs3.writeFile(filePath, content, "utf-8");
|
|
1045
|
+
if (file.type === "script") {
|
|
1046
|
+
await fs3.chmod(filePath, 493);
|
|
1047
|
+
}
|
|
1036
1048
|
}
|
|
1037
1049
|
skillsInstalled++;
|
|
1038
1050
|
}
|
|
@@ -1117,11 +1129,15 @@ async function installSkill(skill, config, cwd, options) {
|
|
|
1117
1129
|
await fs4.ensureDir(skillDir);
|
|
1118
1130
|
for (const file of skill.files) {
|
|
1119
1131
|
const filePath = path5.join(skillDir, file.path);
|
|
1132
|
+
await fs4.ensureDir(path5.dirname(filePath));
|
|
1120
1133
|
let content = file.content;
|
|
1121
1134
|
if (file.path === "SKILL.md" || file.path.endsWith("/SKILL.md")) {
|
|
1122
1135
|
content = updateSkillFrontmatterName(content, skillDirName);
|
|
1123
1136
|
}
|
|
1124
1137
|
await fs4.writeFile(filePath, content, "utf-8");
|
|
1138
|
+
if (file.type === "script") {
|
|
1139
|
+
await fs4.chmod(filePath, 493);
|
|
1140
|
+
}
|
|
1125
1141
|
}
|
|
1126
1142
|
return {
|
|
1127
1143
|
skill,
|
|
@@ -2536,9 +2552,12 @@ async function runBuild(options) {
|
|
|
2536
2552
|
skillDescription = frontmatter.description;
|
|
2537
2553
|
}
|
|
2538
2554
|
}
|
|
2555
|
+
const skillPrefix = `skills/${skill.name}/`;
|
|
2556
|
+
const relativePath = file.path.startsWith(skillPrefix) ? file.path.substring(skillPrefix.length) : path8.basename(file.path);
|
|
2557
|
+
const skillFileType = file.type === "doc" || file.type === "command" ? "reference" : file.type;
|
|
2539
2558
|
skillFiles.push({
|
|
2540
|
-
path:
|
|
2541
|
-
type:
|
|
2559
|
+
path: relativePath,
|
|
2560
|
+
type: skillFileType,
|
|
2542
2561
|
content
|
|
2543
2562
|
});
|
|
2544
2563
|
} else {
|