dsh-agent-sdk-bridge 1.1.7 → 1.2.0

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/DEVELOPMENT.md CHANGED
@@ -8,7 +8,39 @@
8
8
  登录区域),其余代码按 brand 参数化。CN Qoder SDK 静态引入;另两个 SDK 按需 `import()`,
9
9
  没装时只有对应页面报错,插件照常加载。
10
10
  - **品牌隔离**:各 provider 的 CLI 查找、模型目录缓存、会话池、账户读取、模型开关全部按 brand
11
- 分开。`QODERCLI_PATH` 若指向另一 Qoder 版本,对应版本会明确报错而不是借用那个 CLI 的账号。
11
+ 分开。`QODERCLI_PATH` 是机器级变量,不少 CN 安装会全局导出它;两个 SDK 又都在读到我们传的
12
+ 选项之前就先读它,所以 `cliChildEnv()` 会从**子进程环境**里删掉指向另一版本的 `QODERCLI_PATH`
13
+ (中立路径保留)。查找本身也永远不把另一版本的路径当作本版本候选。`foreignCliOverride()`
14
+ 现在只作诊断:本版本完全没有自己的 CLI 时才指出「那个变量属于另一版本」,绝不会因为它的存在
15
+ 而让本版本拒绝启动——旧代码把它当致命错误,于是一台只装了国际版(或只装了 CN)的机器,
16
+ 另一个页面即使装好 CLI 也登不进去。
17
+ - **SDK 与 CLI 的版本是绑定的**:每个 SDK 发布版在 `dist/runtime-manifest.json` 里钉住一个
18
+ `qoderCliVersion`,两边说的是同一条 wire protocol。CLI 1.1.81 移除了旧 SDK 的 worker 会话握手,
19
+ 于是 SDK 1.0.51 的每次查询都以 `Qoder CLI process exited with code 42` 结束,CLI 自己的日志写的
20
+ 是 `sdk_worker_removed: … Upgrade to the latest Qoder SDK version, or roll back the CLI`。
21
+ 因此:`dependencies` 里的两个 Qoder SDK 锁在同一个大版本(1.0.58 ↔ CLI 1.1.81);
22
+ 两个 `setup-*.bat` 从 SDK 清单读出 `qoderCliVersion` 并安装**那个精确版本**(不是 latest);
23
+ `requiredCliVersion()` / `installedCliVersion()` 都从磁盘读(后者读 npm 包的 manifest,不 spawn),
24
+ `/setup` 据此回传 `requiredCliVersion` / `cliVersion` / `versionMismatch`,页面在登录前就红字提示;
25
+ `cliFailureText()` 把 code 42 翻译成「点一键配置装配套版本」,并把原始信息附在后面。
26
+ 另注:`sdkDir()` 要剥掉 `dist` 这一层——`resolve()` 返回的是包内入口,直接 `dirname` 得到的是
27
+ `dist`,再拼 `dist/runtime-manifest.json` 就成了 `dist/dist/…`,两个探测都会静默失败。
28
+ - **Qoder 目录要先读账号**:SDK 1.0.58 里,在 `accountInfo()` 之前调 `getAvailableModels()` 会返回
29
+ 空数组(CLI 的 `--list-models` 同账号却能打出 11 条)。先在同一个 session 里取账号、再带 `uid`
30
+ 查目录才稳定;空答案时再依次回落 `fetchStrategy: 'cache'` → `'live'`。否则设置页显示 0/0,
31
+ 看起来像「没装 CLI」,实际只是读序不对。
32
+ - **CLI 查找要认包清单**:`bundle/<name>.js` 是常见布局,不是唯一布局。`packageEntries()` 还会
33
+ 读包自己的 `package.json`(`main`/`bin`),并把 Windows 的 `<node>/node_modules` 与 unix 的
34
+ `<prefix>/lib/node_modules` 都当作全局根。只猜 `bundle/` 会把已安装的 CLI 判成未安装,
35
+ 页面就一直要你「再装一次」。
36
+ - **卸载要清干净**:npm 只删包,会留下空的 `node_modules/@qoder-ai`(或 `@qodercn-ai`)目录和
37
+ `qodercli.cmd`/`.ps1` 之类 shim,而 CLI 查找和页面的「已安装」徽标读的正是这些。两个
38
+ `setup-*.bat` 的 `--uninstall` 会在 `npm uninstall -g` 之后删掉 shim 与空 scope 目录,
39
+ 页面的「已安装」状态则来自 `readSetupStatus().installed`(每次现查 `resolveQoderCli()`),
40
+ 所以卸载后主按钮会变回「安装 CLI」,而不是继续显示「卸载」。
41
+ - **登录可取消**:`qodercli login` 会一直等浏览器回调,用户关掉标签页后旧代码只能空转。
42
+ `POST /setup {mode:'cancel'}` → `cancelSetup()` 杀掉子进程并把这次 run 标记为已结束
43
+ (`code: null`、`cancelled: true`),页面每 1.2 秒轮询一次状态,因此按钮会立刻回来。
12
44
  - **Qoder 的声明窗口必须稳定**:Qoder 的 `context_usage_ratio` 是「按 CLI 实际运行的窗口」算的,
