@qwen-code/qwen-code 0.20.0 → 0.20.1-jobbench-claude-prompt.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.
Files changed (171) hide show
  1. package/chunks/{MaxSizedBox-B5YGZSYE.js → MaxSizedBox-BGLP6FQT.js} +15 -12
  2. package/chunks/{StandaloneSessionPicker-CEGO2AZX.js → StandaloneSessionPicker-K6I4ZEHD.js} +33 -30
  3. package/chunks/{acpAgent-YUR43TLG.js → acpAgent-PKKBOEP4.js} +79 -71
  4. package/chunks/{agent-H4JIDL7S.js → agent-Y7XOSZY5.js} +15 -12
  5. package/chunks/{agent-headless-TTBEREQV.js → agent-headless-NXRPEYGF.js} +15 -12
  6. package/chunks/{anthropicContentGenerator-HVKLXOOU.js → anthropicContentGenerator-BWBAZGTW.js} +3 -2
  7. package/chunks/{artifact-tool-WBCAMD3O.js → artifact-tool-IUJ7QWCX.js} +1 -1
  8. package/chunks/{askUserQuestion-6DZC4UV5.js → askUserQuestion-IUMUUTDQ.js} +1 -1
  9. package/chunks/{bridge-VL7ITBU5.js → bridge-DCMYGFJ2.js} +18 -15
  10. package/chunks/{chunk-FLSVD6BS.js → chunk-26LLB6FM.js} +1 -1
  11. package/chunks/{chunk-NDMQLV4Y.js → chunk-2F7HITKF.js} +3 -3
  12. package/chunks/{chunk-4N3KMAIL.js → chunk-2R7OXGYM.js} +13 -13
  13. package/chunks/{chunk-7SXZC7ID.js → chunk-2RDNKVZ2.js} +4 -4
  14. package/chunks/{chunk-PBWEWI4N.js → chunk-2T2FG7OX.js} +29 -27
  15. package/chunks/{chunk-O3OCNYY5.js → chunk-3P4TUBON.js} +1 -1
  16. package/chunks/{chunk-MJ6S23WZ.js → chunk-3PG4G7SK.js} +4 -4
  17. package/chunks/{chunk-NGFEPAE6.js → chunk-3XZIXCJY.js} +6 -4
  18. package/chunks/{chunk-EZVDJFZ7.js → chunk-467G3SV5.js} +1 -1
  19. package/chunks/{chunk-CV63PP6U.js → chunk-4E33SVWA.js} +1 -1
  20. package/chunks/{chunk-S2W2LVDU.js → chunk-5244PA32.js} +2 -2
  21. package/chunks/{chunk-CB2HFGRV.js → chunk-6UTNZOZG.js} +4 -4
  22. package/chunks/{chunk-PGEPSDJI.js → chunk-6UTRTWUF.js} +7 -7
  23. package/chunks/{chunk-SEKHYHMS.js → chunk-6YS6TQB3.js} +1 -1
  24. package/chunks/{chunk-TMQ6XQCX.js → chunk-7AB5URLY.js} +36 -36
  25. package/chunks/chunk-7H2JMOPS.js +391 -0
  26. package/chunks/{chunk-SJMV7ZBK.js → chunk-7YK65ZFC.js} +6 -6
  27. package/chunks/{chunk-7PZ2ATFZ.js → chunk-A2F633L4.js} +13 -13
  28. package/chunks/{chunk-6AFUCL3D.js → chunk-AU2GX7QQ.js} +1 -1
  29. package/chunks/{chunk-DBE4QFZS.js → chunk-BL7EEZ4Y.js} +10 -10
  30. package/chunks/{chunk-HZPN55E5.js → chunk-C44MIZ2K.js} +1 -1
  31. package/chunks/{chunk-OWCALFEG.js → chunk-C5L66QPF.js} +1 -1
  32. package/chunks/chunk-C5Z652G4.js +121 -0
  33. package/chunks/{chunk-2LL7TXB4.js → chunk-CAKC64KX.js} +2 -2
  34. package/chunks/{chunk-4ILMYHEI.js → chunk-CMFMPPKV.js} +3 -3
  35. package/chunks/{chunk-KG3XV6FH.js → chunk-D742634K.js} +1 -1
  36. package/chunks/{chunk-AJSJ5TTU.js → chunk-DFQGFXMQ.js} +1 -1
  37. package/chunks/{chunk-S2PD3EZD.js → chunk-E6XTP5ZF.js} +1 -1
  38. package/chunks/{chunk-FQD7GFSV.js → chunk-EELSDL62.js} +3 -3
  39. package/chunks/{chunk-TIH2ZTOC.js → chunk-EKVLDUP4.js} +1 -1
  40. package/chunks/{chunk-CZF3E5GF.js → chunk-EMMNRTQX.js} +1 -1
  41. package/chunks/{chunk-CPCVCKKF.js → chunk-ETD6K42I.js} +1 -1
  42. package/chunks/{chunk-XVVH63JG.js → chunk-FNGK2Z5B.js} +2 -2
  43. package/chunks/{chunk-FEOZBUMT.js → chunk-FODK6UMO.js} +0 -27
  44. package/chunks/chunk-GLNBDYUX.js +38 -0
  45. package/chunks/{chunk-ZFKNWQGQ.js → chunk-HAL7YT4M.js} +7 -7
  46. package/chunks/{chunk-TKLLK6XQ.js → chunk-IMVIN5UC.js} +1 -1
  47. package/chunks/{chunk-KQNM4EO7.js → chunk-J5CK6QYL.js} +1 -1
  48. package/chunks/{chunk-EAUYY7SS.js → chunk-JDI67JFB.js} +1 -1
  49. package/chunks/{chunk-OYZWQNWG.js → chunk-JXWFXSLN.js} +1 -1
  50. package/chunks/{chunk-BRRF37CO.js → chunk-L4BZXQR3.js} +1 -1
  51. package/chunks/{chunk-4EP2PYYL.js → chunk-L4PEDXOX.js} +3 -3
  52. package/chunks/{chunk-VEXFOTEO.js → chunk-LB7ZIQ6C.js} +2 -2
  53. package/chunks/{chunk-VDWBQ5AW.js → chunk-M2DASLLB.js} +1 -1
  54. package/chunks/{chunk-A5LYNIW7.js → chunk-MEDHWB34.js} +4 -4
  55. package/chunks/{chunk-BMWMT5Y2.js → chunk-NL37SKPP.js} +2 -372
  56. package/chunks/{chunk-IR46U7RB.js → chunk-NNDKJNCC.js} +1 -1
  57. package/chunks/{chunk-7RMOXZTC.js → chunk-NRPP5TOB.js} +4 -4
  58. package/chunks/{chunk-5JBR5XIK.js → chunk-NYMHN4ZK.js} +2 -2
  59. package/chunks/{chunk-PF4CHQOJ.js → chunk-ORDXX5SE.js} +4 -4
  60. package/chunks/{chunk-DP5GXXNZ.js → chunk-P5OX37TK.js} +1 -1
  61. package/chunks/chunk-PC2QR5QO.js +1768 -0
  62. package/chunks/{chunk-D22SX43D.js → chunk-PXVAFBEI.js} +1 -1
  63. package/chunks/{chunk-33XUAINQ.js → chunk-QCCOKIGW.js} +46 -6
  64. package/chunks/{chunk-KX6UK4VJ.js → chunk-RTEHQUAD.js} +266 -840
  65. package/chunks/{chunk-OP4MOGXF.js → chunk-S35ZDXOS.js} +6 -0
  66. package/chunks/{chunk-O3Z73NBP.js → chunk-SKQD5RCT.js} +4 -4
  67. package/chunks/{chunk-OEO2ERWK.js → chunk-SMR34EQM.js} +3 -3
  68. package/chunks/{chunk-S2XVRHDN.js → chunk-SWRMKMVY.js} +1 -1
  69. package/chunks/{chunk-AQIEINAY.js → chunk-UJEZQ562.js} +25 -1763
  70. package/chunks/{chunk-ANPINBOF.js → chunk-UNIQ7KNW.js} +3 -3
  71. package/chunks/{chunk-KDC6GNQR.js → chunk-UTBTCPKF.js} +4 -4
  72. package/chunks/{chunk-VZQUV7VK.js → chunk-VT3KBCIU.js} +1 -1
  73. package/chunks/{chunk-4XNLIGVA.js → chunk-W2LKWG6I.js} +43 -26
  74. package/chunks/{chunk-542SK7KV.js → chunk-WCPQTUDI.js} +4 -4
  75. package/chunks/{chunk-KOR3XKCA.js → chunk-WJYCCJ3Q.js} +3 -3
  76. package/chunks/{chunk-I2PYAYFM.js → chunk-XBAYQWDL.js} +1 -1
  77. package/chunks/{chunk-333CXMNJ.js → chunk-XSSAJZXG.js} +4 -4
  78. package/chunks/{chunk-IVPSS6EL.js → chunk-YHRBVZ53.js} +3 -3
  79. package/chunks/{chunk-AKX4WPPP.js → chunk-YXBZOR3D.js} +4 -4
  80. package/chunks/{computer-use-NIWQNUZF.js → computer-use-KQVQD3IW.js} +15 -12
  81. package/chunks/{config-utils-AHQ6YZ66.js → config-utils-6FXFJUYB.js} +1 -1
  82. package/chunks/{contextCommand-L2COEUHS.js → contextCommand-IOC5HY6R.js} +17 -14
  83. package/chunks/{create-sub-session-MGNX52P3.js → create-sub-session-IOAGEN3O.js} +15 -12
  84. package/chunks/{create-sub-session-P26FE5GG.js → create-sub-session-X5RVIHCK.js} +1 -1
  85. package/chunks/{cron-create-JWFHBDRQ.js → cron-create-AC5FFLN7.js} +1 -1
  86. package/chunks/{cron-delete-GDX4E26G.js → cron-delete-JEB3FAHA.js} +1 -1
  87. package/chunks/{cron-list-USMAIWPT.js → cron-list-NBYPCNIB.js} +1 -1
  88. package/chunks/{daemon-status-provider-NL4IAG7B.js → daemon-status-provider-DYDVT4S5.js} +22 -19
  89. package/chunks/{earlyInputCapture-L6I2A22T.js → earlyInputCapture-7AA4D4RF.js} +15 -12
  90. package/chunks/{edit-3QV3JZJL.js → edit-RQXZUTEU.js} +16 -13
  91. package/chunks/{enter-worktree-4GMMF7EG.js → enter-worktree-BPYKHGTX.js} +15 -12
  92. package/chunks/{enterPlanMode-L5UWBAUC.js → enterPlanMode-VJ3KR5HM.js} +15 -12
  93. package/chunks/{environment-3OV7UQOT.js → environment-PZYHWWG5.js} +17 -14
  94. package/chunks/{errors-LEOF5QG4.js → errors-NZ6JOKJB.js} +17 -14
  95. package/chunks/{exit-worktree-DDP57JLV.js → exit-worktree-TZNABJPX.js} +15 -12
  96. package/chunks/{exitPlanMode-CJBLGPIP.js → exitPlanMode-RZMERKLI.js} +15 -12
  97. package/chunks/{fast-path-M6RP2ING.js → fast-path-F5UWH7GI.js} +2 -2
  98. package/chunks/{gemini-H4PHBJTL.js → gemini-2QJRGIKD.js} +56 -53
  99. package/chunks/{geminiContentGenerator-VURJYPWP.js → geminiContentGenerator-Q7IAYVM4.js} +1 -1
  100. package/chunks/{glob-2KUSRAVQ.js → glob-MP7IPPNS.js} +15 -12
  101. package/chunks/{grep-B5RXVESV.js → grep-OHN54Z7A.js} +15 -12
  102. package/chunks/{handleAutoUpdate-QQVIWXKT.js → handleAutoUpdate-EGCO46FV.js} +19 -16
  103. package/chunks/{i18n-N6OBDORT.js → i18n-4LK42EK5.js} +16 -13
  104. package/chunks/{initializer-6WCFNDLL.js → initializer-DAL5QAZU.js} +20 -17
  105. package/chunks/{installationInfo-6J3WPXNS.js → installationInfo-HOKGVMMQ.js} +16 -13
  106. package/chunks/{list-HOWQSWP6.js → list-M5NNXMQQ.js} +23 -20
  107. package/chunks/{loadedSettingsAdapter-AO4YBRXZ.js → loadedSettingsAdapter-I42UOUE7.js} +20 -17
  108. package/chunks/{loop-wakeup-5GLTUBHA.js → loop-wakeup-HMHCT5GU.js} +2 -2
  109. package/chunks/{ls-FHBY3Y7I.js → ls-IW5HYDG4.js} +1 -1
  110. package/chunks/{lsp-B6VMEW6Y.js → lsp-4RL52YIZ.js} +1 -1
  111. package/chunks/{mcp-QH7QNXOH.js → mcp-62XOYOXZ.js} +20 -17
  112. package/chunks/{monitor-GLJZDNPS.js → monitor-YIHFTVM7.js} +15 -12
  113. package/chunks/{nonInteractiveCli-TI7EMPXD.js → nonInteractiveCli-Z73R2B3B.js} +47 -44
  114. package/chunks/{notebook-edit-AVCIWS4F.js → notebook-edit-XK4J36D3.js} +16 -13
  115. package/chunks/{openaiContentGenerator-B7W24G3D.js → openaiContentGenerator-OEIKDARY.js} +10 -7
  116. package/chunks/{pidfile-UEHAT6DH.js → pidfile-2XVZMMKS.js} +15 -12
  117. package/chunks/{processUtils-XZPY2PBB.js → processUtils-SYFMMDPV.js} +2 -2
  118. package/chunks/{qwenContentGenerator-6GUTWJIC.js → qwenContentGenerator-LTTPUWV3.js} +20 -15
  119. package/chunks/{qwenOAuth2-GASEEWGU.js → qwenOAuth2-U3X6UBDP.js} +6 -5
  120. package/chunks/{read-file-SQJONF6A.js → read-file-P6IEAOBS.js} +3 -3
  121. package/chunks/{read-mcp-resource-AKCL7I43.js → read-mcp-resource-OIBCNIX7.js} +1 -1
  122. package/chunks/{record-artifact-PEUB7727.js → record-artifact-HDMK4LHG.js} +1 -1
  123. package/chunks/{resumeHistoryUtils-PFQ2A23X.js → resumeHistoryUtils-WMJ5TUPF.js} +19 -16
  124. package/chunks/{ripGrep-QCK22GDU.js → ripGrep-US5HKBSM.js} +15 -12
  125. package/chunks/{run-qwen-serve-OZGR3FQA.js → run-qwen-serve-MIFJODT4.js} +24 -24
  126. package/chunks/{runtime-SNVAP6EH.js → runtime-SK5QH53T.js} +22 -19
  127. package/chunks/{scheduler-Z7QLMUWA.js → scheduler-4TIUONHH.js} +15 -12
  128. package/chunks/{send-message-3RHE7HSM.js → send-message-WXVVK4DB.js} +2 -2
  129. package/chunks/{serve-BT7KS6SC.js → serve-F6VZULAL.js} +20 -17
  130. package/chunks/{server-SO64U3X5.js → server-UJEZDWGO.js} +70 -67
  131. package/chunks/{session-2KL2WQAH.js → session-PFCYZOZJ.js} +48 -45
  132. package/chunks/{settings-KITVOUSV.js → settings-7UHALRNO.js} +19 -16
  133. package/chunks/{shell-BITUVH2R.js → shell-DY7EASPT.js} +15 -12
  134. package/chunks/{skill-SOQHY455.js → skill-DOZBVXRT.js} +3 -3
  135. package/chunks/{spawnChannel-2BU3AULL.js → spawnChannel-HT7EQ4SL.js} +17 -14
  136. package/chunks/{src-43LM7JLB.js → src-VJO75DQQ.js} +50 -46
  137. package/chunks/{standalone-update-YG5JUYCM.js → standalone-update-5ERAJGLE.js} +17 -14
  138. package/chunks/{startInteractiveUI-3RGTGEX5.js → startInteractiveUI-HYMIOBH7.js} +144 -140
  139. package/chunks/{syntheticOutput-FG5PQKIR.js → syntheticOutput-HCUFXSIA.js} +2 -2
  140. package/chunks/{task-create-HX32YXO7.js → task-create-RIY5JTFC.js} +3 -3
  141. package/chunks/{task-list-QWSY4ZIU.js → task-list-XBUCV3CO.js} +1 -1
  142. package/chunks/{task-stop-GWC6UWAL.js → task-stop-QDFCCYR5.js} +1 -1
  143. package/chunks/{task-update-NCTAB73Q.js → task-update-7PXKJQOI.js} +3 -3
  144. package/chunks/{team-create-FXN3PEBP.js → team-create-NF3FCZE2.js} +18 -15
  145. package/chunks/{team-delete-KK37HTOG.js → team-delete-TNSSE2S5.js} +1 -1
  146. package/chunks/{team-plan-approval-GEIZ356Q.js → team-plan-approval-P5U7U4NW.js} +15 -12
  147. package/chunks/{theme-manager-IAETOI25.js → theme-manager-WD73RXOX.js} +15 -12
  148. package/chunks/{todoWrite-ERCAMLFS.js → todoWrite-OMAIGB6V.js} +1 -1
  149. package/chunks/{tool-search-XKK7DNOK.js → tool-search-TDMA733L.js} +4 -4
  150. package/chunks/{total-session-admission-BJLDHKJN.js → total-session-admission-H3XZPCNC.js} +18 -15
  151. package/chunks/{tree-sitter-4D7QS7F6.js → tree-sitter-VJEPTDMU.js} +1 -1
  152. package/chunks/{tree-sitter-bash-VEJGF5XF.js → tree-sitter-bash-WFKBO43W.js} +1 -1
  153. package/chunks/{trustedFolders-5XCVNEUU.js → trustedFolders-NEFWXHU2.js} +16 -13
  154. package/chunks/{update-relaunch-FMVZK6XF.js → update-relaunch-T2XQQC4W.js} +5 -5
  155. package/chunks/{updateCheck-YZZB7YBU.js → updateCheck-G5JYMVJZ.js} +18 -15
  156. package/chunks/{useAutoAcceptIndicator-ZSQX4I2H.js → useAutoAcceptIndicator-5FLFR3BY.js} +23 -20
  157. package/chunks/{validateNonInterActiveAuth-PRVEB6GG.js → validateNonInterActiveAuth-Z23SJ4D4.js} +44 -41
  158. package/chunks/{version-AZMG6KWL.js → version-PLKW23RX.js} +1 -1
  159. package/chunks/{web-fetch-EPGJ5OQQ.js → web-fetch-QNI3EEXN.js} +5 -4
  160. package/chunks/web-search-DLYTQBNN.js +680 -0
  161. package/chunks/{workflow-UTNVPW22.js → workflow-A3WFSQKU.js} +16 -13
  162. package/chunks/{workspace-providers-status-EADV364W.js → workspace-providers-status-6K34OJLQ.js} +23 -20
  163. package/chunks/{workspace-registration-store-F3ZX3YHT.js → workspace-registration-store-6FPLTQG3.js} +1 -1
  164. package/chunks/{workspace-registry-W6VMFYZU.js → workspace-registry-JZRIJXJS.js} +18 -15
  165. package/chunks/{workspace-service-F3KIN2UN.js → workspace-service-PQDLBZV3.js} +25 -22
  166. package/chunks/{workspace-skills-status-YVICUR5Y.js → workspace-skills-status-RKCPZVT2.js} +21 -18
  167. package/chunks/{write-file-CVGF2OKV.js → write-file-LHZENZ2A.js} +16 -13
  168. package/cli.js +11 -11
  169. package/package.json +3 -3
  170. package/chunks/{chunk-B3KGZCQN.js → chunk-7YBZGNEC.js} +3 -3
  171. /package/chunks/{chunk-YWEW33JY.js → chunk-OMH3276Y.js} +0 -0
