nolo-cli 0.107.0-alpha.4 → 0.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UDCSOTD2.js → _executeModel-C4EH5TZG.js} +77 -69
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-MB2HHMDZ.js → addContentAction-M2WOWZCL.js} +13 -12
  5. package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-QMAQ5Z6N.js} +19 -20
  6. package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-D3RICSHX.js} +118 -43
  7. package/{agentEmailCommands-AU5I4M4W.js → agentEmailCommands-YC2A4USQ.js} +99 -89
  8. package/agentListCommands-UDJELMYP.js +741 -0
  9. package/{agentMachineCommands-YMNME2L6.js → agentMachineCommands-XH4IBGTO.js} +48 -44
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-CMVTBY5X.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-3EOC2QMN.js +138 -0
  13. package/agentRunCommand-BTHYOVVS.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-N4YGKL7M.js} +44 -40
  16. package/{agentSlice-R7PR6KYM.js → agentSlice-NIN4T6CF.js} +15 -14
  17. package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-7DAF33AM.js} +46 -42
  18. package/{appDeployCommands-UTB76XFM.js → appDeployCommands-ZPZSMFGZ.js} +46 -42
  19. package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-FWBDSSS5.js} +46 -42
  20. package/{appGetCommands-PX2BFHOB.js → appGetCommands-SZZOHGEP.js} +46 -42
  21. package/{appListCommands-BSMPTWKC.js → appListCommands-FPMUBDPM.js} +46 -42
  22. package/{authCommand-YW42YZA4.js → authCommand-VL3G26NQ.js} +119 -25
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZK4K67Y5.js} +11 -9
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-JDPFV2JV.js → chunk-2NNRWRM5.js} +20 -11
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  30. package/{chunk-UVA7OYO3.js → chunk-2ZHBFX5R.js} +29 -9
  31. package/{chunk-QTGQ2LTL.js → chunk-3DQY5IFB.js} +6 -10
  32. package/chunk-4LCOCOR5.js +50 -0
  33. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  34. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  35. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  36. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  37. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  38. package/chunk-5MMAK75Q.js +15 -0
  39. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  40. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  41. package/{chunk-IBOOZVVD.js → chunk-6IJDSYUA.js} +849 -279
  42. package/{chunk-4MK3I7Y4.js → chunk-6MAW4XOF.js} +5 -5
  43. package/chunk-76HO2DP6.js +15 -0
  44. package/chunk-7AY2H3GA.js +13692 -0
  45. package/{chunk-4CR5I7BD.js → chunk-7HYOPBUW.js} +47 -67
  46. package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
  47. package/chunk-AGIM7IMJ.js +147 -0
  48. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  49. package/{chunk-6OZ36FXI.js → chunk-BIPGGSJS.js} +22 -4
  50. package/{chunk-EYAQT56M.js → chunk-BNQMNUKZ.js} +9 -6
  51. package/{chunk-62CATUYY.js → chunk-CBUMFIFE.js} +834 -962
  52. package/{chunk-OIVSQH2O.js → chunk-CDEEFJXN.js} +308 -11
  53. package/chunk-CHOZJMJS.js +78 -0
  54. package/{chunk-ETI2NYVF.js → chunk-CIP3AAMT.js} +4 -4
  55. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  56. package/{chunk-IBOZNTG2.js → chunk-DGEUP3DK.js} +23 -28
  57. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  58. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  59. package/{chunk-HKNXJGEC.js → chunk-ECFHBYUW.js} +85 -50
  60. package/{chunk-ACTMNVHM.js → chunk-EHSYSKXV.js} +1 -1
  61. package/{chunk-WV42OMV7.js → chunk-ELUDRSRD.js} +8 -8
  62. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  63. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  64. package/{chunk-BFDFRLLQ.js → chunk-EZ4VZHAG.js} +5 -5
  65. package/{chunk-GO3Z72MT.js → chunk-FHLMQIU7.js} +65 -95
  66. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  67. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  68. package/chunk-GMZLP5DV.js +82 -0
  69. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  70. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  71. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  72. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  73. package/{chunk-BNGW5ASC.js → chunk-I2RGRVQ7.js} +22 -2
  74. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  75. package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
  76. package/{chunk-GQBOR3G6.js → chunk-JBKHQOYK.js} +8 -4
  77. package/{chunk-XD2MJFUG.js → chunk-JEFXP73H.js} +1 -1
  78. package/{chunk-PBA4UJBK.js → chunk-JIXGJTBU.js} +4 -4
  79. package/{chunk-AEOE4Z6Q.js → chunk-K6L5PNXK.js} +39 -15
  80. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  81. package/{chunk-GPCZ7UXG.js → chunk-KD6D6BLA.js} +1 -1
  82. package/{chunk-UZGQNTVW.js → chunk-KHKTDMYG.js} +8 -6
  83. package/{chunk-MRIHM22T.js → chunk-LBFL6RZG.js} +58 -9
  84. package/{chunk-C3M4465B.js → chunk-LKIVH2I2.js} +403 -658
  85. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  86. package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
  87. package/{chunk-NA35QHCF.js → chunk-LVBFKW65.js} +1 -1
  88. package/chunk-LWLNLZC5.js +265 -0
  89. package/{chunk-EEGDMATE.js → chunk-M3NMHYRB.js} +86 -81
  90. package/chunk-N4NGJDT6.js +929 -0
  91. package/{chunk-GL3EHUR4.js → chunk-N7NLLRQQ.js} +68 -46
  92. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  93. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  94. package/chunk-NWENLDMM.js +42 -0
  95. package/chunk-O7SVKKLY.js +875 -0
  96. package/chunk-OCZKATRC.js +129 -0
  97. package/{chunk-6Z7MY3V7.js → chunk-OEJLGVBL.js} +5 -5
  98. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  99. package/{chunk-GEPUP7OO.js → chunk-OR2UWD6X.js} +3 -3
  100. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  101. package/{chunk-J4MOO56S.js → chunk-PNXHPLRU.js} +10 -2
  102. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  103. package/{chunk-P5EVSOPA.js → chunk-R6EBQEQE.js} +22 -29
  104. package/{chunk-NOF3HDSN.js → chunk-RLSF5CSE.js} +11 -9
  105. package/chunk-RQ6CTX2E.js +164 -0
  106. package/{chunk-3UZPUAES.js → chunk-RSB4PWX4.js} +1 -1
  107. package/{chunk-KQ4ONNQD.js → chunk-RXA3HAVW.js} +190 -8
  108. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  109. package/chunk-SQHMSDDU.js +8004 -0
  110. package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
  111. package/{chunk-JRQFUXY7.js → chunk-TBAXFWOS.js} +99 -22
  112. package/{chunk-PQFHGD77.js → chunk-TBM2RS3U.js} +161 -14
  113. package/{chunk-XT35TTFG.js → chunk-TCYU7L6V.js} +18 -20
  114. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  115. package/chunk-TY3TIUJK.js +89 -0
  116. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  117. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  118. package/chunk-UM7TA3K4.js +1008 -0
  119. package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
  120. package/chunk-VIWDGTDA.js +8 -0
  121. package/chunk-VJVNU77E.js +83 -0
  122. package/{chunk-W7HLWAQ7.js → chunk-VPLUU4IX.js} +118 -90
  123. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  124. package/chunk-VZLO4XJD.js +17 -0
  125. package/{chunk-AHAHBQMU.js → chunk-WDLSZMTA.js} +2 -2
  126. package/{chunk-53HEEOTT.js → chunk-WF5X57VW.js} +83 -16
  127. package/{chunk-VRTTFDBM.js → chunk-WPHY3VPF.js} +35 -22
  128. package/{chunk-ASIFZ2WY.js → chunk-YKZLFY5J.js} +66 -54
  129. package/chunk-YV25TM3R.js +780 -0
  130. package/{chunk-MS7TSPZR.js → chunk-YXKNBVYW.js} +19 -17
  131. package/chunk-ZRAU6T47.js +56 -0
  132. package/commandRegistry-UU6IOTHI.js +833 -0
  133. package/{contentThunks-IV2T3EJC.js → contentThunks-ARD56LKI.js} +39 -36
  134. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  135. package/{createAgentAutomationAction-JCOIEYY4.js → createAgentAutomationAction-HWJLU6DD.js} +40 -37
  136. package/createDialogAction-CHYA6PZE.js +70 -0
  137. package/{createPageAction-D2VOOLP3.js → createPageAction-TSCYNFX7.js} +47 -43
  138. package/{chunk-FG3HKPQP.js → cursorProvider-YGGNMVWX.js} +2751 -10185
  139. package/{dbSlice-A6C6H32X.js → dbSlice-TG4MZ5EB.js} +12 -11
  140. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  141. package/{dialogCommands-H7FPUYUQ.js → dialogCommands-IJYQAQMB.js} +49 -46
  142. package/{dialogSlice-6JZOOTDS.js → dialogSlice-H476I77R.js} +57 -37
  143. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  144. package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-AZSK4NAG.js} +48 -44
  145. package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-DDJMSMFZ.js} +49 -45
  146. package/{docReadCommands-WJN3WT6O.js → docReadCommands-5F5Q6EBZ.js} +47 -43
  147. package/{docStore-HUPQ2FSS.js → docStore-HW2RDZDM.js} +17 -13
  148. package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-XPNPVZOC.js} +48 -44
  149. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  150. package/{getPricing-LUSEABA6.js → getPricing-DOBBZLOK.js} +4 -4
  151. package/{handleSendMessageAction-DFPMQ7YM.js → handleSendMessageAction-IOXE7ILC.js} +109 -42
  152. package/index.js +87 -884
  153. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  154. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  155. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  156. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  157. package/{machineCommands-M2T2I5NF.js → machineCommands-Q7TDGM6P.js} +96 -86
  158. package/machineWsRunDispatch-T5VFOQ3R.js +154 -0
  159. package/{memberThunks-P2ECUJ56.js → memberThunks-5S5D3N4U.js} +20 -18
  160. package/{models-T3SG6MJ5.js → models-PQU25T6Q.js} +2 -2
  161. package/oauthTokenStore-ITEB663N.js +23 -0
  162. package/package.json +1 -1
  163. package/processSpawn-SOAV3FEV.js +11 -0
  164. package/profileConfig-ZGOFORWV.js +43 -0
  165. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HAQWVAQX.js} +7 -7
  166. package/{providerRegistry-757OWH3O.js → providerRegistry-5FGWB3X5.js} +11 -7
  167. package/{read-COE3ZYR6.js → read-LSYFLSIM.js} +8 -7
  168. package/{readDocTool-5USN4A6V.js → readDocTool-XWRXV3DR.js} +5 -3
  169. package/{readlineWorkspace-XQRDGWRZ.js → readlineWorkspace-25U6P3DG.js} +2595 -2031
  170. package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-4TEFC3VL.js} +22 -26
  171. package/{runAgentClientLoop-5ZA62FBA.js → runAgentClientLoop-CZOYWHDN.js} +78 -71
  172. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  173. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  174. package/{setDialogExtraReferencesAction-WX5VTY6O.js → setDialogExtraReferencesAction-LSEN44OY.js} +16 -14
  175. package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-SR366X5A.js} +23 -27
  176. package/{chunk-GP5LKBUZ.js → settingThunks-CTVPPGIN.js} +226 -940
  177. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  178. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  179. package/{spaceCommands-5GLCWZPO.js → spaceCommands-3UK63WPE.js} +51 -47
  180. package/{streamAgentChatTurn-6UZJMYRB.js → streamAgentChatTurn-LV6ZWUD4.js} +214 -114
  181. package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-M6NAFOOU.js} +19 -20
  182. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  183. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
  184. package/tools-UJOV6CQZ.js +117 -0
  185. package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-DEH7ZEM6.js} +25 -23
  186. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  187. package/{updateDialogTitleAction-QTKNIURB.js → updateDialogTitleAction-JYXKIBNJ.js} +84 -45
  188. package/action-P4TNFGAD.js +0 -31
  189. package/agentListCommands-B2V4YAC4.js +0 -410
  190. package/agentRecordCommands-G4KK4R7H.js +0 -128
  191. package/agentRunCommand-UTZJA23G.js +0 -156
  192. package/browser-image-compression-MFDTD7K6.js +0 -1763
  193. package/chatQueueReduxAdapter-2P6NFX64.js +0 -186
  194. package/chunk-CQ3WA2NE.js +0 -299
  195. package/chunk-M76ECQRD.js +0 -13658
  196. package/chunk-MEYIRKDN.js +0 -8967
  197. package/chunk-PUOC4YRO.js +0 -394
  198. package/chunk-Q5FJJ6XI.js +0 -103
  199. package/chunk-S7Z2HMCN.js +0 -25
  200. package/chunk-T75QD6AB.js +0 -20923
  201. package/chunk-Y5GCAMGP.js +0 -9
  202. package/chunk-YPREESF4.js +0 -225
  203. package/createDialogAction-NGG7YVNU.js +0 -65
  204. package/machineWsRunDispatch-ISBKOOD7.js +0 -144
  205. package/settingSlice-P4ZW7K5X.js +0 -204
  206. package/syncMapping-N6RGXGBW.js +0 -437
  207. package/tools-KMGFWO43.js +0 -110
  208. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  209. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // packages/cli/agentCommandSupport.ts
