nolo-cli 0.228.0 → 0.228.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 (212) hide show
  1. package/{_executeModel-GIFVXKDT.js → _executeModel-AKCTHGMP.js} +62 -61
  2. package/{action-WZTKEF5H.js → action-C6IQAKN4.js} +6 -6
  3. package/{addContentAction-MLI6GOBV.js → addContentAction-53364YDW.js} +10 -10
  4. package/{addDialogAgentAction-ARGQM22H.js → addDialogAgentAction-U5DD5EN5.js} +9 -9
  5. package/{agentDeleteCommand-UF7XVELS.js → agentDeleteCommand-2E5FAGUO.js} +99 -93
  6. package/{agentEmailCommands-SFHRPQYC.js → agentEmailCommands-UGZZAH7E.js} +99 -93
  7. package/{agentListCommands-IXKBP3W5.js → agentListCommands-JCTW3J2K.js} +240 -52
  8. package/{agentMachineCommands-7NX6PWQ6.js → agentMachineCommands-QPG5ZXF4.js} +45 -41
  9. package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
  10. package/{agentPullCommand-4EQZYHU4.js → agentPullCommand-2EYJ5ENC.js} +1 -1
  11. package/{agentRecordCommands-IUNX6XD6.js → agentRecordCommands-4NTVR6MZ.js} +98 -92
  12. package/{agentRunCommand-LCR4XADM.js → agentRunCommand-VHF34PYC.js} +103 -94
  13. package/{agentRunControl-RN2P6AOD.js → agentRunControl-QYTXUQGY.js} +10 -7
  14. package/{agentRuntimeLocal-LVXPQ7QA.js → agentRuntimeLocal-U54AKHXH.js} +38 -36
  15. package/{agentSlice-ZGMOH6TE.js → agentSlice-4JGDEXWK.js} +10 -10
  16. package/{appDeleteCommands-BESCJOQM.js → appDeleteCommands-XBE5QJ6P.js} +46 -42
  17. package/{appDeployCommands-LPTR6IOX.js → appDeployCommands-QIYLXXGA.js} +46 -42
  18. package/{appDeployStatusCommands-BZ7KZ5RD.js → appDeployStatusCommands-JXS6ZQZZ.js} +46 -42
  19. package/{appGetCommands-EDWGJV4S.js → appGetCommands-SZS7SJPK.js} +46 -42
  20. package/{appListCommands-OPRWYPM6.js → appListCommands-B3GBJSNV.js} +46 -42
  21. package/{authCommand-3C3RN4OU.js → authCommand-V6EOMZX6.js} +15 -15
  22. package/{authCommands-ZMVEDCQD.js → authCommands-T5FODCEG.js} +2 -2
  23. package/{builtinSkillRegistry-VRCMQ77Q.js → builtinSkillRegistry-ZQC3IIO2.js} +4 -3
  24. package/{chromeOpsCommands-NZITLHWO.js → chromeOpsCommands-OFX7ZGKP.js} +2 -2
  25. package/{chunk-MZVCFV3T.js → chunk-223KZUJ6.js} +4 -4
  26. package/{chunk-UF6J7NXV.js → chunk-2C5VN7NH.js} +1 -1
  27. package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
  28. package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
  29. package/chunk-3A5NNQCN.js +64 -0
  30. package/chunk-3F2FRLIO.js +372 -0
  31. package/{chunk-V4IYI3SB.js → chunk-46FETNLF.js} +2 -2
  32. package/{chunk-RR3MB26M.js → chunk-4GYVS4PM.js} +8 -6
  33. package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
  34. package/{chunk-Y4NPF2UN.js → chunk-5AYP5QBB.js} +5 -5
  35. package/{chunk-4OXPN3WC.js → chunk-5ISNPTQH.js} +4 -4
  36. package/{chunk-CO6E7YK6.js → chunk-5P3PPQVP.js} +1 -1
  37. package/{chunk-6TVYUQRM.js → chunk-6BMTKYAO.js} +2 -2
  38. package/{chunk-KLAMJNKQ.js → chunk-6PAHSSD2.js} +15 -8
  39. package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
  40. package/{chunk-ARFCL53U.js → chunk-6VEO7Z3Y.js} +5 -5
  41. package/{chunk-ZM5AZTQG.js → chunk-7BIJFGKS.js} +20 -8
  42. package/{chunk-BAH3BAUZ.js → chunk-7OVOZRZF.js} +5 -5
  43. package/{chunk-N74XL3NI.js → chunk-7PON4LBY.js} +42 -24
  44. package/{chunk-LTVEOOZL.js → chunk-7WHCIA5V.js} +16 -3
  45. package/{chunk-HZDK56EK.js → chunk-ADYWV732.js} +34 -12
  46. package/{chunk-2FK2KZSL.js → chunk-AIFQKNPP.js} +1 -1
  47. package/{chunk-VTHWBTRE.js → chunk-BPB3T5EU.js} +5 -8
  48. package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
  49. package/{chunk-MTM4LRVG.js → chunk-BZMDWGQQ.js} +2 -2
  50. package/{chunk-JP2BH4NC.js → chunk-CEKRIR22.js} +1 -1
  51. package/{chunk-5HUO7SEX.js → chunk-D634SL2Y.js} +1 -1
  52. package/{chunk-SCMYAGQE.js → chunk-DHRPLRIR.js} +294 -159
  53. package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
  54. package/{chunk-X22AUZKL.js → chunk-E3LSO6EI.js} +189 -88
  55. package/{chunk-LHCGKAFO.js → chunk-EHFBP6IK.js} +100 -48
  56. package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
  57. package/{chunk-2BKNICGK.js → chunk-EL5NRJHI.js} +1 -1
  58. package/chunk-EUGTFFO6.js +42 -0
  59. package/{chunk-YFW4H6DL.js → chunk-EVHTYVD2.js} +821 -131
  60. package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
  61. package/{chunk-E5RYFR7E.js → chunk-FEIVARWR.js} +49 -15
  62. package/{chunk-3DJJ4CFG.js → chunk-FLBJ7IJI.js} +9 -9
  63. package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
  64. package/{chunk-VKCPKCSS.js → chunk-FYAMUU55.js} +625 -62
  65. package/{chunk-JEWMQR6J.js → chunk-FZANZZ63.js} +1 -1
  66. package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
  67. package/{chunk-YHNUDTU4.js → chunk-HDKMVYNJ.js} +4 -4
  68. package/chunk-HEVRQGGH.js +106 -0
  69. package/{chunk-PBPXXMWZ.js → chunk-HFHJPHFK.js} +1 -1
  70. package/{chunk-WQDTSK5U.js → chunk-HPDLPEUG.js} +11 -5
  71. package/{chunk-SPU3L3OR.js → chunk-HQUGB2HM.js} +3 -3
  72. package/chunk-IVK2KT3H.js +209 -0
  73. package/{chunk-73PZD7JZ.js → chunk-IYLUK67R.js} +2 -2
  74. package/{chunk-BFKJ2RS3.js → chunk-J55F3IEZ.js} +1 -1
  75. package/{chunk-ADOOL3PG.js → chunk-J7JRCOIW.js} +1 -1
  76. package/{chunk-AEZBAFC6.js → chunk-JAKRY74O.js} +138 -8
  77. package/{chunk-NEG5LYK5.js → chunk-JCQ3WCQ3.js} +3 -1
  78. package/{chunk-W6T4FNZP.js → chunk-JLZJL3WC.js} +219 -351
  79. package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
  80. package/{chunk-IIOSZAJX.js → chunk-KDBDOXOM.js} +137 -53
  81. package/{chunk-CIGCTSBF.js → chunk-KDDHQMSH.js} +1 -1
  82. package/{chunk-OAZP4TSA.js → chunk-KG27JIG4.js} +2 -2
  83. package/{chunk-RHBD22LV.js → chunk-KHYSFS3W.js} +80 -4
  84. package/{chunk-7UVVLYKC.js → chunk-KKIQAVDR.js} +5 -5
  85. package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
  86. package/{chunk-OLGFIQN2.js → chunk-LLUBUHNT.js} +1 -1
  87. package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
  88. package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
  89. package/{chunk-XJSEST7D.js → chunk-MNFUKRRU.js} +3 -3
  90. package/{chunk-R5NRFXGD.js → chunk-O3A2CHAL.js} +5 -5
  91. package/{chunk-4IQN6FWY.js → chunk-OB4FBZXJ.js} +4 -4
  92. package/{chunk-J2VIGDJN.js → chunk-OJSJJKHF.js} +3 -3
  93. package/{chunk-OHUYN3YU.js → chunk-OKAXQFON.js} +1 -1
  94. package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
  95. package/{chunk-MYYNZG2M.js → chunk-OOV5JN25.js} +4 -4
  96. package/{chunk-TMRJGSK2.js → chunk-OOVOAG4Q.js} +1 -1
  97. package/chunk-OQFOE4SJ.js +405 -0
  98. package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
  99. package/{chunk-VIYVRPMJ.js → chunk-PHREU2KZ.js} +5 -3
  100. package/{chunk-EDT65EUE.js → chunk-PIVTQRX6.js} +45 -15
  101. package/{chunk-QMNVV3YM.js → chunk-PJL7OJRC.js} +12 -11
  102. package/{chunk-XCA4WHX5.js → chunk-PNLDLUMO.js} +315 -360
  103. package/{chunk-UPOW5HTG.js → chunk-QGFLVQ6E.js} +3 -3
  104. package/{chunk-JU7VN4LF.js → chunk-QONAOHVW.js} +6 -6
  105. package/{chunk-UOUMPHS5.js → chunk-R3FZHW4Q.js} +13 -13
  106. package/{chunk-K7VIXYTZ.js → chunk-R3MV2GII.js} +1 -45
  107. package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
  108. package/{chunk-KZAT2M2V.js → chunk-RIWKZT7E.js} +22 -0
  109. package/{chunk-RMWDKLBE.js → chunk-S7H4KTMB.js} +1099 -71
  110. package/{chunk-IJZC2KIJ.js → chunk-SA356NGW.js} +1 -1
  111. package/{chunk-BVEDT6DM.js → chunk-SCAC3NM5.js} +3 -3
  112. package/{chunk-EQZQUQ33.js → chunk-SLUN7W6S.js} +5 -5
  113. package/{chunk-KK3FCYZM.js → chunk-SQL7YNED.js} +7 -4
  114. package/{chunk-LMGFVH65.js → chunk-SSOR2EDT.js} +10 -10
  115. package/chunk-TRRXYFTR.js +46 -0
  116. package/{chunk-XNTZD4AE.js → chunk-TUOHSUK5.js} +19367 -17503
  117. package/chunk-TYJCIA2O.js +835 -0
  118. package/{chunk-FTWAOKFU.js → chunk-U3BUWDUP.js} +415 -1962
  119. package/{chunk-CD64YXRB.js → chunk-U6QNVOR5.js} +1 -1
  120. package/chunk-UAF5VQCE.js +77 -0
  121. package/{chunk-CIUZXD5D.js → chunk-UFGUJ2IH.js} +5 -5
  122. package/{chunk-CTIEJRTP.js → chunk-UP7KBWLE.js} +81 -29
  123. package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
  124. package/{chunk-UHW6SCVK.js → chunk-UZKBVQUX.js} +1 -1
  125. package/{chunk-XSRSAU3O.js → chunk-V5TI7HJH.js} +3 -3
  126. package/{chunk-WFGNWWJI.js → chunk-VH7UO6E5.js} +252 -114
  127. package/{chunk-ITBX27W6.js → chunk-VJFDG3ZG.js} +30 -122
  128. package/{chunk-6MTVACLN.js → chunk-WC3J5SL2.js} +277 -293
  129. package/{chunk-HCCQEMTK.js → chunk-WD5547ZF.js} +15 -12
  130. package/{chunk-X3OZ655T.js → chunk-WS36XPJD.js} +2 -2
  131. package/{chunk-JFRJEPFI.js → chunk-WSLL7VV4.js} +2 -2
  132. package/chunk-XRGBJHZX.js +136 -0
  133. package/{chunk-KZ5OD2MO.js → chunk-Y2KWJTOZ.js} +3 -3
  134. package/{dialogUsageCommand-6RW2FY6K.js → chunk-Y2TCTNUD.js} +24 -17
  135. package/{chunk-FFFKAOJN.js → chunk-YN23INFZ.js} +1 -1
  136. package/{chunk-ODBYGVO2.js → chunk-YXK3GJF5.js} +5 -5
  137. package/{chunk-6CXQ3YNJ.js → chunk-Z2OWAYMI.js} +53 -31
  138. package/{chunk-6XVPMGXK.js → chunk-ZTHAJU3O.js} +10 -4
  139. package/{chunk-D25ONVOH.js → chunk-ZYPXOQS2.js} +1 -1
  140. package/{cliAgentConfigHelpers-37ZNEY5Y.js → cliAgentConfigHelpers-BXHQ3PXP.js} +8 -8
  141. package/{cliAuthorityBrokerClient-SFPC3WVK.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
  142. package/cliAuthorityBrokerProcess-5ZFBTHLB.js +22 -0
  143. package/{cliLocalAgentRecordReader-MCQVRWBR.js → cliLocalAgentRecordReader-47PXMHPH.js} +43 -41
  144. package/{commandRegistry-NTH5IAN5.js → commandRegistry-CTMPAQH2.js} +93 -156
  145. package/{contentThunks-SPXTX5U2.js → contentThunks-CAHIIZO5.js} +25 -25
  146. package/{cooldownCommands-TIFCHCUN.js → cooldownCommands-WDOI5VD7.js} +3 -3
  147. package/{createAgentAutomationAction-KUQKCOXB.js → createAgentAutomationAction-M25XZSPD.js} +25 -25
  148. package/{createDialogAction-HJN5U3XS.js → createDialogAction-4SN7FKI7.js} +26 -26
  149. package/{createPageAction-ZAHRDOAU.js → createPageAction-N7QPDN3M.js} +28 -28
  150. package/{db-CMUTP3W5.js → db-VR74ADGC.js} +7 -2
  151. package/{dbSlice-656PMWR2.js → dbSlice-RWPSVHBC.js} +9 -9
  152. package/{deleteFile-ZCQESEEQ.js → deleteFile-ECU6FU5C.js} +12 -7
  153. package/{dialogCommands-KZTZLWPZ.js → dialogCommands-BBHWCKDP.js} +57 -47
  154. package/{dialogNotifyCommand-PST75COP.js → dialogNotifyCommand-IASQGEMW.js} +9 -9
  155. package/{dialogSlice-BXIERQHO.js → dialogSlice-JI3J22RV.js} +23 -23
  156. package/dialogTraceCommand-EW2KK6A4.js +961 -0
  157. package/dialogUsageCommand-WJ3U6KZU.js +27 -0
  158. package/{docCreateCommands-26HJ5NAY.js → docCreateCommands-QSX3X5U4.js} +45 -41
  159. package/{docDeleteCommands-UAOHH5XK.js → docDeleteCommands-63JBG2HQ.js} +46 -42
  160. package/{docReadCommands-4ADG7YE6.js → docReadCommands-CQFKRQUI.js} +45 -41
  161. package/{docStore-FZ75HWP2.js → docStore-XLBKGGNM.js} +10 -10
  162. package/{docUpdateCommands-OGFJZENF.js → docUpdateCommands-534LUK25.js} +45 -41
  163. package/ebookDownloaderAgentCommand-DYSKF5ZY.js +677 -0
  164. package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
  165. package/{handleSendMessageAction-KP6GGBFY.js → handleSendMessageAction-Q2VMEVOR.js} +90 -48
  166. package/{hostCredentialCreate-23TX56G7.js → hostCredentialCreate-C57T7YPE.js} +99 -93
  167. package/index.js +23 -11
  168. package/{localDialogRead-CIOTQM5T.js → localDialogRead-BJJT3TF5.js} +1 -1
  169. package/{localRuntimeAdapter-MTUWOYPN.js → localRuntimeAdapter-OALZPFZU.js} +96 -90
  170. package/{localRuntimeAuthority-TYHQCTZN.js → localRuntimeAuthority-UF2DAQ3F.js} +13 -3
  171. package/{localRuntimeDb-BO7IVWAZ.js → localRuntimeDb-ZJFGNHML.js} +1 -1
  172. package/{machineCommands-4WJUJQHW.js → machineCommands-N6IVWRZT.js} +109 -92
  173. package/{machineWsRunDispatch-V3U4JM67.js → machineWsRunDispatch-PDWYB33B.js} +97 -91
  174. package/{markdownToSlate-KIYM7B3P.js → markdownToSlate-PXYAIBVL.js} +1 -1
  175. package/{mcpLocalAuthorizeCommand-TI656UWC.js → mcpLocalAuthorizeCommand-KYI4EGF5.js} +17 -13
  176. package/{memberThunks-JFYC4Z5L.js → memberThunks-43B7UYC5.js} +11 -11
  177. package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
  178. package/package.json +2 -1
  179. package/{projectArchive-NU2Z5HOR.js → projectArchive-TJNW5DLM.js} +28 -28
  180. package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
  181. package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
  182. package/{read-BRZHXUJ6.js → read-KG6INYUT.js} +12 -7
  183. package/{readDocTool-N7RVFQEE.js → readDocTool-N3GA52JR.js} +1 -1
  184. package/{readlineWorkspace-T56MRMS5.js → readlineWorkspace-PJZJVGA5.js} +1296 -1056
  185. package/{removeDialogAgentAction-J7XU7OUX.js → removeDialogAgentAction-EEVSOQOJ.js} +11 -11
  186. package/{runAgentClientLoop-O2GRCGRZ.js → runAgentClientLoop-3VC5TCDW.js} +69 -58
  187. package/{runtimeDoctorCommands-RDRJXMXC.js → runtimeDoctorCommands-V3M3JTUV.js} +14 -11
  188. package/{secretCommands-2FEMRUFM.js → secretCommands-KVVZS7A6.js} +2 -2
  189. package/{setDialogExtraReferencesAction-Q4V2ZZW2.js → setDialogExtraReferencesAction-DNO5POHA.js} +10 -10
  190. package/{setPrimaryDialogAgentAction-742H5S6T.js → setPrimaryDialogAgentAction-QABBEO4C.js} +11 -11
  191. package/{settingThunks-T4FXSV6M.js → settingThunks-DVKG4X4S.js} +13 -17
  192. package/{skillDiscovery-MDDKPTW3.js → skillDiscovery-ZMJH36AK.js} +3 -3
  193. package/{spaceCommands-W5TAVFDT.js → spaceCommands-AGGZXPY3.js} +218 -77
  194. package/{streamAgentChatTurn-OWDJMU5E.js → streamAgentChatTurn-4GTLL2OF.js} +111 -95
  195. package/{switchDialogAgentAction-HLDLHRRA.js → switchDialogAgentAction-KYWJSGOO.js} +9 -9
  196. package/{tableCommands-44GC4N6J.js → tableCommands-EFA754RE.js} +3 -3
  197. package/{tools-O7SGGVA3.js → tools-5AGPOPLW.js} +48 -47
  198. package/{tuiRestart-EOGC2BYY.js → tuiRestart-77E7PL4R.js} +9 -8
  199. package/{tuiSummaryLlmCaller-TM5BU73J.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
  200. package/{updateCommands-FBYA5WVG.js → updateCommands-GJGRS6JK.js} +3 -3
  201. package/{updateDialogTitleAction-EXSZGTLL.js → updateDialogTitleAction-5OSEDGRK.js} +25 -25
  202. package/{usageCommand-L4OFWXEU.js → usageCommand-WI6SQOPB.js} +2 -2
  203. package/{usageRebuildCommand-7JR33UHS.js → usageRebuildCommand-WQRLLZAT.js} +3 -3
  204. package/{windowsSelfUpdate-M4V77OUB.js → windowsSelfUpdate-C7LGVWYX.js} +2 -2
  205. package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-P2SJVV3S.js} +2 -2
  206. package/chunk-FGHEF6WI.js +0 -34
  207. package/chunk-U5LOKQ2R.js +0 -176
  208. package/chunk-YDRRGVT5.js +0 -142
  209. package/chunk-YGDYYFRX.js +0 -86
  210. package/chunk-Z7KE4K3H.js +0 -758
  211. package/lib-62SWPXNF.js +0 -21042
  212. /package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
@@ -5,14 +5,17 @@ import {
5
5
  } from "./chunk-S25VJYXV.js";
6
6
  import {
7
7
  findPowerShellExecutable
8
- } from "./chunk-CTIEJRTP.js";
8
+ } from "./chunk-UP7KBWLE.js";
9
+ import {
10
+ resolveModelTier
11
+ } from "./chunk-HEVRQGGH.js";
9
12
  import {
10
13
  AUTH_ERROR_PATTERNS
11
14
  } from "./chunk-EWQ3HGNZ.js";
