nolo-cli 0.231.0-alpha.1 → 0.240.0-alpha.3

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 (190) hide show
  1. package/{_executeModel-7V3NSK4W.js → _executeModel-5NA4USGG.js} +56 -51
  2. package/{action-GDZDXPMB.js → action-X75O3XPH.js} +7 -4
  3. package/{addContentAction-7RO4AMRI.js → addContentAction-GVC77QSN.js} +9 -8
  4. package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-KKDVAMW3.js} +12 -11
  5. package/{agentDeleteCommand-MD76OMLN.js → agentDeleteCommand-2RFGKFAB.js} +77 -69
  6. package/{agentEmailCommands-T4TW4IBX.js → agentEmailCommands-GQCQKKOR.js} +84 -72
  7. package/{agentListCommands-4WLG32IW.js → agentListCommands-HSGLDPDQ.js} +40 -47
  8. package/{agentMachineCommands-LSDGA5WR.js → agentMachineCommands-BISF6PVV.js} +26 -22
  9. package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-O3Q25PKU.js} +2 -2
  10. package/{agentPullCommand-KHV4EELF.js → agentPullCommand-G6U2LHMW.js} +1 -1
  11. package/{agentRecordCommands-7TEX2B7Y.js → agentRecordCommands-AOXPGYAJ.js} +79 -67
  12. package/{agentRunCommand-23SMDVDW.js → agentRunCommand-AFAIP7U7.js} +85 -72
  13. package/{agentRunControl-MBG4U6SL.js → agentRunControl-VBL7UFSG.js} +1 -1
  14. package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-T7BX2WGL.js} +24 -19
  15. package/{agentSlice-AATYVDP6.js → agentSlice-XJNKE3PG.js} +10 -9
  16. package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-LURUSPY7.js} +27 -23
  17. package/{appDeployCommands-AU4IUN33.js → appDeployCommands-SMEW4AK2.js} +27 -23
  18. package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-VYPJTBJK.js} +27 -23
  19. package/{appGetCommands-BGTLIQ4K.js → appGetCommands-N4NI5GGJ.js} +27 -23
  20. package/{appListCommands-CUCPRUXW.js → appListCommands-5C6ONN3Z.js} +27 -23
  21. package/{authCommand-3SUYUNQV.js → authCommand-4CVBDADE.js} +15 -13
  22. package/{authCommands-BLE7ETZH.js → authCommands-EHU2BHOX.js} +7 -5
  23. package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-AYWYQVA4.js} +3 -3
  24. package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-CSDG2HYN.js} +1 -1
  25. package/{chunk-HHFGE2WF.js → chunk-2574ANSV.js} +1 -1
  26. package/chunk-2SXN7LAY.js +15 -0
  27. package/{chunk-S6FDXXZV.js → chunk-3EMIEC27.js} +1 -1
  28. package/{chunk-EXNV7CCV.js → chunk-3FBAVU2Y.js} +11 -9
  29. package/{chunk-ZH3KXFHS.js → chunk-4FIO2S7Z.js} +1 -1
  30. package/{chunk-U4FF7LRY.js → chunk-4IQVE43Z.js} +30 -26
  31. package/{chunk-VQ5N5GSV.js → chunk-4Q6HQORG.js} +1 -1
  32. package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
  33. package/chunk-4ZCTKB27.js +31 -0
  34. package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
  35. package/{chunk-QYB23WUH.js → chunk-5QZSEQSK.js} +1 -1
  36. package/{chunk-7JGMNKKG.js → chunk-6CKUO32A.js} +8 -0
  37. package/chunk-6D25V6CB.js +133 -0
  38. package/{chunk-LHN7NIQZ.js → chunk-6WOLPIPY.js} +93 -90
  39. package/{chunk-6QHKRARD.js → chunk-6WZVM33D.js} +9 -4
  40. package/{chunk-NVEYEKN3.js → chunk-7AJRJGSQ.js} +254 -359
  41. package/chunk-7NIBQ4HY.js +138 -0
  42. package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
  43. package/{chunk-GXZ5LB7H.js → chunk-A3LUWRQK.js} +4 -4
  44. package/{chunk-4ZGPHFLE.js → chunk-A5EVA6HU.js} +2 -2
  45. package/{chunk-57TLKTVZ.js → chunk-A74QP4FI.js} +566 -104
  46. package/{chunk-3ING4D5X.js → chunk-AEQMKYZN.js} +4 -4
  47. package/{chunk-FFSPUVL5.js → chunk-AH5R7BYW.js} +6 -166
  48. package/{chunk-7FEP5USX.js → chunk-ANJRDS6U.js} +3 -3
  49. package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
  50. package/{chunk-HYLRQDEE.js → chunk-B5SV4H3J.js} +6 -6
  51. package/{chunk-KUOMUZH6.js → chunk-B7DE5XJW.js} +137 -290
  52. package/chunk-BEM6LPD2.js +734 -0
  53. package/{chunk-DUUDXSLX.js → chunk-BGGAY6OK.js} +27 -3
  54. package/{chunk-YCFP57LH.js → chunk-BGGV6B5O.js} +408 -230
  55. package/{chunk-BP5ZJ6B4.js → chunk-BIABIPGW.js} +1 -1
  56. package/{chunk-TQEKUOTI.js → chunk-BXSMFPTG.js} +4 -4
  57. package/{chunk-RG2DGNL6.js → chunk-CKZPMJNU.js} +3 -3
  58. package/{chunk-WU443D7A.js → chunk-CVJRVBJL.js} +2 -2
  59. package/{chunk-BIWI5M4E.js → chunk-D374I563.js} +1 -1
  60. package/{chunk-QRGDJA4B.js → chunk-DNZ4JJ7C.js} +1 -1
  61. package/chunk-DVYAFH2Q.js +103 -0
  62. package/{chunk-FTMFO6LI.js → chunk-DXW5WDHZ.js} +4 -4
  63. package/{chunk-ZTR65O4L.js → chunk-E5KJOZWY.js} +3 -3
  64. package/{chunk-G7IUT2V3.js → chunk-EBKHA63G.js} +103 -12
  65. package/{chunk-DGYCDA6W.js → chunk-F3XI6WQP.js} +17 -10
  66. package/{chunk-M3OZRQNH.js → chunk-F6YWDVIB.js} +1 -1
  67. package/{chunk-PR2LAQAC.js → chunk-FFYE5ATM.js} +4 -4
  68. package/{chunk-6NNDUDAZ.js → chunk-FZKA3XFA.js} +11 -11
  69. package/{chunk-MNEZUL5S.js → chunk-G22P367E.js} +31 -14
  70. package/{chunk-6OQMSPB7.js → chunk-GDUC4VS2.js} +7 -7
  71. package/{chunk-R6Z5S5GA.js → chunk-GXXY2NL3.js} +16 -14
  72. package/{chunk-U2HBB7RS.js → chunk-H7ZYKHAZ.js} +27 -7
  73. package/{chunk-3U44JB3O.js → chunk-HCNOO374.js} +1 -1
  74. package/{chunk-HSSBDZLD.js → chunk-HOM6LTEW.js} +1 -1
  75. package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
  76. package/{chunk-TPG2DPN2.js → chunk-IJTXNLQE.js} +9 -9
  77. package/{chunk-ALAES342.js → chunk-IUMS6F53.js} +2 -2
  78. package/{chunk-547ENH5T.js → chunk-IUTUWIKE.js} +2 -2
  79. package/{chunk-S6K5F3KP.js → chunk-JBWXPACD.js} +1 -1
  80. package/{chunk-XAG3FWBE.js → chunk-KZPEGO6D.js} +1 -1
  81. package/{chunk-RBPUNSG5.js → chunk-LYDEFPQP.js} +18 -108
  82. package/{chunk-OWKNSIXL.js → chunk-MECDGHLK.js} +271 -66
  83. package/{chunk-FJSNBZXR.js → chunk-MM73SP4K.js} +1 -1
  84. package/{chunk-XSW4EXQV.js → chunk-MYOSN6BT.js} +2 -2
  85. package/{chunk-ZEVQHCLM.js → chunk-MYPKBJJO.js} +2 -2
  86. package/{chunk-DBUR22G5.js → chunk-N2JROHD3.js} +4 -4
  87. package/{chunk-ATEKLSLR.js → chunk-O6IPRAVV.js} +14 -9
  88. package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
  89. package/{chunk-WFVASLQT.js → chunk-P3IZUMIC.js} +1 -1
  90. package/{chunk-FPBJM2BW.js → chunk-PGKA77TZ.js} +26 -20
  91. package/{chunk-IONGMVPY.js → chunk-PRMEU7BT.js} +229 -7
  92. package/{chunk-OJ45MEEI.js → chunk-PROOOQZ3.js} +1 -1
  93. package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
  94. package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
  95. package/chunk-RETQOQ4D.js +33394 -0
  96. package/{chunk-CMMI3DAT.js → chunk-RM4UMFY4.js} +33 -26
  97. package/{chunk-262R3XNN.js → chunk-S2MHR4PU.js} +151 -5
  98. package/{chunk-DEA37IUY.js → chunk-T6VROBY7.js} +2 -2
  99. package/{chunk-M4SFKP5L.js → chunk-TEMLHVGX.js} +1 -1
  100. package/{chunk-3QIYD3VM.js → chunk-TRHJ4NJB.js} +61 -792
  101. package/{chunk-OBIC6EG7.js → chunk-TWTJV35S.js} +1 -1
  102. package/{chunk-TCZ2VJZQ.js → chunk-U3G7RRXJ.js} +5 -5
  103. package/{chunk-F6Z6ZCUV.js → chunk-UFC4J7OY.js} +3 -3
  104. package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
  105. package/{chunk-4N6G2CKP.js → chunk-ULLHVDTZ.js} +46 -1
  106. package/{chunk-XFXFPUO7.js → chunk-VM72HKW2.js} +7 -7
  107. package/{chunk-MHHLABT3.js → chunk-VREG6ANQ.js} +102 -99
  108. package/chunk-VSRISJXZ.js +107 -0
  109. package/chunk-WDWZPASX.js +29 -0
  110. package/{chunk-ILHQ2AXT.js → chunk-WRKMXMU7.js} +2 -0
  111. package/chunk-X7IA2B7R.js +166 -0
  112. package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
  113. package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
  114. package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
  115. package/{chunk-KUDCKVYQ.js → chunk-Y5OWZQMJ.js} +28 -19
  116. package/{chunk-TI2EPRHE.js → chunk-YGCOJNFZ.js} +3 -3
  117. package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
  118. package/{chunk-X7QAIY5B.js → chunk-Z2WZAE4P.js} +128 -150
  119. package/chunk-Z6YTCDU4.js +24 -0
  120. package/{chunk-RRDRQOEC.js → chunk-ZEKUFJLW.js} +81 -66
  121. package/{chunk-EVGU5P4U.js → chunk-ZVOL2MAJ.js} +1 -1
  122. package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-U5OAVAKQ.js} +2 -2
  123. package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
  124. package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-HVZAQCUD.js} +29 -25
  125. package/{commandRegistry-35EMLPIZ.js → commandRegistry-TME7INFU.js} +89 -85
  126. package/{contentThunks-BCNMGA5J.js → contentThunks-U6OC4R2N.js} +23 -22
  127. package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-U7XSRVJP.js} +1 -1
  128. package/{createAgentAutomationAction-HEU4KOYF.js → createAgentAutomationAction-IP4LFN3W.js} +23 -22
  129. package/{createDialogAction-5DSL5ESZ.js → createDialogAction-IAGQJ3LH.js} +24 -23
  130. package/{createPageAction-BBZ25AFI.js → createPageAction-AZ3UIFKA.js} +24 -23
  131. package/{dbSlice-XRUZOGSU.js → dbSlice-DKKMJJYY.js} +8 -7
  132. package/{deleteFile-6URDHYRB.js → deleteFile-TQSONMVU.js} +7 -4
  133. package/{dialogCommands-6SZD4TYP.js → dialogCommands-PCDRMBWG.js} +30 -26
  134. package/dialogMessageRecord-OAV77LT7.js +7 -0
  135. package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-O35MWMOS.js} +3 -3
  136. package/{dialogSlice-QJ5PQOM3.js → dialogSlice-QAKYN4DE.js} +22 -21
  137. package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-2SSLTXKO.js} +2 -2
  138. package/{docCreateCommands-25E6PGN3.js → docCreateCommands-CFQFZOAD.js} +26 -22
  139. package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-5CPNTIIS.js} +27 -23
  140. package/{docReadCommands-JY2E5XEN.js → docReadCommands-XQILYSAJ.js} +26 -22
  141. package/{docStore-XJ4UMU3C.js → docStore-GIVRT7TQ.js} +10 -9
  142. package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-VETKSUDD.js} +26 -22
  143. package/{handleSendMessageAction-YHAOXARI.js → handleSendMessageAction-HKIW4ZNO.js} +48 -45
  144. package/{hostCredentialCreate-62AWCBQC.js → hostCredentialCreate-6VDJFNDO.js} +81 -68
  145. package/index.js +8 -8
  146. package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
  147. package/{localRuntimeAdapter-KNQNNHUM.js → localRuntimeAdapter-BQ4F5PZV.js} +81 -69
  148. package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
  149. package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
  150. package/{machineCommands-X2FMPSV4.js → machineCommands-K6XIGOAD.js} +77 -65
  151. package/{machineWsRunDispatch-XHTPOYVJ.js → machineWsRunDispatch-4OO7Z6UM.js} +77 -65
  152. package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
  153. package/{memberThunks-7Y3OYSJQ.js → memberThunks-PBJPZ2JU.js} +15 -10
  154. package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
  155. package/package.json +1 -1
  156. package/{projectArchive-NPQ3YOAV.js → projectArchive-G7AOQPRW.js} +24 -23
  157. package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-OPBCAONX.js} +1 -1
  158. package/{providerRegistry-ZI2KORJ7.js → providerRegistry-J2HCVTHE.js} +1 -1
  159. package/{read-TYMBGEXO.js → read-JEGPITEW.js} +6 -5
  160. package/{readDocTool-SKQVHBLO.js → readDocTool-TE3XIU4Y.js} +1 -1
  161. package/{readlineWorkspace-77PILYDH.js → readlineWorkspace-SOW5QUGZ.js} +2935 -2376
  162. package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-CX3OAH4Y.js} +14 -13
  163. package/{runAgentClientLoop-XNKAXUKU.js → runAgentClientLoop-HQJPDFGQ.js} +65 -45
  164. package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-GUH2YGMH.js} +3 -3
  165. package/{secretCommands-KZWBZIYS.js → secretCommands-NJXFVHZU.js} +2 -2
  166. package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +11 -10
  167. package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +14 -13
  168. package/{settingThunks-ZRGWVGZD.js → settingThunks-AY76OHYX.js} +176 -57
  169. package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
  170. package/{spaceCommands-TOGSGCPS.js → spaceCommands-G63QGYQO.js} +25 -21
  171. package/{streamAgentChatTurn-IARUEZPU.js → streamAgentChatTurn-E3XH2KFD.js} +127 -85
  172. package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-G6EZRKCQ.js} +12 -11
  173. package/{tableCommands-FTAOCBTX.js → tableCommands-JI75ZHDI.js} +4 -1
  174. package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
  175. package/{tools-5UWS65PB.js → tools-7RSX22FT.js} +41 -37
  176. package/{tuiRestart-2IL37YIB.js → tuiRestart-KAAA7TND.js} +2 -2
  177. package/{tuiSummaryLlmCaller-R4H3ZZ52.js → tuiSummaryLlmCaller-BVNHMWLR.js} +5 -5
  178. package/{updateCommands-CPATDG6J.js → updateCommands-ASK5XYPH.js} +3 -3
  179. package/{updateDialogTitleAction-G6C6XVNV.js → updateDialogTitleAction-SEWV252V.js} +23 -22
  180. package/{usageCommand-2BF74MKF.js → usageCommand-JVT5J3DC.js} +2 -2
  181. package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-IZYYUTEW.js} +3 -3
  182. package/webapi-24RZDIIQ.js +2488 -0
  183. package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
  184. package/workContext-MM3P5GP5.js +13 -0
  185. package/workContextAccess-UZHDLBUR.js +11 -0
  186. package/workContextWriteNotice-YCSSMHN4.js +7 -0
  187. package/chunk-ZXF6D3I6.js +0 -359
  188. package/{accountResolver-QETKNC7T.js → accountResolver-EK2S4PWF.js} +3 -3
  189. package/{localDialogRead-CCOCVGAP.js → localDialogRead-AV2VKKPG.js} +0 -0
  190. package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-YIZ7KLUP.js} +5 -5