6
6
  async function getDefaultCliDb() {
7
- const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-SYQGUF4U.js");
7
+ const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-VKWVOPPI.js");
8
8
  return getDefaultCliLocalRuntimeDb();
9
9
  }
10
10
  function createNullCliDb() {
@@ -1,13 +1,16 @@
1
- import {
2
- buildSkillDocMarkdown
3
- } from "./chunk-Q554LLSI.js";
4
1
  import {
5
2
  SYSTEM_AGENT_CAPABILITIES,
6
3
  SYSTEM_AGENT_CAPABILITY_IDS
7
- } from "./chunk-QDSINZM3.js";
4
+ } from "./chunk-IXH3HKY2.js";
5
+ import {
6
+ buildSkillDocMarkdown
7
+ } from "./chunk-DMXLXZKL.js";
8
+ import {
9
+ CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES
10
+ } from "./chunk-LWLNLZC5.js";
8
11
  import {
9
12
  createKey
10
- } from "./chunk-VMFTFOWF.js";
13
+ } from "./chunk-OKGVNZTL.js";
11
14
 
12
15
  // packages/ai/tools/codeWorkDiscipline.ts
13
16
  var CODE_WORK_DISCIPLINE_BODY = `## \u6548\u7387\u4F18\u5148\uFF08\u7701 token\uFF09
@@ -30,7 +33,7 @@ var CODE_WORK_DISCIPLINE_BODY = `## \u6548\u7387\u4F18\u5148\uFF08\u7701 token\u
30
33
  - \u6309\u89D2\u8272\u52A0\u8F7D\u5BF9\u5E94 skill\uFF1Areviewer \u5148 \`loadSkill("coding-review")\` \u62FF\u901A\u7528\u6D41\u7A0B\uFF0C\u518D\u6309\u89D2\u8272 \`loadSkill("coding-review-<role>")\` \u62FF\u68C0\u67E5\u9879\u3002\u89D2\u8272\u6E05\u5355\uFF1Acode-quality\uFF08**\u5FC5\u8DD1**\uFF09/ architecture\uFF08**\u5355\u72EC\u6D3E\u53D1**\uFF0C\u4E2D\u7EA7\u4EE5\u4E0A\u95EE\u9898\uFF09/ security\uFF08\u6309\u9700 + \u5B89\u5168\u654F\u611F\u89E6\u53D1\u5FC5\u8DD1\uFF09/ frontend-ux\uFF08\u6D89\u53CA UI \u65F6\uFF09/ backend-data\uFF08\u6D89\u53CA server \u65F6\uFF09\u3002\u89D2\u8272\u5207\u5272\u7684\u76EE\u7684\u662F\u6CE8\u610F\u529B\u9694\u79BB\u2014\u2014\u6BCF\u4E2A\u89D2\u8272\u53EA\u76EF\u81EA\u5DF1\u7684\u68C0\u67E5\u9762\uFF0C\u6309\u9700\u542F\u7528\uFF0C\u907F\u514D\u4E00\u4E2A reviewer \u80CC\u6240\u6709\u89D2\u8272\u5BFC\u81F4\u6CE8\u610F\u529B\u7A00\u91CA\u3002
31
34
  - Verdict \u6807\u51C6\uFF1AAPPROVE\uFF08\u65E0 CRITICAL \u6216 HIGH\uFF09\u2192 \u53EF commit\uFF1BWARNING\uFF08\u4EC5 HIGH\uFF09\u2192 \u62A5\u544A owner \u51B3\u5B9A\uFF1BBLOCK\uFF08\u6709 CRITICAL\uFF09\u2192 \u5FC5\u987B\u5148\u4FEE\u3002
32
35
  - review \u662F\u591A\u8F6E\u6536\u655B\u7684\uFF1A\u6D3E reviewer \u5BA1\u5DE5\u4F5C\u533A diff \u2192 \u51FA finding \u5C31\u4FEE \u2192 \u590D\u5BA1\uFF0C\u76F4\u5230 APPROVE \u624D\u63D0\u4EA4\u3002\u6BCF\u8F6E review \u65E0\u4E0A\u4E0B\u6587\u2014\u2014reviewer \u53EA\u770B\u5F53\u524D\u5DE5\u4F5C\u533A diff\uFF0C\u4E0D\u5E26\u4E0A\u4E00\u8F6E finding \u8BB0\u5FC6\u3002
33
- - \u82E5\u5904\u4E8E\u5355 Agent \u72EC\u5360\u73AF\u5883\u3001\u5176\u4ED6 agent \u4E0D\u53EF\u8FBE\u3001\u6216\u7528\u6237\u660E\u786E\u8981\u6C42\u76F4\u63A5\u63D0\u4EA4\uFF0C\u5141\u8BB8\u5E26\u539F\u56E0\u8DF3\u8FC7\uFF08commit message \u6CE8\u660E [no-review: \u539F\u56E0]\uFF09\uFF0C\u4F46\u9ED8\u8BA4\u5FC5\u987B\u6D3E review\u3002`;
36
+ - \u82E5\u5904\u4E8E\u5355 Agent \u72EC\u5360\u73AF\u5883\u3001\u5176\u4ED6 agent \u4E0D\u53EF\u8FBE\u3001\u6216\u7528\u6237\u660E\u786E\u8981\u6C42\u76F4\u63A5\u63D0\u4EA4\uFF1A\u4E0D\u8981\u8865\u5199\u6216\u4F2A\u9020 review \u8BC1\u636E\uFF0C\u4E5F**\u4E0D\u8981\u7528 [no-review: \u539F\u56E0] \u8FD9\u7C7B\u5199\u6CD5**\u2014\u2014\u5B83\u4EFB\u4F55\u5224\u636E\u90FD\u89E3\u6790\u4E0D\u4E86\uFF0C\u5199\u4E86\u7167\u6837\u88AB\u62E6\u3002\u81EA\u6709\u95F8\u95E8\u8BA4\u7684\u5F62\u5F0F\u662F Reviewed-by: <\u975E\u7A7A\u7F72\u540D> \u52A0 Review: \u5E26\u7ED3\u8BBA\uFF08APPROVE / Approved / WARNING\uFF0C\u5360\u4F4D\u7B26\u5982 <pending> \u4E0D\u7B97\uFF09\uFF0Ccommit-msg \u4E0E pre-push / pre-merge \u90FD\u8D70\u8FD9\u4E00\u6761\u6B63\u5219\u3002pre-push / pre-merge **\u53E6**\u8BA4\u4E00\u6761 owner-only \u8C41\u514D\uFF1A\u6B63\u6587\u5199 No-Review: <\u539F\u56E0> \u4E14 commit author email \u547D\u4E2D packages/nolo-ci/core/src/mapping.ts \u7684 NO_REVIEW_OWNER_EMAILS \u767D\u540D\u5355\u2014\u2014agent \u8EAB\u4EFD\uFF08\u5982 app-builder@nolo.local\uFF09\u4E0D\u9002\u7528\u3002\u771F\u88AB\u5361\u4F4F\u5C31\u5982\u5B9E\u4E0A\u62A5\u5361\u70B9\u3001\u7531 owner \u51B3\u5B9A\uFF1Bgit push --no-verify \u4EC5\u9650\u7BA1\u7406\u5458/\u7D27\u6025\u6062\u590D\uFF0C\u670D\u52A1\u7AEF G2 \u4E0D\u53EF\u7ED5\u8FC7\u3002`;
34
37
  var buildCodeWorkDiscipline = (heading) => `# ${heading}