12
15
  import {
13
16
  resolveRuntimeAuthToken,
14
17
  resolveRuntimeServerUrl
15
- } from "./chunk-GX6DITLQ.js";
18
+ } from "./chunk-UUCYUN6Y.js";
16
19
  import {
17
20
  AGENT_RUN_PROTOCOL,
18
21
  HOST_RUNTIME_CONTENT_IDENTITY,
@@ -528,6 +531,37 @@ function createShellApprovalChild(channel, timeoutMs = TTL2) {
528
531
  };
529
532
  }
530
533
 
534
+ // packages/cli/client/reviewVerdict.ts
535
+ var SEVERITIES = ["CRITICAL", "HIGH", "MEDIUM", "LOW"];
536
+ var BLOCKERS = ["CRITICAL", "HIGH"];
537
+ function stripFrontmatter(markdown) {
538
+ return markdown.replace(/^---[\r\n]+[\s\S]*?[\r\n]+---(?:\r?\n|$)/, "");
539
+ }
540
+ function parseStructuredReview(text) {
541
+ const body = stripFrontmatter(text).trim();
542
+ if (!body.startsWith("{")) return { kind: "legacy" };
543
+ const nonempty = (v) => typeof v === "string" && v.trim().length > 0;
544
+ try {
545
+ const value = JSON.parse(body);
546
+ const keys = ["schemaVersion", "revision", "status", "reason", "findings"];
547
+ if (!value || value.schemaVersion !== 1 || Object.keys(value).some((k) => !keys.includes(k)) || !["completed", "incomplete"].includes(value.status) || !nonempty(value.revision) || !Array.isArray(value.findings) || value.reason !== void 0 && (value.status !== "incomplete" || !nonempty(value.reason)) || value.status === "incomplete" && !nonempty(value.reason))
548
+ return { kind: "invalid", reason: "\u7ED3\u6784\u5316\u5BA1\u67E5\u5B57\u6BB5\u65E0\u6548\u6216\u672A\u5B8C\u6210\u539F\u56E0\u7F3A\u5931" };
549
+ const ids = /* @__PURE__ */ new Set();
550
+ const findingKeys = ["id", "severity", "file", "line", "evidence", "impact"];
551
+ for (const f of value.findings) {
552
+ if (!f || Object.keys(f).some((k) => !findingKeys.includes(k)) || !nonempty(f.id) || ids.has(f.id.trim()) || !SEVERITIES.includes(f.severity) || !nonempty(f.file) || !Number.isSafeInteger(f.line) || f.line < 1 || !nonempty(f.evidence) || !nonempty(f.impact))
553
+ return { kind: "invalid", reason: "\u7ED3\u6784\u5316 finding \u65E0\u6548\u6216 id \u91CD\u590D" };
554
+ ids.add(f.id.trim());
555
+ }
556
+ return { kind: "structured", review: value };
557
+ } catch {
558
+ return { kind: "invalid", reason: "\u7ED3\u6784\u5316\u5BA1\u67E5 JSON \u65E0\u6548" };
559
+ }
560
+ }
561
+ function structuredReviewVerdict(review) {
562
+ return review.status === "completed" && !review.findings.some((f) => BLOCKERS.includes(f.severity)) ? "APPROVE" : "BLOCK";
563
+ }
564
+
531
565
  // packages/core/redactLogLines.ts
