@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.
- package/dist/commands/install.js +45 -1
- package/dist/products/index.js +9 -9
- package/package.json +1 -1
- package/skills/flink-flight-api/{flink-openapi-integration/SKILL.md → SKILL.md} +3 -3
- package/skills/flink-flight-api/agents/openai.yaml +4 -0
- package/skills/glink-hotel-api/{glink-openapi-integration/SKILL.md → SKILL.md} +3 -3
- package/skills/glink-hotel-api/agents/openai.yaml +4 -0
- package/skills/flink-flight-api/flink-openapi-integration/agents/openai.yaml +0 -4
- package/skills/glink-hotel-api/glink-openapi-integration/agents/openai.yaml +0 -4
- /package/skills/flink-flight-api/{flink-openapi-integration/references → references}/api-workflows.md +0 -0
- /package/skills/flink-flight-api/{flink-openapi-integration/references → references}/auth-and-credentials.md +0 -0
- /package/skills/flink-flight-api/{flink-openapi-integration/references → references}/endpoint-index.md +0 -0
- /package/skills/flink-flight-api/{flink-openapi-integration/scripts → scripts}/flink_signed_request.py +0 -0
- /package/skills/glink-hotel-api/{glink-openapi-integration/references → references}/api-workflows.md +0 -0
- /package/skills/glink-hotel-api/{glink-openapi-integration/references → references}/auth-and-credentials.md +0 -0
- /package/skills/glink-hotel-api/{glink-openapi-integration/references → references}/endpoint-index.md +0 -0
- /package/skills/glink-hotel-api/{glink-openapi-integration/scripts → scripts}/glink_signed_request.py +0 -0
package/dist/commands/install.js
CHANGED
|
@@ -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
|
|
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
|
+
}
|
package/dist/products/index.js
CHANGED
|
@@ -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/
|
|
6
|
-
skillDir: "skills/glink-hotel-api
|
|
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/
|
|
12
|
-
skillDir: "skills/flink-flight-api
|
|
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,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: flink-
|
|
3
|
-
description: Integrate with the Flink flight OpenAPI exposed through the Open Platform runtime gateway. Use when
|
|
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
|
|
6
|
+
# Flink Flight API Skill
|
|
7
7
|
|
|
8
8
|
## Quick Start
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: glink-
|
|
3
|
-
description: Integrate with the Glink hotel OpenAPI exposed through the Open Platform runtime gateway. Use when
|
|
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
|
|
6
|
+
# Glink Hotel API Skill
|
|
7
7
|
|
|
8
8
|
## Quick Start
|
|
9
9
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/skills/glink-hotel-api/{glink-openapi-integration/references → references}/api-workflows.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|