@d5render/cli 0.1.76 → 0.1.77
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.
- package/bin/d5cli +10 -7
- package/package.json +1 -1
package/bin/d5cli
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
10
|
var name$1 = "@d5render/cli";
|
|
11
|
-
var version = "0.1.
|
|
11
|
+
var version = "0.1.77";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region packages/env.ts
|
|
@@ -277,14 +277,17 @@ async function getCopilotUsage(options = {}) {
|
|
|
277
277
|
|
|
278
278
|
//#endregion
|
|
279
279
|
//#region review/copilot/deploy.ts
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
const configDir = dirname(fileURLToPath(import.meta.url));
|
|
281
|
+
/** CI 下写到项目目录(可写);否则用 CLI 所在目录 */
|
|
282
|
+
function getConfigPath() {
|
|
283
|
+
return env.CI && env.CI_PROJECT_DIR ? join(env.CI_PROJECT_DIR, ".codereview-mcp.json") : join(configDir, "copilot-mcp.json");
|
|
284
|
+
}
|
|
284
285
|
/** Windows 用 "@path"(给 shell 引号),Linux 用内联 JSON,避免 @path 写法触发未登录 */
|
|
285
286
|
function getTools() {
|
|
286
|
-
|
|
287
|
+
const configPath = getConfigPath();
|
|
287
288
|
return [
|
|
289
|
+
"--additional-mcp-config",
|
|
290
|
+
platform === "win32" ? `"@${configPath}"` : existsSync(configPath) ? readFileSync(configPath, "utf8") : "{}",
|
|
288
291
|
"--model",
|
|
289
292
|
"claude-opus-4.6",
|
|
290
293
|
"--allow-all-paths",
|
|
@@ -304,7 +307,7 @@ async function deploy() {
|
|
|
304
307
|
const token = await getCopilotUsage();
|
|
305
308
|
env["TOKEN_USAGE"] = String(token);
|
|
306
309
|
console.log("deploy customized config...");
|
|
307
|
-
writeFileSync(
|
|
310
|
+
writeFileSync(getConfigPath(), JSON.stringify({ mcpServers: { [name]: {
|
|
308
311
|
type: "local",
|
|
309
312
|
command: "node",
|
|
310
313
|
args: [serveFile, `--customizenv=${JSON.stringify(envUsed)}`],
|