mu-agent 0.1.8 → 0.1.10
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/CHANGELOG.md +27 -0
- package/README.md +34 -30
- package/dist/bundle/chunks/anthropic-messages-4PAJY4R6.js +6 -0
- package/dist/bundle/chunks/anthropic.js +1 -1
- package/dist/bundle/chunks/azure-openai-responses-Y4BBWQ3N.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +12 -9
- package/dist/bundle/chunks/{chunk-TRDNDS6A.js → chunk-3V45WARH.js} +6 -3
- package/dist/bundle/chunks/{chunk-S3GGRYIO.js → chunk-5AGIVGSV.js} +1 -1
- package/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
- package/dist/bundle/chunks/{chunk-F5ZABL6Z.js → chunk-7CBJINYJ.js} +2 -2
- package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-7DDKXS2Q.js} +1 -1
- package/dist/bundle/chunks/chunk-BSS6T6KQ.js +2 -0
- package/dist/bundle/chunks/{chunk-H3QXYIF7.js → chunk-CF5GWZHW.js} +1 -1
- package/dist/bundle/chunks/{chunk-4OBXYPH4.js → chunk-DNNHZBQR.js} +1 -1
- package/dist/bundle/chunks/chunk-FN6OEZYR.js +2 -0
- package/dist/bundle/chunks/chunk-FTJT2X6E.js +2 -0
- package/dist/bundle/chunks/chunk-HZNN636Z.js +130 -0
- package/dist/bundle/chunks/{chunk-4L3WN2XY.js → chunk-JXWJOIH4.js} +1 -1
- package/dist/bundle/chunks/{chunk-TAOL3JFA.js → chunk-KIDDRTZP.js} +4 -4
- package/dist/bundle/chunks/chunk-LMNWTX2L.js +11 -0
- package/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
- package/dist/bundle/chunks/{chunk-6CYCI3EJ.js → chunk-LVVZS2NO.js} +1 -1
- package/dist/bundle/chunks/chunk-NN4BEPYX.js +2 -0
- package/dist/bundle/chunks/{chunk-NG4PO5FP.js → chunk-O7IPTASE.js} +120 -103
- package/dist/bundle/chunks/{chunk-LD2P6SFZ.js → chunk-PMRZO46Y.js} +1 -1
- package/dist/bundle/chunks/chunk-QOEEJKS4.js +9 -0
- package/dist/bundle/chunks/chunk-R4VPBBDS.js +2 -0
- package/dist/bundle/chunks/{chunk-NTSWBG4X.js → chunk-RAQ6TU76.js} +1 -1
- package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
- package/dist/bundle/chunks/chunk-SGOTYFMT.js +91 -0
- package/dist/bundle/chunks/chunk-TMTOQ7H7.js +2 -0
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +2 -0
- package/dist/bundle/chunks/chunk-VJLOQZKR.js +9 -0
- package/dist/bundle/chunks/chunk-WCGU75WO.js +11 -0
- package/dist/bundle/chunks/{chunk-RLZVFGW4.js → chunk-X234222Q.js} +29 -92
- package/dist/bundle/chunks/{cli-AOVD3SSZ.js → cli-722OL3K5.js} +4 -4
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MEZHQVNP.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +117 -13
- package/dist/bundle/chunks/easter-egg-3d-6H34EDGX.js +2 -0
- package/dist/bundle/chunks/execute-KVSEIDWL.js +499 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-XMFHGQC5.js → google-generative-ai-D2VJQBTK.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-4XRRNP74.js → google-vertex-SQG2BO6C.js} +1 -1
- package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{jiti-loader-C3NU2SDH.js → jiti-loader-GL4HJFAD.js} +1 -1
- package/dist/bundle/chunks/{jiti-static-loader-E6ANQD5T.js → jiti-static-loader-2RCDI6B4.js} +1 -1
- package/dist/bundle/chunks/{lib-TEDK3E5I.js → lib-4AVRLBHM.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-XT44PI3C.js → llama-cpp-classify-5YHLY3RC.js} +2 -2
- package/dist/bundle/chunks/mistral-conversations-BDARVJTT.js +5 -0
- package/dist/bundle/chunks/{multipart-parser-SQ6GDJL7.js → multipart-parser-FMGQ7342.js} +1 -1
- package/dist/bundle/chunks/{node-TWVVAGPO.js → node-AUOGOBCN.js} +1 -1
- package/dist/bundle/chunks/{node-N5BSDOA5.js → node-KCMANYC2.js} +1 -1
- package/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/dist/bundle/chunks/openai-codex-responses-CECGTDYD.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/openai-completions-UOA7MELD.js +7 -0
- package/dist/bundle/chunks/openai-decisions-HLM372N6.js +5 -0
- package/dist/bundle/chunks/openai-responses-TII7ZY5X.js +3 -0
- package/dist/bundle/chunks/{openrouter-images-ZVXWCSIM.js → openrouter-images-7T452AS5.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-TM5SOOIW.js → pi-messages-2UDKLKOO.js} +1 -1
- package/dist/bundle/chunks/runtime-O3ELDOM7.js +2 -0
- package/dist/bundle/chunks/{src-UK77SYZE.js → src-QKGKDFSU.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-KNCICMO5.js +2 -0
- package/dist/bundle/chunks/virtual-modules-IKEARUOZ.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/core/export-html/template.js +21 -16
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts +13 -16
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +22 -29
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/docs/cli-integration.md +1 -1
- package/docs/cli.md +22 -10
- package/docs/codemode.md +29 -6
- package/docs/compaction.md +5 -5
- package/docs/custom-provider.md +53 -1
- package/docs/docs.json +8 -0
- package/docs/environment-variables.md +3 -1
- package/docs/extensions.md +122 -13
- package/docs/json.md +3 -3
- package/docs/keybindings.md +5 -4
- package/docs/llama-cpp.md +9 -2
- package/docs/mcp.md +4 -2
- package/docs/message-types.md +22 -4
- package/docs/models-configuration.md +187 -0
- package/docs/models.md +18 -2
- package/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/docs/providers.md +47 -0
- package/docs/sessions.md +1 -1
- package/docs/settings.md +8 -5
- package/docs/terminal-setup.md +14 -0
- package/docs/themes.md +4 -2
- package/docs/tui.md +71 -1
- package/docs/usage.md +1 -1
- package/examples/README.md +0 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/minimal-mode.ts +4 -5
- package/examples/extensions/overlay-test.ts +2 -2
- package/examples/extensions/plan-mode/index.ts +6 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/index.ts +4 -6
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/judge/dist/auth.js +41 -10
- package/judge/dist/import.js +26 -21
- package/judge/dist/setup.js +124 -120
- package/judge/manifest.json +630 -250
- package/judge/{dist/kyrn-judge.js → mu/index.js} +1393 -545
- package/judge/themes/mu-dark.json +80 -0
- package/judge/themes/mu-light.json +80 -0
- package/kyrn/bin/kyrn-doctor +17 -17
- package/kyrn/bin/kyrn-judge-local +2 -2
- package/kyrn/bin/kyrn-ledger +1 -1
- package/kyrn/bin/mu.mjs +74 -47
- package/package.json +4 -5
- package/dist/bundle/chunks/anthropic-messages-MI4QHRXW.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-E3QGN4VN.js +0 -2
- package/dist/bundle/chunks/chunk-33KL6IIQ.js +0 -20
- package/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
- package/dist/bundle/chunks/chunk-C47CLQZK.js +0 -2
- package/dist/bundle/chunks/chunk-HQHD6PZI.js +0 -2
- package/dist/bundle/chunks/chunk-KJUDFE6Y.js +0 -11
- package/dist/bundle/chunks/chunk-TE3GUV6H.js +0 -9
- package/dist/bundle/chunks/chunk-VIV3CWXG.js +0 -2
- package/dist/bundle/chunks/chunk-WE4MXUQS.js +0 -11
- package/dist/bundle/chunks/chunk-Y2PP32XV.js +0 -2
- package/dist/bundle/chunks/chunk-YLY6CKPK.js +0 -132
- package/dist/bundle/chunks/chunk-ZE5FMF3V.js +0 -99
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NM3JRRWQ.js +0 -2
- package/dist/bundle/chunks/easter-egg-3d-G2LUBEMZ.js +0 -2
- package/dist/bundle/chunks/execute-MZVUC6BB.js +0 -388
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +0 -13
- package/dist/bundle/chunks/mistral-conversations-Q22M3IBG.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-4MYQSO5E.js +0 -10
- package/dist/bundle/chunks/openai-completions-OSRCWAAA.js +0 -7
- package/dist/bundle/chunks/openai-responses-UHF3DHNG.js +0 -3
- package/dist/bundle/chunks/runtime-VJMMDLVH.js +0 -2
- package/dist/bundle/chunks/typesafe-system-one-PRR5K6CI.js +0 -2
- package/dist/bundle/chunks/virtual-modules-RJXJGCPI.js +0 -2
- package/dist/modes/interactive/theme/theme-json.d.ts +0 -85
- package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-json.js +0 -132
- package/dist/modes/interactive/theme/theme-json.js.map +0 -1
- package/dist/modes/interactive/theme/theme-schema.json +0 -361
- package/examples/plugins/pi-example-plugin/README.md +0 -38
- package/examples/plugins/pi-example-plugin/package.json +0 -10
- package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
- package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
package/judge/dist/setup.js
CHANGED
|
@@ -641,41 +641,41 @@ function explainProblem(problem, context, language) {
|
|
|
641
641
|
const host = hostOf(problem.url);
|
|
642
642
|
const seconds = Math.round((context.timeoutMs ?? CHECK_TIMEOUT_MS) / 1e3);
|
|
643
643
|
const local = /^(localhost|127\.|\[::1\])/.test(host);
|
|
644
|
-
const proxyHint = language === "zh" ? context.proxy ? `\u8FD9\u6B21\u8BF7\u6C42\u8D70\u4E86\u4EE3\u7406\uFF08${context.proxy}\uFF09\uFF0C\u786E\u8BA4\u4EE3\u7406\u6B63\u5728\u8FD0\u884C\u3002` : "\u5982\u679C\u9700\u8981\u4EE3\u7406\uFF1A\u8BBE\u7F6E HTTPS_PROXY\uFF0C\u6216\u5728 ~/.mu/agent/settings.json \u91CC\u5199 httpProxy\uFF0C\u7136\u540E\u91CD\u65B0\u8FD0\u884C mu setup\u3002" : context.proxy ? `The request went through your proxy (${context.proxy})
|
|
644
|
+
const proxyHint = language === "zh" ? context.proxy ? `\u8FD9\u6B21\u8BF7\u6C42\u8D70\u4E86\u4EE3\u7406\uFF08${context.proxy}\uFF09\uFF0C\u786E\u8BA4\u4EE3\u7406\u6B63\u5728\u8FD0\u884C\u3002` : "\u5982\u679C\u9700\u8981\u4EE3\u7406\uFF1A\u8BBE\u7F6E HTTPS_PROXY\uFF0C\u6216\u5728 ~/.mu/agent/settings.json \u91CC\u5199 httpProxy\uFF0C\u7136\u540E\u91CD\u65B0\u8FD0\u884C mu setup\u3002" : context.proxy ? `The request went through your proxy (${context.proxy}). Check that it's running.` : "If you need a proxy, set HTTPS_PROXY (or httpProxy in ~/.mu/agent/settings.json) and run mu setup again.";
|
|
645
645
|
const said = problem.said ? language === "zh" ? `\uFF08\u670D\u52A1\u7684\u539F\u8BDD\uFF1A${problem.said}\uFF09` : ` (The service said: ${problem.said})` : "";
|
|
646
646
|
const zh = language === "zh";
|
|
647
647
|
switch (problem.kind) {
|
|
648
648
|
case "key":
|
|
649
|
-
return zh ? `${service} \u4E0D\u63A5\u53D7\u8FD9\u4E2A\u5BC6\u94A5\u3002\u68C0\u67E5\u662F\u5426\u5B8C\u6574\u590D\u5236\uFF0C\u4EE5\u53CA\u5B83\u786E\u5B9E\u662F ${service} \u7684\u5BC6\u94A5\u3002` : `${service}
|
|
649
|
+
return zh ? `${service} \u4E0D\u63A5\u53D7\u8FD9\u4E2A\u5BC6\u94A5\u3002\u68C0\u67E5\u662F\u5426\u5B8C\u6574\u590D\u5236\uFF0C\u4EE5\u53CA\u5B83\u786E\u5B9E\u662F ${service} \u7684\u5BC6\u94A5\u3002` : `${service} didn't accept this key. Check that you copied all of it and that it's ${article(service)} key.`;
|
|
650
650
|
case "refused":
|
|
651
|
-
return zh ? `${service} \u62D2\u7EDD\u4E86\u8FD9\u4E2A\u5BC6\u94A5\uFF08HTTP 403\uFF09\uFF1A\u53EF\u80FD\u662F\u5BC6\u94A5\u4E0D\u5BF9\uFF0C\u6216\u5B83\u6CA1\u6709\u8BBF\u95EE\u6743\u9650\u3002${said}` : `${service} refused this key (HTTP 403)
|
|
651
|
+
return zh ? `${service} \u62D2\u7EDD\u4E86\u8FD9\u4E2A\u5BC6\u94A5\uFF08HTTP 403\uFF09\uFF1A\u53EF\u80FD\u662F\u5BC6\u94A5\u4E0D\u5BF9\uFF0C\u6216\u5B83\u6CA1\u6709\u8BBF\u95EE\u6743\u9650\u3002${said}` : `${service} refused this key (HTTP 403). The key may be wrong or lack access.${said}`;
|
|
652
652
|
case "permission":
|
|
653
|
-
return zh ? "\u8FD9\u4E2A\u5BC6\u94A5\u6709\u6548\uFF0C\u4F46\u6CA1\u6709\u8BFB\u53D6\u6A21\u578B\u5217\u8868\u7684\u6743\u9650\uFF08\u53D7\u9650\u5BC6\u94A5\uFF09\u3002\u7ED9\u5B83\u8BFB\u53D6\u6A21\u578B\u7684\u6743\u9650\uFF0C\u6216\u6362\u4E00\u4E2A\u5BC6\u94A5\u3002" : "The key works
|
|
653
|
+
return zh ? "\u8FD9\u4E2A\u5BC6\u94A5\u6709\u6548\uFF0C\u4F46\u6CA1\u6709\u8BFB\u53D6\u6A21\u578B\u5217\u8868\u7684\u6743\u9650\uFF08\u53D7\u9650\u5BC6\u94A5\uFF09\u3002\u7ED9\u5B83\u8BFB\u53D6\u6A21\u578B\u7684\u6743\u9650\uFF0C\u6216\u6362\u4E00\u4E2A\u5BC6\u94A5\u3002" : "The key works but can't list models (it's a restricted key). Give it permission to read models, or use another key.";
|
|
654
654
|
case "balance":
|
|
655
655
|
return zh ? `${service} \u7684\u8D26\u6237\u6CA1\u6709\u4F59\u989D\u6216\u989D\u5EA6\u4E86\u3002\u5145\u503C\u540E\u91CD\u65B0\u8FD0\u884C mu setup\u3002` : `The ${service} account has no balance or quota left. Top it up, then run mu setup again.`;
|
|
656
656
|
case "region":
|
|
657
|
-
return zh ? `${service} \u4E0D\u5411\u4F60\u6240\u5728\u7684\u5730\u533A\u63D0\u4F9B\u670D\u52A1\u3002\u9700\u8981\u4E00\u4E2A\u4F4D\u4E8E\u652F\u6301\u5730\u533A\u7684\u4EE3\u7406\u6216 VPN\u3002${proxyHint}` : `${service}
|
|
657
|
+
return zh ? `${service} \u4E0D\u5411\u4F60\u6240\u5728\u7684\u5730\u533A\u63D0\u4F9B\u670D\u52A1\u3002\u9700\u8981\u4E00\u4E2A\u4F4D\u4E8E\u652F\u6301\u5730\u533A\u7684\u4EE3\u7406\u6216 VPN\u3002${proxyHint}` : `${service} isn't available in the region this request came from. You need a proxy or VPN in a supported region. ${proxyHint}`;
|
|
658
658
|
case "rate":
|
|
659
|
-
return zh ? `${service} \u8BF4\u8BF7\u6C42\u592A\u9891\u7E41\u3002\u7B49\u4E00\u5206\u949F\u518D\u8BD5\u3002` : `${service}
|
|
659
|
+
return zh ? `${service} \u8BF4\u8BF7\u6C42\u592A\u9891\u7E41\u3002\u7B49\u4E00\u5206\u949F\u518D\u8BD5\u3002` : `${service} is getting too many requests from you. Wait a minute and try again.`;
|
|
660
660
|
case "address":
|
|
661
|
-
return zh ? `${problem.url} \u8FD9\u4E2A\u5730\u5740\u4E0D\u5B58\u5728\uFF08HTTP 404\uFF09\uFF1A\u5730\u5740\u586B\u9519\u4E86\u3002` : `Nothing
|
|
661
|
+
return zh ? `${problem.url} \u8FD9\u4E2A\u5730\u5740\u4E0D\u5B58\u5728\uFF08HTTP 404\uFF09\uFF1A\u5730\u5740\u586B\u9519\u4E86\u3002` : `Nothing was found at ${problem.url} (HTTP 404). Check the address.`;
|
|
662
662
|
case "server":
|
|
663
|
-
return zh ? `${service} \u81EA\u5DF1\u51FA\u9519\u4E86\uFF08HTTP ${problem.status}\uFF09\u3002\u8FC7\u4E00\u4F1A\u513F\u518D\u8BD5\u3002` : `${service}
|
|
663
|
+
return zh ? `${service} \u81EA\u5DF1\u51FA\u9519\u4E86\uFF08HTTP ${problem.status}\uFF09\u3002\u8FC7\u4E00\u4F1A\u513F\u518D\u8BD5\u3002` : `${service} returned a server error (HTTP ${problem.status}). Try again later.`;
|
|
664
664
|
case "response":
|
|
665
|
-
return zh ? `${problem.url} \u6709\u56DE\u5E94\uFF0C\u4F46\u4E0D\u662F\u6A21\u578B\u5217\u8868\uFF1A\u68C0\u67E5\u5730\u5740\u548C\u63A5\u53E3\u7C7B\u578B\u3002` : `${problem.url}
|
|
665
|
+
return zh ? `${problem.url} \u6709\u56DE\u5E94\uFF0C\u4F46\u4E0D\u662F\u6A21\u578B\u5217\u8868\uFF1A\u68C0\u67E5\u5730\u5740\u548C\u63A5\u53E3\u7C7B\u578B\u3002` : `${problem.url} responded, but not with a list of models. Check the address and the API type.`;
|
|
666
666
|
case "timeout":
|
|
667
|
-
return zh ? `${seconds} \u79D2\u5185 ${host} \u6CA1\u6709\u56DE\u5E94\u3002\u7F51\u7EDC\u53EF\u80FD\u4E0D\u901A\uFF1A\u6709\u4E9B\u5730\u533A\u8981\u7528\u4EE3\u7406\u6216 VPN \u624D\u80FD\u8BBF\u95EE\u3002${proxyHint}` : `No
|
|
667
|
+
return zh ? `${seconds} \u79D2\u5185 ${host} \u6CA1\u6709\u56DE\u5E94\u3002\u7F51\u7EDC\u53EF\u80FD\u4E0D\u901A\uFF1A\u6709\u4E9B\u5730\u533A\u8981\u7528\u4EE3\u7406\u6216 VPN \u624D\u80FD\u8BBF\u95EE\u3002${proxyHint}` : `No response from ${host} within ${seconds} s. The network may be blocking it; some regions need a proxy or VPN. ${proxyHint}`;
|
|
668
668
|
case "dns":
|
|
669
|
-
return zh ? `\u627E\u4E0D\u5230 ${host}\uFF1A\u6CA1\u6709\u8054\u7F51\uFF0C\u6216\u8FD9\u91CC\u89E3\u6790\u4E0D\u4E86\u8FD9\u4E2A\u57DF\u540D\u3002${proxyHint}` : `
|
|
669
|
+
return zh ? `\u627E\u4E0D\u5230 ${host}\uFF1A\u6CA1\u6709\u8054\u7F51\uFF0C\u6216\u8FD9\u91CC\u89E3\u6790\u4E0D\u4E86\u8FD9\u4E2A\u57DF\u540D\u3002${proxyHint}` : `Couldn't resolve ${host}. Check your internet connection and DNS. ${proxyHint}`;
|
|
670
670
|
case "connection":
|
|
671
671
|
if (local) {
|
|
672
|
-
return zh ? `${host} \u4E0A\u6CA1\u6709\u670D\u52A1\u5728\u76D1\u542C\uFF1A\u5B83\u542F\u52A8\u4E86\u5417\uFF1F` : `Nothing is listening at ${host}
|
|
672
|
+
return zh ? `${host} \u4E0A\u6CA1\u6709\u670D\u52A1\u5728\u76D1\u542C\uFF1A\u5B83\u542F\u52A8\u4E86\u5417\uFF1F` : `Nothing is listening at ${host}. Is the service running?`;
|
|
673
673
|
}
|
|
674
|
-
return zh ? `\u8FDE\u4E0D\u4E0A ${host}\u3002${proxyHint}` : `
|
|
674
|
+
return zh ? `\u8FDE\u4E0D\u4E0A ${host}\u3002${proxyHint}` : `Couldn't connect to ${host}. ${proxyHint}`;
|
|
675
675
|
case "tls":
|
|
676
|
-
return zh ? `\u548C ${host} \u7684\u5B89\u5168\u8FDE\u63A5\u5931\u8D25\u4E86\uFF1A\u53EF\u80FD\u6709\u4EE3\u7406\u6216\u9632\u706B\u5899\u5728\u62E6\u622A HTTPS\u3002` : `The secure connection to ${host} failed
|
|
676
|
+
return zh ? `\u548C ${host} \u7684\u5B89\u5168\u8FDE\u63A5\u5931\u8D25\u4E86\uFF1A\u53EF\u80FD\u6709\u4EE3\u7406\u6216\u9632\u706B\u5899\u5728\u62E6\u622A HTTPS\u3002` : `The secure connection to ${host} failed. A proxy or firewall may be intercepting HTTPS.`;
|
|
677
677
|
default:
|
|
678
|
-
return zh ? `${service} \u62D2\u7EDD\u4E86\u8FD9\u6B21\u68C0\u67E5\uFF08HTTP ${problem.status ?? "?"}\uFF09\u3002${said}` : `${service}
|
|
678
|
+
return zh ? `${service} \u62D2\u7EDD\u4E86\u8FD9\u6B21\u68C0\u67E5\uFF08HTTP ${problem.status ?? "?"}\uFF09\u3002${said}` : `${service} rejected the check (HTTP ${problem.status ?? "?"}).${said}`;
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
async function opencodeRefuses(baseUrl, key, fetch, timeoutMs) {
|
|
@@ -809,7 +809,7 @@ var SETUP_SERVICES = [
|
|
|
809
809
|
{
|
|
810
810
|
id: "opencode",
|
|
811
811
|
name: "OpenCode Zen",
|
|
812
|
-
baseUrls: ["https://opencode.ai/
|
|
812
|
+
baseUrls: ["https://opencode.ai/inference/v1"],
|
|
813
813
|
api: "openai-completions",
|
|
814
814
|
models: ["kimi-k2.6"],
|
|
815
815
|
keyPage: "https://opencode.ai/auth",
|
|
@@ -977,7 +977,7 @@ var OTHER = {
|
|
|
977
977
|
};
|
|
978
978
|
var NOT_READY = {
|
|
979
979
|
zh: "Ollama \u8FD8\u6CA1\u51C6\u5907\u597D\uFF08\u7528 `ollama serve` \u542F\u52A8\u5B83\uFF0C\u518D\u62C9\u53D6\u4E00\u4E2A\u6A21\u578B\uFF09\u3002",
|
|
980
|
-
en: "Ollama
|
|
980
|
+
en: "Ollama isn't ready yet. Start it with `ollama serve`, then pull a model."
|
|
981
981
|
};
|
|
982
982
|
function parseSetupArgs(argv) {
|
|
983
983
|
const values = /* @__PURE__ */ new Map();
|
|
@@ -1000,14 +1000,14 @@ function parseSetupArgs(argv) {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
const api = values.get("--api");
|
|
1002
1002
|
if (api !== void 0 && api !== "openai" && api !== "anthropic") {
|
|
1003
|
-
return { error: { zh: "--api \u53EA\u80FD\u662F openai \u6216 anthropic", en: "--api
|
|
1003
|
+
return { error: { zh: "--api \u53EA\u80FD\u662F openai \u6216 anthropic", en: "--api must be openai or anthropic" } };
|
|
1004
1004
|
}
|
|
1005
1005
|
const judge = values.get("--judge");
|
|
1006
1006
|
if (judge !== void 0 && !["jev", "opencode", "free", "model", "none"].includes(judge)) {
|
|
1007
1007
|
return {
|
|
1008
1008
|
error: {
|
|
1009
1009
|
zh: "--judge \u53EA\u80FD\u662F jev\u3001opencode\u3001free\u3001model \u6216 none",
|
|
1010
|
-
en: "--judge
|
|
1010
|
+
en: "--judge must be jev, opencode, free, model or none"
|
|
1011
1011
|
}
|
|
1012
1012
|
};
|
|
1013
1013
|
}
|
|
@@ -1016,11 +1016,11 @@ function parseSetupArgs(argv) {
|
|
|
1016
1016
|
return {
|
|
1017
1017
|
error: {
|
|
1018
1018
|
zh: `\u6CA1\u6709\u53EB ${service} \u7684\u670D\u52A1\uFF08mu setup --list \u5217\u51FA\u5168\u90E8\uFF09`,
|
|
1019
|
-
en: `
|
|
1019
|
+
en: `no service named ${service} (mu setup --list shows them all)`
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
|
-
if (words.length > 1) return { error: { zh: "\u53EA\u80FD\u7ED9\u4E00\u4E2A\u5BC6\u94A5", en: "give one key
|
|
1023
|
+
if (words.length > 1) return { error: { zh: "\u53EA\u80FD\u7ED9\u4E00\u4E2A\u5BC6\u94A5", en: "give at most one key" } };
|
|
1024
1024
|
return {
|
|
1025
1025
|
help: flags.has("help"),
|
|
1026
1026
|
list: flags.has("list"),
|
|
@@ -1063,29 +1063,29 @@ function setupUsage(language) {
|
|
|
1063
1063
|
].join("\n");
|
|
1064
1064
|
}
|
|
1065
1065
|
return [
|
|
1066
|
-
"mu setup: connect a model for mu to work with, and choose
|
|
1066
|
+
"mu setup: connect a model for mu to work with, and choose a judge.",
|
|
1067
1067
|
"",
|
|
1068
|
-
" mu setup
|
|
1069
|
-
" mu setup <key> starts from an API key
|
|
1068
|
+
" mu setup walks you through it, one question at a time",
|
|
1069
|
+
" mu setup <key> starts from an API key and detects its service from the key's format",
|
|
1070
1070
|
" mu setup --service <id> --key-stdin [--model <id>] [--base-url <url>] [--judge <judge>] [--yes]",
|
|
1071
|
-
" for scripts: the key
|
|
1072
|
-
" mu setup --list the services mu knows
|
|
1071
|
+
" for scripts: reads the key from stdin",
|
|
1072
|
+
" mu setup --list lists the services mu knows and their ids",
|
|
1073
1073
|
"",
|
|
1074
|
-
"Why stdin for scripts: a key on the command line stays in your shell
|
|
1075
|
-
"computer that lists processes can read it. `mu setup <key>` is
|
|
1076
|
-
"prompt when you can.",
|
|
1074
|
+
"Why stdin for scripts: a key on the command line stays in your shell history, and any program on this",
|
|
1075
|
+
"computer that lists processes can read it. `mu setup <key>` is a shortcut for getting started; paste the key",
|
|
1076
|
+
"at the prompt when you can.",
|
|
1077
1077
|
"",
|
|
1078
|
-
" --judge jev the Jev key (TypeSafe)
|
|
1079
|
-
" --judge opencode Jev on OpenCode Zen
|
|
1080
|
-
" --judge free Jev on OpenCode Zen
|
|
1081
|
-
" --judge model the model just set up
|
|
1082
|
-
" --judge none
|
|
1078
|
+
" --judge jev read the Jev key (TypeSafe) from stdin's second line, unless TYPESAFE_API_KEY is already set",
|
|
1079
|
+
" --judge opencode use Jev on OpenCode Zen with an OpenCode key (--service opencode or OPENCODE_API_KEY)",
|
|
1080
|
+
" --judge free use the free Jev on OpenCode Zen (limited time, no key; the default while no key is set)",
|
|
1081
|
+
" --judge model use the model you just set up as the judge (slower, and every verdict costs tokens)",
|
|
1082
|
+
" --judge none leave the judge unchanged (the same as omitting --judge)",
|
|
1083
1083
|
" --api, --name for the service `other`: its API (openai or anthropic) and its name in mu",
|
|
1084
|
-
" --yes
|
|
1085
|
-
"
|
|
1084
|
+
" --yes don't ask; replace what's already set up (a subscription sign-in, a provider's address,",
|
|
1085
|
+
" the Jev key)",
|
|
1086
1086
|
"",
|
|
1087
|
-
"Files: auth.json (keys), models.json, settings.json and mu.json in ~/.mu/agent, and the .env
|
|
1088
|
-
"(the Jev key). Each is
|
|
1087
|
+
"Files it changes: auth.json (keys), models.json, settings.json and mu.json in ~/.mu/agent, and the .env",
|
|
1088
|
+
"mu reads (the Jev key). Each one is backed up to ~/.mu/backups/<time>/ before it changes."
|
|
1089
1089
|
].join("\n");
|
|
1090
1090
|
}
|
|
1091
1091
|
function label(service, language) {
|
|
@@ -1204,7 +1204,7 @@ var Setup = class {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
pasteKey() {
|
|
1206
1206
|
return this.secret(
|
|
1207
|
-
this.t({ zh: "\u7C98\u8D34 API \u5BC6\u94A5\uFF08\u4E0D\u4F1A\u663E\u793A\u51FA\u6765\uFF09\uFF1A", en: "Paste the API key (it
|
|
1207
|
+
this.t({ zh: "\u7C98\u8D34 API \u5BC6\u94A5\uFF08\u4E0D\u4F1A\u663E\u793A\u51FA\u6765\uFF09\uFF1A", en: "Paste the API key (it won't be shown): " })
|
|
1208
1208
|
);
|
|
1209
1209
|
}
|
|
1210
1210
|
async choose(question, choices) {
|
|
@@ -1216,7 +1216,7 @@ var Setup = class {
|
|
|
1216
1216
|
if (answer === "") return choices[0].value;
|
|
1217
1217
|
const number = Number(answer);
|
|
1218
1218
|
if (Number.isInteger(number) && number >= 1 && number <= choices.length) return choices[number - 1].value;
|
|
1219
|
-
this.io.say(this.t({ zh: `\u8BF7\u8F93\u5165 ${range} \u4E4B\u95F4\u7684\u6570\u5B57\u3002`, en: `Type a number from ${
|
|
1219
|
+
this.io.say(this.t({ zh: `\u8BF7\u8F93\u5165 ${range} \u4E4B\u95F4\u7684\u6570\u5B57\u3002`, en: `Type a number from 1 to ${choices.length}.` }));
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
1222
|
async confirm(question, yes) {
|
|
@@ -1236,7 +1236,7 @@ var Setup = class {
|
|
|
1236
1236
|
throw this.fail(
|
|
1237
1237
|
{
|
|
1238
1238
|
zh: "--key-stdin \u4ECE\u7BA1\u9053\u8BFB\u5BC6\u94A5\u3002\u5728\u7EC8\u7AEF\u91CC\u8BF7\u76F4\u63A5\u8FD0\u884C mu setup\uFF0C\u5728\u63D0\u793A\u91CC\u7C98\u8D34\u5BC6\u94A5\uFF08\u4E0D\u4F1A\u663E\u793A\uFF09\u3002",
|
|
1239
|
-
en: "--key-stdin reads the key from a pipe. In a terminal, run mu setup and paste the key at
|
|
1239
|
+
en: "--key-stdin reads the key from a pipe. In a terminal, run mu setup and paste the key at the prompt (it won't be shown)."
|
|
1240
1240
|
},
|
|
1241
1241
|
SETUP_EXIT.usage
|
|
1242
1242
|
);
|
|
@@ -1247,9 +1247,9 @@ var Setup = class {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
if (this.scripted && key === void 0 && args.service === void 0) {
|
|
1249
1249
|
throw this.fail(
|
|
1250
|
-
deps.interactive ? { zh: "\u6CA1\u6709\u5BC6\u94A5\uFF0C\u4E5F\u6CA1\u6709 --service", en: "no key
|
|
1250
|
+
deps.interactive ? { zh: "\u6CA1\u6709\u5BC6\u94A5\uFF0C\u4E5F\u6CA1\u6709 --service", en: "no key or --service given" } : {
|
|
1251
1251
|
zh: "\u95EE\u9898\u8981\u5728\u7EC8\u7AEF\u91CC\u56DE\u7B54\u3002\u811A\u672C\u91CC\u7528\uFF1Amu setup --service <id> --key-stdin\uFF08\u89C1 mu setup --help\uFF09",
|
|
1252
|
-
en: "
|
|
1252
|
+
en: "no terminal to ask in. In a script, use mu setup --service <id> --key-stdin (see mu setup --help)"
|
|
1253
1253
|
},
|
|
1254
1254
|
SETUP_EXIT.usage
|
|
1255
1255
|
);
|
|
@@ -1258,7 +1258,7 @@ var Setup = class {
|
|
|
1258
1258
|
this.io.say(
|
|
1259
1259
|
this.t({
|
|
1260
1260
|
zh: "mu setup\uFF1A\u7ED9 mu \u63A5\u4E0A\u4E00\u4E2A\u5E72\u6D3B\u7684\u6A21\u578B\uFF0C\u518D\u9009\u4E00\u4E2A\u5224\u5B9A\u5668\u3002",
|
|
1261
|
-
en: "mu setup: connect a model for mu to work with, and choose
|
|
1261
|
+
en: "mu setup: connect a model for mu to work with, and choose a judge."
|
|
1262
1262
|
})
|
|
1263
1263
|
);
|
|
1264
1264
|
}
|
|
@@ -1296,7 +1296,7 @@ var Setup = class {
|
|
|
1296
1296
|
this.io.say(
|
|
1297
1297
|
this.t({
|
|
1298
1298
|
zh: "\u597D\u7684\uFF0C\u4EE5\u540E\u4E0D\u518D\u95EE\u4E86\u3002\u9700\u8981\u65F6\u8FD0\u884C mu setup\uFF0C\u6216\u5728 mu \u91CC\u8F93\u5165 /login\u3002",
|
|
1299
|
-
en: "OK, mu
|
|
1299
|
+
en: "OK, mu won't ask again. Run mu setup whenever you're ready, or type /login inside mu."
|
|
1300
1300
|
})
|
|
1301
1301
|
);
|
|
1302
1302
|
return false;
|
|
@@ -1308,29 +1308,32 @@ var Setup = class {
|
|
|
1308
1308
|
const named2 = this.args.service === void 0 ? void 0 : serviceById(this.args.service);
|
|
1309
1309
|
if (named2) return this.keyFor(named2, key);
|
|
1310
1310
|
if (key !== void 0) return { service: await this.serviceOf(key), key };
|
|
1311
|
-
const route = await this.choose(
|
|
1312
|
-
{
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
label: this.t({
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1311
|
+
const route = await this.choose(
|
|
1312
|
+
this.t({ zh: "mu \u7528\u4EC0\u4E48\u65B9\u5F0F\u8FDE\u63A5\u6A21\u578B\uFF1F", en: "How should mu connect to a model?" }),
|
|
1313
|
+
[
|
|
1314
|
+
{
|
|
1315
|
+
label: this.t({
|
|
1316
|
+
zh: "\u7C98\u8D34 API \u5BC6\u94A5\uFF08mu \u4F1A\u8BA4\u51FA\u5B83\u5C5E\u4E8E\u54EA\u4E2A\u670D\u52A1\uFF09",
|
|
1317
|
+
en: "Paste an API key (mu detects which service it belongs to)"
|
|
1318
|
+
}),
|
|
1319
|
+
value: "key"
|
|
1320
|
+
},
|
|
1321
|
+
{ label: this.t({ zh: "\u4ECE\u5217\u8868\u91CC\u9009\u4E00\u4E2A\u670D\u52A1", en: "Choose a service from the list" }), value: "list" },
|
|
1322
|
+
{
|
|
1323
|
+
label: this.t({
|
|
1324
|
+
zh: "\u7528\u8BA2\u9605\u8D26\u53F7\u767B\u5F55\uFF1AChatGPT\u3001Claude\u3001Grok \u6216 Google",
|
|
1325
|
+
en: "Sign in with a subscription: ChatGPT, Claude, Grok or Google"
|
|
1326
|
+
}),
|
|
1327
|
+
value: "subscription"
|
|
1328
|
+
}
|
|
1329
|
+
]
|
|
1330
|
+
);
|
|
1328
1331
|
if (route === "subscription") {
|
|
1329
1332
|
const auth = this.path(join3(this.deps.paths.agentDir, "auth.json"));
|
|
1330
1333
|
this.io.say(
|
|
1331
1334
|
this.t({
|
|
1332
1335
|
zh: `\u8BA2\u9605\u8D26\u53F7\u5728 mu \u91CC\u9762\u767B\u5F55\uFF1A\u542F\u52A8 mu\uFF0C\u8F93\u5165 /login\uFF0C\u9009 ChatGPT\uFF08OpenAI Codex\uFF09\u3001Claude\u3001Grok \u6216 Google\uFF0C\u6309\u63D0\u793A\u5728\u6D4F\u89C8\u5668\u91CC\u5B8C\u6210\u3002\u767B\u5F55\u4FE1\u606F\u4FDD\u5B58\u5728 ${auth}\u3002`,
|
|
1333
|
-
en: `
|
|
1336
|
+
en: `Subscriptions sign in from inside mu: start mu, type /login, choose ChatGPT (OpenAI Codex), Claude, Grok or Google, and finish in the browser. The sign-in is saved in ${auth}.`
|
|
1334
1337
|
})
|
|
1335
1338
|
);
|
|
1336
1339
|
return "subscription";
|
|
@@ -1364,10 +1367,10 @@ var Setup = class {
|
|
|
1364
1367
|
throw this.fail(
|
|
1365
1368
|
matches.length > 1 ? {
|
|
1366
1369
|
zh: `${this.names(matches)} \u7684\u5BC6\u94A5\u957F\u5F97\u4E00\u6837\u3002\u7528 --service \u8BF4\u660E\u662F\u54EA\u5BB6\uFF1A${matches.map((service) => service.id).join(" \u6216 ")}`,
|
|
1367
|
-
en:
|
|
1370
|
+
en: `${this.names(matches)} keys look the same. Choose one with --service ${matches.map((service) => service.id).join(" or ")}`
|
|
1368
1371
|
} : {
|
|
1369
1372
|
zh: "\u8BA4\u4E0D\u51FA\u8FD9\u4E2A\u5BC6\u94A5\u5C5E\u4E8E\u54EA\u4E2A\u670D\u52A1\u3002\u7528 --service <id> \u8BF4\u660E\uFF08mu setup --list \u5217\u51FA\u5168\u90E8\uFF09",
|
|
1370
|
-
en: "this key's
|
|
1373
|
+
en: "mu doesn't recognize this key's format. Say which service it's for with --service <id> (mu setup --list)"
|
|
1371
1374
|
},
|
|
1372
1375
|
SETUP_EXIT.usage
|
|
1373
1376
|
);
|
|
@@ -1377,7 +1380,7 @@ var Setup = class {
|
|
|
1377
1380
|
matches,
|
|
1378
1381
|
this.t({
|
|
1379
1382
|
zh: `${this.names(matches)} \u7684\u5BC6\u94A5\u957F\u5F97\u4E00\u6837\u3002\u8FD9\u4E2A\u5BC6\u94A5\u662F\u54EA\u5BB6\u7684\uFF1Fmu \u53EA\u628A\u5BC6\u94A5\u53D1\u7ED9\u5B83\u6240\u5C5E\u7684\u670D\u52A1\u3002`,
|
|
1380
|
-
en:
|
|
1383
|
+
en: `${this.names(matches)} keys look the same. Which service is this key for? mu only sends a key to the service it belongs to.`
|
|
1381
1384
|
})
|
|
1382
1385
|
);
|
|
1383
1386
|
}
|
|
@@ -1385,7 +1388,7 @@ var Setup = class {
|
|
|
1385
1388
|
SETUP_SERVICES.filter((service) => !service.keyless),
|
|
1386
1389
|
this.t({
|
|
1387
1390
|
zh: "mu \u8BA4\u4E0D\u51FA\u8FD9\u4E2A\u5BC6\u94A5\u3002\u5B83\u662F\u54EA\u4E2A\u670D\u52A1\u7684\uFF1F",
|
|
1388
|
-
en: "mu
|
|
1391
|
+
en: "mu doesn't recognize this key. Which service is it for?"
|
|
1389
1392
|
})
|
|
1390
1393
|
);
|
|
1391
1394
|
}
|
|
@@ -1396,9 +1399,7 @@ var Setup = class {
|
|
|
1396
1399
|
let key = given;
|
|
1397
1400
|
if (key === void 0 && !this.scripted) {
|
|
1398
1401
|
if (service.keyPage) {
|
|
1399
|
-
this.io.say(
|
|
1400
|
-
this.t({ zh: `\u5BC6\u94A5\u5728\u8FD9\u91CC\u521B\u5EFA\uFF1A${service.keyPage}`, en: `Keys are made at ${service.keyPage}` })
|
|
1401
|
-
);
|
|
1402
|
+
this.io.say(this.t({ zh: `\u5BC6\u94A5\u5728\u8FD9\u91CC\u521B\u5EFA\uFF1A${service.keyPage}`, en: `Create a key at ${service.keyPage}` }));
|
|
1402
1403
|
}
|
|
1403
1404
|
key = await this.pasteKey();
|
|
1404
1405
|
}
|
|
@@ -1416,7 +1417,7 @@ var Setup = class {
|
|
|
1416
1417
|
this.io.warn(
|
|
1417
1418
|
this.t({
|
|
1418
1419
|
zh: `\u6CE8\u610F\uFF1A\u8FD9\u4E2A\u5BC6\u94A5\u770B\u8D77\u6765\u662F ${this.names(matches)} \u7684\uFF1B\u6309 --service \u53D1\u7ED9 ${this.name(service)}\u3002`,
|
|
1419
|
-
en: `Note: this key looks like ${article(this.names(matches))} key; it
|
|
1420
|
+
en: `Note: this key looks like ${article(this.names(matches))} key; sending it to ${this.name(service)}, as --service says.`
|
|
1420
1421
|
})
|
|
1421
1422
|
);
|
|
1422
1423
|
return { service, key };
|
|
@@ -1463,11 +1464,14 @@ var Setup = class {
|
|
|
1463
1464
|
);
|
|
1464
1465
|
if (/^https?:\/\/[^\s/]+/i.test(baseUrl)) break;
|
|
1465
1466
|
this.io.say(
|
|
1466
|
-
this.t({
|
|
1467
|
+
this.t({
|
|
1468
|
+
zh: "\u5730\u5740\u4EE5 http:// \u6216 https:// \u5F00\u5934\u3002",
|
|
1469
|
+
en: "The address must start with http:// or https://."
|
|
1470
|
+
})
|
|
1467
1471
|
);
|
|
1468
1472
|
}
|
|
1469
1473
|
}
|
|
1470
|
-
const api = args.api === "anthropic" ? "anthropic-messages" : args.api === "openai" || this.scripted ? "openai-completions" : await this.choose(this.t({ zh: "\u5B83\u7528\u54EA\u79CD\u63A5\u53E3\uFF1F", en: "Which API does it
|
|
1474
|
+
const api = args.api === "anthropic" ? "anthropic-messages" : args.api === "openai" || this.scripted ? "openai-completions" : await this.choose(this.t({ zh: "\u5B83\u7528\u54EA\u79CD\u63A5\u53E3\uFF1F", en: "Which API does it use?" }), [
|
|
1471
1475
|
{
|
|
1472
1476
|
label: this.t({
|
|
1473
1477
|
zh: "OpenAI \u517C\u5BB9\uFF08chat completions\uFF09",
|
|
@@ -1489,7 +1493,7 @@ var Setup = class {
|
|
|
1489
1493
|
const typed = await this.ask(
|
|
1490
1494
|
this.t({
|
|
1491
1495
|
zh: `\u7ED9\u5B83\u8D77\u4E2A\u7B80\u77ED\u7684\u540D\u5B57\uFF08\u5B57\u6BCD\u3001\u6570\u5B57\u3001-\uFF09[${provider}]\uFF1A`,
|
|
1492
|
-
en: `A short name for it in mu (letters, digits
|
|
1496
|
+
en: `A short name for it in mu (letters, digits and -) [${provider}]: `
|
|
1493
1497
|
})
|
|
1494
1498
|
);
|
|
1495
1499
|
if (typed) provider = typed.toLowerCase().replace(/[^a-z0-9-]+/g, "-");
|
|
@@ -1518,7 +1522,7 @@ var Setup = class {
|
|
|
1518
1522
|
key = await this.secret(
|
|
1519
1523
|
this.t({
|
|
1520
1524
|
zh: "\u7C98\u8D34\u5B83\u7684 API \u5BC6\u94A5\uFF1B\u4E0D\u9700\u8981\u5BC6\u94A5\u5C31\u76F4\u63A5\u56DE\u8F66\uFF08\u4E0D\u4F1A\u663E\u793A\uFF09\uFF1A",
|
|
1521
|
-
en: "Paste its API key, or press Enter if it
|
|
1525
|
+
en: "Paste its API key, or press Enter if it doesn't need one (it won't be shown): "
|
|
1522
1526
|
}),
|
|
1523
1527
|
true
|
|
1524
1528
|
) || void 0;
|
|
@@ -1537,15 +1541,15 @@ var Setup = class {
|
|
|
1537
1541
|
choices.push({ label: this.t({ zh: "\u518D\u8BD5\u4E00\u6B21", en: "Try again" }), value: "again" });
|
|
1538
1542
|
if (result.problem.kind !== "key") {
|
|
1539
1543
|
choices.push({
|
|
1540
|
-
label: this.t({ zh: "\u4E0D\u68C0\u67E5\u4E86\uFF0C\u7167\u6837\u4FDD\u5B58", en: "Save it without
|
|
1544
|
+
label: this.t({ zh: "\u4E0D\u68C0\u67E5\u4E86\uFF0C\u7167\u6837\u4FDD\u5B58", en: "Save it without checking" }),
|
|
1541
1545
|
value: "unchecked"
|
|
1542
1546
|
});
|
|
1543
1547
|
}
|
|
1544
1548
|
choices.push({
|
|
1545
|
-
label: this.t({ zh: "\u5230\u6B64\u4E3A\u6B62\uFF08\u4EC0\u4E48\u90FD\u4E0D\u6539\uFF09", en: "Stop here (nothing
|
|
1549
|
+
label: this.t({ zh: "\u5230\u6B64\u4E3A\u6B62\uFF08\u4EC0\u4E48\u90FD\u4E0D\u6539\uFF09", en: "Stop here (change nothing)" }),
|
|
1546
1550
|
value: "stop"
|
|
1547
1551
|
});
|
|
1548
|
-
const next = await this.choose(this.t({ zh: "\u63A5\u4E0B\u6765\u600E\u4E48\u529E\uFF1F", en: "What
|
|
1552
|
+
const next = await this.choose(this.t({ zh: "\u63A5\u4E0B\u6765\u600E\u4E48\u529E\uFF1F", en: "What next?" }), choices);
|
|
1549
1553
|
if (next === "stop") throw this.cancelled();
|
|
1550
1554
|
if (next === "unchecked") return { service, reach: reaches[0], key };
|
|
1551
1555
|
if (next === "key") key = await this.pasteKey();
|
|
@@ -1561,10 +1565,10 @@ var Setup = class {
|
|
|
1561
1565
|
this.io.say(
|
|
1562
1566
|
key ? this.t({
|
|
1563
1567
|
zh: `\u6B63\u5728\u7528 ${where}\u68C0\u67E5\u5BC6\u94A5\u2026\u2026`,
|
|
1564
|
-
en: `Checking the key with ${this.name(service)} (${hostOf2(reach.baseUrl)})
|
|
1568
|
+
en: `Checking the key with ${this.name(service)} (${hostOf2(reach.baseUrl)})\u2026`
|
|
1565
1569
|
}) : this.t({
|
|
1566
1570
|
zh: `\u6B63\u5728\u68C0\u67E5 ${where}\u2026\u2026`,
|
|
1567
|
-
en: `Checking ${this.name(service)} (${hostOf2(reach.baseUrl)})
|
|
1571
|
+
en: `Checking ${this.name(service)} (${hostOf2(reach.baseUrl)})\u2026`
|
|
1568
1572
|
})
|
|
1569
1573
|
);
|
|
1570
1574
|
const result = await checkKey({
|
|
@@ -1579,7 +1583,7 @@ var Setup = class {
|
|
|
1579
1583
|
this.io.say(
|
|
1580
1584
|
count === void 0 ? this.t({ zh: "\u5BC6\u94A5\u53EF\u4EE5\u7528\u3002", en: "The key works." }) : this.t({
|
|
1581
1585
|
zh: `\u53EF\u4EE5\u7528\uFF1A\u5217\u51FA\u4E86 ${count} \u4E2A\u6A21\u578B\u3002`,
|
|
1582
|
-
en: `It works: ${count} model${count === 1 ? "" : "s"}
|
|
1586
|
+
en: `It works: ${count} model${count === 1 ? "" : "s"} available.`
|
|
1583
1587
|
})
|
|
1584
1588
|
);
|
|
1585
1589
|
return { ok: true, reach, listed: result.models };
|
|
@@ -1603,13 +1607,13 @@ var Setup = class {
|
|
|
1603
1607
|
if (this.scripted) {
|
|
1604
1608
|
throw this.fail({
|
|
1605
1609
|
zh: `${this.name(service)} \u5DF2\u7ECF\u7528\u8BA2\u9605\u8D26\u53F7\u767B\u5F55\u4E86\u3002\u8981\u6539\u5B58\u5BC6\u94A5\uFF0C\u52A0\u4E0A --yes`,
|
|
1606
|
-
en: `${this.name(service)} is signed in with a subscription. To
|
|
1610
|
+
en: `${this.name(service)} is signed in with a subscription. To use a key instead, add --yes`
|
|
1607
1611
|
});
|
|
1608
1612
|
}
|
|
1609
1613
|
const replace = await this.confirm(
|
|
1610
1614
|
this.t({
|
|
1611
1615
|
zh: `\u4F60\u5DF2\u7ECF\u7528\u8BA2\u9605\u8D26\u53F7\u767B\u5F55\u4E86 ${this.name(service)}\u3002\u6539\u7528\u8FD9\u4E2A\u5BC6\u94A5\u5417\uFF1F\u767B\u5F55\u4F1A\u88AB\u66FF\u6362\uFF08\u7559\u6709\u5907\u4EFD\uFF09\u3002[y/N] `,
|
|
1612
|
-
en: `You
|
|
1616
|
+
en: `You're signed in to ${this.name(service)} with a subscription. Use this key instead? It replaces the sign-in (a backup is kept). [y/N] `
|
|
1613
1617
|
}),
|
|
1614
1618
|
false
|
|
1615
1619
|
);
|
|
@@ -1622,7 +1626,7 @@ var Setup = class {
|
|
|
1622
1626
|
if (readJsonFile(path).state !== "unreadable") return;
|
|
1623
1627
|
throw this.fail({
|
|
1624
1628
|
zh: `${this.path(path)} \u4E0D\u662F\u7EAF JSON\uFF08\u4E5F\u8BB8\u6709\u6CE8\u91CA\u6216\u5199\u9519\u4E86\uFF09\uFF0Cmu setup \u4E0D\u6539\u5199\u5B83\u3002\u5148\u4FEE\u597D\u5B83\uFF0C\u6216\u624B\u52A8\u628A\u670D\u52A1\u52A0\u8FDB\u53BB\u3002`,
|
|
1625
|
-
en: `${this.path(path)}
|
|
1629
|
+
en: `${this.path(path)} isn't plain JSON (it may have comments or a typo), so mu setup won't rewrite it. Fix it, or add the service by hand.`
|
|
1626
1630
|
});
|
|
1627
1631
|
}
|
|
1628
1632
|
// -----------------------------------------------------------------------------------------------------------
|
|
@@ -1635,7 +1639,7 @@ var Setup = class {
|
|
|
1635
1639
|
this.io.say(
|
|
1636
1640
|
this.t({
|
|
1637
1641
|
zh: `\u6CE8\u610F\uFF1A${this.name(service)} \u6CA1\u6709\u5217\u51FA ${this.args.model}\uFF0C\u7167\u6837\u4F7F\u7528\u3002`,
|
|
1638
|
-
en: `Note: ${this.name(service)}
|
|
1642
|
+
en: `Note: ${this.name(service)} doesn't list ${this.args.model}; using it anyway.`
|
|
1639
1643
|
})
|
|
1640
1644
|
);
|
|
1641
1645
|
}
|
|
@@ -1651,14 +1655,14 @@ var Setup = class {
|
|
|
1651
1655
|
if (options.length === 0) {
|
|
1652
1656
|
const none = service.keyless ? NOT_READY : {
|
|
1653
1657
|
zh: `${this.name(service)} \u6CA1\u6709\u5217\u51FA\u6A21\u578B\u3002`,
|
|
1654
|
-
en: `${this.name(service)}
|
|
1658
|
+
en: `${this.name(service)} doesn't list any models.`
|
|
1655
1659
|
};
|
|
1656
1660
|
if (this.scripted) {
|
|
1657
|
-
throw this.fail({ zh: `${none.zh}\u53EF\u4EE5\u7528 --model \u6307\u5B9A\u4E00\u4E2A\u3002`, en: `${none.en}
|
|
1661
|
+
throw this.fail({ zh: `${none.zh}\u53EF\u4EE5\u7528 --model \u6307\u5B9A\u4E00\u4E2A\u3002`, en: `${none.en} Specify one with --model.` });
|
|
1658
1662
|
}
|
|
1659
1663
|
this.io.say(this.t(none));
|
|
1660
1664
|
for (; ; ) {
|
|
1661
|
-
const typed = await this.ask(this.t({ zh: "\u8981\u7528\u7684\u6A21\u578B\u540D\uFF1A", en: "
|
|
1665
|
+
const typed = await this.ask(this.t({ zh: "\u8981\u7528\u7684\u6A21\u578B\u540D\uFF1A", en: "Name of the model to use: " }));
|
|
1662
1666
|
if (typed) return typed;
|
|
1663
1667
|
}
|
|
1664
1668
|
}
|
|
@@ -1674,7 +1678,7 @@ var Setup = class {
|
|
|
1674
1678
|
this.io.say(
|
|
1675
1679
|
this.t({
|
|
1676
1680
|
zh: ` \uFF08\u8FD8\u6709 ${more} \u4E2A\uFF0C\u8F93\u5165\u540D\u5B57\u4E5F\u53EF\u4EE5\uFF09`,
|
|
1677
|
-
en: ` (${more} more
|
|
1681
|
+
en: ` (${more} more; type a name to use one of them)`
|
|
1678
1682
|
})
|
|
1679
1683
|
);
|
|
1680
1684
|
}
|
|
@@ -1692,7 +1696,7 @@ var Setup = class {
|
|
|
1692
1696
|
this.io.say(
|
|
1693
1697
|
this.t({
|
|
1694
1698
|
zh: `\u8BF7\u8F93\u5165 1-${shown.length} \u4E4B\u95F4\u7684\u6570\u5B57\uFF0C\u6216\u6A21\u578B\u540D\u3002`,
|
|
1695
|
-
en: `Type a number from 1
|
|
1699
|
+
en: `Type a number from 1 to ${shown.length}, or a model name.`
|
|
1696
1700
|
})
|
|
1697
1701
|
);
|
|
1698
1702
|
}
|
|
@@ -1708,13 +1712,13 @@ var Setup = class {
|
|
|
1708
1712
|
if (this.scripted) {
|
|
1709
1713
|
throw this.fail({
|
|
1710
1714
|
zh: `models.json \u91CC\u7684 ${target.reach.provider} \u6307\u5411 ${old}\u3002\u8981\u6539\u6210 ${target.reach.baseUrl}\uFF0C\u52A0\u4E0A --yes`,
|
|
1711
|
-
en: `models.json
|
|
1715
|
+
en: `models.json already points ${target.reach.provider} at ${old}. To point it at ${target.reach.baseUrl}, add --yes`
|
|
1712
1716
|
});
|
|
1713
1717
|
}
|
|
1714
1718
|
const move = await this.confirm(
|
|
1715
1719
|
this.t({
|
|
1716
1720
|
zh: `models.json \u91CC\u5DF2\u7ECF\u6709 ${target.reach.provider}\uFF0C\u5730\u5740\u662F ${old}\u3002\u6539\u6210 ${target.reach.baseUrl} \u5417\uFF1F[y/N] `,
|
|
1717
|
-
en: `models.json already
|
|
1721
|
+
en: `models.json already points ${target.reach.provider} at ${old}. Point it at ${target.reach.baseUrl} instead? [y/N] `
|
|
1718
1722
|
}),
|
|
1719
1723
|
false
|
|
1720
1724
|
);
|
|
@@ -1739,7 +1743,7 @@ var Setup = class {
|
|
|
1739
1743
|
choices.push({
|
|
1740
1744
|
label: this.t({
|
|
1741
1745
|
zh: "Jev \u514D\u8D39\u7248\uFF08\u63A8\u8350\uFF09\uFF0C\u5728 OpenCode Zen \u4E0A\uFF1A\u4E0D\u7528\u5BC6\u94A5\uFF0C\u9650\u65F6\u514D\u8D39\uFF1B\u4EE5\u540E\u52A0\u4E86\u5BC6\u94A5\u81EA\u52A8\u6362\u7528",
|
|
1742
|
-
en: "Jev
|
|
1746
|
+
en: "Free Jev on OpenCode Zen (recommended): no key needed, free for a limited time; a key you add later takes over"
|
|
1743
1747
|
}),
|
|
1744
1748
|
value: "free"
|
|
1745
1749
|
});
|
|
@@ -1748,7 +1752,7 @@ var Setup = class {
|
|
|
1748
1752
|
choices.push({
|
|
1749
1753
|
label: this.t({
|
|
1750
1754
|
zh: "Jev\uFF08\u63A8\u8350\uFF09\uFF0C\u5728 OpenCode Zen \u4E0A\uFF0C\u7528\u4F60\u7684 OpenCode \u5BC6\u94A5\uFF0C\u6309\u6B21\u8BA1\u8D39",
|
|
1751
|
-
en: "Jev
|
|
1755
|
+
en: "Jev on OpenCode Zen with your OpenCode key (recommended), billed per call"
|
|
1752
1756
|
}),
|
|
1753
1757
|
value: "opencode"
|
|
1754
1758
|
});
|
|
@@ -1757,18 +1761,18 @@ var Setup = class {
|
|
|
1757
1761
|
choices.push({
|
|
1758
1762
|
label: this.t({
|
|
1759
1763
|
zh: `Jev\uFF08\u63A8\u8350\uFF09\uFF0C\u7528\u5DF2\u7ECF\u8BBE\u7F6E\u7684\u5BC6\u94A5\uFF08${where}\uFF09`,
|
|
1760
|
-
en: `Jev
|
|
1764
|
+
en: `Jev with the key that's already set (recommended): ${where}`
|
|
1761
1765
|
}),
|
|
1762
1766
|
value: "keep"
|
|
1763
1767
|
});
|
|
1764
1768
|
}
|
|
1765
1769
|
choices.push({
|
|
1766
|
-
label: where ? this.t({ zh: "Jev\uFF0C\u6362\u4E00\u4E2A\u65B0\u5BC6\u94A5", en: "Jev
|
|
1770
|
+
label: where ? this.t({ zh: "Jev\uFF0C\u6362\u4E00\u4E2A\u65B0\u5BC6\u94A5", en: "Jev with a new key" }) : opencode ? this.t({
|
|
1767
1771
|
zh: `Jev\uFF0C\u7528 TypeSafe \u7684\u5BC6\u94A5\uFF1A${JEV_PAGE}`,
|
|
1768
1772
|
en: `Jev with a TypeSafe key: ${JEV_PAGE}`
|
|
1769
1773
|
}) : this.t({
|
|
1770
|
-
zh: `Jev\uFF0C\u7528\u81EA\u5DF1\u7684\u5BC6\u94A5\uFF1A\
|
|
1771
|
-
en: `Jev with
|
|
1774
|
+
zh: `Jev\uFF0C\u7528\u81EA\u5DF1\u7684\u5BC6\u94A5\uFF1A\u6BCF\u4E2A\u95EE\u9898\u7EA6 0.3 \u79D2\uFF0C\u6309\u6B21\u8BA1\u8D39\u3002\u5BC6\u94A5\u5728 TypeSafe \u7533\u8BF7\uFF1A${JEV_PAGE}`,
|
|
1775
|
+
en: `Jev with your own key: about 0.3 s per question, billed per call. Get a key from TypeSafe: ${JEV_PAGE}`
|
|
1772
1776
|
}),
|
|
1773
1777
|
value: "jev"
|
|
1774
1778
|
});
|
|
@@ -1776,7 +1780,7 @@ var Setup = class {
|
|
|
1776
1780
|
choices.push({
|
|
1777
1781
|
label: this.t({
|
|
1778
1782
|
zh: "Jev \u514D\u8D39\u7248\uFF0C\u5728 OpenCode Zen \u4E0A\uFF1A\u4E0D\u7528\u5BC6\u94A5\uFF0C\u9650\u65F6\u514D\u8D39",
|
|
1779
|
-
en: "Jev
|
|
1783
|
+
en: "Free Jev on OpenCode Zen: no key needed, free for a limited time"
|
|
1780
1784
|
}),
|
|
1781
1785
|
value: "free"
|
|
1782
1786
|
});
|
|
@@ -1785,7 +1789,7 @@ var Setup = class {
|
|
|
1785
1789
|
choices.push({
|
|
1786
1790
|
label: this.t({
|
|
1787
1791
|
zh: `\u521A\u8BBE\u7F6E\u7684\u6A21\u578B\uFF08${model.provider}/${model.model}\uFF09\uFF1A\u66F4\u6162\uFF0C\u800C\u4E14\u6BCF\u6B21\u5224\u65AD\u90FD\u8981\u82B1 token`,
|
|
1788
|
-
en: `The model you just set up (${model.provider}/${model.model}): slower, and every
|
|
1792
|
+
en: `The model you just set up (${model.provider}/${model.model}): slower, and every verdict costs tokens`
|
|
1789
1793
|
}),
|
|
1790
1794
|
value: "model"
|
|
1791
1795
|
});
|
|
@@ -1793,14 +1797,14 @@ var Setup = class {
|
|
|
1793
1797
|
choices.push({
|
|
1794
1798
|
label: this.t({
|
|
1795
1799
|
zh: "\u6682\u65F6\u4E0D\u8981\uFF1Amu \u5C31\u50CF pi \u4E00\u6837\u5DE5\u4F5C\uFF0C\u6CA1\u6709\u5224\u5B9A\u5668\u56DE\u7B54",
|
|
1796
|
-
en: "Not now: mu
|
|
1800
|
+
en: "Not now: mu works like plain pi, with no judge"
|
|
1797
1801
|
}),
|
|
1798
1802
|
value: "none"
|
|
1799
1803
|
});
|
|
1800
1804
|
const picked = await this.choose(
|
|
1801
1805
|
this.t({
|
|
1802
1806
|
zh: "mu \u5DE5\u4F5C\u65F6\u8981\u505A\u5F88\u591A\u5C0F\u5224\u65AD\uFF1A\u8FD9\u6761\u6D88\u606F\u8BE5\u600E\u4E48\u5904\u7406\u3001\u8FD9\u4E00\u6B65\u4F1A\u4E0D\u4F1A\u8FDD\u53CD\u4F60\u5B9A\u7684\u89C4\u5219\u2026\u2026\u5224\u5B9A\u5668\u8D1F\u8D23\u56DE\u7B54\u3002\u9009\u54EA\u4E2A\u5224\u5B9A\u5668\uFF1F",
|
|
1803
|
-
en: "mu
|
|
1807
|
+
en: "As it works, mu faces many small decisions: how to handle a message, whether a step breaks your rules. A judge answers them. Which judge do you want?"
|
|
1804
1808
|
}),
|
|
1805
1809
|
choices
|
|
1806
1810
|
);
|
|
@@ -1814,7 +1818,7 @@ var Setup = class {
|
|
|
1814
1818
|
throw this.fail(
|
|
1815
1819
|
{
|
|
1816
1820
|
zh: "--judge opencode \u9700\u8981 OpenCode \u7684\u5BC6\u94A5\uFF1A\u7528 --service opencode \u8BBE\u7F6E\u5B83\uFF0C\u6216\u5148\u8BBE\u7F6E OPENCODE_API_KEY",
|
|
1817
|
-
en: "--judge opencode needs an OpenCode key: set
|
|
1821
|
+
en: "--judge opencode needs an OpenCode key: set one up with --service opencode, or set OPENCODE_API_KEY first"
|
|
1818
1822
|
},
|
|
1819
1823
|
SETUP_EXIT.usage
|
|
1820
1824
|
);
|
|
@@ -1829,14 +1833,14 @@ var Setup = class {
|
|
|
1829
1833
|
throw this.fail(
|
|
1830
1834
|
{
|
|
1831
1835
|
zh: "--judge jev \u9700\u8981 Jev \u5BC6\u94A5\uFF1A\u5199\u5728\u6807\u51C6\u8F93\u5165\u7684\u7B2C\u4E8C\u884C\uFF0C\u6216\u5148\u8BBE\u7F6E TYPESAFE_API_KEY",
|
|
1832
|
-
en: "--judge jev needs a Jev key: the second line of stdin, or TYPESAFE_API_KEY
|
|
1836
|
+
en: "--judge jev needs a Jev key: put it on the second line of stdin, or set TYPESAFE_API_KEY first"
|
|
1833
1837
|
},
|
|
1834
1838
|
SETUP_EXIT.usage
|
|
1835
1839
|
);
|
|
1836
1840
|
}
|
|
1837
1841
|
if (key === this.modelKey) {
|
|
1838
1842
|
throw this.fail(
|
|
1839
|
-
{ zh: "Jev \u5BC6\u94A5\u548C\u6A21\u578B\u7684\u5BC6\u94A5\u662F\u540C\u4E00\u4E2A", en: "the Jev key is the same as the model
|
|
1843
|
+
{ zh: "Jev \u5BC6\u94A5\u548C\u6A21\u578B\u7684\u5BC6\u94A5\u662F\u540C\u4E00\u4E2A", en: "the Jev key is the same as the model key" },
|
|
1840
1844
|
SETUP_EXIT.usage
|
|
1841
1845
|
);
|
|
1842
1846
|
}
|
|
@@ -1844,7 +1848,7 @@ var Setup = class {
|
|
|
1844
1848
|
if (current && current !== key && !this.args.yes) {
|
|
1845
1849
|
throw this.fail({
|
|
1846
1850
|
zh: `${this.path(this.deps.paths.envFile)} \u91CC\u5DF2\u7ECF\u6709 TYPESAFE_API_KEY\u3002\u8981\u66FF\u6362\u5B83\uFF0C\u52A0\u4E0A --yes`,
|
|
1847
|
-
en: `${this.path(this.deps.paths.envFile)} has a TYPESAFE_API_KEY
|
|
1851
|
+
en: `${this.path(this.deps.paths.envFile)} already has a TYPESAFE_API_KEY. To replace it, add --yes`
|
|
1848
1852
|
});
|
|
1849
1853
|
}
|
|
1850
1854
|
return { kind: "jev", key };
|
|
@@ -1860,14 +1864,14 @@ var Setup = class {
|
|
|
1860
1864
|
const key = await this.secret(
|
|
1861
1865
|
this.t({
|
|
1862
1866
|
zh: "\u7C98\u8D34 Jev \u5BC6\u94A5\uFF08TYPESAFE_API_KEY\uFF0C\u4E0D\u4F1A\u663E\u793A\uFF09\uFF1A",
|
|
1863
|
-
en: "Paste the Jev key (TYPESAFE_API_KEY
|
|
1867
|
+
en: "Paste the Jev key (TYPESAFE_API_KEY; it won't be shown): "
|
|
1864
1868
|
})
|
|
1865
1869
|
);
|
|
1866
1870
|
if (key === this.modelKey) {
|
|
1867
1871
|
this.io.say(
|
|
1868
1872
|
this.t({
|
|
1869
1873
|
zh: `\u8FD9\u662F\u521A\u624D\u7ED9\u6A21\u578B\u7684\u5BC6\u94A5\u3002Jev \u7684\u5BC6\u94A5\u5728 TypeSafe \u7533\u8BF7\uFF1A${JEV_PAGE}`,
|
|
1870
|
-
en: `That
|
|
1874
|
+
en: `That's the key you gave for the model. Get a Jev key from TypeSafe: ${JEV_PAGE}`
|
|
1871
1875
|
})
|
|
1872
1876
|
);
|
|
1873
1877
|
continue;
|
|
@@ -1935,7 +1939,7 @@ var Setup = class {
|
|
|
1935
1939
|
saved.push(
|
|
1936
1940
|
this.savedLine(
|
|
1937
1941
|
modelsPath,
|
|
1938
|
-
custom || moved ? this.t({ zh: `${provider}\uFF1A${reach.baseUrl}`, en: `${provider} at ${reach.baseUrl}` }) : this.t({ zh: `\u7ED9 ${provider} \u52A0\u4E0A ${model}`, en:
|
|
1942
|
+
custom || moved ? this.t({ zh: `${provider}\uFF1A${reach.baseUrl}`, en: `${provider} at ${reach.baseUrl}` }) : this.t({ zh: `\u7ED9 ${provider} \u52A0\u4E0A ${model}`, en: `added ${model} to ${provider}` })
|
|
1939
1943
|
)
|
|
1940
1944
|
);
|
|
1941
1945
|
}
|
|
@@ -1955,14 +1959,14 @@ var Setup = class {
|
|
|
1955
1959
|
saved.push(
|
|
1956
1960
|
this.savedLine(
|
|
1957
1961
|
settingsPath,
|
|
1958
|
-
this.t({ zh: `\u9ED8\u8BA4\u6A21\u578B ${provider}/${model}`, en: `
|
|
1962
|
+
this.t({ zh: `\u9ED8\u8BA4\u6A21\u578B ${provider}/${model}`, en: `default model ${provider}/${model}` })
|
|
1959
1963
|
)
|
|
1960
1964
|
);
|
|
1961
1965
|
} catch {
|
|
1962
1966
|
notes.push(
|
|
1963
1967
|
this.t({
|
|
1964
1968
|
zh: `${this.path(settingsPath)} \u8BFB\u4E0D\u4E86\uFF0C\u9ED8\u8BA4\u6A21\u578B\u6CA1\u6709\u4FDD\u5B58\u3002\u5728 mu \u91CC\u7528 /model \u9009\u5B83\u3002`,
|
|
1965
|
-
en:
|
|
1969
|
+
en: `Couldn't read ${this.path(settingsPath)}, so the default model wasn't saved. Choose it inside mu with /model.`
|
|
1966
1970
|
})
|
|
1967
1971
|
);
|
|
1968
1972
|
}
|
|
@@ -1976,14 +1980,14 @@ var Setup = class {
|
|
|
1976
1980
|
}
|
|
1977
1981
|
this.io.warn(this.t({ zh: `mu setup\uFF1A\u4FDD\u5B58\u65F6\u51FA\u9519\uFF1A${reason}`, en: `mu setup: saving failed: ${reason}` }));
|
|
1978
1982
|
if (saved.length > 0) {
|
|
1979
|
-
this.io.warn(this.t({ zh: "\u51FA\u9519\u524D\u5DF2\u7ECF\u4FDD\u5B58\u7684\uFF1A", en: "Saved before
|
|
1983
|
+
this.io.warn(this.t({ zh: "\u51FA\u9519\u524D\u5DF2\u7ECF\u4FDD\u5B58\u7684\uFF1A", en: "Saved before the error:" }));
|
|
1980
1984
|
for (const entry of saved) this.io.warn(entry);
|
|
1981
1985
|
}
|
|
1982
1986
|
if (backups.path) {
|
|
1983
1987
|
this.io.warn(
|
|
1984
1988
|
this.t({
|
|
1985
1989
|
zh: `\u539F\u6765\u7684\u6587\u4EF6\u5728 ${this.path(backups.path)}`,
|
|
1986
|
-
en: `The
|
|
1990
|
+
en: `The previous versions are in ${this.path(backups.path)}`
|
|
1987
1991
|
})
|
|
1988
1992
|
);
|
|
1989
1993
|
}
|
|
@@ -1997,7 +2001,7 @@ var Setup = class {
|
|
|
1997
2001
|
this.io.say(
|
|
1998
2002
|
this.t({
|
|
1999
2003
|
zh: `\u6539\u52A8\u524D\u7684\u6587\u4EF6\u5DF2\u590D\u5236\u5230 ${this.path(backups.path)}`,
|
|
2000
|
-
en: `
|
|
2004
|
+
en: `Backed up the previous files to ${this.path(backups.path)}`
|
|
2001
2005
|
})
|
|
2002
2006
|
);
|
|
2003
2007
|
}
|
|
@@ -2024,7 +2028,7 @@ var Setup = class {
|
|
|
2024
2028
|
notes.push(
|
|
2025
2029
|
this.t({
|
|
2026
2030
|
zh: `${this.path(configPath)} \u4E0D\u662F\u7EAF JSON\uFF0C\u6CA1\u6709\u6539\u5B83\u3002\u8BF7\u624B\u52A8\u52A0\u4E0A "tiers": ${JSON.stringify(tiers)}`,
|
|
2027
|
-
en: `${this.path(configPath)}
|
|
2031
|
+
en: `${this.path(configPath)} isn't plain JSON, so it was left unchanged. Add "tiers": ${JSON.stringify(tiers)} by hand.`
|
|
2028
2032
|
})
|
|
2029
2033
|
);
|
|
2030
2034
|
} else if (tiers) {
|
|
@@ -2047,7 +2051,7 @@ var Setup = class {
|
|
|
2047
2051
|
notes.push(
|
|
2048
2052
|
this.t({
|
|
2049
2053
|
zh: `\u6CE8\u610F\uFF1A\u73AF\u5883\u53D8\u91CF\u91CC\u4E5F\u6709 TYPESAFE_API_KEY\uFF0C\u5B83\u6BD4 ${this.path(paths.envFile)} \u4F18\u5148\u3002\u5230\u8BBE\u7F6E\u5B83\u7684\u5730\u65B9\uFF08\u4F8B\u5982 ~/.zshrc\uFF09\u6539\u6389\u6216\u5220\u6389\u3002`,
|
|
2050
|
-
en: `Note: TYPESAFE_API_KEY is also set in your environment
|
|
2054
|
+
en: `Note: TYPESAFE_API_KEY is also set in your environment and takes precedence over ${this.path(paths.envFile)}. Change or remove it where it's set (~/.zshrc, for example).`
|
|
2051
2055
|
})
|
|
2052
2056
|
);
|
|
2053
2057
|
}
|
|
@@ -2057,7 +2061,7 @@ var Setup = class {
|
|
|
2057
2061
|
notes.push(
|
|
2058
2062
|
this.t({
|
|
2059
2063
|
zh: `\u6CE8\u610F\uFF1A\u73AF\u5883\u53D8\u91CF MU_JUDGE=${override} \u6BD4 mu.json \u4F18\u5148\uFF0C\u7531\u5B83\u51B3\u5B9A\u5224\u5B9A\u5668\u3002`,
|
|
2060
|
-
en: `Note: MU_JUDGE=${override} is set in your environment
|
|
2064
|
+
en: `Note: MU_JUDGE=${override} is set in your environment and takes precedence over mu.json for the judge.`
|
|
2061
2065
|
})
|
|
2062
2066
|
);
|
|
2063
2067
|
}
|
|
@@ -2065,18 +2069,18 @@ var Setup = class {
|
|
|
2065
2069
|
summary(target, model, judge) {
|
|
2066
2070
|
const done = target && model ? this.t({
|
|
2067
2071
|
zh: `\u5B8C\u6210\u3002mu \u4F1A\u7528 ${this.name(target.service)} \xB7 ${model} \u5F00\u59CB\u5DE5\u4F5C\u3002`,
|
|
2068
|
-
en: `Done. mu
|
|
2072
|
+
en: `Done. mu will start on ${this.name(target.service)} \xB7 ${model}.`
|
|
2069
2073
|
}) : this.t({ zh: "\u5B8C\u6210\u3002", en: "Done." });
|
|
2070
2074
|
const judged = judge === void 0 ? "" : judge.kind === "model" ? this.t({ zh: "\u5224\u5B9A\u5668\uFF1A\u540C\u4E00\u4E2A\u6A21\u578B\u3002", en: " Judge: the same model." }) : judge.kind === "none" ? this.t({ zh: "\u5224\u5B9A\u5668\uFF1A\u6682\u65F6\u6CA1\u6709\u3002", en: " Judge: none for now." }) : judge.kind === "opencode" ? this.t({ zh: "\u5224\u5B9A\u5668\uFF1AOpenCode Zen \u4E0A\u7684 Jev\u3002", en: " Judge: Jev on OpenCode Zen." }) : judge.kind === "free" ? this.t({
|
|
2071
2075
|
zh: "\u5224\u5B9A\u5668\uFF1AJev\uFF0C\u52A0\u5BC6\u94A5\u4E4B\u524D\u7528 OpenCode Zen \u4E0A\u9650\u65F6\u514D\u8D39\u7684\u7248\u672C\u3002",
|
|
2072
|
-
en: " Judge: Jev, free on OpenCode Zen
|
|
2076
|
+
en: " Judge: Jev, using the free version on OpenCode Zen until you add a key."
|
|
2073
2077
|
}) : this.t({ zh: "\u5224\u5B9A\u5668\uFF1AJev\u3002", en: " Judge: Jev." });
|
|
2074
2078
|
this.io.say("");
|
|
2075
2079
|
this.io.say(`${done}${judged}`);
|
|
2076
2080
|
this.io.say(
|
|
2077
2081
|
target ? this.t({
|
|
2078
2082
|
zh: "\u5728 mu \u91CC\u7528 /model \u6362\u6A21\u578B\uFF1B\u968F\u65F6\u53EF\u4EE5\u518D\u8FD0\u884C mu setup\u3002",
|
|
2079
|
-
en: "Switch models inside mu with /model
|
|
2083
|
+
en: "Switch models inside mu with /model, and run mu setup again any time."
|
|
2080
2084
|
}) : this.t({ zh: "\u542F\u52A8 mu \u540E\u8F93\u5165 /login \u767B\u5F55\u3002", en: "Start mu and type /login to sign in." })
|
|
2081
2085
|
);
|
|
2082
2086
|
}
|