@opencangjie/skills 0.0.38 → 0.0.40

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @opencangjie/skills
1
+ # @opencangjie/skills
2
2
 
3
3
  JavaScript/TypeScript SDK for AgentSkills Runtime - Install, manage, and execute AI agent skills with built-in runtime support.
4
4
 
@@ -40,8 +40,10 @@ npx skills install-runtime --runtime-version 0.0.16
40
40
  Before starting the runtime, you need to configure the AI model API key. The runtime requires an AI model to process skill execution and natural language understanding.
41
41
 
42
42
  Edit the `.env` file in the runtime directory:
43
- - **Windows**: `%USERPROFILE%\.agentskills-runtime\release\.env`
44
- - **macOS/Linux**: `~/.agentskills-runtime/release/.env`
43
+ - **Windows**: `%USERPROFILE%\.agentskills-runtime\<platform>-<arch>\release\.env`
44
+ - **macOS/Linux**: `~/.agentskills-runtime/<platform>-<arch>/release/.env`
45
+
46
+ Where `<platform>-<arch>` is your system architecture, e.g., `win-x64`, `darwin-x64`, or `linux-x64`
45
47
 
46
48
  Add your AI model configuration (choose one provider):
47
49
 
package/README_cn.md CHANGED
@@ -1,4 +1,4 @@
1
- # @opencangjie/skills
1
+ # @opencangjie/skills
2
2
 
3
3
  AgentSkills Runtime 的 JavaScript/TypeScript SDK - 安装、管理和执行 AI 代理技能,内置运行时支持。
4
4
 
@@ -40,8 +40,10 @@ npx skills install-runtime --runtime-version 0.0.16
40
40
  在启动运行时之前,您需要配置 AI 模型 API 密钥。运行时需要 AI 模型来处理技能执行和自然语言理解。
41
41
 
42
42
  编辑运行时目录中的 `.env` 文件:
43
- - **Windows**: `%USERPROFILE%\.agentskills-runtime\release\.env`
44
- - **macOS/Linux**: `~/.agentskills-runtime/release/.env`
43
+ - **Windows**: `%USERPROFILE%\.agentskills-runtime\<platform>-<arch>\release\.env`
44
+ - **macOS/Linux**: `~/.agentskills-runtime/<platform>-<arch>/release/.env`
45
+
46
+ 其中 `<platform>-<arch>` 是您的系统架构,例如 `win-x64`、`darwin-x64` 或 `linux-x64`
45
47
 
46
48
  添加您的 AI 模型配置(选择一个提供商):
47
49
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencangjie/skills",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "description": "JavaScript/TypeScript SDK for AgentSkills Runtime - Install, manage, and execute AI agent skills with built-in runtime support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -89,7 +89,7 @@
89
89
  }
90
90
  },
91
91
  "runtime": {
92
- "version": "0.0.16",
92
+ "version": "0.0.18",
93
93
  "downloadUrl": "https://atomgit.com/UCToo/agentskills-runtime/releases",
94
94
  "platforms": {
95
95
  "win32-x64": "agentskills-runtime-win-x64.tar.gz",
@@ -53,7 +53,8 @@ function getPlatform() {
53
53
  }
54
54
 
55
55
  function getRuntimeDir() {
56
- return path.join(__dirname, '..', 'runtime');
56
+ const homeDir = os.homedir();
57
+ return path.join(homeDir, '.agentskills-runtime');
57
58
  }
58
59
 
59
60
  function getRuntimePath() {
@@ -142,6 +143,27 @@ async function downloadRuntime(version = RUNTIME_VERSION) {
142
143
  fs.chmodSync(runtimePath, '755');
143
144
  }
144
145
 
146
+ // Handle .env file - preserve existing configuration
147
+ const releaseDir = getRuntimeWorkingDir();
148
+ const envFile = path.join(releaseDir, '.env');
149
+ const envExampleFile = path.join(releaseDir, '.env.example');
150
+
151
+ if (!fs.existsSync(envFile) && fs.existsSync(envExampleFile)) {
152
+ fs.copyFileSync(envExampleFile, envFile);
153
+ console.log('Created .env file from .env.example');
154
+ } else if (!fs.existsSync(envFile)) {
155
+ const defaultEnvContent = `# AgentSkills Runtime Configuration
156
+ # This file was auto-generated. Edit as needed.
157
+
158
+ # Skill Installation Path
159
+ SKILL_INSTALL_PATH=./skills
160
+ `;
161
+ fs.writeFileSync(envFile, defaultEnvContent);
162
+ console.log('Created default .env file');
163
+ } else {
164
+ console.log('Preserved existing .env file');
165
+ }
166
+
145
167
  console.log(`AgentSkills Runtime v${version} downloaded successfully from ${mirror.name}!`);
146
168
  return true;
147
169
  } catch (error) {