nolo-cli 0.250.0-alpha.1 → 0.252.0-alpha.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 (186) hide show
  1. package/{_executeModel-F4MT6OPO.js → _executeModel-D6G3B45S.js} +51 -51
  2. package/{action-WZTKEF5H.js → action-QQOQ2LP3.js} +3 -3
  3. package/{addContentAction-MLI6GOBV.js → addContentAction-MB22YIDV.js} +6 -6
  4. package/{addDialogAgentAction-ARGQM22H.js → addDialogAgentAction-KNTBVVGY.js} +5 -5
  5. package/{agentDeleteCommand-DBCRHB4S.js → agentDeleteCommand-YCWDGJSF.js} +87 -82
  6. package/{agentEmailCommands-T4PAJ4KG.js → agentEmailCommands-DTWD5FWC.js} +87 -82
  7. package/{agentListCommands-5ULWKQ3E.js → agentListCommands-JTOONLYL.js} +233 -46
  8. package/{agentMachineCommands-65QUOCEY.js → agentMachineCommands-25X7OTLQ.js} +38 -36
  9. package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
  10. package/{agentPullCommand-4EQZYHU4.js → agentPullCommand-6OCNLVGC.js} +1 -1
  11. package/{agentRecordCommands-EKANS3A5.js → agentRecordCommands-SXE3WV2X.js} +86 -81
  12. package/{agentRunCommand-336PXBRJ.js → agentRunCommand-QSIED54S.js} +87 -82
  13. package/{agentRunControl-QMWTWV7C.js → agentRunControl-KNNDEEDI.js} +8 -6
  14. package/{agentRuntimeLocal-KKXJOBD3.js → agentRuntimeLocal-HVJJMB4W.js} +32 -31
  15. package/{agentSlice-FWYXP332.js → agentSlice-NBUJJVRI.js} +7 -7
  16. package/{appDeleteCommands-ERJK367V.js → appDeleteCommands-YU6TT6VN.js} +39 -37
  17. package/{appDeployCommands-LUV6QKQJ.js → appDeployCommands-4DEIX7YP.js} +39 -37
  18. package/{appDeployStatusCommands-WW7IYQD4.js → appDeployStatusCommands-3VKS6GBQ.js} +39 -37
  19. package/{appGetCommands-G7XYYSFO.js → appGetCommands-22FNNROT.js} +39 -37
  20. package/{appListCommands-4RXCIDNI.js → appListCommands-FVGMLHVU.js} +39 -37
  21. package/{authCommand-3C3RN4OU.js → authCommand-5DC3ES4Q.js} +15 -15
  22. package/{authCommands-ZMVEDCQD.js → authCommands-BLXNAUF4.js} +2 -2
  23. package/{chromeOpsCommands-NZITLHWO.js → chromeOpsCommands-AA555ANS.js} +1 -1
  24. package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
  25. package/chunk-2GAUJDA5.js +594 -0
  26. package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
  27. package/{chunk-222CJNC2.js → chunk-2LANL4B5.js} +3 -3
  28. package/{chunk-W4G25PVP.js → chunk-2PB653F5.js} +196 -253
  29. package/{chunk-UF6J7NXV.js → chunk-3272HU62.js} +1 -1
  30. package/chunk-3A5NNQCN.js +64 -0
  31. package/{chunk-7IQA2VJF.js → chunk-3N3JPQBQ.js} +210 -56
  32. package/{chunk-LXKK7QFI.js → chunk-4HAOOY6G.js} +53 -23
  33. package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
  34. package/{chunk-ADOOL3PG.js → chunk-52M4RYVP.js} +1 -1
  35. package/{chunk-U7OMQLRE.js → chunk-5IN2NBDX.js} +9 -9
  36. package/{chunk-BAH3BAUZ.js → chunk-5QEOTC35.js} +5 -5
  37. package/{chunk-E5RYFR7E.js → chunk-5UYDG6HP.js} +19 -0
  38. package/{chunk-Z7A2ZQ5X.js → chunk-64ACTEAE.js} +1 -1
  39. package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
  40. package/{chunk-BFKJ2RS3.js → chunk-7RYODZDD.js} +1 -1
  41. package/{chunk-YWNCRUBZ.js → chunk-7XO73H5X.js} +116 -6
  42. package/{chunk-SMEX763N.js → chunk-7ZOVFB2H.js} +100 -43
  43. package/{chunk-UR4ZMRV3.js → chunk-A5F6DYP2.js} +1 -1
  44. package/{chunk-ZKMS73DK.js → chunk-A6VIMCWI.js} +3 -3
  45. package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
  46. package/{chunk-LTVEOOZL.js → chunk-CIAV4WK2.js} +14 -1
  47. package/{chunk-HZDK56EK.js → chunk-CO2NXG2J.js} +32 -10
  48. package/{chunk-OHUYN3YU.js → chunk-CYGFNMCH.js} +1 -1
  49. package/{chunk-MZVCFV3T.js → chunk-D3WOFN6N.js} +3 -3
  50. package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
  51. package/{chunk-VV5IS3ES.js → chunk-DU3DJYVA.js} +5 -5
  52. package/{chunk-SPU3L3OR.js → chunk-EFM2IPZR.js} +3 -3
  53. package/{chunk-73PZD7JZ.js → chunk-EG3JTV7H.js} +2 -2
  54. package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
  55. package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
  56. package/{chunk-CD64YXRB.js → chunk-F6Q64KRV.js} +1 -1
  57. package/{chunk-TMRJGSK2.js → chunk-FRC2DNTN.js} +1 -1
  58. package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
  59. package/{chunk-I3J7HO3U.js → chunk-FZI2P64R.js} +137 -53
  60. package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
  61. package/{chunk-XHG7QROB.js → chunk-GO7UC5VH.js} +5 -5
  62. package/{chunk-RDBDHGU7.js → chunk-GVH2IP2M.js} +5 -5
  63. package/{chunk-AXZ5DDLB.js → chunk-GWS2X7TX.js} +235 -120
  64. package/{chunk-KHVTT4WW.js → chunk-HF4C5WIU.js} +81 -542
  65. package/{chunk-ATRU65OK.js → chunk-HMREADP6.js} +21 -19
  66. package/chunk-HZD5HXUO.js +405 -0
  67. package/{chunk-VHMPJGT4.js → chunk-ITCOQAHS.js} +3 -3
  68. package/{chunk-BQ4CZEVZ.js → chunk-ITMBFT35.js} +1 -1
  69. package/chunk-IVK2KT3H.js +209 -0
  70. package/{chunk-FFFKAOJN.js → chunk-JAYPSNGR.js} +1 -1
  71. package/{chunk-NEG5LYK5.js → chunk-JCQ3WCQ3.js} +3 -1
  72. package/{chunk-3IVFGQIM.js → chunk-JF5QT3YY.js} +2 -2
  73. package/{chunk-V4IYI3SB.js → chunk-JKALGWDL.js} +2 -2
  74. package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
  75. package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
  76. package/{chunk-HEIIOJGN.js → chunk-LAQC5FAP.js} +4 -4
  77. package/{chunk-I3OW5RAX.js → chunk-LNIA5JVX.js} +8 -8
  78. package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
  79. package/{chunk-W6T4FNZP.js → chunk-LUPZLKXL.js} +192 -352
  80. package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
  81. package/{chunk-SHDJLJWV.js → chunk-N2ZAY2DK.js} +1 -1
  82. package/{chunk-WEZ27JA7.js → chunk-NMXGIRSG.js} +1 -1
  83. package/{chunk-MTM4LRVG.js → chunk-NNUIVAC2.js} +1 -1
  84. package/{chunk-ARFCL53U.js → chunk-NPUHKEOB.js} +4 -4
  85. package/{chunk-32WTED6G.js → chunk-O6LPLIRS.js} +94 -83
  86. package/{chunk-4IQN6FWY.js → chunk-OB4FBZXJ.js} +4 -4
  87. package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
  88. package/{chunk-UPOW5HTG.js → chunk-OMIXG25B.js} +2 -2
  89. package/{chunk-MYYNZG2M.js → chunk-OOV5JN25.js} +4 -4
  90. package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
  91. package/{chunk-OKKA4BCM.js → chunk-P6HMEKLL.js} +114 -56
  92. package/{chunk-VTHWBTRE.js → chunk-PENRYZ4D.js} +1 -1
  93. package/{chunk-VIYVRPMJ.js → chunk-PHREU2KZ.js} +5 -3
  94. package/{chunk-EDT65EUE.js → chunk-PIVTQRX6.js} +45 -15
  95. package/{chunk-KJDN2YRH.js → chunk-QMKWSKWA.js} +4 -4
  96. package/{chunk-6TVYUQRM.js → chunk-QV32GSVO.js} +2 -2
  97. package/{chunk-K7VIXYTZ.js → chunk-R3MV2GII.js} +1 -45
  98. package/{chunk-XJSEST7D.js → chunk-SMCKJJXI.js} +2 -2
  99. package/{chunk-JFRJEPFI.js → chunk-SMZFWEMX.js} +1 -1
  100. package/{chunk-KK3FCYZM.js → chunk-SQL7YNED.js} +7 -4
  101. package/{chunk-D25ONVOH.js → chunk-SSZHE2RK.js} +1 -1
  102. package/{chunk-OLGFIQN2.js → chunk-T4VVQHSE.js} +1 -1
  103. package/{chunk-6QL3SUEK.js → chunk-TDI7ARZO.js} +3 -3
  104. package/{chunk-X6LYQDN5.js → chunk-TDLZA6LJ.js} +13 -10
  105. package/chunk-TRRXYFTR.js +46 -0
  106. package/{chunk-WMKA2DPK.js → chunk-TTUIM3PJ.js} +4 -4
  107. package/{chunk-RHBD22LV.js → chunk-TTWNTFTO.js} +39 -4
  108. package/{chunk-ZM5AZTQG.js → chunk-U7BP25PE.js} +18 -6
  109. package/{chunk-X3OZ655T.js → chunk-UI3Z3HDK.js} +1 -1
  110. package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
  111. package/{chunk-BVEDT6DM.js → chunk-VH7AQEEF.js} +3 -3
  112. package/{chunk-PGDM7AM2.js → chunk-WAOHK3NJ.js} +9 -9
  113. package/{chunk-2FK2KZSL.js → chunk-WLHUANWZ.js} +1 -1
  114. package/{chunk-ZTWDSOXD.js → chunk-WNIBQBOR.js} +1 -1
  115. package/{chunk-SLUZ6FBJ.js → chunk-XBCADGK2.js} +1 -1
  116. package/chunk-XRGBJHZX.js +136 -0
  117. package/{chunk-6XVPMGXK.js → chunk-YB5D2GK4.js} +9 -3
  118. package/{chunk-AKWA6PCE.js → chunk-YQYYYATY.js} +45 -27
  119. package/{chunk-WQDTSK5U.js → chunk-ZMFA2TLE.js} +1 -1
  120. package/{chunk-CFDOIIOZ.js → chunk-ZMXO5G3E.js} +29 -23
  121. package/{chunk-YQO5UKHP.js → chunk-ZNOXY73P.js} +632 -124
  122. package/{cliAgentConfigHelpers-37ZNEY5Y.js → cliAgentConfigHelpers-FKBPFPKR.js} +7 -7
  123. package/{cliAuthorityBrokerClient-SFPC3WVK.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
  124. package/cliAuthorityBrokerProcess-IUCB4XA6.js +22 -0
  125. package/{cliLocalAgentRecordReader-R4CLUHYO.js → cliLocalAgentRecordReader-DWU3LBO2.js} +36 -35
  126. package/{commandRegistry-UIZRI4JV.js → commandRegistry-7FVATZS2.js} +74 -74
  127. package/{contentThunks-ZQSZA4GH.js → contentThunks-25XCB7VY.js} +20 -20
  128. package/{cooldownCommands-TIFCHCUN.js → cooldownCommands-PT5L4LNB.js} +3 -3
  129. package/{createAgentAutomationAction-RQE4F6PR.js → createAgentAutomationAction-FC5RI2LW.js} +20 -20
  130. package/{createDialogAction-JDSMQ34U.js → createDialogAction-IL3ISSQQ.js} +21 -21
  131. package/{createPageAction-VLF6XCYO.js → createPageAction-RVYBEYZV.js} +23 -23
  132. package/{db-CMUTP3W5.js → db-JMGVD4TB.js} +4 -2
  133. package/{dbSlice-656PMWR2.js → dbSlice-WG3ZG6PZ.js} +5 -5
  134. package/{deleteFile-ZCQESEEQ.js → deleteFile-4TIG54YN.js} +3 -3
  135. package/{dialogCommands-PLM7ZFWH.js → dialogCommands-VUJISJZF.js} +48 -42
  136. package/{dialogNotifyCommand-PST75COP.js → dialogNotifyCommand-JKYVSR6K.js} +8 -8
  137. package/{dialogSlice-63DD2ER2.js → dialogSlice-UMP55UAW.js} +18 -18
  138. package/{dialogUsageCommand-6RW2FY6K.js → dialogUsageCommand-IHAXS7DW.js} +5 -5
  139. package/{docCreateCommands-BST5DO7L.js → docCreateCommands-S46F6GKP.js} +38 -36
  140. package/{docDeleteCommands-YE6G2SO4.js → docDeleteCommands-LJG4NK6J.js} +39 -37
  141. package/{docReadCommands-M6T35U3G.js → docReadCommands-YPAYGHNM.js} +38 -36
  142. package/{docStore-7QNJWRJ2.js → docStore-VK3MVJ5Q.js} +6 -6
  143. package/{docUpdateCommands-6DFWGPVG.js → docUpdateCommands-MPTM6267.js} +38 -36
  144. package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
  145. package/{handleSendMessageAction-FCEFFAV4.js → handleSendMessageAction-VPKVNKBU.js} +83 -41
  146. package/{hostCredentialCreate-YEWCAMZN.js → hostCredentialCreate-K56HWPNY.js} +86 -81
  147. package/index.js +23 -11
  148. package/{localDialogRead-CIOTQM5T.js → localDialogRead-NXILOV3T.js} +1 -1
  149. package/{localRuntimeAdapter-Z22ZOZRY.js → localRuntimeAdapter-KVU72FWT.js} +84 -79
  150. package/{localRuntimeAuthority-TYHQCTZN.js → localRuntimeAuthority-QKWTPBQQ.js} +13 -3
  151. package/{localRuntimeDb-BO7IVWAZ.js → localRuntimeDb-3CIC4SKC.js} +1 -1
  152. package/{machineCommands-PT5OJ36V.js → machineCommands-C3O5RKNJ.js} +85 -80
  153. package/{machineWsRunDispatch-DQVNBSVE.js → machineWsRunDispatch-ZLART7ZA.js} +85 -80
  154. package/{markdownToSlate-KIYM7B3P.js → markdownToSlate-PXYAIBVL.js} +1 -1
  155. package/{mcpLocalAuthorizeCommand-GO6AYT63.js → mcpLocalAuthorizeCommand-LO7E4VQ5.js} +15 -11
  156. package/{memberThunks-JFYC4Z5L.js → memberThunks-7DNR6DRD.js} +7 -7
  157. package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
  158. package/package.json +2 -1
  159. package/{projectArchive-4XUC5SLF.js → projectArchive-UBJFYRL7.js} +23 -23
  160. package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
  161. package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
  162. package/{read-BRZHXUJ6.js → read-Z2JOK6F6.js} +3 -3
  163. package/{readDocTool-N7RVFQEE.js → readDocTool-3QYSVWBT.js} +1 -1
  164. package/{readlineWorkspace-7U5QM3OM.js → readlineWorkspace-TSIYF7C6.js} +655 -248
  165. package/{removeDialogAgentAction-J7XU7OUX.js → removeDialogAgentAction-LRKDU4RI.js} +7 -7
  166. package/{runAgentClientLoop-7D7UCAS2.js → runAgentClientLoop-YAHGOWXN.js} +48 -48
  167. package/{runtimeDoctorCommands-RDRJXMXC.js → runtimeDoctorCommands-QGZSKNSE.js} +14 -11
  168. package/{secretCommands-2FEMRUFM.js → secretCommands-BXAQEOES.js} +2 -2
  169. package/{setDialogExtraReferencesAction-Q4V2ZZW2.js → setDialogExtraReferencesAction-KIITOCFP.js} +6 -6
  170. package/{setPrimaryDialogAgentAction-742H5S6T.js → setPrimaryDialogAgentAction-Y36PKFFB.js} +7 -7
  171. package/{settingThunks-IHXUF276.js → settingThunks-YQNG5L6K.js} +5 -5
  172. package/{spaceCommands-WCLD36WH.js → spaceCommands-P644AAZZ.js} +37 -35
  173. package/{streamAgentChatTurn-DVTOINT3.js → streamAgentChatTurn-5CSYAUAY.js} +81 -77
  174. package/{switchDialogAgentAction-HLDLHRRA.js → switchDialogAgentAction-U2VLPPVO.js} +5 -5
  175. package/{tools-BOPINT5S.js → tools-UZ3CDIR2.js} +38 -38
  176. package/{tuiRestart-5F2APN66.js → tuiRestart-GF4DGAAN.js} +7 -7
  177. package/{tuiSummaryLlmCaller-TM5BU73J.js → tuiSummaryLlmCaller-HROLGN4F.js} +13 -13
  178. package/{updateCommands-FBYA5WVG.js → updateCommands-BZ4YDHNM.js} +3 -3
  179. package/{updateDialogTitleAction-S76PUCLQ.js → updateDialogTitleAction-53XCCDK2.js} +20 -20
  180. package/{usageCommand-L4OFWXEU.js → usageCommand-XVJ7ZUTM.js} +2 -2
  181. package/{usageRebuildCommand-7JR33UHS.js → usageRebuildCommand-NK6S3D4J.js} +3 -3
  182. package/{windowsSelfUpdate-M4V77OUB.js → windowsSelfUpdate-4BAXX7C3.js} +2 -2
  183. package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-DYX5ZMAT.js} +2 -2
  184. package/chunk-FGHEF6WI.js +0 -34
  185. package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
  186. package/{chunk-CDIRKCPD.js → chunk-6HL6E7ZD.js} +152 -152
