@opentiny/next-sdk 0.2.5 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/next-sdk",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "homepage": "https://docs.opentiny.design/next-sdk/guide/",
6
6
  "repository": {
package/skills/index.ts CHANGED
@@ -80,14 +80,14 @@ export function formatSkillsForSystemPrompt(skills: SkillMeta[]): string {
80
80
  }
81
81
 
82
82
  /**
83
- * 获取所有已加载的 md 文件路径(含主 SKILL.md 与 reference 等)
83
+ * 获取所有已加载的技能文件路径(含主 SKILL.md 与 reference 下的 .md/.json/.xml 等)
84
84
  */
85
85
  export function getSkillMdPaths(modules: Record<string, string>): string[] {
86
86
  return Object.keys(modules)
87
87
  }
88
88
 
89
89
  /**
90
- * 根据相对路径获取某个 md 文档的原始内容
90
+ * 根据相对路径获取某个技能文档的原始内容(支持 .md、.json、.xml 等文本格式)
91
91
  */
92
92
  export function getSkillMdContent(modules: Record<string, string>, path: string): string | undefined {
93
93
  return modules[path]
@@ -114,10 +114,10 @@ export type SkillToolsSet = Record<string, any>
114
114
  export function createSkillTools(modules: Record<string, string>): SkillToolsSet {
115
115
  const getSkillContent = tool({
116
116
  description:
117
- '根据技能名称或文档路径获取该技能的完整 Markdown 文档内容。传入 skillName(如 calculator)或 path(如 ./calculator/SKILL.md',
117
+ '根据技能名称或文档路径获取该技能的完整文档内容。传入 skillName(如 calculator)或 path(如 ./calculator/SKILL.md)。支持 .md、.json、.xml 等各类文本格式文件。',
118
118
  inputSchema: z.object({
119
119
  skillName: z.string().optional().describe('技能名称,与目录名一致,如 calculator'),
120
- path: z.string().optional().describe('文档相对路径,如 ./calculator/SKILL.md 或 ./product-guide/reference/xxx.md')
120
+ path: z.string().optional().describe('文档相对路径,如 ./calculator/SKILL.md 或 ./product-guide/reference/xxx.json')
121
121
  }),
122
122
  execute: (args: { skillName?: string; path?: string }) => {
123
123
  const { skillName, path: pathArg } = args