35
38
 
36
39
  ${CODE_WORK_DISCIPLINE_BODY}`;
@@ -50,9 +53,6 @@ var TOOL_PACKS = {
50
53
  // queryModelUsage / queryUserGrowthReport:server-only 工具(web/CLI executor
51
54
  // 直接返回 serverOnlyResult),不随 CORE 常驻——server 端由 agent 显式
52
55
  // tools 配置按需挂载(utilityServerTools 执行器),web 端不再挂死 schema。
53
- // setTodoList 已移至「conversation-todo」系统能力包(defaultEnabled:true)
54
- // 作为唯一 owner——single source of truth:普通 agent 默认仍有 setTodoList,
55
- // 但关闭「对话 Todo」开关即可真正摘掉它(CORE 常驻时该开关形同虚设)。
56
56
  CORE: [
57
57
  "read",
58
58
  "createDoc",
@@ -61,6 +61,8 @@ var TOOL_PACKS = {
61
61
  "updateSelf",
62
62
  "ask_user",
63
63
  "createAgentAutomation",
64
+ "updateAgentAutomation",
65
+ "deleteAgentAutomation",
64
66
  "notifyUser"
65
67
  ],
66
68
  // L2 - 联网搜索:与 CAPABILITY_PACKS「web-search」对齐。
@@ -236,7 +238,7 @@ var CAPABILITY_PACKS = [
236
238
  {
237
239
  id: "video-transcription",
238
240
  label: "\u89C6\u9891\u8F6C\u5199",
239
- description: "\u8D34\u89C6\u9891\u94FE\u63A5\u5373\u53EF\u8F6C\u5199\u4E3A\u5E26\u6807\u70B9\u6587\u672C\u4E0E SRT\u3002\u652F\u6301 B \u7AD9\u5206 P\uFF08\u9ED8\u8BA4\u5168\u90E8\u5904\u7406\uFF09\u3001YouTube \u7B49\uFF1B\u6296\u97F3\u8BF7\u5728\u684C\u9762\u7AEF\u6D4F\u89C8\u5668\u4F7F\u7528\u3002",
241
+ description: "\u8D34\u89C6\u9891\u94FE\u63A5\u5373\u53EF\u8F6C\u5199\u4E3A\u5E26\u6807\u70B9\u6587\u672C\u4E0E SRT\u3002\u652F\u6301 B \u7AD9\u5206 P\uFF08\u9ED8\u8BA4\u5168\u90E8\u5904\u7406\uFF09\u3001YouTube \u7B49\uFF1B\u652F\u6301\u6296\u97F3\u5206\u4EAB\u6587\u6848/\u77ED\u94FE\uFF0C\u628A\u5206\u4EAB\u6587\u5B57\u91CC\u7684\u94FE\u63A5\u4F20\u7ED9 url\u3002",
240
242
  tools: ["transcribeVideo"],
241
243
  defaultEnabled: false,
242
244
  icon: "\u{1F3AC}",
@@ -246,7 +248,7 @@ var CAPABILITY_PACKS = [
246
248
  - \u7528\u6237\u8D34\u4E0A\u89C6\u9891\u94FE\u63A5\u65F6\uFF0C\u76F4\u63A5\u8C03\u7528 \`transcribeVideo({ url })\`\uFF0C\u4E0D\u8981\u5148\u95EE\u8981\u4E0D\u8981\u8F6C\u5199\u3002
247
249
  - B \u7AD9\u5206 P / \u5408\u96C6\uFF1A\u7F3A\u7701\u5904\u7406\u5168\u90E8\uFF1B\u82E5\u7528\u6237\u6307\u5B9A\u300C\u53EA\u8981\u7B2C 3\u30014 \u96C6\u300D\u5219\u4F20 \`p: [3, 4]\`\u3002
248
250
  - \u8FD4\u56DE\u91CC\u7684 \`processedParts\` / \`availableParts\` \u5FC5\u987B\u5411\u7528\u6237\u8BF4\u6E05\u695A\uFF0C\u907F\u514D\u9759\u9ED8\u4E22\u5206 P\u3002
249
- - \u6296\u97F3\u82E5\u62A5\u300C\u8BE5\u5E73\u53F0\u9700\u8981\u767B\u5F55\u6001\uFF0C\u8BF7\u5728\u684C\u9762\u7AEF\u6D4F\u89C8\u5668\u4E2D\u4F7F\u7528\u300D\uFF0C\u63D0\u793A\u7528\u6237\u6539\u8D70\u684C\u9762\u7AEF\u6D4F\u89C8\u80FD\u529B\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u4F20 cookie\u3002
251
+ - \u652F\u6301\u6296\u97F3\u5206\u4EAB\u6587\u6848/\u77ED\u94FE\uFF0C\u628A\u5206\u4EAB\u6587\u5B57\u91CC\u7684\u94FE\u63A5\u4F20\u7ED9 url\u3002
250
252
  `