@@ -1,8 +1,9 @@
1
1
  import {
2
+ AGENT_PROMPT_IN_MESSAGES,
2
3
  DEVIN_CONNECT_URL,
3
4
  parseSseDataLineJson,
4
5
  parseSseDataLineObject
5
- } from "./chunk-U2HBB7RS.js";
6
+ } from "./chunk-H7ZYKHAZ.js";
6
7
  import {
7
8
  EXECUTION_BACKEND_KINDS
8
9
  } from "./chunk-PWTNI4N7.js";
@@ -18,7 +19,7 @@ import {
18
19
  flushChatCompletionStream,
19
20
  providerHttpFailure,
20
21
  throwIfChatCompletionStreamFailed
21
- } from "./chunk-HSSBDZLD.js";
22
+ } from "./chunk-HOM6LTEW.js";
22
23
  import {
23
24
  readSseFrames
24
25
  } from "./chunk-HNUWUO75.js";
@@ -30,14 +31,14 @@ import {
30
31
  evaluateRequestBudget,
31
32
  hasImageInRuntimeMessages,
32
33
  stripImagePartsFromMessages
33
- } from "./chunk-XAG3FWBE.js";
34
+ } from "./chunk-KZPEGO6D.js";
34
35
  import {
35
36
  resolveToolExecutionContract
36
37
  } from "./chunk-LKA64WH4.js";
