@simonyea/holysheep-cli 1.2.0 → 1.2.1
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 +1 -1
- package/src/tools/openclaw.js +7 -5
- package/src/utils/shell.js +11 -5
package/package.json
CHANGED
package/src/tools/openclaw.js
CHANGED
|
@@ -59,7 +59,7 @@ module.exports = {
|
|
|
59
59
|
if (!config.agents) config.agents = {}
|
|
60
60
|
if (!config.agents.defaults) config.agents.defaults = {}
|
|
61
61
|
if (!config.agents.defaults.model) {
|
|
62
|
-
config.agents.defaults.model = { primary: 'anthropic/claude-sonnet-4-5' }
|
|
62
|
+
config.agents.defaults.model = { primary: 'anthropic/claude-sonnet-4-5-20250929' }
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// 同时注册一个 holysheep 自定义 provider(支持所有模型)
|
|
@@ -71,10 +71,12 @@ module.exports = {
|
|
|
71
71
|
apiKey,
|
|
72
72
|
api: 'openai-completions',
|
|
73
73
|
models: [
|
|
74
|
-
{ id: 'claude-sonnet-4-5', name: 'Claude Sonnet 4.5 (HolySheep)' },
|
|
75
|
-
{ id: 'claude-
|
|
76
|
-
{ id: '
|
|
77
|
-
{ id: '
|
|
74
|
+
{ id: 'claude-sonnet-4-5-20250929', name: 'Claude Sonnet 4.5 (HolySheep)' },
|
|
75
|
+
{ id: 'claude-sonnet-4-20250514', name: 'Claude Sonnet 4 (HolySheep)' },
|
|
76
|
+
{ id: 'claude-opus-4-5-20251101', name: 'Claude Opus 4.5 (HolySheep)' },
|
|
77
|
+
{ id: 'claude-opus-4-20250514', name: 'Claude Opus 4 (HolySheep)' },
|
|
78
|
+
{ id: 'gpt-4o', name: 'GPT-4o (HolySheep)' },
|
|
79
|
+
{ id: 'gemini-2.5-pro', name: 'Gemini 2.5 Pro (HolySheep)' },
|
|
78
80
|
],
|
|
79
81
|
}
|
|
80
82
|
|
package/src/utils/shell.js
CHANGED
|
@@ -41,26 +41,31 @@ function removeHsBlock(content) {
|
|
|
41
41
|
return content.replace(re, '')
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function buildEnvBlock(envVars) {
|
|
44
|
+
function buildEnvBlock(envVars, isFish = false) {
|
|
45
45
|
const lines = [MARKER_START]
|
|
46
46
|
for (const [k, v] of Object.entries(envVars)) {
|
|
47
|
-
|
|
47
|
+
// fish shell 用 set -gx,其他 shell 用 export
|
|
48
|
+
lines.push(isFish ? `set -gx ${k} "${v}"` : `export ${k}="${v}"`)
|
|
48
49
|
}
|
|
49
50
|
lines.push(MARKER_END)
|
|
50
51
|
return '\n' + lines.join('\n') + '\n'
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function writeEnvToShell(envVars) {
|
|
54
|
-
// Windows: 用 setx
|
|
55
|
+
// Windows: 用 setx 写入用户级环境变量(需重启终端生效)
|
|
55
56
|
if (process.platform === 'win32') {
|
|
56
57
|
const { execSync } = require('child_process')
|
|
57
58
|
const written = []
|
|
58
59
|
for (const [k, v] of Object.entries(envVars)) {
|
|
59
60
|
try {
|
|
60
61
|
execSync(`setx ${k} "${v}"`, { stdio: 'ignore' })
|
|
61
|
-
written.push(`[
|
|
62
|
+
written.push(`[系统环境变量] ${k}`)
|
|
62
63
|
} catch {}
|
|
63
64
|
}
|
|
65
|
+
if (written.length > 0) {
|
|
66
|
+
const chalk = require('chalk')
|
|
67
|
+
console.log(chalk.yellow('\n ⚠️ Windows 环境变量已写入,需要重启终端后生效'))
|
|
68
|
+
}
|
|
64
69
|
return written
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -71,7 +76,8 @@ function writeEnvToShell(envVars) {
|
|
|
71
76
|
let content = ''
|
|
72
77
|
try { content = fs.readFileSync(file, 'utf8') } catch {}
|
|
73
78
|
content = removeHsBlock(content)
|
|
74
|
-
|
|
79
|
+
const isFish = file.endsWith('config.fish')
|
|
80
|
+
content += buildEnvBlock(envVars, isFish)
|
|
75
81
|
fs.writeFileSync(file, content, 'utf8')
|
|
76
82
|
written.push(file)
|
|
77
83
|
}
|