nolo-cli 0.90.0-alpha.1 → 0.91.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-W26HVI75.js → _executeModel-H35GQ2XO.js} +61 -60
  3. package/{action-6DXQGJMX.js → action-3ZOODRBC.js} +11 -11
  4. package/{addContentAction-I7VX5SAC.js → addContentAction-IJHG2ZV7.js} +9 -9
  5. package/{addDialogAgentAction-OJSFV7DZ.js → addDialogAgentAction-IGFS2UBX.js} +11 -11
  6. package/{agentDeleteCommand-XNFWCKBH.js → agentDeleteCommand-XOFMXMHW.js} +43 -42
  7. package/{agentEmailCommands-W3X3EJ3V.js → agentEmailCommands-H2SEP6ZQ.js} +82 -78
  8. package/{agentGrantCommands-YW6PQAQ2.js → agentGrantCommands-M3XFO6EN.js} +2 -2
  9. package/{agentListCommands-DFWFU6XO.js → agentListCommands-RYGH6NUL.js} +72 -80
  10. package/{agentMachineCommands-LMFOAEL4.js → agentMachineCommands-XELOBZIP.js} +37 -36
  11. package/{agentProviderCommands-ZBYHGTGY.js → agentProviderCommands-JCRK6ST2.js} +1 -1
  12. package/{agentPullCommand-GLOOXJ2E.js → agentPullCommand-HF4A42D4.js} +3 -3
  13. package/agentRecordCommands-43HAXAZO.js +130 -0
  14. package/{agentRunCommand-HTBVIBGV.js → agentRunCommand-GIPN6DBO.js} +80 -75
  15. package/{agentRunControl-XLGD3UZ5.js → agentRunControl-AVJR4JW4.js} +2 -2
  16. package/{agentRuntimeLocal-2JFG4HDU.js → agentRuntimeLocal-SDOSSCLU.js} +38 -33
  17. package/{agentSlice-ZNLGFUB5.js → agentSlice-B2DLZMAC.js} +11 -11
  18. package/{appDeleteCommands-2UN4N2NR.js → appDeleteCommands-7OR5MAOR.js} +37 -36
  19. package/{appDeployCommands-37D74KRR.js → appDeployCommands-5GNI723H.js} +37 -36
  20. package/{appDeployStatusCommands-QBLWL2IA.js → appDeployStatusCommands-WL2NG3SG.js} +37 -36
  21. package/{appGetCommands-6KXIDF2T.js → appGetCommands-7BVKQS44.js} +37 -36
  22. package/{appListCommands-G2WFGEWQ.js → appListCommands-5VXFJOBU.js} +37 -36
  23. package/{authCommand-V2DJ7DB7.js → authCommand-N4Q6463J.js} +115 -23
  24. package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
  25. package/{builtinSkillRegistry-WBGYKIAZ.js → builtinSkillRegistry-JPY2DKRF.js} +7 -7
  26. package/{chatQueueReduxAdapter-XCJHIY3R.js → chatQueueReduxAdapter-3KDRKXTT.js} +29 -29
  27. package/{chromeCommands-VOIRNJBL.js → chromeCommands-NKU3OWKH.js} +36 -11
  28. package/{chromeOpsCommands-M7DPCX2T.js → chromeOpsCommands-OQDJGD4Y.js} +31 -1
  29. package/{chunk-4BYPU626.js → chunk-232453C2.js} +994 -1036
  30. package/{chunk-SMZSWB44.js → chunk-25GAGMRK.js} +6 -83
  31. package/{chunk-PH5J5VUY.js → chunk-3IYMTWYZ.js} +22 -22
  32. package/{chunk-NTW5GWDM.js → chunk-3VNWWVKB.js} +2 -0
  33. package/{chunk-TVNI5FLG.js → chunk-46CRK7XP.js} +7 -7
  34. package/{chunk-2ADBVBEM.js → chunk-55VQ4OPL.js} +4 -4
  35. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  36. package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
  37. package/{chunk-3R5PH4IP.js → chunk-64TIEZHF.js} +1 -1
  38. package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
  39. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  40. package/{chunk-WXPVOQD7.js → chunk-6PELJ3DS.js} +533 -236
  41. package/{chunk-NFMHIUY3.js → chunk-7EMJBGCA.js} +966 -218
  42. package/{chunk-HYZHJ5GW.js → chunk-7YMUSSHQ.js} +93 -93
  43. package/chunk-ACTMNVHM.js +93 -0
  44. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  45. package/{chunk-UKWGR5SS.js → chunk-AUXHZ2M5.js} +186 -397
  46. package/{chunk-7MYYE7WX.js → chunk-B4PW6UAI.js} +61 -34
  47. package/{chunk-4DRWWIOL.js → chunk-B7ANJQWZ.js} +2 -2
  48. package/{chunk-XKQJJK4F.js → chunk-BAAKVSMZ.js} +4 -4
  49. package/{chunk-FQYMLZ6C.js → chunk-BFCXG6AJ.js} +16 -16
  50. package/{chunk-ZBT3WNBK.js → chunk-BJUDYFV5.js} +10 -2
  51. package/chunk-BMQ2MJUK.js +153 -0
  52. package/{chunk-TL6L5XUT.js → chunk-BNGW5ASC.js} +94 -16
  53. package/{chunk-JTK3TJYV.js → chunk-BTSYHR7J.js} +4 -4
  54. package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
  55. package/{chunk-JEDZAO7L.js → chunk-D2W6WRHT.js} +13 -8
  56. package/{chunk-6BEA566T.js → chunk-D76D3RTR.js} +2 -2
  57. package/{chunk-HQCSU3DI.js → chunk-DCLMZ5TX.js} +4 -4
  58. package/{chunk-L2ICPOAL.js → chunk-EFZKILX6.js} +4 -4
  59. package/{chunk-JBBZ5KUM.js → chunk-EHO5EGU4.js} +23 -76
  60. package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
  61. package/{chunk-ABQYVJBJ.js → chunk-ETZWFV6M.js} +1 -1
  62. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  63. package/{chunk-VHJLQHPQ.js → chunk-F64B2W3R.js} +110 -34
  64. package/{chunk-AQZRTHDZ.js → chunk-G4EMOUX3.js} +886 -154
  65. package/{chunk-XTUY5EL4.js → chunk-GJUKGFHG.js} +74 -16
  66. package/{chunk-XMGHGEN6.js → chunk-GMVELWJG.js} +3 -3
  67. package/chunk-GMZLP5DV.js +82 -0
  68. package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
  69. package/{chunk-N3OAPEZE.js → chunk-HBTA2SGQ.js} +97 -21
  70. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  71. package/{chunk-3CR2LC6X.js → chunk-HNRASX3X.js} +8 -8
  72. package/{chunk-CPH3W5A7.js → chunk-I3TQJXQ7.js} +94 -3
  73. package/{chunk-GRYGRGPS.js → chunk-IS5VEM2G.js} +140 -15
  74. package/{chunk-MJHQ3NRV.js → chunk-ISHYYQJC.js} +5 -3
  75. package/{chunk-ZAB3A45K.js → chunk-K7M4I3PF.js} +30 -7
  76. package/{chunk-2AYMFHUG.js → chunk-KQOD3G2X.js} +165 -15
  77. package/{chunk-YOXYA2GU.js → chunk-LNPYTNMG.js} +10 -5
  78. package/{chunk-F2CGG72C.js → chunk-LS2MI3B4.js} +45 -45
  79. package/{chunk-GII32WZW.js → chunk-M2EJHDJP.js} +3 -0
  80. package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
  81. package/{chunk-DNQPPRHY.js → chunk-N3XA2O6O.js} +1 -1
  82. package/{chunk-5DFFKASO.js → chunk-NILSKYOE.js} +3 -3
  83. package/chunk-OCZKATRC.js +129 -0
  84. package/{chunk-K7M3MWCE.js → chunk-OOSVFT6S.js} +2 -2
  85. package/{chunk-QCZX4FTW.js → chunk-OY5IJI2N.js} +194 -21
  86. package/{chunk-HMEMJ7GH.js → chunk-PAYUVQ6P.js} +7749 -1320
  87. package/{chunk-ASGDO77C.js → chunk-Q67DOFOO.js} +92 -4
  88. package/{chunk-UA5S3LQQ.js → chunk-QALRKMHF.js} +11 -10
  89. package/{chunk-RZANZZL2.js → chunk-QDSINZM3.js} +1 -1
  90. package/{chunk-DPQ2WVBY.js → chunk-QJLEMM2V.js} +1 -1
  91. package/{chunk-IIKPWSPX.js → chunk-R4SQ3LGW.js} +1 -1
  92. package/{chunk-UTCCPWB2.js → chunk-RZ6CQZB2.js} +34 -20
  93. package/{chunk-SAFZABH7.js → chunk-SV5IJK6K.js} +1 -1
  94. package/{chunk-576IMUGH.js → chunk-T5V7HA3K.js} +1 -1
  95. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  96. package/chunk-UNYJU5L6.js +780 -0
  97. package/{chunk-QFMFJZLO.js → chunk-V7E4PXQD.js} +1 -1
  98. package/{chunk-QHETQ3KI.js → chunk-VBSVA6CB.js} +2 -2
  99. package/{chunk-A2C4AKKM.js → chunk-VETFWL5K.js} +1 -1
  100. package/chunk-VJVNU77E.js +83 -0
  101. package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
  102. package/{chunk-3CMTBX3X.js → chunk-W2P25VGS.js} +25 -6
  103. package/{chunk-CLI4LFSM.js → chunk-WC6A2Q7S.js} +5 -3
  104. package/{chunk-Z33ARZCP.js → chunk-WT2IAJAJ.js} +4 -4
  105. package/chunk-X6YIXGPT.js +870 -0
  106. package/{chunk-5V4NJHRM.js → chunk-YMPTI7RZ.js} +9 -9
  107. package/{chunk-5NMZNPTN.js → chunk-YRIFJ6XQ.js} +13 -13
  108. package/{chunk-FZGV4FGK.js → chunk-YRRASA5Q.js} +268 -143
  109. package/{chunk-2F4VYGFW.js → chunk-Z5W7UMQV.js} +4 -3
  110. package/{chunk-ND2J3NRB.js → chunk-ZGJLSHER.js} +2 -2
  111. package/{chunk-VRLI2WNW.js → chunk-ZI2MEZMT.js} +314 -142
  112. package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
  113. package/commandRegistry-BP5JLW24.js +822 -0
  114. package/{contentThunks-VURN3DFW.js → contentThunks-2HYFUXUM.js} +29 -29
  115. package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  116. package/{createAgentAutomationAction-QZAAY77R.js → createAgentAutomationAction-DCKUSJH7.js} +29 -29
  117. package/{createDialogAction-CHGXVTAC.js → createDialogAction-NRIAEH2A.js} +32 -32
  118. package/{createPageAction-IOGAFIN7.js → createPageAction-AUJHHXGG.js} +35 -35
  119. package/{dbSlice-YXQ6RYIH.js → dbSlice-HFPIJT5P.js} +8 -8
  120. package/{deleteFile-YG6QMJLU.js → deleteFile-UEAD5A5Z.js} +3 -3
  121. package/{dialogCommands-XREAP6WQ.js → dialogCommands-UJRGCRN6.js} +42 -39
  122. package/{dialogSlice-DOPGWGS4.js → dialogSlice-AHU4XXIW.js} +35 -29
  123. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  124. package/{docCreateCommands-3PYZGSCL.js → docCreateCommands-ZOV3ZBLW.js} +39 -38
  125. package/{docDeleteCommands-3Y6MU44Q.js → docDeleteCommands-G4KAXJYQ.js} +39 -38
  126. package/{docReadCommands-UBANMAFR.js → docReadCommands-B2MM3JIT.js} +38 -37
  127. package/{docStore-SYYFBENY.js → docStore-SITH63V3.js} +9 -9
  128. package/{docUpdateCommands-4GK2X6BN.js → docUpdateCommands-2QNF5CYN.js} +39 -38
  129. package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
  130. package/{getPricing-F2C65RIX.js → getPricing-OX7B4R6B.js} +3 -3
  131. package/{handleSendMessageAction-NPVTY2GE.js → handleSendMessageAction-7ZMJMWLC.js} +72 -80
  132. package/index.js +74 -877
  133. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
  134. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
  135. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
  136. package/{machineCommands-I66X2XB7.js → machineCommands-YCTD5KOL.js} +75 -71
  137. package/{machineWsRunDispatch-W4FVBOUM.js → machineWsRunDispatch-JFMD4ZAW.js} +73 -69
  138. package/{memberThunks-5T4J6KXQ.js → memberThunks-SKFZ37VS.js} +9 -9
  139. package/{models-WW7VFNXB.js → models-T3SG6MJ5.js} +2 -2
  140. package/oauthTokenStore-ITEB663N.js +23 -0
  141. package/{offlineMarxistsAgentCommand-JEWCIAWM.js → offlineMarxistsAgentCommand-HGXZV4XJ.js} +1 -1
  142. package/package.json +1 -1
  143. package/pdf-U6KSUEZZ.js +26435 -0
  144. package/processSpawn-SOAV3FEV.js +11 -0
  145. package/profileConfig-ZGOFORWV.js +43 -0
  146. package/{providerPresetApply-OCWWKBSD.js → providerPresetApply-2QTBYN36.js} +7 -7
  147. package/{providerRegistry-ZJQU7AJ7.js → providerRegistry-SVXE4G4T.js} +7 -7
  148. package/{read-M2Q6WEKB.js → read-IEJLLUXY.js} +5 -5
  149. package/{readDocTool-T37P3YPB.js → readDocTool-4SPYCP2Y.js} +5 -3
  150. package/{readlineWorkspace-VY5AMOGR.js → readlineWorkspace-M3PLTBLD.js} +2396 -2018
  151. package/{removeDialogAgentAction-HB3JBVAI.js → removeDialogAgentAction-LILXTOQY.js} +14 -14
  152. package/{runAgentClientLoop-3NDADLVE.js → runAgentClientLoop-QMCXBOBH.js} +55 -55
  153. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
  154. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  155. package/{setDialogExtraReferencesAction-4XLHRV37.js → setDialogExtraReferencesAction-LVNHLNT5.js} +10 -10
  156. package/{setPrimaryDialogAgentAction-C3JOFC4W.js → setPrimaryDialogAgentAction-DCKO5NTW.js} +14 -14
  157. package/{settingSlice-CZRURSTH.js → settingSlice-CNE75ISY.js} +10 -10
  158. package/{spaceCommands-ENYCUUZH.js → spaceCommands-3U6OHM6O.js} +39 -38
  159. package/{streamAgentChatTurn-634OFUSR.js → streamAgentChatTurn-JPMJQSEE.js} +144 -84
  160. package/{switchDialogAgentAction-C6KVUKJP.js → switchDialogAgentAction-JSYUQ5CG.js} +11 -11
  161. package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
  162. package/{toolApiClient-7PSIFQPJ.js → toolApiClient-INIQCPGY.js} +3 -3
  163. package/{tools-ILBLCF7D.js → tools-XQ5GIH6P.js} +49 -49
  164. package/{tuiSummaryLlmCaller-LFUBZKXK.js → tuiSummaryLlmCaller-L63PDJUD.js} +16 -15
  165. package/{updateCommands-2M74UL7P.js → updateCommands-ECWKIWLQ.js} +3 -3
  166. package/{updateDialogTitleAction-RKFET73N.js → updateDialogTitleAction-EGAZMLUB.js} +32 -32
  167. package/agentRecordCommands-FVVVCQFM.js +0 -126
  168. package/chunk-Q5FJJ6XI.js +0 -103
  169. package/chunk-S7Z2HMCN.js +0 -25
  170. package/chunk-WS22FPWT.js +0 -79
  171. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  172. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  173. 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-KQOD3G2X.js";