13
45
  而 DSH 又用适配器上报的 `contextWindow` 当分母。两者一变,环就会跳。实测目录里 `dfmodel`
14
46
  等模型声明 `availableContextWindows: [200000, 400000, 1000000]`、默认 200000,用户选 1M 是
@@ -45,6 +77,19 @@
45
77
  仍会丢弃任何非宿主前缀的 tool_use,防止模型臆造工具名。CodeBuddy 会把 MCP server 名里的
46
78
  非字母数字字符规范成 `_`(`dsh-host` → `mcp__dsh_host__<tool>`),Qoder CLI 保留连字符,
47
79
  因此 `isHostTool()` / `hostToolName()` 同时接受两种拼写。
80
+ - **切换模型读缓存**:`resolveModel` 与 `capture()` 走 `cachedModels()`
81
+ (`src/model-cache.ts`):有快照就先返回快照,刷新在后台跑;只有从未读到过目录时才等待。
82
+ 三家的目录获取都很贵(Qoder 冷启动 CLI,最长等于 fetch 超时;CodeBuddy 要启进程;MiniMax
83
+ 走 ACP 探测),而宿主在每次切模型、切思考档位时都会重新解析一次,所以以前 TTL 一过期就会
84
+ 卡住菜单。三家 catalog 都新增了 `snapshot()`(只读内存,不发网络)供这里使用。
85
+ 同步探测(`regionBlocked`、额度)不受影响,它们仍走各自的正常读取。
86
+ - **默认思考档位取最强的一档**:`reasoningInfo()` 的第二个参数是**用户配置**的档位,不再是上游
87
+ 声明的 `defaultEffort`;留空时由 `strongestEffort()` 按 `none < minimal < low < medium <
88
+ high < xhigh < max` 取该模型支持的最强档(三家词表不同:Qoder `low|medium|high|max`、
89
+ MiniMax `low|high`、CodeBuddy 由目录声明)。宿主在请求未带档位时会应用我们声明的
90
+ `defaultEffort`(`requested ?? reasoning.defaultEffort`),所以这里选什么,实际就跑什么;
91
+ 上游自己的默认值会偏低(CodeBuddy 的 `high` 在可选 `max` 时就不再直接采用)。配置的档位若
92
+ 模型不支持,会退回最强档,而不是把这一轮判成 `UNSUPPORTED_REASONING_EFFORT`。
48
93
  - **CodeBuddy 模型选择按区域**:`codebuddyGlobalDisabledModels` /
49
94
  `codebuddyCnDisabledModels` 与 `codebuddyGlobalModelContextWindows` /
50
95
  `codebuddyCnModelContextWindows` 是四个独立字段,`CodeBuddyAdapter` 按 region 读取,
package/FAQ.md CHANGED
@@ -2,11 +2,35 @@
2
2
 
3
3
  使用中遇到的问题与历史修复记录。返回 [README](./README.md)。
4
4
 
