@mongoui/skills 0.1.6 → 0.1.7

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.
@@ -64,7 +64,10 @@ export async function runInstall(productName, options) {
64
64
  }
65
65
  await fs.access(sourceSkillFile);
66
66
  const sourceSkillContent = await fs.readFile(sourceSkillFile, "utf8");
67
- const targetSkillContent = renderInstalledContent(installTarget.tool, product.name, product.displayName, sourceSkillContent);
67
+ const bundledSkillContent = sourceSkillDir
68
+ ? await buildBundledSkillContent(sourceSkillDir, sourceSkillContent)
69
+ : sourceSkillContent;
70
+ const targetSkillContent = renderInstalledContent(installTarget.tool, product.name, product.displayName, bundledSkillContent);
68
71
  await fs.writeFile(targetSkillFile, targetSkillContent, "utf8");
69
72
  console.log("Installed skill:");
70
73
  console.log("- command: install");
@@ -135,3 +138,44 @@ async function copyDirectory(sourceDir, targetDir) {
135
138
  await fs.copyFile(sourcePath, targetPath);
136
139
  }
137
140
  }
141
+ async function buildBundledSkillContent(sourceSkillDir, sourceSkillContent) {
142
+ const referencesDir = path.join(sourceSkillDir, "references");
143
+ const scriptsDir = path.join(sourceSkillDir, "scripts");
144
+ const referenceSections = await readBundledFiles(referencesDir, "markdown");
145
+ const scriptSections = await readBundledFiles(scriptsDir, "code");
146
+ const sections = [sourceSkillContent.trim()];
147
+ if (referenceSections.length > 0) {
148
+ sections.push("## Bundled References", ...referenceSections);
149
+ }
150
+ if (scriptSections.length > 0) {
151
+ sections.push("## Bundled Scripts", ...scriptSections);
152
+ }
153
+ return `${sections.join("\n\n")}\n`;
154
+ }
155
+ async function readBundledFiles(dirPath, mode) {
156
+ try {
157
+ const entries = await fs.readdir(dirPath, { withFileTypes: true });
158
+ const files = entries
159
+ .filter((entry) => entry.isFile())
160
+ .map((entry) => entry.name)
161
+ .sort((left, right) => left.localeCompare(right));
162
+ const sections = [];
163
+ for (const fileName of files) {
164
+ const filePath = path.join(dirPath, fileName);
165
+ const fileContent = await fs.readFile(filePath, "utf8");
166
+ if (mode === "markdown") {
167
+ sections.push(`### ${fileName}\n\n${fileContent.trim()}`);
168
+ continue;
169
+ }
170
+ const language = path.extname(fileName).replace(/^\./, "") || "text";
171
+ sections.push(`### ${fileName}\n\n\`\`\`${language}\n${fileContent.trim()}\n\`\`\``);
172
+ }
173
+ return sections;
174
+ }
175
+ catch (error) {
176
+ if (error.code === "ENOENT") {
177
+ return [];
178
+ }
179
+ throw error;
180
+ }
181
+ }
@@ -2,20 +2,20 @@ const PRODUCTS = {
2
2
  "glink-hotel-api": {
3
3
  name: "glink-hotel-api",
4
4
  displayName: "Glink Hotel API",
5
- skillFile: "skills/glink-hotel-api/glink-openapi-integration/SKILL.md",
6
- skillDir: "skills/glink-hotel-api/glink-openapi-integration",
5
+ skillFile: "skills/glink-hotel-api/SKILL.md",
6
+ skillDir: "skills/glink-hotel-api",
7
7
  },
8
8
  "flink-flight-api": {
9
9
  name: "flink-flight-api",
10
10
  displayName: "Flink Flight API",
11
- skillFile: "skills/flink-flight-api/flink-openapi-integration/SKILL.md",
12
- skillDir: "skills/flink-flight-api/flink-openapi-integration",
13
- },
14
- "tmc-whitelabel": {
15
- name: "tmc-whitelabel",
16
- displayName: "TMC Whitelabel",
17
- skillFile: "skills/tmc-whitelabel/SKILL.md",
11
+ skillFile: "skills/flink-flight-api/SKILL.md",
12
+ skillDir: "skills/flink-flight-api",
18
13
  },
14
+ // "tmc-whitelabel": {
15
+ // name: "tmc-whitelabel",
16
+ // displayName: "TMC Whitelabel",
17
+ // skillFile: "skills/tmc-whitelabel/SKILL.md",
18
+ // },
19
19
  };
