nolo-cli 0.98.0-alpha.3 → 0.98.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 (205) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-MA3D2J4W.js → _executeModel-GJK4ZVU6.js} +74 -67
  3. package/action-PNPQLJHG.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-RBOUD7SJ.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-IODCR6TB.js} +18 -19
  6. package/{agentDeleteCommand-FHUJH5X4.js → agentDeleteCommand-GHRF6CH5.js} +47 -42
  7. package/{agentEmailCommands-KNYBWNMA.js → agentEmailCommands-O5BTHYZK.js} +97 -87
  8. package/agentListCommands-3REEM63V.js +742 -0
  9. package/{agentMachineCommands-N62I3D5Q.js → agentMachineCommands-2GW3CV7Q.js} +48 -43
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-IRNZXVGE.js} +1 -1
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-WYQODWZE.js +138 -0
  13. package/agentRunCommand-KAN65WPY.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-IOFBNVIL.js} +48 -39
  16. package/{agentSlice-65ETD734.js → agentSlice-I45M32KO.js} +14 -13
  17. package/{appDeleteCommands-PDZ7HQYH.js → appDeleteCommands-SFS6IZEM.js} +46 -41
  18. package/{appDeployCommands-KLLW32YA.js → appDeployCommands-YZQESVRQ.js} +46 -41
  19. package/{appDeployStatusCommands-IPNJ445T.js → appDeployStatusCommands-FKUUDCKP.js} +46 -41
  20. package/{appGetCommands-QA57XGXS.js → appGetCommands-QUE7OQZC.js} +46 -41
  21. package/{appListCommands-YBTAUFZS.js → appListCommands-QEETFKMH.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-NHDLY3IB.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-UDBJVSZU.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MAR5LPAC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  30. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  31. package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
  32. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  33. package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
  34. package/chunk-4LCOCOR5.js +50 -0
  35. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  36. package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
  37. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  38. package/{chunk-FSX24MR3.js → chunk-5AUJB66Z.js} +550 -515
  39. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  40. package/chunk-5J3PYNUP.js +255 -0
  41. package/chunk-5MMAK75Q.js +15 -0
  42. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  43. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  44. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  45. package/{chunk-D2QT5FW4.js → chunk-6XDD7N7P.js} +47 -67
  46. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  47. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  48. package/chunk-A4SQRTZ6.js +15 -0
  49. package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
  50. package/chunk-AGIM7IMJ.js +147 -0
  51. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  52. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  53. package/{chunk-GZBATRJA.js → chunk-B2DEZY6J.js} +20 -11
  54. package/chunk-BMQ2MJUK.js +153 -0
  55. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  56. package/chunk-C4DVDM72.js +13536 -0
  57. package/chunk-CHOZJMJS.js +78 -0
  58. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  59. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  60. package/chunk-DZ7R5V3Y.js +164 -0
  61. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  62. package/{chunk-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
  63. package/{chunk-UY2NBS4V.js → chunk-EIFYNGU4.js} +24 -5
  64. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  65. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  66. package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
  67. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  68. package/{chunk-TDRTS7QW.js → chunk-FY7DCYW7.js} +88 -17
  69. package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
  70. package/{chunk-6VFARHZW.js → chunk-GDFA73QZ.js} +934 -1091
  71. package/chunk-GMZLP5DV.js +82 -0
  72. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  73. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  74. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  75. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  76. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  77. package/{chunk-AD2L6YCC.js → chunk-I76SDF7A.js} +10 -10
  78. package/{chunk-PELKTR62.js → chunk-I7BCBNWZ.js} +24 -77
  79. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  80. package/{chunk-4OEFYTWL.js → chunk-LDCAFLXD.js} +64 -48
  81. package/{chunk-SNPMM7H3.js → chunk-LNVJHIGA.js} +18 -20
  82. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  83. package/{chunk-5H7KJX7J.js → chunk-LQ4PDQCI.js} +5 -5
  84. package/{chunk-GABFWSOQ.js → chunk-M33GWZIZ.js} +67 -45
  85. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  86. package/chunk-NHDMQZJM.js +7881 -0
  87. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  88. package/{chunk-L5UXH3B2.js → chunk-NNCYNBYV.js} +22 -6
  89. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  90. package/chunk-NWENLDMM.js +42 -0
  91. package/{chunk-76WEAXJB.js → chunk-NZWAO6LH.js} +20 -17
  92. package/chunk-OCZKATRC.js +129 -0
  93. package/{chunk-N2WELJE7.js → chunk-OU36O6OR.js} +23 -28
  94. package/chunk-OW4APERY.js +870 -0
  95. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  96. package/{chunk-TVYSVSA2.js → chunk-P5L7VVMT.js} +11 -9
  97. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  98. package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
  99. package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
  100. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  101. package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
  102. package/chunk-TY3TIUJK.js +89 -0
  103. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  104. package/{chunk-RG6JBBX5.js → chunk-U7XXEI5R.js} +166 -13
  105. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  106. package/chunk-UJXNKP5V.js +760 -0
  107. package/{chunk-UKZDAFYT.js → chunk-UM4PH574.js} +6 -10
  108. package/{chunk-BLJWCTRL.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  110. package/{chunk-YQTQQX2H.js → chunk-V7Y6KRAH.js} +1 -1
  111. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  112. package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
  113. package/chunk-VIWDGTDA.js +8 -0
  114. package/chunk-VJVNU77E.js +83 -0
  115. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  116. package/{chunk-2FA3ITSX.js → chunk-W3RFFFFF.js} +873 -227
  117. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  118. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  119. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  120. package/{chunk-V4I3A7DR.js → chunk-WXHAOL7Y.js} +19 -17
  121. package/{chunk-FUUHG5LT.js → chunk-X2B2C4XD.js} +1 -1
  122. package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
  123. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  124. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  125. package/{chunk-QIAVMDHY.js → chunk-YPOPJAKN.js} +4 -4
  126. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  127. package/chunk-YV25TM3R.js +780 -0
  128. package/chunk-ZRAU6T47.js +56 -0
  129. package/commandRegistry-RZNZ37BN.js +833 -0
  130. package/{contentThunks-Y6FA2TCW.js → contentThunks-DF7ZNCAG.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-JXAFQO5V.js → createAgentAutomationAction-KPMOZ53Y.js} +38 -36
  133. package/createDialogAction-I2UDVAXN.js +69 -0
  134. package/{createPageAction-GUQDPKO5.js → createPageAction-IF5JXNKV.js} +45 -42
  135. package/{chunk-ZMD2CQFC.js → cursorProvider-YGGNMVWX.js} +2496 -9897
  136. package/{dbSlice-XVWBAGYN.js → dbSlice-Q25STFGJ.js} +11 -10
  137. package/{deleteFile-YG6QMJLU.js → deleteFile-AJ2EZMHT.js} +7 -6
  138. package/{dialogCommands-JJDASFIL.js → dialogCommands-LWHIIUQD.js} +49 -45
  139. package/{dialogSlice-J2YJNE6E.js → dialogSlice-74DFPFRV.js} +40 -33
  140. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  141. package/{docCreateCommands-OB3X3EQM.js → docCreateCommands-LVXQ6TNZ.js} +48 -43
  142. package/{docDeleteCommands-WMHRGF22.js → docDeleteCommands-7TVIGCLP.js} +49 -44
  143. package/{docReadCommands-NWGGLIAZ.js → docReadCommands-KYAXFLQ5.js} +47 -42
  144. package/{docStore-6KKYKAGQ.js → docStore-2JDRAYXJ.js} +16 -12
  145. package/{docUpdateCommands-3DDSOLPS.js → docUpdateCommands-TVC5KWPK.js} +48 -43
  146. package/{fetchMessages-EIU7UFFK.js → fetchMessages-I5ICDDHM.js} +5 -5
  147. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  148. package/{handleSendMessageAction-A4XLEEPU.js → handleSendMessageAction-54GY3XOH.js} +110 -86
  149. package/index.js +87 -884
  150. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
  151. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  152. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  153. package/{machineCommands-Y64KAIRW.js → machineCommands-54RNLVJE.js} +91 -81
  154. package/machineWsRunDispatch-WE3VTD57.js +154 -0
  155. package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.js} +20 -18
  156. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  157. package/oauthTokenStore-ITEB663N.js +23 -0
  158. package/package.json +1 -1
  159. package/pdf-U6KSUEZZ.js +26435 -0
  160. package/processSpawn-SOAV3FEV.js +11 -0
  161. package/profileConfig-ZGOFORWV.js +43 -0
  162. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  163. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  164. package/{read-COE3ZYR6.js → read-SRQMNO26.js} +7 -6
  165. package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
  166. package/{readlineWorkspace-45XNHFXU.js → readlineWorkspace-UK5M5CJI.js} +2704 -2060
  167. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  168. package/{runAgentClientLoop-ADZRHNG6.js → runAgentClientLoop-MTI5OU2W.js} +75 -69
  169. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  170. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  171. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
  172. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
  173. package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.js} +226 -940
  174. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  175. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  176. package/{spaceCommands-E7MQ4VU2.js → spaceCommands-446WWA73.js} +51 -46
  177. package/{streamAgentChatTurn-TUP7YO3H.js → streamAgentChatTurn-IANOWAKR.js} +199 -104
  178. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
  179. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  180. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  181. package/tools-WZZYTUNF.js +116 -0
  182. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
  183. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  184. package/{updateDialogTitleAction-KSWXWWFT.js → updateDialogTitleAction-Z2JTYLXD.js} +82 -44
  185. package/action-YVYQEAAV.js +0 -31
  186. package/agentListCommands-GATRXEMT.js +0 -406
  187. package/agentRecordCommands-GOC5K27T.js +0 -128
  188. package/agentRunCommand-JP2U3MQF.js +0 -155
  189. package/browser-image-compression-MFDTD7K6.js +0 -1763
  190. package/chatQueueReduxAdapter-5QOW43T4.js +0 -186
  191. package/chunk-DHDVZFNC.js +0 -18885
  192. package/chunk-M76ECQRD.js +0 -13658
  193. package/chunk-MEYIRKDN.js +0 -8967
  194. package/chunk-Q5FJJ6XI.js +0 -103
  195. package/chunk-S7Z2HMCN.js +0 -25
  196. package/chunk-Y5GCAMGP.js +0 -9
  197. package/chunk-YPREESF4.js +0 -225
  198. package/createDialogAction-O2QABXZF.js +0 -65
  199. package/machineWsRunDispatch-M366L2LJ.js +0 -144
  200. package/settingSlice-ZQZVUPKK.js +0 -204
  201. package/syncMapping-N6RGXGBW.js +0 -437
  202. package/tools-2VDNDFET.js +0 -110
  203. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  204. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  205. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -1,9 +1,13 @@
1
- import {
2
- fetchWithTransientRetry
3
- } from "./chunk-5UTFL4QJ.js";
4
1
  import {
5
2
  isGatewayHttpStatus
6
3
  } from "./chunk-NF64D32W.js";
4
+ import {
5
+ assembleAgentDiscoveryResult,
6
+ resolveDiscoveryScope
7
+ } from "./chunk-U7XXEI5R.js";
8
+ import {
9
+ fetchWithTransientRetry
10
+ } from "./chunk-AOTBKDRK.js";
7
11
  import {
8
12
  CORE_DRAIN_REASON,
9
13
  DRAIN_EXHAUSTED_USER_MESSAGE,
@@ -11,36 +15,26 @@ import {
11
15
  normalizeNonNegativeMs,
12
16
  parseRetryAfterHeaderMs
13
17
  } from "./chunk-3L2WKC3W.js";
14
- import {
15
- TASK_PREVIEW_MAX,
16
- buildDelegatedTaskContent,
17
- calculateDelegatedPayloadMetrics,
18
- formatListRunsCard,
19
- formatNotFoundRunCard,
20
- formatStartRunCard,
21
- formatStatusRunCard,
22
- formatStopRunCard,
23
- resolveRunLabel
24
- } from "./chunk-3VNWWVKB.js";
25
- import {
26
- omitNullishAgentSummaryFields,
27
- sortSafeAgentSummaries,
28
- summarizeCredentialGroups,
29
- toCompactAgentSummary,
30
- toSafeAgentSummary,
31
- toUnavailableAgentSummary
32
- } from "./chunk-RG6JBBX5.js";
33
18
  import {
34
19
  getUserDataItemTimestamp,
35
20
  mergeAndDedupUserData
36
- } from "./chunk-KQHGZWSV.js";
21
+ } from "./chunk-OXME3PEE.js";
22
+ import {
23
+ AGENT_UPDATE_FIELD_NAMES,
24
+ DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS,
25
+ DEFAULT_USER_PREFERENCE_PROFILE,
26
+ normalizeAgentUpdateFieldList,
27
+ normalizePolicyLevelSetting,
28
+ normalizeSystemBuiltinSkills,
29
+ normalizeTonePresetSetting
30
+ } from "./chunk-DZ7R5V3Y.js";
37
31
  import {
38
32
  readDocFunc,
39
33
  readDocFunctionSchema,
40
34
  readPageFunc,
41
35
  readPageFunctionSchema,
42
- slateToSimplifiedMarkdown
43
- } from "./chunk-J4MOO56S.js";
36
+ resolvePageReadMarkdown
37
+ } from "./chunk-GARACBQB.js";
44
38
  import {
45
39
  addMemberSpace,
46
40
  fetchAuthoritativeRemoteSpace,
@@ -52,7 +46,7 @@ import {
52
46
  setMembershipRejected,
53
47
  setSpaceInitialized,
54
48
  updateMemberSpaceName
55
- } from "./chunk-HJUYAD4A.js";
49
+ } from "./chunk-FJ5BGMNM.js";
56
50
  import {
57
51
  ToolApiError,
58
52
  buildToolRequestHeaders,
@@ -60,19 +54,19 @@ import {
60
54
  getRequestConfig,
61
55
  getToolBaseUrl,
62
56
  getToolRequestContext
63
- } from "./chunk-VLTIYV3X.js";
57
+ } from "./chunk-HP57OUJO.js";
64
58
  import {
65
59
  setDialogExtraReferencesAction
66
- } from "./chunk-UKZDAFYT.js";
60
+ } from "./chunk-UM4PH574.js";
67
61
  import {
68
62
  waitForAbortableDelay
69
63
  } from "./chunk-N4G4PKQ6.js";