37
38
  import {
38
39
  resolveAgentImageInputSupport,
39
40
  resolveToolImagePolicy
40
- } from "./chunk-DUUDXSLX.js";
41
+ } from "./chunk-BGGAY6OK.js";
41
42
  import {
42
43
  applyShapingCounts,
43
44
  attachProjectionFacts,
@@ -48,7 +49,7 @@ import {
48
49
  projectUserPartForModel,
49
50
  resolveOutboundDiagnosticSink,
50
51
  writeThinkingFacts
51
- } from "./chunk-QYB23WUH.js";
52
+ } from "./chunk-5QZSEQSK.js";
52
53
  import {
53
54
  createThinkParserState,
54
55
  createToolCallAccumulator,
@@ -74,7 +75,7 @@ import {
74
75
  hashStablePrefixContent,
75
76
  resolveResponseGuidelines,
76
77
  resolveToolGuidedSections
77
- } from "./chunk-FPBJM2BW.js";
78
+ } from "./chunk-PGKA77TZ.js";
78
79
  import {
79
80
  classifyUnparsableToolArgs,
80
81
  collectStablePromptPrefix,
@@ -126,7 +127,7 @@ import {
126
127
  parseNoloWorkspaceToolArguments,
127
128
  readTextStreamUpToChars,
128
129
  resolveNoloDialogInput
129
- } from "./chunk-MNEZUL5S.js";
130
+ } from "./chunk-G22P367E.js";
130
131
  import {
131
132
  applyToolSurfaceConstraints
132
133
  } from "./chunk-VS276URX.js";
@@ -149,7 +150,7 @@ import {
149
150
  } from "./chunk-WFGNWWJI.js";
150
151
  import {
151
152
  isAgentSkillDisabled
152
- } from "./chunk-FJSNBZXR.js";
153
+ } from "./chunk-MM73SP4K.js";
153
154
  import {
154
155
  buildDialogFallbackTitleFromUserInput
155
156
  } from "./chunk-2MBTWINN.js";