@@ -3,15 +3,19 @@ import {
3
3
  DEVIN_CONNECT_URL,
4
4
  parseSseDataLineJson,
5
5
  parseSseDataLineObject
6
- } from "./chunk-MYYNZG2M.js";
6
+ } from "./chunk-OOV5JN25.js";
7
7
  import {
8
8
  ALWAYS_EXCLUDED_GLOBS,
9
9
  EXECUTION_BACKEND_KINDS
10
- } from "./chunk-ANUP75N2.js";
10
+ } from "./chunk-2E4BYAUE.js";
11
11
  import {
12
12
  formatImageSummary,
13
13
  readLocalImage
14
14
  } from "./chunk-AL3TYDIF.js";
15
+ import {
16
+ evaluateFileWritePolicy,
17
+ summarizeToolArguments
18
+ } from "./chunk-CHOZJMJS.js";
15
19
  import {
16
20
  applyChatCompletionDelta,
17
21
  applyResponsesToolEvent,
@@ -20,19 +24,22 @@ import {
20
24
  flushChatCompletionStream,
21
25
  providerHttpFailure,
22
26
  throwIfChatCompletionStreamFailed
23
- } from "./chunk-EDT65EUE.js";
27
+ } from "./chunk-PIVTQRX6.js";
24
28
  import {
25
29
  readSseFrames
26
30
  } from "./chunk-HNUWUO75.js";