70
64
  import {
71
65
  markdownToSlate
72
- } from "./chunk-FZGV4FGK.js";
66
+ } from "./chunk-NUHHBEJC.js";
73
67
  import {
74
68
  extractMentionsFromSlate
75
- } from "./chunk-MEYIRKDN.js";
69
+ } from "./chunk-AGIM7IMJ.js";
76
70
  import {
77
71
  slateToRenderMarkdown
78
72
  } from "./chunk-63W5N6P3.js";
@@ -81,10 +75,22 @@ import {
81
75
  } from "./chunk-VF4K2QE6.js";
82
76
  import {
83
77
  createDocState
84
- } from "./chunk-GZBATRJA.js";
78
+ } from "./chunk-B2DEZY6J.js";
85
79
  import {
86
80
  createDialogAction
87
- } from "./chunk-N2WELJE7.js";
81
+ } from "./chunk-OU36O6OR.js";
82
+ import {
83
+ TASK_PREVIEW_MAX,
84
+ buildDelegatedTaskContent,
85
+ calculateDelegatedPayloadMetrics,
86
+ formatAgentListCard,
87
+ formatListRunsCard,
88
+ formatNotFoundRunCard,
89
+ formatStartRunCard,
90
+ formatStatusRunCard,
91
+ formatStopRunCard,
92
+ resolveRunLabel
93
+ } from "./chunk-E3YWHWCR.js";
88
94
  import {
89
95
  DEFAULT_COLLAPSED_CATEGORIES,
90
96
  addContentToSpace,
@@ -102,7 +108,7 @@ import {
102
108
  updateContentCategory,
103
109
  updateContentTitle,
104
110
  writeStoredCollapsedCategories
105
- } from "./chunk-D2QT5FW4.js";
111
+ } from "./chunk-6XDD7N7P.js";
106
112
  import {
107
113
  getCurrentSpaceId,
108
114
  getCurrentSpaceIdRaw,
@@ -115,28 +121,28 @@ import {
115
121
  } from "./chunk-ZJ7UHBJS.js";
116
122
  import {
117
123
  deleteDialog,
118
- i18n_default,
119
124
  normalizeAppRouteId,
120
125
  resolveDialogRuntimeAgentKey,
126
+ runtime_default,
121
127
  selectAllMsgs,
122
128
  selectCurrentDialogConfig,
123
129
  selectCurrentDialogId,
124
130
  selectMsgById,
125
131
  uiAskChoiceFunc,
126
132
  uiAskChoiceFunctionSchema
127
- } from "./chunk-DHDVZFNC.js";
133
+ } from "./chunk-C4DVDM72.js";
128
134
  import {
129
135
  createAgent,
130
136
  deleteServerSyncedCredential,
131
137
  runLlm,
132
138
  streamAgentChatTurn,
133
139
  updateAgent
134
- } from "./chunk-TVYSVSA2.js";
140
+ } from "./chunk-P5L7VVMT.js";
135
141
  import {
136
142
  getActiveDialogKey,
137
143
  selectCurrentDialogKey,
138
144
  selectPendingRawDataByPageKey
139
- } from "./chunk-6YTOJY35.js";
145
+ } from "./chunk-BZ7NPA6G.js";
140
146
  import {
141
147
  require_react
142
148
  } from "./chunk-YDH3FDFQ.js";
@@ -145,10 +151,13 @@ import {
145
151
  resolveBuiltinCapability,
146
152
  resolveBuiltinSkillByName,
147
153
  resolveBuiltinSkillEntry
148
- } from "./chunk-JRQFUXY7.js";
154
+ } from "./chunk-VEYL5MO5.js";
149
155
  import {
150
156
  CAPABILITY_PACKS
151
- } from "./chunk-DHDMC6FO.js";
157
+ } from "./chunk-WCGC6S77.js";
158
+ import {
159
+ DEFAULT_SYSTEM_AGENT_CAPABILITIES
160
+ } from "./chunk-WJ3B6FX6.js";
152
161
  import {
153
162
  buildSkillDocMarkdown,
154
163
  normalizeSkillModalities,
@@ -156,7 +165,7 @@ import {
156
165
  parseExternalSkillMarkdown,
157
166
  parseSkillDocProtocol,
158
167
  resolvePageSkillMetadata
159
- } from "./chunk-Q554LLSI.js";
168
+ } from "./chunk-AUDNYVRC.js";
160
169
  import {
161
170
  DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
162
171
  NOLO_WORKSPACE_TOOL_NAMES,
@@ -173,39 +182,19 @@ import {
173
182
  redactAgentRecordForWorkspaceTool,
174
183
  resolveNoloDialogInput,
175
184
  verifyNoloDialogSubjectRefQuery
176
- } from "./chunk-IIVGDG4I.js";
177
- import {
178
- isAgentUnavailableNow
179
- } from "./chunk-FDTR4QJ6.js";
185
+ } from "./chunk-4YSOUKUR.js";
180
186
  import {
181
187
  buildDatabaseFileContentUrl
182
- } from "./chunk-DNCEALKX.js";
188
+ } from "./chunk-7MMSLEPA.js";
183
189
  import {
184
- DEFAULT_MODEL
185
- } from "./chunk-OIVSQH2O.js";
190
+ clipCompactText
191
+ } from "./chunk-5MMAK75Q.js";
186
192
  import {
187
193
  compactWhitespace
188
194
  } from "./chunk-DWLEOOGR.js";
189
195
  import {
190
196
  createFileCredentialBroker
191
- } from "./chunk-HVURBGF3.js";
192
- import {
193
- toErrorMessage
194
- } from "./chunk-HNMXYYJR.js";
195
- import {
196
- canonicalizeToolName,
197
- canonicalizeToolNames
198
- } from "./chunk-O6OSWFZQ.js";
199
- import {
200
- shareResourceAction
201
- } from "./chunk-BP4XNZRM.js";
202
- import {
203
- AGENT_UPDATE_FIELD_NAMES,
204
- normalizeAgentUpdateFieldList,
205
- selectAutoApproveSelfUpdateFields,
206
- selectCurrentServer,
207
- selectSyncServers
208
- } from "./chunk-AFUORTY4.js";
197
+ } from "./chunk-XFUBXRVI.js";
209
198
  import {
210
199
  asRecordOrEmpty
211
200
  } from "./chunk-KX6YBIHG.js";
@@ -213,7 +202,7 @@ import {
213
202
  UNCATEGORIZED_ID,
214
203
  addContentAction,
215
204
  checkSpaceMembership
216
- } from "./chunk-V4MJDUSR.js";
205
+ } from "./chunk-E73ON47R.js";
217
206
  import {
218
207
  createSpaceKey,
219
208
  normalizeSpaceId
@@ -223,12 +212,65 @@ import {
223
212
  read,
224
213
  readAndWait,
225
214
  readAndWaitAction,
215
+ readFileContentAction,
226
216
  remove,
227
217
  selectById,
228
218
  selectEntities,
229
219
  toTimestampMs,
230
220
  write
231
- } from "./chunk-H62HCIUP.js";
221
+ } from "./chunk-4FFUDT6D.js";
222
+ import {
223
+ canonicalizeToolName,
224
+ canonicalizeToolNames
225
+ } from "./chunk-XUWRURDF.js";
226
+ import {
227
+ CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
228
+ chromeConnectorToolSchemas,
229
+ chromeConnectorUnavailableFunc,
230
+ getChromeConnectorToolBehavior,
231
+ getChromeConnectorToolDefaultConsent
232
+ } from "./chunk-5J3PYNUP.js";
233
+ import {
234
+ DEFAULT_MODEL,
235
+ clampReasoningEffort,
236
+ resolveModelReasoningCapabilityWithCache
237
+ } from "./chunk-3BXNTXYI.js";
238
+ import {
239
+ toErrorMessage
240
+ } from "./chunk-HNMXYYJR.js";
241
+ import {
242
+ asTrimmedLowercaseString
243
+ } from "./chunk-QSJ3HFEF.js";
244
+ import {
245
+ readAction
246
+ } from "./chunk-PTDYOADJ.js";
247
+ import {
248
+ DEVICE_LOCAL_OWNER_ID,
249
+ getRuntimeServerContext,
250
+ isDeviceLocalOwnerId,
251
+ isDeviceLocalSpaceBody,
252
+ isDeviceLocalSpaceMembership,
253
+ resolveEffectiveSpaceActorId,
254
+ resolveRecordOwnerUserId,
255
+ selectRuntimeSnapshot
256
+ } from "./chunk-UJXNKP5V.js";
257
+ import {
258
+ buildTombstoneRecord,
259
+ isTombstoneRecord
260
+ } from "./chunk-D2MDMY2M.js";
261
+ import {
262
+ extractCustomId
263
+ } from "./chunk-M2EJHDJP.js";
264
+ import {
265
+ isRecord
266
+ } from "./chunk-KUG52IAP.js";
267
+ import {
268
+ shareResourceAction
269
+ } from "./chunk-W72ISAKC.js";
270
+ import {
271
+ selectCurrentServer,
272
+ selectSyncServers
273
+ } from "./chunk-NWENLDMM.js";
232
274
  import {
233
275
  SEPARATOR,
234
276
  TYPE_STORAGE_PREFIXES,
@@ -249,46 +291,23 @@ import {
249
291
  splitKey,
250
292
  toTrimmedString,
251
293
  ulid
252
- } from "./chunk-VMFTFOWF.js";
294
+ } from "./chunk-3AH7LNUB.js";
253
295
  import {
254
296
  asOptionalFiniteNumber
255
297
  } from "./chunk-WWC7I6TA.js";
256
298
  import {
257
- asTrimmedLowercaseString
258
- } from "./chunk-QSJ3HFEF.js";
259
- import {
260
- readAction
261
- } from "./chunk-WV42OMV7.js";
262
- import {
263
- extractCustomId
264
- } from "./chunk-M2EJHDJP.js";
265
- import {
266
- DEVICE_LOCAL_OWNER_ID,
267
299
  createAsyncThunk,
268
- getRuntimeServerContext,
269
- isDeviceLocalOwnerId,
270
- isDeviceLocalSpaceBody,
271
- isDeviceLocalSpaceMembership,
272
- noloWriteRequest,
273
- resolveEffectiveSpaceActorId,
274
- resolveRecordOwnerUserId,
275
- selectRuntimeSnapshot
276
- } from "./chunk-UKWGR5SS.js";
300
+ createSelector,
301
+ noloWriteRequest
302
+ } from "./chunk-VY6VFGKR.js";
277
303
  import {
278
304
  isAbortError
279
- } from "./chunk-QOKAKDPE.js";
305
+ } from "./chunk-HIM3FCLF.js";
280
306
  import {
281
307
  selectIdentityToken,
282
308
  selectIdentityUserBalance,
283
309
  selectIdentityUserId
284
310
  } from "./chunk-SEJ5OS6F.js";
285
- import {
286
- buildTombstoneRecord,
287
- isTombstoneRecord
288
- } from "./chunk-GBRG75BQ.js";
289
- import {
290
- isRecord
291
- } from "./chunk-KUG52IAP.js";
292
311
  import {
293
312
  asTrimmedString
294
313
  } from "./chunk-3EUW3WEO.js";
@@ -308,6 +327,69 @@ import {
308
327
  __toESM
309
328
  } from "./chunk-4VNS5WPM.js";
310
329
 
330
+ // packages/ai/tools/agentAutomationSchemas.ts
331
+ var agentAutomationTriggerSchema = {
332
+ oneOf: [
333
+ {
334
+ type: "object",
335
+ description: "Cron trigger.",
336
+ properties: {
337
+ type: { type: "string", enum: ["cron"] },
338
+ expression: {
339
+ type: "string",
340
+ description: "Cron expression, e.g. 0 9 * * *."
341
+ },
342
+ timezone: {
343
+ type: "string",
344
+ description: "Optional timezone, e.g. Asia/Shanghai."
345
+ }
346
+ },
347
+ required: ["type", "expression"],
348
+ additionalProperties: false
349
+ },
350
+ {
351
+ type: "object",
352
+ description: "Inbound email trigger. Cheap code-side filters are evaluated before starting an Agent run. Set acceptAll=true to fire on every inbound email. Otherwise provide at least one of fromContains, subjectContains, fromContainsAny, or subjectContainsAny \u2014 within a single field, *Any arrays are OR'd; across fields they are AND'd.",
353
+ properties: {
354
+ type: { type: "string", enum: ["email"] },
355
+ acceptAll: {
356
+ type: "boolean",
357
+ description: "When true the automation fires on every inbound email for the bound agent mailbox \u2014 no content filtering."
358
+ },
359
+ fromContains: {
360
+ type: "string",
361
+ description: "Case-insensitive substring match against sender email address."
362
+ },
363
+ subjectContains: {
364
+ type: "string",
365
+ description: "Case-insensitive substring match against email subject."
366
+ },
367
+ fromContainsAny: {
368
+ type: "array",
369
+ description: "OR'd substring match against sender email \u2014 matches if ANY listed needle appears in the From header.",
370
+ items: { type: "string" },
371
+ minItems: 1
372
+ },
373
+ subjectContainsAny: {
374
+ type: "array",
375
+ description: "OR'd substring match against email subject \u2014 matches if ANY listed needle appears in the Subject.",
376
+ items: { type: "string" },
377
+ minItems: 1
378
+ }
379
+ },
380
+ required: ["type"],
381
+ anyOf: [
382
+ { required: ["acceptAll"] },
383
+ { required: ["fromContains"] },
384
+ { required: ["subjectContains"] },
385
+ { required: ["fromContainsAny"] },
386
+ { required: ["subjectContainsAny"] }
387
+ ],
388
+ additionalProperties: false
389
+ }
390
+ ]
391
+ };
392
+
311
393
  // packages/ai/tools/modelUsageTools.ts