5
- **国际版页面提示「QODERCLI_PATH 指向了另一版本的 CLI」?** 这是有意的隔离。部分 CN 安装会在
6
- 环境里设置 `QODERCLI_PATH`,而两个官方 SDK 都会在读取任何参数之前先看这个变量。如果放行,国际版
7
- 会话会启动 `qoderclicn`、拿 CN 账号作答——模型目录和额度都会串台。插件因此只在它不指向另一版本
8
- 时采用;国际版自己的覆盖变量是 `QODER_CLI_PATH`。要么装好 `qodercli`(插件会优先用它),要么把
9
- 该变量指向国际版 CLI。
5
+ **登录后对话直接报 `Qoder CLI process exited with code 42`?** 这是 CLI 与插件 SDK 的版本不匹配:
6
+ 每个 SDK 发布版都钉住一个 CLI 版本,两边说的是同一条协议。CLI 1.1.81 移除了旧 SDK 的会话握手,
7
+ 旧 SDK 每次查询都会被 CLI 以退出码 42 结束(CLI 日志原文 `sdk_worker_removed: … Upgrade to the
8
+ latest Qoder SDK version, or roll back the CLI`)。插件已把两个 SDK 升到 1.0.58(对应 CLI 1.1.81),
9
+ 并且「一键配置」现在按 SDK 清单安装**精确版本**而不是 latest。升级插件后:设置页会直接显示
10
+ 「CLI 版本与插件不匹配:本机 x,插件需要 y」,点「安装 CLI」重装即可;如果版本已经一致还报 42,
11
+ 重启 DSH Web 让新版 SDK 生效。
12
+
13
+ **只启用国内版 / 只启用国际版,另一个版本没装,会不会互相影响?** 不会(这是修过的 bug)。
14
+ `QODERCLI_PATH` 是机器级变量,不少 CN 安装会全局导出它;两个官方 SDK 又都在读到插件传的参数
15
+ 之前先看它。旧代码一旦发现它指向另一版本就判为致命错误,于是一台只装了国际版的机器,国内版
16
+ 页面即使后来装好了 `qoderclicn` 也登不进去——两个版本被这个变量绑在一起。现在查找各自只认
17
+ 自己的包与状态目录,并且会把指向另一版本的 `QODERCLI_PATH` 从**子进程环境**里删掉(中立路径
18
+ 保留);只有本版本完全没有自己的 CLI 时,页面才会提示「那个变量属于另一版本」。两个版本的
19
+ 安装、登录、卸载因此完全独立。
20
+
21
+ **卸载了 CLI,页面上还是「卸载」按钮、目录里还有残留?** 已修复。npm 只删包,会留下空的
22
+ `node_modules/@qoder-ai`(或 `@qodercn-ai`)目录和 `qodercli.cmd` / `.ps1` 这些 shim,而插件的
23
+ CLI 查找和页面徽标读的正是它们。现在 `--uninstall` 会在 `npm uninstall -g` 之后删掉 shim 与空
24
+ scope 目录;页面上的「已安装」也改成每次现查机器,所以卸载后主按钮立刻变回「安装 CLI」,
25
+ 登录 / 卸载按钮只在已安装时出现。
26
+
27
+ **点「重新登录」后关掉了浏览器,页面就一直转圈?** 已修复,并新增「取消」。`qodercli login`
28
+ 会一直等浏览器回调,关掉标签页就没有返回值。现在运行中会出现「取消」按钮:点它会终止这次
29
+ 脚本、把状态标记为已取消,按钮立刻恢复,可以重新登录。
30
+
31
+ **国际版页面提示「QODERCLI_PATH 指向了另一版本的 CLI」?** 只有在国际版本机完全没有自己的
32
+ `qodercli` 时才会这样提示,属于诊断而非拦截。装好 `qodercli`(或把 `QODER_CLI_PATH` 指向它)
33
+ 即可;插件绝不会把 CN 的 CLI 借给国际版会话,因为那会拿 CN 账号作答。
10
34
 
11
35
  **额度卡片显示「无法读取额度」?** 卡片里的文字就是原因:CLI 未安装 / 未登录 / 额度接口暂时
12
36
  不可用。额度读取走的是 CLI 自己的凭证,所以先确认对应版本的 `status` 能列出用户名;点「刷新额度」
@@ -101,6 +125,17 @@ SQLite 依赖就在这些脚本里,普通 `npm i -g` 装出来的 `mcode` 一
101
125
  时使用该区域自己的登录态;要换站请先在原站点点「退出登录」。两个区域的模型开关与上下文窗口
102
126
  仍然分别保存,切回已登录的区域会直接恢复选择。
103
127
 
128
+ **切模型时默认选哪一档思考强度?** 选该模型支持的最强档(有 `max` 就选 `max`,否则取它声明的
129
+ 最高档;只有 `low` / `high` 的模型取 `high`)。以前沿用上游自己的默认值,而它常常偏低:
130
+ CodeBuddy 的 `GLM-5.3` 在可选 `max` 时仍声明默认 `high`。在高级设置里填了
131
+ `defaultReasoningEffort` 时以它为准;该档位模型不支持时退回最强档。
132
+
133
+ **切换模型或思考档位时会卡一下?** 宿主每次切换都会重新解析一次模型元数据(档位、上下文窗口、
134
+ 读图能力),而这三个 provider 的模型目录都要拉起各自的 CLI 或 ACP 进程才能读到。以前这次解析会
135
+ 等待目录刷新,缓存一过期就要等一次完整读取(Qoder 冷启动最久)。现在解析先用上一次成功读到的
136
+ 目录立刻返回,刷新在后台进行;只有从未读到过目录的第一次解析才会等待。目录自身的 TTL 与失败
137
+ 回退规则不变。
138
+
104
139
  **切到 MiniMax 国际站后提示「本机 IP 不在服务区域」?** 这不是登录过期,而是网络位置被拒。