251
253
  }
252
254
  ];
@@ -281,8 +283,7 @@ function resolveEffectiveEnabledPacks(args) {
281
283
  }
282
284
  var SYSTEM_BUILTIN_SKILL_PACK_IDS = SYSTEM_AGENT_CAPABILITY_IDS;
283
285
  var DEFAULT_MOUNT_SYSTEM_CAPABILITY_IDS = [
284
- "agent-orchestration",
285
- "conversation-todo"
286
+ "agent-orchestration"
286
287
  ];
287
288
  function getDefaultSystemCapabilityTools() {
288
289
  const ids = DEFAULT_MOUNT_SYSTEM_CAPABILITY_IDS;
@@ -353,7 +354,7 @@ function isWebSearchTool(name) {
353
354
  return WEB_SEARCH_TOOL_NAMES.has(name);
354
355
  }
355
356
  function isBrowserTool(name) {
356
- return name.startsWith("browser_");
357
+ return name.startsWith("browser_") && !CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES.includes(name);
357
358
  }
358
359
  function addDefaultLightWebToolsForConfiguredAgents(toolNames, agentConfig) {
359
360
  const explicitToolNames = Array.isArray(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-ETI2NYVF.js";
3
+ } from "./chunk-CIP3AAMT.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-A7GB5UGH.js";
@@ -0,0 +1,265 @@
1
+ // packages/ai/tools/chromeConnectorTools.ts
2
+ var CHROME_CONNECTOR_TOOL_NAMES = [
3
+ "browser_list_tabs",
4
+ "browser_open_tab",
5
+ "browser_close_tab",
6
+ "browser_read_page",
7
+ "browser_click_element",
8
+ "browser_type",
9
+ "browser_press",
10
+ "browser_scroll",
11
+ "browser_screenshot",
12
+ "browser_read_console",
13
+ "browser_read_network"
14
+ ];
15
+ var CHROME_CONNECTOR_LEGACY_TOOL_ALIASES = {
16
+ chrome_list_tabs: "browser_list_tabs",
17
+ chrome_open_tab: "browser_open_tab",
18
+ chrome_close_tab: "browser_close_tab",
19
+ chrome_read_page: "browser_read_page",
20
+ chrome_click: "browser_click_element",
21
+ chrome_type: "browser_type",
22
+ chrome_press: "browser_press",
23
+ chrome_scroll: "browser_scroll",
24
+ chrome_screenshot: "browser_screenshot",
25
+ chrome_read_console: "browser_read_console",
26
+ chrome_read_network: "browser_read_network"
27
+ };
28
+ var CHROME_CONNECTOR_LEGACY_TOOL_NAMES = Object.keys(
29
+ CHROME_CONNECTOR_LEGACY_TOOL_ALIASES
30
+ );
31
+ var CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES = [
32
+ ...CHROME_CONNECTOR_TOOL_NAMES,
33
+ ...CHROME_CONNECTOR_LEGACY_TOOL_NAMES
34
+ ];
35
+ function resolveChromeConnectorToolName(name) {
36
+ if (CHROME_CONNECTOR_TOOL_NAMES.includes(name)) {
37
+ return name;
38
+ }
39
+ return CHROME_CONNECTOR_LEGACY_TOOL_ALIASES[name];
40
+ }
41
+ function canonicalizeChromeConnectorToolNames(toolNames) {
42
+ const out = [];
43
+ for (const name of toolNames ?? []) {
44
+ const resolved = typeof name === "string" ? resolveChromeConnectorToolName(name) : void 0;
45
+ if (resolved && !out.includes(resolved)) out.push(resolved);
46
+ }
47
+ return out;
48
+ }
49
+ var CONNECTOR_TARGET_PROPERTY = {
50
+ type: "string",
51
+ enum: ["chrome", "firefox"],
52
+ description: `Which browser's connector serves this call: "chrome" or "firefox". Omit for the default endpoint.`
53
+ };
54
+ var CHROME_CONNECTOR_READ_TOOL_NAMES = [
55
+ "browser_list_tabs",
56
+ "browser_read_page",
57
+ "browser_screenshot",
58
+ "browser_read_console",
59
+ "browser_read_network"
60
+ ];
61
+ var getChromeConnectorToolBehavior = (name) => CHROME_CONNECTOR_READ_TOOL_NAMES.includes(resolveChromeConnectorToolName(name)) ? "data" : "action";
62
+ var getChromeConnectorToolDefaultConsent = (name) => CHROME_CONNECTOR_READ_TOOL_NAMES.includes(resolveChromeConnectorToolName(name)) ? "auto" : "ask";
63
+ function baseSchema(name, description, properties, required = []) {
64
+ return {
65
+ name,
66
+ description,
67
+ parameters: {
68
+ type: "object",
69
+ properties: { ...properties, target: CONNECTOR_TARGET_PROPERTY },
70
+ required
71
+ }
72
+ };
73
+ }
74
+ var tabId = {
75
+ type: "string",
76
+ description: "Browser tab id returned by browser_list_tabs or browser_open_tab."
77
+ };
78
+ var elementRef = {
79
+ type: "string",
80
+ description: "Revision-scoped ref like 1a2b3c4d-e2, copied verbatim from browser_read_page; preferred over selector when available."
81
+ };
82
+ var selector = {
83
+ type: "string",
84
+ description: "CSS selector for the visible page element to operate on; fallback when no elementRef is available."
85
+ };
86
+ var chromeListTabsFunctionSchema = baseSchema(
87
+ "browser_list_tabs",
88
+ "List controllable browser tabs from the user's browser profile through the Nolo Browser Connector.",
89
+ {}
90
+ );
91
+ var chromeOpenTabFunctionSchema = baseSchema(
92
+ "browser_open_tab",
93
+ "Open a URL in the user's browser (Chrome or Firefox) through the Nolo Browser Connector.",
94
+ {
95
+ url: {
96
+ type: "string",
97
+ description: "HTTP or HTTPS URL to open in the browser."
98
+ },
99
+ active: {
100
+ type: "boolean",
101
+ description: "Whether to focus the new browser tab. Defaults to true."
102
+ }
103
+ },
104
+ ["url"]
105
+ );
106
+ var chromeCloseTabFunctionSchema = baseSchema(
107
+ "browser_close_tab",
108
+ "Close a browser tab through the Nolo Browser Connector. Prefer closing the tabs your own run opened with browser_open_tab, and ask the user before closing a tab they are using. Pinned tabs are refused (TAB_PINNED); unknown tab ids fail (TAB_NOT_FOUND).",
109
+ {
110
+ tabId
111
+ },
112
+ ["tabId"]
113
+ );
114
+ var chromeReadPageFunctionSchema = baseSchema(
115
+ "browser_read_page",
116
+ "Read a compact view of a browser tab: visible text (hard cap 6000 chars) plus short-lived elementRefs (hard cap 35) and a pageRevision. Reuse those refs for browser_click_element and browser_type instead of guessing selectors; use region to focus a big page. When the element list exceeds one page, continue by passing the returned nextOffset as offset. Does not read cookies or profile databases.",
117
+ {
118
+ tabId,
119
+ region: {
120
+ type: "string",
121
+ description: "Optional CSS selector limiting the read to part of the page."
122
+ },
123
+ maxChars: {
124
+ type: "number",
125
+ description: "Optional text character budget; the connector clamps it to a hard maximum."
126
+ },
127
+ detail: {
128
+ type: "string",
129
+ enum: ["compact", "full"],
130
+ description: "compact (default) returns budgeted text; full raises the budget and adds capped HTML."
131
+ },
132
+ offset: {
133
+ type: "integer",
134
+ minimum: 0,
135
+ description: "Optional element offset for paging. When an element list exceeds one page, continue by passing the returned nextOffset as offset."
136
+ },
137
+ viewportOnly: {
138
+ type: "boolean",
139
+ description: "Optional. When true, only elements intersecting the current viewport are listed."
140
+ }
141
+ },
142
+ ["tabId"]
143
+ );
144
+ var chromeClickFunctionSchema = baseSchema(
145
+ "browser_click_element",
146
+ "Click a visible element in a browser tab by elementRef from browser_read_page, or by CSS selector. Controls whose name indicates an irreversible external action (payment, send, delete, publish, permission change) are refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION: this desktop runtime has no approval channel, so name the control and ask the user to activate it themselves.",
147
+ {
148
+ tabId,
149
+ elementRef,
150
+ selector
151
+ },
152
+ ["tabId"]
153
+ );
154
+ var chromeTypeFunctionSchema = baseSchema(
155
+ "browser_type",
156
+ "Type text into a browser page element identified by elementRef from browser_read_page or by CSS selector. Typing into a control whose name indicates an irreversible external action is refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION, same as clicking it.",
157
+ {
158
+ tabId,
159
+ elementRef,
160
+ selector,
161
+ text: {
162
+ type: "string",
163
+ description: "Text to type into the selected element."
164
+ },
165
+ clearFirst: {
166
+ type: "boolean",
167
+ description: "Whether to clear the field before typing. Defaults to true."
168
+ }
169
+ },
170
+ ["tabId", "text"]
171
+ );
172
+ var chromePressFunctionSchema = baseSchema(
173
+ "browser_press",
174
+ "Send a keyboard key or shortcut to a browser tab. Enter-like keys are refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION when the focused control is an irreversible action.",
175
+ {
176
+ tabId,
177
+ key: {
178
+ type: "string",
179
+ description: "Key or shortcut, for example Enter, Escape, ArrowDown, or Meta+L."
180
+ }
181
+ },
182
+ ["tabId", "key"]
183
+ );
184
+ var chromeScrollFunctionSchema = baseSchema(
185
+ "browser_scroll",
186
+ "Scroll a browser tab by pixel deltas.",
187
+ {
188
+ tabId,
189
+ deltaX: {
190
+ type: "number",
191
+ description: "Horizontal scroll delta in pixels."
192
+ },
193
+ deltaY: {
194
+ type: "number",
195
+ description: "Vertical scroll delta in pixels."
196
+ }
197
+ },
198
+ ["tabId"]
199
+ );
200
+ var chromeScreenshotFunctionSchema = baseSchema(
201
+ "browser_screenshot",
202
+ "Capture a screenshot from a browser tab through the Nolo Browser Connector.",
203
+ {
204
+ tabId,
205
+ fullPage: {
206
+ type: "boolean",
207
+ description: "Whether to capture the full page. Defaults to false."
208
+ }
209
+ },
210
+ ["tabId"]
211
+ );
212
+ var chromeReadConsoleFunctionSchema = baseSchema(
213
+ "browser_read_console",
214
+ "Read recent console messages from a browser tab using debugger-backed connector state.",
215
+ {
216
+ tabId,
217
+ limit: {
218
+ type: "number",
219
+ description: "Maximum number of recent console messages to return."
220
+ }
221
+ },
222
+ ["tabId"]
223
+ );
224
+ var chromeReadNetworkFunctionSchema = baseSchema(
225
+ "browser_read_network",
226
+ "Read a deduplicated recent network summary from a browser tab using debugger-backed connector state. Static assets are filtered unless includeAssets is set.",
227
+ {
228
+ tabId,
229
+ limit: {
230
+ type: "number",
231
+ description: "Maximum number of recent network entries to return."
232
+ },
233
+ includeAssets: {
234
+ type: "boolean",
235
+ description: "Include images, CSS, fonts and other static assets. Defaults to false."
236
+ }
237
+ },
238
+ ["tabId"]
239
+ );
240
+ var chromeConnectorToolSchemas = [
241
+ chromeListTabsFunctionSchema,
242
+ chromeOpenTabFunctionSchema,
243
+ chromeCloseTabFunctionSchema,
244
+ chromeReadPageFunctionSchema,
245
+ chromeClickFunctionSchema,
246
+ chromeTypeFunctionSchema,
247
+ chromePressFunctionSchema,
248
+ chromeScrollFunctionSchema,
249
+ chromeScreenshotFunctionSchema,
250
+ chromeReadConsoleFunctionSchema,
251
+ chromeReadNetworkFunctionSchema
252
+ ];
253
+ async function chromeConnectorUnavailableFunc() {
254
+ throw new Error("Browser connector tools are only executable in the Nolo desktop local runtime.");
255
+ }
256
+
257
+ export {
258
+ CHROME_CONNECTOR_LEGACY_TOOL_ALIASES,
259
+ CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
260
+ canonicalizeChromeConnectorToolNames,
261
+ getChromeConnectorToolBehavior,
262
+ getChromeConnectorToolDefaultConsent,
263
+ chromeConnectorToolSchemas,
264
+ chromeConnectorUnavailableFunc
265
+ };
@@ -1,87 +1,21 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-GEPUP7OO.js";
4
+ } from "./chunk-OR2UWD6X.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-AEOE4Z6Q.js";
7
+ } from "./chunk-K6L5PNXK.js";
8
8
  import {
9
- deriveCredentialGroup,
10
- toSafeAgentSummary
11
- } from "./chunk-PQFHGD77.js";
9
+ deriveCredentialGroup
10
+ } from "./chunk-TBM2RS3U.js";
12
11
  import {
13
12
  PUBLIC_AGENT_KEY_PREFIX,
14
- isOwnedAgentKey,
15
13
  ownedAgentKey,
16
14
  ownedAgentKeyPrefix,
17
15
  parseOwnedAgentId,
18
16
  publicAgentKey
19
17
  } from "./chunk-M2EJHDJP.js";
