nolo-cli 0.91.0-alpha.1 → 0.91.1

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 (173) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-U5V7LOJX.js → _executeModel-H35GQ2XO.js} +61 -60
  3. package/{action-EXQVY3UO.js → action-3ZOODRBC.js} +11 -11
  4. package/{addContentAction-6IXQSRD2.js → addContentAction-IJHG2ZV7.js} +9 -9
  5. package/{addDialogAgentAction-FZOB4BYM.js → addDialogAgentAction-IGFS2UBX.js} +11 -11
  6. package/{agentDeleteCommand-4MIJFQQB.js → agentDeleteCommand-XOFMXMHW.js} +43 -42
  7. package/{agentEmailCommands-JUXT36BY.js → agentEmailCommands-H2SEP6ZQ.js} +82 -78
  8. package/{agentGrantCommands-YW6PQAQ2.js → agentGrantCommands-M3XFO6EN.js} +2 -2
  9. package/{agentListCommands-MUVKMMZ5.js → agentListCommands-RYGH6NUL.js} +72 -80
  10. package/{agentMachineCommands-56FTZLYV.js → agentMachineCommands-XELOBZIP.js} +37 -36
  11. package/{agentProviderCommands-TOMVKJOV.js → agentProviderCommands-JCRK6ST2.js} +1 -1
  12. package/{agentPullCommand-GLOOXJ2E.js → agentPullCommand-HF4A42D4.js} +3 -3
  13. package/agentRecordCommands-43HAXAZO.js +130 -0
  14. package/{agentRunCommand-UMUEVIY2.js → agentRunCommand-GIPN6DBO.js} +80 -75
  15. package/{agentRunControl-XLGD3UZ5.js → agentRunControl-AVJR4JW4.js} +2 -2
  16. package/{agentRuntimeLocal-NH6GSGAJ.js → agentRuntimeLocal-SDOSSCLU.js} +38 -33
  17. package/{agentSlice-YZK6KG73.js → agentSlice-B2DLZMAC.js} +11 -11
  18. package/{appDeleteCommands-U45KXYX7.js → appDeleteCommands-7OR5MAOR.js} +37 -36
  19. package/{appDeployCommands-LWQIQCFX.js → appDeployCommands-5GNI723H.js} +37 -36
  20. package/{appDeployStatusCommands-LZO33PGD.js → appDeployStatusCommands-WL2NG3SG.js} +37 -36
  21. package/{appGetCommands-OJSO6BCF.js → appGetCommands-7BVKQS44.js} +37 -36
  22. package/{appListCommands-NE56V7DI.js → appListCommands-5VXFJOBU.js} +37 -36
  23. package/{authCommand-U5LA6H4Y.js → authCommand-N4Q6463J.js} +115 -23
  24. package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
  25. package/{builtinSkillRegistry-4NB7PCOF.js → builtinSkillRegistry-JPY2DKRF.js} +7 -7
  26. package/{chatQueueReduxAdapter-FRMSYX7N.js → chatQueueReduxAdapter-3KDRKXTT.js} +29 -29
  27. package/{chromeCommands-VOIRNJBL.js → chromeCommands-NKU3OWKH.js} +36 -11
  28. package/{chromeOpsCommands-M7DPCX2T.js → chromeOpsCommands-OQDJGD4Y.js} +31 -1
  29. package/{chunk-R2YY6MWV.js → chunk-232453C2.js} +994 -1036
  30. package/{chunk-HWZAXNO7.js → chunk-25GAGMRK.js} +6 -83
  31. package/{chunk-DM4UNXPK.js → chunk-3IYMTWYZ.js} +22 -22
  32. package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
  33. package/{chunk-X2ZTVRXP.js → chunk-46CRK7XP.js} +7 -7
  34. package/{chunk-WKEUHK57.js → chunk-55VQ4OPL.js} +4 -4
  35. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  36. package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
  37. package/{chunk-4JBZUECA.js → chunk-64TIEZHF.js} +1 -1
  38. package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
  39. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  40. package/{chunk-UBNV6CS6.js → chunk-6PELJ3DS.js} +533 -236
  41. package/{chunk-7IBK6MYW.js → chunk-7EMJBGCA.js} +966 -218
  42. package/{chunk-YPYMGGPJ.js → chunk-7YMUSSHQ.js} +93 -93
  43. package/chunk-ACTMNVHM.js +93 -0
  44. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  45. package/{chunk-UKWGR5SS.js → chunk-AUXHZ2M5.js} +186 -397
  46. package/{chunk-377KM42Z.js → chunk-B4PW6UAI.js} +61 -34
  47. package/{chunk-XLGHBHGP.js → chunk-B7ANJQWZ.js} +2 -2
  48. package/{chunk-COM7GG76.js → chunk-BAAKVSMZ.js} +4 -4
  49. package/{chunk-QMASIHYZ.js → chunk-BFCXG6AJ.js} +16 -16
  50. package/{chunk-KR3YI36B.js → chunk-BJUDYFV5.js} +10 -2
  51. package/chunk-BMQ2MJUK.js +153 -0
  52. package/{chunk-XGJAR4T5.js → chunk-BNGW5ASC.js} +65 -4
  53. package/{chunk-VOOTT7HA.js → chunk-BTSYHR7J.js} +4 -4
  54. package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
  55. package/{chunk-JEDZAO7L.js → chunk-D2W6WRHT.js} +13 -8
  56. package/{chunk-U47DH2WO.js → chunk-D76D3RTR.js} +2 -2
  57. package/{chunk-HQCSU3DI.js → chunk-DCLMZ5TX.js} +4 -4
  58. package/{chunk-OOLWKQSM.js → chunk-EFZKILX6.js} +4 -4
  59. package/{chunk-WP6BC7OF.js → chunk-EHO5EGU4.js} +23 -76
  60. package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
  61. package/{chunk-ABQYVJBJ.js → chunk-ETZWFV6M.js} +1 -1
  62. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  63. package/{chunk-BF2K6MRF.js → chunk-F64B2W3R.js} +110 -34
  64. package/{chunk-S3UI4IUJ.js → chunk-G4EMOUX3.js} +886 -154
  65. package/{chunk-B4S7MR5S.js → chunk-GJUKGFHG.js} +74 -16
  66. package/{chunk-LSSBA2TN.js → chunk-GMVELWJG.js} +3 -3
  67. package/chunk-GMZLP5DV.js +82 -0
  68. package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
  69. package/{chunk-DSX6K7C2.js → chunk-HBTA2SGQ.js} +97 -21
  70. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  71. package/{chunk-W2E6HIIK.js → chunk-HNRASX3X.js} +8 -8
  72. package/{chunk-CPH3W5A7.js → chunk-I3TQJXQ7.js} +94 -3
  73. package/{chunk-E3VQ6S3A.js → chunk-IS5VEM2G.js} +140 -15
  74. package/{chunk-NKIH4Q7W.js → chunk-ISHYYQJC.js} +5 -3
  75. package/{chunk-RLEWGSM5.js → chunk-K7M4I3PF.js} +30 -7
  76. package/{chunk-OH7H6LPC.js → chunk-KQOD3G2X.js} +165 -15
  77. package/{chunk-YOXYA2GU.js → chunk-LNPYTNMG.js} +10 -5
  78. package/{chunk-GRDSMV4V.js → chunk-LS2MI3B4.js} +45 -45
  79. package/{chunk-GII32WZW.js → chunk-M2EJHDJP.js} +3 -0
  80. package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
  81. package/{chunk-RZYQMSQA.js → chunk-N3XA2O6O.js} +1 -1
  82. package/{chunk-SASGLNUD.js → chunk-NILSKYOE.js} +3 -3
  83. package/chunk-OCZKATRC.js +129 -0
  84. package/{chunk-MBEEYLGL.js → chunk-OOSVFT6S.js} +2 -2
  85. package/{chunk-QCZX4FTW.js → chunk-OY5IJI2N.js} +194 -21
  86. package/{chunk-SUERPXJZ.js → chunk-PAYUVQ6P.js} +7517 -1091
  87. package/{chunk-JTYPAMGP.js → chunk-Q67DOFOO.js} +59 -4
  88. package/{chunk-F3UTRUDO.js → chunk-QALRKMHF.js} +11 -10
  89. package/{chunk-546FPOW3.js → chunk-QDSINZM3.js} +1 -1
  90. package/{chunk-TMAZ3VHN.js → chunk-QJLEMM2V.js} +1 -1
  91. package/{chunk-IIKPWSPX.js → chunk-R4SQ3LGW.js} +1 -1
  92. package/{chunk-E2NP7ZQU.js → chunk-RZ6CQZB2.js} +34 -20
  93. package/{chunk-SAFZABH7.js → chunk-SV5IJK6K.js} +1 -1
  94. package/{chunk-AQDH76OK.js → chunk-T5V7HA3K.js} +1 -1
  95. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  96. package/chunk-UNYJU5L6.js +780 -0
  97. package/{chunk-QFMFJZLO.js → chunk-V7E4PXQD.js} +1 -1
  98. package/{chunk-G5X57NDE.js → chunk-VBSVA6CB.js} +2 -2
  99. package/{chunk-3XMOAYRC.js → chunk-VETFWL5K.js} +1 -1
  100. package/chunk-VJVNU77E.js +83 -0
  101. package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
  102. package/{chunk-HGRDL36J.js → chunk-W2P25VGS.js} +25 -6
  103. package/{chunk-XAQAF25W.js → chunk-WC6A2Q7S.js} +5 -3
  104. package/{chunk-WON762L4.js → chunk-WT2IAJAJ.js} +4 -4
  105. package/chunk-X6YIXGPT.js +870 -0
  106. package/{chunk-ZKMYGRO7.js → chunk-YMPTI7RZ.js} +9 -9
  107. package/{chunk-BKP7CFUD.js → chunk-YRIFJ6XQ.js} +13 -13
  108. package/{chunk-FZGV4FGK.js → chunk-YRRASA5Q.js} +268 -143
  109. package/{chunk-UDEFS2PV.js → chunk-Z5W7UMQV.js} +2 -2
  110. package/{chunk-ZHUTWJ3N.js → chunk-ZGJLSHER.js} +2 -2
  111. package/{chunk-4CAPEGHN.js → chunk-ZI2MEZMT.js} +304 -136
  112. package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
  113. package/commandRegistry-BP5JLW24.js +822 -0
  114. package/{contentThunks-TC3AENBY.js → contentThunks-2HYFUXUM.js} +29 -29
  115. package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  116. package/{createAgentAutomationAction-67EOD3WK.js → createAgentAutomationAction-DCKUSJH7.js} +29 -29
  117. package/{createDialogAction-4OCQC5MW.js → createDialogAction-NRIAEH2A.js} +32 -32
  118. package/{createPageAction-JLGVP57B.js → createPageAction-AUJHHXGG.js} +35 -35
  119. package/{dbSlice-RDGCE5MU.js → dbSlice-HFPIJT5P.js} +8 -8
  120. package/{deleteFile-YG6QMJLU.js → deleteFile-UEAD5A5Z.js} +3 -3
  121. package/{dialogCommands-JHSDKCR5.js → dialogCommands-UJRGCRN6.js} +42 -39
  122. package/{dialogSlice-I2DK32ZT.js → dialogSlice-AHU4XXIW.js} +35 -29
  123. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  124. package/{docCreateCommands-QUL6VWK2.js → docCreateCommands-ZOV3ZBLW.js} +39 -38
  125. package/{docDeleteCommands-DMQ2MU6I.js → docDeleteCommands-G4KAXJYQ.js} +39 -38
  126. package/{docReadCommands-FVHENBU6.js → docReadCommands-B2MM3JIT.js} +38 -37
  127. package/{docStore-OLC6MD7B.js → docStore-SITH63V3.js} +9 -9
  128. package/{docUpdateCommands-VA6V5C6L.js → docUpdateCommands-2QNF5CYN.js} +39 -38
  129. package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
  130. package/{getPricing-YYXTEPBP.js → getPricing-OX7B4R6B.js} +3 -3
  131. package/{handleSendMessageAction-GRDIRXAK.js → handleSendMessageAction-7ZMJMWLC.js} +72 -80
  132. package/index.js +74 -877
  133. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
  134. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
  135. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
  136. package/{machineCommands-IJJ66MYU.js → machineCommands-YCTD5KOL.js} +75 -71
  137. package/{machineWsRunDispatch-PP2ZBS6D.js → machineWsRunDispatch-JFMD4ZAW.js} +73 -69
  138. package/{memberThunks-WQGQWYYT.js → memberThunks-SKFZ37VS.js} +9 -9
  139. package/{models-UN7YGMPM.js → models-T3SG6MJ5.js} +2 -2
  140. package/oauthTokenStore-ITEB663N.js +23 -0
  141. package/{offlineMarxistsAgentCommand-JEWCIAWM.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
  142. package/package.json +1 -1
  143. package/pdf-U6KSUEZZ.js +26435 -0
  144. package/processSpawn-SOAV3FEV.js +11 -0
  145. package/profileConfig-ZGOFORWV.js +43 -0
  146. package/{providerPresetApply-NO73BG45.js → providerPresetApply-2QTBYN36.js} +7 -7
  147. package/{providerRegistry-OVY4VKNN.js → providerRegistry-SVXE4G4T.js} +7 -7
  148. package/{read-S4WC2OUK.js → read-IEJLLUXY.js} +5 -5
  149. package/{readDocTool-PQNM63KV.js → readDocTool-4SPYCP2Y.js} +5 -3
  150. package/{readlineWorkspace-ASJECDJD.js → readlineWorkspace-M3PLTBLD.js} +2396 -2018
  151. package/{removeDialogAgentAction-YJZ6XJV6.js → removeDialogAgentAction-LILXTOQY.js} +14 -14
  152. package/{runAgentClientLoop-KIOQSDRC.js → runAgentClientLoop-QMCXBOBH.js} +55 -55
  153. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
  154. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  155. package/{setDialogExtraReferencesAction-E6A3WL4E.js → setDialogExtraReferencesAction-LVNHLNT5.js} +10 -10
  156. package/{setPrimaryDialogAgentAction-WBLIVICQ.js → setPrimaryDialogAgentAction-DCKO5NTW.js} +14 -14
  157. package/{settingSlice-JR6S7TRD.js → settingSlice-CNE75ISY.js} +10 -10
  158. package/{spaceCommands-WDUNCAK5.js → spaceCommands-3U6OHM6O.js} +39 -38
  159. package/{streamAgentChatTurn-EGQDPMAO.js → streamAgentChatTurn-JPMJQSEE.js} +144 -84
  160. package/{switchDialogAgentAction-DTR36ZY2.js → switchDialogAgentAction-JSYUQ5CG.js} +11 -11
  161. package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
  162. package/{toolApiClient-7PSIFQPJ.js → toolApiClient-INIQCPGY.js} +3 -3
  163. package/{tools-AOVE5LKM.js → tools-XQ5GIH6P.js} +49 -49
  164. package/{tuiSummaryLlmCaller-XRQCSNYQ.js → tuiSummaryLlmCaller-L63PDJUD.js} +16 -15
  165. package/{updateCommands-2M74UL7P.js → updateCommands-ECWKIWLQ.js} +3 -3
  166. package/{updateDialogTitleAction-T66TXHIR.js → updateDialogTitleAction-EGAZMLUB.js} +32 -32
  167. package/agentRecordCommands-FST3KAKG.js +0 -126
  168. package/chunk-4QKBQHPQ.js +0 -79
  169. package/chunk-Q5FJJ6XI.js +0 -103
  170. package/chunk-S7Z2HMCN.js +0 -25
  171. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  172. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  173. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // packages/cli/agentCommandSupport.ts
6
6
  async function getDefaultCliDb() {
7
- const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-SYQGUF4U.js");
7
+ const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-3LRMNLCM.js");
8
8
  return getDefaultCliLocalRuntimeDb();
9
9
  }
10
10
  function createNullCliDb() {
@@ -1,15 +1,15 @@
1
- import {
2
- loadProfileConfig
3
- } from "./chunk-BYMV6QZG.js";
4
- import {
5
- resolveDefaultSpawn
6
- } from "./chunk-X7HHHIOZ.js";
7
1
  import {
8
2
  isCompiledBinary
9
3
  } from "./chunk-A7GB5UGH.js";
10
4
  import {
11
5
  DEFAULT_NOLO_SERVER_URL
12
6
  } from "./chunk-OLZBQWZU.js";
7
+ import {
8
+ loadProfileConfig
9
+ } from "./chunk-TNIX77YM.js";
10
+ import {
11
+ resolveDefaultSpawn
12
+ } from "./chunk-Y6ROFCZO.js";
13
13
  import {
14
14
  normalizeServerOrigin
15
15
  } from "./chunk-CF7PE763.js";
@@ -679,7 +679,11 @@ async function runShellScript(script, {
679
679
  const proc = spawn2({
680
680
  cmd: ["sh", "-c", script],
681
681
  cwd,
682
- stdin: "inherit",
682
+ // Capture mode (TUI sink): ignore stdin — the TUI's own decoder is
683
+ // reading the tty, and a child that reads stdin would race it for keys.
684
+ // The inherit branch is unreachable inside the TUI (useCustomSink is
685
+ // always true there) and stays the correct choice for `nolo update`.
686
+ stdin: useCustomSink ? "ignore" : "inherit",
683
687
  stdout: useCustomSink ? "pipe" : "inherit",
684
688
  stderr: useCustomSink ? "pipe" : "inherit",
685
689
  env
@@ -900,7 +904,8 @@ Nolo Agent CLI Installer & Updater
900
904
  const useCustomSink = options.output !== void 0;
901
905
  const proc = spawn2({
902
906
  cmd: command,
903
- stdin: "inherit",
907
+ // Capture mode (TUI sink): ignore stdin — see runShellScript.
908
+ stdin: useCustomSink ? "ignore" : "inherit",
904
909
  stdout: useCustomSink ? "pipe" : "inherit",
905
910
  stderr: useCustomSink ? "pipe" : "inherit",
906
911
  env
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  selectCurrentServer
3
- } from "./chunk-DM4UNXPK.js";
3
+ } from "./chunk-3IYMTWYZ.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-F3UTRUDO.js";
6
+ } from "./chunk-QALRKMHF.js";
7
7
  import {
8
8
  getIsDesktopApp
9
9
  } from "./chunk-QOKAKDPE.js";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  getActiveDialogKey
3
- } from "./chunk-6YTOJY35.js";
3
+ } from "./chunk-6D2JFXLY.js";
4
4
  import {
5
5
  compactWhitespace
6
6
  } from "./chunk-DWLEOOGR.js";
7
7
  import {
8
8
  asTrimmedLowercaseString
9
9
  } from "./chunk-QSJ3HFEF.js";
10
- import {
11
- extractCustomId
12
- } from "./chunk-GII32WZW.js";
13
10
  import {
14
11
  selectIdentityToken
15
12
  } from "./chunk-SEJ5OS6F.js";
16
13
  import {
17
14
  isRecord
18
15
  } from "./chunk-KUG52IAP.js";
16
+ import {
17
+ extractCustomId
18
+ } from "./chunk-M2EJHDJP.js";
19
19
 
20
20
  // packages/ai/tools/toolApiClient.ts
21
21
  var MAIN_SERVER = "https://nolo.chat";
@@ -1,6 +1,3 @@
1
- import {
2
- BUILTIN_PLATFORM_AGENT_KEYS
3
- } from "./chunk-XGJAR4T5.js";
4
1
  import {
5
2
  getRuntimeServerContext,
6
3
  partitionReadServers,
@@ -10,7 +7,7 @@ import {
10
7
  scheduleExistingRecordReplication,
11
8
  shouldReplaceLocalWithRemoteRecord,
12
9
  shouldReplicateLocalRecord
13
- } from "./chunk-UKWGR5SS.js";
10
+ } from "./chunk-AUXHZ2M5.js";
14
11
  import {
15
12
  fetchFromClientDb,
16
13
  fetchFromServer,
@@ -21,6 +18,9 @@ import {
21
18
  import {
22
19
  shouldReplaceWithNextRecord
23
20
  } from "./chunk-GBRG75BQ.js";
21
+ import {
22
+ BUILTIN_PLATFORM_AGENT_KEYS
23
+ } from "./chunk-BNGW5ASC.js";
24
24
  import {
25
25
  NOLO_CLUSTER_SERVERS,
26
26
  normalizeKnownServerOrigin
@@ -5,14 +5,17 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-YPYMGGPJ.js";
8
+ } from "./chunk-7YMUSSHQ.js";
9
+ import {
10
+ parseApiError
11
+ } from "./chunk-OCZKATRC.js";
9
12
  import {
10
13
  INVALID_TOOL_ARGS_REPLACEMENT,
11
14
  buildInvalidToolCallSelfHealResult,
12
15
  parseToolCallArguments,
13
16
  performFetchRequest,
14
17
  sanitizeOutboundMessages
15
- } from "./chunk-377KM42Z.js";
18
+ } from "./chunk-B4PW6UAI.js";
16
19
  import {
17
20
  createSSEParser,
18
21
  createToolRunId,
@@ -23,10 +26,7 @@ import {
23
26
  toolRunSetPending,
24
27
  toolRunStarted,
25
28
  toolRunSucceeded
26
- } from "./chunk-UBNV6CS6.js";
27
- import {
28
- getPublicImageAgentMode
29
- } from "./chunk-VIDPVFP3.js";
29
+ } from "./chunk-6PELJ3DS.js";
30
30
  import {
31
31
  getCurrentSpaceId
32
32
  } from "./chunk-ZJ7UHBJS.js";
@@ -35,15 +35,18 @@ import {
35
35
  messageStreamEnd,
36
36
  messageStreaming,
37
37
  updateToolMessage
38
- } from "./chunk-SUERPXJZ.js";
38
+ } from "./chunk-PAYUVQ6P.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-X2ZTVRXP.js";
41
+ } from "./chunk-46CRK7XP.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,
45
45
  tokenUsageLiveUpdate
46
- } from "./chunk-6YTOJY35.js";
46
+ } from "./chunk-6D2JFXLY.js";
47
+ import {
48
+ getPublicImageAgentMode
49
+ } from "./chunk-VIDPVFP3.js";
47
50
  import {
48
51
  accumulateToolCallDelta,
49
52
  createThinkParserState,
@@ -56,30 +59,27 @@ import {
56
59
  import {
57
60
  EMPTY_ASSISTANT_REPAIR_PROMPT,
58
61
  getModelInfo
59
- } from "./chunk-GRDSMV4V.js";
60
- import {
61
- getApiEndpoint
62
- } from "./chunk-4CAPEGHN.js";
62
+ } from "./chunk-LS2MI3B4.js";
63
63
  import {
64
64
  toErrorMessage
65
65
  } from "./chunk-HNMXYYJR.js";
66
+ import {
67
+ getApiEndpoint
68
+ } from "./chunk-ZI2MEZMT.js";
66
69
  import {
67
70
  selectCurrentServer
68
- } from "./chunk-DM4UNXPK.js";
71
+ } from "./chunk-3IYMTWYZ.js";
69
72
  import {
70
73
  write
71
- } from "./chunk-F3UTRUDO.js";
74
+ } from "./chunk-QALRKMHF.js";
72
75
  import {
73
76
  createDialogMessageKeyAndId,
74
77
  dialogMessageKey,
75
78
  toTrimmedString
76
- } from "./chunk-VMFTFOWF.js";
77
- import {
78
- extractCustomId
79
- } from "./chunk-GII32WZW.js";
79
+ } from "./chunk-3AH7LNUB.js";
80
80
  import {
81
81
  createAsyncThunk
82
- } from "./chunk-UKWGR5SS.js";
82
+ } from "./chunk-AUXHZ2M5.js";
83
83
  import {
84
84
  isAbortError
85
85
  } from "./chunk-QOKAKDPE.js";