@@ -7,13 +7,9 @@ import {
7
7
  isQwenQuotaExceededError,
8
8
  isRateLimitError,
9
9
  retryContext
10
- } from "./chunk-ZFKNWQGQ.js";
11
- import {
12
- isTlsVerificationDisabled
13
- } from "./chunk-6EFTQYW7.js";
10
+ } from "./chunk-HAL7YT4M.js";
14
11
  import {
15
12
  createDebugLogger,
16
- getErrorMessage,
17
13
  getErrorStatus,
18
14
  isAbortError
19
15
  } from "./chunk-C27BYUX6.js";
@@ -497,379 +493,13 @@ function logRetryAtStatusLevel(message, retryDiagnostics, error, errorStatus) {
497
493
  }
498
494
  __name(logRetryAtStatusLevel, "logRetryAtStatusLevel");
499
495
 
500
- // packages/core/src/utils/fetch.ts
501
- init_esbuild_shims();
502
- import { URL } from "node:url";
503
- var PRIVATE_IP_RANGES = [
504
- /^10\./,
505
- /^127\./,
506
- /^172\.(1[6-9]|2[0-9]|3[0-1])\./,
507
- /^192\.168\./,
508
- // IPv4 link-local (incl. cloud metadata endpoints) and CGNAT 100.64.0.0/10.
509
- /^169\.254\./,
510
- /^100\.(6[4-9]|[7-9][0-9]|1[01][0-9]|12[0-7])\./,
511
- /^0\.0\.0\.0$/,
512
- /^::1$/,
513
- /^::$/,
514
- // ULA fc00::/7 covers fc00: through fdff: (fd00: is the common prefix in
515
- // practice); link-local fe80::/10 covers fe80: through febf:.
516
- /^f[cd][0-9a-f]{2}:/i,
517
- /^fe[89ab][0-9a-f]:/i
518
- ];
519
- var TLS_ERROR_CODES = /* @__PURE__ */ new Set([
520
- "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
521
- "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
522
- "SELF_SIGNED_CERT_IN_CHAIN",
523
- "DEPTH_ZERO_SELF_SIGNED_CERT",
524
- "CERT_HAS_EXPIRED",
525
- "ERR_TLS_CERT_ALTNAME_INVALID"
526
- ]);
527
- var FETCH_TROUBLESHOOTING_ERROR_CODES = /* @__PURE__ */ new Set([
528
- ...TLS_ERROR_CODES,
529
- "ECONNRESET",
530
- "ETIMEDOUT",
531
- "ECONNREFUSED",
532
- "ENOTFOUND",
533
- "EAI_AGAIN",
534
- "EHOSTUNREACH",
535
- "ENETUNREACH"
536
- ]);
537
- var FetchError = class extends Error {
538
- constructor(message, code) {
539
- super(message);
540
- this.code = code;
541
- this.name = "FetchError";
542
- }
543
- static {
544
- __name(this, "FetchError");
545
- }
546
- };
547
- var CONNECTION_LEVEL_ERROR_CODES = /* @__PURE__ */ new Set([
548
- ...TLS_ERROR_CODES,
549
- "ECONNREFUSED",
550
- "EPROTO",
551
- "ERR_SSL_WRONG_VERSION_NUMBER",
552
- // Servers that don't speak TLS on 443 often reset during the handshake
553
- // rather than refusing the connection. Safe to include: the http fallback
554
- // only ever fires for URLs the caller requested as http.
555
- "ECONNRESET",
556
- "UND_ERR_SOCKET",
557
- // Filtered port 443 (silent drop): undici's own bounded connect timeout.
558
- // Deliberately NOT the full-budget ETIMEDOUT — that can fire mid-body on
559
- // a healthy https server, and a fallback there would double a worst-case
560
- // 60s wait for an ambiguous gain.
561
- "UND_ERR_CONNECT_TIMEOUT"
562
- ]);
563
- function isConnectionLevelError(error) {
564
- return error instanceof FetchError && error.code !== void 0 && CONNECTION_LEVEL_ERROR_CODES.has(error.code);
565
- }
566
- __name(isConnectionLevelError, "isConnectionLevelError");
567
- function mappedIpv4(hostname) {
568
- const match = /^::ffff:(.+)$/i.exec(hostname);
569
- if (!match) return void 0;
570
- const tail = match[1];
571
- if (tail.includes(".")) return tail;
572
- const groups = tail.split(":");
573
- if (groups.length !== 2) return void 0;
574
- const hi = Number.parseInt(groups[0], 16);
575
- const lo = Number.parseInt(groups[1], 16);
576
- if (Number.isNaN(hi) || Number.isNaN(lo)) return void 0;
577
- return `${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`;
578
- }
579
- __name(mappedIpv4, "mappedIpv4");
580
- function isPrivateIp(url) {
581
- try {
582
- const hostname = new URL(url).hostname.replace(/^\[|\]$/g, "");
583
- const target = mappedIpv4(hostname) ?? hostname;
584
- return PRIVATE_IP_RANGES.some((range) => range.test(target));
585
- } catch (_e) {
586
- return false;
587
- }
588
- }
589
- __name(isPrivateIp, "isPrivateIp");
590
- var INTERNAL_HOST_SUFFIXES = [".local", ".internal", ".lan", ".home.arpa"];
591
- function isPrivateHost(url) {
592
- try {
593
- const hostname = new URL(url).hostname.toLowerCase();
594
- return hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "host.docker.internal" || // Single-label hostnames (intranet, ci, printserver) are never public.
595
- // IPv6 literals are bracketed and dot-free but CAN be public — they
596
- // are classified by isPrivateIp below, not by this heuristic.
597
- !hostname.includes(".") && !hostname.startsWith("[") || INTERNAL_HOST_SUFFIXES.some((suffix) => hostname.endsWith(suffix)) || isPrivateIp(url);
598
- } catch {
599
- return false;
600
- }
601
- }
602
- __name(isPrivateHost, "isPrivateHost");
603
- var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
604
- function isPermittedRedirect(originalUrl, redirectUrl) {
605
- try {
606
- const original = new URL(originalUrl);
607
- const redirect = new URL(redirectUrl);
608
- if (redirect.protocol !== original.protocol) return false;
609
- if (redirect.port !== original.port) return false;
610
- if (redirect.username || redirect.password) return false;
611
- const stripWww = /* @__PURE__ */ __name((hostname) => hostname.replace(/^www\./, ""), "stripWww");
612
- return stripWww(original.hostname) === stripWww(redirect.hostname);
613
- } catch {
614
- return false;
615
- }
616
- }
617
- __name(isPermittedRedirect, "isPermittedRedirect");
618
- var RETRYABLE_STATUSES = /* @__PURE__ */ new Set([403, 429]);
619
- var RETRYABLE_ERROR_CODES = /* @__PURE__ */ new Set([
620
- "ECONNRESET",
621
- "EAI_AGAIN",
622
- "UND_ERR_SOCKET"
623
- ]);
624
- var RETRY_DELAY_MS = 500;
625
- async function fetchWithPolicy(url, options) {
626
- const timeoutSignal = AbortSignal.timeout(options.timeoutMs);
627
- const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
628
- const abortError = /* @__PURE__ */ __name(() => {
629
- if (options.signal?.aborted) {
630
- return options.signal.reason instanceof Error ? options.signal.reason : new FetchError("Request aborted", "ABORT_ERR");
631
- }
632
- if (timeoutSignal.aborted) {
633
- return new FetchError(
634
- `Request timed out after ${options.timeoutMs}ms`,
635
- "ETIMEDOUT"
636
- );
637
- }
638
- return void 0;
639
- }, "abortError");
640
- let first;
641
- try {
642
- first = await fetchPolicyAttempt(url, options, signal, timeoutSignal);
643
- } catch (error) {
644
- if (error instanceof FetchError && error.code !== void 0 && RETRYABLE_ERROR_CODES.has(error.code) && !signal.aborted) {
645
- try {
646
- await delay(RETRY_DELAY_MS, signal);
647
- } catch {
648
- throw abortError() ?? error;
649
- }
650
- return fetchPolicyAttempt(url, options, signal, timeoutSignal);
651
- }
652
- throw error;
653
- }
654
- if (first.kind === "response" && RETRYABLE_STATUSES.has(first.status) && !signal.aborted) {
655
- try {
656
- await delay(RETRY_DELAY_MS, signal);
657
- return await fetchPolicyAttempt(url, options, signal, timeoutSignal);
658
- } catch {
659
- const aborted = abortError();
660
- if (aborted) throw aborted;
661
- return first;
662
- }
663
- }
664
- return first;
665
- }
666
- __name(fetchWithPolicy, "fetchWithPolicy");
667
- async function fetchPolicyAttempt(url, options, signal, timeoutSignal) {
668
- const wrapAbort = /* @__PURE__ */ __name((error) => {
669
- if (options.signal?.aborted) {
670
- throw options.signal.reason instanceof Error ? options.signal.reason : new FetchError("Request aborted", "ABORT_ERR");
671
- }
672
- if (timeoutSignal.aborted) {
673
- throw new FetchError(
674
- `Request timed out after ${options.timeoutMs}ms`,
675
- "ETIMEDOUT"
676
- );
677
- }
678
- if (error instanceof FetchError) throw error;
679
- const code = getErrorCode(error) ?? (error instanceof Error ? getErrorCode(error.cause) : void 0);
680
- throw new FetchError(getErrorMessage(error), code);
681
- }, "wrapAbort");
682
- let currentUrl = url;
683
- for (let hop = 0; hop <= options.maxRedirects; hop++) {
684
- let response;
685
- try {
686
- response = await fetch(currentUrl, {
687
- signal,
688
- headers: options.headers,
689
- redirect: "manual"
690
- });
691
- } catch (error) {
692
- return wrapAbort(error);
693
- }
694
- if (REDIRECT_STATUSES.has(response.status)) {
695
- const location = response.headers.get("location");
696
- await response.body?.cancel().catch(() => {
697
- });
698
- if (!location) {
699
- throw new FetchError("Redirect response missing Location header");
700
- }
701
- let redirectUrl;
702
- try {
703
- redirectUrl = new URL(location, currentUrl).toString();
704
- } catch {
705
- throw new FetchError(
706
- `Redirect response has a malformed Location header: ${location}`
707
- );
708
- }
709
- if (!isPermittedRedirect(currentUrl, redirectUrl)) {
710
- return {
711
- kind: "cross-host-redirect",
712
- originalUrl: currentUrl,
713
- redirectUrl,
714
- status: response.status
715
- };
716
- }
717
- currentUrl = redirectUrl;
718
- continue;
719
- }
720
- if (response.status < 200 || response.status >= 300) {
721
- await response.body?.cancel().catch(() => {
722
- });
723
- return {
724
- kind: "response",
725
- status: response.status,
726
- statusText: response.statusText,
727
- contentType: response.headers.get("content-type") ?? "",
728
- contentDisposition: response.headers.get("content-disposition") ?? "",
729
- body: Buffer.alloc(0),
730
- finalUrl: currentUrl
731
- };
732
- }
733
- const contentLength = Number(response.headers.get("content-length"));
734
- if (Number.isFinite(contentLength) && contentLength > options.maxBytes) {
735
- await response.body?.cancel().catch(() => {
736
- });
737
- throw new FetchError(
738
- `Response too large: ${contentLength} bytes exceeds the ${options.maxBytes}-byte limit`,
739
- "EMSGSIZE"
740
- );
741
- }
742
- const chunks = [];
743
- let total = 0;
744
- if (response.body) {
745
- const reader = response.body.getReader();
746
- try {
747
- for (; ; ) {
748
- const { done, value } = await reader.read();
749
- if (done) break;
750
- total += value.byteLength;
751
- if (total > options.maxBytes) {
752
- throw new FetchError(
753
- `Response too large: exceeded the ${options.maxBytes}-byte limit while streaming`,
754
- "EMSGSIZE"
755
- );
756
- }
757
- chunks.push(value);
758
- }
759
- } catch (error) {
760
- await reader.cancel().catch(() => {
761
- });
762
- if (error instanceof FetchError) throw error;
763
- return wrapAbort(error);
764
- } finally {
765
- reader.releaseLock();
766
- }
767
- }
768
- return {
769
- kind: "response",
770
- status: response.status,
771
- statusText: response.statusText,
772
- contentType: response.headers.get("content-type") ?? "",
773
- contentDisposition: response.headers.get("content-disposition") ?? "",
774
- body: Buffer.concat(chunks, total),
775
- finalUrl: currentUrl
776
- };
777
- }
778
- throw new FetchError(
779
- `Too many redirects (exceeded ${options.maxRedirects})`,
780
- "EMAXREDIRECTS"
781
- );
782
- }
783
- __name(fetchPolicyAttempt, "fetchPolicyAttempt");
784
- function getErrorCode(error) {
785
- if (!error || typeof error !== "object") {
786
- return void 0;
787
- }
788
- if ("code" in error && typeof error["code"] === "string") {
789
- return error["code"];
790
- }
791
- return void 0;
792
- }
793
- __name(getErrorCode, "getErrorCode");
794
- function formatUnknownErrorMessage(error) {
795
- if (typeof error === "string") {
796
- return error;
797
- }
798
- if (typeof error === "number" || typeof error === "boolean" || typeof error === "bigint") {
799
- return String(error);
800
- }
801
- if (error instanceof Error) {
802
- return error.message;
803
- }
804
- if (!error || typeof error !== "object") {
805
- return void 0;
806
- }
807
- const message = error["message"];
808
- if (typeof message === "string") {
809
- return message;
810
- }
811
- return void 0;
812
- }
813
- __name(formatUnknownErrorMessage, "formatUnknownErrorMessage");
814
- function formatErrorCause(error) {
815
- if (!(error instanceof Error)) {
816
- return void 0;
817
- }
818
- const cause = error.cause;
819
- if (!cause) {
820
- return void 0;
821
- }
822
- const causeCode = getErrorCode(cause);
823
- const causeMessage = formatUnknownErrorMessage(cause);
824
- if (!causeCode && !causeMessage) {
825
- return void 0;
826
- }
827
- if (causeCode && causeMessage && !causeMessage.includes(causeCode)) {
828
- return `${causeCode}: ${causeMessage}`;
829
- }
830
- return causeMessage ?? causeCode;
831
- }
832
- __name(formatErrorCause, "formatErrorCause");
833
- function formatFetchErrorForUser(error, options = {}) {
834
- const errorMessage = getErrorMessage(error);
835
- const code = error instanceof Error ? getErrorCode(error.cause) ?? getErrorCode(error) : getErrorCode(error);
836
- const cause = formatErrorCause(error);
837
- const fullErrorMessage = [
838
- errorMessage,
839
- cause ? `(cause: ${cause})` : void 0
840
- ].filter(Boolean).join(" ");
841
- const shouldShowFetchHints = errorMessage.toLowerCase().includes("fetch failed") || code != null && FETCH_TROUBLESHOOTING_ERROR_CODES.has(code);
842
- const shouldShowTlsHint = code != null && TLS_ERROR_CODES.has(code);
843
- if (!shouldShowFetchHints) {
844
- return fullErrorMessage;
845
- }
846
- const hintLines = [
847
- "",
848
- "Troubleshooting:",
849
- ...options.url ? [`- Confirm you can reach ${options.url} from this machine.`] : [],
850
- "- If you are behind a proxy, pass `--proxy <url>` (or set `proxy` in settings).",
851
- ...shouldShowTlsHint ? isTlsVerificationDisabled() ? [
852
- "- TLS verification is already disabled (`--insecure` / `QWEN_TLS_INSECURE`), so this is likely a network or protocol issue rather than a certificate trust problem."
853
- ] : [
854
- "- If your network uses a corporate TLS inspection CA, set `NODE_EXTRA_CA_CERTS` to your CA bundle.",
855
- "- For a trusted self-signed endpoint, pass `--insecure` (or set `QWEN_TLS_INSECURE=1`) to skip certificate verification."
856
- ] : []
857
- ];
858
- return `${fullErrorMessage}${hintLines.join("\n")}`;
859
- }
860
- __name(formatFetchErrorForUser, "formatFetchErrorForUser");
861
-
862
496
  export {
863
497
  classifyRetryError,
864
498
  isFallbackEligible,
865
499
  isTransientCapacityError,
866
500
  isUnattendedMode,
867
501
  delay,
868
- retryWithBackoff,
869
- isConnectionLevelError,
870
- isPrivateHost,
871
- fetchWithPolicy,
872
- formatFetchErrorForUser
502
+ retryWithBackoff
873
503
  };
