From 648fe7ad339519d3e58dbbfd62e0a127d79f3443 Mon Sep 17 00:00:00 2001 From: xiongxiao Date: Tue, 17 Mar 2026 20:46:13 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E8=87=B3=200.1.3=EF=BC=8C=E5=B9=B6=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=20@opencode-ai/plugin=20=E5=92=8C=20nanoid=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=8C=E5=A2=9E=E5=BC=BA=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=A7=A3=E6=9E=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/commander.ts | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a5f8f87..133375c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "@kevisual/router", - "version": "0.1.2", + "version": "0.1.3", "description": "", "type": "module", "main": "./dist/router.js", @@ -30,7 +30,7 @@ "@kevisual/query": "^0.0.53", "@kevisual/remote-app": "^0.0.7", "@kevisual/use-config": "^1.0.30", - "@opencode-ai/plugin": "^1.2.26", + "@opencode-ai/plugin": "^1.2.27", "@types/bun": "^1.3.10", "@types/crypto-js": "^4.2.2", "@types/node": "^25.5.0", @@ -43,7 +43,7 @@ "eventemitter3": "^5.0.4", "fast-glob": "^3.3.3", "hono": "^4.12.8", - "nanoid": "^5.1.6", + "nanoid": "^5.1.7", "path-to-regexp": "^8.3.0", "send": "^1.2.1", "typescript": "^5.9.3", diff --git a/src/commander.ts b/src/commander.ts index 21c33fb..281694e 100644 --- a/src/commander.ts +++ b/src/commander.ts @@ -124,9 +124,10 @@ export const parse = async (opts: { token?: string, username?: string, id?: string, - } + }, + exitOnEnd?: boolean, }) => { - const { description, parse = true, version } = opts; + const { description, parse = true, version, exitOnEnd = true } = opts; const app = opts.app as App; const _program = opts.program || program; _program.description(description || 'Router 命令行工具'); @@ -167,9 +168,12 @@ export const parse = async (opts: { remoteApp.listenProxy(); console.log('已连接到远程应用,正在监听命令...'); } - return + return; } if (parse) { - _program.parse(process.argv); + await _program.parseAsync(process.argv); + if (exitOnEnd) { + process.exit(0); + } } } \ No newline at end of file