fix(daemon): use bin/chatlab.mjs as launchd/systemd entry point

dist/cli.mjs 只导出 run() 而不调用它,直接运行会立即静默退出(exit 0)。
bin/chatlab.mjs 才是真正调用 run() 的可执行入口,与 npm bin 字段一致。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
diguaandClaude Sonnet 4.6 committed 2026-05-31 16:56:08 +08:00
1 parent 8c98daa654
commit b01c6c7e7a
1 file changed
+2 -2
+2 -2
View File
@@ -70,7 +70,7 @@ export interface ServiceStatus {
function buildPlist(options: ServiceInstallOptions): string {
const port = options.port ?? 3110
const host = options.host ?? '127.0.0.1'
const cliEntry = resolveCliPath('dist/cli.mjs')
const cliEntry = resolveCliPath('bin/chatlab.mjs')
const args = ['start', '--no-open', '--port', String(port), '--host', host]
if (options.token) args.push('--token', options.token)
if (options.headless) args.push('--headless')
@@ -191,7 +191,7 @@ function escapeSystemdArg(arg: string): string {
function buildUnit(options: ServiceInstallOptions): string {
const port = options.port ?? 3110
const host = options.host ?? '127.0.0.1'
const cliEntry = resolveCliPath('dist/cli.mjs')
const cliEntry = resolveCliPath('bin/chatlab.mjs')
const args = ['start', '--no-open', '--port', String(port), '--host', host]
if (options.token) args.push('--token', options.token)
if (options.headless) args.push('--headless')