874
504
  /**
875
505
  * @license
@@ -5,7 +5,7 @@ import {
5
5
  isTranscribableVoiceModel,
6
6
  readVoiceLanguage,
7
7
  resolveVoiceTransport
8
- } from "./chunk-S2PD3EZD.js";
8
+ } from "./chunk-E6XTP5ZF.js";
9
9
  import {
10
10
  resolvePath
11
11
  } from "./chunk-BVLROR2T.js";
@@ -3,17 +3,17 @@
3
3
  import {
4
4
  getGitVersion,
5
5
  getNpmVersion
6
- } from "./chunk-NDMQLV4Y.js";
6
+ } from "./chunk-2F7HITKF.js";
7
7
  import {
8
8
  buildEnvStatusFromEnv,
9
9
  snapshotProcessEnv
10
- } from "./chunk-OYZWQNWG.js";
10
+ } from "./chunk-JXWFXSLN.js";
11
11
  import {
12
12
  mapDomainErrorToErrorKind
13
- } from "./chunk-VDWBQ5AW.js";
13
+ } from "./chunk-M2DASLLB.js";
14
14
  import {
15
15
  canUseRipgrep
16
- } from "./chunk-KX6UK4VJ.js";
16
+ } from "./chunk-RTEHQUAD.js";
17
17
  import {
18
18
  init_esbuild_shims
19
19
  } from "./chunk-5O2XNYP6.js";
@@ -2,13 +2,13 @@
2
2
  "use strict";
3
3
  import {
4
4
  HistoryReplayer
5
- } from "./chunk-PGEPSDJI.js";
5
+ } from "./chunk-6UTRTWUF.js";
6
6
  import {
7
7
  redactLogCredentials
8
8
  } from "./chunk-M5GB774H.js";
9
9
  import {
10
10
  getResponseText
11
- } from "./chunk-KX6UK4VJ.js";
11
+ } from "./chunk-RTEHQUAD.js";
12
12
  import {
13
13
  init_esbuild_shims
14
14
  } from "./chunk-5O2XNYP6.js";
@@ -17,7 +17,7 @@ import {
17
17
  import {
18
18
  formatHistoryGapNotice,
19
19
  indexGapsByChild
20
- } from "./chunk-D22SX43D.js";
20
+ } from "./chunk-PXVAFBEI.js";
21
21
  import {
22
22
  stringWidth
23
23
  } from "./chunk-H2XVO6NE.js";
@@ -29,16 +29,16 @@ import {
29
29
  } from "./chunk-E5Z2AVNV.js";
30
30
  import {
31
31
  t
32
- } from "./chunk-TKLLK6XQ.js";
32
+ } from "./chunk-IMVIN5UC.js";
33
33
  import {
34
34
  getToolResponseDisplayText
35
- } from "./chunk-KX6UK4VJ.js";
35
+ } from "./chunk-RTEHQUAD.js";
36
36
  import {
37
37
  stripAnsi
38
38
  } from "./chunk-T4TZQJ7W.js";
39
39
  import {
40
40
  ToolDisplayNames
41
- } from "./chunk-OP4MOGXF.js";
41
+ } from "./chunk-S35ZDXOS.js";
42
42
  import {
43
43
  init_esbuild_shims
44
44
  } from "./chunk-5O2XNYP6.js";
@@ -60,7 +60,7 @@ async function runExitCleanup(options = {}) {
60
60
  }
61
61
  __name(runExitCleanup, "runExitCleanup");
62
62
  async function cleanupCheckpoints() {
63
- const { Storage } = await import("./src-43LM7JLB.js");
63
+ const { Storage } = await import("./src-VJO75DQQ.js");
64
64
  const storage = new Storage(process.cwd());
65
65
  const tempDir = storage.getProjectTempDir();
66
66
  const checkpointsDir = join(tempDir, "checkpoints");