skillmkt 0.4.29 → 0.4.31

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.
@@ -3,7 +3,7 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import http from 'node:http';
5
5
  import crypto from 'node:crypto';
6
- import { daemonFile, readDaemon } from '../lib/daemon.js';
6
+ import { daemonFile, readDaemon, openURL } from '../lib/daemon.js';
7
7
  import { loadConflicts } from '../lib/conflicts.js';
8
8
  import { loadDecisions, decide } from '../lib/decide.js';
9
9
  import { readLibrary, readLock, readConfig, writeConfig, registerSkill, updateLock, ensureHub, isInitialized } from '../lib/hub.js';
@@ -213,12 +213,18 @@ export async function run(ctx) {
213
213
  // 已有前台/分离实例在跑 → 不重复起,报地址
214
214
  const existing = readDaemon(ctx.hub);
215
215
  if (existing && existing.pid !== process.pid) {
216
- try { process.kill(existing.pid, 0); info(L(`已在跑: http://127.0.0.1:${existing.port}/?token=${existing.token}(--stop 停掉)`, `already running: http://127.0.0.1:${existing.port}/?token=${existing.token} (use --stop to stop)`)); return 0; } catch { /* stale */ }
216
+ try {
217
+ process.kill(existing.pid, 0);
218
+ info(L(`已在跑: http://127.0.0.1:${existing.port}/?token=${existing.token}(--stop 停掉)`, `already running: http://127.0.0.1:${existing.port}/?token=${existing.token} (use --stop to stop)`));
219
+ if (ctx.tty && !flags.daemon) openURL(existing, '/');
220
+ return 0;
221
+ } catch { /* stale */ }
217
222
  }
218
223
  const d = await startServer(ctx, { quiet: !!flags.daemon, port: flags.port || 0 });
219
224
  if (flags.daemon) { console.log(`daemon ready :${d.port}`); await new Promise(() => {}); }
220
225
  console.log(`serve: http://127.0.0.1:${d.port}/?token=${d.token}`);
221
226
  console.log(L(` 前台运行 — Ctrl-C 退出(idle ${ctx.config.daemon?.idle_minutes ?? 30}m 自退)`, ` running in foreground — Ctrl-C to exit (idle ${ctx.config.daemon?.idle_minutes ?? 30}m auto-stop)`));
227
+ if (ctx.tty) openURL(d, '/'); // TTY 起服务自动开浏览器;脚本/--daemon 不开
222
228
  await new Promise(() => {});
223
229
  return 0;
224
230
  }
@@ -62,6 +62,7 @@ export function dashboard({ hub, library, scan, upstream, conflicts, llm, llmVia
62
62
  ? L('skillmkt init 把设置写进 config.yml(现在全靠环境变量兜底)', 'skillmkt init write settings to config.yml (currently env-only)')
63
63
  : L('skillmkt init 初始化设置(语言/模型/目标 agent)', 'skillmkt init set up language/model/agents'));
64
64
  hints.push(L('skillmkt list 列出所有 skill 及各自安装位置', 'skillmkt list list all skills and where they are installed'));
65
+ hints.push(L('skillmkt serve 启动 Web 面板(可视化操作)', 'skillmkt serve start the web UI server'));
65
66
  hints.push(L('skillmkt --help 全部命令', 'skillmkt --help all commands'));
66
- hints.slice(0, 4).forEach((h) => err(h));
67
+ hints.slice(0, 6).forEach((h) => err(h));
67
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillmkt",
3
- "version": "0.4.29",
3
+ "version": "0.4.31",
4
4
  "type": "module",
5
5
  "description": "Local-first agent skill manager: install, audit, merge, distribute.",
6
6
  "license": "MIT",