nolo-cli 0.106.0-alpha.1 → 0.106.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.
- package/README.md +1 -1
- package/{_executeModel-C5ZUOC7O.js → _executeModel-EP6HAX3W.js} +77 -69
- package/action-GVA5ARSJ.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-NZZNAVCB.js} +13 -12
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-5HVGEIXI.js} +19 -20
- package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-M25A6UGB.js} +118 -43
- package/{agentEmailCommands-YBCBTG6X.js → agentEmailCommands-RUL4NL64.js} +99 -89
- package/agentListCommands-KSPFKHFO.js +741 -0
- package/{agentMachineCommands-QHYLBTVW.js → agentMachineCommands-IHBB6PHD.js} +48 -44
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-ND4S2Q6Q.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-7OKIBN6H.js +138 -0
- package/agentRunCommand-GBKJTQQU.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-E5HXZNXZ.js} +44 -40
- package/{agentSlice-7OEXULAY.js → agentSlice-7T3ZLYET.js} +15 -14
- package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-TTJUYTQN.js} +46 -42
- package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-65WYK2TQ.js} +46 -42
- package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-U4XESYYG.js} +46 -42
- package/{appGetCommands-EXWT3QAE.js → appGetCommands-VNHZZC4D.js} +46 -42
- package/{appListCommands-PKRLSWRE.js → appListCommands-O667ZEU6.js} +46 -42
- package/{authCommand-F4EFRRX6.js → authCommand-SUHHTVHA.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-PUGT65WS.js} +11 -9
- package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
- package/{chunk-ZNV445LB.js → chunk-2NGKYC3L.js} +29 -9
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
- package/{chunk-XA2FJW4L.js → chunk-3SXZ6SUC.js} +11 -9
- package/{chunk-UKZDAFYT.js → chunk-3VKDWQMJ.js} +6 -10
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
- package/{chunk-PQFHGD77.js → chunk-4VDS344D.js} +161 -14
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-5F7UKMLN.js} +8 -4
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-YCJN2RA3.js → chunk-6AIURTE7.js} +20 -11
- package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-S4VLC46A.js → chunk-AM4G3LDJ.js} +66 -54
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-TJGWNDGO.js → chunk-AZB6HR4I.js} +846 -276
- package/{chunk-L5UXH3B2.js → chunk-BIH7KCDJ.js} +58 -9
- package/{chunk-UZGQNTVW.js → chunk-BPLIXNC6.js} +8 -6
- package/chunk-CEQ75WPL.js +915 -0
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-GPCZ7UXG.js → chunk-DBKRC5O2.js} +1 -1
- package/chunk-DJ3JABG5.js +7990 -0
- package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
- package/{chunk-UOBDA2JS.js → chunk-DSXRVBTA.js} +118 -90
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-HJUYAD4A.js → chunk-EBS4FKW4.js} +5 -5
- package/{chunk-LC43IGO4.js → chunk-EHGIEGLI.js} +834 -962
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-TOP2VXOR.js → chunk-FJKZSR5P.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
- package/{chunk-ZCYXJSTU.js → chunk-GMP3NBAA.js} +65 -95
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-OIVSQH2O.js → chunk-GU7DC2TD.js} +300 -5
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
- package/{chunk-RJXZDT2P.js → chunk-HNA5KV37.js} +23 -28
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-ACTMNVHM.js → chunk-I5YMDACN.js} +1 -1
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/{chunk-Q67DOFOO.js → chunk-IYIXAIEB.js} +199 -92
- package/{chunk-BP4XNZRM.js → chunk-JIXGJTBU.js} +4 -4
- package/{chunk-OEVAY4J6.js → chunk-JWNBEIME.js} +18 -20
- package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
- package/{chunk-JZL6EHZR.js → chunk-LGWABBTZ.js} +47 -67
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-GEPUP7OO.js → chunk-LOPP5VT6.js} +3 -3
- package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
- package/chunk-LWLNLZC5.js +265 -0
- package/{chunk-BNGW5ASC.js → chunk-LYLO5U3H.js} +15 -2
- package/{chunk-4OEFYTWL.js → chunk-MJ3CRU77.js} +85 -50
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-NA35QHCF.js → chunk-NTNKA5VL.js} +1 -1
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/chunk-NWENLDMM.js +42 -0
- package/chunk-O7SVKKLY.js +875 -0
- package/{chunk-FM2YTE6D.js → chunk-OAXBDMT7.js} +1 -1
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-EYAQT56M.js → chunk-ODTBO4W6.js} +9 -6
- package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
- package/{chunk-EEGDMATE.js → chunk-OQ5IVGCV.js} +86 -81
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-KQ4ONNQD.js → chunk-OYTWDOQV.js} +155 -8
- package/{chunk-JRQFUXY7.js → chunk-OZ2IIIRP.js} +99 -22
- package/{chunk-WV42OMV7.js → chunk-PFLF4R4E.js} +8 -8
- package/{chunk-J4MOO56S.js → chunk-QDH32WF5.js} +10 -2
- package/{chunk-3DII57IT.js → chunk-QVAWUJAJ.js} +1 -1
- package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
- package/{chunk-6OZ36FXI.js → chunk-SJ7CUF65.js} +22 -4
- package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
- package/{chunk-ETI2NYVF.js → chunk-SYEBIZOF.js} +4 -4
- package/{chunk-J3WULTWA.js → chunk-TLKXNTQJ.js} +19 -17
- package/chunk-TLYSGGPG.js +15 -0
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/chunk-UM7TA3K4.js +1008 -0
- package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
- package/chunk-VBQGO5NX.js +164 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/chunk-VYKXIHRP.js +13692 -0
- package/chunk-VZLO4XJD.js +17 -0
- package/{chunk-DNCEALKX.js → chunk-WMWYWYK2.js} +22 -29
- package/{chunk-H56FOERC.js → chunk-XDQ7PHU3.js} +567 -684
- package/{chunk-AEOE4Z6Q.js → chunk-XGOHDYM2.js} +39 -15
- package/{chunk-53HEEOTT.js → chunk-XLWMNFBZ.js} +83 -16
- package/{chunk-V4MJDUSR.js → chunk-YFU5EELM.js} +2 -2
- package/{chunk-IUTWFZOX.js → chunk-YQFLBS6A.js} +68 -46
- package/chunk-YV25TM3R.js +780 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/{chunk-5H7KJX7J.js → chunk-ZVGXD7UJ.js} +5 -5
- package/{chunk-H62HCIUP.js → chunk-ZYM73IHG.js} +36 -22
- package/commandRegistry-6QIAUQDS.js +833 -0
- package/{contentThunks-AZVYDLM4.js → contentThunks-5DDMUQ7B.js} +39 -36
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-V55DNYCE.js → createAgentAutomationAction-NQ6AZM42.js} +40 -37
- package/createDialogAction-QZ6X4A7O.js +70 -0
- package/{createPageAction-I3HH23O3.js → createPageAction-NCGEJBVK.js} +47 -43
- package/{chunk-GDNQO3QR.js → cursorProvider-YGGNMVWX.js} +2751 -10172
- package/{dbSlice-XVWBAGYN.js → dbSlice-RCZ7NRAF.js} +12 -11
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-YVMHDEOX.js → dialogCommands-OGQLEF63.js} +49 -46
- package/{dialogSlice-LVJ67QWE.js → dialogSlice-GIKNUHNW.js} +57 -37
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-RW6LNYT6.js} +48 -44
- package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-Z742TRNY.js} +49 -45
- package/{docReadCommands-QHMQVSLP.js → docReadCommands-5DIGA42Y.js} +47 -43
- package/{docStore-UJNL6SBT.js → docStore-6GUOZH52.js} +17 -13
- package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-ZFZ2QEVK.js} +48 -44
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-QVSNUFZ6.js} +4 -4
- package/{handleSendMessageAction-CCL7ETCL.js → handleSendMessageAction-B2VXOLMM.js} +109 -42
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-2QNINBNI.js → machineCommands-AI3N7JHQ.js} +93 -83
- package/machineWsRunDispatch-RPF2D6VV.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-YICJI4IS.js} +20 -18
- package/{models-T3SG6MJ5.js → models-FTNFVO3D.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-OJJXQ7NM.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-DXFBDCGQ.js} +11 -7
- package/{read-COE3ZYR6.js → read-XMBM52Y4.js} +8 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-LAQHKCVT.js} +5 -3
- package/{readlineWorkspace-4GULS23D.js → readlineWorkspace-EPUCVZ73.js} +2594 -2030
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-HDUI2MU3.js} +22 -26
- package/{runAgentClientLoop-MUMLW2SA.js → runAgentClientLoop-OXQMDGAN.js} +78 -71
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-ADBVOP4O.js} +16 -14
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-PXVXQJ62.js} +23 -27
- package/{chunk-AFUORTY4.js → settingThunks-G2MJRKUE.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-BMXKR7H6.js → spaceCommands-Z662QYY6.js} +51 -47
- package/{streamAgentChatTurn-6EOS5PNG.js → streamAgentChatTurn-YJYEJHP7.js} +214 -114
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-Z3RZACGF.js} +19 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
- package/tools-GHI3WBEI.js +117 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-WTC6GCQC.js} +25 -23
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-4YUVCBDU.js → updateDialogTitleAction-GJCNWTPY.js} +84 -45
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-3GWH4E4G.js +0 -410
- package/agentRecordCommands-P76DPWKV.js +0 -128
- package/agentRunCommand-EQPL4F4K.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-ZBDDI2E5.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-WC6UUQ2C.js +0 -20923
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-H6URYLIZ.js +0 -65
- package/machineWsRunDispatch-S3XXOKR7.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-4AJZHAK3.js +0 -110
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- 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-4VDS344D.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-PQFHGD77.js";
|
|
33
18
|
import {
|
|
34
19
|
getUserDataItemTimestamp,
|
|
35
20
|
mergeAndDedupUserData
|
|
36
|
-
} from "./chunk-
|
|
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-VBQGO5NX.js";
|
|
37
31
|
import {
|
|
38
32
|
readDocFunc,
|
|
39
33
|
readDocFunctionSchema,
|
|
40
34
|
readPageFunc,
|
|
41
35
|
readPageFunctionSchema,
|
|
42
|
-
|
|
43
|
-
} from "./chunk-
|
|
36
|
+
resolvePageReadMarkdown
|
|
37
|
+
} from "./chunk-QDH32WF5.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-
|
|
49
|
+
} from "./chunk-EBS4FKW4.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-
|
|
57
|
+
} from "./chunk-7I25CBT5.js";
|
|
64
58
|
import {
|
|
65
59
|
setDialogExtraReferencesAction
|
|
66
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-3VKDWQMJ.js";
|
|
67
61
|
import {
|
|
68
62
|
waitForAbortableDelay
|
|
69
63
|
} from "./chunk-N4G4PKQ6.js";
|
|
70
64
|
import {
|
|
71
65
|
markdownToSlate
|
|
72
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-NUHHBEJC.js";
|
|
73
67
|
import {
|
|
74
68
|
extractMentionsFromSlate
|
|
75
|
-
} from "./chunk-
|
|
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-
|
|
78
|
+
} from "./chunk-6AIURTE7.js";
|
|
85
79
|
import {
|
|
86
80
|
createDialogAction
|
|
87
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-HNA5KV37.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-
|
|
111
|
+
} from "./chunk-LGWABBTZ.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-
|
|
133
|
+
} from "./chunk-VYKXIHRP.js";
|
|
128
134
|
import {
|
|
129
135
|
createAgent,
|
|
130
136
|
deleteServerSyncedCredential,
|
|
131
137
|
runLlm,
|
|
132
138
|
streamAgentChatTurn,
|
|
133
139
|
updateAgent
|
|
134
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-3SXZ6SUC.js";
|
|
135
141
|
import {
|
|
136
142
|
getActiveDialogKey,
|
|
137
143
|
selectCurrentDialogKey,
|
|
138
144
|
selectPendingRawDataByPageKey
|
|
139
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-VBG7GWWR.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-
|
|
154
|
+
} from "./chunk-OZ2IIIRP.js";
|
|
149
155
|
import {
|
|
150
156
|
CAPABILITY_PACKS
|
|
151
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-LUBFABMJ.js";
|
|
158
|
+
import {
|
|
159
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
160
|
+
} from "./chunk-IXH3HKY2.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-
|
|
168
|
+
} from "./chunk-DMXLXZKL.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-
|
|
177
|
-
import {
|
|
178
|
-
isAgentUnavailableNow
|
|
179
|
-
} from "./chunk-FDTR4QJ6.js";
|
|
185
|
+
} from "./chunk-SJKULPGX.js";
|
|
180
186
|
import {
|
|
181
187
|
buildDatabaseFileContentUrl
|
|
182
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-WMWYWYK2.js";
|
|
183
189
|
import {
|
|
184
|
-
|
|
185
|
-
} from "./chunk-
|
|
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-
|
|
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-2U3NHADM.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-
|
|
205
|
+
} from "./chunk-YFU5EELM.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-
|
|
221
|
+
} from "./chunk-ZYM73IHG.js";
|
|
222
|
+
import {
|
|
223
|
+
canonicalizeToolName,
|
|
224
|
+
canonicalizeToolNames
|
|
225
|
+
} from "./chunk-IHPDK6UD.js";
|
|
226
|
+
import {
|
|
227
|
+
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
228
|
+
chromeConnectorToolSchemas,
|
|
229
|
+
chromeConnectorUnavailableFunc,
|
|
230
|
+
getChromeConnectorToolBehavior,
|
|
231
|
+
getChromeConnectorToolDefaultConsent
|
|
232
|
+
} from "./chunk-LWLNLZC5.js";
|
|
233
|
+
import {
|
|
234
|
+
DEFAULT_MODEL,
|
|
235
|
+
clampReasoningEffort,
|
|
236
|
+
resolveModelReasoningCapabilityWithCache
|
|
237
|
+
} from "./chunk-GU7DC2TD.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-PFLF4R4E.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-O7SVKKLY.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-JIXGJTBU.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-
|
|
294
|
+
} from "./chunk-OKGVNZTL.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
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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-
|
|
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\
|
|
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\
|
|
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\
|
|
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-
|
|
1045
|
+
const { ALL_MODELS } = await import("./models-FTNFVO3D.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:
|
|
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:
|
|
1076
|
+
description: runtime_default.t("tools.createAgent.params.name")
|
|
946
1077
|
},
|
|
947
1078
|
model: {
|
|
948
1079
|
type: "string",
|
|
949
|
-
description:
|
|
1080
|
+
description: runtime_default.t("tools.createAgent.params.model")
|
|
950
1081
|
},
|
|
951
1082
|
provider: {
|
|
952
1083
|
type: "string",
|
|
953
|
-
description:
|
|
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:
|
|
1093
|
+
description: runtime_default.t("tools.createAgent.params.prompt")
|
|
963
1094
|
},
|
|
964
1095
|
introduction: {
|
|
965
1096
|
type: "string",
|
|
966
|
-
description:
|
|
1097
|
+
description: runtime_default.t("tools.createAgent.params.introduction")
|
|
967
1098
|
},
|
|
968
1099
|
greeting: {
|
|
969
|
-
description:
|
|
1100
|
+
description: runtime_default.t("tools.createAgent.params.greeting.desc"),
|
|
970
1101
|
anyOf: [
|
|
971
1102
|
{
|
|
972
1103
|
type: "string",
|
|
973
|
-
description:
|
|
1104
|
+
description: runtime_default.t(
|
|
974
1105
|
"tools.createAgent.params.greeting.stringDesc"
|
|
975
1106
|
)
|
|
976
1107
|
},
|
|
977
1108
|
{
|
|
978
1109
|
type: "object",
|
|
979
|
-
description:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1156
|
+
description: runtime_default.t("tools.createAgent.params.isPublic")
|
|
1026
1157
|
},
|
|
1027
1158
|
allowFork: {
|
|
1028
1159
|
type: "boolean",
|
|
1029
|
-
description:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1218
|
+
description: runtime_default.t("tools.createAgent.params.linkedSpaces")
|
|
1088
1219
|
},
|
|
1089
1220
|
temperature: {
|
|
1090
1221
|
type: "number",
|
|
1091
|
-
description:
|
|
1222
|
+
description: runtime_default.t("tools.createAgent.params.temperature")
|
|
1092
1223
|
},
|
|
1093
1224
|
top_p: {
|
|
1094
1225
|
type: "number",
|
|
1095
|
-
description:
|
|
1226
|
+
description: runtime_default.t("tools.createAgent.params.top_p")
|
|
1096
1227
|
},
|
|
1097
1228
|
frequency_penalty: {
|
|
1098
1229
|
type: "number",
|
|
1099
|
-
description:
|
|
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:
|
|
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:
|
|
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:
|
|
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-
|
|
1290
|
+
const { getModelPricing } = await import("./getPricing-QVSNUFZ6.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 =
|
|
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;
|
|
@@ -3841,6 +3892,8 @@ async function readDialogFunc(args, thunkApi) {
|
|
|
3841
3892
|
// 对全量消息做 materialize + 整体 stringify。
|
|
3842
3893
|
body: JSON.stringify({
|
|
3843
3894
|
dialogId: resolved.dialogId,
|
|
3895
|
+
// 同作用域已解析出的记录 key:不传则服务端退化为 `dialog-*` 全命名空间扫描。
|
|
3896
|
+
dialogKey: resolved.dbKey,
|
|
3844
3897
|
limit,
|
|
3845
3898
|
maxChars: DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS
|
|
3846
3899
|
})
|
|
@@ -3945,7 +3998,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3945
3998
|
const deletedDialogIds = [];
|
|
3946
3999
|
const deletedDialogKeys = [];
|
|
3947
4000
|
const failures = [];
|
|
3948
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
4001
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-GIKNUHNW.js");
|
|
3949
4002
|
for (const target of targets) {
|
|
3950
4003
|
try {
|
|
3951
4004
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -4009,24 +4062,6 @@ async function fetchUserFavoriteAgentMap(thunkApi) {
|
|
|
4009
4062
|
return {};
|
|
4010
4063
|
}
|
|
4011
4064
|
}
|
|
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
4065
|
var listAgentsFunctionSchema = {
|
|
4031
4066
|
name: "listAgents",
|
|
4032
4067
|
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 +4076,10 @@ var listAgentsFunctionSchema = {
|
|
|
4041
4076
|
},
|
|
4042
4077
|
publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
|
|
4043
4078
|
showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
|
|
4079
|
+
query: {
|
|
4080
|
+
type: "string",
|
|
4081
|
+
description: "Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey. Use to locate specific candidates like 'opus', 'devin', or 'claude'."
|
|
4082
|
+
},
|
|
4044
4083
|
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
4084
|
}
|
|
4046
4085
|
}
|
|
@@ -4083,16 +4122,15 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4083
4122
|
}
|
|
4084
4123
|
}
|
|
4085
4124
|
const userId = runtime?.currentUserId ?? void 0;
|
|
4086
|
-
const
|
|
4087
|
-
(
|
|
4125
|
+
const discovery = assembleAgentDiscoveryResult({
|
|
4126
|
+
records: [...Array.from(recordsMap.values()), ...publicRecords],
|
|
4127
|
+
summaryOptions: (record) => ({
|
|
4088
4128
|
favoritesMap,
|
|
4089
4129
|
userId,
|
|
4090
4130
|
publicRecordExists: publicRecords.includes(record) ? true : void 0
|
|
4091
|
-
})
|
|
4092
|
-
);
|
|
4093
|
-
const discovery = buildAgentDiscoveryResult({
|
|
4094
|
-
agents,
|
|
4131
|
+
}),
|
|
4095
4132
|
scope: args?.scope,
|
|
4133
|
+
query: args?.query,
|
|
4096
4134
|
publicOnly: args?.publicOnly,
|
|
4097
4135
|
showUnavailable: args?.showUnavailable,
|
|
4098
4136
|
verbose: args?.verbose
|
|
@@ -4123,6 +4161,30 @@ var readAgentFunctionSchema = {
|
|
|
4123
4161
|
required: ["agent"]
|
|
4124
4162
|
}
|
|
4125
4163
|
};
|
|
4164
|
+
function formatReadAgentCard(agentKey, record) {
|
|
4165
|
+
if (!isRecord(record)) {
|
|
4166
|
+
return jsonPreview({ agentKey, record });
|
|
4167
|
+
}
|
|
4168
|
+
const name = asTrimmedString(record.name) || "(\u672A\u547D\u540D Agent)";
|
|
4169
|
+
const model = asTrimmedString(record.model) || "\u2014";
|
|
4170
|
+
const provider = asTrimmedString(record.provider) || asTrimmedString(record.apiSource) || "\u2014";
|
|
4171
|
+
const apiSource = asTrimmedString(record.apiSource) || "\u2014";
|
|
4172
|
+
const isPublic = record.isPublic === true ? "\u516C\u5F00" : "\u79C1\u6709";
|
|
4173
|
+
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)";
|
|
4174
|
+
const lines = [
|
|
4175
|
+
`\u{1F916} Agent: ${name} (${agentKey})`,
|
|
4176
|
+
`\u2022 \u6A21\u578B: ${model} (${provider})`,
|
|
4177
|
+
`\u2022 \u6765\u6E90: ${apiSource} \xB7 ${isPublic}`,
|
|
4178
|
+
`\u2022 \u5DE5\u5177: ${tools}`
|
|
4179
|
+
];
|
|
4180
|
+
if (typeof record.customProviderUrl === "string" && record.customProviderUrl.trim()) {
|
|
4181
|
+
lines.push(`\u2022 \u7AEF\u70B9: ${record.customProviderUrl.trim()}`);
|
|
4182
|
+
}
|
|
4183
|
+
if (typeof record.prompt === "string" && record.prompt.trim()) {
|
|
4184
|
+
lines.push(`\u2022 \u63D0\u793A\u8BCD: ${clipCompactText(record.prompt.trim(), 200)}`);
|
|
4185
|
+
}
|
|
4186
|
+
return lines.join("\n");
|
|
4187
|
+
}
|
|
4126
4188
|
async function readAgentFunc(args, thunkApi) {
|
|
4127
4189
|
const runtime = getRuntime2(thunkApi);
|
|
4128
4190
|
const userId = runtime?.currentUserId;
|
|
@@ -4134,16 +4196,14 @@ async function readAgentFunc(args, thunkApi) {
|
|
|
4134
4196
|
for (const candidate of candidates) {
|
|
4135
4197
|
const record = await readBestRecord(thunkApi, candidate, true);
|
|
4136
4198
|
if (record) {
|
|
4199
|
+
const redacted = redactAgentRecordForWorkspaceTool(record);
|
|
4137
4200
|
return {
|
|
4138
4201
|
rawData: {
|
|
4139
4202
|
success: true,
|
|
4140
4203
|
agentKey: candidate,
|
|
4141
|
-
record:
|
|
4204
|
+
record: redacted
|
|
4142
4205
|
},
|
|
4143
|
-
displayData:
|
|
4144
|
-
agentKey: candidate,
|
|
4145
|
-
record: redactAgentRecordForWorkspaceTool(record)
|
|
4146
|
-
})
|
|
4206
|
+
displayData: formatReadAgentCard(candidate, redacted)
|
|
4147
4207
|
};
|
|
4148
4208
|
}
|
|
4149
4209
|
}
|
|
@@ -4254,7 +4314,7 @@ var readSkillDocFunctionSchema = {
|
|
|
4254
4314
|
}
|
|
4255
4315
|
};
|
|
4256
4316
|
async function readSkillDocFunc(args, thunkApi) {
|
|
4257
|
-
const { buildReadDocResult } = await import("./readDocTool-
|
|
4317
|
+
const { buildReadDocResult } = await import("./readDocTool-LAQHKCVT.js");
|
|
4258
4318
|
const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
|
|
4259
4319
|
if (typeof id !== "string" || !id.trim()) {
|
|
4260
4320
|
throw new Error("readSkillDoc requires id or doc.");
|
|
@@ -4520,18 +4580,7 @@ var addSpaceAction = async (input, thunkAPI) => {
|
|
|
4520
4580
|
};
|
|
4521
4581
|
|
|
4522
4582
|
// 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
4583
|
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
4584
|
var createInitialState = () => ({
|
|
4536
4585
|
agentIds: [],
|
|
4537
4586
|
contentIds: [],
|
|
@@ -5057,7 +5106,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
|
|
|
5057
5106
|
const spaceKey = createSpaceKey.space(spaceId);
|
|
5058
5107
|
const readSpace = async (dbKey) => {
|
|
5059
5108
|
try {
|
|
5060
|
-
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-
|
|
5109
|
+
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-RCZ7NRAF.js");
|
|
5061
5110
|
if (fresh) {
|
|
5062
5111
|
return await dispatch(readAndWait2(dbKey)).unwrap();
|
|
5063
5112
|
}
|
|
@@ -5698,6 +5747,23 @@ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
5698
5747
|
var normalizeContains = (value) => asTrimmedLowercaseString(value);
|
|
5699
5748
|
var participantList = (emails) => Array.isArray(emails) ? asTrimmedNonEmptyStringArray(emails).map((email) => ({ email })) : [];
|
|
5700
5749
|
var emailText = (email) => [email?.subject, email?.from?.email, email?.from?.name, email?.text, email?.html].filter((value) => typeof value === "string").join("\n");
|
|
5750
|
+
var emailAttachments = (email) => Array.isArray(email?.attachments) ? email.attachments : [];
|
|
5751
|
+
var attachmentPreview = (attachment) => {
|
|
5752
|
+
const name = asOptionalTrimmedString(attachment?.filename) ?? "attachment";
|
|
5753
|
+
const contentType = asOptionalTrimmedString(attachment?.contentType) ?? "application/octet-stream";
|
|
5754
|
+
const fileId = asOptionalTrimmedString(attachment?.fileId) ?? "unknown-file";
|
|
5755
|
+
const size = Number.isFinite(Number(attachment?.size)) ? ` | ${Number(attachment.size)} bytes` : "";
|
|
5756
|
+
return `- ${name} | ${contentType}${size} | fileId: ${fileId}`;
|
|
5757
|
+
};
|
|
5758
|
+
var attachmentListPreview = (email) => {
|
|
5759
|
+
const attachments = emailAttachments(email);
|
|
5760
|
+
if (attachments.length === 0) return "";
|
|
5761
|
+
return [
|
|
5762
|
+
`\u9644\u4EF6\uFF08${attachments.length}\uFF09\uFF1A`,
|
|
5763
|
+
...attachments.map(attachmentPreview),
|
|
5764
|
+
"\u8BFB\u53D6\u9644\u4EF6\uFF1A\u518D\u6B21\u8C03\u7528 email_read\uFF0C\u4F20\u5165\u5F53\u524D dbKey \u548C attachmentFileId\u3002"
|
|
5765
|
+
].join("\n");
|
|
5766
|
+
};
|
|
5701
5767
|
var matchesWaitFilters = (email, args) => {
|
|
5702
5768
|
const subjectContains = normalizeContains(args.subjectContains);
|
|
5703
5769
|
const fromContains = normalizeContains(args.fromContains);
|
|
@@ -5723,6 +5789,58 @@ var stripHtml = (html) => typeof html === "string" ? compactWhitespace(
|
|
|
5723
5789
|
html.replace(/<a\b[^>]*href=["']([^"']+)["'][^>]*>/gi, " $1 ").replace(/<[^>]+>/g, " ")
|
|
5724
5790
|
) : "";
|
|
5725
5791
|
var cleanUrl = (url) => url.replace(/[),.;\]}>]+$/g, "");
|
|
5792
|
+
var extractPdfText = async (blob) => {
|
|
5793
|
+
const pdfjsLib = await import("./pdf-U6KSUEZZ.js");
|
|
5794
|
+
if (typeof window !== "undefined" && pdfjsLib.GlobalWorkerOptions && !pdfjsLib.GlobalWorkerOptions.workerSrc) {
|
|
5795
|
+
pdfjsLib.GlobalWorkerOptions.workerSrc = "/public/assets/pdf.worker.mjs";
|
|
5796
|
+
}
|
|
5797
|
+
const data = await blob.arrayBuffer();
|
|
5798
|
+
const pdf = await pdfjsLib.getDocument({ data }).promise;
|
|
5799
|
+
const pages = [];
|
|
5800
|
+
for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber += 1) {
|
|
5801
|
+
const page = await pdf.getPage(pageNumber);
|
|
5802
|
+
const textContent = await page.getTextContent();
|
|
5803
|
+
const text = textContent.items.map((item) => typeof item?.str === "string" ? item.str : "").filter(Boolean).join(" ").trim();
|
|
5804
|
+
if (text) pages.push(`--- page ${pageNumber} ---
|
|
5805
|
+
${text}`);
|
|
5806
|
+
}
|
|
5807
|
+
return pages.join("\n\n").trim();
|
|
5808
|
+
};
|
|
5809
|
+
var readEmailAttachment = async (email, fileId, maxChars, thunkApi) => {
|
|
5810
|
+
const attachment = emailAttachments(email).find(
|
|
5811
|
+
(item) => asOptionalTrimmedString(item?.fileId) === fileId
|
|
5812
|
+
);
|
|
5813
|
+
if (!attachment) {
|
|
5814
|
+
throw new Error(`\u9644\u4EF6 ${fileId} \u4E0D\u5C5E\u4E8E\u90AE\u4EF6 ${email?.dbKey || "unknown"}`);
|
|
5815
|
+
}
|
|
5816
|
+
const result = await readFileContentAction({ fileId }, thunkApi);
|
|
5817
|
+
const blob = result.blob;
|
|
5818
|
+
const contentType = (asOptionalTrimmedString(attachment?.contentType) || asOptionalTrimmedString(blob.type) || "application/octet-stream").toLowerCase();
|
|
5819
|
+
const filename = asOptionalTrimmedString(attachment?.filename) ?? fileId;
|
|
5820
|
+
let content;
|
|
5821
|
+
if (contentType === "application/pdf" || filename.toLowerCase().endsWith(".pdf")) {
|
|
5822
|
+
content = await extractPdfText(blob);
|
|
5823
|
+
if (!content) {
|
|
5824
|
+
throw new Error(
|
|
5825
|
+
`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`
|
|
5826
|
+
);
|
|
5827
|
+
}
|
|
5828
|
+
} else if (contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("csv") || contentType.includes("xml") || /\.(txt|md|csv|json|xml|html?|log)$/i.test(filename)) {
|
|
5829
|
+
content = await blob.text();
|
|
5830
|
+
} else {
|
|
5831
|
+
throw new Error(
|
|
5832
|
+
`\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`
|
|
5833
|
+
);
|
|
5834
|
+
}
|
|
5835
|
+
const truncated = content.length > maxChars;
|
|
5836
|
+
return {
|
|
5837
|
+
attachment,
|
|
5838
|
+
content: truncated ? content.slice(0, maxChars) : content,
|
|
5839
|
+
totalChars: content.length,
|
|
5840
|
+
truncated,
|
|
5841
|
+
source: result.source
|
|
5842
|
+
};
|
|
5843
|
+
};
|
|
5726
5844
|
var extractEmailVerificationArtifacts = ({
|
|
5727
5845
|
text,
|
|
5728
5846
|
html
|
|
@@ -5790,13 +5908,25 @@ var emailSearchFunctionSchema = {
|
|
|
5790
5908
|
};
|
|
5791
5909
|
var emailReadFunctionSchema = {
|
|
5792
5910
|
name: "email_read",
|
|
5793
|
-
description:
|
|
5911
|
+
description: [
|
|
5912
|
+
"\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
|
|
5913
|
+
"\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",
|
|
5914
|
+
"PDF \u4F18\u5148\u76F4\u63A5\u63D0\u53D6\u6587\u5B57\u5C42\uFF1B\u626B\u63CF\u7248 PDF \u4F1A\u63D0\u793A\u6539\u7528 OCR\u3002"
|
|
5915
|
+
].join("\n"),
|
|
5794
5916
|
parameters: {
|
|
5795
5917
|
type: "object",
|
|
5796
5918
|
properties: {
|
|
5797
5919
|
dbKey: {
|
|
5798
5920
|
type: "string",
|
|
5799
5921
|
description: "\u90AE\u4EF6\u8BB0\u5F55\u7684 dbKey\uFF0C\u4F8B\u5982 email-userId-emailId\u3002"
|
|
5922
|
+
},
|
|
5923
|
+
attachmentFileId: {
|
|
5924
|
+
type: "string",
|
|
5925
|
+
description: "\u53EF\u9009\u3002\u5F53\u524D\u90AE\u4EF6 attachments[] \u4E2D\u7684 fileId\uFF1B\u63D0\u4F9B\u540E\u8BFB\u53D6\u8BE5\u9644\u4EF6\u6587\u672C\u3002"
|
|
5926
|
+
},
|
|
5927
|
+
maxChars: {
|
|
5928
|
+
type: "number",
|
|
5929
|
+
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
5930
|
}
|
|
5801
5931
|
},
|
|
5802
5932
|
required: ["dbKey"]
|
|
@@ -6075,15 +6205,47 @@ ${artifacts.verificationLinks.slice(1).join("\n")}` : ""
|
|
|
6075
6205
|
};
|
|
6076
6206
|
}
|
|
6077
6207
|
async function emailReadFunc(args, thunkApi) {
|
|
6078
|
-
const email = await callToolApi(thunkApi, "/rpc/getEmail", args, {
|
|
6208
|
+
const email = await callToolApi(thunkApi, "/rpc/getEmail", { dbKey: args.dbKey }, {
|
|
6079
6209
|
withAuth: true
|
|
6080
6210
|
});
|
|
6211
|
+
const attachmentFileId = asOptionalTrimmedString(args.attachmentFileId);
|
|
6212
|
+
if (attachmentFileId) {
|
|
6213
|
+
const maxChars = clampInteger(args.maxChars, 12e3, 1e3, 5e4);
|
|
6214
|
+
const attachmentResult = await readEmailAttachment(
|
|
6215
|
+
email,
|
|
6216
|
+
attachmentFileId,
|
|
6217
|
+
maxChars,
|
|
6218
|
+
thunkApi
|
|
6219
|
+
);
|
|
6220
|
+
const filename = asOptionalTrimmedString(attachmentResult.attachment?.filename) ?? attachmentFileId;
|
|
6221
|
+
return {
|
|
6222
|
+
rawData: {
|
|
6223
|
+
emailDbKey: email?.dbKey,
|
|
6224
|
+
attachment: attachmentResult.attachment,
|
|
6225
|
+
content: attachmentResult.content,
|
|
6226
|
+
totalChars: attachmentResult.totalChars,
|
|
6227
|
+
truncated: attachmentResult.truncated,
|
|
6228
|
+
source: attachmentResult.source
|
|
6229
|
+
},
|
|
6230
|
+
displayData: [
|
|
6231
|
+
`\u9644\u4EF6\uFF1A${filename} | fileId: ${attachmentFileId}`,
|
|
6232
|
+
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}`,
|
|
6233
|
+
"",
|
|
6234
|
+
attachmentResult.content
|
|
6235
|
+
].join("\n")
|
|
6236
|
+
};
|
|
6237
|
+
}
|
|
6081
6238
|
const body = asOptionalTrimmedString(email?.text) ?? asOptionalTrimmedString(email?.html) ?? "";
|
|
6239
|
+
const attachments = attachmentListPreview(email);
|
|
6082
6240
|
return {
|
|
6083
6241
|
rawData: email,
|
|
6084
|
-
displayData:
|
|
6085
|
-
|
|
6086
|
-
|
|
6242
|
+
displayData: [
|
|
6243
|
+
emailPreview(email),
|
|
6244
|
+
"",
|
|
6245
|
+
body.slice(0, 4e3),
|
|
6246
|
+
attachments ? `
|
|
6247
|
+
${attachments}` : ""
|
|
6248
|
+
].filter(Boolean).join("\n")
|
|
6087
6249
|
};
|
|
6088
6250
|
}
|
|
6089
6251
|
async function emailUpdateTagsFunc(args, thunkApi) {
|
|
@@ -9207,214 +9369,6 @@ ${preview}`
|
|
|
9207
9369
|
};
|
|
9208
9370
|
}
|
|
9209
9371
|
|
|
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
9372
|
// packages/ai/tools/exaSearchTool.ts
|
|
9419
9373
|
var exaSearchSchema = {
|
|
9420
9374
|
name: "exa_search",
|
|
@@ -9708,74 +9662,16 @@ var olmOcrFunc = async (input, thunkApi) => {
|
|
|
9708
9662
|
};
|
|
9709
9663
|
};
|
|
9710
9664
|
|
|
9711
|
-
// packages/ai/tools/whisperTool.ts
|
|
9712
|
-
var SHARED_PARAMS = {
|
|
9713
|
-
type: "object",
|
|
9714
|
-
properties: {
|
|
9715
|
-
audioUrl: {
|
|
9716
|
-
type: "string",
|
|
9717
|
-
description: "\u97F3\u9891\u6765\u6E90\uFF1A\u5185\u90E8\u6587\u4EF6 ID (file-... \u6216 ULID)\u3001\u516C\u5F00 http/https URL\uFF0C\u6216 base64 data URI\uFF08data:audio/...;base64,...\uFF09\u3002\u652F\u6301 mp3\u3001wav\u3001m4a\u3001ogg\u3001flac \u7B49\u5E38\u89C1\u683C\u5F0F\u3002"
|
|
9718
|
-
},
|
|
9719
|
-
language: {
|
|
9720
|
-
type: "string",
|
|
9721
|
-
description: "\u53EF\u9009\uFF0C\u6307\u5B9A\u97F3\u9891\u8BED\u8A00\u4EE5\u63D0\u5347\u7CBE\u5EA6\uFF08\u5982 'zh'\u3001'en'\u3001'ja'\uFF09\u3002\u4E0D\u6307\u5B9A\u5219\u81EA\u52A8\u68C0\u6D4B\u3002"
|
|
9722
|
-
}
|
|
9723
|
-
},
|
|
9724
|
-
required: ["audioUrl"]
|
|
9725
|
-
};
|
|
9726
|
-
var whisperTurboSchema = {
|
|
9727
|
-
name: "whisper_turbo",
|
|
9728
|
-
description: "\u4F7F\u7528 openai/whisper-large-v3-turbo \u5BF9\u97F3\u9891\u8FDB\u884C\u8BED\u97F3\u8F6C\u6587\u5B57\uFF08ASR\uFF09\u3002\u901F\u5EA6\u5FEB\u3001\u4EF7\u683C\u4F4E\uFF08$0.0002/min\uFF09\uFF0C\u9002\u5408\u5927\u591A\u6570\u573A\u666F\u7684\u5B9E\u65F6\u6216\u6279\u91CF\u8F6C\u5F55\u3002",
|
|
9729
|
-
parameters: SHARED_PARAMS
|
|
9730
|
-
};
|
|
9731
|
-
var whisperTurboFunc = async (input, thunkApi) => {
|
|
9732
|
-
const { audioUrl, language } = input;
|
|
9733
|
-
const data = await callToolApi(
|
|
9734
|
-
thunkApi,
|
|
9735
|
-
"/api/whisper-turbo",
|
|
9736
|
-
{ audioUrl, language },
|
|
9737
|
-
{ withAuth: true }
|
|
9738
|
-
);
|
|
9739
|
-
return {
|
|
9740
|
-
summary: "Transcription completed",
|
|
9741
|
-
text: data.text || "",
|
|
9742
|
-
language: data.language,
|
|
9743
|
-
duration: data.duration,
|
|
9744
|
-
rawData: data
|
|
9745
|
-
};
|
|
9746
|
-
};
|
|
9747
|
-
var whisperV3Schema = {
|
|
9748
|
-
name: "whisper_v3",
|
|
9749
|
-
description: "\u4F7F\u7528 openai/whisper-large-v3 \u5BF9\u97F3\u9891\u8FDB\u884C\u9AD8\u7CBE\u5EA6\u8BED\u97F3\u8F6C\u6587\u5B57\uFF08ASR\uFF09\u3002\u7CBE\u5EA6\u66F4\u9AD8\uFF08\u5C24\u5176\u591A\u8BED\u8A00/\u4E2D\u6587\uFF09\uFF0C\u4EF7\u683C\u7A0D\u9AD8\uFF08$0.00045/min\uFF09\uFF0C\u9002\u5408\u5BF9\u51C6\u786E\u7387\u8981\u6C42\u4E25\u683C\u7684\u573A\u666F\u3002",
|
|
9750
|
-
parameters: SHARED_PARAMS
|
|
9751
|
-
};
|
|
9752
|
-
var whisperV3Func = async (input, thunkApi) => {
|
|
9753
|
-
const { audioUrl, language } = input;
|
|
9754
|
-
const data = await callToolApi(
|
|
9755
|
-
thunkApi,
|
|
9756
|
-
"/api/whisper-v3",
|
|
9757
|
-
{ audioUrl, language },
|
|
9758
|
-
{ withAuth: true }
|
|
9759
|
-
);
|
|
9760
|
-
return {
|
|
9761
|
-
summary: "Transcription completed",
|
|
9762
|
-
text: data.text || "",
|
|
9763
|
-
language: data.language,
|
|
9764
|
-
duration: data.duration,
|
|
9765
|
-
rawData: data
|
|
9766
|
-
};
|
|
9767
|
-
};
|
|
9768
|
-
|
|
9769
9665
|
// packages/ai/tools/transcribeVideoTool.ts
|
|
9770
9666
|
var transcribeVideoSchema = {
|
|
9771
9667
|
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\
|
|
9668
|
+
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
9669
|
parameters: {
|
|
9774
9670
|
type: "object",
|
|
9775
9671
|
properties: {
|
|
9776
9672
|
url: {
|
|
9777
9673
|
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"
|
|
9674
|
+
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
9675
|
},
|
|
9780
9676
|
p: {
|
|
9781
9677
|
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 +10018,7 @@ var cloudflareCrawlStatusFunctionSchema = {
|
|
|
10122
10018
|
async function cloudflareCrawlStatusFunc(args, thunkApi) {
|
|
10123
10019
|
const { jobId, limit, status, cursor } = args;
|
|
10124
10020
|
if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
10125
|
-
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-
|
|
10021
|
+
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-AD7CXTA4.js");
|
|
10126
10022
|
const { baseUrl, token } = getToolRequestContext2(thunkApi);
|
|
10127
10023
|
const params = new URLSearchParams();
|
|
10128
10024
|
if (limit !== void 0) params.set("limit", String(limit));
|
|
@@ -10900,7 +10796,7 @@ var selectUserIdFromState = (state2) => {
|
|
|
10900
10796
|
var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
|
|
10901
10797
|
async function addImageContentToSpace(input) {
|
|
10902
10798
|
const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
|
|
10903
|
-
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-
|
|
10799
|
+
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-NZZNAVCB.js")).addContentAction;
|
|
10904
10800
|
await addContentAction2(
|
|
10905
10801
|
{
|
|
10906
10802
|
spaceId: input.spaceId,
|
|
@@ -11788,6 +11684,7 @@ var deleteMemoryFunctionSchema = {
|
|
|
11788
11684
|
};
|
|
11789
11685
|
|
|
11790
11686
|
// packages/ai/tools/deleteMemoryTool.ts
|
|
11687
|
+
var VNEXT_STATE_ID_PREFIX = "vnext-state-";
|
|
11791
11688
|
async function deleteMemoryFunc(args, thunkApi) {
|
|
11792
11689
|
const reason = String(args.reason ?? "").trim();
|
|
11793
11690
|
if (!reason && !args.ids?.length && !args.contentKeyword && !args.tags?.length) {
|
|
@@ -11824,11 +11721,15 @@ async function deleteMemoryFunc(args, thunkApi) {
|
|
|
11824
11721
|
displayData: "\u672A\u627E\u5230\u5339\u914D\u7684\u8BB0\u5FC6\uFF0C\u65E0\u9700\u5220\u9664\u3002"
|
|
11825
11722
|
};
|
|
11826
11723
|
}
|
|
11724
|
+
const retiredCount2 = result.retiredIds?.length ?? (result.preview ?? []).filter(
|
|
11725
|
+
(item) => item.id.startsWith(VNEXT_STATE_ID_PREFIX)
|
|
11726
|
+
).length;
|
|
11727
|
+
const physicalCount2 = Math.max(0, matched - retiredCount2);
|
|
11827
11728
|
const previewList = (result.preview ?? []).map((item, idx) => `${idx + 1}. [${item.kind}] ${item.content}`).join("\n");
|
|
11828
11729
|
return {
|
|
11829
11730
|
rawData: result,
|
|
11830
11731
|
displayData: [
|
|
11831
|
-
`\u3010\u5F85\u7528\u6237\u786E\u8BA4\u3011\u5339\u914D\u5230 ${matched} \u6761\u7B26\u5408\u6761\u4EF6\u7684\u8BB0\u5FC6\
|
|
11732
|
+
`\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
11733
|
previewList ? `\u9884\u89C8\u524D ${result.preview?.length} \u6761\uFF1A
|
|
11833
11734
|
${previewList}` : "",
|
|
11834
11735
|
`\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 +11737,11 @@ ${previewList}` : "",
|
|
|
11836
11737
|
};
|
|
11837
11738
|
}
|
|
11838
11739
|
const count = result.deletedCount ?? 0;
|
|
11740
|
+
const retiredCount = result.retiredIds?.length ?? 0;
|
|
11741
|
+
const physicalCount = Math.max(0, count - retiredCount);
|
|
11839
11742
|
return {
|
|
11840
11743
|
rawData: result,
|
|
11841
|
-
displayData: `\u5DF2\u5728\u7528\u6237\u6743\u9650\u8303\u56F4\u5185\u786E\u8BA4\u5E76\u7269\u7406\u5220\u9664 ${
|
|
11744
|
+
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
11745
|
};
|
|
11843
11746
|
}
|
|
11844
11747
|
|
|
@@ -12508,6 +12411,34 @@ async function createSkillAgentToolFunc(args, thunkApi) {
|
|
|
12508
12411
|
return createAgentToolFunc(buildCreateSkillAgentArgs(args), thunkApi);
|
|
12509
12412
|
}
|
|
12510
12413
|
|
|
12414
|
+
// packages/app/settings/fieldSelectors.ts
|
|
12415
|
+
var selectMaxExecutionTime = (state2) => state2.settings.maxExecutionTime;
|
|
12416
|
+
var selectGlobalPrompt = (state2) => state2.settings.globalPrompt;
|
|
12417
|
+
var selectUserTonePreset = (state2) => normalizeTonePresetSetting(state2.settings.userTonePreset);
|
|
12418
|
+
var selectKnowledgeCaptureLevel = (state2) => normalizePolicyLevelSetting(
|
|
12419
|
+
state2.settings.knowledgeCaptureLevel,
|
|
12420
|
+
DEFAULT_USER_PREFERENCE_PROFILE.knowledgeCaptureLevel
|
|
12421
|
+
);
|
|
12422
|
+
var selectSpaceContextLevel = (state2) => state2.settings.enableReadCurrentSpace === false ? 1 : normalizePolicyLevelSetting(
|
|
12423
|
+
state2.settings.spaceContextLevel,
|
|
12424
|
+
DEFAULT_USER_PREFERENCE_PROFILE.spaceContextLevel
|
|
12425
|
+
);
|
|
12426
|
+
var selectAutoApproveSelfUpdateFields = createSelector(
|
|
12427
|
+
[(state2) => state2.settings.autoApproveSelfUpdateFields],
|
|
12428
|
+
(fields) => normalizeAgentUpdateFieldList(
|
|
12429
|
+
fields,
|
|
12430
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS
|
|
12431
|
+
)
|
|
12432
|
+
);
|
|
12433
|
+
var selectAiRecentContentLimit = (state2) => state2.settings.aiRecentContentLimit ?? 50;
|
|
12434
|
+
var selectSystemBuiltinSkills = createSelector(
|
|
12435
|
+
[(state2) => state2.settings.systemBuiltinSkills],
|
|
12436
|
+
(systemBuiltinSkills) => normalizeSystemBuiltinSkills(
|
|
12437
|
+
systemBuiltinSkills,
|
|
12438
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
12439
|
+
)
|
|
12440
|
+
);
|
|
12441
|
+
|
|
12511
12442
|
// packages/chat/messages/messageAgent.ts
|
|
12512
12443
|
function resolveMessageAgentKey(message) {
|
|
12513
12444
|
if (!message) return void 0;
|
|
@@ -12554,11 +12485,13 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
|
|
|
12554
12485
|
autoApprovedFields
|
|
12555
12486
|
});
|
|
12556
12487
|
const previousAgentForUpdate = buildUpdateThunkPreviousAgent(previousAgent, userId);
|
|
12488
|
+
const formData = buildPatch(args);
|
|
12489
|
+
const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
|
|
12557
12490
|
const agent = await thunkApi.dispatch(
|
|
12558
12491
|
updateAgent({
|
|
12559
12492
|
userId,
|
|
12560
12493
|
agentId: extractAgentId(currentAgentKey),
|
|
12561
|
-
formData
|
|
12494
|
+
formData,
|
|
12562
12495
|
previousAgent: previousAgentForUpdate
|
|
12563
12496
|
})
|
|
12564
12497
|
).unwrap().catch((e) => {
|
|
@@ -12570,7 +12503,8 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
|
|
|
12570
12503
|
previousAgentForUpdate,
|
|
12571
12504
|
requestedFields
|
|
12572
12505
|
),
|
|
12573
|
-
displayData: formatUpdatedAgentOutput(agent)
|
|
12506
|
+
displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
|
|
12507
|
+
${effortNote}` : "")
|
|
12574
12508
|
};
|
|
12575
12509
|
}
|
|
12576
12510
|
|
|
@@ -13059,11 +12993,14 @@ function checkCredentialFanout(args) {
|
|
|
13059
12993
|
};
|
|
13060
12994
|
}
|
|
13061
12995
|
if (candidateGroup === entryGroup) {
|
|
12996
|
+
if (args.allowCredentialConcurrency === true) {
|
|
12997
|
+
continue;
|
|
12998
|
+
}
|
|
13062
12999
|
return {
|
|
13063
13000
|
allowed: false,
|
|
13064
13001
|
reason: "credential_group_conflict",
|
|
13065
13002
|
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\
|
|
13003
|
+
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
13004
|
};
|
|
13068
13005
|
}
|
|
13069
13006
|
}
|
|
@@ -13124,6 +13061,11 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
13124
13061
|
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
13062
|
default: false
|
|
13126
13063
|
},
|
|
13064
|
+
allowCredentialConcurrency: {
|
|
13065
|
+
type: "boolean",
|
|
13066
|
+
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",
|
|
13067
|
+
default: false
|
|
13068
|
+
},
|
|
13127
13069
|
trackTodo: {
|
|
13128
13070
|
type: "boolean",
|
|
13129
13071
|
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 +13112,8 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
13170
13112
|
const verdict = checkCredentialFanout({
|
|
13171
13113
|
active,
|
|
13172
13114
|
candidate: { agentKey, credentialGroup: args.credentialGroup },
|
|
13173
|
-
allowUnknownCredential: args.allowUnknownCredential === true
|
|
13115
|
+
allowUnknownCredential: args.allowUnknownCredential === true,
|
|
13116
|
+
allowCredentialConcurrency: args.allowCredentialConcurrency === true
|
|
13174
13117
|
});
|
|
13175
13118
|
if (!verdict.allowed) throw new Error(verdict.message);
|
|
13176
13119
|
}
|
|
@@ -13642,75 +13585,6 @@ async function handleWait(thunkApi, opts, contextOpts) {
|
|
|
13642
13585
|
}
|
|
13643
13586
|
}
|
|
13644
13587
|
|
|
13645
|
-
// packages/ai/tools/agent/setTodoListTool.ts
|
|
13646
|
-
var setTodoListFunctionSchema = {
|
|
13647
|
-
name: "setTodoList",
|
|
13648
|
-
description: "\u8BBE\u7F6E/\u6574\u4F53\u66F4\u65B0\u5F53\u524D\u5BF9\u8BDD\u7684\u4EFB\u52A1\u5217\u8868\uFF08Kimi \u5F0F Todo \u5217\u8868\uFF09\u3002\u7528\u4E8E\u591A\u6B65\u9AA4\u4EFB\u52A1\u8FDB\u5EA6\u8FFD\u8E2A\u4E0E\u5C55\u793A\u3002",
|
|
13649
|
-
parameters: {
|
|
13650
|
-
type: "object",
|
|
13651
|
-
properties: {
|
|
13652
|
-
todos: {
|
|
13653
|
-
type: "array",
|
|
13654
|
-
description: "\u5B8C\u6574\u7684 Todo \u4EFB\u52A1\u5217\u8868\uFF08\u6574\u4F53\u66FF\u6362\uFF09",
|
|
13655
|
-
items: {
|
|
13656
|
-
type: "object",
|
|
13657
|
-
properties: {
|
|
13658
|
-
title: {
|
|
13659
|
-
type: "string",
|
|
13660
|
-
description: "\u4EFB\u52A1\u63CF\u8FF0/\u6807\u9898"
|
|
13661
|
-
},
|
|
13662
|
-
status: {
|
|
13663
|
-
type: "string",
|
|
13664
|
-
enum: ["pending", "in_progress", "done"],
|
|
13665
|
-
description: "\u4EFB\u52A1\u72B6\u6001\uFF1Apending(\u5F85\u5904\u7406), in_progress(\u8FDB\u884C\u4E2D), done(\u5DF2\u5B8C\u6210)"
|
|
13666
|
-
}
|
|
13667
|
-
},
|
|
13668
|
-
required: ["title", "status"]
|
|
13669
|
-
}
|
|
13670
|
-
}
|
|
13671
|
-
},
|
|
13672
|
-
required: ["todos"]
|
|
13673
|
-
}
|
|
13674
|
-
};
|
|
13675
|
-
function formatTodoListDisplayData(todos) {
|
|
13676
|
-
if (!todos || todos.length === 0) {
|
|
13677
|
-
return "\u{1F4CB} Todo \u5217\u8868\u5DF2\u6E05\u7A7A";
|
|
13678
|
-
}
|
|
13679
|
-
const statusIcons = {
|
|
13680
|
-
pending: "\u23F3",
|
|
13681
|
-
in_progress: "\u{1F504}",
|
|
13682
|
-
done: "\u2705"
|
|
13683
|
-
};
|
|
13684
|
-
const statusLabels = {
|
|
13685
|
-
pending: "\u5F85\u5904\u7406",
|
|
13686
|
-
in_progress: "\u8FDB\u884C\u4E2D",
|
|
13687
|
-
done: "\u5DF2\u5B8C\u6210"
|
|
13688
|
-
};
|
|
13689
|
-
const doneCount = todos.filter((t) => t.status === "done").length;
|
|
13690
|
-
const lines = [
|
|
13691
|
-
`\u{1F4CB} Todo \u5217\u8868 (${doneCount}/${todos.length})`,
|
|
13692
|
-
...todos.map(
|
|
13693
|
-
(t) => `\u2022 ${statusIcons[t.status] ?? "\u2022"} [${statusLabels[t.status] ?? t.status}] ${t.title}`
|
|
13694
|
-
)
|
|
13695
|
-
];
|
|
13696
|
-
return lines.join("\n");
|
|
13697
|
-
}
|
|
13698
|
-
async function setTodoListFunc(args) {
|
|
13699
|
-
const todos = Array.isArray(args?.todos) ? args.todos : [];
|
|
13700
|
-
const sanitizedTodos = todos.map((item) => {
|
|
13701
|
-
const title = typeof item?.title === "string" ? item.title.trim() : "Untitled Task";
|
|
13702
|
-
let status = "pending";
|
|
13703
|
-
if (item?.status === "in_progress") status = "in_progress";
|
|
13704
|
-
else if (item?.status === "done") status = "done";
|
|
13705
|
-
return { title, status };
|
|
13706
|
-
});
|
|
13707
|
-
const displayData = formatTodoListDisplayData(sanitizedTodos);
|
|
13708
|
-
return {
|
|
13709
|
-
rawData: { todos: sanitizedTodos },
|
|
13710
|
-
displayData
|
|
13711
|
-
};
|
|
13712
|
-
}
|
|
13713
|
-
|
|
13714
13588
|
// packages/ai/tools/agent/agentTools.ts
|
|
13715
13589
|
var agentToolDefinitions = [
|
|
13716
13590
|
{
|
|
@@ -13858,21 +13732,6 @@ var agentToolDefinitions = [
|
|
|
13858
13732
|
riskLevel: "medium",
|
|
13859
13733
|
costLevel: "low",
|
|
13860
13734
|
defaultConsent: "auto"
|
|
13861
|
-
},
|
|
13862
|
-
{
|
|
13863
|
-
id: "setTodoList",
|
|
13864
|
-
schema: setTodoListFunctionSchema,
|
|
13865
|
-
executor: setTodoListFunc,
|
|
13866
|
-
description: {
|
|
13867
|
-
name: "setTodoList",
|
|
13868
|
-
description: "\u8BBE\u7F6E/\u6574\u4F53\u66F4\u65B0\u5F53\u524D\u5BF9\u8BDD\u7684\u4EFB\u52A1\u5217\u8868\uFF08Kimi \u5F0F Todo \u5217\u8868\uFF09\u3002\u7528\u4E8E\u591A\u6B65\u9AA4\u4EFB\u52A1\u8FDB\u5EA6\u8FFD\u8E2A\u4E0E\u5C55\u793A\u3002",
|
|
13869
|
-
category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
|
|
13870
|
-
},
|
|
13871
|
-
behavior: "data",
|
|
13872
|
-
uiGroup: "agent",
|
|
13873
|
-
riskLevel: "low",
|
|
13874
|
-
costLevel: "low",
|
|
13875
|
-
defaultConsent: "auto"
|
|
13876
13735
|
}
|
|
13877
13736
|
];
|
|
13878
13737
|
|
|
@@ -14797,7 +14656,7 @@ ${resultStr}
|
|
|
14797
14656
|
}
|
|
14798
14657
|
|
|
14799
14658
|
// packages/ai/tools/toolRunStore.ts
|
|
14800
|
-
var
|
|
14659
|
+
var import_react2 = __toESM(require_react());
|
|
14801
14660
|
var createToolRunId = () => `toolrun_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
14802
14661
|
var runsById = /* @__PURE__ */ new Map();
|
|
14803
14662
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
@@ -14906,7 +14765,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
14906
14765
|
if (!executionInput) {
|
|
14907
14766
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
14908
14767
|
}
|
|
14909
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
14768
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-GHI3WBEI.js");
|
|
14910
14769
|
const { executor } = findToolExecutor2(run.toolName);
|
|
14911
14770
|
toolRunStarted({
|
|
14912
14771
|
id: run.id,
|
|
@@ -14930,7 +14789,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
14930
14789
|
const latestState = thunkApi.getState();
|
|
14931
14790
|
const userId = selectIdentityUserId(latestState);
|
|
14932
14791
|
if (userId) {
|
|
14933
|
-
const { fetchUserSpaceMemberships } = await import("./memberThunks-
|
|
14792
|
+
const { fetchUserSpaceMemberships } = await import("./memberThunks-YICJI4IS.js");
|
|
14934
14793
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
14935
14794
|
}
|
|
14936
14795
|
}
|
|
@@ -17230,7 +17089,11 @@ async function fetchDialogMessagesFromServer(args) {
|
|
|
17230
17089
|
Authorization: `Bearer ${args.token}`,
|
|
17231
17090
|
"Content-Type": "application/json"
|
|
17232
17091
|
},
|
|
17233
|
-
body: JSON.stringify({
|
|
17092
|
+
body: JSON.stringify({
|
|
17093
|
+
dialogId: args.dialogId,
|
|
17094
|
+
...args.dialogKey ? { dialogKey: args.dialogKey } : {},
|
|
17095
|
+
limit: args.limit
|
|
17096
|
+
})
|
|
17234
17097
|
});
|
|
17235
17098
|
if (!response.ok) return [];
|
|
17236
17099
|
const newestFirst = await response.json();
|
|
@@ -17240,7 +17103,7 @@ async function fetchDialogMessagesFromServer(args) {
|
|
|
17240
17103
|
dbKey: message.dbKey
|
|
17241
17104
|
}));
|
|
17242
17105
|
}
|
|
17243
|
-
async function collectBestAvailableDialogMessages(db, dialogId, thunkApi, scanLimit) {
|
|
17106
|
+
async function collectBestAvailableDialogMessages(db, dialogId, thunkApi, scanLimit, dialogKey) {
|
|
17244
17107
|
const localMessages = await collectDialogMessages(db, dialogId);
|
|
17245
17108
|
const state2 = thunkApi?.getState?.();
|
|
17246
17109
|
const runtime = state2 ? selectRuntimeSnapshot(state2) : null;
|
|
@@ -17256,6 +17119,7 @@ async function collectBestAvailableDialogMessages(db, dialogId, thunkApi, scanLi
|
|
|
17256
17119
|
serverBase: base,
|
|
17257
17120
|
token: runtime?.currentToken,
|
|
17258
17121
|
dialogId,
|
|
17122
|
+
...dialogKey ? { dialogKey } : {},
|
|
17259
17123
|
limit: scanLimit
|
|
17260
17124
|
}).catch(() => [])
|
|
17261
17125
|
)
|
|
@@ -17331,7 +17195,13 @@ async function searchDialogMessagesFunc(args, _thunkApi, context) {
|
|
|
17331
17195
|
1,
|
|
17332
17196
|
SERVER_SCAN_LIMIT
|
|
17333
17197
|
);
|
|
17334
|
-
const messages = await collectBestAvailableDialogMessages(
|
|
17198
|
+
const messages = await collectBestAvailableDialogMessages(
|
|
17199
|
+
db,
|
|
17200
|
+
dialogId,
|
|
17201
|
+
_thunkApi,
|
|
17202
|
+
scanLimit,
|
|
17203
|
+
dialogKey
|
|
17204
|
+
);
|
|
17335
17205
|
const limit = clampDialogSearchNumber(args.limit, 5, 1, MAX_LIMIT);
|
|
17336
17206
|
const contextMessages = clampDialogSearchNumber(args.contextMessages, 1, 0, MAX_CONTEXT_MESSAGES);
|
|
17337
17207
|
const results = buildDialogMessageSearchResults({
|
|
@@ -17413,7 +17283,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
17413
17283
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
17414
17284
|
};
|
|
17415
17285
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
17416
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
17286
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-6GUOZH52.js");
|
|
17417
17287
|
if (getDocState().pageKey === id) {
|
|
17418
17288
|
applyExternalDocUpdate({
|
|
17419
17289
|
slateData: finalSlateData,
|
|
@@ -17438,7 +17308,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
17438
17308
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
17439
17309
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
17440
17310
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
17441
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./
|
|
17311
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-G2MJRKUE.js")).setSettings;
|
|
17442
17312
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
17443
17313
|
}
|
|
17444
17314
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
@@ -17807,7 +17677,7 @@ async function runZiweiChart(input) {
|
|
|
17807
17677
|
const gender = normalizeGender(input.gender);
|
|
17808
17678
|
const fixLeap = input.fixLeap !== false;
|
|
17809
17679
|
const isLeapMonth = input.isLeapMonth === true;
|
|
17810
|
-
const { astro } = await import("./lib-
|
|
17680
|
+
const { astro } = await import("./lib-PU2G2MSO.js");
|
|
17811
17681
|
const rawChart = calendarType === "lunar" ? astro.byLunar(dateStr, timeIndex, gender, isLeapMonth, fixLeap, language) : astro.bySolar(dateStr, timeIndex, gender, fixLeap, language);
|
|
17812
17682
|
const palaces = rawChart.palaces.map((palace) => ({
|
|
17813
17683
|
index: palace.index,
|
|
@@ -18161,6 +18031,38 @@ var baseToolDefinitions = [
|
|
|
18161
18031
|
costLevel: "low",
|
|
18162
18032
|
defaultConsent: "ask"
|
|
18163
18033
|
},
|
|
18034
|
+
{
|
|
18035
|
+
id: "updateAgentAutomation",
|
|
18036
|
+
schema: updateAgentAutomationFunctionSchema,
|
|
18037
|
+
executor: updateAgentAutomationFunc,
|
|
18038
|
+
description: {
|
|
18039
|
+
name: "updateAgentAutomation",
|
|
18040
|
+
description: "\u66F4\u65B0\u4E00\u4E2A agent automation \u7684\u6807\u9898\u3001instruction\u3001trigger\u3001status \u7B49\u5B57\u6BB5\u3002",
|
|
18041
|
+
category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
|
|
18042
|
+
},
|
|
18043
|
+
behavior: "action",
|
|
18044
|
+
uiGroup: "general",
|
|
18045
|
+
capability: "general",
|
|
18046
|
+
riskLevel: "medium",
|
|
18047
|
+
costLevel: "low",
|
|
18048
|
+
defaultConsent: "ask"
|
|
18049
|
+
},
|
|
18050
|
+
{
|
|
18051
|
+
id: "deleteAgentAutomation",
|
|
18052
|
+
schema: deleteAgentAutomationFunctionSchema,
|
|
18053
|
+
executor: deleteAgentAutomationFunc,
|
|
18054
|
+
description: {
|
|
18055
|
+
name: "deleteAgentAutomation",
|
|
18056
|
+
description: "\u5220\u9664\u4E00\u4E2A agent automation \u53CA\u5176 owner index\u3002",
|
|
18057
|
+
category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
|
|
18058
|
+
},
|
|
18059
|
+
behavior: "action",
|
|
18060
|
+
uiGroup: "general",
|
|
18061
|
+
capability: "general",
|
|
18062
|
+
riskLevel: "high",
|
|
18063
|
+
costLevel: "low",
|
|
18064
|
+
defaultConsent: "ask"
|
|
18065
|
+
},
|
|
18164
18066
|
{
|
|
18165
18067
|
id: "notifyUser",
|
|
18166
18068
|
schema: notifyUserFunctionSchema,
|
|
@@ -19204,7 +19106,7 @@ var baseToolDefinitions = [
|
|
|
19204
19106
|
},
|
|
19205
19107
|
behavior: getChromeConnectorToolBehavior(name),
|
|
19206
19108
|
capability: "browser_automation",
|
|
19207
|
-
riskLevel: name === "
|
|
19109
|
+
riskLevel: name === "browser_click_element" || name === "browser_type" ? "medium" : "low",
|
|
19208
19110
|
costLevel: "low",
|
|
19209
19111
|
defaultConsent: getChromeConnectorToolDefaultConsent(name),
|
|
19210
19112
|
cancelable: true
|
|
@@ -19254,28 +19156,6 @@ var baseToolDefinitions = [
|
|
|
19254
19156
|
},
|
|
19255
19157
|
behavior: "data"
|
|
19256
19158
|
},
|
|
19257
|
-
{
|
|
19258
|
-
id: "whisperTurbo",
|
|
19259
|
-
schema: whisperTurboSchema,
|
|
19260
|
-
executor: whisperTurboFunc,
|
|
19261
|
-
description: {
|
|
19262
|
-
name: "whisper_turbo",
|
|
19263
|
-
description: "\u4F7F\u7528 whisper-large-v3-turbo \u5FEB\u901F\u8F6C\u5F55\u97F3\u9891\u4E3A\u6587\u5B57\uFF0C\u652F\u6301\u591A\u8BED\u8A00\uFF0C\u901F\u5EA6\u5FEB\u4EF7\u683C\u4F4E\u3002",
|
|
19264
|
-
category: "\u97F3\u9891\u4E0E\u5A92\u4F53"
|
|
19265
|
-
},
|
|
19266
|
-
behavior: "data"
|
|
19267
|
-
},
|
|
19268
|
-
{
|
|
19269
|
-
id: "whisperV3",
|
|
19270
|
-
schema: whisperV3Schema,
|
|
19271
|
-
executor: whisperV3Func,
|
|
19272
|
-
description: {
|
|
19273
|
-
name: "whisper_v3",
|
|
19274
|
-
description: "\u4F7F\u7528 whisper-large-v3 \u9AD8\u7CBE\u5EA6\u8F6C\u5F55\u97F3\u9891\uFF0C\u4E2D\u6587/\u591A\u8BED\u8A00\u51C6\u786E\u7387\u66F4\u9AD8\uFF0C\u9002\u5408\u5BF9\u8D28\u91CF\u8981\u6C42\u4E25\u683C\u7684\u573A\u666F\u3002",
|
|
19275
|
-
category: "\u97F3\u9891\u4E0E\u5A92\u4F53"
|
|
19276
|
-
},
|
|
19277
|
-
behavior: "data"
|
|
19278
|
-
},
|
|
19279
19159
|
{
|
|
19280
19160
|
id: "transcribeVideo",
|
|
19281
19161
|
schema: transcribeVideoSchema,
|
|
@@ -19638,7 +19518,7 @@ var toolDefinitions = [
|
|
|
19638
19518
|
];
|
|
19639
19519
|
var ALL_TOOL_FUNCTION_NAMES = toolDefinitions.map((tool) => tool.schema?.name).filter((name) => Boolean(name));
|
|
19640
19520
|
var AGENT_AVAILABLE_TOOL_NAMES = ALL_TOOL_FUNCTION_NAMES.filter(
|
|
19641
|
-
(name) => name !== "toolquery" && !name.startsWith("browser_") && name !== "exa_search"
|
|
19521
|
+
(name) => name !== "toolquery" && (!name.startsWith("browser_") || CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES.includes(name)) && name !== "exa_search"
|
|
19642
19522
|
);
|
|
19643
19523
|
var patchAgentToolSchemas = () => {
|
|
19644
19524
|
try {
|
|
@@ -19698,8 +19578,6 @@ var findToolExecutor = (rawName) => {
|
|
|
19698
19578
|
};
|
|
19699
19579
|
|
|
19700
19580
|
export {
|
|
19701
|
-
resolveAgentRequiredPackIds,
|
|
19702
|
-
resolveAgentRecommendedSkillNames,
|
|
19703
19581
|
clipMultilineText,
|
|
19704
19582
|
fetchAndSerializeTable,
|
|
19705
19583
|
getToolResultErrorData,
|
|
@@ -19710,12 +19588,18 @@ export {
|
|
|
19710
19588
|
toolRunFailed,
|
|
19711
19589
|
getAllToolRuns,
|
|
19712
19590
|
createSSEParser,
|
|
19713
|
-
|
|
19591
|
+
selectMaxExecutionTime,
|
|
19592
|
+
selectGlobalPrompt,
|
|
19593
|
+
selectUserTonePreset,
|
|
19594
|
+
selectKnowledgeCaptureLevel,
|
|
19595
|
+
selectSpaceContextLevel,
|
|
19596
|
+
selectAiRecentContentLimit,
|
|
19597
|
+
resolveAgentRequiredPackIds,
|
|
19598
|
+
resolveAgentRecommendedSkillNames,
|
|
19714
19599
|
readXPostFunctionSchema,
|
|
19715
19600
|
readXPostFunc,
|
|
19716
19601
|
readXhsProfileFunctionSchema,
|
|
19717
19602
|
readXhsProfileFunc,
|
|
19718
|
-
CHROME_CONNECTOR_TOOL_NAMES,
|
|
19719
19603
|
rememberMemoryFunctionSchema,
|
|
19720
19604
|
deleteMemoryFunctionSchema,
|
|
19721
19605
|
queryMemoryFunctionSchema,
|
|
@@ -19723,7 +19607,6 @@ export {
|
|
|
19723
19607
|
buildStartAgentRunFunctionSchema,
|
|
19724
19608
|
CONTROL_AGENT_RUN_ACTIONS,
|
|
19725
19609
|
buildControlAgentRunFunctionSchema,
|
|
19726
|
-
setTodoListFunc,
|
|
19727
19610
|
TOOL_GROUP_META,
|
|
19728
19611
|
toolQueryFunctionSchema,
|
|
19729
19612
|
toolQueryFunc,
|