alemonjs-aichat 1.0.17 → 1.0.18

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.
@@ -1,12 +1,14 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import { getConfigValue } from 'alemonjs';
4
5
 
5
6
  // 获取skills/下的文件夹,读取文件夹中的SKILL.md文件,并将其内容解析成对象返回
6
7
  getConfigValue().aiChat || {};
8
+ const currentDir = path.dirname(fileURLToPath(import.meta.url));
7
9
  // 获取技能列表的简介和名称
8
10
  const loadSkills = () => {
9
- const skillsDir = path.join("./skills");
11
+ const skillsDir = path.join(currentDir, "../../skills");
10
12
  const skillFolders = fs.readdirSync(skillsDir).filter((file) => {
11
13
  const skillPath = path.join(skillsDir, file);
12
14
  return fs.statSync(skillPath).isDirectory();
@@ -40,7 +42,7 @@ const loadSkills = () => {
40
42
  };
41
43
  // 获取某个技能的详情, 通过技能名称匹配对应文件夹下的所有md文件,将内容一并返回
42
44
  const loadSkillDetail = (skillName) => {
43
- const skillsDir = path.join(process.cwd(), "src/skills");
45
+ const skillsDir = path.join(currentDir, "../../skills");
44
46
  const skillFolders = fs.readdirSync(skillsDir).filter((file) => {
45
47
  const skillPath = path.join(skillsDir, file);
46
48
  return fs.statSync(skillPath).isDirectory();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs-aichat",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "alemonjs-aichat",
5
5
  "author": "suancaixianyu",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "@aws-sdk/client-s3": "^3.975.0",
55
55
  "@aws-sdk/s3-request-presigner": "^3.975.0",
56
56
  "ai": "^6.0.105",
57
- "alemonjs-aichat": "^1.0.15",
57
+ "alemonjs-aichat": "^1.0.18",
58
58
  "mime-types": "^3.0.2",
59
59
  "openai": "^6.16.0",
60
60
  "sharp": "^0.34.5",