@baryonlabs/cli 0.3.5 → 0.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/commands.js +23 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baryonlabs/cli",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Baryon CLI — AI 코딩·학습 에이전트. baryon.ai API에 기본 연결된 pi 코딩 에이전트 래퍼. 한 줄 설치, 상용·로컬 모델 전환.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/commands.js CHANGED
@@ -246,17 +246,32 @@ export function keys() {
246
246
 
247
247
  export function update() {
248
248
  return new Promise((resolve) => {
249
- log(` ${sym.info} 업데이트: ${c.lime(`npm install -g @baryonlabs/cli ${PI_PACKAGE}`)}\n`);
250
- const child = spawn(
251
- "npm",
252
- ["install", "-g", "@baryonlabs/cli", PI_PACKAGE],
253
- { stdio: "inherit", shell: process.platform === "win32" },
254
- );
255
- child.on("exit", (code) => resolve(code ?? 0));
256
- child.on("error", () => {
249
+ // 1/2 — CLI + pi core via npm (gets the latest pi binary, e.g. 0.80.x).
250
+ log(` ${sym.info} 1/2 CLI·코어 업데이트: ${c.lime(`npm install -g @baryonlabs/cli ${PI_PACKAGE}`)}\n`);
251
+ const npm = spawn("npm", ["install", "-g", "@baryonlabs/cli", PI_PACKAGE], {
252
+ stdio: "inherit",
253
+ shell: process.platform === "win32",
254
+ });
255
+
256
+ npm.on("error", () => {
257
257
  err("npm 실행 실패 — 수동으로 위 명령을 실행하세요.");
258
258
  resolve(1);
259
259
  });
260
+
261
+ npm.on("exit", (code) => {
262
+ // 2/2 — pi's own packages (pi-mcp-adapter, pi-dynamic-workflows, …) are
263
+ // managed by `pi update`, not npm. Run it so those notices clear too.
264
+ const entry = resolvePiEntry();
265
+ if (!entry) return resolve(code ?? 0);
266
+
267
+ log(`\n ${sym.info} 2/2 pi 패키지 업데이트: ${c.lime("pi update")}\n`);
268
+ const pu = spawn(process.execPath, [entry, "update"], { stdio: "inherit" });
269
+ pu.on("error", () => resolve(code ?? 0));
270
+ pu.on("exit", () => {
271
+ log(`\n ${sym.ok} 업데이트 완료. ${c.dim("baryon doctor 로 점검 가능")}`);
272
+ resolve(code ?? 0);
273
+ });
274
+ });
260
275
  });
261
276
  }
262
277