27
31
  import {
28
- evaluateFileWritePolicy,
29
- summarizeToolArguments
30
- } from "./chunk-CHOZJMJS.js";
32
+ resolveToolExecutionContract
33
+ } from "./chunk-DMPZMYH4.js";
31
34
  import {
32
35
  evaluateRequestBudget,
33
36
  hasImageInRuntimeMessages,
34
37
  stripImagePartsFromMessages
35
- } from "./chunk-WMKA2DPK.js";
38
+ } from "./chunk-TTUIM3PJ.js";
39
+ import {
40
+ resolveAgentImageInputSupport,
41
+ resolveToolImagePolicy
42
+ } from "./chunk-BZLGPM5B.js";
36
43
  import {
37
44
  applyShapingCounts,
38
45
  attachProjectionFacts,
@@ -43,7 +50,7 @@ import {
43
50
  projectUserPartForModel,
44
51
  resolveOutboundDiagnosticSink,
45
52
  writeThinkingFacts
46
- } from "./chunk-2FK2KZSL.js";
53
+ } from "./chunk-WLHUANWZ.js";
47
54
  import {
48
55
  createThinkParserState,
49
56
  createToolCallAccumulator,
@@ -62,7 +69,7 @@ import {
62
69
  hashStablePrefixContent,
63
70
  resolveResponseGuidelines,
64
71
  resolveToolGuidedSections
65
- } from "./chunk-LXKK7QFI.js";
72
+ } from "./chunk-4HAOOY6G.js";
66
73
  import {
67
74
  BRIDGE_STREAM_MAX_CHARS,
68
75
  CLI_NOLO_WORKSPACE_TOOL_NAMES,
@@ -77,7 +84,7 @@ import {
77
84
  parseNoloWorkspaceToolArguments,
78
85
  readTextStreamUpToChars,
79
86
  resolveNoloDialogInput
80
- } from "./chunk-CFDOIIOZ.js";
87
+ } from "./chunk-ZMXO5G3E.js";
81
88
  import {
82
89
  classifyUnparsableToolArgs,
83
90
  collectStablePromptPrefix,
@@ -101,7 +108,7 @@ import {
101
108
  toOpenAiCompatibleMessages,
102
109
  toResponsesTools,
103
110
  transferDowngradedToolTurnOrigin
104
- } from "./chunk-W3HSD32M.js";
111
+ } from "./chunk-FXEPZKNJ.js";
105
112
  import {
106
113
  TOOL_HAD_IMAGES,
107
114
  TOOL_IMAGES,
@@ -115,13 +122,6 @@ import {
115
122
  toolImages,
116
123
  withoutToolImages
117
124
  } from "./chunk-X4O7FJF5.js";
118
- import {
119
- resolveToolExecutionContract
120
- } from "./chunk-DMPZMYH4.js";
121
- import {
122
- resolveAgentImageInputSupport,
123
- resolveToolImagePolicy
124
- } from "./chunk-SX6AWTNK.js";
125
125
  import {
126
126
  isContextOverflowText,
127
127
  isQuotaExhaustedError
@@ -140,7 +140,7 @@ import {
140
140
  sanitizeToolOutputText,
141
141
  scrubObjectSecrets,
142
142
  scrubSecrets
143
- } from "./chunk-CDIRKCPD.js";
143
+ } from "./chunk-6HL6E7ZD.js";
144
144
  import {
145
145
  buildDialogFallbackTitleFromUserInput
146
146
  } from "./chunk-2MBTWINN.js";
@@ -152,7 +152,7 @@ import {
152
152
  resolveEmptyAssistantFallbackMessage,
153
153
  resolveEmptyAssistantOutcome,
154
154
  resolveTruncatedReasoningTailLog
155
- } from "./chunk-LTVEOOZL.js";
155
+ } from "./chunk-CIAV4WK2.js";
156
156
  import {
157
157
  COMPACTION_SUMMARY_SCHEMA_VERSION,
158
158
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -177,7 +177,7 @@ import {
177
177
  runSummaryWithContract,
178
178
  summaryCompletionTokens,
179
179
  truncateToolOutputForContext
180
- } from "./chunk-MAA42MMV.js";
180
+ } from "./chunk-2FZVXOFX.js";
181
181
  import {
182
182
  createProviderCallTimingTracker,
183
183
  finalizeProviderCallTiming,
@@ -185,12 +185,12 @@ import {
185
185
  observeMeaningfulProviderResponse,
186
186
  withProviderCallTimingFields
187
187
  } from "./chunk-H57T64RA.js";
188
- import {
189
- sha256Hex
190
- } from "./chunk-SR4FE5VD.js";
191
188
  import {
192
189
  clipCompactText
193
190
  } from "./chunk-5MMAK75Q.js";
191
+ import {
192
+ sha256Hex
193
+ } from "./chunk-SR4FE5VD.js";
194
194
  import {
195
195
  asRecordOrEmpty
196
196
  } from "./chunk-KX6YBIHG.js";
@@ -226,6 +226,9 @@ import {
226
226
  import {
227
227
  estimateTokenCount
228
228
  } from "./chunk-PSCNXBYA.js";
229
+ import {
230
+ Mutex
231
+ } from "./chunk-IVK2KT3H.js";
229
232
  import {
230
233
  isLevelNotFoundError
231
234
  } from "./chunk-OW765XBU.js";
@@ -257,10 +260,10 @@ import {
257
260
  } from "./chunk-OJKUU3LP.js";
258
261
  import {
259
262
  resolveLocalUserId
260
- } from "./chunk-UPOW5HTG.js";
263
+ } from "./chunk-OMIXG25B.js";
261
264
  import {
262
265
  applyToolSurfaceConstraints
263
- } from "./chunk-NEG5LYK5.js";
266
+ } from "./chunk-JCQ3WCQ3.js";
264
267
  import {
265
268
  canonicalizeToolName,
266
269
  canonicalizeToolNames
@@ -277,7 +280,7 @@ import {
277
280
  import {
278
281
  buildProviderAuthHeaders,
279
282
  buildProviderExecutionPlan
280
- } from "./chunk-K26XPZRB.js";
283
+ } from "./chunk-LVZVSLKO.js";
281
284
  import {
282
285
  asTrimmedString
283
286
  } from "./chunk-3EUW3WEO.js";
@@ -292,7 +295,7 @@ import {
292
295
  } from "./chunk-CF7PE763.js";
293
296
  import {
294
297
  PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL
295
- } from "./chunk-PQ63BDV3.js";
298
+ } from "./chunk-JPXACKSW.js";
296
299
  import {
297
300
  asTrimmedLowercaseString
298
301
  } from "./chunk-QSJ3HFEF.js";