20
18
 
21
- // packages/ai/agent/quotaSnapshot.ts
22
- function findTightestQuotaWindow(quota, now = Date.now()) {
23
- if (!quota || !Array.isArray(quota.windows) || quota.windows.length === 0) {
24
- return void 0;
25
- }
26
- let best;
27
- let bestScore = -Infinity;
28
- for (const w of quota.windows) {
29
- let score = 0;
30
- if (typeof w.utilization === "number" && w.utilization >= 0) {
31
- score = 500 + Math.min(w.utilization, 1) * 500;
32
- } else if (typeof w.remaining === "number" && typeof w.limit === "number" && w.limit > 0) {
33
- const util = Math.max(0, 1 - w.remaining / w.limit);
34
- score = 500 + util * 500;
35
- } else if (typeof w.resetAt === "number" && w.resetAt > now) {
36
- score = 200;
37
- } else if (typeof w.remaining === "number") {
38
- score = 100;
39
- }
40
- if (score > bestScore) {
41
- bestScore = score;
42
- best = w;
43
- }
44
- }
45
- return best ?? quota.windows[0];
46
- }
47
- function formatQuotaSummary(quota, now = Date.now(), options) {
48
- const tightest = findTightestQuotaWindow(quota, now);
49
- if (!tightest) return void 0;
50
- const compact = options?.compact === true;
51
- const parts = [];
52
- if (typeof tightest.utilization === "number") {
53
- const pct = Math.round(tightest.utilization * 100);
54
- parts.push(`${pct}%\u5DF2\u7528`);
55
- } else if (typeof tightest.remaining === "number") {
56
- if (typeof tightest.limit === "number") {
57
- parts.push(`${tightest.remaining}/${tightest.limit}${tightest.unit ? ` ${tightest.unit}` : ""}`);
58
- } else {
59
- parts.push(`\u4F59${tightest.remaining}${tightest.unit ? ` ${tightest.unit}` : ""}`);
60
- }
61
- }
62
- if (compact) return parts.length > 0 ? parts[0] : void 0;
63
- if (tightest.scope && tightest.scope !== "user" && tightest.scope !== "project" && tightest.scope !== tightest.unit) {
64
- parts.push(tightest.scope);
65
- }
66
- if (typeof tightest.resetAt === "number" && tightest.resetAt > now) {
67
- const diffSec = Math.round((tightest.resetAt - now) / 1e3);
68
- if (diffSec < 60) {
69
- parts.push(`${diffSec}s\u540E\u91CD\u7F6E`);
70
- } else if (diffSec < 3600) {
71
- parts.push(`${Math.round(diffSec / 60)}m\u540E\u91CD\u7F6E`);
72
- } else if (diffSec < 86400) {
73
- const hours = (diffSec / 3600).toFixed(1).replace(/\.0$/, "");
74
- parts.push(`${hours}h\u540E\u91CD\u7F6E`);
75
- } else {
76
- const days = (diffSec / 86400).toFixed(1).replace(/\.0$/, "");
77
- parts.push(`${days}d\u540E\u91CD\u7F6E`);
78
- }
79
- }
80
- if (parts.length === 0) return void 0;
81
- if (parts.length === 1 && parts[0] === tightest.scope) return void 0;
82
- return parts.join(" \xB7 ");
83
- }
84
-
85
19
  // packages/cli/agentListHelpers.ts