20
20
  export function getProduct(productName) {
21
21
  return PRODUCTS[productName];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongoui/skills",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "CLI for installing product skills into AI tools",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: flink-openapi-integration
3
- description: Integrate with the Flink flight OpenAPI exposed through the Open Platform runtime gateway. Use when Codex needs to read, verify, explain, test, or implement against `docs/swagger/flink-api.json` or Flink route code; choose Flink ticket endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or drive Chinese/English requests about Flink 机票 search, booking, payment, order detail, change, refund, airport, airline, nationality, and fields workflows.
2
+ name: flink-flight-api
3
+ description: Integrate with the Flink flight OpenAPI exposed through the Open Platform runtime gateway. Use when an AI coding assistant needs to read, verify, explain, test, or implement against `docs/swagger/flink-api.json` or Flink route code; choose Flink ticket endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or handle Chinese/English requests about Flink 机票 search, booking, payment, order detail, change, refund, airport, airline, nationality, and fields workflows.
4
4
  ---
5
5
 
6
- # Flink OpenAPI Integration
6
+ # Flink Flight API Skill
7
7
 
8
8
  ## Quick Start
9
9
 
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Flink OpenAPI 接入"
3
+ short_description: "Flink 机票开放接口鉴权、签名和业务调用"
4
+ default_prompt: "Use $flink-flight-api to implement or debug Flink flight OpenAPI auth, signatures, endpoint selection, and order workflows."
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: glink-openapi-integration
3
- description: Integrate with the Glink hotel OpenAPI exposed through the Open Platform runtime gateway. Use when Codex needs to read, verify, explain, test, or implement against `docs/swagger/glink-api.json` or Glink route code; choose Glink hotel endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or drive Chinese/English requests about Glink 酒店 static data, hotel search, hotel info, product detail, booking, payment, order, cancel, order status push/callback, checkout, invoice, and balance workflows.
2
+ name: glink-hotel-api
3
+ description: Integrate with the Glink hotel OpenAPI exposed through the Open Platform runtime gateway. Use when an AI coding assistant needs to read, verify, explain, test, or implement against `docs/swagger/glink-api.json` or Glink route code; choose Glink hotel endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or handle Chinese/English requests about Glink 酒店 static data, hotel search, hotel info, product detail, booking, payment, order, cancel, order status push/callback, checkout, invoice, and balance workflows.
4
4
  ---
5
5
 
6
- # Glink OpenAPI Integration
6
+ # Glink Hotel API Skill
7
7
 
8
8
  ## Quick Start
9
9
 
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Glink OpenAPI 接入"
3
+ short_description: "Glink 酒店开放接口鉴权、签名和业务调用"
4
+ default_prompt: "Use $glink-hotel-api to implement or debug Glink hotel OpenAPI auth, signatures, endpoint selection, and order workflows."
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Flink OpenAPI 接入"
3
- short_description: "Flink 机票开放接口鉴权、签名和业务调用"
4
- default_prompt: "Use $flink-openapi-integration to implement or debug Flink flight OpenAPI auth, signatures, endpoint selection, and order workflows."
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Glink OpenAPI 接入"
3
- short_description: "Glink 酒店开放接口鉴权、签名和业务调用"
4
- default_prompt: "Use $glink-openapi-integration to implement or debug Glink hotel OpenAPI auth, signatures, endpoint selection, and order workflows."