@leviyuan/lodestar 0.10.0 → 0.10.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/README.md +1 -1
- package/dist/lodestar-update.js +4 -4
- package/dist/lodestar.js +237 -237
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ npm i -g @leviyuan/lodestar
|
|
|
27
27
|
| `lodestar-setup` | 首次配置向导 |
|
|
28
28
|
| `lodestar-daemon` | 启动 daemon |
|
|
29
29
|
| `lodestar-stop` | 停止 daemon |
|
|
30
|
-
| `lodestar-update` | 升级到最新版(含 Codex CLI)|
|
|
30
|
+
| `lodestar-update` | 升级到最新版(含 Codex CLI、Claude Code 和 Claude SDK)|
|
|
31
31
|
| `lodestar-version` | 查看 Lodestar 和 Codex CLI 版本 |
|
|
32
32
|
|
|
33
33
|
**2. 跑向导**
|
package/dist/lodestar-update.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawn as b}from"node:child_process";import{existsSync as
|
|
3
|
-
`);let
|
|
4
|
-
${s.red}更新失败 (npm exit ${
|
|
5
|
-
${s.green}✓ 更新完成${s.reset}`),
|
|
2
|
+
import{spawn as b}from"node:child_process";import{existsSync as g}from"node:fs";import{homedir as d}from"node:os";import{join as o}from"node:path";var r=d(),n=process.platform==="win32";function a(t,l,m){if(t)return t;if(l)return o(l,"lodestar");return m}function y(){if(n)return o(process.env.APPDATA??o(r,"AppData","Roaming"),"Lodestar");return o(r,".config","lodestar")}function C(){if(n)return o(process.env.LOCALAPPDATA??o(r,"AppData","Local"),"Lodestar");return o(r,".local","share","lodestar")}var u=a(process.env.LODESTAR_CONFIG_DIR,process.env.XDG_CONFIG_HOME,y()),e=a(process.env.LODESTAR_DATA_DIR,process.env.XDG_DATA_HOME,C()),K=process.env.LODESTAR_CONFIG??o(u,"config.toml"),$=o(e,"daemon.pid"),f=o(e,"daemon.log"),S=o(e,"session-chat-map.json"),i=o(e,"session-resume-map.json"),q=o(e,"session-model-map.json"),z=o(e,"tasklist-map.json"),J=o(e,"alive-on-shutdown.json"),Q=o(e,"inbox"),Y=o(e,"debug.sock"),Z=o(e,"debug-context.json");var s={reset:"\x1B[0m",bold:"\x1B[1m",cyan:"\x1B[36m",green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",dim:"\x1B[2m"},p=["@leviyuan/lodestar@latest","@openai/codex@latest","@anthropic-ai/claude-code@latest","@anthropic-ai/claude-agent-sdk@latest","@anthropic-ai/sdk@latest"];function w(){let t=process.platform==="win32"?"npm.cmd":"npm";return new Promise((l)=>{let m=b(t,["install","-g",...p],{stdio:"inherit",shell:process.platform==="win32"});m.on("exit",(c)=>l(c??1)),m.on("error",(c)=>{console.error(`${s.red}spawn npm 失败:${s.reset} ${c.message}`),l(1)})})}async function x(){console.log(`${s.bold}更新 Lodestar + Codex CLI + Claude Code / SDK${s.reset}`),console.log(`${s.dim}npm i -g ${p.join(" ")}${s.reset}
|
|
3
|
+
`);let t=await w();if(t!==0)console.error(`
|
|
4
|
+
${s.red}更新失败 (npm exit ${t})${s.reset}`),process.exit(t);if(console.log(`
|
|
5
|
+
${s.green}✓ 更新完成${s.reset}`),g($))console.log(),console.log(`${s.yellow}检测到 daemon 仍在跑老版本进程, 用新版本需要重启:${s.reset}`),console.log(` ${s.dim}# systemd / Windows 后台托管的:${s.reset}`),console.log(` ${s.cyan}systemctl --user restart lodestar${s.reset} ${s.dim}# Linux/macOS${s.reset}`),console.log(` ${s.dim}# 或手动重启:${s.reset}`),console.log(` ${s.cyan}lodestar-stop && lodestar-daemon${s.reset}`)}x().catch((t)=>{console.error(`${s.red}lodestar-update:${s.reset} ${t?.message??t}`),process.exit(1)});
|