8
+ import {
9
+ fetchWithTransientRetry
10
+ } from "./chunk-5UTFL4QJ.js";
7
11
  import {
8
12
  CORE_DRAIN_REASON,
9
13
  DRAIN_EXHAUSTED_USER_MESSAGE,
@@ -11,6 +15,13 @@ import {
11
15
  normalizeNonNegativeMs,
12
16
  parseRetryAfterHeaderMs
13
17
  } from "./chunk-3L2WKC3W.js";
18
+ import {
19
+ getUserDataItemTimestamp,
20
+ mergeAndDedupUserData
21
+ } from "./chunk-KQHGZWSV.js";
22
+ import {
23
+ waitForAbortableDelay
24
+ } from "./chunk-N4G4PKQ6.js";
14
25
  import {
15
26
  TASK_PREVIEW_MAX,
16
27
  buildDelegatedTaskContent,
@@ -21,26 +32,10 @@ import {
21
32
  formatStatusRunCard,
22
33
  formatStopRunCard,
23
34
  resolveRunLabel
24
- } from "./chunk-NTW5GWDM.js";
25
- import {
26
- omitNullishAgentSummaryFields,
27
- sortSafeAgentSummaries,
28
- summarizeCredentialGroups,
29
- toCompactAgentSummary,
30
- toSafeAgentSummary,
31
- toUnavailableAgentSummary
32
- } from "./chunk-2AYMFHUG.js";
33
- import {
34
- getUserDataItemTimestamp,
35
- mergeAndDedupUserData
36
- } from "./chunk-KQHGZWSV.js";
35
+ } from "./chunk-3VNWWVKB.js";
37
36
  import {
38
- readDocFunc,
39
- readDocFunctionSchema,
40
- readPageFunc,
41
- readPageFunctionSchema,
42
- slateToSimplifiedMarkdown
43
- } from "./chunk-ZBT3WNBK.js";
37
+ createDialogAction
38
+ } from "./chunk-YMPTI7RZ.js";
44
39
  import {
45
40
  addMemberSpace,
46
41
  fetchAuthoritativeRemoteSpace,
@@ -52,27 +47,10 @@ import {
52
47
  setMembershipRejected,
53
48
  setSpaceInitialized,
54
49
  updateMemberSpaceName
55
- } from "./chunk-3CR2LC6X.js";
56
- import {
57
- ToolApiError,
58
- buildToolRequestHeaders,
59
- callToolApi,
60
- getRequestConfig,
61
- getToolBaseUrl,
62
- getToolRequestContext
63
- } from "./chunk-HQCSU3DI.js";
64
- import {
65
- setDialogExtraReferencesAction
66
- } from "./chunk-JTK3TJYV.js";
67
- import {
68
- waitForAbortableDelay
69
- } from "./chunk-N4G4PKQ6.js";
50
+ } from "./chunk-HNRASX3X.js";
70
51
  import {
71
52
  markdownToSlate
72
- } from "./chunk-FZGV4FGK.js";
73
- import {
74
- extractMentionsFromSlate
75
- } from "./chunk-MEYIRKDN.js";
53
+ } from "./chunk-YRRASA5Q.js";
76
54
  import {
77
55
  slateToRenderMarkdown
78
56
  } from "./chunk-63W5N6P3.js";
