Fix architecture review findings and align CLI metadata

This commit is contained in:
gitea committed 2026-10-17 20:17:06 +08:00
1 parent 780a4ba9c0
commit 50e4e492b4
83 files changed
+966 -792

No files matched your search

+3 -2
View File
@@ -3,6 +3,7 @@
* reach the CLI intact. Lives in its own module because both the MCP server and the HTTP routes
* need it; importing it from the server entry would make the CLI graph circular.
*/
import { usageError } from "../core/errors.js";
export function tokenizeCommand(command: string): string[] {
const tokens: string[] = [];
let token = "";
@@ -53,8 +54,8 @@ export function tokenizeCommand(command: string): string[] {
tokenStarted = true;
}
if (escaped) throw new Error("Invalid command: trailing escape");
if (quote) throw new Error("Invalid command: unterminated quote");
if (escaped) throw usageError("Invalid command: trailing escape");
if (quote) throw usageError("Invalid command: unterminated quote");
if (tokenStarted) tokens.push(token);
return tokens;
}