@@ -89,6 +89,9 @@ import {
89
89
  import {
90
90
  isRecord
91
91
  } from "./chunk-KUG52IAP.js";
92
+ import {
93
+ extractCustomId
94
+ } from "./chunk-M2EJHDJP.js";
92
95
  import {
93
96
  asTrimmedString
94
97
  } from "./chunk-3EUW3WEO.js";
@@ -794,61 +797,6 @@ var handleToolCalls = createAsyncThunk(
794
797
  }
795
798
  );
796
799
 
797
- // packages/ai/chat/parseApiError.ts
798
- async function parseApiError(response) {
799
- const errorBody = await response.text();
800
- const truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
801
- const isContextOverflow = (message) => /maximum context length|context length|context_length_exceeded|requested about .*tokens|too many tokens/i.test(message);
802
- let defaultMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
803
- let errorMessage = defaultMessage;
804
- let errorCode = `E${response.status}`;
805
- try {
806
- const errorJson = JSON.parse(errorBody);
807
- errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || defaultMessage;
808
- errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
809
- } catch (_e) {
810
- if (errorBody) {
811
- errorMessage = errorBody;
812
- }
813
- }
814
- switch (response.status) {
815
- case 400:
816
- if (isContextOverflow(errorMessage) || isContextOverflow(errorBody) || errorCode === "UPSTREAM_400") {
817
- return "\u4E0A\u4E0B\u6587\u8FC7\u957F\uFF1A\u672C\u8F6E\u6D88\u606F\u6216\u5DE5\u5177\u7ED3\u679C\u592A\u5927\u3002\u8BF7\u7F29\u5C0F\u8303\u56F4\uFF0C\u6216\u5148\u8BFB\u53D6\u66F4\u5C0F\u7247\u6BB5\u540E\u518D\u7EE7\u7EED\u3002";
818
- }
819
- if (errorCode === "MISSING_PROVIDER_API_KEY") {
820
- return truncateErrorMessage(errorMessage);
821
- }
822
- if (errorMessage && errorMessage !== defaultMessage) {
823
- return `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`;
824
- }
825
- return "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165";
826
- case 413:
827
- return "\u8BF7\u6C42\u5185\u5BB9\u8FC7\u5927\uFF1A\u8BF7\u51CF\u5C11\u4E00\u6B21\u53D1\u9001\u7684\u6D88\u606F\u3001\u6587\u4EF6\u6216\u5DE5\u5177\u7ED3\u679C\u3002";
828
- case 401:
829
- switch (errorCode) {
830
- case "AUTH_TOKEN_EXPIRED":
831
- return "\u767B\u5F55\u72B6\u6001\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
832
- case "AUTH_ACCOUNT_INVALID":
833
- return "\u8D26\u6237\u65E0\u6548\u6216\u5DF2\u88AB\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458";
834
- case "AUTH_NO_TOKEN":
835
- return "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55";
836
- case "AUTH_INVALID_TOKEN":
837
- return "\u767B\u5F55\u51ED\u8BC1\u65E0\u6548\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
838
- case "AUTH_TOKEN_NOT_ACTIVE":
839
- return "\u4EE4\u724C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
840
- default:
841
- return errorMessage && errorMessage !== `\u72B6\u6001\u7801 401 Unauthorized` ? `\u8BA4\u8BC1\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}` : "\u8EAB\u4EFD\u9A8C\u8BC1\u5931\u8D25\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55";
842
- }
843
- case 503:
844
- return errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
845
- case 504:
846
- return "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5";
847
- default:
848
- return `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`;
849
- }
850
- }
851
-
852
800
  // packages/ai/chat/accumulateToolCallChunks.ts