532
566
  var TAIL_LINES_MAX = 500;
533
567
  var REDACTED_TOKEN = "[REDACTED_TOKEN]";
@@ -1335,6 +1369,10 @@ function buildResultFrontMatter(input) {
1335
1369
  ["cacheInputTokens", input.cacheUsage?.input_tokens],
1336
1370
  ["cacheCachedTokens", input.cacheUsage?.cached_tokens],
1337
1371
  ["cacheHitRatio", input.cacheUsage?.cache_hit_ratio],
1372
+ // run 级 token 总量与生效档位(结构化回溯用;缺省省略,绝不写 0/unknown)
1373
+ ["inputTokens", input.inputTokens],
1374
+ ["outputTokens", input.outputTokens],
1375
+ ["modelTier", input.modelTier],
1338
1376
  ["dialogId", input.dialogId],
1339
1377
  ["server", input.server],
1340
1378
  ["serverSync", input.serverSync],
@@ -1423,6 +1461,77 @@ function classifyRunFailure(input) {
1423
1461
  }
1424
1462
 
1425
1463
  // packages/cli/agentRunControl.ts
1464
+ var STANDALONE_VERDICT_RE = /^(APPROVE|WARNING|BLOCK)$/i;
1465
+ var LABELED_VERDICT_RE = /^(?:结论|判定|VERDICT)\s*[::]\s*(APPROVE|WARNING|BLOCK)$/i;
1466
+ var STANDALONE_ESCALATION_RE = /^need_escalation$/i;
1467
+ var ESCALATION_WITH_DETAIL_RE = /^need_escalation\s*[::]\s*\S/i;
1468
+ var LABELED_ESCALATION_RE = /^(?:状态|结论|判定|status|escalation|escalated)\s*[::]\s*need_escalation\b/i;
1469
+ function stripVerdictDecoration(line) {
1470
+ return line.replace(/^\s*(?:[-*+>]|\d+[.)])\s*/, "").replace(/[*`"']/g, "").replace(/^_+|_+$/g, "").trim();
1471
+ }
1472
+ function leadingColumns(line) {
1473
+ let col = 0;
1474
+ for (const ch of line) {
1475
+ if (ch === " ") col += 1;
1476
+ else if (ch === " ") col += 4 - col % 4;
1477
+ else break;
1478
+ }
1479
+ return col;
1480
+ }
1481
+ function assertionLines(text) {
1482
+ const kept = [];
1483
+ let fence = null;
1484
+ for (const rawLine of text.split(/\r?\n/)) {
1485
+ const indent = leadingColumns(rawLine);
1486
+ const content = rawLine.replace(/^[ \t]*/, "");
1487
+ if (fence) {
1488
+ if (indent >= 4) continue;
1489
+ if (new RegExp(`^\\${fence.char}{${fence.length},}\\s*$`).test(content)) fence = null;
1490
+ continue;
1491
+ }
1492
+ if (indent >= 4) continue;
1493
+ const open = /^(`{3,}|~{3,})/.exec(content);
1494
+ if (open) {
1495
+ fence = { char: open[1][0], length: open[1].length };
1496
+ continue;
1497
+ }
1498
+ if (/^>/.test(content)) continue;
1499
+ kept.push(rawLine);
1500
+ }
1501
+ return kept;
1502
+ }
1503
+ function parseWholeTextJson(text) {
1504
+ const trimmed = text.trim();
1505
+ if (!trimmed) return void 0;
1506
+ try {
1507
+ return { value: JSON.parse(trimmed) };
1508
+ } catch {
1509
+ return void 0;
1510
+ }
1511
+ }
1512
+ function deriveRunFinalObservation(text) {
1513
+ if (typeof text !== "string" || !text.trim()) return { escalated: false };
1514
+ const lines = assertionLines(text);
1515
+ const wholeJson = parseWholeTextJson(text);
1516
+ const escalated = wholeJson ? typeof wholeJson.value === "object" && wholeJson.value !== null && !Array.isArray(wholeJson.value) && wholeJson.value.status === "need_escalation" : lines.some((line) => {
1517
+ const bare = stripVerdictDecoration(line);
1518
+ return STANDALONE_ESCALATION_RE.test(bare) || ESCALATION_WITH_DETAIL_RE.test(bare) || LABELED_ESCALATION_RE.test(bare);
1519
+ });
1520
+ const structured = parseStructuredReview(text);
1521
+ if (structured.kind === "structured") {
1522
+ return { escalated, reviewVerdict: structuredReviewVerdict(structured.review) };
1523
+ }
1524
+ if (structured.kind === "invalid" || wholeJson) return { escalated };
1525
+ const found = /* @__PURE__ */ new Set();
1526
+ for (const line of lines) {
1527
+ const bare = stripVerdictDecoration(line);
1528
+ const hit = LABELED_VERDICT_RE.exec(bare) ?? STANDALONE_VERDICT_RE.exec(bare);
1529
+ if (!hit) continue;
1530
+ found.add(hit[1].toUpperCase());
1531
+ }
1532
+ if (found.size !== 1) return { escalated };
1533
+ return { escalated, reviewVerdict: [...found][0] };
1534
+ }
1426
1535
  var RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
