nolo-cli 0.95.0-alpha.5 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{_executeModel-UXVEB3GO.js → _executeModel-4NTXSCYT.js} +67 -63
- package/{action-YVYQEAAV.js → action-GI44T4DR.js} +10 -10
- package/{addContentAction-O7R66HEX.js → addContentAction-B2DRF7P6.js} +9 -9
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-T3I7IXPK.js} +15 -17
- package/{agentDeleteCommand-QT7KPGJC.js → agentDeleteCommand-QYCCUQ35.js} +47 -43
- package/{agentEmailCommands-EGD3UOFY.js → agentEmailCommands-GJ7KXHA6.js} +89 -82
- package/{agentListCommands-PBY5LTDT.js → agentListCommands-JDU7V3M5.js} +77 -82
- package/{agentMachineCommands-WCCBD7CE.js → agentMachineCommands-PXJG3EDI.js} +42 -38
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-YK2BIIXZ.js} +1 -1
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-HF4A42D4.js} +1 -1
- package/agentRecordCommands-3ONMYU6P.js +135 -0
- package/{agentRunCommand-UQBDIINO.js → agentRunCommand-L6NJGDBA.js} +88 -80
- package/{agentRunControl-XLGD3UZ5.js → agentRunControl-5T64LM2M.js} +2 -2
- package/{agentRuntimeLocal-TT57XSVO.js → agentRuntimeLocal-SYLNOKCT.js} +44 -36
- package/{agentSlice-KTVOEUDX.js → agentSlice-X63VSE6R.js} +11 -11
- package/{appDeleteCommands-XMJJB6UT.js → appDeleteCommands-IP22BHZE.js} +42 -38
- package/{appDeployCommands-DORRXKWU.js → appDeployCommands-5ZTQL6UL.js} +42 -38
- package/{appDeployStatusCommands-BWEE72UH.js → appDeployStatusCommands-G6EMAT75.js} +42 -38
- package/{appGetCommands-WN6KKQHQ.js → appGetCommands-UXBDAYEM.js} +42 -38
- package/{appListCommands-W2WE5TD5.js → appListCommands-J274GTVP.js} +42 -38
- package/{authCommand-F4EFRRX6.js → authCommand-W6I6GD3F.js} +115 -23
- package/{authCommands-RGOGCPP6.js → authCommands-GBIFZWD3.js} +5 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZMF6YGNO.js} +6 -5
- package/{chatQueueReduxAdapter-4YQF4NHY.js → chatQueueReduxAdapter-KN774OKJ.js} +30 -29
- package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
- package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
- package/{chunk-HMPEO3ZE.js → chunk-2JCOP36I.js} +100 -100
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
- package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-IAO6JBYW.js → chunk-5B7XS6UO.js} +164 -14
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/chunk-5J3PYNUP.js +255 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
- package/{chunk-EFVDQUCT.js → chunk-5T2W2ZZN.js} +15 -20
- package/{chunk-DWUCB2A3.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-YQTQQX2H.js → chunk-67HHBCFJ.js} +1 -1
- package/{chunk-SNPMM7H3.js → chunk-67T7O467.js} +13 -13
- package/{chunk-6YTOJY35.js → chunk-6D2JFXLY.js} +35 -0
- package/{chunk-4MY4GLIW.js → chunk-6IHBIRPK.js} +969 -1090
- package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
- package/{chunk-DHDMC6FO.js → chunk-6TPOEJMQ.js} +9 -4
- package/{chunk-LGCTKGQ3.js → chunk-6UPZ63YT.js} +24 -5
- package/{chunk-WADCY6G6.js → chunk-6ZWMH6TJ.js} +111 -41
- package/{chunk-ABQYVJBJ.js → chunk-7CHC4W22.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
- package/{chunk-4OZYL5FG.js → chunk-7VJHIB2S.js} +573 -476
- package/{chunk-OA6Q2A4I.js → chunk-A7RSPKU6.js} +98 -22
- package/{chunk-KQ4ONNQD.js → chunk-ALFH24P3.js} +56 -7
- package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
- package/{chunk-GPCZ7UXG.js → chunk-AZRHIN5B.js} +1 -1
- package/{chunk-JRQFUXY7.js → chunk-B2XUQXQX.js} +96 -19
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-3IIEFNGY.js → chunk-C53ZG23R.js} +2 -2
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-3ZFOWBZF.js → chunk-CJXHT3S7.js} +13 -13
- package/{chunk-HJUYAD4A.js → chunk-CPUFH46E.js} +8 -8
- package/{chunk-2POGRYTM.js → chunk-CQMQXVFQ.js} +860 -142
- package/{chunk-LS2ZANRJ.js → chunk-CTUQJVQM.js} +1 -1
- package/{chunk-BP4XNZRM.js → chunk-CU3QB4HW.js} +3 -3
- package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
- package/{chunk-SQZDZXP5.js → chunk-DA54MHPJ.js} +236 -36
- package/{chunk-VLTIYV3X.js → chunk-DCLMZ5TX.js} +4 -4
- package/{chunk-UKZDAFYT.js → chunk-DSSTTEKI.js} +6 -10
- package/{chunk-HVURBGF3.js → chunk-ESRMFY7G.js} +2 -2
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-CJCJF5XB.js → chunk-H6A6X4EK.js} +36 -3
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-H3PIH2EO.js → chunk-HWRQVJGX.js} +7 -7
- package/{chunk-H62HCIUP.js → chunk-HYZIYH2H.js} +11 -10
- package/{chunk-NTW5GWDM.js → chunk-I3QNET24.js} +32 -17
- package/{chunk-WV42OMV7.js → chunk-IAESIMK7.js} +4 -4
- package/{chunk-QIAVMDHY.js → chunk-IUVCUGQR.js} +4 -4
- package/{chunk-GFD4ALW3.js → chunk-IX27RP45.js} +1 -1
- package/{chunk-IIVGDG4I.js → chunk-LNPYTNMG.js} +8 -4
- package/{chunk-BLJWCTRL.js → chunk-LVITW736.js} +1 -1
- package/{chunk-76WEAXJB.js → chunk-M3LRSBOX.js} +18 -15
- package/{chunk-LIIKM7DD.js → chunk-M73PVOVS.js} +23 -76
- package/{chunk-7S4YWN7P.js → chunk-MX574M24.js} +1 -1
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/{chunk-53HEEOTT.js → chunk-O26PCYLS.js} +80 -13
- package/{chunk-3DII57IT.js → chunk-O2OWEFII.js} +1 -1
- package/chunk-OCZKATRC.js +129 -0
- package/chunk-P6GMCCAT.js +870 -0
- package/{chunk-CPH3W5A7.js → chunk-Q4GP72HX.js} +94 -3
- package/{chunk-Z77CRGTW.js → chunk-R4SQ3LGW.js} +1 -1
- package/chunk-RE3CDVRX.js +7600 -0
- package/{chunk-DEUUPHOO.js → chunk-RKGKDQGJ.js} +74 -17
- package/{chunk-V4MJDUSR.js → chunk-RSEEDUMS.js} +2 -2
- package/{chunk-D2P6UDPQ.js → chunk-S3VFZW75.js} +66 -38
- package/{chunk-UZGQNTVW.js → chunk-S5XGT6GB.js} +5 -3
- package/{chunk-AFUORTY4.js → chunk-SONWNI3L.js} +21 -21
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-OF7AQZUG.js → chunk-TU5NE4U3.js} +9 -84
- package/chunk-UNYJU5L6.js +780 -0
- package/{chunk-J4MOO56S.js → chunk-UQNS32WZ.js} +10 -2
- package/chunk-V2SAIXHE.js +13349 -0
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-6D6VBVEW.js → chunk-VPFEPRME.js} +9 -9
- package/{chunk-JAXOVNM4.js → chunk-WILHZY7K.js} +45 -45
- package/{chunk-UKWGR5SS.js → chunk-WIWM4FE3.js} +187 -398
- package/{chunk-NKRYKK7T.js → chunk-XTDH3PGV.js} +6 -7
- package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
- package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
- package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
- package/{chunk-TOP2VXOR.js → chunk-Z4CSIXYP.js} +2 -2
- package/{chunk-2F7RJC6L.js → chunk-ZOVKKMF6.js} +1 -1
- package/chunk-ZRAU6T47.js +56 -0
- package/commandRegistry-NPS6IYBO.js +833 -0
- package/{contentThunks-2USKJBI4.js → contentThunks-EB4JFL4K.js} +32 -30
- package/{cooldownCommands-BSCH2W7P.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-NTLU42X2.js → createAgentAutomationAction-NZS7N4AW.js} +32 -30
- package/{createDialogAction-UCYF4BUN.js → createDialogAction-4Q4J7P4T.js} +36 -33
- package/{createPageAction-QFGUGZ5M.js → createPageAction-FPKRGV7D.js} +38 -36
- package/{chunk-4LNCCQOB.js → cursorProvider-YGGNMVWX.js} +2560 -9879
- package/{dbSlice-XVWBAGYN.js → dbSlice-DQ32LYTJ.js} +8 -8
- package/{deleteFile-YG6QMJLU.js → deleteFile-NX6QHCWZ.js} +3 -3
- package/{dialogCommands-IIBAS4I2.js → dialogCommands-XXZH5K6U.js} +45 -41
- package/{dialogSlice-HQFQIQDZ.js → dialogSlice-DXEZ3PA3.js} +36 -29
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-RJBSWEY4.js → docCreateCommands-FLNUDWG6.js} +44 -40
- package/{docDeleteCommands-QSDETKEQ.js → docDeleteCommands-74OURFAB.js} +44 -40
- package/{docReadCommands-AJG2EFHB.js → docReadCommands-QENWDQVH.js} +43 -39
- package/{docStore-GVWEDN5E.js → docStore-2JTPJVFK.js} +11 -10
- package/{docUpdateCommands-KWG533GS.js → docUpdateCommands-J4HWJ5JO.js} +44 -40
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-67MEFPZR.js} +2 -2
- package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +3 -3
- package/{handleSendMessageAction-TLB2SAU4.js → handleSendMessageAction-FGPHI364.js} +91 -83
- package/index.js +87 -884
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-EBRS242U.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-5W6IJRAD.js} +6 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-3LRMNLCM.js} +1 -1
- package/{machineCommands-QZDDCLIW.js → machineCommands-26AZP4AS.js} +84 -77
- package/{machineWsRunDispatch-NYMX3H4L.js → machineWsRunDispatch-GQ5XJ2DL.js} +81 -74
- package/{memberThunks-QGFLFVCI.js → memberThunks-5ZXPR63F.js} +9 -9
- package/{models-T3SG6MJ5.js → models-ZPU5EDF4.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-DD6NGWW6.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-XDRLMYGJ.js} +7 -7
- package/{read-COE3ZYR6.js → read-EPTJRAEF.js} +5 -5
- package/{readDocTool-5USN4A6V.js → readDocTool-W4NDXNEX.js} +5 -3
- package/{readlineWorkspace-VETAJAPP.js → readlineWorkspace-B7NBQCX6.js} +2448 -2022
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-BVAWQKXE.js} +17 -19
- package/{runAgentClientLoop-26DG6ZEY.js → runAgentClientLoop-RVB5K6R2.js} +61 -58
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-3USD722U.js} +3 -3
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-LYY45IAD.js} +12 -11
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-73IL7DLU.js} +18 -20
- package/{settingSlice-ZQZVUPKK.js → settingSlice-Q6EKL7EQ.js} +9 -9
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{spaceCommands-WIJTLELT.js → spaceCommands-BYDGOMW7.js} +44 -40
- package/{streamAgentChatTurn-BY7IPY5C.js → streamAgentChatTurn-HV3FSRHN.js} +183 -91
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-UUXDSQ6X.js} +15 -17
- package/{tableCommands-O6NWHFKV.js → tableCommands-G7RV3RU3.js} +4 -4
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-INIQCPGY.js} +3 -3
- package/{tools-4Y2EYH5D.js → tools-AZR26MXC.js} +54 -51
- package/{tuiSummaryLlmCaller-T2SHYMDZ.js → tuiSummaryLlmCaller-74NRRLVW.js} +18 -16
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-2S4DCP35.js → updateDialogTitleAction-HEWCCXZZ.js} +81 -43
- package/agentRecordCommands-YQQKDLIA.js +0 -128
- package/chunk-LBEDNSMY.js +0 -18881
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
- 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-5B7XS6UO.js";
|
|
8
|
+
import {
|
|
9
|
+
fetchWithTransientRetry
|
|
10
|
+
} from "./chunk-5UTFL4QJ.js";
|
|
7
11
|
import {
|
|
8
12
|
CORE_DRAIN_REASON,
|
|
9
13
|
DRAIN_EXHAUSTED_USER_MESSAGE,
|
|
@@ -11,6 +15,13 @@ import {
|
|
|
11
15
|
normalizeNonNegativeMs,
|
|
12
16
|
parseRetryAfterHeaderMs
|
|
13
17
|
} from "./chunk-3L2WKC3W.js";
|
|
18
|
+
import {
|
|
19
|
+
getUserDataItemTimestamp,
|
|
20
|
+
mergeAndDedupUserData
|
|
21
|
+
} from "./chunk-KQHGZWSV.js";
|
|
22
|
+
import {
|
|
23
|
+
waitForAbortableDelay
|
|
24
|
+
} from "./chunk-N4G4PKQ6.js";
|
|
14
25
|
import {
|
|
15
26
|
TASK_PREVIEW_MAX,
|
|
16
27
|
buildDelegatedTaskContent,
|
|
@@ -21,26 +32,10 @@ import {
|
|
|
21
32
|
formatStatusRunCard,
|
|
22
33
|
formatStopRunCard,
|
|
23
34
|
resolveRunLabel
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import {
|
|
26
|
-
omitNullishAgentSummaryFields,
|
|
27
|
-
sortSafeAgentSummaries,
|
|
28
|
-
summarizeCredentialGroups,
|
|
29
|
-
toCompactAgentSummary,
|
|
30
|
-
toSafeAgentSummary,
|
|
31
|
-
toUnavailableAgentSummary
|
|
32
|
-
} from "./chunk-IAO6JBYW.js";
|
|
35
|
+
} from "./chunk-I3QNET24.js";
|
|
33
36
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from "./chunk-KQHGZWSV.js";
|
|
37
|
-
import {
|
|
38
|
-
readDocFunc,
|
|
39
|
-
readDocFunctionSchema,
|
|
40
|
-
readPageFunc,
|
|
41
|
-
readPageFunctionSchema,
|
|
42
|
-
slateToSimplifiedMarkdown
|
|
43
|
-
} from "./chunk-J4MOO56S.js";
|
|
37
|
+
createDialogAction
|
|
38
|
+
} from "./chunk-5T2W2ZZN.js";
|
|
44
39
|
import {
|
|
45
40
|
addMemberSpace,
|
|
46
41
|
fetchAuthoritativeRemoteSpace,
|
|
@@ -52,27 +47,10 @@ import {
|
|
|
52
47
|
setMembershipRejected,
|
|
53
48
|
setSpaceInitialized,
|
|
54
49
|
updateMemberSpaceName
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import {
|
|
57
|
-
ToolApiError,
|
|
58
|
-
buildToolRequestHeaders,
|
|
59
|
-
callToolApi,
|
|
60
|
-
getRequestConfig,
|
|
61
|
-
getToolBaseUrl,
|
|
62
|
-
getToolRequestContext
|
|
63
|
-
} from "./chunk-VLTIYV3X.js";
|
|
64
|
-
import {
|
|
65
|
-
setDialogExtraReferencesAction
|
|
66
|
-
} from "./chunk-UKZDAFYT.js";
|
|
67
|
-
import {
|
|
68
|
-
waitForAbortableDelay
|
|
69
|
-
} from "./chunk-N4G4PKQ6.js";
|
|
50
|
+
} from "./chunk-CPUFH46E.js";
|
|
70
51
|
import {
|
|
71
52
|
markdownToSlate
|
|
72
|
-
} from "./chunk-
|
|
73
|
-
import {
|
|
74
|
-
extractMentionsFromSlate
|
|
75
|
-
} from "./chunk-MEYIRKDN.js";
|
|
53
|
+
} from "./chunk-NUHHBEJC.js";
|
|
76
54
|
import {
|
|
77
55
|
slateToRenderMarkdown
|
|
78
56
|
} from "./chunk-63W5N6P3.js";
|
|
@@ -81,10 +59,28 @@ import {
|
|
|
81
59
|
} from "./chunk-VF4K2QE6.js";
|
|
82
60
|
import {
|
|
83
61
|
createDocState
|
|
84
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-XTDH3PGV.js";
|
|
85
63
|
import {
|
|
86
|
-
|
|
87
|
-
} from "./chunk-
|
|
64
|
+
setDialogExtraReferencesAction
|
|
65
|
+
} from "./chunk-DSSTTEKI.js";
|
|
66
|
+
import {
|
|
67
|
+
ToolApiError,
|
|
68
|
+
buildToolRequestHeaders,
|
|
69
|
+
callToolApi,
|
|
70
|
+
getRequestConfig,
|
|
71
|
+
getToolBaseUrl,
|
|
72
|
+
getToolRequestContext
|
|
73
|
+
} from "./chunk-DCLMZ5TX.js";
|
|
74
|
+
import {
|
|
75
|
+
readDocFunc,
|
|
76
|
+
readDocFunctionSchema,
|
|
77
|
+
readPageFunc,
|
|
78
|
+
readPageFunctionSchema,
|
|
79
|
+
resolvePageReadMarkdown
|
|
80
|
+
} from "./chunk-UQNS32WZ.js";
|
|
81
|
+
import {
|
|
82
|
+
extractMentionsFromSlate
|
|
83
|
+
} from "./chunk-MEYIRKDN.js";
|
|
88
84
|
import {
|
|
89
85
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
90
86
|
addContentToSpace,
|
|
@@ -102,7 +98,7 @@ import {
|
|
|
102
98
|
updateContentCategory,
|
|
103
99
|
updateContentTitle,
|
|
104
100
|
writeStoredCollapsedCategories
|
|
105
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-DA54MHPJ.js";
|
|
106
102
|
import {
|
|
107
103
|
getCurrentSpaceId,
|
|
108
104
|
getCurrentSpaceIdRaw,
|
|
@@ -115,40 +111,43 @@ import {
|
|
|
115
111
|
} from "./chunk-ZJ7UHBJS.js";
|
|
116
112
|
import {
|
|
117
113
|
deleteDialog,
|
|
118
|
-
i18n_default,
|
|
119
114
|
normalizeAppRouteId,
|
|
120
115
|
resolveDialogRuntimeAgentKey,
|
|
116
|
+
runtime_default,
|
|
121
117
|
selectAllMsgs,
|
|
122
118
|
selectCurrentDialogConfig,
|
|
123
119
|
selectCurrentDialogId,
|
|
124
120
|
selectMsgById,
|
|
125
121
|
uiAskChoiceFunc,
|
|
126
122
|
uiAskChoiceFunctionSchema
|
|
127
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-V2SAIXHE.js";
|
|
128
124
|
import {
|
|
129
125
|
createAgent,
|
|
130
126
|
deleteServerSyncedCredential,
|
|
131
127
|
runLlm,
|
|
132
128
|
streamAgentChatTurn,
|
|
133
129
|
updateAgent
|
|
134
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-HWRQVJGX.js";
|
|
135
131
|
import {
|
|
136
132
|
getActiveDialogKey,
|
|
137
133
|
selectCurrentDialogKey,
|
|
138
134
|
selectPendingRawDataByPageKey
|
|
139
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-6D2JFXLY.js";
|
|
140
136
|
import {
|
|
141
137
|
require_react
|
|
142
138
|
} from "./chunk-YDH3FDFQ.js";
|
|
139
|
+
import {
|
|
140
|
+
shareResourceAction
|
|
141
|
+
} from "./chunk-CU3QB4HW.js";
|
|
143
142
|
import {
|
|
144
143
|
listBuiltinSkills,
|
|
145
144
|
resolveBuiltinCapability,
|
|
146
145
|
resolveBuiltinSkillByName,
|
|
147
146
|
resolveBuiltinSkillEntry
|
|
148
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-B2XUQXQX.js";
|
|
149
148
|
import {
|
|
150
149
|
CAPABILITY_PACKS
|
|
151
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-6TPOEJMQ.js";
|
|
152
151
|
import {
|
|
153
152
|
buildSkillDocMarkdown,
|
|
154
153
|
normalizeSkillModalities,
|
|
@@ -156,7 +155,7 @@ import {
|
|
|
156
155
|
parseExternalSkillMarkdown,
|
|
157
156
|
parseSkillDocProtocol,
|
|
158
157
|
resolvePageSkillMetadata
|
|
159
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-AUDNYVRC.js";
|
|
160
159
|
import {
|
|
161
160
|
DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
|
|
162
161
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
@@ -173,62 +172,69 @@ import {
|
|
|
173
172
|
redactAgentRecordForWorkspaceTool,
|
|
174
173
|
resolveNoloDialogInput,
|
|
175
174
|
verifyNoloDialogSubjectRefQuery
|
|
176
|
-
} from "./chunk-
|
|
177
|
-
import {
|
|
178
|
-
isAgentUnavailableNow
|
|
179
|
-
} from "./chunk-CJCJF5XB.js";
|
|
175
|
+
} from "./chunk-LNPYTNMG.js";
|
|
180
176
|
import {
|
|
181
177
|
buildDatabaseFileContentUrl
|
|
182
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-6ZWMH6TJ.js";
|
|
179
|
+
import {
|
|
180
|
+
clipCompactText
|
|
181
|
+
} from "./chunk-5MMAK75Q.js";
|
|
183
182
|
import {
|
|
184
|
-
|
|
185
|
-
} from "./chunk-
|
|
183
|
+
createFileCredentialBroker
|
|
184
|
+
} from "./chunk-ESRMFY7G.js";
|
|
186
185
|
import {
|
|
187
186
|
compactWhitespace
|
|
188
187
|
} from "./chunk-DWLEOOGR.js";
|
|
189
|
-
import {
|
|
190
|
-
createFileCredentialBroker
|
|
191
|
-
} from "./chunk-HVURBGF3.js";
|
|
192
188
|
import {
|
|
193
189
|
toErrorMessage
|
|
194
190
|
} from "./chunk-HNMXYYJR.js";
|
|
191
|
+
import {
|
|
192
|
+
DEFAULT_MODEL,
|
|
193
|
+
clampReasoningEffort,
|
|
194
|
+
resolveModelReasoningCapabilityWithCache
|
|
195
|
+
} from "./chunk-3BXNTXYI.js";
|
|
196
|
+
import {
|
|
197
|
+
UNCATEGORIZED_ID,
|
|
198
|
+
addContentAction,
|
|
199
|
+
checkSpaceMembership
|
|
200
|
+
} from "./chunk-RSEEDUMS.js";
|
|
201
|
+
import {
|
|
202
|
+
createSpaceKey,
|
|
203
|
+
normalizeSpaceId
|
|
204
|
+
} from "./chunk-UAD2WT54.js";
|
|
195
205
|
import {
|
|
196
206
|
canonicalizeToolName,
|
|
197
207
|
canonicalizeToolNames
|
|
198
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-XUWRURDF.js";
|
|
199
209
|
import {
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
211
|
+
chromeConnectorToolSchemas,
|
|
212
|
+
chromeConnectorUnavailableFunc,
|
|
213
|
+
getChromeConnectorToolBehavior,
|
|
214
|
+
getChromeConnectorToolDefaultConsent
|
|
215
|
+
} from "./chunk-5J3PYNUP.js";
|
|
202
216
|
import {
|
|
203
217
|
AGENT_UPDATE_FIELD_NAMES,
|
|
204
218
|
normalizeAgentUpdateFieldList,
|
|
205
219
|
selectAutoApproveSelfUpdateFields,
|
|
206
220
|
selectCurrentServer,
|
|
207
221
|
selectSyncServers
|
|
208
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-SONWNI3L.js";
|
|
209
223
|
import {
|
|
210
224
|
asRecordOrEmpty
|
|
211
225
|
} from "./chunk-KX6YBIHG.js";
|
|
212
|
-
import {
|
|
213
|
-
UNCATEGORIZED_ID,
|
|
214
|
-
addContentAction,
|
|
215
|
-
checkSpaceMembership
|
|
216
|
-
} from "./chunk-V4MJDUSR.js";
|
|
217
|
-
import {
|
|
218
|
-
createSpaceKey,
|
|
219
|
-
normalizeSpaceId
|
|
220
|
-
} from "./chunk-UAD2WT54.js";
|
|
221
226
|
import {
|
|
222
227
|
patch,
|
|
223
228
|
read,
|
|
224
229
|
readAndWait,
|
|
225
230
|
readAndWaitAction,
|
|
231
|
+
readFileContentAction,
|
|
226
232
|
remove,
|
|
227
233
|
selectById,
|
|
228
234
|
selectEntities,
|
|
229
235
|
toTimestampMs,
|
|
230
236
|
write
|
|
231
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-HYZIYH2H.js";
|
|
232
238
|
import {
|
|
233
239
|
SEPARATOR,
|
|
234
240
|
TYPE_STORAGE_PREFIXES,
|
|
@@ -249,7 +255,7 @@ import {
|
|
|
249
255
|
splitKey,
|
|
250
256
|
toTrimmedString,
|
|
251
257
|
ulid
|
|
252
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-3AH7LNUB.js";
|
|
253
259
|
import {
|
|
254
260
|
asOptionalFiniteNumber
|
|
255
261
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -258,10 +264,7 @@ import {
|
|
|
258
264
|
} from "./chunk-QSJ3HFEF.js";
|
|
259
265
|
import {
|
|
260
266
|
readAction
|
|
261
|
-
} from "./chunk-
|
|
262
|
-
import {
|
|
263
|
-
extractCustomId
|
|
264
|
-
} from "./chunk-M2EJHDJP.js";
|
|
267
|
+
} from "./chunk-IAESIMK7.js";
|
|
265
268
|
import {
|
|
266
269
|
DEVICE_LOCAL_OWNER_ID,
|
|
267
270
|
createAsyncThunk,
|
|
@@ -273,7 +276,7 @@ import {
|
|
|
273
276
|
resolveEffectiveSpaceActorId,
|
|
274
277
|
resolveRecordOwnerUserId,
|
|
275
278
|
selectRuntimeSnapshot
|
|
276
|
-
} from "./chunk-
|
|
279
|
+
} from "./chunk-WIWM4FE3.js";
|
|
277
280
|
import {
|
|
278
281
|
isAbortError
|
|
279
282
|
} from "./chunk-QOKAKDPE.js";
|
|
@@ -289,6 +292,9 @@ import {
|
|
|
289
292
|
import {
|
|
290
293
|
isRecord
|
|
291
294
|
} from "./chunk-KUG52IAP.js";
|
|
295
|
+
import {
|
|
296
|
+
extractCustomId
|
|
297
|
+
} from "./chunk-M2EJHDJP.js";
|
|
292
298
|
import {
|
|
293
299
|
asTrimmedString
|
|
294
300
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -308,6 +314,69 @@ import {
|
|
|
308
314
|
__toESM
|
|
309
315
|
} from "./chunk-4VNS5WPM.js";
|
|
310
316
|
|
|
317
|
+
// packages/ai/tools/agentAutomationSchemas.ts
|
|
318
|
+
var agentAutomationTriggerSchema = {
|
|
319
|
+
oneOf: [
|
|
320
|
+
{
|
|
321
|
+
type: "object",
|
|
322
|
+
description: "Cron trigger.",
|
|
323
|
+
properties: {
|
|
324
|
+
type: { type: "string", enum: ["cron"] },
|
|
325
|
+
expression: {
|
|
326
|
+
type: "string",
|
|
327
|
+
description: "Cron expression, e.g. 0 9 * * *."
|
|
328
|
+
},
|
|
329
|
+
timezone: {
|
|
330
|
+
type: "string",
|
|
331
|
+
description: "Optional timezone, e.g. Asia/Shanghai."
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
required: ["type", "expression"],
|
|
335
|
+
additionalProperties: false
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
type: "object",
|
|
339
|
+
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.",
|
|
340
|
+
properties: {
|
|
341
|
+
type: { type: "string", enum: ["email"] },
|
|
342
|
+
acceptAll: {
|
|
343
|
+
type: "boolean",
|
|
344
|
+
description: "When true the automation fires on every inbound email for the bound agent mailbox \u2014 no content filtering."
|
|
345
|
+
},
|
|
346
|
+
fromContains: {
|
|
347
|
+
type: "string",
|
|
348
|
+
description: "Case-insensitive substring match against sender email address."
|
|
349
|
+
},
|
|
350
|
+
subjectContains: {
|
|
351
|
+
type: "string",
|
|
352
|
+
description: "Case-insensitive substring match against email subject."
|
|
353
|
+
},
|
|
354
|
+
fromContainsAny: {
|
|
355
|
+
type: "array",
|
|
356
|
+
description: "OR'd substring match against sender email \u2014 matches if ANY listed needle appears in the From header.",
|
|
357
|
+
items: { type: "string" },
|
|
358
|
+
minItems: 1
|
|
359
|
+
},
|
|
360
|
+
subjectContainsAny: {
|
|
361
|
+
type: "array",
|
|
362
|
+
description: "OR'd substring match against email subject \u2014 matches if ANY listed needle appears in the Subject.",
|
|
363
|
+
items: { type: "string" },
|
|
364
|
+
minItems: 1
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
required: ["type"],
|
|
368
|
+
anyOf: [
|
|
369
|
+
{ required: ["acceptAll"] },
|
|
370
|
+
{ required: ["fromContains"] },
|
|
371
|
+
{ required: ["subjectContains"] },
|
|
372
|
+
{ required: ["fromContainsAny"] },
|
|
373
|
+
{ required: ["subjectContainsAny"] }
|
|
374
|
+
],
|
|
375
|
+
additionalProperties: false
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
};
|
|
379
|
+
|
|
311
380
|
// packages/ai/tools/modelUsageTools.ts
|
|
312
381
|
var queryModelUsageFunctionSchema = {
|
|
313
382
|
name: "queryModelUsage",
|
|
@@ -432,7 +501,7 @@ var queryUserGrowthReportFunctionSchema = {
|
|
|
432
501
|
};
|
|
433
502
|
var createAgentAutomationFunctionSchema = {
|
|
434
503
|
name: "createAgentAutomation",
|
|
435
|
-
description: "\u521B\u5EFA\
|
|
504
|
+
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
505
|
parameters: {
|
|
437
506
|
type: "object",
|
|
438
507
|
properties: {
|
|
@@ -442,29 +511,9 @@ var createAgentAutomationFunctionSchema = {
|
|
|
442
511
|
},
|
|
443
512
|
instruction: {
|
|
444
513
|
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
|
|
514
|
+
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
515
|
},
|
|
516
|
+
trigger: agentAutomationTriggerSchema,
|
|
468
517
|
ownerAgentKey: {
|
|
469
518
|
type: "string",
|
|
470
519
|
description: "\u6267\u884C\u8BE5 automation \u7684 agentKey\u3002\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D agent\u3002"
|
|
@@ -489,13 +538,64 @@ var createAgentAutomationFunctionSchema = {
|
|
|
489
538
|
},
|
|
490
539
|
runOnceNow: {
|
|
491
540
|
type: "boolean",
|
|
492
|
-
description: "\u521B\u5EFA\u540E\
|
|
541
|
+
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
542
|
default: false
|
|
494
543
|
}
|
|
495
544
|
},
|
|
496
545
|
required: ["instruction", "trigger"]
|
|
497
546
|
}
|
|
498
547
|
};
|
|
548
|
+
var updateAgentAutomationFunctionSchema = {
|
|
549
|
+
name: "updateAgentAutomation",
|
|
550
|
+
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",
|
|
551
|
+
parameters: {
|
|
552
|
+
type: "object",
|
|
553
|
+
properties: {
|
|
554
|
+
automationKey: {
|
|
555
|
+
type: "string",
|
|
556
|
+
description: "automation \u7684 dbKey\uFF08agent-automation-{userId}-{id}\uFF09\u3002"
|
|
557
|
+
},
|
|
558
|
+
title: { type: "string", description: "\u65B0\u6807\u9898\u3002" },
|
|
559
|
+
instruction: { type: "string", description: "\u65B0 instruction\u3002" },
|
|
560
|
+
status: {
|
|
561
|
+
type: "string",
|
|
562
|
+
enum: ["active", "paused"],
|
|
563
|
+
description: "automation \u72B6\u6001\u3002paused \u65F6 dispatcher \u4E0D\u518D\u89E6\u53D1 run\u3002"
|
|
564
|
+
},
|
|
565
|
+
trigger: agentAutomationTriggerSchema,
|
|
566
|
+
spaceId: { type: "string", description: "\u65B0\u7684 spaceId\uFF1B\u4F20\u7A7A\u5B57\u7B26\u4E32\u6E05\u9664\u3002" },
|
|
567
|
+
subjectRefs: {
|
|
568
|
+
type: "array",
|
|
569
|
+
description: "\u65B0\u7684 subjectRefs\uFF1B\u4F20\u7A7A\u6570\u7EC4\u6E05\u9664\u3002",
|
|
570
|
+
items: {
|
|
571
|
+
type: "object",
|
|
572
|
+
properties: {
|
|
573
|
+
kind: { type: "string" },
|
|
574
|
+
id: { type: "string" },
|
|
575
|
+
role: { type: "string" }
|
|
576
|
+
},
|
|
577
|
+
required: ["kind", "id"],
|
|
578
|
+
additionalProperties: true
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
required: ["automationKey"]
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
var deleteAgentAutomationFunctionSchema = {
|
|
586
|
+
name: "deleteAgentAutomation",
|
|
587
|
+
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",
|
|
588
|
+
parameters: {
|
|
589
|
+
type: "object",
|
|
590
|
+
properties: {
|
|
591
|
+
automationKey: {
|
|
592
|
+
type: "string",
|
|
593
|
+
description: "automation \u7684 dbKey\uFF08agent-automation-{userId}-{id}\uFF09\u3002"
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
required: ["automationKey"]
|
|
597
|
+
}
|
|
598
|
+
};
|
|
499
599
|
var notifyUserFunctionSchema = {
|
|
500
600
|
name: "notifyUser",
|
|
501
601
|
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 +637,8 @@ var serverOnlyResult = (toolName) => ({
|
|
|
537
637
|
var queryModelUsageFunc = async () => serverOnlyResult("queryModelUsage");
|
|
538
638
|
var queryUserGrowthReportFunc = async () => serverOnlyResult("queryUserGrowthReport");
|
|
539
639
|
var createAgentAutomationFunc = async () => serverOnlyResult("createAgentAutomation");
|
|
640
|
+
var updateAgentAutomationFunc = async () => serverOnlyResult("updateAgentAutomation");
|
|
641
|
+
var deleteAgentAutomationFunc = async () => serverOnlyResult("deleteAgentAutomation");
|
|
540
642
|
var notifyUserFunc = async () => serverOnlyResult("notifyUser");
|
|
541
643
|
|
|
542
644
|
// packages/ai/tools/toolResultError.ts
|
|
@@ -710,6 +812,22 @@ var buildPatch = (args) => {
|
|
|
710
812
|
if (reasoning_effort !== void 0) patch2.reasoning_effort = reasoning_effort;
|
|
711
813
|
return patch2;
|
|
712
814
|
};
|
|
815
|
+
var calibrateReasoningEffortInPatch = (patch2, previousAgent) => {
|
|
816
|
+
if (patch2.reasoning_effort === void 0) return void 0;
|
|
817
|
+
const provider = patch2.provider ?? previousAgent.provider ?? void 0;
|
|
818
|
+
const model = patch2.model ?? previousAgent.model ?? void 0;
|
|
819
|
+
const cap = resolveModelReasoningCapabilityWithCache(provider, model);
|
|
820
|
+
if (!cap.found) return void 0;
|
|
821
|
+
const requested = String(patch2.reasoning_effort);
|
|
822
|
+
const calibrated = clampReasoningEffort(requested, provider ?? null, model ?? null);
|
|
823
|
+
if (!calibrated) {
|
|
824
|
+
delete patch2.reasoning_effort;
|
|
825
|
+
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`;
|
|
826
|
+
}
|
|
827
|
+
patch2.reasoning_effort = calibrated;
|
|
828
|
+
if (calibrated === requested) return void 0;
|
|
829
|
+
return `\u2139\uFE0F reasoning_effort \u5DF2\u6309 ${model ?? "\u5F53\u524D\u6A21\u578B"} \u7684\u771F\u5B9E\u6863\u4F4D\u4ECE "${requested}" \u5438\u9644\u4E3A "${calibrated}"\u3002`;
|
|
830
|
+
};
|
|
713
831
|
var AGENT_UPDATE_FIELD_NAME_SET = new Set(AGENT_UPDATE_FIELD_NAMES);
|
|
714
832
|
var listRequestedFields = (args) => Object.keys(args).filter(
|
|
715
833
|
(key) => key !== "agentId" && key !== "__confirmedSelfEvolution" && AGENT_UPDATE_FIELD_NAME_SET.has(key) && args[key] !== void 0
|
|
@@ -911,7 +1029,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
|
|
|
911
1029
|
workspace: { mode: "lease" }
|
|
912
1030
|
};
|
|
913
1031
|
var findModelConfig = async (modelName, provider) => {
|
|
914
|
-
const { ALL_MODELS } = await import("./models-
|
|
1032
|
+
const { ALL_MODELS } = await import("./models-ZPU5EDF4.js");
|
|
915
1033
|
const name = toTrimmedString(modelName);
|
|
916
1034
|
const prov = toTrimmedString(provider ?? "");
|
|
917
1035
|
if (!name) return null;
|
|
@@ -936,21 +1054,21 @@ var findModelConfig = async (modelName, provider) => {
|
|
|
936
1054
|
};
|
|
937
1055
|
var createAgentToolFunctionSchema = {
|
|
938
1056
|
name: "createAgent",
|
|
939
|
-
description:
|
|
1057
|
+
description: runtime_default.t("tools.createAgent.description"),
|
|
940
1058
|
parameters: {
|
|
941
1059
|
type: "object",
|
|
942
1060
|
properties: {
|
|
943
1061
|
name: {
|
|
944
1062
|
type: "string",
|
|
945
|
-
description:
|
|
1063
|
+
description: runtime_default.t("tools.createAgent.params.name")
|
|
946
1064
|
},
|
|
947
1065
|
model: {
|
|
948
1066
|
type: "string",
|
|
949
|
-
description:
|
|
1067
|
+
description: runtime_default.t("tools.createAgent.params.model")
|
|
950
1068
|
},
|
|
951
1069
|
provider: {
|
|
952
1070
|
type: "string",
|
|
953
|
-
description:
|
|
1071
|
+
description: runtime_default.t("tools.createAgent.params.provider")
|
|
954
1072
|
},
|
|
955
1073
|
apiSource: {
|
|
956
1074
|
type: "string",
|
|
@@ -959,36 +1077,36 @@ var createAgentToolFunctionSchema = {
|
|
|
959
1077
|
},
|
|
960
1078
|
prompt: {
|
|
961
1079
|
type: "string",
|
|
962
|
-
description:
|
|
1080
|
+
description: runtime_default.t("tools.createAgent.params.prompt")
|
|
963
1081
|
},
|
|
964
1082
|
introduction: {
|
|
965
1083
|
type: "string",
|
|
966
|
-
description:
|
|
1084
|
+
description: runtime_default.t("tools.createAgent.params.introduction")
|
|
967
1085
|
},
|
|
968
1086
|
greeting: {
|
|
969
|
-
description:
|
|
1087
|
+
description: runtime_default.t("tools.createAgent.params.greeting.desc"),
|
|
970
1088
|
anyOf: [
|
|
971
1089
|
{
|
|
972
1090
|
type: "string",
|
|
973
|
-
description:
|
|
1091
|
+
description: runtime_default.t(
|
|
974
1092
|
"tools.createAgent.params.greeting.stringDesc"
|
|
975
1093
|
)
|
|
976
1094
|
},
|
|
977
1095
|
{
|
|
978
1096
|
type: "object",
|
|
979
|
-
description:
|
|
1097
|
+
description: runtime_default.t(
|
|
980
1098
|
"tools.createAgent.params.greeting.objectDesc"
|
|
981
1099
|
),
|
|
982
1100
|
properties: {
|
|
983
1101
|
text: {
|
|
984
1102
|
type: "string",
|
|
985
|
-
description:
|
|
1103
|
+
description: runtime_default.t(
|
|
986
1104
|
"tools.createAgent.params.greeting.texts.text"
|
|
987
1105
|
)
|
|
988
1106
|
},
|
|
989
1107
|
menu: {
|
|
990
1108
|
type: "array",
|
|
991
|
-
description:
|
|
1109
|
+
description: runtime_default.t(
|
|
992
1110
|
"tools.createAgent.params.greeting.menu.desc"
|
|
993
1111
|
),
|
|
994
1112
|
items: {
|
|
@@ -996,19 +1114,19 @@ var createAgentToolFunctionSchema = {
|
|
|
996
1114
|
properties: {
|
|
997
1115
|
id: {
|
|
998
1116
|
type: "string",
|
|
999
|
-
description:
|
|
1117
|
+
description: runtime_default.t(
|
|
1000
1118
|
"tools.createAgent.params.greeting.menu.id"
|
|
1001
1119
|
)
|
|
1002
1120
|
},
|
|
1003
1121
|
label: {
|
|
1004
1122
|
type: "string",
|
|
1005
|
-
description:
|
|
1123
|
+
description: runtime_default.t(
|
|
1006
1124
|
"tools.createAgent.params.greeting.menu.label"
|
|
1007
1125
|
)
|
|
1008
1126
|
},
|
|
1009
1127
|
userMessage: {
|
|
1010
1128
|
type: "string",
|
|
1011
|
-
description:
|
|
1129
|
+
description: runtime_default.t(
|
|
1012
1130
|
"tools.createAgent.params.greeting.menu.userMessage"
|
|
1013
1131
|
)
|
|
1014
1132
|
}
|
|
@@ -1022,21 +1140,21 @@ var createAgentToolFunctionSchema = {
|
|
|
1022
1140
|
},
|
|
1023
1141
|
isPublic: {
|
|
1024
1142
|
type: "boolean",
|
|
1025
|
-
description:
|
|
1143
|
+
description: runtime_default.t("tools.createAgent.params.isPublic")
|
|
1026
1144
|
},
|
|
1027
1145
|
allowFork: {
|
|
1028
1146
|
type: "boolean",
|
|
1029
|
-
description:
|
|
1147
|
+
description: runtime_default.t("tools.createAgent.params.allowFork")
|
|
1030
1148
|
},
|
|
1031
1149
|
tags: {
|
|
1032
1150
|
type: "array",
|
|
1033
1151
|
items: { type: "string" },
|
|
1034
|
-
description:
|
|
1152
|
+
description: runtime_default.t("tools.createAgent.params.tags")
|
|
1035
1153
|
},
|
|
1036
1154
|
tools: {
|
|
1037
1155
|
type: "array",
|
|
1038
1156
|
items: { type: "string" },
|
|
1039
|
-
description:
|
|
1157
|
+
description: runtime_default.t("tools.createAgent.params.tools")
|
|
1040
1158
|
},
|
|
1041
1159
|
disabledTools: {
|
|
1042
1160
|
type: "array",
|
|
@@ -1054,26 +1172,26 @@ var createAgentToolFunctionSchema = {
|
|
|
1054
1172
|
},
|
|
1055
1173
|
references: {
|
|
1056
1174
|
type: "array",
|
|
1057
|
-
description:
|
|
1175
|
+
description: runtime_default.t("tools.createAgent.params.references.desc"),
|
|
1058
1176
|
items: {
|
|
1059
1177
|
type: "object",
|
|
1060
1178
|
properties: {
|
|
1061
1179
|
dbKey: {
|
|
1062
1180
|
type: "string",
|
|
1063
|
-
description:
|
|
1181
|
+
description: runtime_default.t(
|
|
1064
1182
|
"tools.createAgent.params.references.dbKey"
|
|
1065
1183
|
)
|
|
1066
1184
|
},
|
|
1067
1185
|
title: {
|
|
1068
1186
|
type: "string",
|
|
1069
|
-
description:
|
|
1187
|
+
description: runtime_default.t(
|
|
1070
1188
|
"tools.createAgent.params.references.title"
|
|
1071
1189
|
)
|
|
1072
1190
|
},
|
|
1073
1191
|
type: {
|
|
1074
1192
|
type: "string",
|
|
1075
1193
|
enum: ["knowledge", "instruction", "page"],
|
|
1076
|
-
description:
|
|
1194
|
+
description: runtime_default.t(
|
|
1077
1195
|
"tools.createAgent.params.references.type"
|
|
1078
1196
|
)
|
|
1079
1197
|
}
|
|
@@ -1084,36 +1202,36 @@ var createAgentToolFunctionSchema = {
|
|
|
1084
1202
|
linkedSpaces: {
|
|
1085
1203
|
type: "array",
|
|
1086
1204
|
items: { type: "string" },
|
|
1087
|
-
description:
|
|
1205
|
+
description: runtime_default.t("tools.createAgent.params.linkedSpaces")
|
|
1088
1206
|
},
|
|
1089
1207
|
temperature: {
|
|
1090
1208
|
type: "number",
|
|
1091
|
-
description:
|
|
1209
|
+
description: runtime_default.t("tools.createAgent.params.temperature")
|
|
1092
1210
|
},
|
|
1093
1211
|
top_p: {
|
|
1094
1212
|
type: "number",
|
|
1095
|
-
description:
|
|
1213
|
+
description: runtime_default.t("tools.createAgent.params.top_p")
|
|
1096
1214
|
},
|
|
1097
1215
|
frequency_penalty: {
|
|
1098
1216
|
type: "number",
|
|
1099
|
-
description:
|
|
1217
|
+
description: runtime_default.t(
|
|
1100
1218
|
"tools.createAgent.params.frequency_penalty"
|
|
1101
1219
|
)
|
|
1102
1220
|
},
|
|
1103
1221
|
presence_penalty: {
|
|
1104
1222
|
type: "number",
|
|
1105
|
-
description:
|
|
1223
|
+
description: runtime_default.t(
|
|
1106
1224
|
"tools.createAgent.params.presence_penalty"
|
|
1107
1225
|
)
|
|
1108
1226
|
},
|
|
1109
1227
|
max_tokens: {
|
|
1110
1228
|
type: "number",
|
|
1111
|
-
description:
|
|
1229
|
+
description: runtime_default.t("tools.createAgent.params.max_tokens")
|
|
1112
1230
|
},
|
|
1113
1231
|
reasoning_effort: {
|
|
1114
1232
|
type: "string",
|
|
1115
1233
|
enum: ["low", "medium", "high"],
|
|
1116
|
-
description:
|
|
1234
|
+
description: runtime_default.t(
|
|
1117
1235
|
"tools.createAgent.params.reasoning_effort"
|
|
1118
1236
|
)
|
|
1119
1237
|
}
|
|
@@ -1156,7 +1274,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
|
|
|
1156
1274
|
const trimmedModel = toTrimmedString(model);
|
|
1157
1275
|
const trimmedProvider = toTrimmedString(provider);
|
|
1158
1276
|
const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
|
|
1159
|
-
const { getModelPricing } = await import("./getPricing-
|
|
1277
|
+
const { getModelPricing } = await import("./getPricing-NMMFT3YI.js");
|
|
1160
1278
|
const normalizedTools = tools ?? [];
|
|
1161
1279
|
const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
|
|
1162
1280
|
const formData = {
|
|
@@ -1292,6 +1410,7 @@ ${availableList}`
|
|
|
1292
1410
|
formData = await buildPlatformFormDataFromArgs(args);
|
|
1293
1411
|
formData.linkedSpaces = resolvedLinkedSpaces;
|
|
1294
1412
|
}
|
|
1413
|
+
const effortNote = calibrateReasoningEffortInPatch(formData, formData);
|
|
1295
1414
|
const expectedProviderConfig = getForkedAgentProviderExpectation(formData);
|
|
1296
1415
|
try {
|
|
1297
1416
|
const agent = await thunkApi.dispatch(
|
|
@@ -1337,6 +1456,9 @@ ${availableList}`
|
|
|
1337
1456
|
if (typeof currentBalance === "number") {
|
|
1338
1457
|
lines.push(`- \u5F53\u524D\u4F59\u989D: ${currentBalance}`);
|
|
1339
1458
|
}
|
|
1459
|
+
if (effortNote) {
|
|
1460
|
+
lines.push(effortNote);
|
|
1461
|
+
}
|
|
1340
1462
|
return {
|
|
1341
1463
|
rawData: agent,
|
|
1342
1464
|
displayData: lines.join("\n")
|
|
@@ -1379,6 +1501,7 @@ async function updateAgentToolFunc(args, thunkApi) {
|
|
|
1379
1501
|
}
|
|
1380
1502
|
const agentId = extractAgentId(dbKey);
|
|
1381
1503
|
const formData = buildPatch(args);
|
|
1504
|
+
const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
|
|
1382
1505
|
const requestedFields = listRequestedFields(args);
|
|
1383
1506
|
assertAgentUpdateConfirmation({
|
|
1384
1507
|
scope: "generic",
|
|
@@ -1401,7 +1524,8 @@ async function updateAgentToolFunc(args, thunkApi) {
|
|
|
1401
1524
|
);
|
|
1402
1525
|
return {
|
|
1403
1526
|
rawData: rawDataWithUpdateInfo,
|
|
1404
|
-
displayData: formatUpdatedAgentOutput(agent)
|
|
1527
|
+
displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
|
|
1528
|
+
${effortNote}` : "")
|
|
1405
1529
|
};
|
|
1406
1530
|
}
|
|
1407
1531
|
|
|
@@ -3259,7 +3383,7 @@ async function readFunc(args, thunkApi, context) {
|
|
|
3259
3383
|
}
|
|
3260
3384
|
if (dbKey.startsWith("PAGE-") || result.type === "page" /* DOC */) {
|
|
3261
3385
|
const pageData = result;
|
|
3262
|
-
const markdownContent =
|
|
3386
|
+
const markdownContent = resolvePageReadMarkdown(pageData);
|
|
3263
3387
|
return {
|
|
3264
3388
|
rawData: {
|
|
3265
3389
|
...pageData,
|
|
@@ -3397,92 +3521,6 @@ async function listUserSpacesFunc(args, thunkApi, context) {
|
|
|
3397
3521
|
}
|
|
3398
3522
|
}
|
|
3399
3523
|
|
|
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
3524
|
// packages/ai/agent/publicAgentDiscovery.ts
|
|
3487
3525
|
async function fetchPublicAgentsForDiscovery(args) {
|
|
3488
3526
|
const fetchImpl = args.fetchImpl ?? fetch;
|
|
@@ -3945,7 +3983,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3945
3983
|
const deletedDialogIds = [];
|
|
3946
3984
|
const deletedDialogKeys = [];
|
|
3947
3985
|
const failures = [];
|
|
3948
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3986
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-DXEZ3PA3.js");
|
|
3949
3987
|
for (const target of targets) {
|
|
3950
3988
|
try {
|
|
3951
3989
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -4041,6 +4079,10 @@ var listAgentsFunctionSchema = {
|
|
|
4041
4079
|
},
|
|
4042
4080
|
publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
|
|
4043
4081
|
showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
|
|
4082
|
+
query: {
|
|
4083
|
+
type: "string",
|
|
4084
|
+
description: "Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey. Use to locate specific candidates like 'opus', 'devin', or 'claude'."
|
|
4085
|
+
},
|
|
4044
4086
|
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
4087
|
}
|
|
4046
4088
|
}
|
|
@@ -4083,16 +4125,15 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4083
4125
|
}
|
|
4084
4126
|
}
|
|
4085
4127
|
const userId = runtime?.currentUserId ?? void 0;
|
|
4086
|
-
const
|
|
4087
|
-
(
|
|
4128
|
+
const discovery = assembleAgentDiscoveryResult({
|
|
4129
|
+
records: [...Array.from(recordsMap.values()), ...publicRecords],
|
|
4130
|
+
summaryOptions: (record) => ({
|
|
4088
4131
|
favoritesMap,
|
|
4089
4132
|
userId,
|
|
4090
4133
|
publicRecordExists: publicRecords.includes(record) ? true : void 0
|
|
4091
|
-
})
|
|
4092
|
-
);
|
|
4093
|
-
const discovery = buildAgentDiscoveryResult({
|
|
4094
|
-
agents,
|
|
4134
|
+
}),
|
|
4095
4135
|
scope: args?.scope,
|
|
4136
|
+
query: args?.query,
|
|
4096
4137
|
publicOnly: args?.publicOnly,
|
|
4097
4138
|
showUnavailable: args?.showUnavailable,
|
|
4098
4139
|
verbose: args?.verbose
|
|
@@ -4123,6 +4164,30 @@ var readAgentFunctionSchema = {
|
|
|
4123
4164
|
required: ["agent"]
|
|
4124
4165
|
}
|
|
4125
4166
|
};
|
|
4167
|
+
function formatReadAgentCard(agentKey, record) {
|
|
4168
|
+
if (!isRecord(record)) {
|
|
4169
|
+
return jsonPreview({ agentKey, record });
|
|
4170
|
+
}
|
|
4171
|
+
const name = asTrimmedString(record.name) || "(\u672A\u547D\u540D Agent)";
|
|
4172
|
+
const model = asTrimmedString(record.model) || "\u2014";
|
|
4173
|
+
const provider = asTrimmedString(record.provider) || asTrimmedString(record.apiSource) || "\u2014";
|
|
4174
|
+
const apiSource = asTrimmedString(record.apiSource) || "\u2014";
|
|
4175
|
+
const isPublic = record.isPublic === true ? "\u516C\u5F00" : "\u79C1\u6709";
|
|
4176
|
+
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)";
|
|
4177
|
+
const lines = [
|
|
4178
|
+
`\u{1F916} Agent: ${name} (${agentKey})`,
|
|
4179
|
+
`\u2022 \u6A21\u578B: ${model} (${provider})`,
|
|
4180
|
+
`\u2022 \u6765\u6E90: ${apiSource} \xB7 ${isPublic}`,
|
|
4181
|
+
`\u2022 \u5DE5\u5177: ${tools}`
|
|
4182
|
+
];
|
|
4183
|
+
if (typeof record.customProviderUrl === "string" && record.customProviderUrl.trim()) {
|
|
4184
|
+
lines.push(`\u2022 \u7AEF\u70B9: ${record.customProviderUrl.trim()}`);
|
|
4185
|
+
}
|
|
4186
|
+
if (typeof record.prompt === "string" && record.prompt.trim()) {
|
|
4187
|
+
lines.push(`\u2022 \u63D0\u793A\u8BCD: ${clipCompactText(record.prompt.trim(), 200)}`);
|
|
4188
|
+
}
|
|
4189
|
+
return lines.join("\n");
|
|
4190
|
+
}
|
|
4126
4191
|
async function readAgentFunc(args, thunkApi) {
|
|
4127
4192
|
const runtime = getRuntime2(thunkApi);
|
|
4128
4193
|
const userId = runtime?.currentUserId;
|
|
@@ -4134,16 +4199,14 @@ async function readAgentFunc(args, thunkApi) {
|
|
|
4134
4199
|
for (const candidate of candidates) {
|
|
4135
4200
|
const record = await readBestRecord(thunkApi, candidate, true);
|
|
4136
4201
|
if (record) {
|
|
4202
|
+
const redacted = redactAgentRecordForWorkspaceTool(record);
|
|
4137
4203
|
return {
|
|
4138
4204
|
rawData: {
|
|
4139
4205
|
success: true,
|
|
4140
4206
|
agentKey: candidate,
|
|
4141
|
-
record:
|
|
4207
|
+
record: redacted
|
|
4142
4208
|
},
|
|
4143
|
-
displayData:
|
|
4144
|
-
agentKey: candidate,
|
|
4145
|
-
record: redactAgentRecordForWorkspaceTool(record)
|
|
4146
|
-
})
|
|
4209
|
+
displayData: formatReadAgentCard(candidate, redacted)
|
|
4147
4210
|
};
|
|
4148
4211
|
}
|
|
4149
4212
|
}
|
|
@@ -4254,7 +4317,7 @@ var readSkillDocFunctionSchema = {
|
|
|
4254
4317
|
}
|
|
4255
4318
|
};
|
|
4256
4319
|
async function readSkillDocFunc(args, thunkApi) {
|
|
4257
|
-
const { buildReadDocResult } = await import("./readDocTool-
|
|
4320
|
+
const { buildReadDocResult } = await import("./readDocTool-W4NDXNEX.js");
|
|
4258
4321
|
const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
|
|
4259
4322
|
if (typeof id !== "string" || !id.trim()) {
|
|
4260
4323
|
throw new Error("readSkillDoc requires id or doc.");
|
|
@@ -5057,7 +5120,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
|
|
|
5057
5120
|
const spaceKey = createSpaceKey.space(spaceId);
|
|
5058
5121
|
const readSpace = async (dbKey) => {
|
|
5059
5122
|
try {
|
|
5060
|
-
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-
|
|
5123
|
+
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-DQ32LYTJ.js");
|
|
5061
5124
|
if (fresh) {
|
|
5062
5125
|
return await dispatch(readAndWait2(dbKey)).unwrap();
|
|
5063
5126
|
}
|
|
@@ -5698,6 +5761,23 @@ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
5698
5761
|
var normalizeContains = (value) => asTrimmedLowercaseString(value);
|
|
5699
5762
|
var participantList = (emails) => Array.isArray(emails) ? asTrimmedNonEmptyStringArray(emails).map((email) => ({ email })) : [];
|
|
5700
5763
|
var emailText = (email) => [email?.subject, email?.from?.email, email?.from?.name, email?.text, email?.html].filter((value) => typeof value === "string").join("\n");
|
|
5764
|
+
var emailAttachments = (email) => Array.isArray(email?.attachments) ? email.attachments : [];
|
|
5765
|
+
var attachmentPreview = (attachment) => {
|
|
5766
|
+
const name = asOptionalTrimmedString(attachment?.filename) ?? "attachment";
|
|
5767
|
+
const contentType = asOptionalTrimmedString(attachment?.contentType) ?? "application/octet-stream";
|
|
5768
|
+
const fileId = asOptionalTrimmedString(attachment?.fileId) ?? "unknown-file";
|
|
5769
|
+
const size = Number.isFinite(Number(attachment?.size)) ? ` | ${Number(attachment.size)} bytes` : "";
|
|
5770
|
+
return `- ${name} | ${contentType}${size} | fileId: ${fileId}`;
|
|
5771
|
+
};
|
|
5772
|
+
var attachmentListPreview = (email) => {
|
|
5773
|
+
const attachments = emailAttachments(email);
|
|
5774
|
+
if (attachments.length === 0) return "";
|
|
5775
|
+
return [
|
|
5776
|
+
`\u9644\u4EF6\uFF08${attachments.length}\uFF09\uFF1A`,
|
|
5777
|
+
...attachments.map(attachmentPreview),
|
|
5778
|
+
"\u8BFB\u53D6\u9644\u4EF6\uFF1A\u518D\u6B21\u8C03\u7528 email_read\uFF0C\u4F20\u5165\u5F53\u524D dbKey \u548C attachmentFileId\u3002"
|
|
5779
|
+
].join("\n");
|
|
5780
|
+
};
|
|
5701
5781
|
var matchesWaitFilters = (email, args) => {
|
|
5702
5782
|
const subjectContains = normalizeContains(args.subjectContains);
|
|
5703
5783
|
const fromContains = normalizeContains(args.fromContains);
|
|
@@ -5723,6 +5803,58 @@ var stripHtml = (html) => typeof html === "string" ? compactWhitespace(
|
|
|
5723
5803
|
html.replace(/<a\b[^>]*href=["']([^"']+)["'][^>]*>/gi, " $1 ").replace(/<[^>]+>/g, " ")
|
|
5724
5804
|
) : "";
|
|
5725
5805
|
var cleanUrl = (url) => url.replace(/[),.;\]}>]+$/g, "");
|
|
5806
|
+
var extractPdfText = async (blob) => {
|
|
5807
|
+
const pdfjsLib = await import("./pdf-U6KSUEZZ.js");
|
|
5808
|
+
if (typeof window !== "undefined" && pdfjsLib.GlobalWorkerOptions && !pdfjsLib.GlobalWorkerOptions.workerSrc) {
|
|
5809
|
+
pdfjsLib.GlobalWorkerOptions.workerSrc = "/public/assets/pdf.worker.mjs";
|
|
5810
|
+
}
|
|
5811
|
+
const data = await blob.arrayBuffer();
|
|
5812
|
+
const pdf = await pdfjsLib.getDocument({ data }).promise;
|
|
5813
|
+
const pages = [];
|
|
5814
|
+
for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber += 1) {
|
|
5815
|
+
const page = await pdf.getPage(pageNumber);
|
|
5816
|
+
const textContent = await page.getTextContent();
|
|
5817
|
+
const text = textContent.items.map((item) => typeof item?.str === "string" ? item.str : "").filter(Boolean).join(" ").trim();
|
|
5818
|
+
if (text) pages.push(`--- page ${pageNumber} ---
|
|
5819
|
+
${text}`);
|
|
5820
|
+
}
|
|
5821
|
+
return pages.join("\n\n").trim();
|
|
5822
|
+
};
|
|
5823
|
+
var readEmailAttachment = async (email, fileId, maxChars, thunkApi) => {
|
|
5824
|
+
const attachment = emailAttachments(email).find(
|
|
5825
|
+
(item) => asOptionalTrimmedString(item?.fileId) === fileId
|
|
5826
|
+
);
|
|
5827
|
+
if (!attachment) {
|
|
5828
|
+
throw new Error(`\u9644\u4EF6 ${fileId} \u4E0D\u5C5E\u4E8E\u90AE\u4EF6 ${email?.dbKey || "unknown"}`);
|
|
5829
|
+
}
|
|
5830
|
+
const result = await readFileContentAction({ fileId }, thunkApi);
|
|
5831
|
+
const blob = result.blob;
|
|
5832
|
+
const contentType = (asOptionalTrimmedString(attachment?.contentType) || asOptionalTrimmedString(blob.type) || "application/octet-stream").toLowerCase();
|
|
5833
|
+
const filename = asOptionalTrimmedString(attachment?.filename) ?? fileId;
|
|
5834
|
+
let content;
|
|
5835
|
+
if (contentType === "application/pdf" || filename.toLowerCase().endsWith(".pdf")) {
|
|
5836
|
+
content = await extractPdfText(blob);
|
|
5837
|
+
if (!content) {
|
|
5838
|
+
throw new Error(
|
|
5839
|
+
`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`
|
|
5840
|
+
);
|
|
5841
|
+
}
|
|
5842
|
+
} else if (contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("csv") || contentType.includes("xml") || /\.(txt|md|csv|json|xml|html?|log)$/i.test(filename)) {
|
|
5843
|
+
content = await blob.text();
|
|
5844
|
+
} else {
|
|
5845
|
+
throw new Error(
|
|
5846
|
+
`\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`
|
|
5847
|
+
);
|
|
5848
|
+
}
|
|
5849
|
+
const truncated = content.length > maxChars;
|
|
5850
|
+
return {
|
|
5851
|
+
attachment,
|
|
5852
|
+
content: truncated ? content.slice(0, maxChars) : content,
|
|
5853
|
+
totalChars: content.length,
|
|
5854
|
+
truncated,
|
|
5855
|
+
source: result.source
|
|
5856
|
+
};
|
|
5857
|
+
};
|
|
5726
5858
|
var extractEmailVerificationArtifacts = ({
|
|
5727
5859
|
text,
|
|
5728
5860
|
html
|
|
@@ -5790,13 +5922,25 @@ var emailSearchFunctionSchema = {
|
|
|
5790
5922
|
};
|
|
5791
5923
|
var emailReadFunctionSchema = {
|
|
5792
5924
|
name: "email_read",
|
|
5793
|
-
description:
|
|
5925
|
+
description: [
|
|
5926
|
+
"\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
|
|
5927
|
+
"\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",
|
|
5928
|
+
"PDF \u4F18\u5148\u76F4\u63A5\u63D0\u53D6\u6587\u5B57\u5C42\uFF1B\u626B\u63CF\u7248 PDF \u4F1A\u63D0\u793A\u6539\u7528 OCR\u3002"
|
|
5929
|
+
].join("\n"),
|
|
5794
5930
|
parameters: {
|
|
5795
5931
|
type: "object",
|
|
5796
5932
|
properties: {
|
|
5797
5933
|
dbKey: {
|
|
5798
5934
|
type: "string",
|
|
5799
5935
|
description: "\u90AE\u4EF6\u8BB0\u5F55\u7684 dbKey\uFF0C\u4F8B\u5982 email-userId-emailId\u3002"
|
|
5936
|
+
},
|
|
5937
|
+
attachmentFileId: {
|
|
5938
|
+
type: "string",
|
|
5939
|
+
description: "\u53EF\u9009\u3002\u5F53\u524D\u90AE\u4EF6 attachments[] \u4E2D\u7684 fileId\uFF1B\u63D0\u4F9B\u540E\u8BFB\u53D6\u8BE5\u9644\u4EF6\u6587\u672C\u3002"
|
|
5940
|
+
},
|
|
5941
|
+
maxChars: {
|
|
5942
|
+
type: "number",
|
|
5943
|
+
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
5944
|
}
|
|
5801
5945
|
},
|
|
5802
5946
|
required: ["dbKey"]
|
|
@@ -6075,15 +6219,47 @@ ${artifacts.verificationLinks.slice(1).join("\n")}` : ""
|
|
|
6075
6219
|
};
|
|
6076
6220
|
}
|
|
6077
6221
|
async function emailReadFunc(args, thunkApi) {
|
|
6078
|
-
const email = await callToolApi(thunkApi, "/rpc/getEmail", args, {
|
|
6222
|
+
const email = await callToolApi(thunkApi, "/rpc/getEmail", { dbKey: args.dbKey }, {
|
|
6079
6223
|
withAuth: true
|
|
6080
6224
|
});
|
|
6225
|
+
const attachmentFileId = asOptionalTrimmedString(args.attachmentFileId);
|
|
6226
|
+
if (attachmentFileId) {
|
|
6227
|
+
const maxChars = clampInteger(args.maxChars, 12e3, 1e3, 5e4);
|
|
6228
|
+
const attachmentResult = await readEmailAttachment(
|
|
6229
|
+
email,
|
|
6230
|
+
attachmentFileId,
|
|
6231
|
+
maxChars,
|
|
6232
|
+
thunkApi
|
|
6233
|
+
);
|
|
6234
|
+
const filename = asOptionalTrimmedString(attachmentResult.attachment?.filename) ?? attachmentFileId;
|
|
6235
|
+
return {
|
|
6236
|
+
rawData: {
|
|
6237
|
+
emailDbKey: email?.dbKey,
|
|
6238
|
+
attachment: attachmentResult.attachment,
|
|
6239
|
+
content: attachmentResult.content,
|
|
6240
|
+
totalChars: attachmentResult.totalChars,
|
|
6241
|
+
truncated: attachmentResult.truncated,
|
|
6242
|
+
source: attachmentResult.source
|
|
6243
|
+
},
|
|
6244
|
+
displayData: [
|
|
6245
|
+
`\u9644\u4EF6\uFF1A${filename} | fileId: ${attachmentFileId}`,
|
|
6246
|
+
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}`,
|
|
6247
|
+
"",
|
|
6248
|
+
attachmentResult.content
|
|
6249
|
+
].join("\n")
|
|
6250
|
+
};
|
|
6251
|
+
}
|
|
6081
6252
|
const body = asOptionalTrimmedString(email?.text) ?? asOptionalTrimmedString(email?.html) ?? "";
|
|
6253
|
+
const attachments = attachmentListPreview(email);
|
|
6082
6254
|
return {
|
|
6083
6255
|
rawData: email,
|
|
6084
|
-
displayData:
|
|
6085
|
-
|
|
6086
|
-
|
|
6256
|
+
displayData: [
|
|
6257
|
+
emailPreview(email),
|
|
6258
|
+
"",
|
|
6259
|
+
body.slice(0, 4e3),
|
|
6260
|
+
attachments ? `
|
|
6261
|
+
${attachments}` : ""
|
|
6262
|
+
].filter(Boolean).join("\n")
|
|
6087
6263
|
};
|
|
6088
6264
|
}
|
|
6089
6265
|
async function emailUpdateTagsFunc(args, thunkApi) {
|
|
@@ -9207,214 +9383,6 @@ ${preview}`
|
|
|
9207
9383
|
};
|
|
9208
9384
|
}
|
|
9209
9385
|
|
|
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
9386
|
// packages/ai/tools/exaSearchTool.ts
|
|
9419
9387
|
var exaSearchSchema = {
|
|
9420
9388
|
name: "exa_search",
|
|
@@ -10122,7 +10090,7 @@ var cloudflareCrawlStatusFunctionSchema = {
|
|
|
10122
10090
|
async function cloudflareCrawlStatusFunc(args, thunkApi) {
|
|
10123
10091
|
const { jobId, limit, status, cursor } = args;
|
|
10124
10092
|
if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
10125
|
-
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-
|
|
10093
|
+
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-INIQCPGY.js");
|
|
10126
10094
|
const { baseUrl, token } = getToolRequestContext2(thunkApi);
|
|
10127
10095
|
const params = new URLSearchParams();
|
|
10128
10096
|
if (limit !== void 0) params.set("limit", String(limit));
|
|
@@ -10900,7 +10868,7 @@ var selectUserIdFromState = (state2) => {
|
|
|
10900
10868
|
var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
|
|
10901
10869
|
async function addImageContentToSpace(input) {
|
|
10902
10870
|
const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
|
|
10903
|
-
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-
|
|
10871
|
+
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-B2DRF7P6.js")).addContentAction;
|
|
10904
10872
|
await addContentAction2(
|
|
10905
10873
|
{
|
|
10906
10874
|
spaceId: input.spaceId,
|
|
@@ -12554,11 +12522,13 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
|
|
|
12554
12522
|
autoApprovedFields
|
|
12555
12523
|
});
|
|
12556
12524
|
const previousAgentForUpdate = buildUpdateThunkPreviousAgent(previousAgent, userId);
|
|
12525
|
+
const formData = buildPatch(args);
|
|
12526
|
+
const effortNote = calibrateReasoningEffortInPatch(formData, previousAgent);
|
|
12557
12527
|
const agent = await thunkApi.dispatch(
|
|
12558
12528
|
updateAgent({
|
|
12559
12529
|
userId,
|
|
12560
12530
|
agentId: extractAgentId(currentAgentKey),
|
|
12561
|
-
formData
|
|
12531
|
+
formData,
|
|
12562
12532
|
previousAgent: previousAgentForUpdate
|
|
12563
12533
|
})
|
|
12564
12534
|
).unwrap().catch((e) => {
|
|
@@ -12570,7 +12540,8 @@ async function updateSelfToolFunc(args, thunkApi, runtime) {
|
|
|
12570
12540
|
previousAgentForUpdate,
|
|
12571
12541
|
requestedFields
|
|
12572
12542
|
),
|
|
12573
|
-
displayData: formatUpdatedAgentOutput(agent)
|
|
12543
|
+
displayData: formatUpdatedAgentOutput(agent) + (effortNote ? `
|
|
12544
|
+
${effortNote}` : "")
|
|
12574
12545
|
};
|
|
12575
12546
|
}
|
|
12576
12547
|
|
|
@@ -13027,7 +12998,64 @@ var runAgentBackground = createAsyncThunk("agent/runBackground", async (args, {
|
|
|
13027
12998
|
throw lastError ?? new Error("\u4E8B\u4EF6\u6D41\u91CD\u8FDE\u5931\u8D25");
|
|
13028
12999
|
});
|
|
13029
13000
|
|
|
13001
|
+
// packages/ai/tools/agent/credentialFanoutGuard.ts
|
|
13002
|
+
var UNKNOWN_CREDENTIAL_GROUP = "unknown";
|
|
13003
|
+
function normalizeCredentialGroupValue(group) {
|
|
13004
|
+
if (typeof group !== "string") return UNKNOWN_CREDENTIAL_GROUP;
|
|
13005
|
+
const trimmed2 = group.trim();
|
|
13006
|
+
if (!trimmed2) return UNKNOWN_CREDENTIAL_GROUP;
|
|
13007
|
+
if (trimmed2.toLowerCase() === UNKNOWN_CREDENTIAL_GROUP) {
|
|
13008
|
+
return UNKNOWN_CREDENTIAL_GROUP;
|
|
13009
|
+
}
|
|
13010
|
+
return trimmed2;
|
|
13011
|
+
}
|
|
13012
|
+
var describeEntry = (entry) => entry.agentKey ?? entry.runId ?? "(unknown run)";
|
|
13013
|
+
function checkCredentialFanout(args) {
|
|
13014
|
+
const candidateGroup = normalizeCredentialGroupValue(
|
|
13015
|
+
args.candidate.credentialGroup
|
|
13016
|
+
);
|
|
13017
|
+
for (const entry of args.active) {
|
|
13018
|
+
if (entry.runId && args.candidate.runId && entry.runId === args.candidate.runId) {
|
|
13019
|
+
continue;
|
|
13020
|
+
}
|
|
13021
|
+
const entryGroup = normalizeCredentialGroupValue(entry.credentialGroup);
|
|
13022
|
+
if (candidateGroup === UNKNOWN_CREDENTIAL_GROUP || entryGroup === UNKNOWN_CREDENTIAL_GROUP) {
|
|
13023
|
+
if (args.allowUnknownCredential === true) continue;
|
|
13024
|
+
const side = candidateGroup === UNKNOWN_CREDENTIAL_GROUP ? "candidate" : "active";
|
|
13025
|
+
return {
|
|
13026
|
+
allowed: false,
|
|
13027
|
+
reason: "unknown_credential_group",
|
|
13028
|
+
conflict: entry,
|
|
13029
|
+
message: `\u62D2\u7EDD\u5E76\u53D1\u6D3E\u53D1\uFF1A${side === "candidate" ? `\u5019\u9009 agent ${describeEntry(args.candidate)} \u7684 credentialGroup \u672A\u77E5` : `\u5DF2\u6D3B\u8DC3 run ${describeEntry(entry)} \u7684 credentialGroup \u672A\u77E5`}\uFF0C\u65E0\u6CD5\u8BC1\u660E\u5B83\u4E0E\u540C\u6279\u5E76\u53D1 run \u4E0D\u5171\u7528\u4E0A\u6E38\u51ED\u8BC1\u3002\u8BF7\u6539\u4E3A\u4E32\u884C\u6D3E\u53D1\u3001\u6362\u7528 credentialGroup \u660E\u786E\u7684 agent\uFF0C\u6216\u5728\u786E\u8BA4\u98CE\u9669\u540E\u663E\u5F0F\u4F20 allowUnknownCredential: true \u5F3A\u5236\u653E\u884C\u3002`
|
|
13030
|
+
};
|
|
13031
|
+
}
|
|
13032
|
+
if (candidateGroup === entryGroup) {
|
|
13033
|
+
if (args.allowCredentialConcurrency === true) {
|
|
13034
|
+
continue;
|
|
13035
|
+
}
|
|
13036
|
+
return {
|
|
13037
|
+
allowed: false,
|
|
13038
|
+
reason: "credential_group_conflict",
|
|
13039
|
+
conflict: entry,
|
|
13040
|
+
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`
|
|
13041
|
+
};
|
|
13042
|
+
}
|
|
13043
|
+
}
|
|
13044
|
+
return { allowed: true };
|
|
13045
|
+
}
|
|
13046
|
+
|
|
13030
13047
|
// packages/ai/tools/agent/startAgentRunTool.ts
|
|
13048
|
+
var BATCH_FANOUT_ENTRY_TTL_MS = 30 * 60 * 1e3;
|
|
13049
|
+
var batchFanoutRegistry = /* @__PURE__ */ new Map();
|
|
13050
|
+
function pruneBatchFanoutRegistry(nowMs) {
|
|
13051
|
+
for (const [batchId, entries] of batchFanoutRegistry) {
|
|
13052
|
+
const alive = entries.filter(
|
|
13053
|
+
(e) => nowMs - e.startedAtMs < BATCH_FANOUT_ENTRY_TTL_MS
|
|
13054
|
+
);
|
|
13055
|
+
if (alive.length === 0) batchFanoutRegistry.delete(batchId);
|
|
13056
|
+
else batchFanoutRegistry.set(batchId, alive);
|
|
13057
|
+
}
|
|
13058
|
+
}
|
|
13031
13059
|
function buildStartAgentRunFunctionSchema(opts) {
|
|
13032
13060
|
const supportsWait = opts?.supportsWait !== false;
|
|
13033
13061
|
const wakeEnabled = opts?.wakeEnabled === true;
|
|
@@ -13059,7 +13087,21 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
13059
13087
|
// 与 server 透传保持不动,探活/烟测仍走 CLI 侧。
|
|
13060
13088
|
batchId: {
|
|
13061
13089
|
type: "string",
|
|
13062
|
-
description: "\u53EF\u9009\u3002\u6279\u6B21 id\uFF0C\u7528\u4E8E\u628A\u591A\u4E2A\u5E76\u884C run \u5F52\u4E3A\u4E00\u7EC4\uFF0C\u4FBF\u4E8E\u540E\u7EED controlAgentRun(list, batchId=...) \u6309\u6279\u67E5\u8BE2\u3002\u672A\u4F20\u65F6\u81EA\u52A8\u751F\u6210\u4E00\u4E2A\u5E76\u5728\u8FD4\u56DE\u503C\u4E2D\u5E26\u56DE\uFF0C\u8C03\u7528\u65B9\u65E0\u9700\u5148\u521B\u5EFA\u3002"
|
|
13090
|
+
description: "\u53EF\u9009\u3002\u6279\u6B21 id\uFF0C\u7528\u4E8E\u628A\u591A\u4E2A\u5E76\u884C run \u5F52\u4E3A\u4E00\u7EC4\uFF0C\u4FBF\u4E8E\u540E\u7EED controlAgentRun(list, batchId=...) \u6309\u6279\u67E5\u8BE2\u3002\u672A\u4F20\u65F6\u81EA\u52A8\u751F\u6210\u4E00\u4E2A\u5E76\u5728\u8FD4\u56DE\u503C\u4E2D\u5E26\u56DE\uFF0C\u8C03\u7528\u65B9\u65E0\u9700\u5148\u521B\u5EFA\u3002\u540C\u4E00 batchId \u5185\u7684\u5E76\u53D1\u6D3E\u53D1\u4F1A\u505A\u51ED\u8BC1\u7EC4\u9694\u79BB\u68C0\u67E5\uFF1AcredentialGroup \u76F8\u540C\u6216\u672A\u77E5\u7684\u5E76\u53D1 run \u4F1A\u88AB\u62D2\u7EDD\u3002"
|
|
13091
|
+
},
|
|
13092
|
+
credentialGroup: {
|
|
13093
|
+
type: "string",
|
|
13094
|
+
description: "\u53EF\u9009\u3002\u7167\u6284 listAgents \u8FD4\u56DE\u7684 credentialGroup \u5B57\u6BB5\uFF0C\u7528\u4E8E\u540C\u6279\u6B21\u5E76\u53D1\u6247\u51FA\u7684\u51ED\u8BC1\u9694\u79BB\u6821\u9A8C\u3002\u7F3A\u7701/\u7A7A\u503C\u89C6\u4E3A\u300C\u672A\u77E5\u300D\uFF08\u4E0D\u662F\u300C\u72EC\u7ACB\u300D\uFF09\uFF1A\u4E0E\u540C batch \u5185\u4EFB\u4F55\u5176\u4ED6 run \u5E76\u53D1\u90FD\u4F1A\u88AB\u62D2\u7EDD\u3002"
|
|
13095
|
+
},
|
|
13096
|
+
allowUnknownCredential: {
|
|
13097
|
+
type: "boolean",
|
|
13098
|
+
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",
|
|
13099
|
+
default: false
|
|
13100
|
+
},
|
|
13101
|
+
allowCredentialConcurrency: {
|
|
13102
|
+
type: "boolean",
|
|
13103
|
+
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",
|
|
13104
|
+
default: false
|
|
13063
13105
|
},
|
|
13064
13106
|
trackTodo: {
|
|
13065
13107
|
type: "boolean",
|
|
@@ -13092,13 +13134,26 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
13092
13134
|
const { agentKey, task, input, agentName, batchId, wait } = args;
|
|
13093
13135
|
const resultMode = args.resultMode ?? "full";
|
|
13094
13136
|
const { dispatch } = thunkApi;
|
|
13095
|
-
const
|
|
13137
|
+
const explicitBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : void 0;
|
|
13138
|
+
const effectiveBatchId = explicitBatchId ?? `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
|
|
13096
13139
|
if (!agentKey) {
|
|
13097
13140
|
throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\u3002");
|
|
13098
13141
|
}
|
|
13099
13142
|
if (!task || typeof task !== "string") {
|
|
13100
13143
|
throw new Error("startAgentRun: \u7F3A\u5C11\u6709\u6548\u7684 task \u6587\u672C\u63CF\u8FF0\u3002");
|
|
13101
13144
|
}
|
|
13145
|
+
if (explicitBatchId) {
|
|
13146
|
+
const nowMs = Date.now();
|
|
13147
|
+
pruneBatchFanoutRegistry(nowMs);
|
|
13148
|
+
const active = batchFanoutRegistry.get(explicitBatchId) ?? [];
|
|
13149
|
+
const verdict = checkCredentialFanout({
|
|
13150
|
+
active,
|
|
13151
|
+
candidate: { agentKey, credentialGroup: args.credentialGroup },
|
|
13152
|
+
allowUnknownCredential: args.allowUnknownCredential === true,
|
|
13153
|
+
allowCredentialConcurrency: args.allowCredentialConcurrency === true
|
|
13154
|
+
});
|
|
13155
|
+
if (!verdict.allowed) throw new Error(verdict.message);
|
|
13156
|
+
}
|
|
13102
13157
|
const content = buildDelegatedTaskContent(task, input);
|
|
13103
13158
|
const payloadMetrics = calculateDelegatedPayloadMetrics(task, input, content);
|
|
13104
13159
|
const activeDialogKey = getActiveDialogKey();
|
|
@@ -13128,6 +13183,16 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
13128
13183
|
};
|
|
13129
13184
|
}
|
|
13130
13185
|
const runId = bgResult.dialogId;
|
|
13186
|
+
if (explicitBatchId) {
|
|
13187
|
+
const entries = batchFanoutRegistry.get(explicitBatchId) ?? [];
|
|
13188
|
+
entries.push({
|
|
13189
|
+
runId,
|
|
13190
|
+
agentKey,
|
|
13191
|
+
...typeof args.credentialGroup === "string" && args.credentialGroup.trim() ? { credentialGroup: args.credentialGroup.trim() } : {},
|
|
13192
|
+
startedAtMs: Date.now()
|
|
13193
|
+
});
|
|
13194
|
+
batchFanoutRegistry.set(explicitBatchId, entries);
|
|
13195
|
+
}
|
|
13131
13196
|
const status = bgResult.status ?? "pending";
|
|
13132
13197
|
const resolvedName = agentName?.trim() || bgResult.agentName || bgResult.name;
|
|
13133
13198
|
const identity = { agentName: resolvedName, agentKey, runId };
|
|
@@ -14821,7 +14886,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
14821
14886
|
if (!executionInput) {
|
|
14822
14887
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
14823
14888
|
}
|
|
14824
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
14889
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-AZR26MXC.js");
|
|
14825
14890
|
const { executor } = findToolExecutor2(run.toolName);
|
|
14826
14891
|
toolRunStarted({
|
|
14827
14892
|
id: run.id,
|
|
@@ -14845,7 +14910,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
14845
14910
|
const latestState = thunkApi.getState();
|
|
14846
14911
|
const userId = selectIdentityUserId(latestState);
|
|
14847
14912
|
if (userId) {
|
|
14848
|
-
const { fetchUserSpaceMemberships } = await import("./memberThunks-
|
|
14913
|
+
const { fetchUserSpaceMemberships } = await import("./memberThunks-5ZXPR63F.js");
|
|
14849
14914
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
14850
14915
|
}
|
|
14851
14916
|
}
|
|
@@ -17328,7 +17393,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
17328
17393
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
17329
17394
|
};
|
|
17330
17395
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
17331
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
17396
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-2JTPJVFK.js");
|
|
17332
17397
|
if (getDocState().pageKey === id) {
|
|
17333
17398
|
applyExternalDocUpdate({
|
|
17334
17399
|
slateData: finalSlateData,
|
|
@@ -17353,7 +17418,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
17353
17418
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
17354
17419
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
17355
17420
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
17356
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-
|
|
17421
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-Q6EKL7EQ.js")).setSettings;
|
|
17357
17422
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
17358
17423
|
}
|
|
17359
17424
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
@@ -18076,6 +18141,38 @@ var baseToolDefinitions = [
|
|
|
18076
18141
|
costLevel: "low",
|
|
18077
18142
|
defaultConsent: "ask"
|
|
18078
18143
|
},
|
|
18144
|
+
{
|
|
18145
|
+
id: "updateAgentAutomation",
|
|
18146
|
+
schema: updateAgentAutomationFunctionSchema,
|
|
18147
|
+
executor: updateAgentAutomationFunc,
|
|
18148
|
+
description: {
|
|
18149
|
+
name: "updateAgentAutomation",
|
|
18150
|
+
description: "\u66F4\u65B0\u4E00\u4E2A agent automation \u7684\u6807\u9898\u3001instruction\u3001trigger\u3001status \u7B49\u5B57\u6BB5\u3002",
|
|
18151
|
+
category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
|
|
18152
|
+
},
|
|
18153
|
+
behavior: "action",
|
|
18154
|
+
uiGroup: "general",
|
|
18155
|
+
capability: "general",
|
|
18156
|
+
riskLevel: "medium",
|
|
18157
|
+
costLevel: "low",
|
|
18158
|
+
defaultConsent: "ask"
|
|
18159
|
+
},
|
|
18160
|
+
{
|
|
18161
|
+
id: "deleteAgentAutomation",
|
|
18162
|
+
schema: deleteAgentAutomationFunctionSchema,
|
|
18163
|
+
executor: deleteAgentAutomationFunc,
|
|
18164
|
+
description: {
|
|
18165
|
+
name: "deleteAgentAutomation",
|
|
18166
|
+
description: "\u5220\u9664\u4E00\u4E2A agent automation \u53CA\u5176 owner index\u3002",
|
|
18167
|
+
category: "\u8BA1\u5212\u4E0E\u7F16\u6392"
|
|
18168
|
+
},
|
|
18169
|
+
behavior: "action",
|
|
18170
|
+
uiGroup: "general",
|
|
18171
|
+
capability: "general",
|
|
18172
|
+
riskLevel: "high",
|
|
18173
|
+
costLevel: "low",
|
|
18174
|
+
defaultConsent: "ask"
|
|
18175
|
+
},
|
|
18079
18176
|
{
|
|
18080
18177
|
id: "notifyUser",
|
|
18081
18178
|
schema: notifyUserFunctionSchema,
|
|
@@ -19119,7 +19216,7 @@ var baseToolDefinitions = [
|
|
|
19119
19216
|
},
|
|
19120
19217
|
behavior: getChromeConnectorToolBehavior(name),
|
|
19121
19218
|
capability: "browser_automation",
|
|
19122
|
-
riskLevel: name === "
|
|
19219
|
+
riskLevel: name === "browser_click_element" || name === "browser_type" ? "medium" : "low",
|
|
19123
19220
|
costLevel: "low",
|
|
19124
19221
|
defaultConsent: getChromeConnectorToolDefaultConsent(name),
|
|
19125
19222
|
cancelable: true
|
|
@@ -19553,7 +19650,7 @@ var toolDefinitions = [
|
|
|
19553
19650
|
];
|
|
19554
19651
|
var ALL_TOOL_FUNCTION_NAMES = toolDefinitions.map((tool) => tool.schema?.name).filter((name) => Boolean(name));
|
|
19555
19652
|
var AGENT_AVAILABLE_TOOL_NAMES = ALL_TOOL_FUNCTION_NAMES.filter(
|
|
19556
|
-
(name) => name !== "toolquery" && !name.startsWith("browser_") && name !== "exa_search"
|
|
19653
|
+
(name) => name !== "toolquery" && (!name.startsWith("browser_") || CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES.includes(name)) && name !== "exa_search"
|
|
19557
19654
|
);
|
|
19558
19655
|
var patchAgentToolSchemas = () => {
|
|
19559
19656
|
try {
|
|
@@ -19613,31 +19710,30 @@ var findToolExecutor = (rawName) => {
|
|
|
19613
19710
|
};
|
|
19614
19711
|
|
|
19615
19712
|
export {
|
|
19616
|
-
resolveAgentRequiredPackIds,
|
|
19617
|
-
resolveAgentRecommendedSkillNames,
|
|
19618
19713
|
clipMultilineText,
|
|
19619
19714
|
fetchAndSerializeTable,
|
|
19620
19715
|
getToolResultErrorData,
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
toolRunSetPending,
|
|
19624
|
-
toolRunSucceeded,
|
|
19625
|
-
toolRunFailed,
|
|
19626
|
-
getAllToolRuns,
|
|
19627
|
-
createSSEParser,
|
|
19628
|
-
formatAgentListCard,
|
|
19716
|
+
resolveAgentRequiredPackIds,
|
|
19717
|
+
resolveAgentRecommendedSkillNames,
|
|
19629
19718
|
readXPostFunctionSchema,
|
|
19630
19719
|
readXPostFunc,
|
|
19631
19720
|
readXhsProfileFunctionSchema,
|
|
19632
19721
|
readXhsProfileFunc,
|
|
19633
|
-
CHROME_CONNECTOR_TOOL_NAMES,
|
|
19634
19722
|
rememberMemoryFunctionSchema,
|
|
19635
19723
|
deleteMemoryFunctionSchema,
|
|
19636
19724
|
queryMemoryFunctionSchema,
|
|
19725
|
+
createSSEParser,
|
|
19726
|
+
checkCredentialFanout,
|
|
19637
19727
|
buildStartAgentRunFunctionSchema,
|
|
19638
19728
|
CONTROL_AGENT_RUN_ACTIONS,
|
|
19639
19729
|
buildControlAgentRunFunctionSchema,
|
|
19640
19730
|
setTodoListFunc,
|
|
19731
|
+
createToolRunId,
|
|
19732
|
+
toolRunStarted,
|
|
19733
|
+
toolRunSetPending,
|
|
19734
|
+
toolRunSucceeded,
|
|
19735
|
+
toolRunFailed,
|
|
19736
|
+
getAllToolRuns,
|
|
19641
19737
|
TOOL_GROUP_META,
|
|
19642
19738
|
toolQueryFunctionSchema,
|
|
19643
19739
|
toolQueryFunc,
|
|
@@ -19646,5 +19742,6 @@ export {
|
|
|
19646
19742
|
toolExecutors,
|
|
19647
19743
|
toolDescriptions,
|
|
19648
19744
|
toolDefinitionsByName,
|
|
19649
|
-
findToolExecutor
|
|
19745
|
+
findToolExecutor,
|
|
19746
|
+
formatAgentListCard
|
|
19650
19747
|
};
|