853
801
  function accumulateToolCallChunks(currentAccumulatedCalls, toolCallChunks) {
854
802
  const accumulator = {
@@ -1839,7 +1787,6 @@ export {
1839
1787
  filterAndCleanMessages,
1840
1788
  persistToolMessages,
1841
1789
  handleToolCalls,
1842
- parseApiError,
1843
1790
  updateTotalUsage,
1844
1791
  readStreamChunk,
1845
1792
  sendOpenAICompletionsRequest
@@ -2,10 +2,10 @@ import {
2
2
  getCredentialsDir,
3
3
  getLegacyCredentialPath,
4
4
  migrateLegacyCredentialFile
5
- } from "./chunk-ONXOABJR.js";
5
+ } from "./chunk-HNGRBWYF.js";
6
6
  import {
7
7
  asNonEmptyStringArray
8
- } from "./chunk-VMFTFOWF.js";
8
+ } from "./chunk-3AH7LNUB.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-KUG52IAP.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRuntimeServerContext,
3
3
  scheduleDeleteReplication
4
- } from "./chunk-UKWGR5SS.js";
4
+ } from "./chunk-AUXHZ2M5.js";
5
5
  import {
6
6
  fetchFromClientDb
7
7
  } from "./chunk-QOKAKDPE.js";