@@ -81,10 +59,28 @@ import {
81
59
  } from "./chunk-VF4K2QE6.js";
82
60
  import {
83
61
  createDocState
84
- } from "./chunk-5DFFKASO.js";
62
+ } from "./chunk-NILSKYOE.js";
85
63
  import {
86
- createDialogAction
87
- } from "./chunk-5V4NJHRM.js";
64
+ setDialogExtraReferencesAction
65
+ } from "./chunk-BTSYHR7J.js";
66
+ import {
67
+ ToolApiError,
68
+ buildToolRequestHeaders,
69
+ callToolApi,
70
+ getRequestConfig,
71
+ getToolBaseUrl,
72
+ getToolRequestContext
73
+ } from "./chunk-DCLMZ5TX.js";
74
+ import {
75
+ readDocFunc,
76
+ readDocFunctionSchema,
77
+ readPageFunc,
78
+ readPageFunctionSchema,
79
+ resolvePageReadMarkdown
80
+ } from "./chunk-BJUDYFV5.js";
81
+ import {
82
+ extractMentionsFromSlate
83
+ } from "./chunk-MEYIRKDN.js";
88
84
  import {
89
85
  DEFAULT_COLLAPSED_CATEGORIES,
90
86
  addContentToSpace,
@@ -102,7 +98,7 @@ import {
102
98
  updateContentCategory,
103
99
  updateContentTitle,
104
100
  writeStoredCollapsedCategories
105
- } from "./chunk-FQYMLZ6C.js";
101
+ } from "./chunk-BFCXG6AJ.js";
106
102
  import {
107
103
  getCurrentSpaceId,
108
104
  getCurrentSpaceIdRaw,
@@ -124,31 +120,34 @@ import {
124
120
  selectMsgById,
125
121
  uiAskChoiceFunc,
126
122
  uiAskChoiceFunctionSchema
127
- } from "./chunk-HMEMJ7GH.js";
123
+ } from "./chunk-PAYUVQ6P.js";
128
124
  import {
129
125
  createAgent,
130
126
  deleteServerSyncedCredential,
131
127
  runLlm,
132
128
  streamAgentChatTurn,
133
129
  updateAgent
134
- } from "./chunk-TVNI5FLG.js";
130
+ } from "./chunk-46CRK7XP.js";
135
131
  import {
136
132
  getActiveDialogKey,
137
133
  selectCurrentDialogKey,
138
134
  selectPendingRawDataByPageKey
139
- } from "./chunk-6YTOJY35.js";
135
+ } from "./chunk-6D2JFXLY.js";
140
136
  import {
141
137
  require_react
142
138
  } from "./chunk-YDH3FDFQ.js";
139
+ import {
140
+ shareResourceAction
141
+ } from "./chunk-GMVELWJG.js";
143
142
  import {
144
143
  listBuiltinSkills,
145
144
  resolveBuiltinCapability,
146
145
  resolveBuiltinSkillByName,
147
146
  resolveBuiltinSkillEntry
148
- } from "./chunk-2ADBVBEM.js";
147
+ } from "./chunk-55VQ4OPL.js";
149
148
  import {
150
149
  CAPABILITY_PACKS
151
- } from "./chunk-CLI4LFSM.js";
150
+ } from "./chunk-WC6A2Q7S.js";
152
151
  import {
153
152
  buildSkillDocMarkdown,
154
153
  normalizeSkillModalities,
@@ -156,7 +155,7 @@ import {
156
155
  parseExternalSkillMarkdown,
157
156
  parseSkillDocProtocol,
158
157
  resolvePageSkillMetadata
159
- } from "./chunk-Q554LLSI.js";
158
+ } from "./chunk-AUDNYVRC.js";
160
159
  import {
161
160
  DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
162
161
  NOLO_WORKSPACE_TOOL_NAMES,
@@ -173,62 +172,60 @@ import {
173
172
  redactAgentRecordForWorkspaceTool,
174
173
  resolveNoloDialogInput,
175
174
  verifyNoloDialogSubjectRefQuery
176
- } from "./chunk-YOXYA2GU.js";
177
- import {
178
- isAgentUnavailableNow
179
- } from "./chunk-CJCJF5XB.js";
175
+ } from "./chunk-LNPYTNMG.js";
180
176
  import {
181
- buildDatabaseFileContentUrl
182
- } from "./chunk-VHJLQHPQ.js";
177
+ buildDatabaseFileContentUrl,
178
+ clipCompactText
179
+ } from "./chunk-F64B2W3R.js";
183
180
  import {
184
- DEFAULT_MODEL
185
- } from "./chunk-VRLI2WNW.js";
181
+ createFileCredentialBroker
182
+ } from "./chunk-ESRMFY7G.js";
186
183
  import {
187
184
  compactWhitespace
188
185
  } from "./chunk-DWLEOOGR.js";
189
- import {
190
- createFileCredentialBroker
191
- } from "./chunk-HVURBGF3.js";
192
186
  import {
193
187
  toErrorMessage
194
188
  } from "./chunk-HNMXYYJR.js";
189
+ import {
190
+ DEFAULT_MODEL,
191
+ clampReasoningEffort,
192
+ resolveModelReasoningCapabilityWithCache
193
+ } from "./chunk-ZI2MEZMT.js";
194
+ import {
195
+ UNCATEGORIZED_ID,
196
+ addContentAction,
197
+ checkSpaceMembership
198
+ } from "./chunk-B7ANJQWZ.js";
199
+ import {
200
+ createSpaceKey,
201
+ normalizeSpaceId
202
+ } from "./chunk-UAD2WT54.js";
195
203
  import {
196
204
  canonicalizeToolName,
197
205
  canonicalizeToolNames
198
206
  } from "./chunk-O6OSWFZQ.js";
199
- import {
200
- shareResourceAction
201
- } from "./chunk-XMGHGEN6.js";
202
207
  import {
203
208
  AGENT_UPDATE_FIELD_NAMES,
204
209
  normalizeAgentUpdateFieldList,
205
210
  selectAutoApproveSelfUpdateFields,
206
211
  selectCurrentServer,
207
212
  selectSyncServers
208
- } from "./chunk-PH5J5VUY.js";
213
+ } from "./chunk-3IYMTWYZ.js";
209
214
  import {
210
215
  asRecordOrEmpty
211
216
  } from "./chunk-KX6YBIHG.js";
212
- import {
213
- UNCATEGORIZED_ID,
214
- addContentAction,
215
- checkSpaceMembership
216
- } from "./chunk-4DRWWIOL.js";
217
- import {
218
- createSpaceKey,
219
- normalizeSpaceId
220
- } from "./chunk-UAD2WT54.js";
221
217
  import {
222
218
  patch,
223
219
  read,
224
220
  readAndWait,
225
221
  readAndWaitAction,
222
+ readFileContentAction,
226
223
  remove,
227
224
  selectById,
228
225
  selectEntities,
229
226
  toTimestampMs,
230
227
  write
231
- } from "./chunk-UA5S3LQQ.js";
228
+ } from "./chunk-QALRKMHF.js";
232
229
  import {
233
230
  SEPARATOR,
234
231
  TYPE_STORAGE_PREFIXES,
@@ -249,7 +246,7 @@ import {
249
246
  splitKey,
250
247
  toTrimmedString,
251
248
  ulid
252
- } from "./chunk-VMFTFOWF.js";
249
+ } from "./chunk-3AH7LNUB.js";
253
250
  import {
254
251
  asOptionalFiniteNumber
255
252
  } from "./chunk-WWC7I6TA.js";
@@ -258,10 +255,7 @@ import {
258
255
  } from "./chunk-QSJ3HFEF.js";
259
256
  import {
260
257
  readAction
261
- } from "./chunk-L2ICPOAL.js";
262
- import {
263
- extractCustomId
264
- } from "./chunk-GII32WZW.js";
258
+ } from "./chunk-EFZKILX6.js";
265
259
  import {
266
260
  DEVICE_LOCAL_OWNER_ID,
267
261
  createAsyncThunk,
@@ -273,7 +267,7 @@ import {
273
267
  resolveEffectiveSpaceActorId,
274
268
  resolveRecordOwnerUserId,
275
269
  selectRuntimeSnapshot
276
- } from "./chunk-UKWGR5SS.js";
270
+ } from "./chunk-AUXHZ2M5.js";
277
271
  import {
278
272
  isAbortError
279
273
  } from "./chunk-QOKAKDPE.js";