312
394
  var queryModelUsageFunctionSchema = {
313
395
  name: "queryModelUsage",
@@ -432,7 +514,7 @@ var queryUserGrowthReportFunctionSchema = {
432
514
  };
433
515
  var createAgentAutomationFunctionSchema = {
434
516
  name: "createAgentAutomation",
435
- description: "\u521B\u5EFA\u4E00\u4E2A\u957F\u671F agent automation \u89C4\u5219\u3002\u9002\u5408\u8BA9 agent \u6309 cron \u5B9A\u65F6\u68C0\u67E5\u7528\u91CF\u3001\u751F\u6210\u62A5\u544A\u6216\u6267\u884C\u63D0\u9192\uFF1B\u53EF\u9009\u62E9\u521B\u5EFA\u540E\u7ACB\u523B\u8BD5\u8FD0\u884C\u4E00\u6B21\u3002",
517
+ description: "\u521B\u5EFA\u957F\u671F agent automation\u3002\u652F\u6301 cron \u5B9A\u65F6\u89E6\u53D1\uFF0C\u4EE5\u53CA\u65B0\u90AE\u4EF6\u4E8B\u4EF6\u89E6\u53D1\uFF08\u53EF\u8BBE acceptAll \u63A5\u6536\u5168\u90E8\u90AE\u4EF6\uFF0C\u6216\u6309\u53D1\u4EF6\u4EBA/\u4E3B\u9898\u8FC7\u6EE4\uFF1B*Any \u6570\u7EC4\u5B57\u6BB5\u5185\u90E8 OR\u3001\u5B57\u6BB5\u4E4B\u95F4 AND\uFF09\u3002email \u89E6\u53D1\u53EA\u5728\u4EE3\u7801\u8FC7\u6EE4\u547D\u4E2D\u540E\u542F\u52A8\u540E\u53F0 Agent run\u3002",
436
518
  parameters: {
437
519
  type: "object",
438
520
  properties: {
@@ -442,29 +524,9 @@ var createAgentAutomationFunctionSchema = {
442
524
  },
443
525
  instruction: {
444
526
  type: "string",
445
- description: "automation \u6BCF\u6B21\u6267\u884C\u65F6\u4EA4\u7ED9 agent \u7684\u5B8C\u6574\u4EFB\u52A1\u63CF\u8FF0\uFF0C\u5E94\u5305\u542B\u68C0\u67E5\u6761\u4EF6\u548C\u901A\u77E5\u65B9\u5F0F\u3002"
446
- },
447
- trigger: {
448
- type: "object",
449
- description: "\u89E6\u53D1\u89C4\u5219\u3002v0 \u53EA\u652F\u6301 cron\u3002",
450
- properties: {
451
- type: {
452
- type: "string",
453
- enum: ["cron"],
454
- description: "\u89E6\u53D1\u7C7B\u578B\u3002v0 \u53EA\u652F\u6301 cron\u3002"
455
- },
456
- expression: {
457
- type: "string",
458
- description: "cron \u8868\u8FBE\u5F0F\uFF0C\u4F8B\u5982\u6BCF\u5929 09:00 \u6267\u884C\u4E3A 0 9 * * *\u3002"
459
- },
460
- timezone: {
461
- type: "string",
462
- description: "\u53EF\u9009\u65F6\u533A\uFF0C\u4F8B\u5982 Asia/Shanghai\u3002"
463
- }
464
- },
465
- required: ["type", "expression"],
466
- additionalProperties: false
527
+ description: "automation \u6BCF\u6B21\u6267\u884C\u65F6\u4EA4\u7ED9 agent \u7684\u5B8C\u6574\u4EFB\u52A1\u63CF\u8FF0\uFF0C\u5E94\u5305\u542B\u5904\u7406\u76EE\u6807\u548C\u5FC5\u8981\u7684\u901A\u77E5\u65B9\u5F0F\u3002"
467
528
  },
529
+ trigger: agentAutomationTriggerSchema,
468
530
  ownerAgentKey: {
469
531
  type: "string",
470
532
  description: "\u6267\u884C\u8BE5 automation \u7684 agentKey\u3002\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D agent\u3002"
@@ -489,13 +551,64 @@ var createAgentAutomationFunctionSchema = {
489
551
  },
490
552
  runOnceNow: {
491
553
  type: "boolean",
492
- description: "\u521B\u5EFA\u540E\u662F\u5426\u7ACB\u5373\u6267\u884C\u4E00\u6B21\uFF0C\u7528\u6765\u9A8C\u8BC1 automation \u4F1A\u4EA7\u751F\u4EC0\u4E48\u7ED3\u679C\u3002",
554
+ description: "cron \u521B\u5EFA\u540E\u53EF\u7ACB\u5373\u8BD5\u8FD0\u884C\uFF1Bemail trigger \u4E0D\u652F\u6301\uFF0C\u56E0\u4E3A\u521B\u5EFA\u65F6\u6CA1\u6709\u89E6\u53D1\u90AE\u4EF6\u4E0A\u4E0B\u6587\u3002",
493
555
  default: false
494
556
  }
495
557
  },
496
558
  required: ["instruction", "trigger"]
497
559
  }
498
560
  };
561
+ var updateAgentAutomationFunctionSchema = {
562
+ name: "updateAgentAutomation",
563
+ description: "\u90E8\u5206\u66F4\u65B0\u4E00\u4E2A agent automation\u3002\u53EA\u5141\u8BB8 owner user\uFF08automation \u521B\u5EFA\u8005\uFF09\u4E14 owner agent\uFF08automation \u7684 ownerAgentKey\uFF09\u8C03\u7528\u3002\u53EF\u66F4\u65B0\u5B57\u6BB5\uFF1Atitle\u3001instruction\u3001status\uFF08active/paused\uFF09\u3001trigger\uFF08email trigger \u4F1A\u88AB\u91CD\u65B0\u5F52\u4E00\u5316\uFF09\u3001spaceId\u3001subjectRefs\u3002\u4E0D\u53EF\u66F4\u65B0\uFF1Aid\u3001dbKey\u3001ownerAgentKey\u3001createdBy\u3001createdAt\u3001runStatus\u3002",
564
+ parameters: {
565
+ type: "object",
566
+ properties: {
567
+ automationKey: {
568
+ type: "string",
569
+ description: "automation \u7684 dbKey\uFF08agent-automation-{userId}-{id}\uFF09\u3002"
570
+ },
571
+ title: { type: "string", description: "\u65B0\u6807\u9898\u3002" },
572
+ instruction: { type: "string", description: "\u65B0 instruction\u3002" },
573
+ status: {
574
+ type: "string",
575
+ enum: ["active", "paused"],
576
+ description: "automation \u72B6\u6001\u3002paused \u65F6 dispatcher \u4E0D\u518D\u89E6\u53D1 run\u3002"
577
+ },
578
+ trigger: agentAutomationTriggerSchema,
579
+ spaceId: { type: "string", description: "\u65B0\u7684 spaceId\uFF1B\u4F20\u7A7A\u5B57\u7B26\u4E32\u6E05\u9664\u3002" },
580
+ subjectRefs: {
581
+ type: "array",
582
+ description: "\u65B0\u7684 subjectRefs\uFF1B\u4F20\u7A7A\u6570\u7EC4\u6E05\u9664\u3002",
583
+ items: {
584
+ type: "object",
585
+ properties: {
586
+ kind: { type: "string" },
587
+ id: { type: "string" },
588
+ role: { type: "string" }
589
+ },
590
+ required: ["kind", "id"],
591
+ additionalProperties: true
592
+ }
593
+ }
594
+ },
595
+ required: ["automationKey"]
596
+ }
597
+ };
598
+ var deleteAgentAutomationFunctionSchema = {
599
+ name: "deleteAgentAutomation",
600
+ description: "\u5220\u9664\u4E00\u4E2A agent automation\uFF08\u542B owner index\uFF09\u3002\u53EA\u5141\u8BB8 owner user\uFF08automation \u521B\u5EFA\u8005\uFF09\u4E14 owner agent \u8C03\u7528\u3002\u91CD\u590D\u5220\u9664\u5DF2\u4E0D\u5B58\u5728\u7684 automation \u8FD4\u56DE deleted:false, reason:not_found \u2014\u2014 \u662F\u5E42\u7B49 no-op\u3002",
601
+ parameters: {
602
+ type: "object",
603
+ properties: {
604
+ automationKey: {
605
+ type: "string",
606
+ description: "automation \u7684 dbKey\uFF08agent-automation-{userId}-{id}\uFF09\u3002"
607
+ }
608
+ },
609
+ required: ["automationKey"]
610
+ }
611
+ };
499
612
  var notifyUserFunctionSchema = {
500
613
  name: "notifyUser",
501
614
  description: "\u53D1\u9001\u4E00\u6761\u7AD9\u5185\u901A\u77E5\u7ED9\u5F53\u524D\u7528\u6237\u3002\u7B2C\u4E00\u7248\u53EA\u652F\u6301\u7AD9\u5185\u901A\u77E5\uFF0C\u540E\u7EED\u53EF\u6269\u5C55\u90AE\u4EF6\u3001\u684C\u9762\u7AEF\u3001\u7F51\u9875\u548C\u79FB\u52A8\u7AEF\u901A\u77E5\u3002",
@@ -537,6 +650,8 @@ var serverOnlyResult = (toolName) => ({
537
650
  var queryModelUsageFunc = async () => serverOnlyResult("queryModelUsage");
538
651
  var queryUserGrowthReportFunc = async () => serverOnlyResult("queryUserGrowthReport");
539
652
  var createAgentAutomationFunc = async () => serverOnlyResult("createAgentAutomation");
653
+ var updateAgentAutomationFunc = async () => serverOnlyResult("updateAgentAutomation");
654
+ var deleteAgentAutomationFunc = async () => serverOnlyResult("deleteAgentAutomation");
540
655
  var notifyUserFunc = async () => serverOnlyResult("notifyUser");
541
656
 
542
657
  // packages/ai/tools/toolResultError.ts
@@ -710,6 +825,22 @@ var buildPatch = (args) => {
710
825
  if (reasoning_effort !== void 0) patch2.reasoning_effort = reasoning_effort;
711
826
  return patch2;
712
827
  };
828
+ var calibrateReasoningEffortInPatch = (patch2, previousAgent) => {
829
+ if (patch2.reasoning_effort === void 0) return void 0;
830
+ const provider = patch2.provider ?? previousAgent.provider ?? void 0;
831
+ const model = patch2.model ?? previousAgent.model ?? void 0;
832
+ const cap = resolveModelReasoningCapabilityWithCache(provider, model);
833
+ if (!cap.found) return void 0;
834
+ const requested = String(patch2.reasoning_effort);
835
+ const calibrated = clampReasoningEffort(requested, provider ?? null, model ?? null);
836
+ if (!calibrated) {
837
+ delete patch2.reasoning_effort;
838
+ return `\u26A0\uFE0F \u6A21\u578B ${model ?? "\u5F53\u524D\u6A21\u578B"} \u4E0D\u652F\u6301\u63A8\u7406\u5F3A\u5EA6\u8BBE\u7F6E\uFF0C\u5DF2\u5FFD\u7565 reasoning_effort=${requested}\u3002`;
839
+ }
840
+ patch2.reasoning_effort = calibrated;
841
+ if (calibrated === requested) return void 0;
842
+ return `\u2139\uFE0F reasoning_effort \u5DF2\u6309 ${model ?? "\u5F53\u524D\u6A21\u578B"} \u7684\u771F\u5B9E\u6863\u4F4D\u4ECE "${requested}" \u5438\u9644\u4E3A "${calibrated}"\u3002`;
843
+ };
713
844
  var AGENT_UPDATE_FIELD_NAME_SET = new Set(AGENT_UPDATE_FIELD_NAMES);
714
845
  var listRequestedFields = (args) => Object.keys(args).filter(
715
846
  (key) => key !== "agentId" && key !== "__confirmedSelfEvolution" && AGENT_UPDATE_FIELD_NAME_SET.has(key) && args[key] !== void 0
@@ -911,7 +1042,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
911
1042
  workspace: { mode: "lease" }
912
1043
  };
913
1044
  var findModelConfig = async (modelName, provider) => {
914
- const { ALL_MODELS } = await import("./models-T3SG6MJ5.js");
1045
+ const { ALL_MODELS } = await import("./models-ZPU5EDF4.js");
915
1046
  const name = toTrimmedString(modelName);
916
1047
  const prov = toTrimmedString(provider ?? "");
917
1048
  if (!name) return null;
@@ -936,21 +1067,21 @@ var findModelConfig = async (modelName, provider) => {
936
1067
  };
937
1068
  var createAgentToolFunctionSchema = {
938
1069
  name: "createAgent",
939
- description: i18n_default.t("tools.createAgent.description"),
1070
+ description: runtime_default.t("tools.createAgent.description"),
940
1071
  parameters: {
941
1072
  type: "object",
942
1073
  properties: {
943
1074
  name: {
944
1075
  type: "string",
945
- description: i18n_default.t("tools.createAgent.params.name")
1076
+ description: runtime_default.t("tools.createAgent.params.name")
946
1077
  },
947
1078
  model: {
948
1079
  type: "string",
949
- description: i18n_default.t("tools.createAgent.params.model")
1080
+ description: runtime_default.t("tools.createAgent.params.model")
950
1081
  },
951
1082
  provider: {
952
1083
  type: "string",
953
- description: i18n_default.t("tools.createAgent.params.provider")
1084
+ description: runtime_default.t("tools.createAgent.params.provider")
954
1085
  },
955
1086
  apiSource: {
956
1087
  type: "string",
@@ -959,36 +1090,36 @@ var createAgentToolFunctionSchema = {
959
1090
  },
960
1091
  prompt: {
961
1092
  type: "string",
962
- description: i18n_default.t("tools.createAgent.params.prompt")
1093
+ description: runtime_default.t("tools.createAgent.params.prompt")
963
1094
  },
964
1095
  introduction: {
965
1096
  type: "string",
966
- description: i18n_default.t("tools.createAgent.params.introduction")
1097
+ description: runtime_default.t("tools.createAgent.params.introduction")
967
1098
  },
968
1099
  greeting: {
969
- description: i18n_default.t("tools.createAgent.params.greeting.desc"),
1100
+ description: runtime_default.t("tools.createAgent.params.greeting.desc"),
970
1101
  anyOf: [
971
1102
  {
972
1103
  type: "string",
973
- description: i18n_default.t(
1104
+ description: runtime_default.t(
974
1105
  "tools.createAgent.params.greeting.stringDesc"
975
1106
  )
976
1107
  },
977
1108
  {
978
1109
  type: "object",
979
- description: i18n_default.t(
1110
+ description: runtime_default.t(
980
1111
  "tools.createAgent.params.greeting.objectDesc"
981
1112
  ),
982
1113
  properties: {
983
1114
  text: {
984
1115
  type: "string",
985
- description: i18n_default.t(
1116
+ description: runtime_default.t(
986
1117
  "tools.createAgent.params.greeting.texts.text"
987
1118
  )
988
1119
  },
989
1120
  menu: {
990
1121
  type: "array",
991
- description: i18n_default.t(
1122
+ description: runtime_default.t(
992
1123
  "tools.createAgent.params.greeting.menu.desc"
993
1124
  ),
994
1125
  items: {
@@ -996,19 +1127,19 @@ var createAgentToolFunctionSchema = {
996
1127
  properties: {
997
1128
  id: {
998
1129
  type: "string",
999
- description: i18n_default.t(
1130
+ description: runtime_default.t(
1000
1131
  "tools.createAgent.params.greeting.menu.id"
1001
1132
  )
1002
1133
  },
1003
1134
  label: {
1004
1135
  type: "string",
1005
- description: i18n_default.t(
1136
+ description: runtime_default.t(
1006
1137
  "tools.createAgent.params.greeting.menu.label"
1007
1138
  )
1008
1139
  },
1009
1140
  userMessage: {
1010
1141
  type: "string",
1011
- description: i18n_default.t(
1142
+ description: runtime_default.t(
1012
1143
  "tools.createAgent.params.greeting.menu.userMessage"
1013
1144
  )
1014
1145
  }
@@ -1022,21 +1153,21 @@ var createAgentToolFunctionSchema = {
1022
1153
  },
1023
1154
  isPublic: {
1024
1155
  type: "boolean",
1025
- description: i18n_default.t("tools.createAgent.params.isPublic")
1156
+ description: runtime_default.t("tools.createAgent.params.isPublic")
1026
1157
  },
1027
1158
  allowFork: {
1028
1159
  type: "boolean",
1029
- description: i18n_default.t("tools.createAgent.params.allowFork")
1160
+ description: runtime_default.t("tools.createAgent.params.allowFork")
1030
1161
  },
1031
1162
  tags: {
1032
1163
  type: "array",
1033
1164
  items: { type: "string" },
1034
- description: i18n_default.t("tools.createAgent.params.tags")
1165
+ description: runtime_default.t("tools.createAgent.params.tags")
1035
1166
  },
1036
1167
  tools: {
1037
1168
  type: "array",
1038
1169
  items: { type: "string" },
1039
- description: i18n_default.t("tools.createAgent.params.tools")
1170
+ description: runtime_default.t("tools.createAgent.params.tools")
1040
1171
  },
1041
1172
  disabledTools: {
1042
1173
  type: "array",
@@ -1054,26 +1185,26 @@ var createAgentToolFunctionSchema = {
1054
1185
  },
1055
1186
  references: {
1056
1187
  type: "array",
1057
- description: i18n_default.t("tools.createAgent.params.references.desc"),
1188
+ description: runtime_default.t("tools.createAgent.params.references.desc"),
1058
1189
  items: {
1059
1190
  type: "object",
1060
1191
  properties: {
1061
1192
  dbKey: {
1062
1193
  type: "string",
1063
- description: i18n_default.t(
1194
+ description: runtime_default.t(
1064
1195
  "tools.createAgent.params.references.dbKey"
1065
1196
  )
1066
1197
  },
1067
1198
  title: {
1068
1199
  type: "string",
1069
- description: i18n_default.t(
1200
+ description: runtime_default.t(
1070
1201
  "tools.createAgent.params.references.title"
1071
1202
  )
1072
1203
  },
1073
1204
  type: {
1074
1205
  type: "string",
1075
1206
  enum: ["knowledge", "instruction", "page"],
1076
- description: i18n_default.t(
1207
+ description: runtime_default.t(
1077
1208
  "tools.createAgent.params.references.type"
1078
1209
  )
1079
1210
  }
@@ -1084,36 +1215,36 @@ var createAgentToolFunctionSchema = {
1084
1215
  linkedSpaces: {
1085
1216
  type: "array",
1086
1217
  items: { type: "string" },
1087
- description: i18n_default.t("tools.createAgent.params.linkedSpaces")
1218
+ description: runtime_default.t("tools.createAgent.params.linkedSpaces")
1088
1219
  },
1089
1220
  temperature: {
1090
1221
  type: "number",
1091
- description: i18n_default.t("tools.createAgent.params.temperature")
1222
+ description: runtime_default.t("tools.createAgent.params.temperature")
1092
1223
  },
1093
1224
  top_p: {
1094
1225
  type: "number",
1095
- description: i18n_default.t("tools.createAgent.params.top_p")
1226
+ description: runtime_default.t("tools.createAgent.params.top_p")
1096
1227
  },
1097
1228
  frequency_penalty: {
1098
1229
  type: "number",
1099
- description: i18n_default.t(
1230
+ description: runtime_default.t(
1100
1231
  "tools.createAgent.params.frequency_penalty"
1101
1232
  )
1102
1233
  },
1103
1234
  presence_penalty: {
1104
1235
  type: "number",
1105
- description: i18n_default.t(
1236
+ description: runtime_default.t(
1106
1237
  "tools.createAgent.params.presence_penalty"
1107
1238
  )
1108
1239
  },
1109
1240
  max_tokens: {
1110
1241
  type: "number",
1111
- description: i18n_default.t("tools.createAgent.params.max_tokens")
1242
+ description: runtime_default.t("tools.createAgent.params.max_tokens")
1112
1243
  },
1113
1244
  reasoning_effort: {
1114
1245
  type: "string",
1115
1246
  enum: ["low", "medium", "high"],
1116
- description: i18n_default.t(
1247
+ description: runtime_default.t(
1117
1248
  "tools.createAgent.params.reasoning_effort"
1118
1249
  )
1119
1250
  }
@@ -1156,7 +1287,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
1156
1287
  const trimmedModel = toTrimmedString(model);
1157
1288
  const trimmedProvider = toTrimmedString(provider);
1158
1289
  const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
1159
- const { getModelPricing } = await import("./getPricing-LUSEABA6.js");
1290
+ const { getModelPricing } = await import("./getPricing-NMMFT3YI.js");
1160
1291
  const normalizedTools = tools ?? [];
1161
1292
  const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
1162
1293
  const formData = {
@@ -1292,6 +1423,7 @@ ${availableList}`
1292
1423
  formData = await buildPlatformFormDataFromArgs(args);
1293
1424
  formData.linkedSpaces = resolvedLinkedSpaces;
1294
1425
  }
1426
+ const effortNote = calibrateReasoningEffortInPatch(formData, formData);
1295
1427
  const expectedProviderConfig = getForkedAgentProviderExpectation(formData);
1296
1428
  try {
1297
1429
  const agent = await thunkApi.dispatch(
@@ -1337,6 +1469,9 @@ ${availableList}`
1337
1469
  if (typeof currentBalance === "number") {
1338
1470
  lines.push(`- \u5F53\u524D\u4F59\u989D: ${currentBalance}`);
1339
1471
  }
1472
+ if (effortNote) {
1473
+ lines.push(effortNote);
1474
+ }
1340
1475
  return {
1341
1476
  rawData: agent,
1342
1477
  displayData: lines.join("\n")
@@ -1379,6 +1514,7 @@ async function updateAgentToolFunc(args, thunkApi) {
1379
1514
  }
1380
1515
  const agentId = extractAgentId(dbKey);
1381
1516
  const formData = buildPatch(args);
1517
+ const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
1382
1518
  const requestedFields = listRequestedFields(args);
1383
1519
  assertAgentUpdateConfirmation({
1384
1520
  scope: "generic",
@@ -1401,7 +1537,8 @@ async function updateAgentToolFunc(args, thunkApi) {
1401
1537
  );
1402
1538
  return {
1403
1539
  rawData: rawDataWithUpdateInfo,
1404
- displayData: formatUpdatedAgentOutput(agent)
1540
+ displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
1541
+ ${effortNote}` : "")
1405
1542
  };
1406
1543
  }
1407
1544
 
@@ -3259,7 +3396,7 @@ async function readFunc(args, thunkApi, context) {
3259
3396
  }
3260
3397
  if (dbKey.startsWith("PAGE-") || result.type === "page" /* DOC */) {
3261
3398
  const pageData = result;
3262
- const markdownContent = slateToSimplifiedMarkdown(pageData.slateData || []);
3399
+ const markdownContent = resolvePageReadMarkdown(pageData);
3263
3400
  return {
3264
3401
  rawData: {
3265
3402
  ...pageData,
@@ -3397,92 +3534,6 @@ async function listUserSpacesFunc(args, thunkApi, context) {
3397
3534
  }
3398
3535
  }
3399
3536
 
3400
- // packages/ai/agent/agentDiscovery.ts
3401
- function isPreferredAgent(agent) {
3402
- return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
3403
- }
3404
- function isPublicDiscoveryAgent(agent) {
3405
- return agent.isPublic === true && !isPreferredAgent(agent);
3406
- }
3407
- function resolveDiscoveryScope(args) {
3408
- const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
3409
- const hasScope = rawScope !== void 0 && rawScope !== "";
3410
- const hasPublicOnly = typeof args?.publicOnly === "boolean";
3411
- const publicOnly = args?.publicOnly === true;
3412
- if (hasScope) {
3413
- if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
3414
- throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
3415
- }
3416
- const scope = rawScope;
3417
- if (hasPublicOnly) {
3418
- if (publicOnly && scope !== "public") {
3419
- throw new Error(
3420
- `Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
3421
- );
3422
- }
3423
- if (!publicOnly && scope === "public") {
3424
- throw new Error(
3425
- `Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
3426
- );
3427
- }
3428
- }
3429
- return scope;
3430
- }
3431
- if (hasPublicOnly && publicOnly) {
3432
- return "public";
3433
- }
3434
- return "preferred";
3435
- }
3436
- function agentIdentityKeys(agent) {
3437
- return [agent.agentKey, agent.publicKey, agent.id].filter(
3438
- (key) => typeof key === "string" && key.length > 0
3439
- );
3440
- }
3441
- function deduplicateAgentSummaries(agents) {
3442
- const byIdentity = /* @__PURE__ */ new Map();
3443
- for (const agent of agents) {
3444
- const keys = agentIdentityKeys(agent);
3445
- const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
3446
- if (!existing) {
3447
- for (const key of keys) byIdentity.set(key, agent);
3448
- continue;
3449
- }
3450
- const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
3451
- for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
3452
- }
3453
- return [...new Set(byIdentity.values())];
3454
- }
3455
- function filterAgentsByScope(agents, scope) {
3456
- const unique = deduplicateAgentSummaries(agents);
3457
- if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
3458
- if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
3459
- return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
3460
- }
3461
- function buildAgentDiscoveryResult(options) {
3462
- const scope = resolveDiscoveryScope({
3463
- scope: options.scope,
3464
- publicOnly: options.publicOnly
3465
- });
3466
- const now = options.now ?? Date.now();
3467
- let scopedAgents = filterAgentsByScope(options.agents, scope);
3468
- const unavailableList = scopedAgents.filter((a) => isAgentUnavailableNow(a, now));
3469
- const unavailableCount = unavailableList.length;
3470
- const unavailableAgents = sortSafeAgentSummaries(unavailableList).map(toUnavailableAgentSummary);
3471
- const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
3472
- if (options.showUnavailable !== true) {
3473
- scopedAgents = scopedAgents.filter((a) => !isAgentUnavailableNow(a, now));
3474
- }
3475
- const sortedAgents = sortSafeAgentSummaries(scopedAgents);
3476
- const projectedAgents = options.verbose === true ? sortedAgents.map(omitNullishAgentSummaryFields) : sortedAgents.map(toCompactAgentSummary);
3477
- return {
3478
- total: projectedAgents.length,
3479
- unavailableCount,
3480
- unavailableAgents,
3481
- credentialGroups,
3482
- agents: projectedAgents
3483
- };
3484
- }
3485
-
3486
3537
  // packages/ai/agent/publicAgentDiscovery.ts
3487
3538
  async function fetchPublicAgentsForDiscovery(args) {
3488
3539
  const fetchImpl = args.fetchImpl ?? fetch;
@@ -3945,7 +3996,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3945
3996
  const deletedDialogIds = [];
3946
3997
  const deletedDialogKeys = [];
3947
3998
  const failures = [];
3948
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-J2YJNE6E.js");
3999
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-74DFPFRV.js");
3949
4000
  for (const target of targets) {
3950
4001
  try {
3951
4002
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -4009,24 +4060,6 @@ async function fetchUserFavoriteAgentMap(thunkApi) {
4009
4060
  return {};
4010
4061
  }
4011
4062
  }
4012
- function formatAgentListCard(agents, maxDisplay = 8) {
4013
- const total = agents.length;
4014
- const lines = [`Agents (${total})`];
4015
- const visible = agents.slice(0, maxDisplay);
4016
- for (const agent of visible) {
4017
- const star = agent.isFavorite ? "\u2605" : " ";
4018
- const own = agent.isOwned ? "\u25CE" : " ";
4019
- const name = agent.name || "(unnamed)";
4020
- const model = agent.model || "\u2014";
4021
- const source = agent.apiSource || agent.provider || agent.cliProvider || "\u2014";
4022
- const key = agent.agentKey || "(agentKey unavailable)";
4023
- lines.push(`${star}${own} ${name} ${model} ${source} ${key}`);
4024
- }
4025
- if (total > maxDisplay) {
4026
- lines.push(`\u2026 +${total - maxDisplay} more`);
4027
- }
4028
- return lines.join("\n");
4029
- }
4030
4063
  var listAgentsFunctionSchema = {
4031
4064
  name: "listAgents",
4032
4065
  description: "List Nolo agents available for delegation as safe summaries. By default (scope='preferred'), returns the user's preferred agents (favorites, self-owned, OAuth subscriptions, custom API, and local agents). Note: favorited public agents stay in preferred and may still consume platform credits - check each agent's billingSource before dispatching. If no suitable preferred candidate is found or the user explicitly asks to explore public/shared agents, call with scope='public' (public agents may consume platform credits). scope='all' returns the deduplicated union for troubleshooting/management. listAgents does not automatically fallback to public agents. The payload returns `credentialGroups` summarizing independent credential capacities (credentialGroup, credentialKind, agentCount, and availableAt recovery timestamps). Orchestration discipline: Never fan out parallel runs on one credential; fan out only across distinct credentialGroups. A channel verdict is valid for the current dispatch attempt only; always re-read availability before dispatching, and never reuse a failure verdict from an earlier attempt. On config_unresolved-class errors, retry once before degrading. Reserve the strongest private channels for review; execution should use cheap channels. The `agents` array carries a compact agent-selection projection per agent: runnable `agentKey` (agent-<userId>-<id> owned, agent-pub-<id> public), name, model, provider, apiSource, billingSource ('user_subscription' | 'owner_subscription' | 'user_api' | 'platform_credits' | 'local'), tools, isFavorite, isOAuth, isOwned, isPublic, credentialGroup, credentialKind. Copy `agentKey` verbatim into startAgentRun. Rate-limited agents (429, nextAvailableAt in the future) are hidden by default; unavailableCount and unavailableAgents carry their nextAvailableAt recovery timestamps; pass `showUnavailable: true` to include them. Set `verbose: true` for full safe summary details.",
@@ -4041,6 +4074,10 @@ var listAgentsFunctionSchema = {
4041
4074
  },
4042
4075
  publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
4043
4076
  showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
4077
+ query: {
4078
+ type: "string",
4079
+ description: "Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey. Use to locate specific candidates like 'opus', 'devin', or 'claude'."
4080
+ },
4044
4081
  verbose: { type: "boolean", description: "Return the full safe-summary field set (prices, introduction, modelAbility, timestamps) for troubleshooting. Default false returns the compact agent-selection projection." }
4045
4082
  }
4046
4083
  }
@@ -4083,16 +4120,15 @@ async function listAgentsFunc(args, thunkApi) {
4083
4120
  }
4084
4121
  }
4085
4122
  const userId = runtime?.currentUserId ?? void 0;
4086
- const agents = [...Array.from(recordsMap.values()), ...publicRecords].map(
4087
- (record) => toSafeAgentSummary(record, {
4123
+ const discovery = assembleAgentDiscoveryResult({
4124
+ records: [...Array.from(recordsMap.values()), ...publicRecords],
4125
+ summaryOptions: (record) => ({
4088
4126
  favoritesMap,
4089
4127
  userId,
4090
4128
  publicRecordExists: publicRecords.includes(record) ? true : void 0
4091
- })
4092
- );
4093
- const discovery = buildAgentDiscoveryResult({
4094
- agents,
4129
+ }),
4095
4130
  scope: args?.scope,
4131
+ query: args?.query,
4096
4132
  publicOnly: args?.publicOnly,
4097
4133
  showUnavailable: args?.showUnavailable,
4098
4134
  verbose: args?.verbose
@@ -4123,6 +4159,30 @@ var readAgentFunctionSchema = {
4123
4159
  required: ["agent"]
4124
4160
  }
4125
4161
  };
4162
+ function formatReadAgentCard(agentKey, record) {
4163
+ if (!isRecord(record)) {
4164
+ return jsonPreview({ agentKey, record });
4165
+ }
4166
+ const name = asTrimmedString(record.name) || "(\u672A\u547D\u540D Agent)";
4167
+ const model = asTrimmedString(record.model) || "\u2014";
4168
+ const provider = asTrimmedString(record.provider) || asTrimmedString(record.apiSource) || "\u2014";
4169
+ const apiSource = asTrimmedString(record.apiSource) || "\u2014";
4170
+ const isPublic = record.isPublic === true ? "\u516C\u5F00" : "\u79C1\u6709";
4171
+ const tools = Array.isArray(record.tools) && record.tools.length > 0 ? record.tools.map((t) => String(t)).join(", ") : "\u65E0\u81EA\u5B9A\u4E49\u5DE5\u5177 (\u9ED8\u8BA4\u57FA\u7840\u5DE5\u4F5C\u533A\u80FD\u529B)";
4172
+ const lines = [
4173
+ `\u{1F916} Agent: ${name} (${agentKey})`,
4174
+ `\u2022 \u6A21\u578B: ${model} (${provider})`,
4175
+ `\u2022 \u6765\u6E90: ${apiSource} \xB7 ${isPublic}`,
4176
+ `\u2022 \u5DE5\u5177: ${tools}`
4177
+ ];
4178
+ if (typeof record.customProviderUrl === "string" && record.customProviderUrl.trim()) {
4179
+ lines.push(`\u2022 \u7AEF\u70B9: ${record.customProviderUrl.trim()}`);
4180
+ }
4181
+ if (typeof record.prompt === "string" && record.prompt.trim()) {
4182
+ lines.push(`\u2022 \u63D0\u793A\u8BCD: ${clipCompactText(record.prompt.trim(), 200)}`);
4183
+ }
4184
+ return lines.join("\n");
4185
+ }
4126
4186
  async function readAgentFunc(args, thunkApi) {
4127
4187
  const runtime = getRuntime2(thunkApi);
4128
4188
  const userId = runtime?.currentUserId;
@@ -4134,16 +4194,14 @@ async function readAgentFunc(args, thunkApi) {
4134
4194
  for (const candidate of candidates) {
4135
4195
  const record = await readBestRecord(thunkApi, candidate, true);
4136
4196
  if (record) {
4197
+ const redacted = redactAgentRecordForWorkspaceTool(record);
4137
4198
  return {
4138
4199
  rawData: {
4139
4200
  success: true,
4140
4201
  agentKey: candidate,
4141
- record: redactAgentRecordForWorkspaceTool(record)
4202
+ record: redacted
4142
4203
  },
4143
- displayData: jsonPreview({
4144
- agentKey: candidate,
4145
- record: redactAgentRecordForWorkspaceTool(record)
4146
- })
4204
+ displayData: formatReadAgentCard(candidate, redacted)
4147
4205
  };
4148
4206
  }
4149
4207
  }
@@ -4254,7 +4312,7 @@ var readSkillDocFunctionSchema = {
4254
4312
  }
4255
4313
  };
4256
4314
  async function readSkillDocFunc(args, thunkApi) {
4257
- const { buildReadDocResult } = await import("./readDocTool-5USN4A6V.js");
4315
+ const { buildReadDocResult } = await import("./readDocTool-RC3JUNJ2.js");
4258
4316
  const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
4259
4317
  if (typeof id !== "string" || !id.trim()) {
4260
4318
  throw new Error("readSkillDoc requires id or doc.");
@@ -4520,18 +4578,7 @@ var addSpaceAction = async (input, thunkAPI) => {
4520
4578
  };
4521
4579
 
4522
4580
  // packages/app/favorite/favoriteStore.ts
4523
- var import_react3 = __toESM(require_react());
4524
-
4525
- // packages/app/store.ts
4526
- var import_react2 = __toESM(require_react());
4527
-
4528
- // packages/app/sessionSnapshot.ts
4529
4581
  var import_react = __toESM(require_react());
4530
-
4531
- // packages/identity/useIdentity.local.ts
4532
- var LOCAL_USER_ID = (typeof process !== "undefined" ? process.env?.NOLO_LOCAL_USER_ID : void 0) || (typeof process !== "undefined" ? process.env?.NOLO_USER_ID : void 0) || "local";
4533
-
4534
- // packages/app/favorite/favoriteStore.ts
4535
4582
  var createInitialState = () => ({
4536
4583
  agentIds: [],
4537
4584
  contentIds: [],
@@ -5057,7 +5104,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
5057
5104
  const spaceKey = createSpaceKey.space(spaceId);
5058
5105
  const readSpace = async (dbKey) => {
5059
5106
  try {
5060
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-XVWBAGYN.js");
5107
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-Q25STFGJ.js");
5061
5108
  if (fresh) {
5062
5109
  return await dispatch(readAndWait2(dbKey)).unwrap();
5063
5110
  }
@@ -5698,6 +5745,23 @@ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5698
5745
  var normalizeContains = (value) => asTrimmedLowercaseString(value);
5699
5746
  var participantList = (emails) => Array.isArray(emails) ? asTrimmedNonEmptyStringArray(emails).map((email) => ({ email })) : [];
5700
5747
  var emailText = (email) => [email?.subject, email?.from?.email, email?.from?.name, email?.text, email?.html].filter((value) => typeof value === "string").join("\n");
5748
+ var emailAttachments = (email) => Array.isArray(email?.attachments) ? email.attachments : [];
5749
+ var attachmentPreview = (attachment) => {
5750
+ const name = asOptionalTrimmedString(attachment?.filename) ?? "attachment";
5751
+ const contentType = asOptionalTrimmedString(attachment?.contentType) ?? "application/octet-stream";
5752
+ const fileId = asOptionalTrimmedString(attachment?.fileId) ?? "unknown-file";
5753
+ const size = Number.isFinite(Number(attachment?.size)) ? ` | ${Number(attachment.size)} bytes` : "";
5754
+ return `- ${name} | ${contentType}${size} | fileId: ${fileId}`;
5755
+ };
5756
+ var attachmentListPreview = (email) => {
5757
+ const attachments = emailAttachments(email);
5758
+ if (attachments.length === 0) return "";
5759
+ return [
5760
+ `\u9644\u4EF6\uFF08${attachments.length}\uFF09\uFF1A`,
5761
+ ...attachments.map(attachmentPreview),
5762
+ "\u8BFB\u53D6\u9644\u4EF6\uFF1A\u518D\u6B21\u8C03\u7528 email_read\uFF0C\u4F20\u5165\u5F53\u524D dbKey \u548C attachmentFileId\u3002"
5763
+ ].join("\n");
5764
+ };
5701
5765
  var matchesWaitFilters = (email, args) => {
5702
5766
  const subjectContains = normalizeContains(args.subjectContains);
5703
5767
  const fromContains = normalizeContains(args.fromContains);
@@ -5723,6 +5787,58 @@ var stripHtml = (html) => typeof html === "string" ? compactWhitespace(
5723
5787
  html.replace(/<a\b[^>]*href=["']([^"']+)["'][^>]*>/gi, " $1 ").replace(/<[^>]+>/g, " ")
5724
5788
  ) : "";
5725
5789
  var cleanUrl = (url) => url.replace(/[),.;\]}>]+$/g, "");
5790
+ var extractPdfText = async (blob) => {
5791
+ const pdfjsLib = await import("./pdf-U6KSUEZZ.js");
5792
+ if (typeof window !== "undefined" && pdfjsLib.GlobalWorkerOptions && !pdfjsLib.GlobalWorkerOptions.workerSrc) {
5793
+ pdfjsLib.GlobalWorkerOptions.workerSrc = "/public/assets/pdf.worker.mjs";
5794
+ }
5795
+ const data = await blob.arrayBuffer();
5796
+ const pdf = await pdfjsLib.getDocument({ data }).promise;
5797
+ const pages = [];
5798
+ for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber += 1) {
5799
+ const page = await pdf.getPage(pageNumber);
5800
+ const textContent = await page.getTextContent();
5801
+ const text = textContent.items.map((item) => typeof item?.str === "string" ? item.str : "").filter(Boolean).join(" ").trim();
5802
+ if (text) pages.push(`--- page ${pageNumber} ---
5803
+ ${text}`);
5804
+ }
5805
+ return pages.join("\n\n").trim();
5806
+ };
5807
+ var readEmailAttachment = async (email, fileId, maxChars, thunkApi) => {
5808
+ const attachment = emailAttachments(email).find(
5809
+ (item) => asOptionalTrimmedString(item?.fileId) === fileId
5810
+ );
5811
+ if (!attachment) {
5812
+ throw new Error(`\u9644\u4EF6 ${fileId} \u4E0D\u5C5E\u4E8E\u90AE\u4EF6 ${email?.dbKey || "unknown"}`);
5813
+ }
5814
+ const result = await readFileContentAction({ fileId }, thunkApi);
5815
+ const blob = result.blob;
5816
+ const contentType = (asOptionalTrimmedString(attachment?.contentType) || asOptionalTrimmedString(blob.type) || "application/octet-stream").toLowerCase();
5817
+ const filename = asOptionalTrimmedString(attachment?.filename) ?? fileId;
5818
+ let content;
5819
+ if (contentType === "application/pdf" || filename.toLowerCase().endsWith(".pdf")) {
5820
+ content = await extractPdfText(blob);
5821
+ if (!content) {
5822
+ throw new Error(
5823
+ `PDF \u9644\u4EF6 ${filename} \u6CA1\u6709\u53EF\u63D0\u53D6\u7684\u6587\u5B57\u5C42\uFF0C\u53EF\u80FD\u662F\u626B\u63CF\u7248\uFF1B\u8BF7\u6539\u7528 OCR \u80FD\u529B\u5904\u7406\u8BE5 fileId\u3002`
5824
+ );
5825
+ }
5826
+ } else if (contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("csv") || contentType.includes("xml") || /\.(txt|md|csv|json|xml|html?|log)$/i.test(filename)) {
5827
+ content = await blob.text();
5828
+ } else {
5829
+ throw new Error(
5830
+ `\u9644\u4EF6 ${filename} (${contentType}) \u6682\u4E0D\u652F\u6301\u76F4\u63A5\u8F6C\u6587\u672C\uFF1BfileId=${fileId} \u4ECD\u53EF\u4EA4\u7ED9\u5BF9\u5E94\u7684\u6587\u4EF6/\u5A92\u4F53\u5904\u7406\u80FD\u529B\u3002`
5831
+ );
5832
+ }
5833
+ const truncated = content.length > maxChars;
5834
+ return {
5835
+ attachment,
5836
+ content: truncated ? content.slice(0, maxChars) : content,
5837
+ totalChars: content.length,
5838
+ truncated,
5839
+ source: result.source
5840
+ };
5841
+ };
5726
5842
  var extractEmailVerificationArtifacts = ({
5727
5843
  text,
5728
5844
  html
@@ -5790,13 +5906,25 @@ var emailSearchFunctionSchema = {
5790
5906
  };
5791
5907
  var emailReadFunctionSchema = {
5792
5908
  name: "email_read",
5793
- description: "\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
5909
+ description: [
5910
+ "\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
5911
+ "\u90AE\u4EF6\u6709\u9644\u4EF6\u65F6\u4F1A\u5217\u51FA\u9644\u4EF6 fileId\u3002\u8981\u8BFB\u53D6 PDF/\u6587\u672C/CSV/JSON \u9644\u4EF6\uFF0C\u518D\u4F20 attachmentFileId\uFF1B\u5DE5\u5177\u4F1A\u5148\u6821\u9A8C\u8BE5\u6587\u4EF6\u786E\u5B9E\u5C5E\u4E8E\u8FD9\u5C01\u90AE\u4EF6\u3002",
5912
+ "PDF \u4F18\u5148\u76F4\u63A5\u63D0\u53D6\u6587\u5B57\u5C42\uFF1B\u626B\u63CF\u7248 PDF \u4F1A\u63D0\u793A\u6539\u7528 OCR\u3002"
5913
+ ].join("\n"),
5794
5914
  parameters: {
5795
5915
  type: "object",
5796
5916
  properties: {
5797
5917
  dbKey: {
5798
5918
  type: "string",
5799
5919
  description: "\u90AE\u4EF6\u8BB0\u5F55\u7684 dbKey\uFF0C\u4F8B\u5982 email-userId-emailId\u3002"
5920
+ },
5921
+ attachmentFileId: {
5922
+ type: "string",
5923
+ description: "\u53EF\u9009\u3002\u5F53\u524D\u90AE\u4EF6 attachments[] \u4E2D\u7684 fileId\uFF1B\u63D0\u4F9B\u540E\u8BFB\u53D6\u8BE5\u9644\u4EF6\u6587\u672C\u3002"
5924
+ },
5925
+ maxChars: {
5926
+ type: "number",
5927
+ description: "\u8BFB\u53D6\u9644\u4EF6\u65F6\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u5B57\u7B26\uFF0C\u9ED8\u8BA4 12000\uFF0C\u8303\u56F4 1000-50000\u3002"
5800
5928
  }
5801
5929
  },
5802
5930
  required: ["dbKey"]
@@ -6075,15 +6203,47 @@ ${artifacts.verificationLinks.slice(1).join("\n")}` : ""
6075
6203
  };
6076
6204
  }
6077
6205
  async function emailReadFunc(args, thunkApi) {
6078
- const email = await callToolApi(thunkApi, "/rpc/getEmail", args, {
6206
+ const email = await callToolApi(thunkApi, "/rpc/getEmail", { dbKey: args.dbKey }, {
6079
6207
  withAuth: true
6080
6208
  });
6209
+ const attachmentFileId = asOptionalTrimmedString(args.attachmentFileId);
6210
+ if (attachmentFileId) {
6211
+ const maxChars = clampInteger(args.maxChars, 12e3, 1e3, 5e4);
6212
+ const attachmentResult = await readEmailAttachment(
6213
+ email,
6214
+ attachmentFileId,
6215
+ maxChars,
6216
+ thunkApi
6217
+ );
6218
+ const filename = asOptionalTrimmedString(attachmentResult.attachment?.filename) ?? attachmentFileId;
6219
+ return {
6220
+ rawData: {
6221
+ emailDbKey: email?.dbKey,
6222
+ attachment: attachmentResult.attachment,
6223
+ content: attachmentResult.content,
6224
+ totalChars: attachmentResult.totalChars,
6225
+ truncated: attachmentResult.truncated,
6226
+ source: attachmentResult.source
6227
+ },
6228
+ displayData: [
6229
+ `\u9644\u4EF6\uFF1A${filename} | fileId: ${attachmentFileId}`,
6230
+ attachmentResult.truncated ? `\u5185\u5BB9\u5DF2\u622A\u65AD\uFF1A\u8FD4\u56DE ${attachmentResult.content.length}/${attachmentResult.totalChars} \u5B57\u7B26\u3002` : `\u5185\u5BB9\u5B57\u7B26\u6570\uFF1A${attachmentResult.totalChars}`,
6231
+ "",
6232
+ attachmentResult.content
6233
+ ].join("\n")
6234
+ };
6235
+ }
6081
6236
  const body = asOptionalTrimmedString(email?.text) ?? asOptionalTrimmedString(email?.html) ?? "";
6237
+ const attachments = attachmentListPreview(email);
6082
6238
  return {
6083
6239
  rawData: email,
6084
- displayData: `${emailPreview(email)}
6085
-
6086
- ${body.slice(0, 4e3)}`
6240
+ displayData: [
6241
+ emailPreview(email),
6242
+ "",
6243
+ body.slice(0, 4e3),
6244
+ attachments ? `
6245
+ ${attachments}` : ""
6246
+ ].filter(Boolean).join("\n")
6087
6247
  };
6088
6248
  }
6089
6249
  async function emailUpdateTagsFunc(args, thunkApi) {
@@ -9207,214 +9367,6 @@ ${preview}`
9207
9367
  };
9208
9368
  }
9209
9369
 
9210
- // packages/ai/tools/chromeConnectorTools.ts
9211
- var CHROME_CONNECTOR_TOOL_NAMES = [
9212
- "chrome_list_tabs",
9213
- "chrome_open_tab",
9214
- "chrome_close_tab",
9215
- "chrome_read_page",
9216
- "chrome_click",
9217
- "chrome_type",
9218
- "chrome_press",
9219
- "chrome_scroll",
9220
- "chrome_screenshot",
9221
- "chrome_read_console",
9222
- "chrome_read_network"
9223
- ];
9224
- var CHROME_CONNECTOR_READ_TOOL_NAMES = [
9225
- "chrome_list_tabs",
9226
- "chrome_read_page",
9227
- "chrome_screenshot",
9228
- "chrome_read_console",
9229
- "chrome_read_network"
9230
- ];
9231
- var getChromeConnectorToolBehavior = (name) => CHROME_CONNECTOR_READ_TOOL_NAMES.includes(name) ? "data" : "action";
9232
- var getChromeConnectorToolDefaultConsent = (name) => CHROME_CONNECTOR_READ_TOOL_NAMES.includes(name) ? "auto" : "ask";
9233
- function baseSchema(name, description, properties, required = []) {
9234
- return {
9235
- name,
9236
- description,
9237
- parameters: {
9238
- type: "object",
9239
- properties,
9240
- required
9241
- }
9242
- };
9243
- }
9244
- var tabId = {
9245
- type: "string",
9246
- description: "Chrome tab id returned by chrome_list_tabs or chrome_open_tab."
9247
- };
9248
- var elementRef = {
9249
- type: "string",
9250
- description: "Revision-scoped ref like 1a2b3c4d-e2, copied verbatim from chrome_read_page; preferred over selector when available."
9251
- };
9252
- var selector = {
9253
- type: "string",
9254
- description: "CSS selector for the visible page element to operate on; fallback when no elementRef is available."
9255
- };
9256
- var chromeListTabsFunctionSchema = baseSchema(
9257
- "chrome_list_tabs",
9258
- "List controllable Chrome tabs from the user's Chrome profile through the Nolo desktop Chrome connector.",
9259
- {}
9260
- );
9261
- var chromeOpenTabFunctionSchema = baseSchema(
9262
- "chrome_open_tab",
9263
- "Open a URL in the user's Chrome browser through the Nolo desktop Chrome connector.",
9264
- {
9265
- url: {
9266
- type: "string",
9267
- description: "HTTP or HTTPS URL to open in Chrome."
9268
- },
9269
- active: {
9270
- type: "boolean",
9271
- description: "Whether to focus the new Chrome tab. Defaults to true."
9272
- }
9273
- },
9274
- ["url"]
9275
- );
9276
- var chromeCloseTabFunctionSchema = baseSchema(
9277
- "chrome_close_tab",
9278
- "Close a Chrome tab through the Nolo desktop Chrome connector. Prefer closing the tabs your own run opened with chrome_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).",
9279
- {
9280
- tabId
9281
- },
9282
- ["tabId"]
9283
- );
9284
- var chromeReadPageFunctionSchema = baseSchema(
9285
- "chrome_read_page",
9286
- "Read a compact view of a Chrome tab: visible text (hard cap 6000 chars) plus short-lived elementRefs (hard cap 35) and a pageRevision. Reuse those refs for chrome_click and chrome_type instead of guessing selectors; use region to focus a big page. Does not read cookies or profile databases.",
9287
- {
9288
- tabId,
9289
- region: {
9290
- type: "string",
9291
- description: "Optional CSS selector limiting the read to part of the page."
9292
- },
9293
- maxChars: {
9294
- type: "number",
9295
- description: "Optional text character budget; the connector clamps it to a hard maximum."
9296
- },
9297
- detail: {
9298
- type: "string",
9299
- enum: ["compact", "full"],
9300
- description: "compact (default) returns budgeted text; full raises the budget and adds capped HTML."
9301
- }
9302
- },
9303
- ["tabId"]
9304
- );
9305
- var chromeClickFunctionSchema = baseSchema(
9306
- "chrome_click",
9307
- "Click a visible element in a Chrome tab by elementRef from chrome_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.",
9308
- {
9309
- tabId,
9310
- elementRef,
9311
- selector
9312
- },
9313
- ["tabId"]
9314
- );
9315
- var chromeTypeFunctionSchema = baseSchema(
9316
- "chrome_type",
9317
- "Type text into a Chrome page element identified by elementRef from chrome_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.",
9318
- {
9319
- tabId,
9320
- elementRef,
9321
- selector,
9322
- text: {
9323
- type: "string",
9324
- description: "Text to type into the selected element."
9325
- },
9326
- clearFirst: {
9327
- type: "boolean",
9328
- description: "Whether to clear the field before typing. Defaults to true."
9329
- }
9330
- },
9331
- ["tabId", "text"]
9332
- );
9333
- var chromePressFunctionSchema = baseSchema(
9334
- "chrome_press",
9335
- "Send a keyboard key or shortcut to a Chrome tab. Enter-like keys are refused with SENSITIVE_ACTION_REQUIRES_CONFIRMATION when the focused control is an irreversible action.",
9336
- {
9337
- tabId,
9338
- key: {
9339
- type: "string",
9340
- description: "Key or shortcut, for example Enter, Escape, ArrowDown, or Meta+L."
9341
- }
9342
- },
9343
- ["tabId", "key"]
9344
- );
9345
- var chromeScrollFunctionSchema = baseSchema(
9346
- "chrome_scroll",
9347
- "Scroll a Chrome tab by pixel deltas.",
9348
- {
9349
- tabId,
9350
- deltaX: {
9351
- type: "number",
9352
- description: "Horizontal scroll delta in pixels."
9353
- },
9354
- deltaY: {
9355
- type: "number",
9356
- description: "Vertical scroll delta in pixels."
9357
- }
9358
- },
9359
- ["tabId"]
9360
- );
9361
- var chromeScreenshotFunctionSchema = baseSchema(
9362
- "chrome_screenshot",
9363
- "Capture a screenshot from a Chrome tab through the Nolo desktop Chrome connector.",
9364
- {
9365
- tabId,
9366
- fullPage: {
9367
- type: "boolean",
9368
- description: "Whether to capture the full page. Defaults to false."
9369
- }
9370
- },
9371
- ["tabId"]
9372
- );
9373
- var chromeReadConsoleFunctionSchema = baseSchema(
9374
- "chrome_read_console",
9375
- "Read recent console messages from a Chrome tab using debugger-backed connector state.",
9376
- {
9377
- tabId,
9378
- limit: {
9379
- type: "number",
9380
- description: "Maximum number of recent console messages to return."
9381
- }
9382
- },
9383
- ["tabId"]
9384
- );
9385
- var chromeReadNetworkFunctionSchema = baseSchema(
9386
- "chrome_read_network",
9387
- "Read a deduplicated recent network summary from a Chrome tab using debugger-backed connector state. Static assets are filtered unless includeAssets is set.",
9388
- {
9389
- tabId,
9390
- limit: {
9391
- type: "number",
9392
- description: "Maximum number of recent network entries to return."
9393
- },
9394
- includeAssets: {
9395
- type: "boolean",
9396
- description: "Include images, CSS, fonts and other static assets. Defaults to false."
9397
- }
9398
- },
9399
- ["tabId"]
9400
- );
9401
- var chromeConnectorToolSchemas = [
9402
- chromeListTabsFunctionSchema,
9403
- chromeOpenTabFunctionSchema,
9404
- chromeCloseTabFunctionSchema,
9405
- chromeReadPageFunctionSchema,
9406
- chromeClickFunctionSchema,
9407
- chromeTypeFunctionSchema,
9408
- chromePressFunctionSchema,
9409
- chromeScrollFunctionSchema,
9410
- chromeScreenshotFunctionSchema,
9411
- chromeReadConsoleFunctionSchema,
9412
- chromeReadNetworkFunctionSchema
9413
- ];
9414
- async function chromeConnectorUnavailableFunc() {
9415
- throw new Error("Chrome connector tools are only executable in the Nolo desktop local runtime.");
9416
- }
9417
-
9418
9370
  // packages/ai/tools/exaSearchTool.ts
9419
9371
  var exaSearchSchema = {
9420
9372
  name: "exa_search",
@@ -9769,13 +9721,13 @@ var whisperV3Func = async (input, thunkApi) => {
9769
9721
  // packages/ai/tools/transcribeVideoTool.ts
9770
9722
  var transcribeVideoSchema = {
9771
9723
  name: "transcribeVideo",
9772
- description: "\u5C06\u89C6\u9891\u94FE\u63A5\u8F6C\u5199\u4E3A\u5E26\u6807\u70B9\u7684\u6587\u672C\u4E0E SRT \u5B57\u5E55\u3002\u652F\u6301 B \u7AD9\u5206 P/\u5408\u96C6\uFF08\u9ED8\u8BA4\u5904\u7406\u5168\u90E8\uFF0C\u4E5F\u53EF\u6307\u5B9A p\uFF09\u3001YouTube \u7B49 yt-dlp \u5E73\u53F0\uFF1B\u6296\u97F3\u9700\u5728\u684C\u9762\u7AEF\u6D4F\u89C8\u5668\u4F7F\u7528\u3002\u4E0B\u8F7D\u540E\u4E0D\u8F6C\u7801\uFF0C\u4FDD\u7559\u539F\u59CB\u97F3\u8F68\u8D28\u91CF\u3002",
9724
+ description: "\u5C06\u89C6\u9891\u94FE\u63A5\u8F6C\u5199\u4E3A\u5E26\u6807\u70B9\u7684\u6587\u672C\u4E0E SRT \u5B57\u5E55\u3002\u652F\u6301 B \u7AD9\u5206 P/\u5408\u96C6\uFF08\u9ED8\u8BA4\u5904\u7406\u5168\u90E8\uFF0C\u4E5F\u53EF\u6307\u5B9A p\uFF09\u3001YouTube \u7B49 yt-dlp \u5E73\u53F0\uFF0C\u4EE5\u53CA\u6296\u97F3\uFF08\u652F\u6301 v.douyin.com \u77ED\u94FE\u3001douyin.com \u89C6\u9891\u9875\u94FE\u63A5\uFF0C\u6216\u76F4\u63A5\u4F20\u6574\u6BB5\u6296\u97F3\u5206\u4EAB\u6587\u6848\uFF0C\u4F1A\u81EA\u52A8\u63D0\u53D6\u5176\u4E2D\u94FE\u63A5\uFF1B\u65E0\u9700\u767B\u5F55\u6216\u6D4F\u89C8\u5668\uFF09\u3002\u4E0B\u8F7D\u540E\u4E0D\u8F6C\u7801\uFF0C\u4FDD\u7559\u539F\u59CB\u97F3\u8F68\u8D28\u91CF\u3002",
9773
9725
  parameters: {
9774
9726
  type: "object",
9775
9727
  properties: {
9776
9728
  url: {
9777
9729
  type: "string",
9778
- description: "\u89C6\u9891\u94FE\u63A5\uFF08B \u7AD9 / YouTube \u7B49\uFF09\u3002\u5206 P \u5408\u96C6\u7F3A\u7701\u4F1A\u5904\u7406\u5168\u90E8\uFF0C\u7ED3\u679C\u91CC\u4F1A\u5217\u51FA processedParts\u3002"
9730
+ description: "\u89C6\u9891\u94FE\u63A5\uFF08B \u7AD9 / YouTube / \u6296\u97F3\u7B49\uFF09\uFF0C\u4E5F\u53EF\u76F4\u63A5\u4F20\u542B\u94FE\u63A5\u7684\u5206\u4EAB\u6587\u6848\u3002\u5206 P \u5408\u96C6\u7F3A\u7701\u4F1A\u5904\u7406\u5168\u90E8\uFF0C\u7ED3\u679C\u91CC\u4F1A\u5217\u51FA processedParts\u3002"
9779
9731
  },
9780
9732
  p: {
9781
9733
  description: "\u53EF\u9009\uFF0C1-based \u5206 P \u9009\u62E9\u3002\u4F20\u5355\u4E2A\u6570\u5B57\u6216\u6570\u5B57\u6570\u7EC4\uFF1B\u7F3A\u7701=\u5168\u90E8\u5904\u7406\uFF08\u7EDD\u4E0D\u9759\u9ED8\u53EA\u6293\u7B2C\u4E00\u4E2A\uFF09\u3002",
@@ -10122,7 +10074,7 @@ var cloudflareCrawlStatusFunctionSchema = {
10122
10074
  async function cloudflareCrawlStatusFunc(args, thunkApi) {
10123
10075
  const { jobId, limit, status, cursor } = args;
10124
10076
  if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
10125
- const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-QVJ6HDNN.js");
10077
+ const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-EJT6TMFG.js");
10126
10078
  const { baseUrl, token } = getToolRequestContext2(thunkApi);
10127
10079
  const params = new URLSearchParams();
10128
10080
  if (limit !== void 0) params.set("limit", String(limit));
@@ -10900,7 +10852,7 @@ var selectUserIdFromState = (state2) => {
10900
10852
  var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
10901
10853
  async function addImageContentToSpace(input) {
10902
10854
  const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
10903
- const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-O7R66HEX.js")).addContentAction;
10855
+ const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-RBOUD7SJ.js")).addContentAction;
10904
10856
  await addContentAction2(
10905
10857
  {
10906
10858
  spaceId: input.spaceId,
@@ -11788,6 +11740,7 @@ var deleteMemoryFunctionSchema = {
11788
11740
  };
11789
11741
 
11790
11742
  // packages/ai/tools/deleteMemoryTool.ts
11743
+ var VNEXT_STATE_ID_PREFIX = "vnext-state-";
11791
11744
  async function deleteMemoryFunc(args, thunkApi) {
11792
11745
  const reason = String(args.reason ?? "").trim();
11793
11746
  if (!reason && !args.ids?.length && !args.contentKeyword && !args.tags?.length) {
@@ -11824,11 +11777,15 @@ async function deleteMemoryFunc(args, thunkApi) {
11824
11777
  displayData: "\u672A\u627E\u5230\u5339\u914D\u7684\u8BB0\u5FC6\uFF0C\u65E0\u9700\u5220\u9664\u3002"
11825
11778
  };
11826
11779
  }
11780
+ const retiredCount2 = result.retiredIds?.length ?? (result.preview ?? []).filter(
11781
+ (item) => item.id.startsWith(VNEXT_STATE_ID_PREFIX)
11782
+ ).length;
11783
+ const physicalCount2 = Math.max(0, matched - retiredCount2);
11827
11784
  const previewList = (result.preview ?? []).map((item, idx) => `${idx + 1}. [${item.kind}] ${item.content}`).join("\n");
11828
11785
  return {
11829
11786
  rawData: result,
11830
11787
  displayData: [
11831
- `\u3010\u5F85\u7528\u6237\u786E\u8BA4\u3011\u5339\u914D\u5230 ${matched} \u6761\u7B26\u5408\u6761\u4EF6\u7684\u8BB0\u5FC6\uFF0C\u5373\u5C06\u7269\u7406\u5220\u9664\u3002`,
11788
+ `\u3010\u5F85\u7528\u6237\u786E\u8BA4\u3011\u5339\u914D\u5230 ${matched} \u6761\u7B26\u5408\u6761\u4EF6\u7684\u8BB0\u5FC6\uFF1A\u7269\u7406\u5220\u9664 ${physicalCount2} \u6761\uFF0C\u9000\u5F79 ${retiredCount2} \u6761\uFF08\u9000\u5F79\u4EC5\u8868\u793A\u505C\u6B62\u53EC\u56DE\uFF0C\u8BB0\u5F55\u672C\u8EAB\u4FDD\u7559\uFF09\u3002`,
11832
11789
  previewList ? `\u9884\u89C8\u524D ${result.preview?.length} \u6761\uFF1A
11833
11790
  ${previewList}` : "",
11834
11791
  `\u8FD9\u662F\u4E0D\u53EF\u9006\u64CD\u4F5C\u3002\u8BF7\u5411\u7528\u6237\u5C55\u793A\u4E0A\u8FF0\u9884\u89C8\u5E76\u83B7\u5F97\u660E\u786E\u786E\u8BA4\u3002\u786E\u8BA4\u540E\uFF0C\u8BF7\u4F20\u5165 confirmed: true${result.deletionToken ? ` \u4E0E deletionToken: "${result.deletionToken}"` : ""} \u518D\u6B21\u8C03\u7528\u672C\u5DE5\u5177\u3002`
@@ -11836,9 +11793,11 @@ ${previewList}` : "",
11836
11793
  };
11837
11794
  }
11838
11795
  const count = result.deletedCount ?? 0;
11796
+ const retiredCount = result.retiredIds?.length ?? 0;
11797
+ const physicalCount = Math.max(0, count - retiredCount);
11839
11798
  return {
11840
11799
  rawData: result,
11841
- displayData: `\u5DF2\u5728\u7528\u6237\u6743\u9650\u8303\u56F4\u5185\u786E\u8BA4\u5E76\u7269\u7406\u5220\u9664 ${count} \u6761\u8BB0\u5FC6\u3002`
11800
+ displayData: `\u5DF2\u5728\u7528\u6237\u6743\u9650\u8303\u56F4\u5185\u786E\u8BA4\u5E76\u6267\u884C\uFF1A\u7269\u7406\u5220\u9664 ${physicalCount} \u6761\u8BB0\u5FC6\uFF0C\u9000\u5F79 ${retiredCount} \u6761\uFF08\u8BB0\u5F55\u4FDD\u7559\u3001\u4E0D\u518D\u53EC\u56DE\uFF09\u3002`
11842
11801
  };
11843
11802
  }
11844
11803
 
@@ -12508,6 +12467,34 @@ async function createSkillAgentToolFunc(args, thunkApi) {
12508
12467
  return createAgentToolFunc(buildCreateSkillAgentArgs(args), thunkApi);
12509
12468
  }
12510
12469
 
12470
+ // packages/app/settings/fieldSelectors.ts
12471
+ var selectMaxExecutionTime = (state2) => state2.settings.maxExecutionTime;
12472
+ var selectGlobalPrompt = (state2) => state2.settings.globalPrompt;
12473
+ var selectUserTonePreset = (state2) => normalizeTonePresetSetting(state2.settings.userTonePreset);
12474
+ var selectKnowledgeCaptureLevel = (state2) => normalizePolicyLevelSetting(
12475
+ state2.settings.knowledgeCaptureLevel,
12476
+ DEFAULT_USER_PREFERENCE_PROFILE.knowledgeCaptureLevel
12477
+ );
12478
+ var selectSpaceContextLevel = (state2) => state2.settings.enableReadCurrentSpace === false ? 1 : normalizePolicyLevelSetting(
12479
+ state2.settings.spaceContextLevel,
12480
+ DEFAULT_USER_PREFERENCE_PROFILE.spaceContextLevel
12481
+ );
12482
+ var selectAutoApproveSelfUpdateFields = createSelector(
12483
+ [(state2) => state2.settings.autoApproveSelfUpdateFields],
12484
+ (fields) => normalizeAgentUpdateFieldList(
12485
+ fields,
12486
+ DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS
12487
+ )
12488
+ );
12489
+ var selectAiRecentContentLimit = (state2) => state2.settings.aiRecentContentLimit ?? 50;
12490
+ var selectSystemBuiltinSkills = createSelector(
12491
+ [(state2) => state2.settings.systemBuiltinSkills],
12492
+ (systemBuiltinSkills) => normalizeSystemBuiltinSkills(
12493
+ systemBuiltinSkills,
12494
+ DEFAULT_SYSTEM_AGENT_CAPABILITIES
12495
+ )
12496
+ );
12497
+
12511
12498
  // packages/chat/messages/messageAgent.ts
12512
12499
  function resolveMessageAgentKey(message) {
12513
12500
  if (!message) return void 0;
@@ -12554,11 +12541,13 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
12554
12541
  autoApprovedFields
12555
12542
  });
12556
12543
  const previousAgentForUpdate = buildUpdateThunkPreviousAgent(previousAgent, userId);
12544
+ const formData = buildPatch(args);
12545
+ const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
12557
12546
  const agent = await thunkApi.dispatch(
12558
12547
  updateAgent({
12559
12548
  userId,
12560
12549
  agentId: extractAgentId(currentAgentKey),
12561
- formData: buildPatch(args),
12550
+ formData,
12562
12551
  previousAgent: previousAgentForUpdate
12563
12552
  })
12564
12553
  ).unwrap().catch((e) => {
@@ -12570,7 +12559,8 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
12570
12559
  previousAgentForUpdate,
12571
12560
  requestedFields
12572
12561
  ),
12573
- displayData: formatUpdatedAgentOutput(agent)
12562
+ displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
12563
+ ${effortNote}` : "")
12574
12564
  };
12575
12565
  }
12576
12566
 
@@ -13059,11 +13049,14 @@ function checkCredentialFanout(args) {
13059
13049
  };
13060
13050
  }
13061
13051
  if (candidateGroup === entryGroup) {
13052
+ if (args.allowCredentialConcurrency === true) {
13053
+ continue;
13054
+ }
13062
13055
  return {
13063
13056
  allowed: false,
13064
13057
  reason: "credential_group_conflict",
13065
13058
  conflict: entry,
13066
- message: `\u62D2\u7EDD\u5E76\u53D1\u6D3E\u53D1\uFF1A\u5019\u9009 agent ${describeEntry(args.candidate)} \u4E0E\u5DF2\u6D3B\u8DC3 run ${describeEntry(entry)} \u540C\u5C5E credentialGroup "${candidateGroup}"\uFF0C\u540C\u4E00\u51ED\u8BC1\u4E0A\u7981\u6B62\u5E76\u53D1\u6247\u51FA\u3002\u8BF7\u4E32\u884C\u6D3E\u53D1\u6216\u6539\u7528\u5176\u4ED6 credentialGroup \u7684 agent\u3002`
13059
+ message: `\u62D2\u7EDD\u5E76\u53D1\u6D3E\u53D1\uFF1A\u5019\u9009 agent ${describeEntry(args.candidate)} \u4E0E\u5DF2\u6D3B\u8DC3 run ${describeEntry(entry)} \u540C\u5C5E credentialGroup "${candidateGroup}"\uFF0C\u540C\u4E00\u51ED\u8BC1\u4E0A\u7981\u6B62\u5E76\u53D1\u6247\u51FA\u3002\u8BF7\u4E32\u884C\u6D3E\u53D1\u3001\u6362\u7528\u5176\u4ED6 credentialGroup \u7684 agent\uFF0C\u6216\u4F20 allowCredentialConcurrency: true \u5141\u8BB8\u5E76\u53D1\u3002`
13067
13060
  };
13068
13061
  }
13069
13062
  }
@@ -13124,6 +13117,11 @@ function buildStartAgentRunFunctionSchema(opts) {
13124
13117
  description: "\u53EF\u9009\u3002\u663E\u5F0F\u786E\u8BA4\u300C\u51ED\u8BC1\u5F52\u5C5E\u672A\u77E5\u300D\u7684\u5E76\u53D1\u98CE\u9669\u540E\u5F3A\u5236\u653E\u884C\uFF08\u7B49\u540C\u4E8E CLI \u7684 --force-unknown-credential\uFF09\u3002\u4EC5\u5728\u5DF2\u81EA\u884C\u786E\u8BA4\u4E24\u4FA7\u4E0D\u5171\u7528\u4E0A\u6E38\u51ED\u8BC1\u65F6\u4F7F\u7528\uFF1B\u9ED8\u8BA4 false\uFF0C\u672A\u77E5\u51ED\u8BC1\u5E76\u53D1\u4E00\u5F8B\u62D2\u7EDD\u3002",
13125
13118
  default: false
13126
13119
  },
13120
+ allowCredentialConcurrency: {
13121
+ type: "boolean",
13122
+ description: "\u53EF\u9009\u3002\u663E\u5F0F\u5141\u8BB8\u540C\u4E00\u51ED\u8BC1\u7EC4\u5E76\u53D1\u6D3E\u53D1\u3002\u9ED8\u8BA4 false\u3002\u5728\u7528\u6237\u6388\u6743\u540C\u4E00\u51ED\u636E\u591A\u4EFB\u52A1\u5E76\u53D1\u6216\u786E\u8BA4\u4E0A\u6E38\u652F\u6301\u5E76\u53D1\u65F6\u4F7F\u7528\u3002",
13123
+ default: false
13124
+ },
13127
13125
  trackTodo: {
13128
13126
  type: "boolean",
13129
13127
  description: '\u53EF\u9009\u3002\u4E3A true \u65F6\u672C\u6B21 run \u4F1A\u88AB\u8BB0\u5F55\u8FDB runtime todo\uFF08~/.nolo/todos.json\uFF09\u3002\u4F20\u4E86 batchId \u65F6\u9ED8\u8BA4\u5373\u8BB0\u5F55\uFF08\u6BCF\u6279\u5BF9\u5E94\u4E00\u9879 todo\uFF09\u3002todo \u72B6\u6001\u7531\u5173\u8054 run \u72B6\u6001 + review \u7ED3\u8BBA\u63A8\u5BFC\uFF0C\u7528 controlAgentRun(action:"todo") \u67E5\u8BE2\u3002'
@@ -13170,7 +13168,8 @@ async function startAgentRunFunc(args, thunkApi, _context) {
13170
13168
  const verdict = checkCredentialFanout({
13171
13169
  active,
13172
13170
  candidate: { agentKey, credentialGroup: args.credentialGroup },
13173
- allowUnknownCredential: args.allowUnknownCredential === true
13171
+ allowUnknownCredential: args.allowUnknownCredential === true,
13172
+ allowCredentialConcurrency: args.allowCredentialConcurrency === true
13174
13173
  });
13175
13174
  if (!verdict.allowed) throw new Error(verdict.message);
13176
13175
  }
@@ -14797,7 +14796,7 @@ ${resultStr}
14797
14796
  }
14798
14797
 
14799
14798
  // packages/ai/tools/toolRunStore.ts
14800
- var import_react4 = __toESM(require_react());
14799
+ var import_react2 = __toESM(require_react());
14801
14800
  var createToolRunId = () => `toolrun_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
14802
14801
  var runsById = /* @__PURE__ */ new Map();
14803
14802
  var listeners2 = /* @__PURE__ */ new Set();
@@ -14906,7 +14905,7 @@ var executeToolRun = createAsyncThunk(
14906
14905
  if (!executionInput) {
14907
14906
  throw new Error(`ToolRun ${id} has no input to execute with.`);
14908
14907
  }
14909
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-2VDNDFET.js");
14908
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-WZZYTUNF.js");
14910
14909
  const { executor } = findToolExecutor2(run.toolName);
14911
14910
  toolRunStarted({
14912
14911
  id: run.id,
@@ -14930,7 +14929,7 @@ var executeToolRun = createAsyncThunk(
14930
14929
  const latestState = thunkApi.getState();
14931
14930
  const userId = selectIdentityUserId(latestState);
14932
14931
  if (userId) {
14933
- const { fetchUserSpaceMemberships } = await import("./memberThunks-QGFLFVCI.js");
14932
+ const { fetchUserSpaceMemberships } = await import("./memberThunks-R75S3RWP.js");
14934
14933
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
14935
14934
  }
14936
14935
  }
@@ -17413,7 +17412,7 @@ async function updateDocFunc(args, thunkApi) {
17413
17412
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
17414
17413
  };
17415
17414
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
17416
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-6KKYKAGQ.js");
17415
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-2JDRAYXJ.js");
17417
17416
  if (getDocState().pageKey === id) {
17418
17417
  applyExternalDocUpdate({
17419
17418
  slateData: finalSlateData,
@@ -17438,7 +17437,7 @@ async function updateDocFunc(args, thunkApi) {
17438
17437
  // packages/ai/tools/updateUserPreferenceProfileTool.ts
17439
17438
  async function dispatchSetSettings(thunkApi, changes) {
17440
17439
  const injectedSetSettings = thunkApi?.extra?.setSettings;
17441
- const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-ZQZVUPKK.js")).setSettings;
17440
+ const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-PPZZZOWN.js")).setSettings;
17442
17441
  await thunkApi.dispatch(setSettings(changes)).unwrap();
17443
17442
  }
17444
17443
  var updateUserPreferenceProfileFunctionSchema = {
@@ -18161,6 +18160,38 @@ var baseToolDefinitions = [
18161
18160
  costLevel: "low",
18162
18161
  defaultConsent: "ask"
18163
18162
  },
18163
+ {
18164
+ id: "updateAgentAutomation",
18165
+ schema: updateAgentAutomationFunctionSchema,
18166
+ executor: updateAgentAutomationFunc,
18167
+ description: {
18168
+ name: "updateAgentAutomation",
18169
+ description: "\u66F4\u65B0\u4E00\u4E2A agent automation \u7684\u6807\u9898\u3001instruction\u3001trigger\u3001status \u7B49\u5B57\u6BB5\u3002",
18170
+ category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
18171
+ },
18172
+ behavior: "action",
18173
+ uiGroup: "general",
18174
+ capability: "general",
18175
+ riskLevel: "medium",
18176
+ costLevel: "low",
18177
+ defaultConsent: "ask"
18178
+ },
18179
+ {
18180
+ id: "deleteAgentAutomation",
18181
+ schema: deleteAgentAutomationFunctionSchema,
18182
+ executor: deleteAgentAutomationFunc,
18183
+ description: {
18184
+ name: "deleteAgentAutomation",
18185
+ description: "\u5220\u9664\u4E00\u4E2A agent automation \u53CA\u5176 owner index\u3002",
18186
+ category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
18187
+ },
18188
+ behavior: "action",
18189
+ uiGroup: "general",
18190
+ capability: "general",
18191
+ riskLevel: "high",
18192
+ costLevel: "low",
18193
+ defaultConsent: "ask"
18194
+ },
18164
18195
  {
18165
18196
  id: "notifyUser",
18166
18197
  schema: notifyUserFunctionSchema,
@@ -19204,7 +19235,7 @@ var baseToolDefinitions = [
19204
19235
  },
19205
19236
  behavior: getChromeConnectorToolBehavior(name),
19206
19237
  capability: "browser_automation",
19207
- riskLevel: name === "chrome_click" || name === "chrome_type" ? "medium" : "low",
19238
+ riskLevel: name === "browser_click_element" || name === "browser_type" ? "medium" : "low",
19208
19239
  costLevel: "low",
19209
19240
  defaultConsent: getChromeConnectorToolDefaultConsent(name),
19210
19241
  cancelable: true
@@ -19638,7 +19669,7 @@ var toolDefinitions = [
19638
19669
  ];
19639
19670
  var ALL_TOOL_FUNCTION_NAMES = toolDefinitions.map((tool) => tool.schema?.name).filter((name) => Boolean(name));
19640
19671
  var AGENT_AVAILABLE_TOOL_NAMES = ALL_TOOL_FUNCTION_NAMES.filter(
19641
- (name) => name !== "toolquery" && !name.startsWith("browser_") && name !== "exa_search"
19672
+ (name) => name !== "toolquery" && (!name.startsWith("browser_") || CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES.includes(name)) && name !== "exa_search"
19642
19673
  );
19643
19674
  var patchAgentToolSchemas = () => {
19644
19675
  try {
@@ -19698,8 +19729,6 @@ var findToolExecutor = (rawName) => {
19698
19729
  };
19699
19730
 
19700
19731
  export {
19701
- resolveAgentRequiredPackIds,
19702
- resolveAgentRecommendedSkillNames,
19703
19732
  clipMultilineText,
19704
19733
  fetchAndSerializeTable,
19705
19734
  getToolResultErrorData,
@@ -19710,12 +19739,18 @@ export {
19710
19739
  toolRunFailed,
19711
19740
  getAllToolRuns,
19712
19741
  createSSEParser,
19713
- formatAgentListCard,
19742
+ selectMaxExecutionTime,
19743
+ selectGlobalPrompt,
19744
+ selectUserTonePreset,
19745
+ selectKnowledgeCaptureLevel,
19746
+ selectSpaceContextLevel,
19747
+ selectAiRecentContentLimit,
19748
+ resolveAgentRequiredPackIds,
19749
+ resolveAgentRecommendedSkillNames,
19714
19750
  readXPostFunctionSchema,
19715
19751
  readXPostFunc,
19716
19752
  readXhsProfileFunctionSchema,
19717
19753
  readXhsProfileFunc,
19718
- CHROME_CONNECTOR_TOOL_NAMES,
19719
19754
  rememberMemoryFunctionSchema,
19720
19755
  deleteMemoryFunctionSchema,
19721
19756
  queryMemoryFunctionSchema,