1427
1536
  "done",
1428
1537
  "failed",
@@ -2657,11 +2766,12 @@ function validateLocalWriterChild(runId, cwd, policy, deps = {}) {
2657
2766
  if (!r || r.runId !== runId || r.pid !== process.pid || r.status !== "running" || e?.state !== "known" || e.kind !== "host-local" || e.runtimeKey !== "local" || e.device.kind !== "localhost" || e.device.hostname !== nodeHostname() || e.device.platform !== process.platform || !["cli-command-authorized", "cli-tool-dispatch-authorized"].includes(e.provenance) || e.owner.state !== "verified" || native.state !== "verified" || e.owner.pid !== process.pid || e.owner.startedAt !== native.startedAt || (e.owner.linux?.bootId !== native.linux?.bootId || e.owner.linux?.startTicks !== native.linux?.startTicks) || r.processIdentity !== "verified" || r.processStartedAt !== e.owner.startedAt || e.canonicalCwd !== real || r.cwd !== real || e.permissions.hostWritesAuthorized !== policy.hostWritesAuthorized || e.permissions.readOnly !== policy.readOnly) fail("native identity/authorization");
2658
2767
  if (e?.state !== "known") return fail();
2659
2768
  const set = (v) => JSON.stringify(v === void 0 ? null : [...new Set(v)].sort());
2660
- if (set(e.permissions.allowedToolNames) !== set(policy.allowedToolNames) || set(e.permissions.blockedToolNames) !== set(policy.blockedToolNames) || JSON.stringify(e.worktree) !== JSON.stringify(trustedLocalWorktree(real, deps))) fail("scope/worktree");
2769
+ if (set(e.permissions.allowedToolNames) !== set(policy.allowedToolNames) || !policy.readOnly && set(e.permissions.blockedToolNames) !== set(policy.blockedToolNames) || JSON.stringify(e.worktree) !== JSON.stringify(trustedLocalWorktree(real, deps))) fail("scope/worktree");
2661
2770
  if (!policy.readOnly && (!policy.hostWritesAuthorized || r?.localWriterClaim?.state !== "held" || r.localWriterClaim.cwd !== real || e.worktree && (r.localWriterClaim.worktree?.root !== e.worktree.root || r.localWriterClaim.worktree.gitDir !== e.worktree.gitDir))) fail();
2662
- return true;
2771
+ const blockedToolNames = policy.readOnly ? [.../* @__PURE__ */ new Set([...e.permissions.blockedToolNames ?? [], ...policy.blockedToolNames ?? []])] : policy.blockedToolNames;
2772
+ return { blockedToolNames };
2663
2773
  }, { strict: true, requireDeadOwner: true });