86
20
  function parseAgentRecordId(privateKey, explicitId) {
87
21
  if (explicitId) return explicitId;
@@ -117,6 +51,9 @@ function normalizeListedAgent(record) {
117
51
  ...typeof record?.handle === "string" && record.handle ? { handle: record.handle } : {},
118
52
  ...typeof record?.introduction === "string" && record.introduction ? { introduction: record.introduction } : typeof record?.description === "string" && record.description ? { introduction: record.description } : {},
119
53
  ...typeof record?.provider === "string" && record.provider ? { provider: record.provider } : {},
54
+ // 仅供 resolveBillingSource 判定订阅端点(Step Plan / OpenCode Go 等),
55
+ // safe 投影不输出它。缺了它本地 agent list 会把订阅端点全报成 user_api。
56
+ ...typeof record?.customProviderUrl === "string" && record.customProviderUrl ? { customProviderUrl: record.customProviderUrl } : {},
120
57
  ...typeof record?.inputPrice === "number" && Number.isFinite(record.inputPrice) ? { inputPrice: record.inputPrice } : {},
121
58
  ...typeof record?.outputPrice === "number" && Number.isFinite(record.outputPrice) ? { outputPrice: record.outputPrice } : {},
122
59
  updatedAt: typeof record?.updatedAt === "string" || typeof record?.updatedAt === "number" ? record.updatedAt : typeof record?.createdAt === "string" || typeof record?.createdAt === "number" ? record.createdAt : typeof record?.created === "string" || typeof record?.created === "number" ? record.created : null,
@@ -135,13 +72,6 @@ function normalizeListedAgent(record) {
135
72
  ...record?.quota && typeof record.quota === "object" && Array.isArray(record.quota.windows) ? { quota: record.quota } : {}
136
73
  };
137
74
  }
138
- function toSafeListedAgentSummary(agent, options) {
139
- const summary = toSafeAgentSummary(agent, options);
140
- if (agent.publicRecordExists === false) {
141
- delete summary.publicKey;
142
- }
143
- return summary;
144
- }
145
75
  function sortListedAgents(agents) {
146
76
  agents.sort((a, b) => {
147
77
  const ta = a.updatedAt == null ? 0 : new Date(a.updatedAt).getTime();
@@ -162,6 +92,7 @@ function parseAgentListArgs(args) {
162
92
  publicOnly: args.includes("--public-only"),
163
93
  idsOnly: args.includes("--ids-only"),
164
94
  scope: readArgValue(args, "--scope"),
95
+ query: readArgValue(args, "--query"),
165
96
  showUnavailable: args.includes("--show-unavailable"),
166
97
  // --safe 默认输出精简投影(与 server listAgents 一致,防大列表被截断);
167
98
  // --verbose 拿回完整字段集排障。
@@ -175,7 +106,7 @@ async function listLocalCachedAgents(args) {
175
106
  for (const prefix of [ownedPrefix, PUBLIC_AGENT_KEY_PREFIX]) {
176
107
  for await (const [key, value] of args.db.iterator({ gte: prefix, lte: `${prefix}\uFFFF` })) {
177
108
  if (typeof key !== "string" || !value || typeof value !== "object") continue;
178
- if (isOwnedAgentKey(key, args.userId)) {
109
+ if (key.startsWith(ownedPrefix)) {
179
110
  privateRecords.set(key, { ...value, dbKey: key });
180
111
  continue;
181
112
  }
@@ -302,15 +233,89 @@ async function decorateAgentsWithPublicStatusAcrossServers(args) {
302
233
  return args.agents;
303
234
  }
304
235
 
236
+ // packages/ai/agent/quotaSnapshot.ts
237
+ function findTightestQuotaWindow(quota, now = Date.now()) {
238
+ if (!quota || !Array.isArray(quota.windows) || quota.windows.length === 0) {
239
+ return void 0;
240
+ }
241
+ let best;
242
+ let bestScore = -Infinity;
243
+ for (const w of quota.windows) {
244
+ let score = 0;
245
+ if (typeof w.utilization === "number" && w.utilization >= 0) {
246
+ score = 500 + Math.min(w.utilization, 1) * 500;
247
+ } else if (typeof w.remaining === "number" && typeof w.limit === "number" && w.limit > 0) {
248
+ const util = Math.max(0, 1 - w.remaining / w.limit);
249
+ score = 500 + util * 500;
250
+ } else if (typeof w.resetAt === "number" && w.resetAt > now) {
251
+ score = 200;
252
+ } else if (typeof w.remaining === "number") {
253
+ score = 100;
254
+ }
255
+ if (score > bestScore) {
256
+ bestScore = score;
257
+ best = w;
258
+ }
259
+ }
260
+ return best ?? quota.windows[0];
261
+ }
262
+ function formatQuotaSummary(quota, now = Date.now(), options) {
263
+ const compact = options?.compact === true;
264
+ const planText = formatPlanLabel(quota?.plan);
265
+ const planName = typeof quota?.plan?.name === "string" ? quota.plan.name.trim() : "";
266
+ const tightest = findTightestQuotaWindow(quota, now);
267
+ if (!tightest) return compact ? planName || void 0 : planText;
268
+ const parts = [];
269
+ if (typeof tightest.utilization === "number") {
270
+ const pct = Math.round(tightest.utilization * 100);
271
+ parts.push(`${pct}%\u5DF2\u7528`);
272
+ } else if (typeof tightest.remaining === "number") {
273
+ if (typeof tightest.limit === "number") {
274
+ parts.push(`${tightest.remaining}/${tightest.limit}${tightest.unit ? ` ${tightest.unit}` : ""}`);
275
+ } else {
276
+ parts.push(`\u4F59${tightest.remaining}${tightest.unit ? ` ${tightest.unit}` : ""}`);
277
+ }
278
+ }
279
+ if (compact) {
280
+ const head = parts.length > 0 ? parts[0] : void 0;
281
+ return [planName || void 0, head].filter(Boolean).join(" \xB7 ") || void 0;
282
+ }
283
+ if (tightest.scope && tightest.scope !== "user" && tightest.scope !== "project" && tightest.scope !== tightest.unit) {
284
+ parts.push(tightest.scope);
285
+ }
286
+ if (typeof tightest.resetAt === "number" && tightest.resetAt > now) {
287
+ const diffSec = Math.round((tightest.resetAt - now) / 1e3);
288
+ if (diffSec < 60) {
289
+ parts.push(`${diffSec}s\u540E\u91CD\u7F6E`);
290
+ } else if (diffSec < 3600) {
291
+ parts.push(`${Math.round(diffSec / 60)}m\u540E\u91CD\u7F6E`);
292
+ } else if (diffSec < 86400) {
293
+ const hours = (diffSec / 3600).toFixed(1).replace(/\.0$/, "");
294
+ parts.push(`${hours}h\u540E\u91CD\u7F6E`);
295
+ } else {
296
+ const days = (diffSec / 86400).toFixed(1).replace(/\.0$/, "");
297
+ parts.push(`${days}d\u540E\u91CD\u7F6E`);
298
+ }
299
+ }
300
+ const onlyScope = parts.length === 0 || parts.length === 1 && parts[0] === tightest.scope;
301
+ if (onlyScope) return planText;
302
+ return [planText, ...parts].filter(Boolean).join(" \xB7 ");
303
+ }
304
+ function formatPlanLabel(plan) {
305
+ const name = typeof plan?.name === "string" ? plan.name.trim() : "";
306
+ if (!name) return void 0;
307
+ const credits = typeof plan?.monthlyCreditsUsd === "number" && Number.isFinite(plan.monthlyCreditsUsd) && plan.monthlyCreditsUsd > 0 ? `\u6708\u5EA6\u989D\u5EA6 $${plan.monthlyCreditsUsd}` : void 0;
308
+ return [`${name} \u5957\u9910`, credits].filter(Boolean).join(" \xB7 ");
309
+ }
310
+
305
311
  export {
306
- formatQuotaSummary,
307
312
  normalizeListedAgent,
308
- toSafeListedAgentSummary,
309
313
  parseAgentListArgs,
310
314
  listLocalCachedAgents,
311
315
  listRemotePublicAgents,
312
316
  listRemoteAgents,
313
317
  listRemoteAgentsAcrossServers,
314
318
  listFavoriteAgentIdsAcrossServers,
315
- decorateAgentsWithPublicStatusAcrossServers
319
+ decorateAgentsWithPublicStatusAcrossServers,
320
+ formatQuotaSummary
316
321
  };