@@ -5124,7 +5127,7 @@ var makeCachedUnsafe = (self, ttlMillis) => {
5124
5127
  let expiresAt = 0;
5125
5128
  let exit3;
5126
5129
  let current;
5127
- const join3 = (fiber3, run2) => {
5130
+ const join4 = (fiber3, run2) => {
5128
5131
  run2.awaiters++;
5129
5132
  onExitUnsafe(fiber3, () => {
5130
5133
  if (--run2.awaiters > 0 || run2.done) return;
@@ -5135,7 +5138,7 @@ var makeCachedUnsafe = (self, ttlMillis) => {
5135
5138
  };
5136
5139
  return [withFiber((fiber3) => {
5137
5140
  if (current !== void 0) {
5138
- return fiber3 === current.fiber ? fiberJoin(current.fiber) : join3(fiber3, current);
5141
+ return fiber3 === current.fiber ? fiberJoin(current.fiber) : join4(fiber3, current);
5139
5142
  }
5140
5143
  if (exit3 !== void 0 && (expiresAt === Infinity || fiber3.getRef(ClockRef).currentTimeMillisUnsafe() < expiresAt)) {
5141
5144
  return exit3;
@@ -5148,7 +5151,7 @@ var makeCachedUnsafe = (self, ttlMillis) => {
5148
5151
  done: false
5149
5152
  };
5150
5153
  current = run2;
5151
- const joined = join3(fiber3, run2);
5154
+ const joined = join4(fiber3, run2);
5152
5155
  run2.fiber.evaluate(onExitPrimitive(self, (exit_) => {
5153
5156
  run2.done = true;
5154
5157
  if (current !== run2) return;
@@ -13220,8 +13223,8 @@ function createLoopTiming() {
13220
13223
  if (!lines) return;
13221
13224
  if (LOOP_TIMING_FILE) {
13222
13225
  try {
13223
- const { appendFileSync } = await import("node:fs");
13224
- appendFileSync(LOOP_TIMING_FILE, lines + "\n");
13226
+ const { appendFileSync: appendFileSync2 } = await import("node:fs");
13227
+ appendFileSync2(LOOP_TIMING_FILE, lines + "\n");
13225
13228
  } catch {
13226
13229
  }
13227
13230
  } else {
@@ -14741,15 +14744,16 @@ var execShellCapability = {
14741
14744
  shell: normalized.shell,
14742
14745
  ...typeof normalized.login === "boolean" ? { login: normalized.login } : {}
14743
14746
  });
14744
- const background = normalized.background === true;
14747
+ const background = ctx.disableBackgroundDetach === true ? false : normalized.background === true;
14748
+ const effectiveTimeoutMs = resolveExecShellTimeoutMs(ctx.commandTimeoutMs);
14745
14749
  const executionArgs = {
14746
14750
  workspaceRoot,
14747
14751
  command: shellPlan.argv,
14748
- timeoutMs: resolveExecShellTimeoutMs(ctx.commandTimeoutMs),
14752
+ timeoutMs: effectiveTimeoutMs,
14749
14753
  outputLimit: ctx.commandOutputLimit,
14750
14754
  commandPrefix: ctx.commandPrefix,
14751
14755
  abortSignal: ctx.abortSignal,
14752
- detachMs: background ? 0 : isImmediateDetachShellCommand({ command }) ? 0 : ctx.detachMs,
14756
+ detachMs: ctx.disableBackgroundDetach === true ? Math.max((effectiveTimeoutMs ?? 3e4) + 6e4, 12e4) : background ? 0 : isImmediateDetachShellCommand({ command }) ? 0 : ctx.detachMs,
14753
14757
  stdin: typeof normalized.input === "string" ? normalized.input : void 0,
14754
14758
  label: typeof normalized.label === "string" ? normalized.label : void 0,
14755
14759
  // Ownership of the turn that invoked this command: an auto-detached
@@ -16118,7 +16122,7 @@ function buildWorkspacePathProperty() {
16118
16122
  };
16119
16123
  }
16120
16124
  function buildReadWorkspaceDescription() {
16121
- return "Read a UTF-8 text file inside the workspace. For multiple files, call readFile concurrently in the same turn. Absolute paths and ~/ are also accepted (runtime spill files can be read directly). Use lines for focused range reads after search to save tokens. A range already delivered earlier for an unchanged file answers with a short notice instead of resending (force:true refetches).";
16125
+ return "Read a UTF-8 text file inside the workspace. For multiple known targets, call readFile concurrently in the same turn (use available search or glob tools first when paths or line ranges are uncertain). Absolute paths and ~/ are also accepted (runtime spill files can be read directly). Use lines for focused range reads after search to save tokens. A range already delivered earlier for an unchanged file answers with a short notice instead of resending (force:true refetches).";
16122
16126
  }
16123
16127
  function buildReadWorkspaceParameters() {
16124
16128
  const path = buildWorkspacePathProperty();
@@ -17970,6 +17974,7 @@ async function execShellTool(args2) {
17970
17974
  restrictToWorkspace: args2.restrictToWorkspace,
17971
17975
  abortSignal: args2.abortSignal,
17972
17976
  detachMs: args2.detachMs,
17977
+ disableBackgroundDetach: args2.disableBackgroundDetach,
17973
17978
  confirmed: args2.confirmed,
17974
17979
  enableDestructiveShellGuard: args2.enableDestructiveShellGuard,
17975
17980
  confirmDestructiveAction: args2.confirmDestructiveAction,
@@ -18450,6 +18455,7 @@ function createLocalWorkspaceToolExecutors(args2) {
18450
18455
  restrictToWorkspace: args2.restrictShellToWorkspace,
18451
18456
  abortSignal: opts?.abortSignal ?? args2.abortSignal,
18452
18457
  detachMs: opts?.detachMs ?? args2.detachMs,
18458
+ disableBackgroundDetach: args2.disableBackgroundDetach,
18453
18459
  confirmed: opts?.confirmed,
18454
18460
  enableDestructiveShellGuard: opts?.enableDestructiveShellGuard,
18455
18461
  confirmDestructiveAction: opts?.confirmDestructiveAction,
@@ -19248,10 +19254,13 @@ async function executeToolCall(args2) {
19248
19254
  }
19249
19255
  if (!toolResult) {
19250
19256
  let runtimeContext = input.runtimeContext;
19251
- if (args2.getDirectWorkSource && !runtimeContext?.userMessageId && toolName === "rememberMemory" && parseNoloWorkspaceToolArguments(unwrappedArguments).mode === "work") {
19252
- const id = await args2.getDirectWorkSource();
19253
- throwIfAborted(input);
19254
- if (id) runtimeContext = { ...runtimeContext, userMessageId: id };
19257
+ if (args2.getDirectWorkSource && !runtimeContext?.userMessageId && (toolName === "rememberMemory" || toolName === "queryMemory")) {
19258
+ const memoryArgs = parseNoloWorkspaceToolArguments(unwrappedArguments);
19259
+ if (memoryArgs.mode === "work" && (toolName === "rememberMemory" || memoryArgs.storage === void 0 || memoryArgs.storage === "local")) {
19260
+ const id = await args2.getDirectWorkSource();
19261
+ throwIfAborted(input);
19262
+ if (id) runtimeContext = { ...runtimeContext, userMessageId: id };
19263
+ }
19255
19264
  }
19256
19265
  const executePromise = input.adapter.executeTool({
19257
19266
  id: toolCall.id,
@@ -19641,7 +19650,7 @@ function createSubtaskSoftBudgetAdvisor(options) {
19641
19650
  }
19642
19651
 
19643
19652
  // packages/agent-runtime/leafFinalHandoff.ts
19644
- var LEAF_FINAL_HANDOFF_INSTRUCTIONS = `Leaf subtask final: return only the result, blockers/findings, and minimal evidence the parent needs. Do not narrate your process or restate the task. Keep success concise without dropping the current delivery scope, unresolved blockers or evidence references; on failure include the blocker, severity when relevant, and an evidence reference (file:line, test command, commit, artifact, or run/dialog). If the task explicitly requires a long-form deliverable (document, translation, dataset, code, or other artifact), provide that deliverable in full and keep only the handoff around it concise. During execution, follow the brief as given: keep progress updates incremental to the brief; the final report must stand alone with the complete current delivery scope, unresolved blockers and evidence references, including on continuation; only when new evidence would materially change the goal, risk, irreversibility, or DoD should you surface it as a blocker/finding \u2014 do not silently expand scope or re-litigate the settled direction. Own investigation, implementation, related checks and failure fixes within the brief\u2019s scope and budget; leave goals and critical decisions to the parent. For required DoD checks, include the worktree, checked version (including uncommitted change scope), command, check scope, pass/fail and original-output reference; explicitly mark checks not run or evidence unavailable. Reuse valid same-version evidence; additional checks are warranted for version changes, missing/conflicting evidence or integration risk. Do not invent version metadata. Process done/exit 0 and assistant claims do not establish passing tests, user acceptance, independent review approval, integration or release; runtime acceptance is observations only and unknown remains unknown. Preserve a requested reviewer JSON/checkVerdict format; do not wrap it in another report. Keep success concise without omitting required evidence.`;
19653
+ var LEAF_FINAL_HANDOFF_INSTRUCTIONS = `Leaf subtask final: return only the result, blockers/findings, and minimal evidence the parent needs. Do not narrate your process or restate the task. Keep success concise without dropping the current delivery scope, unresolved blockers or evidence references; on failure include the blocker, severity when relevant, and an evidence reference (file:line, test command, commit, artifact, or run/dialog). If the task explicitly requires a long-form deliverable (document, translation, dataset, code, or other artifact), provide that deliverable in full and keep only the handoff around it concise. During execution, follow the brief as given: keep progress updates incremental to the brief; the final report must stand alone with the complete current delivery scope, unresolved blockers and evidence references, including on continuation; only when new evidence would materially change the goal, risk, irreversibility, or DoD should you surface it as a blocker/finding \u2014 do not silently expand scope or re-litigate the settled direction. Own investigation, implementation, related checks and failure fixes within the brief\u2019s scope and budget; leave goals and critical decisions to the parent. Escalate instead of patching blindly: if the root cause falls outside the brief's stated scope, or the same problem is still unconverged after two consecutive fix attempts, stop and return need_escalation in the final report with the verified facts, failed attempts and evidence references, so the parent can pick a stronger tier or change approach. For required DoD checks, include the worktree, checked version (including uncommitted change scope), command, check scope, pass/fail and original-output reference; explicitly mark checks not run or evidence unavailable. Reuse valid same-version evidence; additional checks are warranted for version changes, missing/conflicting evidence or integration risk. Do not invent version metadata. Process done/exit 0 and assistant claims do not establish passing tests, user acceptance, independent review approval, integration or release; runtime acceptance is observations only and unknown remains unknown. Preserve a requested reviewer JSON/checkVerdict format; do not wrap it in another report. Keep success concise without omitting required evidence.`;
19645
19654
 
19646
19655
  // packages/agent-runtime/contextBlockScope.ts
19647
19656
  var isContextBlockScope = (value) => {
@@ -19685,6 +19694,40 @@ function resolveProviderInputItemLimit(args2) {
19685
19694
  )?.maxInputItems;
19686
19695
  }
19687
19696
 
19697
+ // packages/agent-runtime/compactionTelemetryLog.ts
19698
+ import { appendFileSync, mkdirSync } from "node:fs";
19699
+ import { dirname as dirname3, join as join3 } from "node:path";
19700
+ var COMPACTION_TELEMETRY_SCHEMA_VERSION = 1;
19701
+ function isTestEnvironment() {
19702
+ if (typeof process === "undefined") return false;
19703
+ return process.env?.NODE_ENV === "test" || process.env?.BUN_ENV === "test";
19704
+ }
19705
+ function resolveCompactionTelemetryLogPath(opts) {
19706
+ if (typeof process !== "undefined" && process.env?.NOLO_COMPACTION_LOG_DISABLE === "1") {
19707
+ return null;
19708
+ }
19709
+ const explicit = opts?.logFile?.trim();
19710
+ if (explicit) return explicit;
19711
+ const envFile = typeof process !== "undefined" ? process.env?.NOLO_COMPACTION_LOG_FILE?.trim() : void 0;
19712
+ if (envFile) return envFile;
19713
+ const noloHome = typeof process !== "undefined" ? process.env?.NOLO_HOME?.trim() : void 0;
19714
+ if (isTestEnvironment() && !noloHome && !opts?.allowDefaultInTest) {
19715
+ return null;
19716
+ }
19717
+ return join3(resolveNoloStateDir("telemetry"), "compaction.jsonl");
19718
+ }
19719
+ function appendCompactionTelemetryRecord(record2, opts) {
19720
+ const file = resolveCompactionTelemetryLogPath(opts);
19721
+ if (!file) return false;
19722
+ try {
19723
+ mkdirSync(dirname3(file), { recursive: true });
19724
+ appendFileSync(file, JSON.stringify(record2) + "\n", "utf8");
19725
+ return true;
19726
+ } catch {
19727
+ return false;
19728
+ }
19729
+ }
19730
+
19688
19731
  // packages/agent-runtime/localAutoCompaction.ts
19689
19732
  import { randomUUID } from "node:crypto";
19690
19733
  function toPlanCompressionMessages(history) {
@@ -20043,12 +20086,48 @@ async function maybeAutoCompactLocalHistory(args2) {
20043
20086
  contextWindow,
20044
20087
  canonicalizeToolName
20045
20088
  });
20089
+ const telemetryTrigger = invalidSummary ? "invalid-summary" : args2.force ? "budget-rescue" : plan.diagnostics?.triggeredByItemLimit ? "item-limit" : plan.diagnostics?.triggeredByRealUsage ? "real-usage" : plan.diagnostics?.triggeredByEstimate ? "estimate" : "unknown";
20090
+ const telemetryPromptTokens = typeof args2.triggerPromptTokens === "number" && Number.isFinite(args2.triggerPromptTokens) && args2.triggerPromptTokens > 0 ? Math.round(args2.triggerPromptTokens) : null;
20091
+ const telemetryLogOpts = args2.telemetryLogFile ? { logFile: args2.telemetryLogFile } : void 0;
20046
20092
  if (bounded3.status === "blocked") {
20047
20093
  const detail = `bounded compaction blocked: ${bounded3.reason}`;
20048
20094
  console.warn(
20049
20095
  `[localLoop] ${detail}`,
20050
20096
  ...bounded3.diagnostics ? [bounded3.diagnostics] : []
20051
20097
  );
20098
+ appendCompactionTelemetryRecord(
20099
+ {
20100
+ schemaVersion: COMPACTION_TELEMETRY_SCHEMA_VERSION,
20101
+ ts: new Date(args2.now?.() ?? Date.now()).toISOString(),
20102
+ dialogId,
20103
+ outcome: "blocked",
20104
+ trigger: telemetryTrigger,
20105
+ attempts: 0,
20106
+ model: args2.model ?? null,
20107
+ provider: args2.provider ?? null,
20108
+ contextWindow,
20109
+ triggerPromptTokens: telemetryPromptTokens,
20110
+ realUsageRatio: plan.diagnostics?.realUsageRatio ?? null,
20111
+ estimatedTokens: plan.diagnostics?.totalUsed ?? null,
20112
+ elapsedMs: null,
20113
+ primaryElapsedMs: null,
20114
+ saveElapsedMs: null,
20115
+ summaryInputTokens: null,
20116
+ summaryInputCapTokens: bounded3.diagnostics?.cap ?? null,
20117
+ summaryExpandedMessages: bounded3.diagnostics?.expandedMessages ?? null,
20118
+ summaryOmittedMessages: null,
20119
+ pendingMessageCount: plan.diagnostics?.pendingMsgCount ?? null,
20120
+ compressedCount: null,
20121
+ retainedCount: null,
20122
+ compressedTokens: null,
20123
+ newSummaryTokens: null,
20124
+ residentReductionTokens: null,
20125
+ beforeProjectedTokens: null,
20126
+ afterProjectedTokens: null,
20127
+ finishReason: null
20128
+ },
20129
+ telemetryLogOpts
20130
+ );
20052
20131
  return {
20053
20132
  ...projectExisting(),
20054
20133
  decision: { outcome: "skipped", skipReason: "bounded-request-blocked", detail }
@@ -20061,7 +20140,9 @@ async function maybeAutoCompactLocalHistory(args2) {
20061
20140
  let retryCount = 0;
20062
20141
  let attemptRoute = "current";
20063
20142
  let attemptTimingLogged = false;
20064
- let compactionT0 = Date.now();
20143
+ let telemetryWritten = false;
20144
+ const compactionEventT0 = Date.now();
20145
+ let compactionT0 = compactionEventT0;
20065
20146
  let compactionInputTokens;
20066
20147
  let compactionPrevSummaryTokens;
20067
20148
  let compactionInputSource;
@@ -20075,6 +20156,45 @@ async function maybeAutoCompactLocalHistory(args2) {
20075
20156
  let summaryDiagnostics = {
20076
20157
  maxOutputTokens: bounded3.outputTokenBudget
20077
20158
  };
20159
+ const writeCompactionTelemetryOnce = (outcome, fields = {}) => {
20160
+ if (telemetryWritten) return;
20161
+ telemetryWritten = true;
20162
+ const m = fields.metrics;
20163
+ const isSuccess6 = outcome === "success";
20164
+ appendCompactionTelemetryRecord(
20165
+ {
20166
+ schemaVersion: COMPACTION_TELEMETRY_SCHEMA_VERSION,
20167
+ ts: new Date(args2.now?.() ?? Date.now()).toISOString(),
20168
+ dialogId,
20169
+ outcome,
20170
+ trigger: telemetryTrigger,
20171
+ attempts: attempt,
20172
+ model: fields.model ?? summaryModel ?? null,
20173
+ provider: summaryProvider ?? null,
20174
+ contextWindow,
20175
+ triggerPromptTokens: telemetryPromptTokens,
20176
+ realUsageRatio: plan.diagnostics?.realUsageRatio ?? null,
20177
+ estimatedTokens: plan.diagnostics?.totalUsed ?? null,
20178
+ elapsedMs: Date.now() - compactionEventT0,
20179
+ primaryElapsedMs: primaryElapsedMs ?? null,
20180
+ saveElapsedMs: saveElapsedMs ?? null,
20181
+ summaryInputTokens: m?.summaryInputTokens ?? bounded3.inputTokens ?? null,
20182
+ summaryInputCapTokens: m?.summaryInputCapTokens ?? bounded3.capTokens ?? null,
20183
+ summaryExpandedMessages: m?.summaryExpandedMessages ?? bounded3.expandedMessages ?? null,
20184
+ summaryOmittedMessages: isSuccess6 ? m?.summaryOmittedMessages ?? bounded3.omittedMessages ?? null : null,
20185
+ pendingMessageCount: m?.pendingMessageCount ?? plan.diagnostics?.pendingMsgCount ?? null,
20186
+ compressedCount: m?.compressedCount ?? null,
20187
+ retainedCount: m?.retainedCount ?? null,
20188
+ compressedTokens: m?.compressedTokens ?? null,
20189
+ newSummaryTokens: m?.newSummaryTokens ?? null,
20190
+ residentReductionTokens: m?.residentReductionTokens ?? null,
20191
+ beforeProjectedTokens: fields.beforeProjectedTokens ?? null,
20192
+ afterProjectedTokens: fields.afterProjectedTokens ?? null,
20193
+ finishReason: summaryDiagnostics.finishReason ?? null
20194
+ },
20195
+ telemetryLogOpts
20196
+ );
20197
+ };
20078
20198
  const logCompactionTiming = (outcome, fields) => {
20079
20199
  if (attemptTimingLogged) return;
20080
20200
  attemptTimingLogged = true;
@@ -20084,6 +20204,8 @@ async function maybeAutoCompactLocalHistory(args2) {
20084
20204
  if (compactionPrevSummaryTokens === void 0 && compactionPrevSummarySource !== void 0) {
20085
20205
  compactionPrevSummaryTokens = estimateTokenCount(compactionPrevSummarySource);
20086
20206
  }
20207
+ const elapsedMs = Date.now() - compactionT0;
20208
+ const resolvedModel = fields.model ?? summaryModel ?? null;
20087
20209
  console.log(
20088
20210
  `[compaction-timing] ${JSON.stringify({
20089
20211
  attemptId: compactionAttemptId,
@@ -20091,7 +20213,7 @@ async function maybeAutoCompactLocalHistory(args2) {
20091
20213
  maxAttempts,
20092
20214
  physicalAttempts: attempt,
20093
20215
  route: attemptRoute,
20094
- model: fields.model ?? summaryModel ?? null,
20216
+ model: resolvedModel,
20095
20217
  provider: summaryProvider ?? null,
20096
20218
  inputTokens: compactionInputTokens ?? null,
20097
20219
  prevSummaryTokens: compactionPrevSummaryTokens ?? null,
@@ -20101,7 +20223,7 @@ async function maybeAutoCompactLocalHistory(args2) {
20101
20223
  incompleteReason: summaryDiagnostics.incompleteReason ?? null,
20102
20224
  maxOutputTokens: summaryDiagnostics.maxOutputTokens ?? null,
20103
20225
  completionTokens: summaryDiagnostics.completionTokens ?? null,
20104
- elapsedMs: Date.now() - compactionT0,
20226
+ elapsedMs,
20105
20227
  primaryElapsedMs: primaryElapsedMs ?? null,
20106
20228
  fallbackElapsedMs: fallbackElapsedMs ?? null,
20107
20229
  saveElapsedMs: saveElapsedMs ?? null,
@@ -20302,6 +20424,7 @@ async function maybeAutoCompactLocalHistory(args2) {
20302
20424
  if (!newSummary) {
20303
20425
  recordCompactionFailure(dialogId, args2.now?.() ?? Date.now());
20304
20426
  logCompactionTiming("empty", { model: result4?.model });
20427
+ writeCompactionTelemetryOnce("empty", { model: result4?.model });
20305
20428
  emitPhase({ kind: "compaction-end" });
20306
20429
  return { ...projectExisting(), failureMessage: "Summary empty", failureReason: "provider-error", decision: { outcome: "failed", reason: "provider-error", detail: "Summary empty", ...itemDiagnostics } };
20307
20430
  }
@@ -20363,6 +20486,11 @@ async function maybeAutoCompactLocalHistory(args2) {
20363
20486
  console.warn(`[localLoop] ${failureMessage}`);
20364
20487
  recordCompactionFailure(dialogId, args2.now?.() ?? Date.now());
20365
20488
  logCompactionTiming("empty", {});
20489
+ writeCompactionTelemetryOnce("unsafe-projection", {
20490
+ model: result4?.model ?? args2.model ?? null,
20491
+ beforeProjectedTokens,
20492
+ afterProjectedTokens: projectedTokens
20493
+ });
20366
20494
  emitPhase({ kind: "compaction-end" });
20367
20495
  return {
20368
20496
  ...oldProjection,
@@ -20414,6 +20542,12 @@ async function maybeAutoCompactLocalHistory(args2) {
20414
20542
  model: result4?.model ?? args2.model ?? null,
20415
20543
  outputChars: newSummary.length
20416
20544
  });
20545
+ writeCompactionTelemetryOnce("success", {
20546
+ model: result4?.model ?? args2.model ?? null,
20547
+ metrics,
20548
+ beforeProjectedTokens,
20549
+ afterProjectedTokens: projectedTokens
20550
+ });
20417
20551
  emitPhase({ kind: "compaction-end" });
20418
20552
  return {
20419
20553
  history: projectedHistory,
@@ -20462,6 +20596,7 @@ async function maybeAutoCompactLocalHistory(args2) {
20462
20596
  ...safe.outputChars === void 0 ? {} : { outputChars: safe.outputChars }
20463
20597
  };
20464
20598
  logCompactionTiming(failureReason, {});
20599
+ writeCompactionTelemetryOnce(failureReason, {});
20465
20600
  const failureNow = args2.now?.() ?? Date.now();
20466
20601
  if (failureReason !== "aborted") recordCompactionFailure(dialogId, failureNow);
20467
20602
  if (failureReason === "aborted") emitPhase({ kind: "compaction-end" });
@@ -20540,6 +20675,7 @@ function createTurnCompactionController(args2) {
20540
20675
  const compactionDialogId = args2.continueDialogId ?? ephemeralDialogId;
20541
20676
  const runCompaction = async (history, force) => {
20542
20677
  let realContextUsagePercent;
20678
+ let triggerPromptTokens;
20543
20679
  if (args2.continueDialogId && typeof args2.adapter.loadLastContextUsage === "function") {
20544
20680
  try {
20545
20681
  const usage = await args2.adapter.loadLastContextUsage(
@@ -20547,6 +20683,7 @@ function createTurnCompactionController(args2) {
20547
20683
  );
20548
20684
  const inputTokens = usage?.inputTokens;
20549
20685
  if (typeof inputTokens === "number" && Number.isFinite(inputTokens) && inputTokens > 0 && typeof args2.contextWindow === "number" && Number.isFinite(args2.contextWindow) && args2.contextWindow > 0) {
20686
+ triggerPromptTokens = inputTokens;
20550
20687
  realContextUsagePercent = Math.min(
20551
20688
  1,
20552
20689
  Math.max(0, inputTokens / args2.contextWindow)
@@ -20568,6 +20705,7 @@ function createTurnCompactionController(args2) {
20568
20705
  resolveProvider: args2.resolveProvider,
20569
20706
  contextWindow: args2.contextWindow,
20570
20707
  realContextUsagePercent,
20708
+ ...triggerPromptTokens !== void 0 ? { triggerPromptTokens } : {},
20571
20709
  force,
20572
20710
  abortSignal: args2.abortSignal,
20573
20711
  timeoutMs: args2.timeoutMs,
@@ -20624,6 +20762,7 @@ function createTurnCompactionController(args2) {
20624
20762
  contextWindow: args2.contextWindow,
20625
20763
  ...force ? { force: true } : {},
20626
20764
  ...ratio !== void 0 ? { realContextUsagePercent: ratio } : {},
20765
+ ...inputTokens > 0 ? { triggerPromptTokens: inputTokens } : {},
20627
20766
  abortSignal: args2.abortSignal,
20628
20767
  timeoutMs: args2.timeoutMs,
20629
20768
  summaryFallback: args2.summaryFallback,
@@ -21180,7 +21319,11 @@ async function runLocalAgentTurn(input) {
21180
21319
  dispatchIntent: detectDispatchIntentFromMessages(history) || detectDispatchIntent(
21181
21320
  typeof input.input === "string" ? input.input : void 0
21182
21321
  ),
21183
- runKind: input.runKind
21322
+ runKind: input.runKind,
21323
+ // 主 Agent 强弱姿态:本地宿主能直读当前会话模型(agentConfig.model,会话内
21324
+ // 恒定),显式透传后由 resolveToolGuidedSections 按档位追加一句短指引;
21325
+ // 模型缺失/推不出档位时不追加文本,前缀缓存稳定性不受影响。
21326
+ callerModel: agentConfig.model
21184
21327
  });
21185
21328
  const callerScopes = normalizeContextBlockScopes(
21186
21329
  input.contextBlocks,
@@ -23519,213 +23662,13 @@ function createHybridRecordStore(deps) {
23519
23662
 
23520
23663
  // packages/agent-runtime/sandboxCommandPrefix.ts
23521
23664
  var DEFAULT_SANDBOX_TMPFS_SIZE_BYTES = 128 * 1024 * 1024;
23522
- var BWRAP_PROBE_TTL_MS = 5 * 6e4;
23523
-
23524
- // node_modules/async-mutex/index.mjs
23525
- var E_TIMEOUT = new Error("timeout while waiting for mutex to become available");
23526
- var E_ALREADY_LOCKED = new Error("mutex already locked");
23527
- var E_CANCELED = new Error("request for lock canceled");
23528
- var __awaiter$2 = function(thisArg, _arguments, P, generator) {
23529
- function adopt(value) {
23530
- return value instanceof P ? value : new P(function(resolve7) {
23531
- resolve7(value);
23532
- });
23533
- }
23534
- return new (P || (P = Promise))(function(resolve7, reject) {
23535
- function fulfilled(value) {
23536
- try {
23537
- step(generator.next(value));
23538
- } catch (e) {
23539
- reject(e);
23540
- }
23541
- }
23542
- function rejected(value) {
23543
- try {
23544
- step(generator["throw"](value));
23545
- } catch (e) {
23546
- reject(e);
23547
- }
23548
- }
23549
- function step(result4) {
23550
- result4.done ? resolve7(result4.value) : adopt(result4.value).then(fulfilled, rejected);
23551
- }
23552
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23553
- });
23554
- };
23555
- var Semaphore = class {
23556
- constructor(_value, _cancelError = E_CANCELED) {
23557
- this._value = _value;
23558
- this._cancelError = _cancelError;
23559
- this._queue = [];
23560
- this._weightedWaiters = [];
23561
- }
23562
- acquire(weight = 1, priority = 0) {
23563
- if (weight <= 0)
23564
- throw new Error(`invalid weight ${weight}: must be positive`);
23565
- return new Promise((resolve7, reject) => {
23566
- const task = { resolve: resolve7, reject, weight, priority };
23567
- const i = findIndexFromEnd(this._queue, (other) => priority <= other.priority);
23568
- if (i === -1 && weight <= this._value) {
23569
- this._dispatchItem(task);
23570
- } else {
23571
- this._queue.splice(i + 1, 0, task);
23572
- }
23573
- });
23574
- }
23575
- runExclusive(callback_1) {
23576
- return __awaiter$2(this, arguments, void 0, function* (callback4, weight = 1, priority = 0) {
23577
- const [value, release3] = yield this.acquire(weight, priority);
23578
- try {
23579
- return yield callback4(value);
23580
- } finally {
23581
- release3();
23582
- }
23583
- });
23584
- }
23585
- waitForUnlock(weight = 1, priority = 0) {
23586
- if (weight <= 0)
23587
- throw new Error(`invalid weight ${weight}: must be positive`);
23588
- if (this._couldLockImmediately(weight, priority)) {
23589
- return Promise.resolve();
23590
- } else {
23591
- return new Promise((resolve7) => {
23592
- if (!this._weightedWaiters[weight - 1])
23593
- this._weightedWaiters[weight - 1] = [];
23594
- insertSorted(this._weightedWaiters[weight - 1], { resolve: resolve7, priority });
23595
- });
23596
- }
23597
- }
23598
- isLocked() {
23599
- return this._value <= 0;
23600
- }
23601
- getValue() {
23602
- return this._value;
23603
- }
23604
- setValue(value) {
23605
- this._value = value;
23606
- this._dispatchQueue();
23607
- }
23608
- release(weight = 1) {
23609
- if (weight <= 0)
23610
- throw new Error(`invalid weight ${weight}: must be positive`);
23611
- this._value += weight;
23612
- this._dispatchQueue();
23613
- }
23614
- cancel() {
23615
- this._queue.forEach((entry) => entry.reject(this._cancelError));
23616
- this._queue = [];
23617
- }
23618
- _dispatchQueue() {
23619
- this._drainUnlockWaiters();
23620
- while (this._queue.length > 0 && this._queue[0].weight <= this._value) {
23621
- this._dispatchItem(this._queue.shift());
23622
- this._drainUnlockWaiters();
23623
- }
23624
- }
23625
- _dispatchItem(item) {
23626
- const previousValue = this._value;
23627
- this._value -= item.weight;
23628
- item.resolve([previousValue, this._newReleaser(item.weight)]);
23629
- }
23630
- _newReleaser(weight) {
23631
- let called = false;
23632
- return () => {
23633
- if (called)
23634
- return;
23635
- called = true;
23636
- this.release(weight);
23637
- };
23638
- }
23639
- _drainUnlockWaiters() {
23640
- if (this._queue.length === 0) {
23641
- for (let weight = this._value; weight > 0; weight--) {
23642
- const waiters = this._weightedWaiters[weight - 1];
23643
- if (!waiters)
23644
- continue;
23645
- waiters.forEach((waiter) => waiter.resolve());
23646
- this._weightedWaiters[weight - 1] = [];
23647
- }
23648
- } else {
23649
- const queuedPriority = this._queue[0].priority;
23650
- for (let weight = this._value; weight > 0; weight--) {
23651
- const waiters = this._weightedWaiters[weight - 1];
23652
- if (!waiters)
23653
- continue;
23654
- const i = waiters.findIndex((waiter) => waiter.priority <= queuedPriority);
23655
- (i === -1 ? waiters : waiters.splice(0, i)).forEach((waiter) => waiter.resolve());
23656
- }
23657
- }
23658
- }
23659
- _couldLockImmediately(weight, priority) {
23660
- return (this._queue.length === 0 || this._queue[0].priority < priority) && weight <= this._value;
23661
- }
23662
- };
23663
- function insertSorted(a, v) {
23664
- const i = findIndexFromEnd(a, (other) => v.priority <= other.priority);
23665
- a.splice(i + 1, 0, v);
23666
- }
23667
- function findIndexFromEnd(a, predicate) {
23668
- for (let i = a.length - 1; i >= 0; i--) {
23669
- if (predicate(a[i])) {
23670
- return i;
23671
- }
23672
- }
23673
- return -1;
23674
- }
23675
- var __awaiter$1 = function(thisArg, _arguments, P, generator) {
23676
- function adopt(value) {
23677
- return value instanceof P ? value : new P(function(resolve7) {
23678
- resolve7(value);
23679
- });
23680
- }
23681
- return new (P || (P = Promise))(function(resolve7, reject) {
23682
- function fulfilled(value) {
23683
- try {
23684
- step(generator.next(value));
23685
- } catch (e) {
23686
- reject(e);
23687
- }
23688
- }
23689
- function rejected(value) {
23690
- try {
23691
- step(generator["throw"](value));
23692
- } catch (e) {
23693
- reject(e);
23694
- }
23695
- }
23696
- function step(result4) {
23697
- result4.done ? resolve7(result4.value) : adopt(result4.value).then(fulfilled, rejected);
23698
- }
23699
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23700
- });
23701
- };
23702
- var Mutex = class {
23703
- constructor(cancelError) {
23704
- this._semaphore = new Semaphore(1, cancelError);
23705
- }
23706
- acquire() {
23707
- return __awaiter$1(this, arguments, void 0, function* (priority = 0) {
23708
- const [, releaser] = yield this._semaphore.acquire(1, priority);
23709
- return releaser;
23710
- });
23711
- }
23712
- runExclusive(callback4, priority = 0) {
23713
- return this._semaphore.runExclusive(() => callback4(), 1, priority);
23714
- }
23715
- isLocked() {
23716
- return this._semaphore.isLocked();
23717
- }
23718
- waitForUnlock(priority = 0) {
23719
- return this._semaphore.waitForUnlock(1, priority);
23720
- }
23721
- release() {
23722
- if (this._semaphore.isLocked())
23723
- this._semaphore.release();
23724
- }
23725
- cancel() {
23726
- return this._semaphore.cancel();
23727
- }
23665
+ var DEFAULT_HOSTED_SANDBOX_RESOURCE_LIMITS = {
23666
+ cpuSeconds: 30,
23667
+ maxFileSizeBytes: 64 * 1024 * 1024,
23668
+ maxOpenFiles: 256,
23669
+ maxProcesses: 256
23728
23670
  };
23671
+ var BWRAP_PROBE_TTL_MS = 5 * 6e4;
23729
23672
 
23730
23673
  // packages/database-engine/dialogOwner.ts
23731
23674
  var dialogOwnerKey = (dialogId) => `dialogown-${dialogId}`;
@@ -23858,7 +23801,7 @@ async function saveCliPendingUserMessages(args2) {
23858
23801
  if (ops.length) await args2.store.batch(ops);
23859
23802
  }
23860
23803
  async function readCliPendingUserMessages(store, dialogId) {
23861
- const { readDialogMessageRecords } = await import("./cliLocalAgentRecordReader-R4CLUHYO.js");
23804
+ const { readDialogMessageRecords } = await import("./cliLocalAgentRecordReader-DWU3LBO2.js");
23862
23805
  const rows = await readDialogMessageRecords({ store, dialogId });
23863
23806
  const uncertain = rows.filter(({ record: record2 }) => record2.metadata?.cliBatchPhase === "requested" && !record2.metadata?.cliBatchResolution);
23864
23807
  const recovery = uncertain.length ? {