2664
- if (!validated) fail("registry lock busy");
2774
+ return validated ?? fail("registry lock busy");
2665
2775
  }
2666
2776
  async function awaitLocalWriterChild(runId, cwd, policy, deps = {}) {
2667
2777
  if (!/^[A-Za-z0-9_-]+$/.test(runId)) throw new Error("[local-writer-resource] child binding invalid id");
@@ -2675,8 +2785,7 @@ async function awaitLocalWriterChild(runId, cwd, policy, deps = {}) {
2675
2785
  const native = publication ? nativeOwner(publication.parent.pid, deps) : { state: "unknown" };
2676
2786
  const parentLive = publication && native.state === "verified" && publication.parent.startedAt === native.startedAt && publication.parent.linux?.bootId === native.linux?.bootId && publication.parent.linux?.startTicks === native.linux?.startTicks;
2677
2787
  try {
2678
- validateLocalWriterChild(runId, cwd, policy, deps);
2679
- return;
2788
+ return validateLocalWriterChild(runId, cwd, policy, deps);
2680
2789
  } catch (error) {
2681
2790
  const lockBusy = String(error).includes("registry lock busy");
2682
2791
  const pending = publication?.state === "pending" && r?.execution?.state === "known" && r.execution.owner.state === "unknown";
@@ -2901,6 +3010,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
2901
3010
  startup: { protocol: AGENT_RUN_PROTOCOL, phase: "spawn" },
2902
3011
  agentKey: input.agentKey,
2903
3012
  agentName: input.agentName?.trim() || shortAgentKey(input.agentKey),
3013
+ ...typeof input.callerAgentKey === "string" && input.callerAgentKey.trim() ? { callerAgentKey: input.callerAgentKey.trim() } : {},
2904
3014
  ...title ? { title } : {},
2905
3015
  cwd: canonicalCwd ?? input.cwd,
2906
3016
  execution,
@@ -3247,9 +3357,25 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
3247
3357
  if (typeof update.lastAssistantText === "string" && update.lastAssistantText) {
3248
3358
  record2.lastAssistantText = update.lastAssistantText.slice(0, 2e3);
3249
3359
  }
3360
+ if (typeof update.model === "string" && update.model.trim()) {
3361
+ record2.model = update.model.trim();
3362
+ }
3363
+ const finalObservation = deriveRunFinalObservation(update.lastAssistantText);
3364
+ if (finalObservation.escalated) record2.escalated = true;
3365
+ if (finalObservation.reviewVerdict) record2.reviewVerdict = finalObservation.reviewVerdict;
3250
3366
  if (update.cacheUsage) {
3251
3367
  record2.cacheHitRatio = update.cacheUsage.cache_hit_ratio;
3252
3368
  record2.cacheCachedTokens = update.cacheUsage.cached_tokens;
3369
+ if (typeof update.cacheUsage.input_tokens === "number") {
3370
+ record2.inputTokens = update.cacheUsage.input_tokens;
3371
+ }
3372
+ if (typeof update.cacheUsage.output_tokens === "number") {
3373
+ record2.outputTokens = update.cacheUsage.output_tokens;
3374
+ }
3375
+ }
3376
+ const resolvedTier = record2.selectionCheck?.modelTier ?? resolveModelTier(record2.model);
3377
+ if (resolvedTier !== "unknown" || record2.selectionCheck?.modelTier) {
3378
+ record2.modelTier = resolvedTier;
3253
3379
  }
3254
3380
  record2.endedAt = now().toISOString();
3255
3381
  let resultWriteFailed = false;
@@ -3293,7 +3419,10 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
3293
3419
  serverSync: update.serverSync,
3294
3420
  cwd: record2.cwd,
3295
3421
  continuedFrom: record2.continuedFrom,
3296
- ...update.cacheUsage ? { cacheUsage: update.cacheUsage } : {}
3422
+ ...update.cacheUsage ? { cacheUsage: update.cacheUsage } : {},
3423
+ ...typeof record2.inputTokens === "number" ? { inputTokens: record2.inputTokens } : {},
3424
+ ...typeof record2.outputTokens === "number" ? { outputTokens: record2.outputTokens } : {},
3425
+ ...record2.modelTier ? { modelTier: record2.modelTier } : {}
3297
3426
  },
3298
3427
  update.lastAssistantText ?? ""
3299
3428
  );
@@ -3996,6 +4125,7 @@ export {
3996
4125
  getRunResultHeaderMeta,
3997
4126
  serverOriginForDialog,
3998
4127
  isHistoryIntegrityFailure,
4128
+ deriveRunFinalObservation,
3999
4129
  RUN_TERMINAL_STATUSES,
4000
4130
  isRunTerminalStatus,
4001
4131
  resolveNoloHome,
@@ -71,7 +71,9 @@ var HIGH_RISK_MUTATION_TOOL_NAMES = [
71
71
  // 受控云端执行:在用户拥有的云资源上跑任意命令,不可重放、副作用在云端。
72
72
  // 硬边界:它永不进 DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS(见该清单注释),
73
73
  // 必须由 agent 显式启用才出现;这里进名单保证只读 run 即使被显式要求也拿不到。
74
- "cloud_exec"
74
+ "cloud_exec",
75
+ // Sandbox 产物持久化提交:会写入 Space / 用户持久存储,只读 run 不允许调用。
76
+ "commitSandboxArtifact"
75
77
  ];
76
78
  function resolveReadOnlyToolConstraints(additionalBlockedTools) {
77
79
  return {