u1s1-cli 1.14.2 → 1.14.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u1s1-cli",
3
- "version": "1.14.2",
3
+ "version": "1.14.4",
4
4
  "description": "u1s1 — 有一说一,最省心的 AI 编程搭子。终端里用中文说需求,AI 帮你读文件、改代码、跑命令。",
5
5
  "type": "module",
6
6
  "bin": {
@@ -42,7 +42,12 @@
42
42
  "license": "MIT",
43
43
  "homepage": "https://u1s1app.com",
44
44
  "dependencies": {
45
+ "@earendil-works/pi-agent-core": "1.2.0",
46
+ "@earendil-works/pi-ai": "1.2.0",
47
+ "@earendil-works/pi-codemode": "1.2.0",
45
48
  "@earendil-works/pi-coding-agent": "1.2.0",
49
+ "@earendil-works/pi-mcp": "1.2.0",
50
+ "@earendil-works/pi-telemetry": "1.2.0",
46
51
  "@earendil-works/pi-tui": "1.2.0",
47
52
  "typebox": "1.3.7"
48
53
  },
@@ -374,6 +374,14 @@ const MCP_UI_REPLACEMENTS = [
374
374
  ["new Text(this.theme.fg(\"muted\", \"Approve access in your browser. If it did not open, visit:\"), 1, 0),", "new Text(this.theme.fg(\"muted\", process.env.U1S1_LANG === \"en\" ? \"Approve access in your browser. If it did not open, visit:\" : \"请在浏览器里同意授权。浏览器没自动打开的话,访问:\"), 1, 0),"],
375
375
  ["new Text(this.theme.fg(\"muted\", \"If the browser runs on another machine, paste the URL it was redirected to:\"), 1, 0),", "new Text(this.theme.fg(\"muted\", process.env.U1S1_LANG === \"en\" ? \"If the browser runs on another machine, paste the URL it was redirected to:\" : \"浏览器在另一台机器上的话,把它跳转到的网址粘贴到这里:\"), 1, 0),"],
376
376
  ];
377
+ // 网络补丁(dist/core/http-dispatcher.js):undici 默认 10 秒连接超时,丢包线路上 TLS 握手常要 10 秒以上,
378
+ // 到网关的请求直接报 fetch failed(UND_ERR_CONNECT_TIMEOUT)。放宽到 30 秒;pi 每次重建 dispatcher 都走这里。
379
+ const HTTP_DISPATCHER_REPLACEMENTS = [
380
+ [
381
+ "autoSelectFamilyAttemptTimeout: DEFAULT_AUTO_SELECT_FAMILY_ATTEMPT_TIMEOUT_MS,",
382
+ "autoSelectFamilyAttemptTimeout: DEFAULT_AUTO_SELECT_FAMILY_ATTEMPT_TIMEOUT_MS,\n // u1s1: undici's 10s default drops slow TLS handshakes on lossy routes to the gateway.\n timeout: 30_000,",
383
+ ],
384
+ ];
377
385
  // codemode 工具结果(dist/extensions/codemode/renderer.js)的固定文案
378
386
  const CODEMODE_RENDER_REPLACEMENTS = [
379
387
  ['theme.fg("muted", `Model calls: ${formatCost(total)}`)', 'theme.fg("muted", process.env.U1S1_LANG === "en" ? `Model calls: ${formatCost(total)}` : `模型调用:${formatCost(total)}`)'],
@@ -394,6 +402,7 @@ const TUI_TEXT_TARGETS = [
394
402
  [["extensions", "mcp", "index.js"], MCP_TEXT_REPLACEMENTS, "/mcp 面板"],
395
403
  [["extensions", "mcp", "ui.js"], MCP_UI_REPLACEMENTS, "/mcp 界面"],
396
404
  [["extensions", "codemode", "renderer.js"], CODEMODE_RENDER_REPLACEMENTS, "codemode 结果"],
405
+ [["core", "http-dispatcher.js"], HTTP_DISPATCHER_REPLACEMENTS, "连接超时"],
397
406
  ];
398
407
 
399
408
  /**
@@ -453,7 +462,7 @@ function patchTuiText() {
453
462
  const { text, applied } = applyTextRules(before, rules);
454
463
  if (applied < rules.length) {
455
464
  console.log(
456
- `[u1s1] 提示: pi 版本可能已更新,${label}文案补丁只应用了 ${applied}/${rules.length} 处(不影响使用)`,
465
+ `[u1s1] 提示: pi 版本可能已更新,${label}补丁只应用了 ${applied}/${rules.length} 处(不影响使用)`,
457
466
  );
458
467
  }
459
468
  if (text !== before) writeFileSync(target, text);