@@ -161,7 +162,7 @@ import {
161
162
  resolveEmptyAssistantFallbackMessage,
162
163
  resolveEmptyAssistantOutcome,
163
164
  resolveTruncatedReasoningTailLog
164
- } from "./chunk-QRGDJA4B.js";
165
+ } from "./chunk-DNZ4JJ7C.js";
165
166
  import {
166
167
  COMPACTION_SUMMARY_SCHEMA_VERSION,
167
168
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -199,9 +200,6 @@ import {
199
200
  import {
200
201
  asRecordOrEmpty
201
202
  } from "./chunk-KX6YBIHG.js";
202
- import {
203
- assertCredentialRef
204
- } from "./chunk-OQHIVPG4.js";
205
203
  import {
206
204
  isAbortError
207
205
  } from "./chunk-7DPNBQSV.js";
@@ -242,9 +240,12 @@ import {
242
240
  import {
243
241
  resolveNoloStateDir
244
242
  } from "./chunk-6UBGXX2W.js";
243
+ import {
244
+ dialogMessageRecordToAgentRuntimeMessage
245
+ } from "./chunk-4ZCTKB27.js";
245
246
  import {
246
247
  WORKTREE_ISOLATION_PRELUDE
247
- } from "./chunk-G7IUT2V3.js";
248
+ } from "./chunk-EBKHA63G.js";
248
249
  import {
249
250
  canonicalizeToolName,
250
251
  canonicalizeToolNames
@@ -262,11 +263,13 @@ import {
262
263
  import {
263
264
  buildAgentsMdLayer,
264
265
  buildAgentsMdLayerHeader,
265
- buildDialogSummaryLayer
266
- } from "./chunk-42OKN2LI.js";
266
+ buildDialogSummaryLayer,
267
+ hasMemoryTools
268
+ } from "./chunk-5HUO7SEX.js";
267
269
  import {
270
+ MEMORY_USE_GUIDANCE,
268
271
  buildUserResponseLanguageContext
269
- } from "./chunk-JQZRSXS5.js";
272
+ } from "./chunk-YGDYYFRX.js";
270
273
  import {
271
274
  buildProviderAuthHeaders,
272
275
  buildProviderExecutionPlan
@@ -13697,7 +13700,8 @@ ${args2.input}` : [
13697
13700
  const prefix2 = stableContent ? [{
13698
13701
  role: "system",
13699
13702
  content: stableContent,
13700
- stable_prefix_chars: stableContent.length
13703
+ stable_prefix_chars: stableContent.length,
13704
+ ...args2.prompt?.trim() ? { [AGENT_PROMPT_IN_MESSAGES]: true } : {}
13701
13705
  }] : [];
13702
13706
  const composed2 = composeProviderMessages({
13703
13707
  prefix: prefix2,
@@ -13720,7 +13724,11 @@ ${args2.input}` : [
13720
13724
  }
13721
13725
  const blocks = (args2.contextBlocks ?? []).map((block) => block.trim()).filter(Boolean);
13722
13726
  const systemContent = [args2.prompt?.trim(), ...blocks].filter(Boolean).join("\n\n");
13723
- const prefix = systemContent ? [{ role: "system", content: systemContent }] : [];
13727
+ const prefix = systemContent ? [{
13728
+ role: "system",
13729
+ content: systemContent,
13730
+ ...args2.prompt?.trim() ? { [AGENT_PROMPT_IN_MESSAGES]: true } : {}
13731
+ }] : [];
13724
13732
  const composed = composeProviderMessages({
13725
13733
  prefix,
13726
13734
  history: args2.history,
@@ -16060,7 +16068,7 @@ function buildWorkspacePathProperty() {
16060
16068
  };
16061
16069
  }
16062
16070
  function buildReadWorkspaceDescription() {
16063
- return "Read a UTF-8 text file inside the workspace. 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).";
16071
+ 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).";
16064
16072
  }
16065
16073
  function buildReadWorkspaceParameters() {
16066
16074
  const path = buildWorkspacePathProperty();
@@ -16076,20 +16084,14 @@ function buildReadWorkspaceParameters() {
16076
16084
  type: "object",
16077
16085
  properties: {
16078
16086
  path,
16079
- files: {
16080
- type: "array",
16081
- minItems: 1,
16082
- maxItems: 8,
16083
- description: "Batch of files with optional individual line ranges; mutually exclusive with path. One shared output budget applies.",
16084
- items: { type: "object", properties: { path, lines, force }, required: ["path"], additionalProperties: false }
16085
- },
16086
16087
  lines,
16087
16088
  force,
16088
16089
  raw: {
16089
16090
  type: "boolean",
16090
16091
  description: "Read original bytes including full runtime acceptance observations in *.result.md. Default compacts only machine observations; report text and physical line numbers are unchanged."
16091
16092
  }
16092
- }
16093
+ },
16094
+ required: ["path"]
16093
16095
  };
16094
16096
  }
16095
16097
  function buildReadWorkspaceFileTool() {
@@ -20679,6 +20681,7 @@ function combineRollbackError(primary, rollbackError) {
20679
20681
  return combined;
20680
20682
  }
20681
20683
  async function runLocalAgentTurn(input) {
20684
+ input = { ...input, runtimeContext: input.runtimeContext ? { ...input.runtimeContext } : void 0 };
20682
20685
  const legacyCallbacks = {
20683
20686
  onLoopEvent: input.onLoopEvent,
20684
20687
  onToolEvent: input.onToolEvent,
@@ -20823,6 +20826,13 @@ async function runLocalAgentTurn(input) {
20823
20826
  typeof input.input === "string" ? input.input : void 0
20824
20827
  )
20825
20828
  });
20829
+ const callerScopes = normalizeContextBlockScopes(
20830
+ input.contextBlocks,
20831
+ input.contextBlockScopes
20832
+ );
20833
+ const callerHasMemoryGuidance = callerScopes.some(
20834
+ (scope3) => scope3.content.includes(MEMORY_USE_GUIDANCE)
20835
+ );
20826
20836
  const guidanceScopes = [
20827
20837
  ...input.userLanguage?.trim() ? [buildUserResponseLanguageContext({ language: input.userLanguage })] : [],
20828
20838
  guidanceBlocks.startupProtocol,
@@ -20831,12 +20841,14 @@ async function runLocalAgentTurn(input) {
20831
20841
  // 注入顺序遵循 TOOL_GUIDED_SECTION_ORDER(与 buildSystemPrompt 的显式
20832
20842
  // layer 列表同源),禁止用 Object.values 自行定序。
20833
20843
  ...TOOL_GUIDED_SECTION_ORDER.map((id) => toolGuidedSections[id] ?? ""),
20844
+ // 记忆使用指引(session-scope,进稳定前缀):判定真值是 turnContext 的
20845
+ // `hasMemoryTools`(有效工具面),与 web/server 的 buildSystemPrompt 同一条
20846
+ // 规则。放在这里而不是各宿主:CLI/TUI/desktop 都经 runLocalAgentTurn 进入本
20847
+ // 函数,一处即可覆盖三端,并补齐「空库 + 有记忆工具」这一档——此前本地宿主
20848
+ // 只按记忆 overlay 是否为空门控,空库时模型永远不知道该怎么用记忆工具。
20849
+ ...hasMemoryTools(agentTools) && !callerHasMemoryGuidance ? [MEMORY_USE_GUIDANCE] : [],
20834
20850
  ...input.runKind === "subtask" ? [LEAF_FINAL_HANDOFF_INSTRUCTIONS] : []
20835
20851
  ].map((content) => content.trim()).filter((content) => content.length > 0).map((content) => ({ content, cacheScope: "session" }));
20836
- const callerScopes = normalizeContextBlockScopes(
20837
- input.contextBlocks,
20838
- input.contextBlockScopes
20839
- );
20840
20852
  const responseGuidelines = resolveResponseGuidelines(
20841
20853
  input.responseViewport ?? "unknown"
20842
20854
  );
@@ -21201,6 +21213,16 @@ async function runLocalAgentTurn(input) {
21201
21213
  inFlightTransactions = pendingInjectionCommits.splice(0);
21202
21214
  try {
21203
21215
  for (const transaction of inFlightTransactions) await transaction.commit();
21216
+ input.runtimeContext = { ...input.runtimeContext };
21217
+ delete input.runtimeContext.userMessageId;
21218
+ const admittedMessages = inFlightTransactions.flatMap((transaction) => transaction.messages);
21219
+ if (admittedMessages.length === 1 && admittedMessages[0]?.cliMessageId) {
21220
+ try {
21221
+ const id = await input.resolveInjectedUserMessageId?.(admittedMessages);
21222
+ if (id === admittedMessages[0].cliMessageId) input.runtimeContext.userMessageId = id;
21223
+ } catch {
21224
+ }
21225
+ }
21204
21226
  if (input.abortSignal?.aborted) throw buildAbortedError();
21205
21227
  } catch (error) {
21206
21228
  const toRollback = inFlightTransactions;
@@ -22640,757 +22662,6 @@ async function resolveOpenAiCompatibleProviderConfig(args2) {
22640
22662
  };
22641
22663
  }
22642
22664
 
22643
- // packages/agent-runtime/macOsKeychainCredentialBroker.ts
22644
- import { spawn as spawn2 } from "node:child_process";
22645
- var MACOS_KEYCHAIN_SERVICE_PREFIX = "nolo.credentials.keys";
22646
- var MACOS_KEYCHAIN_ACCOUNT = "api-key";
22647
- var SECURITY_ITEM_NOT_FOUND_EXIT = 44;
22648
- var DEFAULT_SECURITY_BIN = "/usr/bin/security";
22649
- function safeCredentialRef(ref) {
22650
- try {
22651
- return assertCredentialRef(ref);
22652
- } catch {
22653
- throw new Error("invalid_ref");
22654
- }
22655
- }
22656
- function credentialRefToMacOsKeychainService(ref, servicePrefix = MACOS_KEYCHAIN_SERVICE_PREFIX) {
22657
- const safe = safeCredentialRef(ref);
22658
- const hex = Buffer.from(safe, "utf8").toString("hex");
22659
- if (!hex) {
22660
- throw new Error("invalid_ref");
22661
- }
22662
- return `${servicePrefix}.${hex}`;
22663
- }
22664
- function rethrowBrokerError(op, _error) {
22665
- throw new Error(`credential_broker_${op}_failed`);
22666
- }
22667
- function createDefaultSecurityRunner(securityBin = DEFAULT_SECURITY_BIN) {
22668
- return function defaultSecurityRunner(input) {
22669
- return new Promise((resolve7) => {
22670
- let settled = false;
22671
- const finish = (result4) => {
22672
- if (settled) return;
22673
- settled = true;
22674
- resolve7(result4);
22675
- };
22676
- let child;
22677
- try {
22678
- child = spawn2(securityBin, input.args, {
22679
- stdio: ["pipe", "pipe", "pipe"]
22680
- });
22681
- } catch {
22682
- finish({ exitCode: -1, stdout: "", stderr: "" });
22683
- return;
22684
- }
22685
- let stdout = "";
22686
- let stderr = "";
22687
- child.stdout?.setEncoding("utf8");
22688
- child.stderr?.setEncoding("utf8");
22689
- child.stdout?.on("data", (chunk) => {
22690
- stdout += chunk;
22691
- });
22692
- child.stderr?.on("data", (chunk) => {
22693
- stderr += chunk;
22694
- });
22695
- child.on("error", () => {
22696
- finish({ exitCode: -1, stdout: "", stderr: "" });
22697
- });
22698
- child.on("close", (code) => {
22699
- finish({
22700
- exitCode: typeof code === "number" ? code : -1,
22701
- stdout,
22702
- stderr
22703
- });
22704
- });
22705
- if (input.stdin !== void 0) {
22706
- child.stdin?.write(input.stdin);
22707
- }
22708
- child.stdin?.end();
22709
- });
22710
- };
22711
- }
22712
- function createMacOsKeychainCredentialBroker(options = {}) {
22713
- const runner = options.runner ?? createDefaultSecurityRunner(options.securityBin);
22714
- const servicePrefix = options.servicePrefix ?? MACOS_KEYCHAIN_SERVICE_PREFIX;
22715
- const account = options.account ?? MACOS_KEYCHAIN_ACCOUNT;
22716
- const serviceFor = (ref) => credentialRefToMacOsKeychainService(ref, servicePrefix);
22717
- return {
22718
- async get(ref) {
22719
- const safeRef = safeCredentialRef(ref);
22720
- const service4 = serviceFor(safeRef);
22721
- let result4;
22722
- try {
22723
- result4 = await runner({
22724
- args: [
22725
- "find-generic-password",
22726
- "-a",
22727
- account,
22728
- "-s",
22729
- service4,
22730
- "-w"
22731
- ]
22732
- });
22733
- } catch (error) {
22734
- rethrowBrokerError("get", error);
22735
- }
22736
- if (result4.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
22737
- return null;
22738
- }
22739
- if (result4.exitCode !== 0) {
22740
- rethrowBrokerError("get");
22741
- }
22742
- const secret = result4.stdout.replace(/\n$/, "");
22743
- return secret.length > 0 ? secret : null;
22744
- },
22745
- async put(ref, secret) {
22746
- const safeRef = safeCredentialRef(ref);
22747
- const value = asTrimmedString(secret);
22748
- if (!value) {
22749
- throw new Error("Cannot store an empty credential secret.");
22750
- }
22751
- const service4 = serviceFor(safeRef);
22752
- const stdin = `${value}
22753
- ${value}
22754
- `;
22755
- let result4;
22756
- try {
22757
- result4 = await runner({
22758
- args: [
22759
- "add-generic-password",
22760
- "-a",
22761
- account,
22762
- "-s",
22763
- service4,
22764
- "-U",
22765
- "-w"
22766
- ],
22767
- stdin
22768
- });
22769
- } catch (error) {
22770
- rethrowBrokerError("put", error);
22771
- }
22772
- if (result4.exitCode !== 0) {
22773
- rethrowBrokerError("put");
22774
- }
22775
- },
22776
- async delete(ref) {
22777
- const safeRef = safeCredentialRef(ref);
22778
- const service4 = serviceFor(safeRef);
22779
- let result4;
22780
- try {
22781
- result4 = await runner({
22782
- args: [
22783
- "delete-generic-password",
22784
- "-a",
22785
- account,
22786
- "-s",
22787
- service4
22788
- ]
22789
- });
22790
- } catch (error) {
22791
- rethrowBrokerError("delete", error);
22792
- }
22793
- if (result4.exitCode === 0 || result4.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
22794
- return;
22795
- }
22796
- rethrowBrokerError("delete");
22797
- },
22798
- async has(ref) {
22799
- const safeRef = safeCredentialRef(ref);
22800
- const service4 = serviceFor(safeRef);
22801
- let result4;
22802
- try {
22803
- result4 = await runner({
22804
- args: [
22805
- "find-generic-password",
22806
- "-a",
22807
- account,
22808
- "-s",
22809
- service4
22810
- ]
22811
- });
22812
- } catch (error) {
22813
- rethrowBrokerError("has", error);
22814
- }
22815
- if (result4.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
22816
- return false;
22817
- }
22818
- if (result4.exitCode !== 0) {
22819
- rethrowBrokerError("has");
22820
- }
22821
- return true;
22822
- }
22823
- };
22824
- }
22825
-
22826
- // packages/agent-runtime/windowsCredentialManagerBroker.ts
22827
- import { spawn as spawn3 } from "node:child_process";
22828
- var WINDOWS_CREDENTIAL_TARGET_PREFIX = "nolo.credentials.keys";
22829
- var WIN_ERROR_NOT_FOUND = 1168;
22830
- var WINDOWS_CREDENTIAL_MANAGER_SCRIPT = `
22831
- $ErrorActionPreference = 'Stop'
22832
- try {
22833
- $raw = [Console]::In.ReadToEnd()
22834
- if ([string]::IsNullOrWhiteSpace($raw)) { exit 1 }
22835
- $req = $raw | ConvertFrom-Json
22836
- $op = [string]$req.op
22837
- $target = [string]$req.target
22838
- if ([string]::IsNullOrWhiteSpace($op) -or [string]::IsNullOrWhiteSpace($target)) { exit 1 }
22839
-
22840
- Add-Type @"
22841
- using System;
22842
- using System.Runtime.InteropServices;
22843
- using System.Text;
22844
-
22845
- public class NoloCredNative {
22846
- public const int CRED_TYPE_GENERIC = 1;
22847
- public const int CRED_PERSIST_LOCAL_MACHINE = 2;
22848
- public const int ERROR_NOT_FOUND = 1168;
22849
-
22850
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
22851
- public struct CREDENTIAL {
22852
- public int Flags;
22853
- public int Type;
22854
- public string TargetName;
22855
- public string Comment;
22856
- public long LastWritten;
22857
- public int CredentialBlobSize;
22858
- public IntPtr CredentialBlob;
22859
- public int Persist;
22860
- public int AttributeCount;
22861
- public IntPtr Attributes;
22862
- public string TargetAlias;
22863
- public string UserName;
22864
- }
22865
-
22866
- [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
22867
- public static extern bool CredWriteW(ref CREDENTIAL userCredential, uint flags);
22868
-
22869
- [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
22870
- public static extern bool CredReadW(string target, int type, int reservedFlag, out IntPtr credentialPtr);
22871
-
22872
- [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
22873
- public static extern bool CredDeleteW(string target, int type, int flags);
22874
-
22875
- [DllImport("advapi32.dll", SetLastError = true)]
22876
- public static extern void CredFree(IntPtr buffer);
22877
- }
22878
- "@
22879
-
22880
- if ($op -eq 'get') {
22881
- $ptr = [IntPtr]::Zero
22882
- $ok = [NoloCredNative]::CredReadW($target, [NoloCredNative]::CRED_TYPE_GENERIC, 0, [ref]$ptr)
22883
- if (-not $ok) {
22884
- exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
22885
- }
22886
- try {
22887
- $cred = [Runtime.InteropServices.Marshal]::PtrToStructure($ptr, [type][NoloCredNative+CREDENTIAL])
22888
- if ($cred.CredentialBlobSize -le 0 -or $cred.CredentialBlob -eq [IntPtr]::Zero) {
22889
- $payload = @{ secret = '' } | ConvertTo-Json -Compress
22890
- [Console]::Out.Write($payload)
22891
- exit 0
22892
- }
22893
- $bytes = New-Object byte[] $cred.CredentialBlobSize
22894
- [Runtime.InteropServices.Marshal]::Copy($cred.CredentialBlob, $bytes, 0, $cred.CredentialBlobSize)
22895
- $secret = [Text.Encoding]::UTF8.GetString($bytes)
22896
- $payload = @{ secret = $secret } | ConvertTo-Json -Compress
22897
- [Console]::Out.Write($payload)
22898
- exit 0
22899
- } finally {
22900
- [NoloCredNative]::CredFree($ptr)
22901
- }
22902
- }
22903
-
22904
- if ($op -eq 'has') {
22905
- $ptr = [IntPtr]::Zero
22906
- $ok = [NoloCredNative]::CredReadW($target, [NoloCredNative]::CRED_TYPE_GENERIC, 0, [ref]$ptr)
22907
- if (-not $ok) {
22908
- exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
22909
- }
22910
- [NoloCredNative]::CredFree($ptr)
22911
- exit 0
22912
- }
22913
-
22914
- if ($op -eq 'put') {
22915
- $secret = [string]$req.secret
22916
- if ([string]::IsNullOrEmpty($secret)) { exit 1 }
22917
- $blob = [Text.Encoding]::UTF8.GetBytes($secret)
22918
- $cred = New-Object NoloCredNative+CREDENTIAL
22919
- $cred.Type = [NoloCredNative]::CRED_TYPE_GENERIC
22920
- $cred.TargetName = $target
22921
- $cred.UserName = 'api-key'
22922
- $cred.Persist = [NoloCredNative]::CRED_PERSIST_LOCAL_MACHINE
22923
- $cred.CredentialBlobSize = $blob.Length
22924
- $cred.CredentialBlob = [Runtime.InteropServices.Marshal]::AllocHGlobal($blob.Length)
22925
- try {
22926
- if ($blob.Length -gt 0) {
22927
- [Runtime.InteropServices.Marshal]::Copy($blob, 0, $cred.CredentialBlob, $blob.Length)
22928
- }
22929
- $ok = [NoloCredNative]::CredWriteW([ref]$cred, 0)
22930
- if (-not $ok) {
22931
- exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
22932
- }
22933
- exit 0
22934
- } finally {
22935
- [Runtime.InteropServices.Marshal]::FreeHGlobal($cred.CredentialBlob)
22936
- }
22937
- }
22938
-
22939
- if ($op -eq 'delete') {
22940
- $ok = [NoloCredNative]::CredDeleteW($target, [NoloCredNative]::CRED_TYPE_GENERIC, 0)
22941
- if (-not $ok) {
22942
- exit [Runtime.InteropServices.Marshal]::GetLastWin32Error()
22943
- }
22944
- exit 0
22945
- }
22946
-
22947
- exit 1
22948
- } catch {
22949
- exit 1
22950
- }
22951
- `.trim();
22952
- function safeCredentialRef2(ref) {
22953
- try {
22954
- return assertCredentialRef(ref);
22955
- } catch {
22956
- throw new Error("invalid_ref");
22957
- }
22958
- }
22959
- function credentialRefToWindowsCredentialTarget(ref, targetPrefix = WINDOWS_CREDENTIAL_TARGET_PREFIX) {
22960
- const safe = safeCredentialRef2(ref);
22961
- const hex = Buffer.from(safe, "utf8").toString("hex");
22962
- if (!hex) {
22963
- throw new Error("invalid_ref");
22964
- }
22965
- return `${targetPrefix}.${hex}`;
22966
- }
22967
- function rethrowBrokerError2(op, _error) {
22968
- throw new Error(`credential_broker_${op}_failed`);
22969
- }
22970
- function buildWindowsCredentialPowerShellArgs(script = WINDOWS_CREDENTIAL_MANAGER_SCRIPT) {
22971
- const encoded = Buffer.from(script, "utf16le").toString("base64");
22972
- return [
22973
- "-NoProfile",
22974
- "-NonInteractive",
22975
- "-ExecutionPolicy",
22976
- "Bypass",
22977
- "-EncodedCommand",
22978
- encoded
22979
- ];
22980
- }
22981
- function requestStdin(payload) {
22982
- return JSON.stringify(payload);
22983
- }
22984
- function parseGetSecretFromStdout(stdout) {
22985
- const trimmed = asTrimmedString(stdout);
22986
- if (!trimmed) {
22987
- rethrowBrokerError2("get");
22988
- }
22989
- let parsed;
22990
- try {
22991
- parsed = JSON.parse(trimmed);
22992
- } catch {
22993
- rethrowBrokerError2("get");
22994
- }
22995
- if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed) || typeof parsed.secret !== "string") {
22996
- rethrowBrokerError2("get");
22997
- }
22998
- return parsed.secret;
22999
- }
23000
- function spawnShell(bin, args2, stdin) {
23001
- return new Promise((resolve7) => {
23002
- let settled = false;
23003
- const finish = (result4) => {
23004
- if (settled) return;
23005
- settled = true;
23006
- resolve7(result4);
23007
- };
23008
- let child;
23009
- try {
23010
- child = spawn3(bin, args2, {
23011
- stdio: ["pipe", "pipe", "pipe"],
23012
- windowsHide: true
23013
- });
23014
- } catch {
23015
- finish({ exitCode: -1, stdout: "", stderr: "" });
23016
- return;
23017
- }
23018
- let stdout = "";
23019
- let stderr = "";
23020
- child.stdout?.setEncoding("utf8");
23021
- child.stderr?.setEncoding("utf8");
23022
- child.stdout?.on("data", (chunk) => {
23023
- stdout += chunk;
23024
- });
23025
- child.stderr?.on("data", (chunk) => {
23026
- stderr += chunk;
23027
- });
23028
- child.on("error", () => {
23029
- finish({ exitCode: -1, stdout: "", stderr: "" });
23030
- });
23031
- child.on("close", (code) => {
23032
- finish({
23033
- exitCode: typeof code === "number" ? code : -1,
23034
- stdout,
23035
- stderr
23036
- });
23037
- });
23038
- if (stdin !== void 0) {
23039
- child.stdin?.write(stdin);
23040
- }
23041
- child.stdin?.end();
23042
- });
23043
- }
23044
- function createDefaultWindowsCredentialRunner(shellBin) {
23045
- let resolvedBin = shellBin ?? null;
23046
- return async function defaultWindowsCredentialRunner(input) {
23047
- if (resolvedBin) {
23048
- return spawnShell(resolvedBin, input.args, input.stdin);
23049
- }
23050
- const first = await spawnShell("powershell.exe", input.args, input.stdin);
23051
- if (first.exitCode !== -1) {
23052
- resolvedBin = "powershell.exe";
23053
- return first;
23054
- }
23055
- const second = await spawnShell("pwsh", input.args, input.stdin);
23056
- if (second.exitCode !== -1) {
23057
- resolvedBin = "pwsh";
23058
- }
23059
- return second;
23060
- };
23061
- }
23062
- function createWindowsCredentialManagerBroker(options = {}) {
23063
- const runner = options.runner ?? createDefaultWindowsCredentialRunner(options.shellBin);
23064
- const targetPrefix = options.targetPrefix ?? WINDOWS_CREDENTIAL_TARGET_PREFIX;
23065
- const targetFor = (ref) => credentialRefToWindowsCredentialTarget(ref, targetPrefix);
23066
- const staticArgs = buildWindowsCredentialPowerShellArgs();
23067
- return {
23068
- async get(ref) {
23069
- const safeRef = safeCredentialRef2(ref);
23070
- const target = targetFor(safeRef);
23071
- let result4;
23072
- try {
23073
- result4 = await runner({
23074
- args: staticArgs,
23075
- stdin: requestStdin({ op: "get", target })
23076
- });
23077
- } catch (error) {
23078
- rethrowBrokerError2("get", error);
23079
- }
23080
- if (result4.exitCode === WIN_ERROR_NOT_FOUND) {
23081
- return null;
23082
- }
23083
- if (result4.exitCode !== 0) {
23084
- rethrowBrokerError2("get");
23085
- }
23086
- const secret = parseGetSecretFromStdout(result4.stdout);
23087
- return secret.length > 0 ? secret : null;
23088
- },
23089
- async put(ref, secret) {
23090
- const safeRef = safeCredentialRef2(ref);
23091
- const value = asTrimmedString(secret);
23092
- if (!value) {
23093
- throw new Error("Cannot store an empty credential secret.");
23094
- }
23095
- const target = targetFor(safeRef);
23096
- let result4;
23097
- try {
23098
- result4 = await runner({
23099
- args: staticArgs,
23100
- stdin: requestStdin({ op: "put", target, secret: value })
23101
- });
23102
- } catch (error) {
23103
- rethrowBrokerError2("put", error);
23104
- }
23105
- if (result4.exitCode !== 0) {
23106
- rethrowBrokerError2("put");
23107
- }
23108
- },
23109
- async delete(ref) {
23110
- const safeRef = safeCredentialRef2(ref);
23111
- const target = targetFor(safeRef);
23112
- let result4;
23113
- try {
23114
- result4 = await runner({
23115
- args: staticArgs,
23116
- stdin: requestStdin({ op: "delete", target })
23117
- });
23118
- } catch (error) {
23119
- rethrowBrokerError2("delete", error);
23120
- }
23121
- if (result4.exitCode === 0 || result4.exitCode === WIN_ERROR_NOT_FOUND) {
23122
- return;
23123
- }
23124
- rethrowBrokerError2("delete");
23125
- },
23126
- async has(ref) {
23127
- const safeRef = safeCredentialRef2(ref);
23128
- const target = targetFor(safeRef);
23129
- let result4;
23130
- try {
23131
- result4 = await runner({
23132
- args: staticArgs,
23133
- stdin: requestStdin({ op: "has", target })
23134
- });
23135
- } catch (error) {
23136
- rethrowBrokerError2("has", error);
23137
- }
23138
- if (result4.exitCode === WIN_ERROR_NOT_FOUND) {
23139
- return false;
23140
- }
23141
- if (result4.exitCode !== 0) {
23142
- rethrowBrokerError2("has");
23143
- }
23144
- return true;
23145
- }
23146
- };
23147
- }
23148
-
23149
- // packages/agent-runtime/linuxSecretServiceCredentialBroker.ts
23150
- import { spawn as spawn4 } from "node:child_process";
23151
- var LINUX_SECRET_SERVICE_ATTRIBUTE = "nolo-credential";
23152
- var SECRET_TOOL_NO_MATCH_EXIT = 1;
23153
- var DEFAULT_SECRET_TOOL_BIN = "secret-tool";
23154
- function safeCredentialRef3(ref) {
23155
- try {
23156
- return assertCredentialRef(ref);
23157
- } catch {
23158
- throw new Error("invalid_ref");
23159
- }
23160
- }
23161
- function brokerFailure(op) {
23162
- throw new Error(`credential_broker_${op}_failed`);
23163
- }
23164
- function createDefaultSecretToolRunner(secretToolBin = DEFAULT_SECRET_TOOL_BIN) {
23165
- return (input) => new Promise((resolve7) => {
23166
- let stdout = "";
23167
- let stderr = "";
23168
- let settled = false;
23169
- const finish = (result4) => {
23170
- if (settled) return;
23171
- settled = true;
23172
- resolve7(result4);
23173
- };
23174
- let child;
23175
- try {
23176
- child = spawn4(secretToolBin, input.args, {
23177
- stdio: ["pipe", "pipe", "pipe"]
23178
- });
23179
- } catch {
23180
- finish({ exitCode: -1, stdout: "", stderr: "" });
23181
- return;
23182
- }
23183
- child.stdout?.on("data", (chunk) => {
23184
- stdout += chunk;
23185
- });
23186
- child.stderr?.on("data", (chunk) => {
23187
- stderr += chunk;
23188
- });
23189
- child.on("error", () => {
23190
- finish({ exitCode: -1, stdout: "", stderr: "" });
23191
- });
23192
- child.on("close", (code) => {
23193
- finish({
23194
- exitCode: typeof code === "number" ? code : -1,
23195
- stdout,
23196
- stderr
23197
- });
23198
- });
23199
- if (input.stdin !== void 0) {
23200
- child.stdin?.write(input.stdin);
23201
- }
23202
- child.stdin?.end();
23203
- });
23204
- }
23205
- function createLinuxSecretServiceCredentialBroker(options = {}) {
23206
- const runner = options.runner ?? createDefaultSecretToolRunner(options.secretToolBin);
23207
- const attribute = options.attribute ?? LINUX_SECRET_SERVICE_ATTRIBUTE;
23208
- const attrArgs = (ref) => [attribute, ref];
23209
- const lookup3 = async (ref) => {
23210
- try {
23211
- return await runner({ args: ["lookup", ...attrArgs(ref)] });
23212
- } catch {
23213
- brokerFailure("get");
23214
- }
23215
- };
23216
- return {
23217
- async get(ref) {
23218
- const safeRef = safeCredentialRef3(ref);
23219
- const result4 = await lookup3(safeRef);
23220
- if (result4.exitCode === SECRET_TOOL_NO_MATCH_EXIT) return null;
23221
- if (result4.exitCode !== 0) brokerFailure("get");
23222
- const secret = result4.stdout.replace(/\n$/, "");
23223
- return secret.length > 0 ? secret : null;
23224
- },
23225
- async put(ref, secret) {
23226
- const safeRef = safeCredentialRef3(ref);
23227
- const value = asTrimmedString(secret);
23228
- if (!value) {
23229
- throw new Error("Cannot store an empty credential secret.");
23230
- }
23231
- const args2 = [
23232
- "store",
23233
- `--label=nolo-credential:${safeRef}`,
23234
- ...attrArgs(safeRef)
23235
- ];
23236
- if (value.includes("\n") || args2.some((arg) => arg.includes(value))) {
23237
- brokerFailure("put");
23238
- }
23239
- let result4;
23240
- try {
23241
- result4 = await runner({ args: args2, stdin: value });
23242
- } catch {
23243
- brokerFailure("put");
23244
- }
23245
- if (result4.exitCode !== 0) brokerFailure("put");
23246
- },
23247
- async delete(ref) {
23248
- const safeRef = safeCredentialRef3(ref);
23249
- let result4;
23250
- try {
23251
- result4 = await runner({ args: ["clear", ...attrArgs(safeRef)] });
23252
- } catch {
23253
- brokerFailure("delete");
23254
- }
23255
- if (result4.exitCode === 0 || result4.exitCode === SECRET_TOOL_NO_MATCH_EXIT) {
23256
- return;
23257
- }
23258
- brokerFailure("delete");
23259
- },
23260
- async has(ref) {
23261
- const safeRef = safeCredentialRef3(ref);
23262
- const result4 = await lookup3(safeRef);
23263
- if (result4.exitCode === SECRET_TOOL_NO_MATCH_EXIT) return false;
23264
- if (result4.exitCode !== 0) brokerFailure("has");
23265
- return true;
23266
- }
23267
- };
23268
- }
23269
-
23270
- // packages/agent-runtime/desktopHostCredentialBroker.ts
23271
- function createClosedCredentialBroker(code = "credential_store_unavailable") {
23272
- const fail9 = () => {
23273
- throw new Error(code);
23274
- };
23275
- return {
23276
- get: fail9,
23277
- put: fail9,
23278
- delete: fail9,
23279
- has: () => false
23280
- };
23281
- }
23282
- function createHostCredentialBrokerChain(args2) {
23283
- const { strict, session, legacy, notifySessionFallback, notifyLegacyHit } = args2;
23284
- const legacyNoticed = /* @__PURE__ */ new Set();
23285
- let sessionNotified = false;
23286
- const noticeSession = () => {
23287
- if (sessionNotified || !notifySessionFallback) return;
23288
- sessionNotified = true;
23289
- try {
23290
- notifySessionFallback();
23291
- } catch {
23292
- }
23293
- };
23294
- return {
23295
- async get(ref) {
23296
- try {
23297
- const strictValue = await strict.get(ref);
23298
- if (strictValue !== null && strictValue !== void 0) return strictValue;
23299
- } catch {
23300
- }
23301
- const sessionValue = await session.get(ref);
23302
- if (sessionValue !== null && sessionValue !== void 0) return sessionValue;
23303
- if (!legacy) return null;
23304
- const legacyValue = await legacy.get(ref);
23305
- if (legacyValue !== null && legacyValue !== void 0) {
23306
- if (notifyLegacyHit && !legacyNoticed.has(ref)) {
23307
- legacyNoticed.add(ref);
23308
- try {
23309
- notifyLegacyHit(ref);
23310
- } catch {
23311
- }
23312
- }
23313
- return legacyValue;
23314
- }
23315
- return null;
23316
- },
23317
- async put(ref, secret) {
23318
- try {
23319
- await strict.put(ref, secret);
23320
- if (await strict.has(ref)) return;
23321
- } catch {
23322
- }
23323
- await session.put(ref, secret);
23324
- noticeSession();
23325
- },
23326
- async delete(ref) {
23327
- try {
23328
- await strict.delete(ref);
23329
- } catch {
23330
- }
23331
- try {
23332
- await session.delete(ref);
23333
- } catch {
23334
- }
23335
- if (legacy) await legacy.delete(ref);
23336
- },
23337
- async has(ref) {
23338
- try {
23339
- if (await strict.has(ref)) return true;
23340
- } catch {
23341
- }
23342
- if (await session.has(ref)) return true;
23343
- return legacy ? await legacy.has(ref) : false;
23344
- }
23345
- };
23346
- }
23347
- function createStrictHostCredentialBroker(options = {}) {
23348
- const platform = options.platform ?? process.platform;
23349
- const env = options.env ?? process.env;
23350
- const override = String(env.NOLO_DESKTOP_CREDENTIAL_STORE ?? "").trim().toLowerCase();
23351
- if (override === "file") {
23352
- return createClosedCredentialBroker("credential_store_file_not_allowed");
23353
- }
23354
- if (platform === "darwin" || override === "keychain") {
23355
- return options.keychainBroker ?? (options.createKeychainBroker ?? (() => createMacOsKeychainCredentialBroker()))();
23356
- }
23357
- if (platform === "win32" || override === "credman") {
23358
- return options.windowsCredentialBroker ?? (options.createWindowsCredentialBroker ?? (() => createWindowsCredentialManagerBroker()))();
23359
- }
23360
- if (platform === "linux" || override === "secret-service") {
23361
- return options.linuxSecretServiceBroker ?? (options.createLinuxSecretServiceBroker ?? (() => createLinuxSecretServiceCredentialBroker()))();
23362
- }
23363
- return createClosedCredentialBroker("credential_store_unsupported");
23364
- }
23365
-
23366
- // packages/agent-runtime/dialogMessageRecord.ts
23367
- function dialogMessageRecordToAgentRuntimeMessage(record2) {
23368
- if (!record2 || typeof record2 !== "object") return null;
23369
- if (record2.role !== "user" && record2.role !== "assistant" && record2.role !== "tool") return null;
23370
- return {
23371
- ...typeof record2.id === "string" ? { id: record2.id } : {},
23372
- role: record2.role,
23373
- ...Number.isFinite(record2.metadata?.cliHistoryOrder) ? { cliHistoryOrder: record2.metadata.cliHistoryOrder } : {},
23374
- content: record2.content ?? "",
23375
- ...record2.contextReference !== void 0 ? { context_reference: record2.contextReference } : {},
23376
- ...typeof record2.reasoning_content === "string" ? { reasoning_content: record2.reasoning_content } : {},
23377
- ...typeof record2.toolCallId === "string" ? { tool_call_id: record2.toolCallId } : {},
23378
- ...Array.isArray(record2.tool_calls) ? { tool_calls: record2.tool_calls } : {},
23379
- ...record2.toolPayload !== void 0 ? { toolPayload: record2.toolPayload } : {},
23380
- ...typeof record2.toolName === "string" ? { toolName: record2.toolName } : {},
23381
- // 写侧(dialogWritePlan)把 tool_result_metadata 以 `metadata` 字段落库;
23382
- // 回读必须还原,否则跨 turn 投影丢失 metadata 后缀,同一 tool 消息的字节
23383
- // 在 turn 边界漂移 → provider 前缀缓存断裂(stable projection 契约,
23384
- // 见 docs/plans/2026-09-05-tool-output-cache-stability.md)。
23385
- ...record2.metadata && typeof record2.metadata === "object" ? { tool_result_metadata: record2.metadata } : {},
23386
- ...(() => {
23387
- const raw = record2.createdAt;
23388
- const ms = typeof raw === "number" ? raw : typeof raw === "string" ? Date.parse(raw) : NaN;
23389
- return Number.isFinite(ms) ? { createdAt: ms } : {};
23390
- })()
23391
- };
23392
- }
23393
-
23394
22665
  // packages/agent-runtime/dialogWritePlan.ts
23395
22666
  function extractLastUserText(messages) {
23396
22667
  const lastUser = [...messages].reverse().find((message) => message.role === "user");
@@ -24147,7 +23418,7 @@ async function saveCliPendingUserMessages(args2) {
24147
23418
  if (ops.length) await args2.store.batch(ops);
24148
23419
  }
24149
23420
  async function readCliPendingUserMessages(store, dialogId) {
24150
- const { readDialogMessageRecords } = await import("./cliLocalAgentRecordReader-H3HYQRRR.js");
23421
+ const { readDialogMessageRecords } = await import("./cliLocalAgentRecordReader-HVZAQCUD.js");
24151
23422
  const rows = await readDialogMessageRecords({ store, dialogId });
24152
23423
  const uncertain = rows.filter(({ record: record2 }) => record2.metadata?.cliBatchPhase === "requested" && !record2.metadata?.cliBatchResolution);
24153
23424
  const recovery = uncertain.length ? {
@@ -24246,11 +23517,11 @@ async function readNoloProcessStream(readable) {
24246
23517
  async function runNoloWorkspaceCliTool(call, args2) {
24247
23518
  const cliArgs = buildNoloWorkspaceCommandArgs(call);
24248
23519
  const bunSpawn = globalThis.Bun?.spawn;
24249
- const spawn5 = args2.spawn ?? (typeof bunSpawn === "function" ? bunSpawn : nodeSpawnFallback);
23520
+ const spawn2 = args2.spawn ?? (typeof bunSpawn === "function" ? bunSpawn : nodeSpawnFallback);
24250
23521
  const execPath = args2.processExecPath ?? process.execPath;
24251
23522
  const entrypoint = args2.cliEntrypoint;
24252
23523
  const cmd = entrypoint && entrypoint !== execPath ? [execPath, entrypoint, ...cliArgs] : [execPath, ...cliArgs];
24253
- const proc = spawn5({
23524
+ const proc = spawn2({
24254
23525
  cmd,
24255
23526
  stdout: "pipe",
24256
23527
  stderr: "pipe",
@@ -24362,10 +23633,10 @@ function buildLoadSkillExecutor(args2) {
24362
23633
  metadata: { loadSkill: true, resolved: false }
24363
23634
  };
24364
23635
  }
24365
- const { resolveSkillByName } = await import("./skillDiscovery-BHHPCUHZ.js");
23636
+ const { resolveSkillByName } = await import("./skillDiscovery-MDDKPTW3.js");
24366
23637
  const resolved = resolveSkillByName(args2.cwd, name);
24367
23638
  if (!resolved) {
24368
- const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-BAE2LDXF.js");
23639
+ const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-AYWYQVA4.js");
24369
23640
  const builtin = resolveBuiltinSkillByName(name);
24370
23641
  if (builtin) {
24371
23642
  const denied = await rejectDisabledBuiltin(args2.agentSkillSource, builtin.slug, name, args2.resolveAgentSkillSource);
@@ -24444,7 +23715,7 @@ async function loadPreciseSkill(cwd, parsed, agentSkillSource, resolveAgentSkill
24444
23715
  if (!nonEmpty(parsed.slug) || has2("projectBinding") || has2("relativePath")) {
24445
23716
  return reject("builtin requires only an exact slug.");
24446
23717
  }
24447
- const { listBuiltinSkills } = await import("./builtinSkillRegistry-BAE2LDXF.js");
23718
+ const { listBuiltinSkills } = await import("./builtinSkillRegistry-AYWYQVA4.js");
24448
23719
  const builtin = listBuiltinSkills().find((entry) => entry.slug === parsed.slug);
24449
23720
  if (!builtin) return reject("builtin slug not found.");
24450
23721
  const denied = await rejectDisabledBuiltin(agentSkillSource, builtin.slug, builtin.slug, resolveAgentSkillSource);
@@ -24510,7 +23781,7 @@ ${body}`,
24510
23781
  }
24511
23782
  }
24512
23783
  async function formatUnknownSkillMessage(cwd, requestedName) {
24513
- const { discoverSkills } = await import("./skillDiscovery-BHHPCUHZ.js");
23784
+ const { discoverSkills } = await import("./skillDiscovery-MDDKPTW3.js");
24514
23785
  let available = [];
24515
23786
  try {
24516
23787
  available = discoverSkills(cwd).map((s) => s.name);
@@ -25149,8 +24420,6 @@ function verifyOwnerRouteAck(headers, expectedRequestId) {
25149
24420
  }
25150
24421
 
25151
24422
  export {
25152
- createHostCredentialBrokerChain,
25153
- createStrictHostCredentialBroker,
25154
24423
  readCommandActionGatePayload,
25155
24424
  readActionGate,
25156
24425
  orderDialogHistory,
@@ -25184,6 +24453,7 @@ export {
25184
24453
  runExecShellGates,
25185
24454
  executeLocalToolWithPolicy,
25186
24455
  LOCAL_TURN_ABORTED_CODE,
24456
+ validateStoredSummary,
25187
24457
  projectContextProvenance,
25188
24458
  hashToolDefinitions,
25189
24459
  LOCAL_AGENT_CONFIG_MISSING_CODE,
@@ -25198,7 +24468,6 @@ export {
25198
24468
  executeOpenAiCompatibleChatCompletion,
25199
24469
  describeOpenAiCompatibleRequestBudget,
25200
24470
  resolveOpenAiCompatibleProviderConfig,
25201
- dialogMessageRecordToAgentRuntimeMessage,
25202
24471
  buildAgentRuntimeDialogWritePlan,
25203
24472
  shouldCacheHybridRemoteRecord,
25204
24473
  parseSyncServersEnv,