@@ -289,6 +283,9 @@ import {
289
283
  import {
290
284
  isRecord
291
285
  } from "./chunk-KUG52IAP.js";
286
+ import {
287
+ extractCustomId
288
+ } from "./chunk-M2EJHDJP.js";
292
289
  import {
293
290
  asTrimmedString
294
291
  } from "./chunk-3EUW3WEO.js";
@@ -308,6 +305,69 @@ import {
308
305
  __toESM
309
306
  } from "./chunk-4VNS5WPM.js";
310
307
 
308
+ // packages/ai/tools/agentAutomationSchemas.ts
309
+ var agentAutomationTriggerSchema = {
310
+ oneOf: [
311
+ {
312
+ type: "object",
313
+ description: "Cron trigger.",
314
+ properties: {
315
+ type: { type: "string", enum: ["cron"] },
316
+ expression: {
317
+ type: "string",
318
+ description: "Cron expression, e.g. 0 9 * * *."
319
+ },
320
+ timezone: {
321
+ type: "string",
322
+ description: "Optional timezone, e.g. Asia/Shanghai."
323
+ }
324
+ },
325
+ required: ["type", "expression"],
326
+ additionalProperties: false
327
+ },
328
+ {
329
+ type: "object",
330
+ 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.",
331
+ properties: {
332
+ type: { type: "string", enum: ["email"] },
333
+ acceptAll: {
334
+ type: "boolean",
335
+ description: "When true the automation fires on every inbound email for the bound agent mailbox \u2014 no content filtering."
336
+ },
337
+ fromContains: {
338
+ type: "string",
339
+ description: "Case-insensitive substring match against sender email address."
340
+ },
341
+ subjectContains: {
342
+ type: "string",
343
+ description: "Case-insensitive substring match against email subject."
344
+ },
345
+ fromContainsAny: {
346
+ type: "array",
347
+ description: "OR'd substring match against sender email \u2014 matches if ANY listed needle appears in the From header.",
348
+ items: { type: "string" },
349
+ minItems: 1
350
+ },
351
+ subjectContainsAny: {
352
+ type: "array",
353
+ description: "OR'd substring match against email subject \u2014 matches if ANY listed needle appears in the Subject.",
354
+ items: { type: "string" },
355
+ minItems: 1
356
+ }
357
+ },
358
+ required: ["type"],
359
+ anyOf: [
360
+ { required: ["acceptAll"] },
361
+ { required: ["fromContains"] },
362
+ { required: ["subjectContains"] },
363
+ { required: ["fromContainsAny"] },
364
+ { required: ["subjectContainsAny"] }
365
+ ],
366
+ additionalProperties: false
367
+ }
368
+ ]
369
+ };
370
+
311
371
  // packages/ai/tools/modelUsageTools.ts
312
372
  var queryModelUsageFunctionSchema = {
313
373
  name: "queryModelUsage",
@@ -432,7 +492,7 @@ var queryUserGrowthReportFunctionSchema = {
432
492
  };
433
493
  var createAgentAutomationFunctionSchema = {
434
494
  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",
495
+ 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
496
  parameters: {
437
497
  type: "object",
438
498
  properties: {
@@ -442,29 +502,9 @@ var createAgentAutomationFunctionSchema = {
442
502
  },
443
503
  instruction: {
444
504
  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
505
+ 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
506
  },
507
+ trigger: agentAutomationTriggerSchema,
468
508
  ownerAgentKey: {
469
509
  type: "string",
470
510
  description: "\u6267\u884C\u8BE5 automation \u7684 agentKey\u3002\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D agent\u3002"
@@ -489,13 +529,64 @@ var createAgentAutomationFunctionSchema = {
489
529
  },
490
530
  runOnceNow: {
491
531
  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",
532
+ 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
533
  default: false
494
534
  }
495
535
  },
496
536
  required: ["instruction", "trigger"]
497
537
  }
498
538
  };
539
+ var updateAgentAutomationFunctionSchema = {
540
+ name: "updateAgentAutomation",
541
+ 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",
542
+ parameters: {
543
+ type: "object",
544
+ properties: {
545
+ automationKey: {
546
+ type: "string",
547
+ description: "automation \u7684 dbKey\uFF08agent-automation-{userId}-{id}\uFF09\u3002"
548
+ },
549
+ title: { type: "string", description: "\u65B0\u6807\u9898\u3002" },
550
+ instruction: { type: "string", description: "\u65B0 instruction\u3002" },
551
+ status: {
552
+ type: "string",
553
+ enum: ["active", "paused"],
554
+ description: "automation \u72B6\u6001\u3002paused \u65F6 dispatcher \u4E0D\u518D\u89E6\u53D1 run\u3002"
555
+ },
556
+ trigger: agentAutomationTriggerSchema,
557
+ spaceId: { type: "string", description: "\u65B0\u7684 spaceId\uFF1B\u4F20\u7A7A\u5B57\u7B26\u4E32\u6E05\u9664\u3002" },
558
+ subjectRefs: {
559
+ type: "array",
560
+ description: "\u65B0\u7684 subjectRefs\uFF1B\u4F20\u7A7A\u6570\u7EC4\u6E05\u9664\u3002",
561
+ items: {
562
+ type: "object",
563
+ properties: {
564
+ kind: { type: "string" },
565
+ id: { type: "string" },
566
+ role: { type: "string" }
567
+ },
568
+ required: ["kind", "id"],
569
+ additionalProperties: true
570
+ }
571
+ }
572
+ },
573
+ required: ["automationKey"]
574
+ }
575
+ };
576
+ var deleteAgentAutomationFunctionSchema = {
577
+ name: "deleteAgentAutomation",
578
+ 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",
579
+ parameters: {
580
+ type: "object",
581
+ properties: {
582
+ automationKey: {
583
+ type: "string",
584
+ description: "automation \u7684 dbKey\uFF08agent-automation-{userId}-{id}\uFF09\u3002"
585
+ }
586
+ },
587
+ required: ["automationKey"]
588
+ }
589
+ };
499
590
  var notifyUserFunctionSchema = {
500
591
  name: "notifyUser",
501
592
  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 +628,8 @@ var serverOnlyResult = (toolName) => ({
537
628
  var queryModelUsageFunc = async () => serverOnlyResult("queryModelUsage");
538
629
  var queryUserGrowthReportFunc = async () => serverOnlyResult("queryUserGrowthReport");
539
630
  var createAgentAutomationFunc = async () => serverOnlyResult("createAgentAutomation");
631
+ var updateAgentAutomationFunc = async () => serverOnlyResult("updateAgentAutomation");
632
+ var deleteAgentAutomationFunc = async () => serverOnlyResult("deleteAgentAutomation");
540
633
  var notifyUserFunc = async () => serverOnlyResult("notifyUser");
541
634
 
542
635
  // packages/ai/tools/toolResultError.ts
@@ -710,6 +803,22 @@ var buildPatch = (args) => {
710
803
  if (reasoning_effort !== void 0) patch2.reasoning_effort = reasoning_effort;
711
804
  return patch2;
712
805
  };
806
+ var calibrateReasoningEffortInPatch = (patch2, previousAgent) => {
807
+ if (patch2.reasoning_effort === void 0) return void 0;
808
+ const provider = patch2.provider ?? previousAgent.provider ?? void 0;
809
+ const model = patch2.model ?? previousAgent.model ?? void 0;
810
+ const cap = resolveModelReasoningCapabilityWithCache(provider, model);
811
+ if (!cap.found) return void 0;
812
+ const requested = String(patch2.reasoning_effort);
813
+ const calibrated = clampReasoningEffort(requested, provider ?? null, model ?? null);
814
+ if (!calibrated) {
815
+ delete patch2.reasoning_effort;
816
+ 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`;
817
+ }
818
+ patch2.reasoning_effort = calibrated;
819
+ if (calibrated === requested) return void 0;
820
+ return `\u2139\uFE0F reasoning_effort \u5DF2\u6309 ${model ?? "\u5F53\u524D\u6A21\u578B"} \u7684\u771F\u5B9E\u6863\u4F4D\u4ECE "${requested}" \u5438\u9644\u4E3A "${calibrated}"\u3002`;
821
+ };
713
822
  var AGENT_UPDATE_FIELD_NAME_SET = new Set(AGENT_UPDATE_FIELD_NAMES);
714
823
  var listRequestedFields = (args) => Object.keys(args).filter(
715
824
  (key) => key !== "agentId" && key !== "__confirmedSelfEvolution" && AGENT_UPDATE_FIELD_NAME_SET.has(key) && args[key] !== void 0
@@ -911,7 +1020,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
911
1020
  workspace: { mode: "lease" }
912
1021
  };
913
1022
  var findModelConfig = async (modelName, provider) => {
914
- const { ALL_MODELS } = await import("./models-WW7VFNXB.js");
1023
+ const { ALL_MODELS } = await import("./models-T3SG6MJ5.js");
915
1024
  const name = toTrimmedString(modelName);
916
1025
  const prov = toTrimmedString(provider ?? "");
917
1026
  if (!name) return null;
@@ -1156,7 +1265,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
1156
1265
  const trimmedModel = toTrimmedString(model);
1157
1266
  const trimmedProvider = toTrimmedString(provider);
1158
1267
  const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
1159
- const { getModelPricing } = await import("./getPricing-F2C65RIX.js");
1268
+ const { getModelPricing } = await import("./getPricing-OX7B4R6B.js");
1160
1269
  const normalizedTools = tools ?? [];
1161
1270
  const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
1162
1271
  const formData = {
@@ -1292,6 +1401,7 @@ ${availableList}`
1292
1401
  formData = await buildPlatformFormDataFromArgs(args);
1293
1402
  formData.linkedSpaces = resolvedLinkedSpaces;
1294
1403
  }
1404
+ const effortNote = calibrateReasoningEffortInPatch(formData, formData);
1295
1405
  const expectedProviderConfig = getForkedAgentProviderExpectation(formData);
1296
1406
  try {
1297
1407
  const agent = await thunkApi.dispatch(
@@ -1337,6 +1447,9 @@ ${availableList}`
1337
1447
  if (typeof currentBalance === "number") {
1338
1448
  lines.push(`- \u5F53\u524D\u4F59\u989D: ${currentBalance}`);
1339
1449
  }
1450
+ if (effortNote) {
1451
+ lines.push(effortNote);
1452
+ }
1340
1453
  return {
1341
1454
  rawData: agent,
1342
1455
  displayData: lines.join("\n")
@@ -1379,6 +1492,7 @@ async function updateAgentToolFunc(args, thunkApi) {
1379
1492
  }
1380
1493
  const agentId = extractAgentId(dbKey);
1381
1494
  const formData = buildPatch(args);
1495
+ const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
1382
1496
  const requestedFields = listRequestedFields(args);
1383
1497
  assertAgentUpdateConfirmation({
1384
1498
  scope: "generic",
@@ -1401,7 +1515,8 @@ async function updateAgentToolFunc(args, thunkApi) {
1401
1515
  );
1402
1516
  return {
1403
1517
  rawData: rawDataWithUpdateInfo,
1404
- displayData: formatUpdatedAgentOutput(agent)
1518
+ displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
1519
+ ${effortNote}` : "")
1405
1520
  };
1406
1521
  }
1407
1522
 
@@ -3259,7 +3374,7 @@ async function readFunc(args, thunkApi, context) {
3259
3374
  }
3260
3375
  if (dbKey.startsWith("PAGE-") || result.type === "page" /* DOC */) {
3261
3376
  const pageData = result;
3262
- const markdownContent = slateToSimplifiedMarkdown(pageData.slateData || []);
3377
+ const markdownContent = resolvePageReadMarkdown(pageData);
3263
3378
  return {
3264
3379
  rawData: {
3265
3380
  ...pageData,
@@ -3397,92 +3512,6 @@ async function listUserSpacesFunc(args, thunkApi, context) {
3397
3512
  }
3398
3513
  }
3399
3514
 
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
3515
  // packages/ai/agent/publicAgentDiscovery.ts
3487
3516
  async function fetchPublicAgentsForDiscovery(args) {
3488
3517
  const fetchImpl = args.fetchImpl ?? fetch;
@@ -3945,7 +3974,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3945
3974
  const deletedDialogIds = [];
3946
3975
  const deletedDialogKeys = [];
3947
3976
  const failures = [];
3948
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-DOPGWGS4.js");
3977
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-AHU4XXIW.js");
3949
3978
  for (const target of targets) {
3950
3979
  try {
3951
3980
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -4041,6 +4070,10 @@ var listAgentsFunctionSchema = {
4041
4070
  },
4042
4071
  publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
4043
4072
  showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
4073
+ query: {
4074
+ type: "string",
4075
+ description: "Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey. Use to locate specific candidates like 'opus', 'devin', or 'claude'."
4076
+ },
4044
4077
  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
4078
  }
4046
4079
  }
@@ -4083,16 +4116,15 @@ async function listAgentsFunc(args, thunkApi) {
4083
4116
  }
4084
4117
  }
4085
4118
  const userId = runtime?.currentUserId ?? void 0;
4086
- const agents = [...Array.from(recordsMap.values()), ...publicRecords].map(
4087
- (record) => toSafeAgentSummary(record, {
4119
+ const discovery = assembleAgentDiscoveryResult({
4120
+ records: [...Array.from(recordsMap.values()), ...publicRecords],
4121
+ summaryOptions: (record) => ({
4088
4122
  favoritesMap,
4089
4123
  userId,
4090
4124
  publicRecordExists: publicRecords.includes(record) ? true : void 0
4091
- })
4092
- );
4093
- const discovery = buildAgentDiscoveryResult({
4094
- agents,
4125
+ }),
4095
4126
  scope: args?.scope,
4127
+ query: args?.query,
4096
4128
  publicOnly: args?.publicOnly,
4097
4129
  showUnavailable: args?.showUnavailable,
4098
4130
  verbose: args?.verbose
@@ -4123,6 +4155,30 @@ var readAgentFunctionSchema = {
4123
4155
  required: ["agent"]
4124
4156
  }
4125
4157
  };
4158
+ function formatReadAgentCard(agentKey, record) {
4159
+ if (!isRecord(record)) {
4160
+ return jsonPreview({ agentKey, record });
4161
+ }
4162
+ const name = asTrimmedString(record.name) || "(\u672A\u547D\u540D Agent)";
4163
+ const model = asTrimmedString(record.model) || "\u2014";
4164
+ const provider = asTrimmedString(record.provider) || asTrimmedString(record.apiSource) || "\u2014";
4165
+ const apiSource = asTrimmedString(record.apiSource) || "\u2014";
4166
+ const isPublic = record.isPublic === true ? "\u516C\u5F00" : "\u79C1\u6709";
4167
+ 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)";
4168
+ const lines = [
4169
+ `\u{1F916} Agent: ${name} (${agentKey})`,
4170
+ `\u2022 \u6A21\u578B: ${model} (${provider})`,
4171
+ `\u2022 \u6765\u6E90: ${apiSource} \xB7 ${isPublic}`,
4172
+ `\u2022 \u5DE5\u5177: ${tools}`
4173
+ ];
4174
+ if (typeof record.customProviderUrl === "string" && record.customProviderUrl.trim()) {
4175
+ lines.push(`\u2022 \u7AEF\u70B9: ${record.customProviderUrl.trim()}`);
4176
+ }
4177
+ if (typeof record.prompt === "string" && record.prompt.trim()) {
4178
+ lines.push(`\u2022 \u63D0\u793A\u8BCD: ${clipCompactText(record.prompt.trim(), 200)}`);
4179
+ }
4180
+ return lines.join("\n");
4181
+ }
4126
4182
  async function readAgentFunc(args, thunkApi) {
4127
4183
  const runtime = getRuntime2(thunkApi);
4128
4184
  const userId = runtime?.currentUserId;
@@ -4134,16 +4190,14 @@ async function readAgentFunc(args, thunkApi) {
4134
4190
  for (const candidate of candidates) {
4135
4191
  const record = await readBestRecord(thunkApi, candidate, true);
4136
4192
  if (record) {
4193
+ const redacted = redactAgentRecordForWorkspaceTool(record);
4137
4194
  return {
4138
4195
  rawData: {
4139
4196
  success: true,
4140
4197
  agentKey: candidate,
4141
- record: redactAgentRecordForWorkspaceTool(record)
4198
+ record: redacted
4142
4199
  },
4143
- displayData: jsonPreview({
4144
- agentKey: candidate,
4145
- record: redactAgentRecordForWorkspaceTool(record)
4146
- })
4200
+ displayData: formatReadAgentCard(candidate, redacted)
4147
4201
  };
4148
4202
  }
4149
4203
  }
@@ -4254,7 +4308,7 @@ var readSkillDocFunctionSchema = {
4254
4308
  }
4255
4309
  };
4256
4310
  async function readSkillDocFunc(args, thunkApi) {
4257
- const { buildReadDocResult } = await import("./readDocTool-T37P3YPB.js");
4311
+ const { buildReadDocResult } = await import("./readDocTool-4SPYCP2Y.js");
4258
4312
  const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
4259
4313
  if (typeof id !== "string" || !id.trim()) {
4260
4314
  throw new Error("readSkillDoc requires id or doc.");
@@ -5057,7 +5111,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
5057
5111
  const spaceKey = createSpaceKey.space(spaceId);
5058
5112
  const readSpace = async (dbKey) => {
5059
5113
  try {
5060
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-YXQ6RYIH.js");
5114
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-HFPIJT5P.js");
5061
5115
  if (fresh) {
5062
5116
  return await dispatch(readAndWait2(dbKey)).unwrap();
5063
5117
  }
@@ -5698,6 +5752,23 @@ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5698
5752
  var normalizeContains = (value) => asTrimmedLowercaseString(value);
5699
5753
  var participantList = (emails) => Array.isArray(emails) ? asTrimmedNonEmptyStringArray(emails).map((email) => ({ email })) : [];
5700
5754
  var emailText = (email) => [email?.subject, email?.from?.email, email?.from?.name, email?.text, email?.html].filter((value) => typeof value === "string").join("\n");
5755
+ var emailAttachments = (email) => Array.isArray(email?.attachments) ? email.attachments : [];
5756
+ var attachmentPreview = (attachment) => {
5757
+ const name = asOptionalTrimmedString(attachment?.filename) ?? "attachment";
5758
+ const contentType = asOptionalTrimmedString(attachment?.contentType) ?? "application/octet-stream";
5759
+ const fileId = asOptionalTrimmedString(attachment?.fileId) ?? "unknown-file";
5760
+ const size = Number.isFinite(Number(attachment?.size)) ? ` | ${Number(attachment.size)} bytes` : "";
5761
+ return `- ${name} | ${contentType}${size} | fileId: ${fileId}`;
5762
+ };
5763
+ var attachmentListPreview = (email) => {
5764
+ const attachments = emailAttachments(email);
5765
+ if (attachments.length === 0) return "";
5766
+ return [
5767
+ `\u9644\u4EF6\uFF08${attachments.length}\uFF09\uFF1A`,
5768
+ ...attachments.map(attachmentPreview),
5769
+ "\u8BFB\u53D6\u9644\u4EF6\uFF1A\u518D\u6B21\u8C03\u7528 email_read\uFF0C\u4F20\u5165\u5F53\u524D dbKey \u548C attachmentFileId\u3002"
5770
+ ].join("\n");
5771
+ };
5701
5772
  var matchesWaitFilters = (email, args) => {
5702
5773
  const subjectContains = normalizeContains(args.subjectContains);
5703
5774
  const fromContains = normalizeContains(args.fromContains);
@@ -5723,6 +5794,58 @@ var stripHtml = (html) => typeof html === "string" ? compactWhitespace(
5723
5794
  html.replace(/<a\b[^>]*href=["']([^"']+)["'][^>]*>/gi, " $1 ").replace(/<[^>]+>/g, " ")
5724
5795
  ) : "";
5725
5796
  var cleanUrl = (url) => url.replace(/[),.;\]}>]+$/g, "");
5797
+ var extractPdfText = async (blob) => {
5798
+ const pdfjsLib = await import("./pdf-U6KSUEZZ.js");
5799
+ if (typeof window !== "undefined" && pdfjsLib.GlobalWorkerOptions && !pdfjsLib.GlobalWorkerOptions.workerSrc) {
5800
+ pdfjsLib.GlobalWorkerOptions.workerSrc = "/public/assets/pdf.worker.mjs";
5801
+ }
5802
+ const data = await blob.arrayBuffer();
5803
+ const pdf = await pdfjsLib.getDocument({ data }).promise;
5804
+ const pages = [];
5805
+ for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber += 1) {
5806
+ const page = await pdf.getPage(pageNumber);
5807
+ const textContent = await page.getTextContent();
5808
+ const text = textContent.items.map((item) => typeof item?.str === "string" ? item.str : "").filter(Boolean).join(" ").trim();
5809
+ if (text) pages.push(`--- page ${pageNumber} ---
5810
+ ${text}`);
5811
+ }
5812
+ return pages.join("\n\n").trim();
5813
+ };
5814
+ var readEmailAttachment = async (email, fileId, maxChars, thunkApi) => {
5815
+ const attachment = emailAttachments(email).find(
5816
+ (item) => asOptionalTrimmedString(item?.fileId) === fileId
5817
+ );
5818
+ if (!attachment) {
5819
+ throw new Error(`\u9644\u4EF6 ${fileId} \u4E0D\u5C5E\u4E8E\u90AE\u4EF6 ${email?.dbKey || "unknown"}`);
5820
+ }
5821
+ const result = await readFileContentAction({ fileId }, thunkApi);
5822
+ const blob = result.blob;
5823
+ const contentType = (asOptionalTrimmedString(attachment?.contentType) || asOptionalTrimmedString(blob.type) || "application/octet-stream").toLowerCase();
5824
+ const filename = asOptionalTrimmedString(attachment?.filename) ?? fileId;
5825
+ let content;
5826
+ if (contentType === "application/pdf" || filename.toLowerCase().endsWith(".pdf")) {
5827
+ content = await extractPdfText(blob);
5828
+ if (!content) {
5829
+ throw new Error(
5830
+ `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`
5831
+ );
5832
+ }
5833
+ } else if (contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("csv") || contentType.includes("xml") || /\.(txt|md|csv|json|xml|html?|log)$/i.test(filename)) {
5834
+ content = await blob.text();
5835
+ } else {
5836
+ throw new Error(
5837
+ `\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`
5838
+ );
5839
+ }
5840
+ const truncated = content.length > maxChars;
5841
+ return {
5842
+ attachment,
5843
+ content: truncated ? content.slice(0, maxChars) : content,
5844
+ totalChars: content.length,
5845
+ truncated,
5846
+ source: result.source
5847
+ };
5848
+ };
5726
5849
  var extractEmailVerificationArtifacts = ({
5727
5850
  text,
5728
5851
  html
@@ -5790,13 +5913,25 @@ var emailSearchFunctionSchema = {
5790
5913
  };
5791
5914
  var emailReadFunctionSchema = {
5792
5915
  name: "email_read",
5793
- description: "\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
5916
+ description: [
5917
+ "\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
5918
+ "\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",
5919
+ "PDF \u4F18\u5148\u76F4\u63A5\u63D0\u53D6\u6587\u5B57\u5C42\uFF1B\u626B\u63CF\u7248 PDF \u4F1A\u63D0\u793A\u6539\u7528 OCR\u3002"
5920
+ ].join("\n"),
5794
5921
  parameters: {
5795
5922
  type: "object",
5796
5923
  properties: {
5797
5924
  dbKey: {
5798
5925
  type: "string",
5799
5926
  description: "\u90AE\u4EF6\u8BB0\u5F55\u7684 dbKey\uFF0C\u4F8B\u5982 email-userId-emailId\u3002"
5927
+ },
5928
+ attachmentFileId: {
5929
+ type: "string",
5930
+ description: "\u53EF\u9009\u3002\u5F53\u524D\u90AE\u4EF6 attachments[] \u4E2D\u7684 fileId\uFF1B\u63D0\u4F9B\u540E\u8BFB\u53D6\u8BE5\u9644\u4EF6\u6587\u672C\u3002"
5931
+ },
5932
+ maxChars: {
5933
+ type: "number",
5934
+ 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
5935
  }
5801
5936
  },
5802
5937
  required: ["dbKey"]
@@ -6075,15 +6210,47 @@ ${artifacts.verificationLinks.slice(1).join("\n")}` : ""
6075
6210
  };
6076
6211
  }
6077
6212
  async function emailReadFunc(args, thunkApi) {
6078
- const email = await callToolApi(thunkApi, "/rpc/getEmail", args, {
6213
+ const email = await callToolApi(thunkApi, "/rpc/getEmail", { dbKey: args.dbKey }, {
6079
6214
  withAuth: true
6080
6215
  });
6216
+ const attachmentFileId = asOptionalTrimmedString(args.attachmentFileId);
6217
+ if (attachmentFileId) {
6218
+ const maxChars = clampInteger(args.maxChars, 12e3, 1e3, 5e4);
6219
+ const attachmentResult = await readEmailAttachment(
6220
+ email,
6221
+ attachmentFileId,
6222
+ maxChars,
6223
+ thunkApi
6224
+ );
6225
+ const filename = asOptionalTrimmedString(attachmentResult.attachment?.filename) ?? attachmentFileId;
6226
+ return {
6227
+ rawData: {
6228
+ emailDbKey: email?.dbKey,
6229
+ attachment: attachmentResult.attachment,
6230
+ content: attachmentResult.content,
6231
+ totalChars: attachmentResult.totalChars,
6232
+ truncated: attachmentResult.truncated,
6233
+ source: attachmentResult.source
6234
+ },
6235
+ displayData: [
6236
+ `\u9644\u4EF6\uFF1A${filename} | fileId: ${attachmentFileId}`,
6237
+ 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}`,
6238
+ "",
6239
+ attachmentResult.content
6240
+ ].join("\n")
6241
+ };
6242
+ }
6081
6243
  const body = asOptionalTrimmedString(email?.text) ?? asOptionalTrimmedString(email?.html) ?? "";
6244
+ const attachments = attachmentListPreview(email);
6082
6245
  return {
6083
6246
  rawData: email,
6084
- displayData: `${emailPreview(email)}
6085
-
6086
- ${body.slice(0, 4e3)}`
6247
+ displayData: [
6248
+ emailPreview(email),
6249
+ "",
6250
+ body.slice(0, 4e3),
6251
+ attachments ? `
6252
+ ${attachments}` : ""
6253
+ ].filter(Boolean).join("\n")
6087
6254
  };
6088
6255
  }
6089
6256
  async function emailUpdateTagsFunc(args, thunkApi) {
@@ -10122,7 +10289,7 @@ var cloudflareCrawlStatusFunctionSchema = {
10122
10289
  async function cloudflareCrawlStatusFunc(args, thunkApi) {
10123
10290
  const { jobId, limit, status, cursor } = args;
10124
10291
  if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
10125
- const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-7PSIFQPJ.js");
10292
+ const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-INIQCPGY.js");
10126
10293
  const { baseUrl, token } = getToolRequestContext2(thunkApi);
10127
10294
  const params = new URLSearchParams();
10128
10295
  if (limit !== void 0) params.set("limit", String(limit));
@@ -10900,7 +11067,7 @@ var selectUserIdFromState = (state2) => {
10900
11067
  var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
10901
11068
  async function addImageContentToSpace(input) {
10902
11069
  const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
10903
- const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-I7VX5SAC.js")).addContentAction;
11070
+ const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-IJHG2ZV7.js")).addContentAction;
10904
11071
  await addContentAction2(
10905
11072
  {
10906
11073
  spaceId: input.spaceId,
@@ -12554,11 +12721,13 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
12554
12721
  autoApprovedFields
12555
12722
  });
12556
12723
  const previousAgentForUpdate = buildUpdateThunkPreviousAgent(previousAgent, userId);
12724
+ const formData = buildPatch(args);
12725
+ const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
12557
12726
  const agent = await thunkApi.dispatch(
12558
12727
  updateAgent({
12559
12728
  userId,
12560
12729
  agentId: extractAgentId(currentAgentKey),
12561
- formData: buildPatch(args),
12730
+ formData,
12562
12731
  previousAgent: previousAgentForUpdate
12563
12732
  })
12564
12733
  ).unwrap().catch((e) => {
@@ -12570,7 +12739,8 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
12570
12739
  previousAgentForUpdate,
12571
12740
  requestedFields
12572
12741
  ),
12573
- displayData: formatUpdatedAgentOutput(agent)
12742
+ displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
12743
+ ${effortNote}` : "")
12574
12744
  };
12575
12745
  }
12576
12746
 
@@ -13027,7 +13197,64 @@ var runAgentBackground = createAsyncThunk("agent/runBackground", async (args, {
13027
13197
  throw lastError ?? new Error("\u4E8B\u4EF6\u6D41\u91CD\u8FDE\u5931\u8D25");
13028
13198
  });
13029
13199
 
13200
+ // packages/ai/tools/agent/credentialFanoutGuard.ts
13201
+ var UNKNOWN_CREDENTIAL_GROUP = "unknown";
13202
+ function normalizeCredentialGroupValue(group) {
13203
+ if (typeof group !== "string") return UNKNOWN_CREDENTIAL_GROUP;
13204
+ const trimmed2 = group.trim();
13205
+ if (!trimmed2) return UNKNOWN_CREDENTIAL_GROUP;
13206
+ if (trimmed2.toLowerCase() === UNKNOWN_CREDENTIAL_GROUP) {
13207
+ return UNKNOWN_CREDENTIAL_GROUP;
13208
+ }
13209
+ return trimmed2;
13210
+ }
13211
+ var describeEntry = (entry) => entry.agentKey ?? entry.runId ?? "(unknown run)";
13212
+ function checkCredentialFanout(args) {
13213
+ const candidateGroup = normalizeCredentialGroupValue(
13214
+ args.candidate.credentialGroup
13215
+ );
13216
+ for (const entry of args.active) {
13217
+ if (entry.runId && args.candidate.runId && entry.runId === args.candidate.runId) {
13218
+ continue;
13219
+ }
13220
+ const entryGroup = normalizeCredentialGroupValue(entry.credentialGroup);
13221
+ if (candidateGroup === UNKNOWN_CREDENTIAL_GROUP || entryGroup === UNKNOWN_CREDENTIAL_GROUP) {
13222
+ if (args.allowUnknownCredential === true) continue;
13223
+ const side = candidateGroup === UNKNOWN_CREDENTIAL_GROUP ? "candidate" : "active";
13224
+ return {
13225
+ allowed: false,
13226
+ reason: "unknown_credential_group",
13227
+ conflict: entry,
13228
+ message: `\u62D2\u7EDD\u5E76\u53D1\u6D3E\u53D1\uFF1A${side === "candidate" ? `\u5019\u9009 agent ${describeEntry(args.candidate)} \u7684 credentialGroup \u672A\u77E5` : `\u5DF2\u6D3B\u8DC3 run ${describeEntry(entry)} \u7684 credentialGroup \u672A\u77E5`}\uFF0C\u65E0\u6CD5\u8BC1\u660E\u5B83\u4E0E\u540C\u6279\u5E76\u53D1 run \u4E0D\u5171\u7528\u4E0A\u6E38\u51ED\u8BC1\u3002\u8BF7\u6539\u4E3A\u4E32\u884C\u6D3E\u53D1\u3001\u6362\u7528 credentialGroup \u660E\u786E\u7684 agent\uFF0C\u6216\u5728\u786E\u8BA4\u98CE\u9669\u540E\u663E\u5F0F\u4F20 allowUnknownCredential: true \u5F3A\u5236\u653E\u884C\u3002`
13229
+ };
13230
+ }
13231
+ if (candidateGroup === entryGroup) {
13232
+ if (args.allowCredentialConcurrency === true) {
13233
+ continue;
13234
+ }
13235
+ return {
13236
+ allowed: false,
13237
+ reason: "credential_group_conflict",
13238
+ conflict: entry,
13239
+ 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`
13240
+ };
13241
+ }
13242
+ }
13243
+ return { allowed: true };
13244
+ }
13245
+
13030
13246
  // packages/ai/tools/agent/startAgentRunTool.ts
13247
+ var BATCH_FANOUT_ENTRY_TTL_MS = 30 * 60 * 1e3;
13248
+ var batchFanoutRegistry = /* @__PURE__ */ new Map();
13249
+ function pruneBatchFanoutRegistry(nowMs) {
13250
+ for (const [batchId, entries] of batchFanoutRegistry) {
13251
+ const alive = entries.filter(
13252
+ (e) => nowMs - e.startedAtMs < BATCH_FANOUT_ENTRY_TTL_MS
13253
+ );
13254
+ if (alive.length === 0) batchFanoutRegistry.delete(batchId);
13255
+ else batchFanoutRegistry.set(batchId, alive);
13256
+ }
13257
+ }
13031
13258
  function buildStartAgentRunFunctionSchema(opts) {
13032
13259
  const supportsWait = opts?.supportsWait !== false;
13033
13260
  const wakeEnabled = opts?.wakeEnabled === true;
@@ -13059,7 +13286,21 @@ function buildStartAgentRunFunctionSchema(opts) {
13059
13286
  // 与 server 透传保持不动,探活/烟测仍走 CLI 侧。
13060
13287
  batchId: {
13061
13288
  type: "string",
13062
- description: "\u53EF\u9009\u3002\u6279\u6B21 id\uFF0C\u7528\u4E8E\u628A\u591A\u4E2A\u5E76\u884C run \u5F52\u4E3A\u4E00\u7EC4\uFF0C\u4FBF\u4E8E\u540E\u7EED controlAgentRun(list, batchId=...) \u6309\u6279\u67E5\u8BE2\u3002\u672A\u4F20\u65F6\u81EA\u52A8\u751F\u6210\u4E00\u4E2A\u5E76\u5728\u8FD4\u56DE\u503C\u4E2D\u5E26\u56DE\uFF0C\u8C03\u7528\u65B9\u65E0\u9700\u5148\u521B\u5EFA\u3002"
13289
+ description: "\u53EF\u9009\u3002\u6279\u6B21 id\uFF0C\u7528\u4E8E\u628A\u591A\u4E2A\u5E76\u884C run \u5F52\u4E3A\u4E00\u7EC4\uFF0C\u4FBF\u4E8E\u540E\u7EED controlAgentRun(list, batchId=...) \u6309\u6279\u67E5\u8BE2\u3002\u672A\u4F20\u65F6\u81EA\u52A8\u751F\u6210\u4E00\u4E2A\u5E76\u5728\u8FD4\u56DE\u503C\u4E2D\u5E26\u56DE\uFF0C\u8C03\u7528\u65B9\u65E0\u9700\u5148\u521B\u5EFA\u3002\u540C\u4E00 batchId \u5185\u7684\u5E76\u53D1\u6D3E\u53D1\u4F1A\u505A\u51ED\u8BC1\u7EC4\u9694\u79BB\u68C0\u67E5\uFF1AcredentialGroup \u76F8\u540C\u6216\u672A\u77E5\u7684\u5E76\u53D1 run \u4F1A\u88AB\u62D2\u7EDD\u3002"
13290
+ },
13291
+ credentialGroup: {
13292
+ type: "string",
13293
+ description: "\u53EF\u9009\u3002\u7167\u6284 listAgents \u8FD4\u56DE\u7684 credentialGroup \u5B57\u6BB5\uFF0C\u7528\u4E8E\u540C\u6279\u6B21\u5E76\u53D1\u6247\u51FA\u7684\u51ED\u8BC1\u9694\u79BB\u6821\u9A8C\u3002\u7F3A\u7701/\u7A7A\u503C\u89C6\u4E3A\u300C\u672A\u77E5\u300D\uFF08\u4E0D\u662F\u300C\u72EC\u7ACB\u300D\uFF09\uFF1A\u4E0E\u540C batch \u5185\u4EFB\u4F55\u5176\u4ED6 run \u5E76\u53D1\u90FD\u4F1A\u88AB\u62D2\u7EDD\u3002"
13294
+ },
13295
+ allowUnknownCredential: {
13296
+ type: "boolean",
13297
+ 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",
13298
+ default: false
13299
+ },
13300
+ allowCredentialConcurrency: {
13301
+ type: "boolean",
13302
+ 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",
13303
+ default: false
13063
13304
  },
13064
13305
  trackTodo: {
13065
13306
  type: "boolean",
@@ -13092,13 +13333,26 @@ async function startAgentRunFunc(args, thunkApi, _context) {
13092
13333
  const { agentKey, task, input, agentName, batchId, wait } = args;
13093
13334
  const resultMode = args.resultMode ?? "full";
13094
13335
  const { dispatch } = thunkApi;
13095
- const effectiveBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
13336
+ const explicitBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : void 0;
13337
+ const effectiveBatchId = explicitBatchId ?? `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
13096
13338
  if (!agentKey) {
13097
13339
  throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\u3002");
13098
13340
  }
13099
13341
  if (!task || typeof task !== "string") {
13100
13342
  throw new Error("startAgentRun: \u7F3A\u5C11\u6709\u6548\u7684 task \u6587\u672C\u63CF\u8FF0\u3002");
13101
13343
  }
13344
+ if (explicitBatchId) {
13345
+ const nowMs = Date.now();
13346
+ pruneBatchFanoutRegistry(nowMs);
13347
+ const active = batchFanoutRegistry.get(explicitBatchId) ?? [];
13348
+ const verdict = checkCredentialFanout({
13349
+ active,
13350
+ candidate: { agentKey, credentialGroup: args.credentialGroup },
13351
+ allowUnknownCredential: args.allowUnknownCredential === true,
13352
+ allowCredentialConcurrency: args.allowCredentialConcurrency === true
13353
+ });
13354
+ if (!verdict.allowed) throw new Error(verdict.message);
13355
+ }
13102
13356
  const content = buildDelegatedTaskContent(task, input);
13103
13357
  const payloadMetrics = calculateDelegatedPayloadMetrics(task, input, content);
13104
13358
  const activeDialogKey = getActiveDialogKey();
@@ -13128,6 +13382,16 @@ async function startAgentRunFunc(args, thunkApi, _context) {
13128
13382
  };
13129
13383
  }
13130
13384
  const runId = bgResult.dialogId;
13385
+ if (explicitBatchId) {
13386
+ const entries = batchFanoutRegistry.get(explicitBatchId) ?? [];
13387
+ entries.push({
13388
+ runId,
13389
+ agentKey,
13390
+ ...typeof args.credentialGroup === "string" && args.credentialGroup.trim() ? { credentialGroup: args.credentialGroup.trim() } : {},
13391
+ startedAtMs: Date.now()
13392
+ });
13393
+ batchFanoutRegistry.set(explicitBatchId, entries);
13394
+ }
13131
13395
  const status = bgResult.status ?? "pending";
13132
13396
  const resolvedName = agentName?.trim() || bgResult.agentName || bgResult.name;
13133
13397
  const identity = { agentName: resolvedName, agentKey, runId };
@@ -14821,7 +15085,7 @@ var executeToolRun = createAsyncThunk(
14821
15085
  if (!executionInput) {
14822
15086
  throw new Error(`ToolRun ${id} has no input to execute with.`);
14823
15087
  }
14824
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-ILBLCF7D.js");
15088
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-XQ5GIH6P.js");
14825
15089
  const { executor } = findToolExecutor2(run.toolName);
14826
15090
  toolRunStarted({
14827
15091
  id: run.id,
@@ -14845,7 +15109,7 @@ var executeToolRun = createAsyncThunk(
14845
15109
  const latestState = thunkApi.getState();
14846
15110
  const userId = selectIdentityUserId(latestState);
14847
15111
  if (userId) {
14848
- const { fetchUserSpaceMemberships } = await import("./memberThunks-5T4J6KXQ.js");
15112
+ const { fetchUserSpaceMemberships } = await import("./memberThunks-SKFZ37VS.js");
14849
15113
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
14850
15114
  }
14851
15115
  }
@@ -17328,7 +17592,7 @@ async function updateDocFunc(args, thunkApi) {
17328
17592
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
17329
17593
  };
17330
17594
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
17331
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-SYYFBENY.js");
17595
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-SITH63V3.js");
17332
17596
  if (getDocState().pageKey === id) {
17333
17597
  applyExternalDocUpdate({
17334
17598
  slateData: finalSlateData,
@@ -17353,7 +17617,7 @@ async function updateDocFunc(args, thunkApi) {
17353
17617
  // packages/ai/tools/updateUserPreferenceProfileTool.ts
17354
17618
  async function dispatchSetSettings(thunkApi, changes) {
17355
17619
  const injectedSetSettings = thunkApi?.extra?.setSettings;
17356
- const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-CZRURSTH.js")).setSettings;
17620
+ const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-CNE75ISY.js")).setSettings;
17357
17621
  await thunkApi.dispatch(setSettings(changes)).unwrap();
17358
17622
  }
17359
17623
  var updateUserPreferenceProfileFunctionSchema = {
@@ -18076,6 +18340,38 @@ var baseToolDefinitions = [
18076
18340
  costLevel: "low",
18077
18341
  defaultConsent: "ask"
18078
18342
  },
18343
+ {
18344
+ id: "updateAgentAutomation",
18345
+ schema: updateAgentAutomationFunctionSchema,
18346
+ executor: updateAgentAutomationFunc,
18347
+ description: {
18348
+ name: "updateAgentAutomation",
18349
+ description: "\u66F4\u65B0\u4E00\u4E2A agent automation \u7684\u6807\u9898\u3001instruction\u3001trigger\u3001status \u7B49\u5B57\u6BB5\u3002",
18350
+ category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
18351
+ },
18352
+ behavior: "action",
18353
+ uiGroup: "general",
18354
+ capability: "general",
18355
+ riskLevel: "medium",
18356
+ costLevel: "low",
18357
+ defaultConsent: "ask"
18358
+ },
18359
+ {
18360
+ id: "deleteAgentAutomation",
18361
+ schema: deleteAgentAutomationFunctionSchema,
18362
+ executor: deleteAgentAutomationFunc,
18363
+ description: {
18364
+ name: "deleteAgentAutomation",
18365
+ description: "\u5220\u9664\u4E00\u4E2A agent automation \u53CA\u5176 owner index\u3002",
18366
+ category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
18367
+ },
18368
+ behavior: "action",
18369
+ uiGroup: "general",
18370
+ capability: "general",
18371
+ riskLevel: "high",
18372
+ costLevel: "low",
18373
+ defaultConsent: "ask"
18374
+ },
18079
18375
  {
18080
18376
  id: "notifyUser",
18081
18377
  schema: notifyUserFunctionSchema,
@@ -19613,19 +19909,11 @@ var findToolExecutor = (rawName) => {
19613
19909
  };
19614
19910
 
19615
19911
  export {
19616
- resolveAgentRequiredPackIds,
19617
- resolveAgentRecommendedSkillNames,
19618
19912
  clipMultilineText,
19619
19913
  fetchAndSerializeTable,
19620
19914
  getToolResultErrorData,
19621
- createToolRunId,
19622
- toolRunStarted,
19623
- toolRunSetPending,
19624
- toolRunSucceeded,
19625
- toolRunFailed,
19626
- getAllToolRuns,
19627
- createSSEParser,
19628
- formatAgentListCard,
19915
+ resolveAgentRequiredPackIds,
19916
+ resolveAgentRecommendedSkillNames,
19629
19917
  readXPostFunctionSchema,
19630
19918
  readXPostFunc,
19631
19919
  readXhsProfileFunctionSchema,
@@ -19634,10 +19922,18 @@ export {
19634
19922
  rememberMemoryFunctionSchema,
19635
19923
  deleteMemoryFunctionSchema,
19636
19924
  queryMemoryFunctionSchema,
19925
+ createSSEParser,
19926
+ checkCredentialFanout,
19637
19927
  buildStartAgentRunFunctionSchema,
19638
19928
  CONTROL_AGENT_RUN_ACTIONS,
19639
19929
  buildControlAgentRunFunctionSchema,
19640
19930
  setTodoListFunc,
19931
+ createToolRunId,
19932
+ toolRunStarted,
19933
+ toolRunSetPending,
19934
+ toolRunSucceeded,
19935
+ toolRunFailed,
19936
+ getAllToolRuns,
19641
19937
  TOOL_GROUP_META,
19642
19938
  toolQueryFunctionSchema,
19643
19939
  toolQueryFunc,
@@ -19646,5 +19942,6 @@ export {
19646
19942
  toolExecutors,
19647
19943
  toolDescriptions,
19648
19944
  toolDefinitionsByName,
19649
- findToolExecutor
19945
+ findToolExecutor,
19946
+ formatAgentListCard
19650
19947
  };