105
140
  MiniMax 的边缘节点在收到跨区请求时会返回 `307`,把 `.io` 重定向到 `.minimaxi.com`(反向亦然)。
106
141
  两个域名是不同 origin,浏览器/Node 跟随重定向时 `Authorization` 头会被丢弃,于是账号接口变成空的
package/client.js CHANGED
@@ -86,6 +86,13 @@ window.__ModuleLoader__.load({
86
86
  cliUninstallConfirm: '确定要卸载本机的 Qoder CLI 吗?卸载后需要重新安装才能继续使用,登录凭证会保留。',
87
87
  cliUninstalling: '正在卸载…',
88
88
  cliUninstallOk: 'CLI 已卸载',
89
+ cliInstall: '安装 CLI',
90
+ cliInstalled: '已安装',
91
+ cliCancel: '取消',
92
+ cliCancelling: '正在取消…',
93
+ cliCancelled: '已取消,可以重新操作',
94
+ cliVersionMismatch: 'CLI 版本与插件不匹配:本机',
95
+ cliVersionMismatchTail: ',插件需要',
89
96
  intlNav: 'Qoder 国际版',
90
97
  intlTitle: 'Qoder 国际版',
91
98
  intlIntro: '国际版账户(qoder.com)的模型与额度。勾选要启用的模型,并为需要的模型指定上下文窗口。改动即时生效,无需重启。',
@@ -113,6 +120,7 @@ window.__ModuleLoader__.load({
113
120
  usageUpdated: '更新于',
114
121
  usageUnknownPlan: '未知套餐',
115
122
  usageStale: '显示上次读数,刷新失败',
123
+ usageCliMissing: '未检测到本机 CLI,安装并登录后才会显示额度。',
116
124
  pluginOptionsTitle: '启用的版本',
117
125
  pluginOptionsHint: '关闭后,对应设置页、模型列表与模型分组都会移除;已保存的模型选择保留,重新打开即可恢复。',
118
126
  pluginOptionsOn: '显示中',
@@ -275,6 +283,13 @@ window.__ModuleLoader__.load({
275
283
  cliUninstallConfirm: 'Uninstall the Qoder CLI from this machine? It must be installed again to keep using this edition. Sign-in files are kept.',
276
284
  cliUninstalling: 'Uninstalling…',
277
285
  cliUninstallOk: 'CLI uninstalled',
286
+ cliInstall: 'Install CLI',
287
+ cliInstalled: 'Installed',
288
+ cliCancel: 'Cancel',
289
+ cliCancelling: 'Cancelling…',
290
+ cliCancelled: 'Cancelled — you can start again',
291
+ cliVersionMismatch: 'CLI version does not match the plugin: this machine has',
292
+ cliVersionMismatchTail: 'but the plugin needs',
278
293
  intlNav: 'Qoder International',
279
294
  intlTitle: 'Qoder International',
280
295
  intlIntro: 'Models and quota for the international account (qoder.com). Tick the models you want available and set a context window where needed. Changes apply immediately.',
@@ -302,6 +317,7 @@ window.__ModuleLoader__.load({
302
317
  usageUpdated: 'Updated',
303
318
  usageUnknownPlan: 'Unknown plan',
304
319
  usageStale: 'Showing the last reading; refresh failed',
320
+ usageCliMissing: 'This machine has no CLI for this edition; quota appears after it is installed and signed in.',
305
321
  pluginOptionsTitle: 'Enabled editions',
306
322
  pluginOptionsHint: 'Turning one off removes its settings page, model list, and model group. Saved model choices are kept, so turning it back on restores them.',
307
323
  pluginOptionsOn: 'Shown',
@@ -644,6 +660,24 @@ window.__ModuleLoader__.load({
644
660
  }
645
661
  }
646
662
 
663
+ /**
664
+ * Forget one cached answer.
665
+ *
666
+ * Needed when the cache has become wrong rather than merely old: after an
667
+ * uninstall the stored quota describes an account read through a CLI that
668
+ * is no longer on the machine, and painting it again on the next render
669
+ * would keep showing numbers nobody can reproduce.
670
+ */
671
+ function clearCache(brand, kind) {
672
+ const key = cacheKey(brand, kind)
673
+ cacheMemory.delete(key)
674
+ try {
675
+ window.localStorage.removeItem(key)
676
+ } catch {
677
+ /* storage unavailable: the in-memory copy is already gone */
678
+ }
679
+ }
680
+
647
681
  /** Call the plugin's model API. */
648
682
  async function api(path, options) {
649
683
  const { timeout = 30_000, ...rest } = options ?? {}
@@ -860,6 +894,8 @@ window.__ModuleLoader__.load({
860
894
  const [snapshot, setSnapshot] = useState(() => readCache(brand.id, 'usage'))
861
895
  const [failure, setFailure] = useState(undefined)
862
896
  const [busy, setBusy] = useState(false)
897
+ /** The CLI is not installed: show that, and never any cached numbers. */
898
+ const [missing, setMissing] = useState(false)
863
899
  const ticket = useRef(0)
864
900
 
865
901
  const load = useCallback(async (fresh = false) => {
@@ -869,12 +905,25 @@ window.__ModuleLoader__.load({
869
905
  try {
870
906
  const payload = await api(`/usage?brand=${brand.id}${fresh ? '&fresh=1' : ''}`, { timeout: 45_000 })
871
907
  if (mine !== ticket.current) return
872
- // A failed account lookup (signed out, endpoint down) must not replace
908
+ // The CLI is gone: the stored reading describes an installation that
909
+ // no longer exists, so drop it (memory and storage) instead of
910
+ // labelling old credits "last reading". This is what makes the card
911
+ // empty out after an uninstall.
912
+ if (payload?.cliMissing === true) {
913
+ clearCache(brand.id, 'usage')
914
+ setSnapshot(undefined)
915
+ setMissing(true)
916
+ setFailure(String(payload.error ?? t('usageCliMissing')))
917
+ return
918
+ }
919
+ // Any other failed lookup (signed out, endpoint down) must not replace
873
920
  // the last good reading with an empty card: keep it and say so.
874
921
  if (payload?.usage === undefined && payload?.error !== undefined) {
922
+ setMissing(false)
875
923
  setFailure(String(payload.error))
876
924
  return
877
925
  }
926
+ setMissing(false)
878
927
  setSnapshot(payload)
879
928
  writeCache(brand.id, 'usage', payload)
880
929
  } catch (err) {
@@ -911,9 +960,14 @@ window.__ModuleLoader__.load({
911
960
  if (snapshot === undefined || usage === undefined) {
912
961
  return h('div', { style: css.usageCard },
913
962
  head,
914
- error === undefined
915
- ? h('div', { style: css.note }, t('usageLoading'))
916
- : h('div', { style: css.err }, `${t('usageUnavailable')}:${error}`),
963
+ // Nothing is shown for a missing CLI beyond the reason: the account,
964
+ // plan and credits a previous install reported are not this machine's
965
+ // state any more.
966
+ missing
967
+ ? h('div', { style: css.note }, error ?? t('usageCliMissing'))
968
+ : error === undefined
969
+ ? h('div', { style: css.note }, t('usageLoading'))
970
+ : h('div', { style: css.err }, `${t('usageUnavailable')}:${error}`),
917
971
  error === undefined
918
972
  ? null
919
973
  : h('div', { style: css.bar },
@@ -2077,6 +2131,14 @@ window.__ModuleLoader__.load({
2077
2131
  const setupCode = setup !== undefined && setup.running === false ? setup.code : undefined
2078
2132
  const setupFinishedAt = setup?.finishedAt
2079
2133
  const setupLines = Array.isArray(setup?.lines) ? setup.lines : []
2134
+ // `installed` is read from the host's own CLI lookup, so the button
2135
+ // follows the machine rather than the last run: after an uninstall it
2136
+ // reads false even though that run exited 0, and the page offers
2137
+ // "install" again instead of a dead "uninstall". Until the first status
2138
+ // arrives the old layout is kept, so opening the page does not flash an
2139
+ // "install" button on a machine that already has the CLI.
2140
+ const cliInstalled = setup === undefined ? true : setup.installed === true
2141
+ const setupCancelled = setup?.cancelled === true
2080
2142
 
2081
2143
  useEffect(() => { void pollSetup() }, [pollSetup])
2082
2144
  useEffect(() => {
@@ -2311,10 +2373,36 @@ window.__ModuleLoader__.load({
2311
2373
  brand.kind !== 'qoder' ? null : h('div', { style: css.group },
2312
2374
  h('h3', { style: css.h3 }, t(brand.cliGroupKey)),
2313
2375
  h('div', { style: css.note }, t(brand.cliHintKey)),
2376
+ // Each SDK release pins one CLI build; a mismatch kills every session
2377
+ // with a bare exit code, so warn before the user signs in or chats.
2378
+ setup?.versionMismatch === true
2379
+ ? h('div', { style: { ...css.err, marginTop: '6px' } },
2380
+ `${t('cliVersionMismatch')} ${setup.cliVersion ?? '?'} ${t('cliVersionMismatchTail')} ${setup.requiredCliVersion ?? '?'}`)
2381
+ : null,
2314
2382
  h('div', { style: { ...css.bar, flexWrap: 'nowrap' } },
2315
- h('button', { style: css.btn, disabled: setupRunning, onClick: () => void startCliSetup('configure') }, t('cliRun')),
2316
- h('button', { style: css.btn, disabled: setupRunning, onClick: () => void startCliSetup('login') }, t('cliLogin')),
2317
- h('button', { style: { ...css.btn, ...css.btnAlert }, disabled: setupRunning, onClick: uninstallCli }, t('cliUninstall')),
2383
+ // The primary action follows the machine: install when the CLI is
2384
+ // gone, configure/re-login when it is there. Offering "uninstall"
2385
+ // on a machine that has none was the confusing half of the old
2386
+ // fixed trio.
2387
+ cliInstalled
2388
+ ? h('button', { style: css.btn, disabled: setupRunning, onClick: () => void startCliSetup('configure') },
2389
+ setup?.versionMismatch === true ? t('cliInstall') : t('cliRun'))
2390
+ : h('button', { style: css.btn, disabled: setupRunning, onClick: () => void startCliSetup('configure') }, t('cliInstall')),
2391
+ cliInstalled
2392
+ ? h('button', { style: css.btn, disabled: setupRunning, onClick: () => void startCliSetup('login') }, t('cliLogin'))
2393
+ : null,
2394
+ cliInstalled
2395
+ ? h('button', { style: { ...css.btn, ...css.btnAlert }, disabled: setupRunning, onClick: uninstallCli }, t('cliUninstall'))
2396
+ : null,
2397
+ // The login step waits for a browser callback; closing that tab
2398
+ // used to leave this row spinning forever. Cancelling settles the
2399
+ // run so the buttons come back.
2400
+ setupRunning
2401
+ ? h('button', {
2402
+ style: { ...css.btn, ...css.btnAlert },
2403
+ onClick: () => void startCliSetup('cancel'),
2404
+ }, t('cliCancel'))
2405
+ : null,
2318
2406
  setupLines.length > 0 && !setupRunning
2319
2407
  ? h('button', { style: css.btn, onClick: () => setLogOpen(value => !value) }, logOpen ? t('cliHideLog') : t('cliShowLog'))
2320
2408
  : null,
@@ -2322,14 +2410,16 @@ window.__ModuleLoader__.load({
2322
2410
  ? (setup?.mode === 'uninstall' ? t('cliUninstalling') : t('cliRunning'))
2323
2411
  : setupError !== undefined
2324
2412
  ? setupError
2325
- : setupCode === 0
2326
- ? (setup?.mode === 'uninstall' ? t('cliUninstallOk') : t('cliExitOk'))
2327
- : setupCode === undefined || setupCode === null
2328
- ? ''
2329
- : `${t('cliExitFail')} ${setupCode}`),
2413
+ : setupCancelled
2414
+ ? t('cliCancelled')
2415
+ : setupCode === 0
2416
+ ? (setup?.mode === 'uninstall' ? t('cliUninstallOk') : t('cliExitOk'))
2417
+ : setupCode === undefined || setupCode === null
2418
+ ? ''
2419
+ : `${t('cliExitFail')} ${setupCode}`),
2330
2420
  ),
2331
2421
  logOpen && setupLines.length > 0
2332
- ? h('pre', { ref: logRef, style: css.log }, setupLines.join('\n'))
2422
+ ? h('pre', { ref: logRef, style: css.log }, setupLines.join('\\n'))
2333
2423
  : null,
2334
2424
  ),
2335
2425