@@ -91,6 +91,7 @@ function createCliAuthorityBrokerSocketInvoker(options) {
91
91
  const timeout = setTimeout(() => {
92
92
  finish(() => {
93
93
  socket.destroy();
94
+ socket.unref?.();
94
95
  reject(new CliAuthorityBrokerTimeoutError(options.endpoint, timeoutMs));
95
96
  });
96
97
  }, timeoutMs);
@@ -6,13 +6,13 @@ import {
6
6
  } from "./chunk-DWLEOOGR.js";
7
7
  import {
8
8
  addContentAction
9
- } from "./chunk-XLGHBHGP.js";
9
+ } from "./chunk-B7ANJQWZ.js";
10
10
  import {
11
11
  upload
12
- } from "./chunk-F3UTRUDO.js";
12
+ } from "./chunk-QALRKMHF.js";
13
13
  import {
14
14
  getRuntimeServerContext
15
- } from "./chunk-UKWGR5SS.js";
15
+ } from "./chunk-AUXHZ2M5.js";
16
16
  import {
17
17
  API_ENDPOINTS
18
18
  } from "./chunk-LCBAMY2M.js";
@@ -367,6 +367,7 @@ var truncateToolOutputForContext = (text, contextWindow) => {
367
367
  // packages/ai/context/planCompression.ts
368
368
  var MIN_COMPRESS_COUNT = 5;
369
369
  var ACTIVE_SUMMARY_TAIL_KEEP_COUNT = 2;
370
+ var COMPACTION_RETENTION_CUSHION_RATIO = 0.18;
370
371
  var MIN_TRIGGER_PENDING_COUNT = MIN_COMPRESS_COUNT + ACTIVE_SUMMARY_TAIL_KEEP_COUNT;
371
372
  var getMessageTokenCount = (msg) => {
372
373
  const content = serializeMessageContent(msg.content) || "";
@@ -409,13 +410,14 @@ var normalizeContextUsageRatio = (value) => {
409
410
  const ratio = value > 1 ? value / 100 : value;
410
411
  return ratio >= 0 && ratio <= 1 ? ratio : void 0;
411
412
  };
412
- var emptyPlan = (startIndex) => ({
413
+ var emptyPlan = (startIndex, diagnostics) => ({
413
414
  shouldCompress: false,
414
415
  compressCount: 0,
415
416
  msgsToCompress: [],
416
417
  msgsToKeep: [],
417
418
  newSummarizedBeforeId: void 0,
418
- startIndex
419
+ startIndex,
420
+ ...diagnostics ? { diagnostics } : {}
419
421
  });
420
422
  function findPendingMessages(allMsgs, summarizedBeforeId) {
421
423
  let startIndex = 0;
@@ -464,15 +466,42 @@ function calculateCompressCount(pendingMsgs, rawMessageBudget, opts) {
464
466
  }
465
467
  return pendingMsgs.length - keepCount;
466
468
  }
469
+ function resolveEffectiveCompactionBudgets(args) {
470
+ const {
471
+ contextWindow,
472
+ triggerRatio,
473
+ historyBudget,
474
+ rawMessageBudget,
475
+ summaryTokens,
476
+ cushionRatio = COMPACTION_RETENTION_CUSHION_RATIO
477
+ } = args;
478
+ const maxRetainedRatio = Math.max(
479
+ 0.2,
480
+ Number((triggerRatio - cushionRatio).toFixed(4))
481
+ );
482
+ const maxRetainedHistoryBudget = Math.floor(contextWindow * maxRetainedRatio);
483
+ const effectiveHistoryBudget = Math.min(historyBudget, maxRetainedHistoryBudget);
484
+ const effectiveRawMessageBudget = Math.min(
485
+ rawMessageBudget,
486
+ Math.max(0, effectiveHistoryBudget - summaryTokens)
487
+ );
488
+ return {
489
+ effectiveHistoryBudget,
490
+ effectiveRawMessageBudget,
491
+ maxRetainedRatio
492
+ };
493
+ }
467
494
  function guardToolChainBoundary(pendingMsgs, compressCount) {
468
495
  let count = compressCount;
469
- while (count > 0 && count < pendingMsgs.length && pendingMsgs[count].role === "tool") {
470
- count--;
496
+ while (count < pendingMsgs.length && pendingMsgs[count].role === "tool") {
497
+ count++;
471
498
  }
472
- if (count > 0) {
473
- const lastCompressed = pendingMsgs[count - 1];
474
- if (hasOpenEndedToolCall(lastCompressed)) {
499
+ while (count > 0 && hasOpenEndedToolCall(pendingMsgs[count - 1])) {
500
+ if (count < pendingMsgs.length && pendingMsgs[count].role === "tool") {
501
+ count++;
502
+ } else {
475
503
  count--;
504
+ break;
476
505
  }
477
506
  }
478
507
  return count;
@@ -489,7 +518,20 @@ function planCompression(input) {
489
518
  coldResume
490
519
  } = input;
491
520
  const { pendingMsgs, startIndex } = findPendingMessages(allMsgs, summarizedBeforeId);
492
- if (pendingMsgs.length === 0) return emptyPlan(startIndex);
521
+ if (pendingMsgs.length === 0) {
522
+ return emptyPlan(startIndex, {
523
+ pendingMsgCount: 0,
524
+ totalUsed: estimateTokenCount(summary || ""),
525
+ historyBudget: 0,
526
+ triggerRatio: resolveCompressionTriggerRatio(contextWindow),
527
+ realUsageRatio: normalizeContextUsageRatio(realContextUsagePercent),
528
+ triggeredByRealUsage: false,
529
+ triggeredByEstimate: false,
530
+ triggeredByColdResume: false,
531
+ shouldRunActiveSummary: false,
532
+ emptyReason: "no-pending"
533
+ });
534
+ }
493
535
  const summaryTokens = estimateTokenCount(summary || "");
494
536
  const pendingTokens = pendingMsgs.reduce((sum, msg) => sum + getMessageTokenCount(msg), 0);
495
537
  const totalUsed = summaryTokens + pendingTokens;
@@ -517,14 +559,47 @@ function planCompression(input) {
517
559
  coldResume,
518
560
  lastMsg: pendingMsgs[pendingMsgs.length - 1]
519
561
  });
520
- if (!trigger) return emptyPlan(startIndex);
521
- let compressCount = calculateCompressCount(pendingMsgs, rawMessageBudget, {
522
- keepTailCount: shouldRunActiveSummary || triggeredByRealUsage || triggeredByColdResume,
562
+ const diagnostics = {
563
+ pendingMsgCount: pendingMsgs.length,
523
564
  totalUsed,
524
- historyBudget
565
+ historyBudget,
566
+ triggerRatio,
567
+ realUsageRatio: normalizeContextUsageRatio(realContextUsagePercent),
568
+ triggeredByRealUsage,
569
+ triggeredByEstimate: normalizeContextUsageRatio(realContextUsagePercent) === void 0 && totalUsed >= historyBudget,
570
+ triggeredByColdResume,
571
+ shouldRunActiveSummary
572
+ };
573
+ if (!trigger) {
574
+ return emptyPlan(startIndex, {
575
+ ...diagnostics,
576
+ emptyReason: "not-triggered"
577
+ });
578
+ }
579
+ const { effectiveHistoryBudget, effectiveRawMessageBudget } = resolveEffectiveCompactionBudgets({
580
+ contextWindow,
581
+ triggerRatio,
582
+ historyBudget,
583
+ rawMessageBudget,
584
+ summaryTokens
525
585
  });
586
+ let compressCount = calculateCompressCount(
587
+ pendingMsgs,
588
+ effectiveRawMessageBudget,
589
+ {
590
+ keepTailCount: shouldRunActiveSummary || triggeredByRealUsage || triggeredByColdResume,
591
+ totalUsed,
592
+ historyBudget: effectiveHistoryBudget
593
+ }
594
+ );
526
595
  compressCount = guardToolChainBoundary(pendingMsgs, compressCount);
527
- if (compressCount < MIN_COMPRESS_COUNT) return emptyPlan(startIndex);
596
+ if (compressCount < MIN_COMPRESS_COUNT) {
597
+ return emptyPlan(startIndex, {
598
+ ...diagnostics,
599
+ compressCount,
600
+ emptyReason: "below-min-compress-count"
601
+ });
602
+ }
528
603
  const msgsToCompress = pendingMsgs.slice(0, compressCount);
529
604
  const msgsToKeep = pendingMsgs.slice(compressCount);
530
605
  const newSummarizedBeforeId = msgsToCompress[msgsToCompress.length - 1].id;
@@ -534,7 +609,8 @@ function planCompression(input) {
534
609
  msgsToCompress,
535
610
  msgsToKeep,
536
611
  newSummarizedBeforeId,
537
- startIndex
612
+ startIndex,
613
+ diagnostics: { ...diagnostics, compressCount }
538
614
  };
539
615
  }
540
616
 
@@ -691,14 +767,6 @@ function formatCompactionMetricsLog(metrics) {
691
767
  return `[Compaction] reason=${metrics.reason} compressed=${metrics.compressedCount}->${metrics.retainedCount} msgs, tokens=${totalBefore}->${totalAfter} (ratio=${ratio})${llmInfo}`;
692
768
  }
693
769
 
694
- // packages/core/clipCompactText.ts
695
- function clipCompactText(value, max, ellipsis = "...") {
696
- const compact = compactWhitespace(value);
697
- if (compact.length <= max) return compact;
698
- if (max <= ellipsis.length) return compact.slice(0, max);
699
- return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
700
- }
701
-
702
770
  // packages/ai/token/providerCallTiming.ts
703
771
  var defaultNow = () => {
704
772
  const perf = globalThis.performance;
@@ -769,7 +837,23 @@ var isMeaningfulResponsesOutput = (event) => {
769
837
  return false;
770
838
  };
771
839
 
840
+ // packages/core/clipCompactText.ts
841
+ function clipCompactText(value, max, ellipsis = "...") {
842
+ const compact = compactWhitespace(value);
843
+ if (compact.length <= max) return compact;
844
+ if (max <= ellipsis.length) return compact.slice(0, max);
845
+ return `${compact.slice(0, max - ellipsis.length)}${ellipsis}`;
846
+ }
847
+
772
848
  export {
849
+ normalizeTimingMs,
850
+ createProviderCallTimingTracker,
851
+ observeMeaningfulProviderResponseAt,
852
+ observeMeaningfulProviderResponse,
853
+ finalizeProviderCallTiming,
854
+ withProviderCallTimingFields,
855
+ isMeaningfulChatCompletionOutput,
856
+ isMeaningfulResponsesOutput,
773
857
  clipCompactText,
774
858
  planContextUsage,
775
859
  buildDatabaseFileContentUrl,
@@ -784,13 +868,5 @@ export {
784
868
  formatFileOperationsFromMessages,
785
869
  formatMessagesForSummaryWithTruncation,
786
870
  buildCompactionMetricsFromPlan,
787
- formatCompactionMetricsLog,
788
- normalizeTimingMs,
789
- createProviderCallTimingTracker,
790
- observeMeaningfulProviderResponseAt,
791
- observeMeaningfulProviderResponse,
792
- finalizeProviderCallTiming,
793
- withProviderCallTimingFields,
794
- isMeaningfulChatCompletionOutput,
795
- isMeaningfulResponsesOutput
871
+ formatCompactionMetricsLog
796
872
  };