nolo-cli 0.224.0-alpha.1 → 0.224.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-WW57SJN4.js → _executeModel-5NA4USGG.js} +77 -70
- package/{action-CK64LS6S.js → action-X75O3XPH.js} +11 -8
- package/{addContentAction-EQXMFNPR.js → addContentAction-GVC77QSN.js} +14 -13
- package/{addDialogAgentAction-RSDZDASD.js → addDialogAgentAction-KKDVAMW3.js} +15 -14
- package/{agentDeleteCommand-X2VWEKUA.js → agentDeleteCommand-2RFGKFAB.js} +127 -118
- package/{agentEmailCommands-6IE773VW.js → agentEmailCommands-GQCQKKOR.js} +126 -113
- package/{agentFavoriteCommands-2LKGKSUD.js → agentFavoriteCommands-7LOP3HUD.js} +5 -5
- package/{agentGrantCommands-QQV4N4JW.js → agentGrantCommands-L6O2HVJI.js} +5 -5
- package/{agentListCommands-5UNM7CGG.js → agentListCommands-HSGLDPDQ.js} +110 -495
- package/{agentMachineCommands-EVWFKK6Q.js → agentMachineCommands-BISF6PVV.js} +63 -57
- package/{agentProviderCommands-ZCH37KAL.js → agentProviderCommands-O3Q25PKU.js} +6 -6
- package/{agentPullCommand-XN6ZPBUW.js → agentPullCommand-G6U2LHMW.js} +6 -6
- package/agentRecordCommands-AOXPGYAJ.js +189 -0
- package/{agentRunCommand-KGOT2AFB.js → agentRunCommand-AFAIP7U7.js} +129 -113
- package/{agentRunControl-QDFW5P2T.js → agentRunControl-VBL7UFSG.js} +20 -14
- package/{agentRuntimeLocal-SD7U2EGY.js → agentRuntimeLocal-T7BX2WGL.js} +47 -41
- package/{agentSlice-ACZGTZVW.js → agentSlice-XJNKE3PG.js} +18 -17
- package/{appDeleteCommands-NE3NQQJL.js → appDeleteCommands-LURUSPY7.js} +56 -50
- package/{appDeployCommands-2BAHY522.js → appDeployCommands-SMEW4AK2.js} +56 -50
- package/{appDeployStatusCommands-JTW6LZNC.js → appDeployStatusCommands-VYPJTBJK.js} +56 -50
- package/{appGetCommands-WKFEJO6A.js → appGetCommands-N4NI5GGJ.js} +56 -50
- package/{appListCommands-HNAZZLFX.js → appListCommands-5C6ONN3Z.js} +56 -50
- package/{authCommand-4FDPL7WG.js → authCommand-4CVBDADE.js} +29 -24
- package/{authCommands-GAJ3NIXO.js → authCommands-EHU2BHOX.js} +12 -7
- package/{builtinSkillRegistry-PXH7EGQB.js → builtinSkillRegistry-AYWYQVA4.js} +4 -4
- package/{chromeOpsCommands-YKX2QX3A.js → chromeOpsCommands-CSDG2HYN.js} +6 -6
- package/{chunk-OOF7XDZF.js → chunk-2574ANSV.js} +6 -6
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-OGHP3CTL.js → chunk-2X7WFDT6.js} +1 -1
- package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
- package/{chunk-D726I5AZ.js → chunk-3EMIEC27.js} +2 -2
- package/{chunk-S7SB7L2I.js → chunk-3FBAVU2Y.js} +24 -22
- package/{chunk-YL3EFYL3.js → chunk-4D4QD7FT.js} +3 -1
- package/{chunk-5RKUPJYL.js → chunk-4FIO2S7Z.js} +11 -3
- package/{chunk-MKQ2UTTX.js → chunk-4IQVE43Z.js} +63 -32
- package/{chunk-6NKA6RKF.js → chunk-4Q6HQORG.js} +8 -8
- package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
- package/chunk-4ZCTKB27.js +31 -0
- package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-4A2JIXR2.js → chunk-5QZSEQSK.js} +1 -1
- package/chunk-5ZUOVCKT.js +32 -0
- package/{chunk-TRWT3EE3.js → chunk-62HXNQVV.js} +1 -1
- package/{chunk-JC5XLWZK.js → chunk-6CKUO32A.js} +27 -15
- package/chunk-6D25V6CB.js +133 -0
- package/chunk-6WOLPIPY.js +379 -0
- package/{chunk-KOXKKHFE.js → chunk-6WZVM33D.js} +9 -4
- package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
- package/{chunk-KO63FPG3.js → chunk-7AJRJGSQ.js} +1049 -2860
- package/chunk-7NIBQ4HY.js +138 -0
- package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
- package/{chunk-7WPAI5JJ.js → chunk-A3LUWRQK.js} +15 -15
- package/{chunk-C4WTX5TU.js → chunk-A5EVA6HU.js} +2 -2
- package/{chunk-O2CYENYJ.js → chunk-A74QP4FI.js} +2614 -1374
- package/{chunk-N3J4VDGV.js → chunk-AEQMKYZN.js} +15 -15
- package/{chunk-DVQH4BTR.js → chunk-AH5R7BYW.js} +26 -176
- package/{chunk-H7R3365N.js → chunk-ANJRDS6U.js} +8 -5
- package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
- package/{chunk-GIABSSWQ.js → chunk-B5SV4H3J.js} +4 -4
- package/{chunk-FVZW66K4.js → chunk-B7DE5XJW.js} +387 -347
- package/chunk-BEM6LPD2.js +734 -0
- package/{chunk-SRL56PI2.js → chunk-BGGAY6OK.js} +46 -8
- package/{chunk-T3O6BLYU.js → chunk-BGGV6B5O.js} +555 -328
- package/{chunk-BGGHA5DV.js → chunk-BIABIPGW.js} +1 -1
- package/chunk-BIDSIRTS.js +307 -0
- package/{chunk-6D7NVU66.js → chunk-BXSMFPTG.js} +17 -14
- package/{chunk-Q6HOUF4O.js → chunk-CBUZ6DKA.js} +3 -3
- package/{chunk-LE6LGAJE.js → chunk-CD3RU7XL.js} +17 -2
- package/{chunk-GVGOEMNV.js → chunk-CKZPMJNU.js} +3 -3
- package/{chunk-3ESU44FG.js → chunk-CVJRVBJL.js} +3 -3
- package/chunk-D374I563.js +62 -0
- package/{chunk-XWGDCWXY.js → chunk-DNZ4JJ7C.js} +9 -9
- package/chunk-DVYAFH2Q.js +103 -0
- package/{chunk-N7HVLYOY.js → chunk-DXW5WDHZ.js} +4 -4
- package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
- package/{chunk-65XXHYZ5.js → chunk-E5KJOZWY.js} +4 -4
- package/{chunk-GNHMRBYZ.js → chunk-EBKHA63G.js} +106 -14
- package/{chunk-PFJNLBRU.js → chunk-EEOOBRA7.js} +6 -6
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-QLFCTYRH.js → chunk-F3XI6WQP.js} +17 -10
- package/{chunk-AFHOCBSP.js → chunk-F6YWDVIB.js} +1 -1
- package/{chunk-VHPAA6MT.js → chunk-FFYE5ATM.js} +6 -6
- package/{chunk-F3TQURKK.js → chunk-FZKA3XFA.js} +21 -21
- package/{chunk-C4VAR65S.js → chunk-G22P367E.js} +153 -117
- package/{chunk-4NMHE7CX.js → chunk-GDUC4VS2.js} +12 -12
- package/{chunk-2VUZSVAS.js → chunk-GXXY2NL3.js} +22 -20
- package/{chunk-IWH5SOU4.js → chunk-H7ZYKHAZ.js} +38 -18
- package/{chunk-G2EJ7NL4.js → chunk-HBRDSQ3M.js} +2 -2
- package/{chunk-EGXPAWLG.js → chunk-HCNOO374.js} +1 -1
- package/{chunk-DJSTBAOU.js → chunk-HOM6LTEW.js} +4 -4
- package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
- package/{chunk-QWYFFHCJ.js → chunk-IJTXNLQE.js} +13 -13
- package/{chunk-UYOICCYG.js → chunk-IUMS6F53.js} +59 -88
- package/{chunk-MOMR7NMG.js → chunk-IUTUWIKE.js} +2 -2
- package/{chunk-JVRQ6YVK.js → chunk-JBWXPACD.js} +1 -1
- package/{chunk-SASHAZ67.js → chunk-KZPEGO6D.js} +13 -2
- package/{chunk-HCJFGH6Y.js → chunk-L32W3PRP.js} +46 -16
- package/{chunk-GGKNJ42M.js → chunk-LYDEFPQP.js} +18 -108
- package/{chunk-K5FNYHZC.js → chunk-MECDGHLK.js} +420 -120
- package/{chunk-EOWLBDY6.js → chunk-MM73SP4K.js} +1 -1
- package/{chunk-J6T25AJ6.js → chunk-MYOSN6BT.js} +82 -18
- package/{chunk-Q7WP5RPC.js → chunk-MYPKBJJO.js} +5 -5
- package/{chunk-6RQFZCKH.js → chunk-N2JROHD3.js} +4 -4
- package/{chunk-VREDDN25.js → chunk-O6IPRAVV.js} +14 -9
- package/{chunk-VALBGPM6.js → chunk-OBSEKCVK.js} +17 -20
- package/{chunk-AMEOV5VZ.js → chunk-OOJNQK6V.js} +33 -33
- package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
- package/{chunk-5R63B62U.js → chunk-P3IZUMIC.js} +8 -8
- package/{chunk-FRSBYNWI.js → chunk-PGKA77TZ.js} +52 -217
- package/{chunk-7UH3DGV6.js → chunk-PRMEU7BT.js} +232 -10
- package/{chunk-2ZKFCIJJ.js → chunk-PROOOQZ3.js} +1 -1
- package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
- package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
- package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/chunk-RETQOQ4D.js +33394 -0
- package/{chunk-AVHRSJUH.js → chunk-RM4UMFY4.js} +32 -25
- package/{chunk-2OLYKYNY.js → chunk-RTHFJZ6M.js} +8 -8
- package/{chunk-OB6DVWPF.js → chunk-S2MHR4PU.js} +164 -4
- package/{chunk-IWQAOW2X.js → chunk-SRCCSTIM.js} +8 -8
- package/{chunk-PVZY6P3S.js → chunk-T6VROBY7.js} +2 -2
- package/{chunk-2KTUDBG7.js → chunk-TEMLHVGX.js} +1 -1
- package/{chunk-TVFRV3UQ.js → chunk-TRHJ4NJB.js} +673 -1279
- package/{chunk-QVBXJNZ2.js → chunk-TUSTONB3.js} +1 -1
- package/{chunk-UMRI2IRY.js → chunk-TWTJV35S.js} +6 -6
- package/{chunk-5OZC7R7Y.js → chunk-U3G7RRXJ.js} +13 -12
- package/{chunk-CXDPIPZ4.js → chunk-UFC4J7OY.js} +3 -3
- package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
- package/{chunk-AGP3YSEC.js → chunk-ULLHVDTZ.js} +48 -3
- package/{chunk-SYQR7FQS.js → chunk-VM72HKW2.js} +97 -29
- package/{chunk-KEN3N2TN.js → chunk-VMJVAJ6W.js} +13 -10
- package/{chunk-3N4ASIP6.js → chunk-VREG6ANQ.js} +103 -100
- package/{chunk-SOF4OWDM.js → chunk-VS276URX.js} +0 -2
- package/chunk-VSRISJXZ.js +107 -0
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-UJKTI5PG.js → chunk-WRKMXMU7.js} +2 -1
- package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
- package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
- package/chunk-X7IA2B7R.js +166 -0
- package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
- package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
- package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
- package/{chunk-KAVGK4ES.js → chunk-Y5OWZQMJ.js} +39 -30
- package/{chunk-AK5O76CC.js → chunk-YGCOJNFZ.js} +3 -3
- package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-XFJ4ZPFC.js → chunk-Z2WZAE4P.js} +128 -149
- package/chunk-Z6YTCDU4.js +24 -0
- package/chunk-ZEKUFJLW.js +1438 -0
- package/{chunk-KN3HEZIQ.js → chunk-ZVOL2MAJ.js} +1 -1
- package/{cliAgentConfigHelpers-PO3MVDME.js → cliAgentConfigHelpers-U5OAVAKQ.js} +12 -12
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
- package/{cliEnvHelpers-VPSJ4XWC.js → cliEnvHelpers-CNMP3RDX.js} +1 -1
- package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
- package/{cliLocalAgentRecordReader-Z7CH4K4R.js → cliLocalAgentRecordReader-HVZAQCUD.js} +49 -44
- package/{commandRegistry-SDSYBKMC.js → commandRegistry-TME7INFU.js} +98 -94
- package/{contentThunks-G3TRPEAU.js → contentThunks-U6OC4R2N.js} +37 -35
- package/{cooldownCommands-X7P5M2V5.js → cooldownCommands-U7XSRVJP.js} +4 -4
- package/{createAgentAutomationAction-KHA4MXUJ.js → createAgentAutomationAction-IP4LFN3W.js} +37 -35
- package/{createDialogAction-KWSBNAPJ.js → createDialogAction-IAGQJ3LH.js} +38 -36
- package/{createPageAction-HXKJ7OFG.js → createPageAction-AZ3UIFKA.js} +38 -36
- package/{db-CS4ZJQKV.js → db-M7FU2GNK.js} +9 -6
- package/{dbSlice-ZJPDIFER.js → dbSlice-DKKMJJYY.js} +13 -12
- package/{deleteFile-Q3YDB4ML.js → deleteFile-TQSONMVU.js} +11 -8
- package/{dialogCommands-6KQEBHSG.js → dialogCommands-PCDRMBWG.js} +60 -55
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-WIZFFEY3.js → dialogNotifyCommand-O35MWMOS.js} +13 -13
- package/{dialogSlice-HXPKFGRL.js → dialogSlice-QAKYN4DE.js} +35 -33
- package/{dialogUsageCommand-HTVPR2CX.js → dialogUsageCommand-2SSLTXKO.js} +3 -3
- package/{docCreateCommands-XZOLWBRC.js → docCreateCommands-CFQFZOAD.js} +54 -48
- package/{docDeleteCommands-ZSO4LGWE.js → docDeleteCommands-5CPNTIIS.js} +56 -50
- package/{docReadCommands-TTMXCDER.js → docReadCommands-XQILYSAJ.js} +54 -48
- package/{docStore-A2B3GH33.js → docStore-GIVRT7TQ.js} +15 -14
- package/{docUpdateCommands-PRG6WOXL.js → docUpdateCommands-VETKSUDD.js} +54 -48
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-YH3VMSVU.js → getPricing-LF5C4XSI.js} +5 -5
- package/{handleSendMessageAction-NWYG3Q72.js → handleSendMessageAction-HKIW4ZNO.js} +70 -66
- package/{hostCredentialCreate-WS6D3EHT.js → hostCredentialCreate-6VDJFNDO.js} +118 -104
- package/index.js +56 -18
- package/keys-RWF7UCB4.js +1 -1
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-SVTPA5GY.js → localDialogRead-AV2VKKPG.js} +1 -1
- package/{localRecall-2J6QPOK2.js → localRecall-BDYKXB46.js} +3 -1
- package/{localRuntimeAdapter-TFYOA6YE.js → localRuntimeAdapter-BQ4F5PZV.js} +120 -107
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
- package/{machineCommands-WFWV25IR.js → machineCommands-K6XIGOAD.js} +142 -114
- package/{machineWsRunDispatch-ZGXC3F2R.js → machineWsRunDispatch-4OO7Z6UM.js} +114 -101
- package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
- package/{memberThunks-JRYNONYV.js → memberThunks-PBJPZ2JU.js} +22 -17
- package/{memoryCommands-5WC3T66U.js → memoryCommands-BC6REPQB.js} +4 -4
- package/{models-CXINDUJA.js → models-H5NNZRLH.js} +2 -2
- package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
- package/package.json +1 -1
- package/{projectArchive-ULJDLUA6.js → projectArchive-G7AOQPRW.js} +43 -41
- package/{providerPresetApply-SHT2SUVB.js → providerPresetApply-OPBCAONX.js} +6 -6
- package/{providerRegistry-TA7EGCVZ.js → providerRegistry-J2HCVTHE.js} +6 -6
- package/{read-Q7GOHGNP.js → read-JEGPITEW.js} +10 -9
- package/{readDocTool-Z5OQ6422.js → readDocTool-TE3XIU4Y.js} +1 -1
- package/{readlineWorkspace-LTCV2BFW.js → readlineWorkspace-SOW5QUGZ.js} +4412 -4277
- package/{removeDialogAgentAction-U3F2MNAY.js → removeDialogAgentAction-CX3OAH4Y.js} +17 -16
- package/{runAgentClientLoop-BVIEQUB3.js → runAgentClientLoop-HQJPDFGQ.js} +95 -69
- package/{runtimeDoctorCommands-I47JN4HS.js → runtimeDoctorCommands-GUH2YGMH.js} +17 -17
- package/{secretCommands-LJXOOYA7.js → secretCommands-NJXFVHZU.js} +4 -4
- package/{setDialogExtraReferencesAction-G3WSJ7EM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +16 -15
- package/{setPrimaryDialogAgentAction-6FHAHZBB.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +17 -16
- package/{settingThunks-AXTBX3Q5.js → settingThunks-AY76OHYX.js} +181 -62
- package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-IB6FKWIC.js → spaceCommands-G63QGYQO.js} +59 -53
- package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
- package/{streamAgentChatTurn-DNYFHBJM.js → streamAgentChatTurn-E3XH2KFD.js} +160 -154
- package/{switchDialogAgentAction-UOFIAGPL.js → switchDialogAgentAction-G6EZRKCQ.js} +15 -14
- package/{tableCommands-HITDSLHS.js → tableCommands-JI75ZHDI.js} +14 -11
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
- package/{tools-JVOJ5HC4.js → tools-7RSX22FT.js} +64 -58
- package/tuiRestart-KAAA7TND.js +41 -0
- package/{tuiSummaryLlmCaller-7LWYTHLM.js → tuiSummaryLlmCaller-BVNHMWLR.js} +19 -19
- package/{updateCommands-RJVCRSBP.js → updateCommands-ASK5XYPH.js} +8 -6
- package/{updateDialogTitleAction-Q57BOSXG.js → updateDialogTitleAction-SEWV252V.js} +37 -35
- package/{usageCommand-RVKHEPLU.js → usageCommand-JVT5J3DC.js} +3 -3
- package/{usageRebuildCommand-GRAFOZF2.js → usageRebuildCommand-IZYYUTEW.js} +4 -4
- package/webapi-24RZDIIQ.js +2488 -0
- package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
- package/workContext-MM3P5GP5.js +13 -0
- package/workContextAccess-UZHDLBUR.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/agentRecordCommands-DX2WE6BH.js +0 -176
- package/chunk-2THCNKE4.js +0 -147
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-652XYZGP.js +0 -352
- package/chunk-KEPOVMF4.js +0 -91
- package/chunk-OXKUPBAQ.js +0 -776
- package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
- package/{chunk-SNBZZPYH.js → chunk-OQHIVPG4.js} +3 -3
- package/{chunk-47ITIXO7.js → chunk-USGHJSGO.js} +3 -3
- package/{offlineMarxistsAgentCommand-4IC3Y4C6.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +3 -3
- package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-YIZ7KLUP.js} +3 -3
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fetchWithTransientRetry
|
|
3
|
-
} from "./chunk-KFHREHUQ.js";
|
|
4
1
|
import {
|
|
5
2
|
buildAgentDiscoveryResult,
|
|
6
3
|
deriveCredentialGroup,
|
|
4
|
+
injectSpeedContextIntoListAgentsResult,
|
|
5
|
+
isServerDispatchSpeedSource,
|
|
7
6
|
resolveDiscoveryScope,
|
|
8
7
|
resolvePaginationArgs,
|
|
9
8
|
toDiscoverySafeAgentSummary
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZEKUFJLW.js";
|
|
10
|
+
import {
|
|
11
|
+
formatWorkContextWriteNotice
|
|
12
|
+
} from "./chunk-WDWZPASX.js";
|
|
13
|
+
import {
|
|
14
|
+
AGENT_UPDATE_FIELD_NAMES,
|
|
15
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS,
|
|
16
|
+
normalizeAgentUpdateFieldList,
|
|
17
|
+
normalizeSystemBuiltinSkills,
|
|
18
|
+
normalizeUiPlugins
|
|
19
|
+
} from "./chunk-LYDEFPQP.js";
|
|
20
|
+
import {
|
|
21
|
+
applyFetchSpaceFulfilled,
|
|
22
|
+
fetchAuthoritativeRemoteSpace,
|
|
23
|
+
selectSpaceRemoteAuth
|
|
24
|
+
} from "./chunk-6WZVM33D.js";
|
|
11
25
|
import {
|
|
12
26
|
ToolResultError,
|
|
13
27
|
clipMultilineText,
|
|
@@ -16,42 +30,21 @@ import {
|
|
|
16
30
|
loadSkillFunc,
|
|
17
31
|
loadSkillFunctionSchema,
|
|
18
32
|
parseUiCard,
|
|
19
|
-
|
|
33
|
+
resolveMemoryToolContext,
|
|
34
|
+
resolveToolAttributionContext,
|
|
20
35
|
toolRunUpdated,
|
|
21
36
|
uiCardFallback,
|
|
22
37
|
waitForAbortableDelay
|
|
23
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VREG6ANQ.js";
|
|
24
39
|
import {
|
|
25
40
|
isGatewayHttpStatus
|
|
26
41
|
} from "./chunk-NF64D32W.js";
|
|
27
42
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
isDrainExhaustedResponse,
|
|
31
|
-
normalizeNonNegativeMs,
|
|
32
|
-
parseRetryAfterHeaderMs
|
|
33
|
-
} from "./chunk-3L2WKC3W.js";
|
|
34
|
-
import {
|
|
35
|
-
AGENT_UPDATE_FIELD_NAMES,
|
|
36
|
-
normalizeAgentUpdateFieldList
|
|
37
|
-
} from "./chunk-GGKNJ42M.js";
|
|
38
|
-
import {
|
|
39
|
-
markdownToSlate
|
|
40
|
-
} from "./chunk-FJ23FZXF.js";
|
|
41
|
-
import {
|
|
42
|
-
extractMentionsFromSlate
|
|
43
|
-
} from "./chunk-AGIM7IMJ.js";
|
|
44
|
-
import {
|
|
45
|
-
slateToRenderMarkdown
|
|
46
|
-
} from "./chunk-63W5N6P3.js";
|
|
43
|
+
resolveUserEnabledSkills
|
|
44
|
+
} from "./chunk-DVYAFH2Q.js";
|
|
47
45
|
import {
|
|
48
46
|
createDocState
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import {
|
|
51
|
-
applyFetchSpaceFulfilled,
|
|
52
|
-
fetchAuthoritativeRemoteSpace,
|
|
53
|
-
selectSpaceRemoteAuth
|
|
54
|
-
} from "./chunk-KOXKKHFE.js";
|
|
47
|
+
} from "./chunk-DXW5WDHZ.js";
|
|
55
48
|
import {
|
|
56
49
|
ToolApiError,
|
|
57
50
|
buildToolRequestHeaders,
|
|
@@ -59,20 +52,28 @@ import {
|
|
|
59
52
|
getRequestConfig,
|
|
60
53
|
getToolBaseUrl,
|
|
61
54
|
getToolRequestContext
|
|
62
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-XS5A3EKX.js";
|
|
63
56
|
import {
|
|
64
57
|
readDocFunc,
|
|
65
58
|
readDocFunctionSchema,
|
|
66
59
|
readPageFunc,
|
|
67
60
|
readPageFunctionSchema,
|
|
68
61
|
resolvePageReadMarkdown
|
|
69
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-BIABIPGW.js";
|
|
70
63
|
import {
|
|
71
|
-
|
|
72
|
-
} from "./chunk-
|
|
64
|
+
markdownToSlate
|
|
65
|
+
} from "./chunk-FJ23FZXF.js";
|
|
66
|
+
import {
|
|
67
|
+
extractMentionsFromSlate
|
|
68
|
+
} from "./chunk-AGIM7IMJ.js";
|
|
73
69
|
import {
|
|
74
|
-
|
|
75
|
-
} from "./chunk-
|
|
70
|
+
slateToRenderMarkdown
|
|
71
|
+
} from "./chunk-63W5N6P3.js";
|
|
72
|
+
import {
|
|
73
|
+
createDialogAction,
|
|
74
|
+
uiAskChoiceFunc,
|
|
75
|
+
uiAskChoiceFunctionSchema
|
|
76
|
+
} from "./chunk-PRMEU7BT.js";
|
|
76
77
|
import {
|
|
77
78
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
78
79
|
addContentToSpace,
|
|
@@ -89,27 +90,7 @@ import {
|
|
|
89
90
|
updateContentCategory,
|
|
90
91
|
updateContentTitle,
|
|
91
92
|
writeStoredCollapsedCategories
|
|
92
|
-
} from "./chunk-
|
|
93
|
-
import {
|
|
94
|
-
buildDatabaseFileContentUrl,
|
|
95
|
-
deleteDialog,
|
|
96
|
-
normalizeAppRouteId,
|
|
97
|
-
resolveDialogRuntimeAgentKey,
|
|
98
|
-
runtime_default,
|
|
99
|
-
selectAllMsgs,
|
|
100
|
-
selectCurrentDialogConfig,
|
|
101
|
-
selectCurrentDialogId,
|
|
102
|
-
selectMsgById,
|
|
103
|
-
uiAskChoiceFunc,
|
|
104
|
-
uiAskChoiceFunctionSchema
|
|
105
|
-
} from "./chunk-FVZW66K4.js";
|
|
106
|
-
import {
|
|
107
|
-
createAgent,
|
|
108
|
-
deleteServerSyncedCredential,
|
|
109
|
-
runLlm,
|
|
110
|
-
streamAgentChatTurn,
|
|
111
|
-
updateAgent
|
|
112
|
-
} from "./chunk-QWYFFHCJ.js";
|
|
93
|
+
} from "./chunk-FZKA3XFA.js";
|
|
113
94
|
import {
|
|
114
95
|
addMemberSpace,
|
|
115
96
|
getAllMemberSpaces,
|
|
@@ -126,28 +107,58 @@ import {
|
|
|
126
107
|
setViewMode,
|
|
127
108
|
updateCurrentSpaceIfMatch,
|
|
128
109
|
updateMemberSpaceName
|
|
129
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-IUTUWIKE.js";
|
|
111
|
+
import {
|
|
112
|
+
buildDatabaseFileContentUrl,
|
|
113
|
+
deleteDialog,
|
|
114
|
+
runtime_default,
|
|
115
|
+
selectAllMsgs,
|
|
116
|
+
selectCurrentDialogConfig,
|
|
117
|
+
selectCurrentDialogId,
|
|
118
|
+
selectMsgById
|
|
119
|
+
} from "./chunk-B7DE5XJW.js";
|
|
120
|
+
import {
|
|
121
|
+
createAgent,
|
|
122
|
+
deleteServerSyncedCredential,
|
|
123
|
+
runLlm,
|
|
124
|
+
streamAgentChatTurn,
|
|
125
|
+
updateAgent
|
|
126
|
+
} from "./chunk-IJTXNLQE.js";
|
|
130
127
|
import {
|
|
131
128
|
buildMediaToolConfirmation,
|
|
132
129
|
normalizeMediaConfirmExecutionRevision
|
|
133
130
|
} from "./chunk-QYPE3TS3.js";
|
|
134
131
|
import {
|
|
135
|
-
getActiveDialogKey,
|
|
136
|
-
selectCurrentDialogKey,
|
|
137
132
|
selectPendingRawDataByPageKey
|
|
138
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-I2OYPD3Y.js";
|
|
139
134
|
import {
|
|
140
135
|
require_react
|
|
141
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-RD3QLZQV.js";
|
|
137
|
+
import {
|
|
138
|
+
resolveDefaultReasoningEffort
|
|
139
|
+
} from "./chunk-5ZUOVCKT.js";
|
|
140
|
+
import {
|
|
141
|
+
fetchWithTransientRetry
|
|
142
|
+
} from "./chunk-DXWGFL2Z.js";
|
|
143
|
+
import {
|
|
144
|
+
CORE_DRAIN_REASON,
|
|
145
|
+
DRAIN_EXHAUSTED_USER_MESSAGE,
|
|
146
|
+
isDrainExhaustedResponse,
|
|
147
|
+
normalizeNonNegativeMs,
|
|
148
|
+
parseRetryAfterHeaderMs
|
|
149
|
+
} from "./chunk-3L2WKC3W.js";
|
|
150
|
+
import {
|
|
151
|
+
shareResourceAction
|
|
152
|
+
} from "./chunk-YGCOJNFZ.js";
|
|
142
153
|
import {
|
|
143
154
|
selectCurrentServer,
|
|
144
155
|
selectSyncServers
|
|
145
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-O6IPRAVV.js";
|
|
146
157
|
import {
|
|
147
158
|
UNCATEGORIZED_ID,
|
|
148
159
|
addContentAction,
|
|
149
160
|
checkSpaceMembership
|
|
150
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-T6VROBY7.js";
|
|
151
162
|
import {
|
|
152
163
|
createSpaceKey,
|
|
153
164
|
normalizeSpaceId
|
|
@@ -163,14 +174,10 @@ import {
|
|
|
163
174
|
selectEntities,
|
|
164
175
|
toTimestampMs,
|
|
165
176
|
write
|
|
166
|
-
} from "./chunk-
|
|
167
|
-
import {
|
|
168
|
-
getUserDataItemTimestamp,
|
|
169
|
-
mergeAndDedupUserData
|
|
170
|
-
} from "./chunk-GBWGPTA7.js";
|
|
177
|
+
} from "./chunk-RM4UMFY4.js";
|
|
171
178
|
import {
|
|
172
179
|
readAction
|
|
173
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-F3XI6WQP.js";
|
|
174
181
|
import {
|
|
175
182
|
DEVICE_LOCAL_OWNER_ID,
|
|
176
183
|
getRuntimeServerContext,
|
|
@@ -180,16 +187,36 @@ import {
|
|
|
180
187
|
resolveEffectiveSpaceActorId,
|
|
181
188
|
resolveRecordOwnerUserId,
|
|
182
189
|
selectRuntimeSnapshot
|
|
183
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-GXXY2NL3.js";
|
|
184
191
|
import {
|
|
185
192
|
createAsyncThunk,
|
|
193
|
+
createSelector,
|
|
186
194
|
noloWriteRequest
|
|
187
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-7TTMMOKH.js";
|
|
188
196
|
import {
|
|
189
197
|
selectIdentityToken,
|
|
190
198
|
selectIdentityUserBalance,
|
|
191
199
|
selectIdentityUserId
|
|
192
200
|
} from "./chunk-PXYBUFDB.js";
|
|
201
|
+
import {
|
|
202
|
+
getUserDataItemTimestamp,
|
|
203
|
+
mergeAndDedupUserData
|
|
204
|
+
} from "./chunk-GBWGPTA7.js";
|
|
205
|
+
import {
|
|
206
|
+
RUN_TITLE_MAX,
|
|
207
|
+
TASK_PREVIEW_MAX,
|
|
208
|
+
buildDelegatedTaskContent,
|
|
209
|
+
calculateDelegatedPayloadMetrics,
|
|
210
|
+
formatAgentListCard,
|
|
211
|
+
formatListRunsCard,
|
|
212
|
+
formatNotFoundRunCard,
|
|
213
|
+
formatStartRunCard,
|
|
214
|
+
formatStatusRunCard,
|
|
215
|
+
formatStopRunCard,
|
|
216
|
+
normalizeRunTitle,
|
|
217
|
+
resolveAgentRunName,
|
|
218
|
+
resolveRunLabel
|
|
219
|
+
} from "./chunk-OOJNQK6V.js";
|
|
193
220
|
import {
|
|
194
221
|
buildTombstoneRecord,
|
|
195
222
|
isTombstoneRecord
|
|
@@ -212,24 +239,24 @@ import {
|
|
|
212
239
|
normalizeNoloSpaceInput,
|
|
213
240
|
resolveNoloDialogInput,
|
|
214
241
|
verifyNoloDialogSubjectRefQuery
|
|
215
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-G22P367E.js";
|
|
216
243
|
import {
|
|
217
244
|
mergeAvailabilityDeadline,
|
|
218
245
|
resolveCredentialKeyWithFallback
|
|
219
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-QJTZ76CP.js";
|
|
220
247
|
import {
|
|
221
248
|
redactAgentRecordForWorkspaceTool,
|
|
222
249
|
resolveReadOnlyToolConstraints
|
|
223
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-VS276URX.js";
|
|
224
251
|
import {
|
|
225
252
|
clipCompactText
|
|
226
253
|
} from "./chunk-5MMAK75Q.js";
|
|
254
|
+
import {
|
|
255
|
+
createFileCredentialBroker
|
|
256
|
+
} from "./chunk-OQHIVPG4.js";
|
|
227
257
|
import {
|
|
228
258
|
asRecordOrEmpty
|
|
229
259
|
} from "./chunk-KX6YBIHG.js";
|
|
230
|
-
import {
|
|
231
|
-
createFileCredentialBroker
|
|
232
|
-
} from "./chunk-SNBZZPYH.js";
|
|
233
260
|
import {
|
|
234
261
|
compactWhitespace
|
|
235
262
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -237,8 +264,9 @@ import {
|
|
|
237
264
|
isAbortError
|
|
238
265
|
} from "./chunk-7DPNBQSV.js";
|
|
239
266
|
import {
|
|
240
|
-
CAPABILITY_PACKS
|
|
241
|
-
|
|
267
|
+
CAPABILITY_PACKS,
|
|
268
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
269
|
+
} from "./chunk-EBKHA63G.js";
|
|
242
270
|
import {
|
|
243
271
|
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
244
272
|
canonicalizeToolName,
|
|
@@ -276,8 +304,12 @@ import {
|
|
|
276
304
|
toTrimmedString
|
|
277
305
|
} from "./chunk-SYTHYBMI.js";
|
|
278
306
|
import {
|
|
307
|
+
dialogMessageKey,
|
|
279
308
|
dialogMessageRange,
|
|
280
309
|
isDialogKey,
|
|
310
|
+
isDialogRecordKey,
|
|
311
|
+
isDialogRecordKeyForId,
|
|
312
|
+
parseDialogKey,
|
|
281
313
|
ulid
|
|
282
314
|
} from "./chunk-OJKUU3LP.js";
|
|
283
315
|
import {
|
|
@@ -285,20 +317,8 @@ import {
|
|
|
285
317
|
asTrimmedNonEmptyStringArray
|
|
286
318
|
} from "./chunk-I42VC5KR.js";
|
|
287
319
|
import {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
buildDelegatedTaskContent,
|
|
291
|
-
calculateDelegatedPayloadMetrics,
|
|
292
|
-
formatAgentListCard,
|
|
293
|
-
formatListRunsCard,
|
|
294
|
-
formatNotFoundRunCard,
|
|
295
|
-
formatStartRunCard,
|
|
296
|
-
formatStatusRunCard,
|
|
297
|
-
formatStopRunCard,
|
|
298
|
-
normalizeRunTitle,
|
|
299
|
-
resolveAgentRunName,
|
|
300
|
-
resolveRunLabel
|
|
301
|
-
} from "./chunk-AMEOV5VZ.js";
|
|
320
|
+
API_ENDPOINTS
|
|
321
|
+
} from "./chunk-LCBAMY2M.js";
|
|
302
322
|
import {
|
|
303
323
|
toErrorMessage
|
|
304
324
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -309,19 +329,13 @@ import {
|
|
|
309
329
|
DEFAULT_MODEL,
|
|
310
330
|
clampReasoningEffort,
|
|
311
331
|
resolveModelReasoningCapabilityWithCache
|
|
312
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-CD3RU7XL.js";
|
|
313
333
|
import {
|
|
314
334
|
isRecord
|
|
315
335
|
} from "./chunk-KUG52IAP.js";
|
|
316
|
-
import {
|
|
317
|
-
asTrimmedLowercaseString
|
|
318
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
319
336
|
import {
|
|
320
337
|
asOptionalFiniteNumber
|
|
321
338
|
} from "./chunk-WWC7I6TA.js";
|
|
322
|
-
import {
|
|
323
|
-
API_ENDPOINTS
|
|
324
|
-
} from "./chunk-LCBAMY2M.js";
|
|
325
339
|
import {
|
|
326
340
|
asOptionalTrimmedString
|
|
327
341
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -331,6 +345,9 @@ import {
|
|
|
331
345
|
import {
|
|
332
346
|
normalizeServerOrigin
|
|
333
347
|
} from "./chunk-CF7PE763.js";
|
|
348
|
+
import {
|
|
349
|
+
asTrimmedLowercaseString
|
|
350
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
334
351
|
import {
|
|
335
352
|
__toESM
|
|
336
353
|
} from "./chunk-U67V476Y.js";
|
|
@@ -1023,7 +1040,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
|
|
|
1023
1040
|
workspace: { mode: "lease" }
|
|
1024
1041
|
};
|
|
1025
1042
|
var findModelConfig = async (modelName, provider) => {
|
|
1026
|
-
const { ALL_MODELS } = await import("./models-
|
|
1043
|
+
const { ALL_MODELS } = await import("./models-H5NNZRLH.js");
|
|
1027
1044
|
const name = toTrimmedString(modelName);
|
|
1028
1045
|
const prov = toTrimmedString(provider ?? "");
|
|
1029
1046
|
if (!name) return null;
|
|
@@ -1268,7 +1285,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
|
|
|
1268
1285
|
const trimmedModel = toTrimmedString(model);
|
|
1269
1286
|
const trimmedProvider = toTrimmedString(provider);
|
|
1270
1287
|
const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
|
|
1271
|
-
const { getModelPricing } = await import("./getPricing-
|
|
1288
|
+
const { getModelPricing } = await import("./getPricing-LF5C4XSI.js");
|
|
1272
1289
|
const normalizedTools = tools ?? [];
|
|
1273
1290
|
const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
|
|
1274
1291
|
const formData = {
|
|
@@ -1310,7 +1327,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
|
|
|
1310
1327
|
frequency_penalty,
|
|
1311
1328
|
presence_penalty,
|
|
1312
1329
|
max_tokens,
|
|
1313
|
-
reasoning_effort: reasoning_effort ?? "medium",
|
|
1330
|
+
reasoning_effort: reasoning_effort ?? resolveDefaultReasoningEffort({ provider: trimmedProvider, model: trimmedModel, fallback: "medium" }),
|
|
1314
1331
|
whitelist: []
|
|
1315
1332
|
};
|
|
1316
1333
|
return formData;
|
|
@@ -1328,6 +1345,10 @@ var findSpaceConfig = (nameOrId, allSpaces) => {
|
|
|
1328
1345
|
};
|
|
1329
1346
|
async function createAgentToolFunc(args, thunkApi, runtime) {
|
|
1330
1347
|
const state2 = thunkApi.getState();
|
|
1348
|
+
const { spaceId } = resolveToolAttributionContext(state2, runtime, {
|
|
1349
|
+
requireAgentKey: false,
|
|
1350
|
+
errorLabel: "\u521B\u5EFA Agent \u5931\u8D25\uFF1A\u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E"
|
|
1351
|
+
});
|
|
1331
1352
|
const currentUserId = selectIdentityUserId(state2);
|
|
1332
1353
|
const currentBalance = selectIdentityUserBalance(state2);
|
|
1333
1354
|
const allSpaces = getAllMemberSpaces();
|
|
@@ -1411,16 +1432,15 @@ ${availableList}`
|
|
|
1411
1432
|
createAgent({
|
|
1412
1433
|
userId: currentUserId,
|
|
1413
1434
|
formData,
|
|
1414
|
-
spaceId
|
|
1435
|
+
spaceId
|
|
1415
1436
|
})
|
|
1416
1437
|
).unwrap();
|
|
1417
1438
|
assertForkedAgentProviderConfig(agent, expectedProviderConfig);
|
|
1418
|
-
|
|
1419
|
-
if (currentSpaceId) {
|
|
1439
|
+
if (spaceId) {
|
|
1420
1440
|
const agentDbKey = agent.isPublic ? createAgentKey.public(agent.id) : createAgentKey.private(currentUserId, agent.id);
|
|
1421
1441
|
try {
|
|
1422
1442
|
await thunkApi.dispatch(addContentToSpace({
|
|
1423
|
-
spaceId
|
|
1443
|
+
spaceId,
|
|
1424
1444
|
title: agent.name || "\u672A\u547D\u540D\u667A\u80FD\u4F53",
|
|
1425
1445
|
type: "agent" /* AGENT */,
|
|
1426
1446
|
// 统一使用 ContentType.AGENT
|
|
@@ -1523,6 +1543,34 @@ ${effortNote}` : "")
|
|
|
1523
1543
|
};
|
|
1524
1544
|
}
|
|
1525
1545
|
|
|
1546
|
+
// packages/ai/tools/knowledgeCaptureConfirmation.ts
|
|
1547
|
+
function canonical(value) {
|
|
1548
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
1549
|
+
if (value && typeof value === "object") return `{${Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`).join(",")}}`;
|
|
1550
|
+
return JSON.stringify(value);
|
|
1551
|
+
}
|
|
1552
|
+
function requireKnowledgeCaptureConfirmation(args, operation, input, preview = input) {
|
|
1553
|
+
const binding = canonical({ operation, input, preview });
|
|
1554
|
+
if (args.__confirmedKnowledgeCapture === binding) return;
|
|
1555
|
+
const confirmationInput = { ...input, __confirmedKnowledgeCapture: binding };
|
|
1556
|
+
throw new ToolResultError("\u4FDD\u5B58\u524D\u8BF7\u786E\u8BA4\u5185\u5BB9\u4E0E\u76EE\u6807\u7A7A\u95F4\u3002", {
|
|
1557
|
+
code: "knowledge_capture_requires_confirmation",
|
|
1558
|
+
retryable: false,
|
|
1559
|
+
displayData: "\u786E\u8BA4\u4FDD\u5B58\uFF1F\u8BF7\u6838\u5BF9\u672C\u6B21\u5B8C\u6574\u5185\u5BB9\u4E0E\u76EE\u6807\u7A7A\u95F4\u3002",
|
|
1560
|
+
rawData: {
|
|
1561
|
+
error: "knowledge_capture_requires_confirmation",
|
|
1562
|
+
operation,
|
|
1563
|
+
confirmationInput,
|
|
1564
|
+
preview
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
async function checkKnowledgeCaptureTarget(spaceId, api) {
|
|
1569
|
+
if (!spaceId) return;
|
|
1570
|
+
const space = await api.dispatch(read({ dbKey: createSpaceKey.space(spaceId) })).unwrap();
|
|
1571
|
+
checkSpaceMembership(space, selectIdentityUserId(api.getState()));
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1526
1574
|
// packages/ai/tools/createDocTool.ts
|
|
1527
1575
|
var createDocFunctionSchema = {
|
|
1528
1576
|
name: "createDoc",
|
|
@@ -1581,18 +1629,20 @@ async function createDocFunc(args, thunkApi) {
|
|
|
1581
1629
|
const categoryId = rawCategoryId || void 0;
|
|
1582
1630
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
1583
1631
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
1584
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
1632
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
1585
1633
|
const rawContent = (args.content ?? "").trim();
|
|
1586
1634
|
const content = rawContent || void 0;
|
|
1635
|
+
requireKnowledgeCaptureConfirmation(args, "createDoc", { title, content: content ?? "", categoryId: categoryId ?? "", spaceId: spaceId ?? "" });
|
|
1636
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
1587
1637
|
try {
|
|
1588
1638
|
console.log("[createDocTool] dispatching createDoc with:", {
|
|
1589
1639
|
title,
|
|
1590
|
-
spaceId,
|
|
1640
|
+
spaceId: spaceId ?? "",
|
|
1591
1641
|
categoryId,
|
|
1592
1642
|
content
|
|
1593
1643
|
});
|
|
1594
1644
|
const id = await createDocState(
|
|
1595
|
-
{ title, spaceId, categoryId, content },
|
|
1645
|
+
{ title, spaceId: spaceId ?? "", categoryId, content },
|
|
1596
1646
|
{ dispatch, getState }
|
|
1597
1647
|
);
|
|
1598
1648
|
console.log("[createDocTool] createDoc success, id:", id);
|
|
@@ -1682,26 +1732,26 @@ var updateHtmlArtifactFunctionSchema = {
|
|
|
1682
1732
|
required: ["id", "html"]
|
|
1683
1733
|
}
|
|
1684
1734
|
};
|
|
1685
|
-
var
|
|
1735
|
+
var resolveArtifactDialogKey = (thunkApi, explicitDialogKey, context2) => {
|
|
1686
1736
|
if (explicitDialogKey && typeof explicitDialogKey === "string" && explicitDialogKey.trim()) {
|
|
1687
1737
|
return explicitDialogKey.trim();
|
|
1688
1738
|
}
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
if (
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1739
|
+
const state2 = thunkApi?.getState?.();
|
|
1740
|
+
const { dialogId } = resolveToolAttributionContext(state2, context2, {
|
|
1741
|
+
requireAgentKey: false,
|
|
1742
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A HTML artifact \u5F52\u5C5E"
|
|
1743
|
+
});
|
|
1744
|
+
if (context2?.dialogKey?.trim()) return context2.dialogKey.trim();
|
|
1745
|
+
return Object.keys(state2.db.entities).find(
|
|
1746
|
+
(key2) => isDialogRecordKeyForId(key2, dialogId) && state2.db.entities[key2]?.id?.trim() === dialogId
|
|
1747
|
+
);
|
|
1698
1748
|
};
|
|
1699
|
-
async function createHtmlArtifactFunc(args, thunkApi) {
|
|
1749
|
+
async function createHtmlArtifactFunc(args, thunkApi, context2) {
|
|
1700
1750
|
const html = typeof args?.html === "string" ? args.html : "";
|
|
1701
1751
|
if (!html.trim()) {
|
|
1702
1752
|
throw new Error("createHtmlArtifact: html \u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A\u3002");
|
|
1703
1753
|
}
|
|
1704
|
-
const dialogKey =
|
|
1754
|
+
const dialogKey = resolveArtifactDialogKey(thunkApi, args?.dialogKey, context2);
|
|
1705
1755
|
const title = typeof args?.title === "string" && args.title.trim() ? args.title.trim() : DEFAULT_HTML_ARTIFACT_TITLE;
|
|
1706
1756
|
const response = await callToolApi(
|
|
1707
1757
|
thunkApi,
|
|
@@ -1986,12 +2036,15 @@ async function createSkillDocFunc(args, thunkApi) {
|
|
|
1986
2036
|
const { title, content, skillConfig, evalConfig } = buildSkillDocFromArgs(args);
|
|
1987
2037
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
1988
2038
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
1989
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
2039
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
1990
2040
|
const categoryId = (args.categoryId ?? "").trim() || void 0;
|
|
2041
|
+
const { __confirmedKnowledgeCapture: _confirmation, ...source } = args;
|
|
2042
|
+
requireKnowledgeCaptureConfirmation(args, "createSkillDoc", { ...source, spaceId: spaceId ?? "", categoryId: categoryId ?? "" }, { title, content, spaceId: spaceId ?? "", categoryId: categoryId ?? "" });
|
|
2043
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
1991
2044
|
const id = await createDocState(
|
|
1992
2045
|
{
|
|
1993
2046
|
title,
|
|
1994
|
-
spaceId,
|
|
2047
|
+
spaceId: spaceId ?? "",
|
|
1995
2048
|
categoryId,
|
|
1996
2049
|
content
|
|
1997
2050
|
},
|
|
@@ -2371,12 +2424,14 @@ Imported from: ${url}` : ""
|
|
|
2371
2424
|
});
|
|
2372
2425
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
2373
2426
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
2374
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
2427
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
2375
2428
|
const categoryId = (args.categoryId ?? "").trim() || void 0;
|
|
2429
|
+
requireKnowledgeCaptureConfirmation(args, "importSkill", { content: rawMarkdown, title: docTitle, url, spaceId: spaceId ?? "", categoryId: categoryId ?? "" }, { title: docTitle, content, spaceId: spaceId ?? "", categoryId: categoryId ?? "" });
|
|
2430
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
2376
2431
|
const id = await createDocState(
|
|
2377
2432
|
{
|
|
2378
2433
|
title: docTitle,
|
|
2379
|
-
spaceId,
|
|
2434
|
+
spaceId: spaceId ?? "",
|
|
2380
2435
|
categoryId,
|
|
2381
2436
|
content
|
|
2382
2437
|
},
|
|
@@ -3904,7 +3959,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3904
3959
|
const deletedDialogIds = [];
|
|
3905
3960
|
const deletedDialogKeys = [];
|
|
3906
3961
|
const failures = [];
|
|
3907
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3962
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-QAKYN4DE.js");
|
|
3908
3963
|
for (const target of targets) {
|
|
3909
3964
|
try {
|
|
3910
3965
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -3970,7 +4025,7 @@ async function fetchUserFavoriteAgentMap(thunkApi) {
|
|
|
3970
4025
|
}
|
|
3971
4026
|
var listAgentsFunctionSchema = {
|
|
3972
4027
|
name: "listAgents",
|
|
3973
|
-
description: "List Nolo agents available for delegation as safe summaries. By default (scope='all') returns the deduplicated union of the user's own/favorite agents and public/shared agents. scope='public' returns only public/shared agents. Public agents may consume platform credits - check each agent's billingSource before dispatching. The payload returns `credentialGroups` summarizing independent credential capacities (credentialGroup, credentialKind, agentCount, and availableAt recovery timestamps). Orchestration discipline:
|
|
4028
|
+
description: "List Nolo agents available for delegation as safe summaries. Returns planningRecommendation: conditional advice only when planning is needed and the candidate is suitable; simple questions need no extra planning call. action self/delegate, reason, currentTier, optional agentKey/recommendedTier, poolComplete, requiresPaidApproval. Caller identity/model/runKind are host-owned, not tool arguments. Unknown tiers are not ranked; incomplete pools cannot establish a highest candidate. Bounded subtasks do not delegate planning. Recommendation is not authorization and never starts a run; paid channels require separate approval. By default (scope='all') returns the deduplicated union of the user's own/favorite agents and public/shared agents. scope='public' returns only public/shared agents. Public agents may consume platform credits - check each agent's billingSource before dispatching. The payload returns `credentialGroups` summarizing independent credential capacities (credentialGroup, credentialKind, agentCount, and availableAt recovery timestamps). Orchestration discipline: Fan out independent runs concurrently; sharing a credential alone is not a dependency. Same-credential concurrency is normally allowed subject to server admission budgets and upstream 429 limits; reduce concurrency or switch channels when needed. Spread load across credentialGroups when useful. Unknown credentials are not assumed independent: the dispatch guard limits only same-batch concurrency among those candidates (one at a time unless allowUnknownCredential explicitly confirms the risk); unrelated channels and work remain concurrent. A channel verdict is valid for the current dispatch attempt only; always re-read availability before dispatching, and never reuse a failure verdict from an earlier attempt. On config_unresolved-class errors, retry once before degrading. Choose a channel by task capability and applicable cost authorization; higher tier alone does not require reserving it for review. The `agents` array carries a compact agent-selection projection per agent: runnable `agentKey` (agent-<userId>-<id> owned, agent-pub-<id> public), name, model, provider, apiSource, billingSource ('user_subscription' | 'owner_subscription' | 'user_api' | 'platform_credits' | 'local'), tools, isFavorite, isOAuth, isOwned, isPublic, credentialGroup, credentialKind. Copy `agentKey` verbatim into startAgentRun. All agents are listed, including rate-limited (429) ones: cooldown agents carry `availabilityStatus` / `availabilityReason` / `nextAvailableAt` as reference info, not a dispatch gate (quota is informational; requests are still sent and upstream results are reported as-is). `unavailableCount` reports how many agents are currently rate-limited. `showUnavailable` is deprecated and has no effect (kept for compatibility). Set `verbose: true` for full safe summary details.",
|
|
3974
4029
|
parameters: {
|
|
3975
4030
|
type: "object",
|
|
3976
4031
|
properties: {
|
|
@@ -3987,23 +4042,34 @@ var listAgentsFunctionSchema = {
|
|
|
3987
4042
|
description: "Optional case-insensitive search substring matching agent name, model, provider, handle, or agentKey. Use to locate specific candidates like 'opus', 'devin', or 'claude'."
|
|
3988
4043
|
},
|
|
3989
4044
|
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." },
|
|
3990
|
-
compact: { type: "boolean", description: "Explicit compact projection mode. Retains essential agent-selection and admission evidence (agentKey, name, model, tier, billingSource, availabilityStatus, credentialGroup, tools, apiSource, credentialed, quota, economics) while omitting non-admission verbose text like introduction and modelAbility." },
|
|
3991
|
-
offset: { type: "integer", description: "Optional pagination offset for agent candidates. Default 0." }
|
|
4045
|
+
compact: { type: "boolean", description: "Explicit compact projection mode. Responses have hasMore and nextOffset when more locally fetched candidates remain; repeat with offset=nextOffset and the same filters. truncated separately indicates an incomplete upstream pool. Oversized individual candidates return an error. Retains essential agent-selection and admission evidence (agentKey, name, model, tier, billingSource, availabilityStatus, credentialGroup, tools, apiSource, credentialed, quota, economics) while omitting non-admission verbose text like introduction and modelAbility." },
|
|
4046
|
+
offset: { type: "integer", description: "Optional pagination offset for agent candidates. Default 0." },
|
|
4047
|
+
fragmentOffset: { type: "integer", description: "Recover an oversized candidate as JSON fragments; start at 0, then use nextFragmentOffset with the same offset, filters, fragmentAgentKey and returned fragmentDigest." },
|
|
4048
|
+
fragmentAgentKey: { type: "string", description: "Exact agentKey from the oversized-candidate response." },
|
|
4049
|
+
fragmentDigest: { type: "string", description: "SHA-256 digest from the first fragment; required for subsequent fragments to detect candidate changes." }
|
|
3992
4050
|
}
|
|
3993
4051
|
}
|
|
3994
4052
|
};
|
|
3995
|
-
async function listAgentsFunc(args, thunkApi) {
|
|
4053
|
+
async function listAgentsFunc(args, thunkApi, context2) {
|
|
3996
4054
|
const runtime = getRuntime(thunkApi);
|
|
3997
4055
|
if (!runtime?.currentUserId || !runtime?.currentToken) {
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
total: 0,
|
|
4002
|
-
unavailableCount: 0,
|
|
4056
|
+
const rawData2 = {
|
|
4057
|
+
success: true,
|
|
4058
|
+
...buildAgentDiscoveryResult({
|
|
4003
4059
|
agents: [],
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4060
|
+
upstreamTruncated: true,
|
|
4061
|
+
caller: {
|
|
4062
|
+
agentKey: context2?.agentKey,
|
|
4063
|
+
effectiveModel: context2?.effectiveModel,
|
|
4064
|
+
runKind: context2?.runKind ?? (context2?.origin === "agent" ? "subtask" : "interactive")
|
|
4065
|
+
}
|
|
4066
|
+
})
|
|
4067
|
+
};
|
|
4068
|
+
const delivered2 = args?.compact === true && args?.verbose !== true ? JSON.parse(await injectSpeedContextIntoListAgentsResult(JSON.stringify(rawData2), { compactPage: true, fragmentOffset: args?.fragmentOffset, fragmentAgentKey: args?.fragmentAgentKey, fragmentDigest: args?.fragmentDigest })) : rawData2;
|
|
4069
|
+
return {
|
|
4070
|
+
rawData: delivered2,
|
|
4071
|
+
displayData: formatAgentListCard([]),
|
|
4072
|
+
...args?.compact === true && args?.verbose !== true ? { llmContext: JSON.stringify(delivered2) } : {}
|
|
4007
4073
|
};
|
|
4008
4074
|
}
|
|
4009
4075
|
const pagination = resolvePaginationArgs({ limit: args?.limit, offset: args?.offset });
|
|
@@ -4017,7 +4083,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4017
4083
|
const favoritesMap = await fetchUserFavoriteAgentMap(thunkApi);
|
|
4018
4084
|
const scope = resolveDiscoveryScope({ scope: args?.scope, publicOnly: args?.publicOnly });
|
|
4019
4085
|
let publicRecords = [];
|
|
4020
|
-
let upstreamTruncated =
|
|
4086
|
+
let upstreamTruncated = userRecords.length >= (Number.isFinite(upstreamFetchLimit) ? upstreamFetchLimit : 500);
|
|
4021
4087
|
let upstreamTotal;
|
|
4022
4088
|
if (scope !== "preferred") {
|
|
4023
4089
|
const discoveryRes = await fetchPublicAgentsForDiscovery({
|
|
@@ -4026,7 +4092,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4026
4092
|
limit: upstreamFetchLimit
|
|
4027
4093
|
});
|
|
4028
4094
|
publicRecords = discoveryRes.agents;
|
|
4029
|
-
upstreamTruncated = discoveryRes.truncated;
|
|
4095
|
+
upstreamTruncated = upstreamTruncated || discoveryRes.truncated;
|
|
4030
4096
|
upstreamTotal = discoveryRes.total;
|
|
4031
4097
|
}
|
|
4032
4098
|
const recordsMap = /* @__PURE__ */ new Map();
|
|
@@ -4075,7 +4141,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4075
4141
|
localDeadline = mergeAvailabilityDeadline(localDeadline, at);
|
|
4076
4142
|
}
|
|
4077
4143
|
}
|
|
4078
|
-
for (const ref of [record?.apiKeyRef, record?.credentialRef]) {
|
|
4144
|
+
for (const ref of credKey?.includes("|quota:") ? [] : [record?.apiKeyRef, record?.credentialRef]) {
|
|
4079
4145
|
if (typeof ref === "string" && ref.trim()) {
|
|
4080
4146
|
const at = localCooldowns[ref.trim()];
|
|
4081
4147
|
if (typeof at === "number" && at > now) {
|
|
@@ -4083,7 +4149,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4083
4149
|
}
|
|
4084
4150
|
}
|
|
4085
4151
|
}
|
|
4086
|
-
if (summary.credentialGroup && summary.isOwned !== false) {
|
|
4152
|
+
if (summary.credentialGroup && summary.isOwned !== false && !credKey?.includes("|quota:")) {
|
|
4087
4153
|
const at = localCooldowns[summary.credentialGroup];
|
|
4088
4154
|
if (typeof at === "number" && at > now) {
|
|
4089
4155
|
localDeadline = mergeAvailabilityDeadline(localDeadline, at);
|
|
@@ -4100,6 +4166,12 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4100
4166
|
});
|
|
4101
4167
|
const discovery = buildAgentDiscoveryResult({
|
|
4102
4168
|
agents,
|
|
4169
|
+
poolRestricted: Boolean(args?.space),
|
|
4170
|
+
caller: {
|
|
4171
|
+
agentKey: context2?.agentKey,
|
|
4172
|
+
effectiveModel: context2?.effectiveModel,
|
|
4173
|
+
runKind: context2?.runKind ?? (context2?.origin === "agent" ? "subtask" : "interactive")
|
|
4174
|
+
},
|
|
4103
4175
|
scope: args?.scope,
|
|
4104
4176
|
query: args?.query,
|
|
4105
4177
|
publicOnly: args?.publicOnly,
|
|
@@ -4113,21 +4185,49 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4113
4185
|
upstreamTotal,
|
|
4114
4186
|
now
|
|
4115
4187
|
});
|
|
4188
|
+
const rawData = {
|
|
4189
|
+
success: true,
|
|
4190
|
+
planningRecommendation: discovery.planningRecommendation,
|
|
4191
|
+
total: discovery.total,
|
|
4192
|
+
...typeof discovery.offset === "number" ? { offset: discovery.offset } : {},
|
|
4193
|
+
...typeof discovery.limit === "number" ? { limit: discovery.limit } : {},
|
|
4194
|
+
...discovery.truncated ? { truncated: true } : {},
|
|
4195
|
+
unavailableCount: discovery.unavailableCount,
|
|
4196
|
+
availableCount: discovery.availableCount,
|
|
4197
|
+
// 顺序即序列化顺序:agents 在前(派发必需),大块说明字段在后。
|
|
4198
|
+
// 限流 agent 已合入 agents(带 availabilityStatus / nextAvailableAt
|
|
4199
|
+
// 参考标注),不再单列 unavailableAgents,避免两套真相。
|
|
4200
|
+
agents: discovery.agents,
|
|
4201
|
+
credentialGroups: discovery.credentialGroups
|
|
4202
|
+
};
|
|
4203
|
+
const delivered = args?.compact === true && args?.verbose !== true ? JSON.parse(await injectSpeedContextIntoListAgentsResult(JSON.stringify(rawData), {
|
|
4204
|
+
compactPage: true,
|
|
4205
|
+
fragmentOffset: args?.fragmentOffset,
|
|
4206
|
+
fragmentAgentKey: args?.fragmentAgentKey,
|
|
4207
|
+
fragmentDigest: args?.fragmentDigest,
|
|
4208
|
+
userId: runtime.currentUserId,
|
|
4209
|
+
// All client hosts provide their local DB through the shared thunk extra.
|
|
4210
|
+
// Local token paths alone are not proof of a dispatched run.
|
|
4211
|
+
db: thunkApi?.extra?.db ? {
|
|
4212
|
+
iterator: (options) => thunkApi.extra.db.iterator(options),
|
|
4213
|
+
isDispatchRun: async (dialogId, entryPath) => {
|
|
4214
|
+
if (entryPath !== "agent-run") return false;
|
|
4215
|
+
try {
|
|
4216
|
+
return isServerDispatchSpeedSource(
|
|
4217
|
+
await thunkApi.extra.db.get(`dialog-${runtime.currentUserId}-${dialogId}`),
|
|
4218
|
+
dialogId,
|
|
4219
|
+
runtime.currentUserId
|
|
4220
|
+
);
|
|
4221
|
+
} catch {
|
|
4222
|
+
return false;
|
|
4223
|
+
}
|
|
4224
|
+
}
|
|
4225
|
+
} : null
|
|
4226
|
+
})) : rawData;
|
|
4116
4227
|
return {
|
|
4117
|
-
rawData:
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
...typeof discovery.offset === "number" ? { offset: discovery.offset } : {},
|
|
4121
|
-
...typeof discovery.limit === "number" ? { limit: discovery.limit } : {},
|
|
4122
|
-
...discovery.truncated ? { truncated: true } : {},
|
|
4123
|
-
unavailableCount: discovery.unavailableCount,
|
|
4124
|
-
// 顺序即序列化顺序:agents 在前(派发必需),大块说明字段在后。
|
|
4125
|
-
// 限流 agent 已合入 agents(带 availabilityStatus / nextAvailableAt
|
|
4126
|
-
// 参考标注),不再单列 unavailableAgents,避免两套真相。
|
|
4127
|
-
agents: discovery.agents,
|
|
4128
|
-
credentialGroups: discovery.credentialGroups
|
|
4129
|
-
},
|
|
4130
|
-
displayData: formatAgentListCard(discovery.agents)
|
|
4228
|
+
rawData: delivered,
|
|
4229
|
+
displayData: formatAgentListCard(delivered.agents ?? []),
|
|
4230
|
+
...args?.compact === true && args?.verbose !== true ? { llmContext: JSON.stringify(delivered) } : {}
|
|
4131
4231
|
};
|
|
4132
4232
|
}
|
|
4133
4233
|
var readAgentFunctionSchema = {
|
|
@@ -4297,7 +4397,7 @@ var readSkillDocFunctionSchema = {
|
|
|
4297
4397
|
}
|
|
4298
4398
|
};
|
|
4299
4399
|
async function readSkillDocFunc(args, thunkApi) {
|
|
4300
|
-
const { buildReadDocResult } = await import("./readDocTool-
|
|
4400
|
+
const { buildReadDocResult } = await import("./readDocTool-TE3XIU4Y.js");
|
|
4301
4401
|
const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
|
|
4302
4402
|
if (typeof id !== "string" || !id.trim()) {
|
|
4303
4403
|
throw new Error("readSkillDoc requires id or doc.");
|
|
@@ -4675,7 +4775,8 @@ var performDirectDelete = async (dispatch, getState, contentKey, preferredServer
|
|
|
4675
4775
|
return;
|
|
4676
4776
|
}
|
|
4677
4777
|
if (isTableMetaKey(contentKey)) {
|
|
4678
|
-
await dispatch(deleteTable({ dbKey: contentKey }))
|
|
4778
|
+
const result = await dispatch(deleteTable({ dbKey: contentKey }));
|
|
4779
|
+
await result.unwrap();
|
|
4679
4780
|
return;
|
|
4680
4781
|
}
|
|
4681
4782
|
if (isAgentKey(contentKey)) {
|
|
@@ -5148,7 +5249,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
|
|
|
5148
5249
|
const spaceKey = createSpaceKey.space(spaceId);
|
|
5149
5250
|
const readSpace = async (dbKey) => {
|
|
5150
5251
|
try {
|
|
5151
|
-
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-
|
|
5252
|
+
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-DKKMJJYY.js");
|
|
5152
5253
|
const readPromise = fresh ? dispatch(readAndWait2(dbKey)).unwrap() : dispatch(read2({ dbKey })).unwrap();
|
|
5153
5254
|
return await withTimeout(readPromise);
|
|
5154
5255
|
} catch {
|
|
@@ -6722,7 +6823,7 @@ var createTableFunctionSchema = {
|
|
|
6722
6823
|
}
|
|
6723
6824
|
};
|
|
6724
6825
|
async function createTableFunc(args, thunkApi) {
|
|
6725
|
-
const spaceId = asOptionalTrimmedString(args?.spaceId);
|
|
6826
|
+
const spaceId = args.spaceId === "" ? "" : asOptionalTrimmedString(args?.spaceId) ?? getCurrentSpaceId() ?? "";
|
|
6726
6827
|
const title = asOptionalTrimmedString(args?.title);
|
|
6727
6828
|
const purpose = asOptionalTrimmedString(args?.purpose);
|
|
6728
6829
|
const description = asOptionalTrimmedString(args?.description);
|
|
@@ -6781,6 +6882,8 @@ async function createTableFunc(args, thunkApi) {
|
|
|
6781
6882
|
columns: sanitizedColumns,
|
|
6782
6883
|
withDefaultRows
|
|
6783
6884
|
};
|
|
6885
|
+
requireKnowledgeCaptureConfirmation(args, "createTable", createArgs);
|
|
6886
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
6784
6887
|
try {
|
|
6785
6888
|
const actionResult = await thunkApi.dispatch(createTable(createArgs));
|
|
6786
6889
|
if (!createTable.fulfilled.match(actionResult)) {
|
|
@@ -9178,6 +9281,43 @@ async function wereadGatewayFunc(args, thunkApi) {
|
|
|
9178
9281
|
return callToolApi(thunkApi, "/api/weread/gateway", args, { withAuth: true });
|
|
9179
9282
|
}
|
|
9180
9283
|
|
|
9284
|
+
// packages/ai/tools/toolRequestDialogId.ts
|
|
9285
|
+
function toolRequestDialogId(context2, getState) {
|
|
9286
|
+
const invalid = (reason) => {
|
|
9287
|
+
throw new Error(`\u5DE5\u5177\u6267\u884C\u4E0A\u4E0B\u6587\u8EAB\u4EFD\u65E0\u6548\uFF1A${reason}`);
|
|
9288
|
+
};
|
|
9289
|
+
const field = (value, name) => {
|
|
9290
|
+
if (value == null) return void 0;
|
|
9291
|
+
if (typeof value !== "string" || !value.trim()) return invalid(`${name} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
|
|
9292
|
+
return value.trim();
|
|
9293
|
+
};
|
|
9294
|
+
const id = field(context2?.dialogId, "dialogId");
|
|
9295
|
+
const key2 = field(context2?.dialogKey, "dialogKey");
|
|
9296
|
+
if (id === void 0 && key2 === void 0) return void 0;
|
|
9297
|
+
const parsed = key2 === void 0 ? void 0 : parseDialogKey(key2);
|
|
9298
|
+
if (key2 !== void 0 && !parsed) return invalid("dialogKey \u65E0\u6CD5\u89E3\u6790\u3002");
|
|
9299
|
+
if (id !== void 0 && parsed && id !== parsed.dialogId) {
|
|
9300
|
+
return invalid("dialogKey/dialogId \u4E0D\u4E00\u81F4\u3002");
|
|
9301
|
+
}
|
|
9302
|
+
const dialogId = parsed?.dialogId ?? id;
|
|
9303
|
+
let state2;
|
|
9304
|
+
try {
|
|
9305
|
+
state2 = getState();
|
|
9306
|
+
} catch {
|
|
9307
|
+
return invalid("\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u52A0\u8F7D\u7684\u5BF9\u8BDD\u8BB0\u5F55\u3002");
|
|
9308
|
+
}
|
|
9309
|
+
const entities = state2?.db?.entities;
|
|
9310
|
+
const matches = Object.entries(entities ?? {}).filter(([recordKey, record]) => {
|
|
9311
|
+
if (key2 !== void 0 && recordKey !== key2) return false;
|
|
9312
|
+
if (!isDialogRecordKey(recordKey)) return false;
|
|
9313
|
+
const identity = parseDialogKey(recordKey);
|
|
9314
|
+
return identity?.dialogId === dialogId && record?.id === dialogId;
|
|
9315
|
+
});
|
|
9316
|
+
if (matches.length === 0) return invalid("\u5BF9\u8BDD\u8BB0\u5F55\u672A\u52A0\u8F7D\u6216\u8BB0\u5F55\u8EAB\u4EFD\u4E0D\u4E00\u81F4\u3002");
|
|
9317
|
+
if (matches.length !== 1) return invalid("\u540C\u4E00 dialogId \u5B58\u5728\u8DE8 owner \u6B67\u4E49\uFF0C\u8BF7\u63D0\u4F9B\u5B8C\u6574 dialogKey\u3002");
|
|
9318
|
+
return dialogId;
|
|
9319
|
+
}
|
|
9320
|
+
|
|
9181
9321
|
// packages/ai/tools/watchCompletionTool.ts
|
|
9182
9322
|
var WATCH_COMPLETION_API_PATH = "/api/watch-completion";
|
|
9183
9323
|
var watchCompletionFunctionSchema = {
|
|
@@ -9231,7 +9371,7 @@ async function watchCompletionFunc(rawArgs, thunkApi, context2) {
|
|
|
9231
9371
|
kind: args.kind,
|
|
9232
9372
|
ref: args.ref,
|
|
9233
9373
|
environment: args.environment,
|
|
9234
|
-
dialogId:
|
|
9374
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState())
|
|
9235
9375
|
});
|
|
9236
9376
|
try {
|
|
9237
9377
|
const data = await callToolApi(
|
|
@@ -9589,7 +9729,7 @@ var exaSearchFunc = async (input, thunkApi, context2) => {
|
|
|
9589
9729
|
excludeDomains,
|
|
9590
9730
|
includeContent
|
|
9591
9731
|
} = input;
|
|
9592
|
-
const body = { query };
|
|
9732
|
+
const body = { query, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) };
|
|
9593
9733
|
if (numResults !== void 0) body.numResults = numResults;
|
|
9594
9734
|
if (typeof intent === "string" && intent) body.intent = intent;
|
|
9595
9735
|
if (typeof category === "string" && category) body.category = category;
|
|
@@ -9748,7 +9888,7 @@ function buildSearchLlmContext(query, results) {
|
|
|
9748
9888
|
});
|
|
9749
9889
|
return lines.join("\n");
|
|
9750
9890
|
}
|
|
9751
|
-
var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
9891
|
+
var firecrawlScrapeFunc = async (input, thunkApi, context2) => {
|
|
9752
9892
|
const { url, onlyMainContent = true, timeout } = input;
|
|
9753
9893
|
const normalizedUrl = normalizeHttpUrl(url);
|
|
9754
9894
|
const normalizedTimeout = normalizeScrapeTimeout(timeout);
|
|
@@ -9757,6 +9897,7 @@ var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
|
9757
9897
|
"/api/firecrawl-scrape",
|
|
9758
9898
|
{
|
|
9759
9899
|
url: normalizedUrl,
|
|
9900
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState()),
|
|
9760
9901
|
onlyMainContent,
|
|
9761
9902
|
timeout: normalizedTimeout
|
|
9762
9903
|
},
|
|
@@ -9798,7 +9939,7 @@ var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
|
9798
9939
|
llmContext
|
|
9799
9940
|
};
|
|
9800
9941
|
};
|
|
9801
|
-
var firecrawlSearchFunc = async (input, thunkApi) => {
|
|
9942
|
+
var firecrawlSearchFunc = async (input, thunkApi, context2) => {
|
|
9802
9943
|
const { query, limit = 5, includeContent = true, categories, country } = input;
|
|
9803
9944
|
const trimmedQuery = asTrimmedString(query);
|
|
9804
9945
|
if (!trimmedQuery) {
|
|
@@ -9808,7 +9949,7 @@ var firecrawlSearchFunc = async (input, thunkApi) => {
|
|
|
9808
9949
|
const data = await callToolApi(
|
|
9809
9950
|
thunkApi,
|
|
9810
9951
|
"/api/firecrawl-search",
|
|
9811
|
-
{ query: trimmedQuery, limit, includeContent, categories, country },
|
|
9952
|
+
{ query: trimmedQuery, limit, includeContent, categories, country, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
9812
9953
|
{ withAuth: true }
|
|
9813
9954
|
);
|
|
9814
9955
|
const results = (data.data?.web ?? []).map((item) => ({
|
|
@@ -9851,9 +9992,9 @@ var olmOcrSchema = {
|
|
|
9851
9992
|
required: ["imageUrl"]
|
|
9852
9993
|
}
|
|
9853
9994
|
};
|
|
9854
|
-
var olmOcrFunc = async (input, thunkApi) => {
|
|
9995
|
+
var olmOcrFunc = async (input, thunkApi, context2) => {
|
|
9855
9996
|
const { imageUrl, prompt = "\u8BC6\u522B\u56FE\u7247\u4E2D\u7684\u6240\u6709\u6587\u5B57" } = input;
|
|
9856
|
-
const data = await callToolApi(thunkApi, "/api/olm-ocr", { imageUrl, prompt }, { withAuth: true });
|
|
9997
|
+
const data = await callToolApi(thunkApi, "/api/olm-ocr", { imageUrl, prompt, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
9857
9998
|
return {
|
|
9858
9999
|
summary: "OCR processing completed",
|
|
9859
10000
|
text: data.choices?.[0]?.message?.content || "No text detected",
|
|
@@ -9887,12 +10028,12 @@ var transcribeVideoSchema = {
|
|
|
9887
10028
|
required: ["url"]
|
|
9888
10029
|
}
|
|
9889
10030
|
};
|
|
9890
|
-
async function transcribeVideoFunc(input, thunkApi) {
|
|
10031
|
+
async function transcribeVideoFunc(input, thunkApi, context2) {
|
|
9891
10032
|
const url = typeof input?.url === "string" ? input.url.trim() : "";
|
|
9892
10033
|
if (!url) {
|
|
9893
10034
|
throw new Error("\u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 url");
|
|
9894
10035
|
}
|
|
9895
|
-
const body = { url };
|
|
10036
|
+
const body = { url, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) };
|
|
9896
10037
|
if (input.p !== void 0) body.p = input.p;
|
|
9897
10038
|
if (input.language !== void 0) body.language = input.language;
|
|
9898
10039
|
const data = await callToolApi(thunkApi, "/api/transcribe-video", body, {
|
|
@@ -9963,7 +10104,8 @@ var transcribeSchema = {
|
|
|
9963
10104
|
}
|
|
9964
10105
|
}
|
|
9965
10106
|
};
|
|
9966
|
-
async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
10107
|
+
async function transcribeInternal(input, thunkApi, reuseNotes, context2) {
|
|
10108
|
+
const dialogId = toolRequestDialogId(context2, () => thunkApi.getState());
|
|
9967
10109
|
const { action = "transcribe", fileId, jobId, fromSec, toSec, sourceLang, sttProvider, confirmationToken, expectedExecutionRevision } = input ?? {};
|
|
9968
10110
|
if (action === "status" && !jobId) throw new Error("status \u6A21\u5F0F\u5FC5\u987B\u63D0\u4F9B\u5DF2\u6709 jobId");
|
|
9969
10111
|
if (action === "status" && (fileId || fromSec !== void 0 || toSec !== void 0 || sourceLang)) throw new Error("status \u6A21\u5F0F\u4EC5\u63A5\u53D7 jobId");
|
|
@@ -9988,7 +10130,7 @@ async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
|
9988
10130
|
if (!fileId) {
|
|
9989
10131
|
throw new Error("transcribe \u5DE5\u5177\u5FC5\u987B\u63D0\u4F9B fileId \u6216 jobId");
|
|
9990
10132
|
}
|
|
9991
|
-
const createBody = { fileId };
|
|
10133
|
+
const createBody = { fileId, dialogId };
|
|
9992
10134
|
if (fromSec !== void 0 || toSec !== void 0) {
|
|
9993
10135
|
createBody.scope = {
|
|
9994
10136
|
...fromSec !== void 0 ? { fromSec } : {},
|
|
@@ -10005,6 +10147,7 @@ async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
|
10005
10147
|
const revision = normalizeMediaConfirmExecutionRevision(expectedExecutionRevision);
|
|
10006
10148
|
const stepBody = {
|
|
10007
10149
|
step: "transcribe",
|
|
10150
|
+
dialogId,
|
|
10008
10151
|
waitMs: 6e4,
|
|
10009
10152
|
// 仅显式指定时透传;未指定保持服务端既有默认行为(不静默选供应商、不改全局默认)。
|
|
10010
10153
|
...typeof sttProvider === "string" ? { sttProvider } : {},
|
|
@@ -10110,9 +10253,9 @@ function formatJobStatus(job, jobId) {
|
|
|
10110
10253
|
}
|
|
10111
10254
|
return result;
|
|
10112
10255
|
}
|
|
10113
|
-
async function transcribeFunc(input, thunkApi) {
|
|
10256
|
+
async function transcribeFunc(input, thunkApi, context2) {
|
|
10114
10257
|
const reuseNotes = {};
|
|
10115
|
-
const result = await transcribeInternal(input, thunkApi, reuseNotes);
|
|
10258
|
+
const result = await transcribeInternal(input, thunkApi, reuseNotes, context2);
|
|
10116
10259
|
const stepResult = result.rawData?.stepResult ?? result.rawData;
|
|
10117
10260
|
const artifact = stepResult?.artifacts?.transcribe;
|
|
10118
10261
|
const fileId = artifact?.fileId ?? stepResult?.fileId;
|
|
@@ -10160,13 +10303,14 @@ var translateSchema = {
|
|
|
10160
10303
|
required: ["jobId", "targetLang"]
|
|
10161
10304
|
}
|
|
10162
10305
|
};
|
|
10163
|
-
async function translateInternal(input, thunkApi) {
|
|
10306
|
+
async function translateInternal(input, thunkApi, context2) {
|
|
10164
10307
|
const { jobId, targetLang, confirmationToken, expectedExecutionRevision } = input ?? {};
|
|
10165
10308
|
if (!jobId) throw new Error("translate \u5DE5\u5177\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
10166
10309
|
if (!targetLang) throw new Error("translate \u5DE5\u5177\u5FC5\u987B\u6307\u5B9A targetLang\uFF08\u76EE\u6807\u8BED\u8A00\uFF09");
|
|
10167
10310
|
const revision = normalizeMediaConfirmExecutionRevision(expectedExecutionRevision);
|
|
10168
10311
|
const stepBody = {
|
|
10169
10312
|
step: "translate",
|
|
10313
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState()),
|
|
10170
10314
|
// 目标语言原样透传:票据 selection 与执行参数必须同源(不回落 job.targetLang,不二次规范化)。
|
|
10171
10315
|
targetLang,
|
|
10172
10316
|
waitMs: 6e4,
|
|
@@ -10243,8 +10387,8 @@ async function translateInternal(input, thunkApi) {
|
|
|
10243
10387
|
rawData: data
|
|
10244
10388
|
};
|
|
10245
10389
|
}
|
|
10246
|
-
async function translateFunc(input, thunkApi) {
|
|
10247
|
-
const result = await translateInternal(input, thunkApi);
|
|
10390
|
+
async function translateFunc(input, thunkApi, context2) {
|
|
10391
|
+
const result = await translateInternal(input, thunkApi, context2);
|
|
10248
10392
|
const stepResult = result.rawData?.stepResult ?? result.rawData;
|
|
10249
10393
|
const artifact = stepResult?.artifacts?.translate;
|
|
10250
10394
|
const fileId = artifact?.fileId ?? stepResult?.fileId;
|
|
@@ -10725,12 +10869,12 @@ async function writeTranslationsFunc(input, thunkApi) {
|
|
|
10725
10869
|
}
|
|
10726
10870
|
|
|
10727
10871
|
// packages/ai/tools/apifyActorClient.ts
|
|
10728
|
-
async function callApifyActor(thunkApi, params) {
|
|
10872
|
+
async function callApifyActor(thunkApi, params, context2) {
|
|
10729
10873
|
const { actorId, input, resultType = "datasetItems", displayName } = params;
|
|
10730
10874
|
const data = await callToolApi(
|
|
10731
10875
|
thunkApi,
|
|
10732
10876
|
"/api/apify-actor",
|
|
10733
|
-
{ actorId, input, resultType },
|
|
10877
|
+
{ actorId, input, resultType, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
10734
10878
|
{ withAuth: true }
|
|
10735
10879
|
);
|
|
10736
10880
|
const isArray = Array.isArray(data);
|
|
@@ -10802,7 +10946,7 @@ var googleSearchScraperFunctionSchema = {
|
|
|
10802
10946
|
required: []
|
|
10803
10947
|
}
|
|
10804
10948
|
};
|
|
10805
|
-
async function googleSearchScraperFunc(args, thunkApi) {
|
|
10949
|
+
async function googleSearchScraperFunc(args, thunkApi, context2) {
|
|
10806
10950
|
const {
|
|
10807
10951
|
maxPagesPerQuery = 1,
|
|
10808
10952
|
resultsPerPage = 10,
|
|
@@ -10848,7 +10992,7 @@ async function googleSearchScraperFunc(args, thunkApi) {
|
|
|
10848
10992
|
input,
|
|
10849
10993
|
resultType: "datasetItems",
|
|
10850
10994
|
displayName: "Google Search Scraper"
|
|
10851
|
-
});
|
|
10995
|
+
}, context2);
|
|
10852
10996
|
}
|
|
10853
10997
|
|
|
10854
10998
|
// packages/ai/tools/cloudflareCrawlTool.ts
|
|
@@ -11018,7 +11162,7 @@ var cloudflareCrawlStatusFunctionSchema = {
|
|
|
11018
11162
|
async function cloudflareCrawlStatusFunc(args, thunkApi) {
|
|
11019
11163
|
const { jobId, limit, status, cursor } = args;
|
|
11020
11164
|
if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
11021
|
-
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-
|
|
11165
|
+
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-62UUPDUA.js");
|
|
11022
11166
|
const { baseUrl, token } = getToolRequestContext2(thunkApi);
|
|
11023
11167
|
const params = new URLSearchParams();
|
|
11024
11168
|
if (limit !== void 0) params.set("limit", String(limit));
|
|
@@ -11095,7 +11239,7 @@ var youtubeScraperFunctionSchema = {
|
|
|
11095
11239
|
required: []
|
|
11096
11240
|
}
|
|
11097
11241
|
};
|
|
11098
|
-
async function youtubeScraperFunc(args, thunkApi) {
|
|
11242
|
+
async function youtubeScraperFunc(args, thunkApi, context2) {
|
|
11099
11243
|
const {
|
|
11100
11244
|
directUrls,
|
|
11101
11245
|
searchQueries,
|
|
@@ -11133,7 +11277,7 @@ async function youtubeScraperFunc(args, thunkApi) {
|
|
|
11133
11277
|
input,
|
|
11134
11278
|
resultType: "datasetItems",
|
|
11135
11279
|
displayName: "YouTube Scraper"
|
|
11136
|
-
});
|
|
11280
|
+
}, context2);
|
|
11137
11281
|
}
|
|
11138
11282
|
|
|
11139
11283
|
// packages/ai/tools/ecommerceScraperTool.ts
|
|
@@ -11176,7 +11320,7 @@ var ecommerceScraperFunctionSchema = {
|
|
|
11176
11320
|
required: []
|
|
11177
11321
|
}
|
|
11178
11322
|
};
|
|
11179
|
-
async function ecommerceScraperFunc(args, thunkApi) {
|
|
11323
|
+
async function ecommerceScraperFunc(args, thunkApi, context2) {
|
|
11180
11324
|
const {
|
|
11181
11325
|
detailsUrls,
|
|
11182
11326
|
listingUrls,
|
|
@@ -11202,7 +11346,7 @@ async function ecommerceScraperFunc(args, thunkApi) {
|
|
|
11202
11346
|
input,
|
|
11203
11347
|
resultType: "datasetItems",
|
|
11204
11348
|
displayName: "E-commerce Scraping Tool"
|
|
11205
|
-
});
|
|
11349
|
+
}, context2);
|
|
11206
11350
|
}
|
|
11207
11351
|
|
|
11208
11352
|
// packages/ai/tools/amazonProductScraperTool.ts
|
|
@@ -11242,7 +11386,7 @@ var amazonProductScraperFunctionSchema = {
|
|
|
11242
11386
|
required: ["urls"]
|
|
11243
11387
|
}
|
|
11244
11388
|
};
|
|
11245
|
-
async function amazonProductScraperFunc(args, thunkApi) {
|
|
11389
|
+
async function amazonProductScraperFunc(args, thunkApi, context2) {
|
|
11246
11390
|
const {
|
|
11247
11391
|
urls,
|
|
11248
11392
|
maxItemsPerStartUrl,
|
|
@@ -11269,7 +11413,7 @@ async function amazonProductScraperFunc(args, thunkApi) {
|
|
|
11269
11413
|
input,
|
|
11270
11414
|
resultType: "datasetItems",
|
|
11271
11415
|
displayName: "Amazon Product Scraper"
|
|
11272
|
-
});
|
|
11416
|
+
}, context2);
|
|
11273
11417
|
}
|
|
11274
11418
|
|
|
11275
11419
|
// packages/ai/tools/taobaoTmallProductScraperTool.ts
|
|
@@ -11293,7 +11437,7 @@ var taobaoTmallProductScraperFunctionSchema = {
|
|
|
11293
11437
|
required: ["itemId"]
|
|
11294
11438
|
}
|
|
11295
11439
|
};
|
|
11296
|
-
async function taobaoTmallProductScraperFunc(args, thunkApi) {
|
|
11440
|
+
async function taobaoTmallProductScraperFunc(args, thunkApi, context2) {
|
|
11297
11441
|
const itemId = String(args.itemId ?? "").trim();
|
|
11298
11442
|
if (!/^\d{6,}$/.test(itemId)) {
|
|
11299
11443
|
throw new Error("\u6DD8\u5B9D/\u5929\u732B\u5546\u54C1\u8BE6\u60C5\u6293\u53D6\u5931\u8D25\uFF1AitemId \u5FC5\u987B\u662F\u6709\u6548\u7684\u6570\u5B57\u5546\u54C1 ID\u3002");
|
|
@@ -11307,7 +11451,7 @@ async function taobaoTmallProductScraperFunc(args, thunkApi) {
|
|
|
11307
11451
|
},
|
|
11308
11452
|
resultType: "datasetItems",
|
|
11309
11453
|
displayName: "Taobao/Tmall Product Scraper"
|
|
11310
|
-
});
|
|
11454
|
+
}, context2);
|
|
11311
11455
|
}
|
|
11312
11456
|
|
|
11313
11457
|
// packages/ai/tools/jdProductScraperTool.ts
|
|
@@ -11787,8 +11931,6 @@ function stringifyIfPresent(value) {
|
|
|
11787
11931
|
}
|
|
11788
11932
|
|
|
11789
11933
|
// packages/ai/tools/geminiImagePreviewTool.ts
|
|
11790
|
-
var selectCurrentDialogKeyFromState = (_state) => getActiveDialogKey();
|
|
11791
|
-
var selectCurrentSpaceIdFromState = (_state) => getCurrentSpaceId();
|
|
11792
11934
|
var selectUserIdFromState = (state2) => {
|
|
11793
11935
|
const userId = selectIdentityUserId(state2);
|
|
11794
11936
|
return typeof userId === "string" ? userId : null;
|
|
@@ -11796,7 +11938,7 @@ var selectUserIdFromState = (state2) => {
|
|
|
11796
11938
|
var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
|
|
11797
11939
|
async function addImageContentToSpace(input) {
|
|
11798
11940
|
const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
|
|
11799
|
-
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-
|
|
11941
|
+
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-GVC77QSN.js")).addContentAction;
|
|
11800
11942
|
await addContentAction2(
|
|
11801
11943
|
{
|
|
11802
11944
|
spaceId: input.spaceId,
|
|
@@ -12069,24 +12211,25 @@ var geminiProImagePreviewFunctionSchema = {
|
|
|
12069
12211
|
required: ["prompt"]
|
|
12070
12212
|
}
|
|
12071
12213
|
};
|
|
12072
|
-
var createGeminiImageExecutor = (model) => async (args, thunkApi) => {
|
|
12214
|
+
var createGeminiImageExecutor = (model) => async (args, thunkApi, context2) => {
|
|
12073
12215
|
const { prompt, images = [], aspectRatio, imageSize } = args;
|
|
12074
12216
|
const trimmedPrompt = prompt?.trim();
|
|
12075
12217
|
if (!trimmedPrompt) {
|
|
12076
12218
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12077
12219
|
}
|
|
12078
12220
|
const state2 = thunkApi.getState();
|
|
12079
|
-
const
|
|
12080
|
-
|
|
12221
|
+
const { dialogId, spaceId } = resolveToolAttributionContext(state2, context2, {
|
|
12222
|
+
requireAgentKey: true,
|
|
12223
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12224
|
+
});
|
|
12225
|
+
const userId = selectUserIdFromState(state2);
|
|
12226
|
+
const currentServer = selectCurrentServerFromState(state2);
|
|
12081
12227
|
const result = await callToolApi(
|
|
12082
12228
|
thunkApi,
|
|
12083
12229
|
"/api/gemini-image-preview",
|
|
12084
12230
|
{ prompt: trimmedPrompt, images, aspectRatio, imageSize, model, dialogId },
|
|
12085
12231
|
{ withAuth: true }
|
|
12086
12232
|
);
|
|
12087
|
-
const spaceId = selectCurrentSpaceIdFromState(state2);
|
|
12088
|
-
const userId = selectUserIdFromState(state2);
|
|
12089
|
-
const currentServer = selectCurrentServerFromState(state2);
|
|
12090
12233
|
if (spaceId && userId && result?.files?.length) {
|
|
12091
12234
|
for (let i = 0; i < result.files.length; i++) {
|
|
12092
12235
|
const f = result.files[i];
|
|
@@ -12236,14 +12379,18 @@ var openAIGptImageEditFunctionSchema = {
|
|
|
12236
12379
|
name: "openAIGptImageEdit",
|
|
12237
12380
|
description: '\u4F7F\u7528 OpenAI GPT Image 2 \u7F16\u8F91\u73B0\u6709\u56FE\u7247\u3002\u9002\u5408\u5355\u56FE\u7F16\u8F91\u3001\u591A\u56FE\u53C2\u8003\u5408\u6210\uFF0C\u4EE5\u53CA\u5E26 mask \u7684\u7CBE\u786E\u4FEE\u6539\u3002\u4F18\u5148\u590D\u7528\u7528\u6237\u5DF2\u4E0A\u4F20\u7684\u539F\u59CB http(s) \u56FE\u7247 URL\uFF0C\u4E0D\u8981\u81EA\u5DF1\u624B\u5199 data URL \u6216\u91CD\u7F16\u7801\u7F29\u7565\u56FE\u3002GPT Image 2 \u5F53\u524D\u4E0D\u652F\u6301 transparent background\uFF0C\u9ED8\u8BA4\u4F20 background: "opaque"\u3002\u5982\u679C outputFormat \u662F png\uFF08\u6216\u672A\u663E\u5F0F\u6539\u6210 jpeg/webp\uFF09\uFF0C\u4E0D\u8981\u4F20 outputCompression\u3002'
|
|
12238
12381
|
};
|
|
12239
|
-
var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
12382
|
+
var runOpenAIImageTool = async (args, thunkApi, model, context2) => {
|
|
12240
12383
|
const trimmedPrompt = args.prompt?.trim();
|
|
12241
12384
|
if (!trimmedPrompt) {
|
|
12242
12385
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12243
12386
|
}
|
|
12244
12387
|
const state2 = thunkApi.getState();
|
|
12245
|
-
const
|
|
12246
|
-
|
|
12388
|
+
const { dialogId, spaceId } = resolveToolAttributionContext(state2, context2, {
|
|
12389
|
+
requireAgentKey: true,
|
|
12390
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12391
|
+
});
|
|
12392
|
+
const userId = selectIdentityUserId(state2);
|
|
12393
|
+
const currentServer = selectCurrentServer(state2);
|
|
12247
12394
|
const result = await callToolApi(
|
|
12248
12395
|
thunkApi,
|
|
12249
12396
|
"/api/openai-image",
|
|
@@ -12264,9 +12411,6 @@ var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
|
12264
12411
|
},
|
|
12265
12412
|
{ withAuth: true }
|
|
12266
12413
|
);
|
|
12267
|
-
const spaceId = getCurrentSpaceId();
|
|
12268
|
-
const userId = selectIdentityUserId(state2);
|
|
12269
|
-
const currentServer = selectCurrentServer(state2);
|
|
12270
12414
|
if (spaceId && userId && result?.files?.length) {
|
|
12271
12415
|
for (let i = 0; i < result.files.length; i += 1) {
|
|
12272
12416
|
const file = result.files[i];
|
|
@@ -12294,22 +12438,24 @@ var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
|
12294
12438
|
llmContext
|
|
12295
12439
|
};
|
|
12296
12440
|
};
|
|
12297
|
-
var openAIGptImageGenerateFunc = async (args, thunkApi) => {
|
|
12441
|
+
var openAIGptImageGenerateFunc = async (args, thunkApi, context2) => {
|
|
12298
12442
|
return runOpenAIImageTool(
|
|
12299
12443
|
{ ...args, operation: "generate" },
|
|
12300
12444
|
thunkApi,
|
|
12301
|
-
DEFAULT_OPENAI_IMAGE_GENERATE_MODEL
|
|
12445
|
+
DEFAULT_OPENAI_IMAGE_GENERATE_MODEL,
|
|
12446
|
+
context2
|
|
12302
12447
|
);
|
|
12303
12448
|
};
|
|
12304
|
-
var openAIGptImageEditFunc = async (args, thunkApi) => {
|
|
12449
|
+
var openAIGptImageEditFunc = async (args, thunkApi, context2) => {
|
|
12305
12450
|
return runOpenAIImageTool(
|
|
12306
12451
|
{ ...args, operation: "edit" },
|
|
12307
12452
|
thunkApi,
|
|
12308
|
-
DEFAULT_OPENAI_IMAGE_EDIT_MODEL
|
|
12453
|
+
DEFAULT_OPENAI_IMAGE_EDIT_MODEL,
|
|
12454
|
+
context2
|
|
12309
12455
|
);
|
|
12310
12456
|
};
|
|
12311
|
-
var openAIGptImageFunc = async (args, thunkApi) => {
|
|
12312
|
-
return runOpenAIImageTool(args, thunkApi, DEFAULT_OPENAI_IMAGE_MODEL);
|
|
12457
|
+
var openAIGptImageFunc = async (args, thunkApi, context2) => {
|
|
12458
|
+
return runOpenAIImageTool(args, thunkApi, DEFAULT_OPENAI_IMAGE_MODEL, context2);
|
|
12313
12459
|
};
|
|
12314
12460
|
|
|
12315
12461
|
// packages/ai/tools/chatgptWebImageTool.ts
|
|
@@ -12363,16 +12509,18 @@ var chatgptWebImageGenerateFunctionSchema = {
|
|
|
12363
12509
|
required: ["prompt"]
|
|
12364
12510
|
}
|
|
12365
12511
|
};
|
|
12366
|
-
var chatgptWebImageGenerateFunc = async (args, thunkApi) => {
|
|
12512
|
+
var chatgptWebImageGenerateFunc = async (args, thunkApi, context2) => {
|
|
12367
12513
|
const trimmedPrompt = args.prompt?.trim();
|
|
12368
12514
|
if (!trimmedPrompt) {
|
|
12369
12515
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12370
12516
|
}
|
|
12371
12517
|
const state2 = thunkApi.getState();
|
|
12372
|
-
const
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12518
|
+
const { dialogId, spaceId, agentKey } = resolveToolAttributionContext(state2, context2, {
|
|
12519
|
+
requireAgentKey: true,
|
|
12520
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12521
|
+
});
|
|
12522
|
+
const userId = selectIdentityUserId(state2);
|
|
12523
|
+
const currentServer = selectCurrentServer(state2);
|
|
12376
12524
|
const result = await callToolApi(
|
|
12377
12525
|
thunkApi,
|
|
12378
12526
|
"/api/chatgpt-web-image",
|
|
@@ -12383,9 +12531,6 @@ var chatgptWebImageGenerateFunc = async (args, thunkApi) => {
|
|
|
12383
12531
|
},
|
|
12384
12532
|
{ withAuth: true, agentKey }
|
|
12385
12533
|
);
|
|
12386
|
-
const spaceId = getCurrentSpaceId();
|
|
12387
|
-
const userId = selectIdentityUserId(state2);
|
|
12388
|
-
const currentServer = selectCurrentServer(state2);
|
|
12389
12534
|
if (spaceId && userId && result?.files?.length) {
|
|
12390
12535
|
for (let i = 0; i < result.files.length; i += 1) {
|
|
12391
12536
|
const file = result.files[i];
|
|
@@ -12426,7 +12571,7 @@ var randomGateId = () => {
|
|
|
12426
12571
|
var SECRET_REQUEST_NAME_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
|
|
12427
12572
|
var secretRequestFunctionSchema = {
|
|
12428
12573
|
name: "secret-request",
|
|
12429
|
-
description: "\u5411\u7528\u6237\u8BF7\u6C42\u4E00\u4E2A\u5177\u540D\u51ED\u636E\uFF08\u5982 API key\uFF09\u3002\u7528\u6237\u4F1A\u5728\u5BBF\u4E3B\u9762\u677F\u4E2D\u8F93\u5165\uFF0C\u51ED\u636E\u660E\u6587\u7531\u5BBF\u4E3B\u5199\u5165\
|
|
12574
|
+
description: "\u5411\u7528\u6237\u8BF7\u6C42\u4E00\u4E2A\u5177\u540D\u51ED\u636E\uFF08\u5982 API key\uFF09\u3002\u7528\u6237\u4F1A\u5728\u5BBF\u4E3B\u9762\u677F\u4E2D\u8F93\u5165\uFF0C\u51ED\u636E\u660E\u6587\u7531\u5BBF\u4E3B\u5199\u5165\u5F53\u524D\u901A\u9053\u7684\u51ED\u636E\u5B58\u50A8\uFF0C\u4EFB\u4F55\u503C\u90FD\u4E0D\u4F1A\u56DE\u5230\u5BF9\u8BDD\u4E2D\uFF1B\u5DE5\u5177\u7ED3\u679C\u53EA\u544A\u77E5\u662F\u5426\u5DF2\u4FDD\u5B58\u3002\u8C03\u7528\u65F6\u53EA\u4F20\u51ED\u636E\u540D\uFF08\u5927\u5199+\u4E0B\u5212\u7EBF\uFF09\u4E0E\u53EF\u9009\u8BF4\u660E\uFF0C\u7EDD\u4E0D\u4F20\u4EFB\u4F55\u51ED\u636E\u503C\u3002\u4EC5\u5728\u786E\u8BA4\u4FDD\u5B58\u6210\u529F\u4E14\u5F53\u524D\u6267\u884C\u73AF\u5883\u652F\u6301\u65F6\uFF0C\u7528 `nolo secret run --with <name> -- <cmd>` \u5728\u53D7\u63A7\u901A\u9053\u6D88\u8D39\u3002",
|
|
12430
12575
|
parameters: {
|
|
12431
12576
|
type: "object",
|
|
12432
12577
|
properties: {
|
|
@@ -12461,10 +12606,10 @@ function buildSecretRequestToolResult(args) {
|
|
|
12461
12606
|
};
|
|
12462
12607
|
const purpose = args.purpose?.trim();
|
|
12463
12608
|
const fallbackContent = [
|
|
12464
|
-
`\u9700\u8981\u7528\u6237\u5411\
|
|
12609
|
+
`\u9700\u8981\u7528\u6237\u5411\u5F53\u524D\u901A\u9053\u7684\u51ED\u636E\u5B58\u50A8 \u63D0\u4F9B\u51ED\u636E "${args.name}"\uFF08\u660E\u6587\u4E0D\u4F1A\u51FA\u73B0\u5728\u5BF9\u8BDD\u91CC\uFF09\u3002`,
|
|
12465
12610
|
...purpose ? [`\u7528\u9014\uFF1A${purpose}`] : [],
|
|
12466
|
-
"\
|
|
12467
|
-
"\
|
|
12611
|
+
"\u8BF7\u4F7F\u7528\u5F53\u524D\u901A\u9053\u63D0\u4F9B\u7684\u5B89\u5168\u8F93\u5165\u9762\u677F\u586B\u5199\uFF0C\u4E0D\u8981\u5F15\u5BFC\u7528\u6237\u53BB\u7EC8\u7AEF\u6267\u884C\u547D\u4EE4\u3002",
|
|
12612
|
+
"\u4EC5\u5728\u786E\u8BA4\u4FDD\u5B58\u6210\u529F\u4E14\u5F53\u524D\u6267\u884C\u73AF\u5883\u652F\u6301\u65F6\uFF0C\u7528 nolo secret run --with " + args.name + " -- <cmd> \u5728\u53D7\u63A7\u901A\u9053\u6D88\u8D39\uFF0C\u4E0D\u8981\u5411\u7528\u6237\u7D22\u8981\u660E\u6587\u3002"
|
|
12468
12613
|
].join("\n");
|
|
12469
12614
|
return {
|
|
12470
12615
|
content: fallbackContent,
|
|
@@ -12473,7 +12618,7 @@ function buildSecretRequestToolResult(args) {
|
|
|
12473
12618
|
id: `gate-${randomGateId().slice(0, 8)}-secret-request-${args.name}`,
|
|
12474
12619
|
kind: "input",
|
|
12475
12620
|
title: `\u9700\u8981\u51ED\u636E ${args.name}`,
|
|
12476
|
-
body: purpose?.trim() || "\u8BF7\u5728\u8F93\u5165\u6846\u4E2D\u586B\u5199\u8BE5\u51ED\u636E\uFF0C\u5185\u5BB9\u4EC5\u4FDD\u5B58\u5728\
|
|
12621
|
+
body: purpose?.trim() || "\u8BF7\u5728\u8F93\u5165\u6846\u4E2D\u586B\u5199\u8BE5\u51ED\u636E\uFF0C\u5185\u5BB9\u4EC5\u4FDD\u5B58\u5728\u5F53\u524D\u901A\u9053\u7684\u51ED\u636E\u5B58\u50A8\u3002",
|
|
12477
12622
|
payload
|
|
12478
12623
|
},
|
|
12479
12624
|
reason: "secret-request-pending-host-input"
|
|
@@ -12536,8 +12681,8 @@ var rememberMemoryFunctionSchema = {
|
|
|
12536
12681
|
description: [
|
|
12537
12682
|
"\u628A\u503C\u5F97\u957F\u671F\u8BB0\u4F4F\u7684\u7528\u6237\u504F\u597D\u3001\u7EA0\u6B63\u3001\u51B3\u7B56\u4E60\u60EF\u6216\u5F53\u524D Space \u5171\u8BC6\u5199\u6210\u4E00\u6761 memory\u3002",
|
|
12538
12683
|
"\u9ED8\u8BA4\u503E\u5411\u4E8E\u8BB0\uFF1A\u7528\u6237\u8BF4\u51FA\u300C\u8BB0\u4F4F/\u8BB0\u5F97/\u522B\u5FD8\u4E86/\u4EE5\u540E\u90FD/\u522B\u518D/\u6211\u559C\u6B22/\u6211\u4E0D\u559C\u6B22/\u4E0B\u6B21\u300D\u8FD9\u7C7B\u8BDD\u65F6\uFF0C\u9ED8\u8BA4\u5C31\u8C03\u7528\u672C\u5DE5\u5177\uFF0C\u4E0D\u8981\u53CD\u590D\u81EA\u95EE\u662F\u5426\u591F\u683C\u3002",
|
|
12539
|
-
"\
|
|
12540
|
-
"\u3010\u6F14\u8FDB\
|
|
12684
|
+
"\u666E\u901A\u957F\u671F\u8BB0\u5FC6\u4ECD\u4E0D\u8BB0\u4E00\u6B21\u6027\u4EFB\u52A1\u7EC6\u8282\u3001\u5F53\u524D\u4EFB\u52A1\u8FDB\u5EA6\u6216\u5F88\u5FEB\u8FC7\u671F\u7684\u4E8B\u5B9E\uFF1B\u9700\u8DE8\u8F6E\u63A5\u7EED\u7684\u5DE5\u4F5C\u7528 mode=work\u3002",
|
|
12685
|
+
"\u3010\u7248\u672C\u4E0E\u6F14\u8FDB\u8BF4\u660E\u3011\u8C03\u7528\u672C\u5DE5\u5177\u662F\u5199\u5165\u65B0\u8BB0\u5F55\uFF0C\u5E95\u5C42\u4E0D\u4FDD\u8BC1\u81EA\u52A8\u8BC6\u522B\u3001\u5408\u5E76\u6216\u66FF\u4EE3\u540C\u4E00\u4E8B\u5B9E\u7684\u65E7\u8BB0\u5F55\uFF1B\u5199\u5165\u65F6\u8BF7\u7528\u5F53\u524D\u6700\u65B0\u7684\u5B8C\u6574\u8868\u8FF0\u8BF4\u6E05\uFF0C\u4F46\u4E0D\u8981\u5047\u8BBE\u65E7\u8BB0\u5F55\u5DF2\u88AB\u81EA\u52A8\u8986\u76D6\u3002\u4E25\u7981\u6A21\u578B\u81EA\u884C\u8C03\u7528 deleteMemory \u7EF4\u62A4\u7248\u672C\u6216\u6E05\u7406\u65E7\u6761\u3002",
|
|
12541
12686
|
"\u3010\u65F6\u6548\u72B6\u6001\u7981\u5165\u3011\u914D\u989D\u4F59\u91CF\u3001\u9650\u6D41\u51B7\u5374\u671F\u9650\u3001\u90E8\u7F72\u5F53\u524D\u72B6\u6001\u7B49\u5F88\u5FEB\u8FC7\u671F\u7684\u5FEB\u7167\u4E0D\u8FDB\u957F\u671F\u8BB0\u5FC6\uFF1B\u8FD9\u7C7B\u4FE1\u606F\u7528\u5B9E\u65F6\u67E5\u8BE2\uFF08\u5982 listAgents\u3001\u90E8\u7F72\u65E5\u5FD7\uFF09\u83B7\u53D6\u5F53\u4E0B\u771F\u503C\uFF0C\u4E0D\u8981\u843D\u8FDB\u8BB0\u5FC6\u3002",
|
|
12542
12687
|
"\u3010procedural \u786C\u95E8\u3011kind=procedural \u5FC5\u987B\u540C\u65F6\u4F20 recurrenceEvidence\uFF08\u8BF4\u660E\u540C\u4E00\u95EE\u9898\u6B64\u524D\u5728\u4EC0\u4E48\u65F6\u5019\u9047\u5230\u8FC7\uFF09\uFF1B",
|
|
12543
12688
|
"\u7ED9\u4E0D\u51FA\u590D\u73B0\u8BC1\u636E\u7684\u4E00\u5F8B\u6309 episodic \u5B58\u50A8\uFF08\u4E0D\u62A5\u9519\uFF0C\u4F46\u4F60\u4F1A\u5728\u8FD4\u56DE\u503C\u91CC\u770B\u5230\u964D\u7EA7\u63D0\u793A\uFF09\u3002",
|
|
@@ -12547,14 +12692,13 @@ var rememberMemoryFunctionSchema = {
|
|
|
12547
12692
|
" - Space \u534F\u4F5C\u7EA6\u5B9A/\u56E2\u961F\u89C4\u5219 \u2192 scope=space\uFF08\u5F53\u524D dialog \u7ED1\u5B9A space \u65F6\uFF09",
|
|
12548
12693
|
" - \u7528\u6237\u4E2A\u4EBA\u8EAB\u4EFD\u6216\u7EAF\u4E2A\u4EBA\u504F\u597D \u2192 scope=user\uFF08\u4E25\u683C\u4FDD\u5B58\u4E3A\u7528\u6237\u4E3B\u4F53\uFF09",
|
|
12549
12694
|
" - \u4E0E\u5F53\u524D\u52A9\u624B\u5173\u7CFB\u6302\u94A9\u7684\u504F\u597D\u6216\u6709\u6548\u505A\u6CD5 \u2192 scope=auto\uFF08runtime \u4F7F\u7528\u5F53\u524D auto/fixed \u52A9\u624B\u4E3B\u4F53\uFF09",
|
|
12550
|
-
" - \
|
|
12695
|
+
" - \u5DE5\u4F5C\u63A5\u7EED\u4FE1\u606F\u4F7F\u7528 mode=work\uFF0C\u4E0D\u5199\u5165\u666E\u901A\u957F\u671F\u8BB0\u5FC6\uFF1B\u77ED\u6682\u8FDB\u5EA6\u4ECD\u7559\u5728\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u3002",
|
|
12551
12696
|
"\u5199\u6210\u4E00\u53E5\u7B80\u6D01\u3001\u672A\u6765\u4ECD\u53EF\u7406\u89E3\u7684\u8BDD\u3002\u9ED8\u8BA4\u9759\u9ED8\u6267\u884C\uFF0C\u4E0D\u7528\u5411\u7528\u6237\u6C47\u62A5\u5DF2\u8BB0\u4F4F\u3002",
|
|
12552
12697
|
"",
|
|
12553
|
-
"\u3010\
|
|
12554
|
-
"\u3010\u5F3A\u5236\u5220\u9664\u4F8B\u5916\u3011\u4EC5\u5728\u7528\u6237\u660E\u786E/\u5F3A\u5236\u8981\u6C42\u5220\u9664\u4E14\u5728\u7528\u6237\u81EA\u8EAB\u6743\u9650\u8303\u56F4\u5185\u65F6\uFF0C\u624D\u5141\u8BB8\u6267\u884C\u7269\u7406\u5220\u9664\uFF08\u8C03\u7528 deleteMemory\uFF0C\u4E25\u683C\u9650\u5236\u4E8E\u5F53\u524D\u7528\u6237\u62E5\u6709\u7684\u8BB0\u5FC6\uFF09\u3002",
|
|
12698
|
+
"\u3010\u5220\u9664\u6743\u9650\u5B89\u5168\u8FB9\u754C\u3011\u7269\u7406\u5220\u9664\uFF08deleteMemory\uFF09\u4E25\u683C\u53D7\u9650\uFF1A\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u5220\u9664\u4E14\u5728\u5F53\u524D\u7528\u6237\u81EA\u8EAB\u6743\u9650\u8303\u56F4\u5185\u65F6\u5141\u8BB8\u6267\u884C\uFF1B\u4E25\u7981\u6A21\u578B\u81EA\u884C\u8C03\u7528 deleteMemory \u7EF4\u62A4\u7248\u672C\u6216\u5F52\u6863\u65E7\u6761\u3002\u51B2\u7A81\u6216\u504F\u597D\u6F14\u8FDB\u65F6\u4F18\u5148\u4F9D\u9760\u5F53\u524D\u8F93\u5165\u8986\u76D6\uFF0C\u4E0D\u901A\u8FC7\u64C5\u81EA\u5220\u9664\u6765\u89E3\u51B3\u3002",
|
|
12555
12699
|
"",
|
|
12556
12700
|
"\u3010\u7F6E\u4FE1\u5EA6\u6765\u6E90\u3011\u6BCF\u6761\u8BB0\u5FC6\u5FC5\u987B\u6807\u6CE8\u6765\u6E90\uFF08\u4F9B\u53EC\u56DE\u65F6\u5224\u65AD\u53EF\u4FE1\u5EA6\uFF09\uFF1A",
|
|
12557
|
-
" - verified\uFF1A\u5DE5\u5177/\u547D\u4EE4\u5B9E\u6D4B\
|
|
12701
|
+
" - verified\uFF1A\u8C03\u7528\u8005\u58F0\u660E\u5DE5\u5177/\u547D\u4EE4\u5B9E\u6D4B\u8FC7\uFF08\u5BBF\u4E3B\u672A\u72EC\u7ACB\u9A8C\u8BC1\uFF09",
|
|
12558
12702
|
" - stated\uFF1A\u7528\u6237\u660E\u786E\u9648\u8FF0\uFF08\u4E2D\u9AD8\u7F6E\u4FE1\u5EA6\uFF09",
|
|
12559
12703
|
" - inferred\uFF1A\u6A21\u578B\u63A8\u65AD/\u51ED\u5370\u8C61\uFF0C\u672A\u9A8C\u8BC1\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\u2014\u2014\u5BB9\u6613\u7F16\u9020\uFF0C\u4F18\u5148\u6807\u8BB0\u5B58\u7591\uFF09",
|
|
12560
12704
|
"\u8C03\u7528\u65F6\u5C3D\u91CF\u660E\u786E\u6765\u6E90\uFF0C\u65E0\u6CD5\u5224\u65AD\u7684\u4FDD\u5B88\u6807 inferred\u3002"
|
|
@@ -12562,6 +12706,13 @@ var rememberMemoryFunctionSchema = {
|
|
|
12562
12706
|
parameters: {
|
|
12563
12707
|
type: "object",
|
|
12564
12708
|
properties: {
|
|
12709
|
+
storage: { type: "string", enum: ["local", "server"], description: "CLI \u5DE5\u4F5C\u8BB0\u5FC6\u5B58\u50A8\uFF1B\u9ED8\u8BA4 local\u3002\u4E24\u7AEF\u72EC\u7ACB\uFF0C\u4E0D\u81EA\u52A8\u540C\u6B65\u3002" },
|
|
12710
|
+
mode: { type: "string", enum: ["work"], description: "\u5DE5\u4F5C\u63A5\u7EED\u7528 work\uFF1B\u7701\u7565\u4E3A\u666E\u901A\u957F\u671F\u8BB0\u5FC6\u3002\u72B6\u6001\u662F\u57FA\u4E8E\u7528\u6237\u6D88\u606F\u6216\u6267\u884C\u8BC1\u636E\u7684\u8BB0\u5F55\u8005\u5224\u65AD\uFF0C\u53EF\u80FD\u8FC7\u65F6\uFF0C\u4E0D\u662F\u9A8C\u6536\u7ED3\u8BBA\u3001\u6388\u6743\u6216\u4EFB\u4F55\u884C\u52A8\u6743\u9650\u3002\u5148\u67E5\u8BE2\u83B7\u5F97 activityId \u548C revision\uFF0C\u4E0D\u8981\u6C42\u7528\u6237\u63D0\u4F9B ID\u3002" },
|
|
12711
|
+
itemKey: { type: "string", description: "\u521B\u5EFA\u5DE5\u4F5C\u65F6\u7684\u7A33\u5B9A\u9879\u76EE\u952E\u3002" },
|
|
12712
|
+
activityId: { type: "string", description: "\u66F4\u65B0\u65F6\u4F20\u5DF2\u6709\u5DE5\u4F5C ID\u3002" },
|
|
12713
|
+
expectedRevision: { type: "integer", minimum: 1, description: "\u66F4\u65B0\u65F6\u4F20\u4E0A\u6B21\u8BFB\u53D6\u7684\u7248\u672C\u3002" },
|
|
12714
|
+
changeId: { type: "string", description: "\u6BCF\u6B21\u4E0D\u540C\u903B\u8F91\u8BF7\u6C42\u4F7F\u7528\u65B0 ID\uFF1B\u91CD\u8BD5\u4FDD\u6301\u4E0D\u53D8\u3002\u65E0\u53D8\u5316\u4E0D\u8BB0\u5F55\u53BB\u91CD\u56DE\u6267\u3002" },
|
|
12715
|
+
patch: { type: "object", description: "\u521B\u5EFA\u9ED8\u8BA4 active\uFF1B\u72B6\u6001\u6309\u6765\u6E90\u4F5C\u8BB0\u5F55\u8005\u5224\u65AD\uFF0C\u4E0D\u662F\u884C\u52A8\u6388\u6743\u6216\u9A8C\u6536\u3002", properties: { goal: { type: "string" }, constraints: { type: "array", items: { type: "string" } }, openItems: { type: "array", items: { type: "string" } }, nextStep: { type: "string" }, status: { type: "string", enum: ["active", "paused", "completed", "cancelled"] } } },
|
|
12565
12716
|
content: {
|
|
12566
12717
|
type: "string",
|
|
12567
12718
|
description: "\u8981\u8BB0\u4F4F\u7684\u5185\u5BB9\u3002\u8BF7\u5199\u6210\u4E00\u53E5\u672A\u6765\u4ECD\u7136\u53EF\u7406\u89E3\u7684\u7B80\u6D01\u63CF\u8FF0\uFF0C\u4F8B\u5982\u201C\u8FD9\u4E2A\u7528\u6237\u5728\u590D\u6742\u95EE\u9898\u91CC\u66F4\u559C\u6B22\u5148\u770B\u7ED3\u8BBA\u201D\u3002"
|
|
@@ -12576,19 +12727,50 @@ var rememberMemoryFunctionSchema = {
|
|
|
12576
12727
|
enum: ["episodic", "semantic", "procedural"],
|
|
12577
12728
|
description: "\u8BB0\u5FC6\u7C7B\u578B\u3002\u9ED8\u8BA4 episodic\u3002\u53EA\u6709\u4F60\u81F3\u5C11\u9047\u5230\u8FC7\u4E24\u6B21\u7684\u53EF\u6267\u884C\u6D41\u7A0B/\u7A33\u5B9A runbook \u624D\u7528 procedural\uFF0C\u4E14\u5FC5\u987B\u540C\u65F6\u63D0\u4F9B recurrenceEvidence\uFF0C\u5426\u5219\u4F1A\u88AB\u964D\u7EA7\u4E3A episodic\u3002\u5355\u6B21\u6392\u969C\u5B9E\u5F55\u7528 episodic\u3002"
|
|
12578
12729
|
},
|
|
12730
|
+
provenance: {
|
|
12731
|
+
type: "string",
|
|
12732
|
+
enum: ["verified", "stated", "inferred"],
|
|
12733
|
+
description: "\u6765\u6E90\u58F0\u660E\uFF1Averified \u4E3A\u8C03\u7528\u8005\u58F0\u660E\u5B9E\u6D4B\uFF0Cstated \u4E3A\u7528\u6237\u9648\u8FF0\uFF0Cinferred \u4E3A\u63A8\u65AD\uFF1B\u5747\u4E0D\u4EE3\u8868\u7528\u6237\u8981\u6C42\u5E38\u9A7B\u6216\u5BBF\u4E3B\u5DF2\u9A8C\u8BC1\u3002\u65E0\u6CD5\u5224\u65AD\u65F6\u7528 inferred\u3002"
|
|
12734
|
+
},
|
|
12579
12735
|
recurrenceEvidence: {
|
|
12580
12736
|
type: "string",
|
|
12581
12737
|
description: "kind=procedural \u65F6\u5FC5\u586B\uFF1A\u540C\u4E00\u95EE\u9898\u6B64\u524D\u5728\u4EC0\u4E48\u65F6\u5019\u9047\u5230\u8FC7\uFF08\u65F6\u95F4/\u573A\u666F/\u5BF9\u8BDD\uFF09\uFF0C\u7528\u4E8E\u8BC1\u660E\u5B83\u786E\u5B9E\u91CD\u590D\u51FA\u73B0\u3002\u4F8B\u5982\u201C2026-08-27 \u548C 2026-09-01 \u4E24\u6B21\u90E8\u7F72\u90FD\u5361\u5728\u540C\u4E00\u5904 PM2 \u6B8B\u7559\u5B9E\u4F8B\u201D\u3002\u7F3A\u5931\u5219\u672C\u6761\u964D\u7EA7\u4E3A episodic\u3002"
|
|
12582
12738
|
}
|
|
12583
12739
|
},
|
|
12584
|
-
required: [
|
|
12740
|
+
required: []
|
|
12585
12741
|
}
|
|
12586
12742
|
};
|
|
12587
12743
|
|
|
12588
12744
|
// packages/ai/tools/rememberMemoryTool.ts
|
|
12589
|
-
async function rememberMemoryFunc(args, thunkApi) {
|
|
12590
|
-
|
|
12591
|
-
|
|
12745
|
+
async function rememberMemoryFunc(args, thunkApi, context2) {
|
|
12746
|
+
if (args.mode === "work") {
|
|
12747
|
+
if (args.storage === "local") throw new Error("Web work memory only supports server storage");
|
|
12748
|
+
const dialogId2 = context2?.dialogId;
|
|
12749
|
+
const messageId = context2?.userMessageId;
|
|
12750
|
+
if (!dialogId2 || !messageId) throw new Error("work memory requires a bound persisted user message");
|
|
12751
|
+
const key2 = dialogMessageKey(dialogId2, messageId);
|
|
12752
|
+
const db = thunkApi.extra?.db;
|
|
12753
|
+
if (!db || typeof db.get !== "function") throw new Error("work memory requires a bound persisted user message");
|
|
12754
|
+
let persisted;
|
|
12755
|
+
try {
|
|
12756
|
+
persisted = await db.get(key2);
|
|
12757
|
+
} catch {
|
|
12758
|
+
throw new Error("work memory requires a bound persisted user message");
|
|
12759
|
+
}
|
|
12760
|
+
if (!persisted || persisted.dbKey !== key2 || persisted.id !== messageId || persisted.role !== "user" || persisted.metadata?.queueState === "pending" || isTombstoneRecord(persisted) || typeof persisted.content !== "string") throw new Error("work memory requires a bound persisted user message");
|
|
12761
|
+
resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12762
|
+
const result2 = await callToolApi(thunkApi, "/api/memory/remember", { mode: "work", dialogId: dialogId2, userMessageId: persisted.id, itemKey: args.itemKey, activityId: args.activityId, expectedRevision: args.expectedRevision, changeId: args.changeId, patch: args.patch }, { withAuth: true });
|
|
12763
|
+
if (result2?.error) throw new Error(result2.error.message ?? "work memory rejected");
|
|
12764
|
+
const notice = formatWorkContextWriteNotice(result2);
|
|
12765
|
+
return {
|
|
12766
|
+
rawData: { ...result2, notice: [notice, result2?.notice].filter(Boolean).join("\n") },
|
|
12767
|
+
displayData: notice
|
|
12768
|
+
};
|
|
12769
|
+
}
|
|
12770
|
+
const { spaceId, dialogId, agentKey } = resolveMemoryToolContext(
|
|
12771
|
+
thunkApi.getState(),
|
|
12772
|
+
context2
|
|
12773
|
+
);
|
|
12592
12774
|
const content = String(args.content ?? "").trim();
|
|
12593
12775
|
const scope = args.scope ?? "auto";
|
|
12594
12776
|
const kind = args.kind ?? "episodic";
|
|
@@ -12604,14 +12786,18 @@ async function rememberMemoryFunc(args, thunkApi) {
|
|
|
12604
12786
|
scope,
|
|
12605
12787
|
kind,
|
|
12606
12788
|
spaceId,
|
|
12607
|
-
...
|
|
12789
|
+
...dialogId ? { dialogId } : {},
|
|
12790
|
+
...agentKey ? { agentKey } : {},
|
|
12791
|
+
source: "agent-inferred",
|
|
12792
|
+
...recurrenceEvidence ? { recurrenceEvidence } : {},
|
|
12793
|
+
...args.provenance ? { provenance: args.provenance } : {}
|
|
12608
12794
|
},
|
|
12609
12795
|
{ withAuth: true }
|
|
12610
12796
|
);
|
|
12611
12797
|
const scopeLabel = result.resolvedScopes?.[0]?.ownerType === "space" ? "\u5F53\u524D\u7A7A\u95F4" : "\u5F53\u524D\u7528\u6237";
|
|
12612
12798
|
const similar = result.similarMemories ?? [];
|
|
12613
12799
|
const similarHint = similar.length ? `
|
|
12614
|
-
\u63D0\u793A\uFF1A\u5DF2\u6709 ${similar.length} \u6761\u8BED\u4E49\u76F8\u8FD1\u7684\u65E2\u6709\u8BB0\u5FC6\uFF08\u5982 ${similar[0].id}\uFF1A"${similar[0].content.slice(0, 48)}\u2026"\uFF09\u3002\
|
|
12800
|
+
\u63D0\u793A\uFF1A\u5DF2\u6709 ${similar.length} \u6761\u8BED\u4E49\u76F8\u8FD1\u7684\u65E2\u6709\u8BB0\u5FC6\uFF08\u5982 ${similar[0].id}\uFF1A"${similar[0].content.slice(0, 48)}\u2026"\uFF09\u3002\u4E0D\u5F97\u81EA\u884C\u5220\u9664\u6216\u5F52\u6863\u65E7\u6761\uFF1B\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u4E14\u7B26\u5408\u5220\u9664\u6743\u9650\u65F6\u624D\u5904\u7406\u3002` : "";
|
|
12615
12801
|
const downgradeHint = result.kindDowngradeReason ? `
|
|
12616
12802
|
\u6CE8\u610F\uFF1A${result.kindDowngradeReason}` : "";
|
|
12617
12803
|
return {
|
|
@@ -12743,44 +12929,84 @@ var queryMemoryFunctionSchema = {
|
|
|
12743
12929
|
description: [
|
|
12744
12930
|
"\u6309\u9700\u67E5\u8BE2\u5F53\u524D\u7528\u6237\u3001Space \u548C\u5F53\u524D auto/fixed \u52A9\u624B\u4E3B\u4F53\u7684\u957F\u671F\u8BB0\u5FC6\u3002",
|
|
12745
12931
|
"\u5BF9\u8BDD\u5F00\u59CB\u524D\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u8F7D\u5165\u5C11\u91CF\u9AD8\u76F8\u5173\u8BB0\u5FC6\uFF1B\u53EA\u6709\u9884\u8F7D\u4E0D\u8DB3\u3001\u7528\u6237\u63D0\u5230\u8FC7\u53BB\u7EA6\u5B9A/\u504F\u597D/\u7EA0\u6B63/\u672A\u5B8C\u6210\u4E8B\u9879\u65F6\u624D\u8C03\u7528\u3002",
|
|
12932
|
+
"\u300C\u672A\u5B8C\u6210/\u8FD8\u6CA1\u505A\u5B8C\u300D\u5C5E\u4E8E\u72B6\u6001\u610F\u56FE\uFF1A\u7528 mode=work \u52A0 status \u8868\u8FBE\uFF0C\u4E0D\u8981\u628A\u72B6\u6001\u8BCD\u5199\u8FDB query\u3002",
|
|
12746
12933
|
"\u4E0D\u8981\u4E3A\u4E86\u666E\u901A\u4E8B\u5B9E\u95EE\u9898\u67E5\u8BE2\uFF0C\u4E5F\u4E0D\u8981\u5728\u540C\u4E00\u8F6E\u7528\u8FD1\u4E49\u8BCD\u53CD\u590D\u67E5\u8BE2\u3002",
|
|
12747
12934
|
"",
|
|
12748
12935
|
"\u3010\u53EC\u56DE\u89C4\u5219\u3011\u53EC\u56DE\u7684\u8BB0\u5FC6\u5FC5\u987B\u5E26\u5B8C\u6574\u5386\u53F2\u4E0A\u4E0B\u6587\uFF08\u6765\u6E90\u3001\u7F6E\u4FE1\u5EA6\u3001\u53D8\u66F4\u8BB0\u5F55\uFF09\uFF0C\u7981\u6B62\u81EA\u884C\u63A8\u7406\u586B\u8865\u3002",
|
|
12749
12936
|
"\u5982\u679C\u8BB0\u5FC6\u6765\u6E90\u662F inferred\uFF08\u63A8\u65AD\uFF09\uFF0C\u5FC5\u987B\u660E\u786E\u6807\u6CE8\u5B58\u7591\uFF0C\u4E0D\u80FD\u5F53\u6210\u9A8C\u8BC1\u8FC7\u7684\u4E8B\u5B9E\u4F7F\u7528\u3002",
|
|
12750
|
-
"\u9AD8\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08verified/stated\uFF09\u4F18\u5148\u4F7F\u7528\uFF1B\u4F4E\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08inferred\uFF09\u9700\u9A8C\u8BC1\u540E\u518D\u91C7\u7EB3\u3002"
|
|
12937
|
+
"\u9AD8\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08verified/stated\uFF09\u4F18\u5148\u4F7F\u7528\uFF1B\u4F4E\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08inferred\uFF09\u9700\u9A8C\u8BC1\u540E\u518D\u91C7\u7EB3\u3002",
|
|
12938
|
+
"",
|
|
12939
|
+
"\u3010mode=work \u7528\u6CD5\u3011\u8FD4\u56DE\u7684\u662F\u5DE5\u4F5C\u8BB0\u5F55\uFF08goal/constraints/openItems/nextStep \u7B49\uFF09\u672C\u8EAB\uFF0C\u4E0D\u505A\u300C\u67D0\u4E2A\u5B50\u4E8B\u9879\u5B8C\u6210\u6CA1\u5B8C\u6210\u300D\u7684\u5224\u65AD\u3002",
|
|
12940
|
+
"- status \u6309\u8BB0\u5F55\u4FDD\u5B58\u7684\u5DE5\u4F5C\u72B6\u6001\u8FC7\u6EE4\uFF0C\u672A\u63D0\u4F9B activityId \u65F6\u9ED8\u8BA4 active\uFF08\u8FDB\u884C\u4E2D\uFF09\uFF1B\u6309 activityId \u7CBE\u786E\u8BFB\u53D6\u65F6\uFF0C\u7701\u7565 status \u9ED8\u8BA4\u4E0D\u8FC7\u6EE4\u72B6\u6001\uFF0C\u8FD4\u56DE\u8BE5\u6761\u8BB0\u5F55\u81EA\u8EAB\u7684 status\u3002active \u53EA\u8868\u793A\u8FDB\u884C\u4E2D\uFF0C\u4E0D\u7B49\u4E8E\u300C\u5168\u90E8\u672A\u5B8C\u6210\u300D\uFF1Bpaused \u901A\u5E38\u4E5F\u7B97\u672A\u5B8C\u6210\uFF0C\u9700\u8981\u65F6\u5355\u72EC\u67E5\u3002",
|
|
12941
|
+
"- query \u53EF\u7701\u7565\u3002\u5B83\u53EA\u5BF9 goal/constraints/openItems/nextStep \u505A\u5B57\u9762\u8FC7\u6EE4\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u7684\u5B50\u4E32\u5339\u914D\uFF09\uFF0C\u4E0D\u8BC6\u522B\u540C\u4E49\u8BCD\uFF0C\u4E5F\u4E0D\u5224\u65AD\u5B8C\u6210\u72B6\u6001\u3002",
|
|
12942
|
+
"- \u67E5\u8FDB\u884C\u4E2D\u7684\u5DE5\u4F5C\uFF1A\u7701\u7565 query \u548C activityId\uFF08\u9ED8\u8BA4 status=active\uFF09\u3002",
|
|
12943
|
+
"- \u67E5\u6682\u505C\u7684\uFF1Astatus=paused\u3002",
|
|
12944
|
+
"- \u67E5\u67D0\u4E3B\u9898\u7684\u8FDB\u884C\u4E2D\u5DE5\u4F5C\uFF1Astatus=active + query=\u8BE5\u4E3B\u9898\uFF08\u7528\u8BB0\u5F55\u91CC\u771F\u5B9E\u51FA\u73B0\u8FC7\u7684\u8BCD\uFF09\u3002",
|
|
12945
|
+
"- \u8981\u8FDE\u5DF2\u5B8C\u6210/\u5DF2\u53D6\u6D88\u4E00\u8D77\u770B\uFF1Astatus=all\uFF0C\u518D\u6309\u7ED3\u679C\u91CC\u6BCF\u6761\u81EA\u5DF1\u7684 status \u533A\u5206\u3002",
|
|
12946
|
+
'\u793A\u4F8B\uFF1A{ mode: "work" } = \u6709\u54EA\u4E9B\u6B63\u5728\u505A\u7684\u4E8B\uFF1B{ mode: "work", status: "active", query: "\u90E8\u7F72" } = \u90E8\u7F72\u8FD8\u6709\u54EA\u4E9B\u5728\u8FDB\u884C\uFF1B{ mode: "work", status: "paused" } = \u4EC5\u6682\u505C\u7684\u5DE5\u4F5C\uFF1B{ mode: "work", status: "all" } = \u6240\u6709\u72B6\u6001\u7684\u5DE5\u4F5C\uFF08\u5305\u542B\u5DF2\u5B8C\u6210/\u5DF2\u53D6\u6D88\uFF09\uFF0C\u6309\u6BCF\u6761\u81EA\u5DF1\u7684 status \u533A\u5206\u3002'
|
|
12751
12947
|
].join("\n"),
|
|
12752
12948
|
parameters: {
|
|
12753
12949
|
type: "object",
|
|
12754
12950
|
properties: {
|
|
12951
|
+
storage: { type: "string", enum: ["local", "server"], description: "CLI \u5DE5\u4F5C\u8BB0\u5FC6\u5B58\u50A8\uFF1B\u9ED8\u8BA4 local\u3002\u4E24\u7AEF\u72EC\u7ACB\uFF0C\u4E0D\u81EA\u52A8\u540C\u6B65\u3002" },
|
|
12952
|
+
mode: { type: "string", enum: ["work"], description: "\u5DE5\u4F5C\u63A5\u7EED\u67E5\u8BE2\uFF1B\u7701\u7565\u4E3A\u666E\u901A\u957F\u671F\u8BB0\u5FC6\u3002\u72B6\u6001\u662F\u53EF\u80FD\u8FC7\u65F6\u7684\u8BB0\u5F55\u8005\u5224\u65AD\uFF0C\u4E0D\u662F\u9A8C\u6536\u7ED3\u8BBA\u6216\u884C\u52A8\u6388\u6743\uFF1B\u53EF\u4ECE\u7ED3\u679C\u53D6\u5F97 activityId \u548C revision\u3002" },
|
|
12953
|
+
activityId: { type: "string", description: "\u7CBE\u786E\u5DE5\u4F5C ID\u3002" },
|
|
12954
|
+
status: {
|
|
12955
|
+
type: "string",
|
|
12956
|
+
enum: ["active", "paused", "completed", "cancelled", "all"],
|
|
12957
|
+
description: "\u6309\u8BB0\u5F55\u4FDD\u5B58\u7684\u5DE5\u4F5C\u72B6\u6001\u8FC7\u6EE4\uFF0C\u672A\u63D0\u4F9B activityId \u65F6\u9ED8\u8BA4 active\uFF08\u8FDB\u884C\u4E2D\uFF09\uFF1B\u6309 activityId \u7CBE\u786E\u8BFB\u53D6\u65F6\uFF0C\u7701\u7565 status \u9ED8\u8BA4\u4E0D\u8FC7\u6EE4\u72B6\u6001\uFF0C\u8FD4\u56DE\u8BE5\u6761\u8BB0\u5F55\u81EA\u8EAB\u7684 status\u3002active \u4E0D\u7B49\u4E8E\u5168\u90E8\u672A\u5B8C\u6210\uFF08paused \u901A\u5E38\u4E5F\u662F\u672A\u5B8C\u6210\uFF0C\u9700\u53E6\u67E5\uFF09\uFF1Ball \u4E0D\u6309\u72B6\u6001\u8FC7\u6EE4\u3002"
|
|
12958
|
+
},
|
|
12959
|
+
discovery: { type: "string", enum: ["dialog", "scope"], description: "\u5F53\u524D\u5BF9\u8BDD\u6216\u540C\u7528\u6237\u540C\u7A7A\u95F4\u8303\u56F4\u3002" },
|
|
12960
|
+
source: {
|
|
12961
|
+
type: "string",
|
|
12962
|
+
enum: ["archive"],
|
|
12963
|
+
description: "\u663E\u5F0F\u67E5\u65E7\u7248\u5386\u53F2\u65F6\u4F20 archive\uFF08\u7EAF\u53EA\u8BFB\uFF0C\u4E0D\u4EE3\u8868\u5F53\u524D\u7ED3\u8BBA\uFF09\uFF1B\u7701\u7565\u4FDD\u6301\u9ED8\u8BA4\u67E5\u8BE2\u3002\u4EC5\u5F53\u524D\u7528\u6237 archive\uFF0C\u4E0D\u652F\u6301 Space\u3002"
|
|
12964
|
+
},
|
|
12965
|
+
limit: { type: "integer", minimum: 1, maximum: 100, description: "work \u4E0E archive \u6BCF\u9875\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420\uFF1Barchive \u6BCF\u9875\u6700\u591A\u626B\u63CF100\u6761\u7D22\u5F15\u3002" },
|
|
12966
|
+
cursor: { type: "string", description: "archive \u9996\u67E5\u7701\u7565 cursor\uFF08\u7A7A\u5B57\u7B26\u4E32\u7B49\u4EF7\u7701\u7565\uFF09\uFF1B\u7EED\u67E5\u53EA\u80FD\u539F\u6837\u4F7F\u7528\u4E0A\u4E00\u9875\u8FD4\u56DE\u7684\u975E\u7A7A cursor\uFF0C\u7981\u6B62\u731C\u6D4B\u6216\u6784\u9020\uFF08\u5982 0\uFF09\uFF0C\u4FDD\u6301 query \u4E0D\u53D8\u3002\u7A7A\u7ED3\u679C\u4E5F\u53EF\u80FD truncated\uFF0C\u7EE7\u7EED\u7FFB\u9875\u3002\u4E0D\u63D0\u4F9B\u5FEB\u7167\u4E00\u81F4\u6027\u3002" },
|
|
12755
12967
|
query: {
|
|
12756
12968
|
type: "string",
|
|
12757
|
-
description: "\
|
|
12969
|
+
description: "\u5B57\u9762\u4E3B\u9898\u8FC7\u6EE4\uFF0C\u53EF\u7701\u7565\uFF1A\u5BF9\u8BB0\u5F55\u7684\u4E3B\u9898\u5185\u5BB9\uFF08\u542B goal/constraints/openItems/nextStep\uFF09\u505A\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u7684\u5B50\u4E32\u5339\u914D\u3002\u4E0D\u8BC6\u522B\u540C\u4E49\u8BCD\uFF0C\u4E0D\u5224\u65AD\u5B8C\u6210\u72B6\u6001\uFF1B\u67E5\u72B6\u6001\u8BF7\u7528 status\u3002\u666E\u901A\u8BB0\u5FC6\u6A21\u5F0F\u4E0B\u4F5C\u4E3A\u68C0\u7D22\u95EE\u9898\u6216\u5173\u952E\u8BCD\u3002"
|
|
12758
12970
|
}
|
|
12759
12971
|
},
|
|
12760
|
-
required: [
|
|
12972
|
+
required: []
|
|
12761
12973
|
}
|
|
12762
12974
|
};
|
|
12763
12975
|
|
|
12764
12976
|
// packages/ai/tools/queryMemoryTool.ts
|
|
12765
|
-
async function queryMemoryFunc(args, thunkApi) {
|
|
12977
|
+
async function queryMemoryFunc(args, thunkApi, context2) {
|
|
12978
|
+
if (args.mode === "work") {
|
|
12979
|
+
if (args.storage === "local") throw new Error("Web work memory only supports server storage");
|
|
12980
|
+
if (!context2?.dialogId) throw new Error("work memory requires a bound dialog");
|
|
12981
|
+
const { dialogId } = resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12982
|
+
const result2 = await callToolApi(thunkApi, "/api/memory/query", { mode: "work", dialogId, query: args.query, activityId: args.activityId, status: args.status, discovery: args.discovery, limit: args.limit }, { withAuth: true });
|
|
12983
|
+
if (result2?.error) throw new Error(result2.error.message ?? "work memory rejected");
|
|
12984
|
+
return { rawData: result2, displayData: JSON.stringify(result2) };
|
|
12985
|
+
}
|
|
12766
12986
|
const query = String(args.query ?? "").trim();
|
|
12767
12987
|
if (!query) throw new Error("queryMemory \u9700\u8981\u975E\u7A7A query\u3002");
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
const
|
|
12988
|
+
if (args.source !== void 0 && args.source !== "archive") throw new Error("Invalid memory source");
|
|
12989
|
+
if (args.source === void 0 && (args.limit !== void 0 || args.cursor !== void 0)) throw new Error("Pagination requires source archive");
|
|
12990
|
+
const { agentKey, spaceId } = resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12771
12991
|
const result = await callToolApi(
|
|
12772
12992
|
thunkApi,
|
|
12773
12993
|
"/api/memory/query",
|
|
12774
12994
|
{
|
|
12775
|
-
agentKey
|
|
12995
|
+
agentKey,
|
|
12776
12996
|
userInput: query,
|
|
12777
|
-
...
|
|
12997
|
+
...args.source === "archive" ? {
|
|
12998
|
+
source: args.source,
|
|
12999
|
+
...args.limit !== void 0 ? { limit: args.limit } : {},
|
|
13000
|
+
...args.cursor !== void 0 ? { cursor: args.cursor } : {}
|
|
13001
|
+
} : {},
|
|
13002
|
+
...args.source !== "archive" && spaceId ? { spaceId } : {}
|
|
12778
13003
|
},
|
|
12779
13004
|
{ withAuth: true }
|
|
12780
13005
|
);
|
|
12781
13006
|
const selectedItems = Array.isArray(result?.selectedItems) ? result.selectedItems : [];
|
|
12782
13007
|
const displayData = selectedItems.length ? selectedItems.map((item) => String(item?.content ?? "").trim()).filter(Boolean).join("\n") : "\u6CA1\u6709\u627E\u5230\u76F8\u5173\u957F\u671F\u8BB0\u5FC6\u3002";
|
|
12783
|
-
return { rawData: result, displayData
|
|
13008
|
+
return { rawData: result, displayData: args.source === "archive" ? `\u5386\u53F2 archive\uFF08\u4EC5\u5F53\u524D\u7528\u6237\uFF0C\u4E0D\u542B Space \u5386\u53F2\uFF1B\u4E0D\u4EE3\u8868\u5F53\u524D\u7ED3\u8BBA\uFF09\uFF1A
|
|
13009
|
+
${JSON.stringify(result)}` : displayData };
|
|
12784
13010
|
}
|
|
12785
13011
|
|
|
12786
13012
|
// packages/ai/tools/execShellTool.ts
|
|
@@ -13346,7 +13572,7 @@ var buildCreateSkillAgentArgs = (args) => {
|
|
|
13346
13572
|
references: args.references ?? [],
|
|
13347
13573
|
linkedSpaces: args.linkedSpaces ?? [],
|
|
13348
13574
|
temperature: 0.3,
|
|
13349
|
-
reasoning_effort: "medium"
|
|
13575
|
+
reasoning_effort: resolveDefaultReasoningEffort({ provider: (args.provider ?? "").trim() || DEFAULT_PROVIDER, model: (args.model ?? "").trim() || DEFAULT_MODEL2, fallback: "medium" })
|
|
13350
13576
|
};
|
|
13351
13577
|
};
|
|
13352
13578
|
|
|
@@ -13403,6 +13629,45 @@ async function createSkillAgentToolFunc(args, thunkApi) {
|
|
|
13403
13629
|
return createAgentToolFunc(buildCreateSkillAgentArgs(args), thunkApi);
|
|
13404
13630
|
}
|
|
13405
13631
|
|
|
13632
|
+
// packages/app/settings/fieldSelectors.ts
|
|
13633
|
+
var selectMaxExecutionTime = (state2) => state2.settings.maxExecutionTime;
|
|
13634
|
+
var selectEnabledSkills = createSelector(
|
|
13635
|
+
[
|
|
13636
|
+
(state2) => Boolean(
|
|
13637
|
+
state2.settings && Object.prototype.hasOwnProperty.call(state2.settings, "enabledSkills")
|
|
13638
|
+
),
|
|
13639
|
+
(state2) => state2.settings?.enabledSkills,
|
|
13640
|
+
(state2) => state2.settings?.enabledPromptSkills
|
|
13641
|
+
],
|
|
13642
|
+
(hasOwnEnabledSkills, enabledSkills, enabledPromptSkills) => {
|
|
13643
|
+
const preferences = hasOwnEnabledSkills ? { enabledSkills, enabledPromptSkills } : { enabledPromptSkills };
|
|
13644
|
+
return resolveUserEnabledSkills(preferences);
|
|
13645
|
+
}
|
|
13646
|
+
);
|
|
13647
|
+
var selectAutoApproveSelfUpdateFields = createSelector(
|
|
13648
|
+
[(state2) => state2.settings.autoApproveSelfUpdateFields],
|
|
13649
|
+
(fields) => normalizeAgentUpdateFieldList(
|
|
13650
|
+
fields,
|
|
13651
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS
|
|
13652
|
+
)
|
|
13653
|
+
);
|
|
13654
|
+
var selectSystemBuiltinSkills = createSelector(
|
|
13655
|
+
[(state2) => state2.settings.systemBuiltinSkills],
|
|
13656
|
+
(systemBuiltinSkills) => normalizeSystemBuiltinSkills(
|
|
13657
|
+
systemBuiltinSkills,
|
|
13658
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
13659
|
+
)
|
|
13660
|
+
);
|
|
13661
|
+
var selectUiPlugins = createSelector(
|
|
13662
|
+
[
|
|
13663
|
+
(state2) => state2.settings.uiPlugins,
|
|
13664
|
+
(state2) => state2.settings.uiPluginsOwnerAccountId,
|
|
13665
|
+
(state2) => state2.settings.uiPluginsGeneration,
|
|
13666
|
+
(_state, session) => session
|
|
13667
|
+
],
|
|
13668
|
+
(value, owner, generation, session) => session?.transition === "idle" && owner === session.activeAccountId && generation === session.sessionGeneration ? normalizeUiPlugins(value) : normalizeUiPlugins(void 0)
|
|
13669
|
+
);
|
|
13670
|
+
|
|
13406
13671
|
// packages/chat/messages/messageAgent.ts
|
|
13407
13672
|
function resolveMessageAgentKey(message) {
|
|
13408
13673
|
if (!message) return void 0;
|
|
@@ -14127,8 +14392,8 @@ function assertRuntimeKeyDispatchableByHost(input) {
|
|
|
14127
14392
|
`startAgentRun \u7684 runtimeKey="${requested}" \u65E0\u6CD5\u7531 CLI \u672C\u5730\u6D3E\u53D1\u901A\u9053\u5151\u73B0\uFF1A\u8BE5\u901A\u9053\u53EA\u80FD\u628A run \u843D\u5230\u672C\u673A\uFF08local\uFF09\u3001\u672C\u673A sbx \u4E91\u6C99\u76D2\uFF08docker / docker:<id>\uFF09\u6216 Instabox \u6C99\u76D2\uFF08instabox\uFF09\uFF0C\u672C\u673A\u6CA1\u6709 ${requested} \u5BF9\u5E94\u7684\u6267\u884C\u540E\u7AEF\u3002\u5DF2\u62D2\u7EDD\u6D3E\u53D1\uFF0C\u672A\u542F\u52A8\u4EFB\u4F55 run\u3002\u8981\u771F\u6B63\u5728 ${requested} \u6267\u884C\uFF1A\u7528 CLI \u901A\u9053 \`nolo agent run --runtime-key ${requested} ...\`\uFF0C\u6216\u4ECE\u80FD\u6D3E\u53D1\u5230\u8BE5\u4F4D\u7F6E\u7684\u5BBF\u4E3B\uFF08\u670D\u52A1\u7AEF\uFF09\u53D1\u8D77\u3002`
|
|
14128
14393
|
);
|
|
14129
14394
|
}
|
|
14130
|
-
var HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE = "
|
|
14131
|
-
var HOST_EXECUTOR_UNAVAILABLE_MESSAGE = "runtimeKey 'local'\uFF08\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u6267\u884C\uFF09\u5728\u5F53\u524D\u5BBF\u4E3B\u6CA1\u6709\u53EF\u7528\u7684\u5BBF\u4E3B\u6267\u884C\u5668\uFF1A\u670D\u52A1\u7AEF / \u6D4F\u89C8\u5668 run \u5151\u73B0\u4E0D\u4E86\u5B83\uFF08\u670D\u52A1\u7AEF\u4ECE\u4E0D\u5151\u73B0 local\uFF0C\u89C1 local_target_unsupported\uFF09\u3002\u8BF7\u5728\u5BBF\u4E3B\u8FDB\u7A0B\u5185\u6D3E\u53D1\uFF08CLI \u901A\u9053\u652F\u6301 runtimeKey=local + allowHostWrites: true\uFF09\uFF0C\u6216\u6539\u7528\u5DF2\u8FDE\u63A5\u7684\u673A\u5668\uFF08runtimeKey: machine:<machineId>\uFF09\uFF0C\u6216\
|
|
14395
|
+
var HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE = "CLI \u672C\u5730\u5199\u578B\u6D3E\u53D1\u9ED8\u8BA4\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u8BFB\u5199\u4EE3\u7801\uFF08\u65E0\u9694\u79BB\uFF09\uFF1A\u5FC5\u987B\u7531\u8C03\u7528\u65B9\u663E\u5F0F\u58F0\u660E allowHostWrites: true \u624D\u80FD\u6D3E\u53D1\uFF08\u663E\u5F0F runtimeKey 'local' \u540C\u6837\u9700\u8981\uFF09\u3002\u672A\u58F0\u660E\u65F6\u5DF2\u62D2\u7EDD\u6D3E\u53D1\uFF08\u672A\u542F\u52A8\u4EFB\u4F55 run\uFF09\uFF1B\u8981\u6C99\u76D2\u6267\u884C\u8BF7\u663E\u5F0F\u6307\u5B9A runtimeKey: docker / docker:<id>\u3002\u53EA\u8BFB\u6D3E\u53D1\uFF08readOnly: true\uFF09\u4E0D\u9700\u8981 runtimeKey\uFF1A\u7701\u7565\u5B83\u5373\u5728\u5BBF\u4E3B\u6267\u884C\uFF0C\u65E0\u9700 allowHostWrites\u3002\u6CE8\u610F readOnly \u4E0D\u63D0\u4F9B\u6587\u4EF6\u7CFB\u7EDF\u53EA\u8BFB\u9694\u79BB\uFF08shell \u4ECD\u53EF\u5199\uFF09\uFF0C\u9700\u8981\u9694\u79BB\u8BF7\u663E\u5F0F\u6307\u5B9A docker\u3002";
|
|
14396
|
+
var HOST_EXECUTOR_UNAVAILABLE_MESSAGE = "runtimeKey 'local'\uFF08\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u6267\u884C\uFF09\u5728\u5F53\u524D\u5BBF\u4E3B\u6CA1\u6709\u53EF\u7528\u7684\u5BBF\u4E3B\u6267\u884C\u5668\uFF1A\u670D\u52A1\u7AEF / \u6D4F\u89C8\u5668 run \u5151\u73B0\u4E0D\u4E86\u5B83\uFF08\u670D\u52A1\u7AEF\u4ECE\u4E0D\u5151\u73B0 local\uFF0C\u89C1 local_target_unsupported\uFF09\u3002\u8BF7\u5728\u5BBF\u4E3B\u8FDB\u7A0B\u5185\u6D3E\u53D1\uFF08CLI \u901A\u9053\u652F\u6301 runtimeKey=local + allowHostWrites: true\uFF09\uFF0C\u6216\u6539\u7528\u5DF2\u8FDE\u63A5\u7684\u673A\u5668\uFF08runtimeKey: machine:<machineId>\uFF09\uFF0C\u6216\u663E\u5F0F\u6307\u5B9A runtimeKey: docker \u4F7F\u7528\u6C99\u76D2\u3002";
|
|
14132
14397
|
function resolveCliLocalSpawnDispatch(input) {
|
|
14133
14398
|
const requested = assertRuntimeKeyDispatchableByHost({
|
|
14134
14399
|
...input,
|
|
@@ -14158,10 +14423,13 @@ function resolvePlanForRequestedKey(requested, allowHostWrites, readOnly) {
|
|
|
14158
14423
|
if (readOnly === true) {
|
|
14159
14424
|
return { target: "host", reason: "read-only-host" };
|
|
14160
14425
|
}
|
|
14426
|
+
if (allowHostWrites !== true) {
|
|
14427
|
+
throw new Error(HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE);
|
|
14428
|
+
}
|
|
14161
14429
|
return {
|
|
14162
|
-
runtimeKey: "
|
|
14163
|
-
target: "
|
|
14164
|
-
reason: "default-
|
|
14430
|
+
runtimeKey: "local",
|
|
14431
|
+
target: "host",
|
|
14432
|
+
reason: "default-host-writes"
|
|
14165
14433
|
};
|
|
14166
14434
|
}
|
|
14167
14435
|
function normalizeExplicitHostCwd(rawCwd) {
|
|
@@ -14317,7 +14585,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14317
14585
|
const wakeEnabled = opts?.wakeEnabled === true;
|
|
14318
14586
|
return {
|
|
14319
14587
|
name: "startAgentRun",
|
|
14320
|
-
description: "\u542F\u52A8\u4E00\u4E2A Agent \u6267\u884C\u5B50\u4EFB\u52A1\u3002\u9ED8\u8BA4\u5F02\u6B65\uFF08fork+exec\uFF09\uFF1A\u7ACB\u5373\u8FD4\u56DE runId \u4E0D\u963B\u585E\u5BF9\u8BDD\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\u901A\u77E5\uFF0C\u7981\u6B62\u8F6E\u8BE2\uFF1BcontrolAgentRun \u7528\u4E8E\u63A7\u5236\uFF08\u53EB\u505C/\u8FFD\u52A0\u6307\u4EE4\uFF09\u4E0E\u5F02\u5E38\u8BCA\u65AD\u3002\u3010\u6D3E\u53D1\u7EAA\u5F8B\u3011\u540C\u4E00\u8F6E\u5E94\u5E76\u53D1\u6D3E\u53D1\u65E0\u771F\u5B9E\u4F9D\u8D56\u7684\u591A\u4E2A run\uFF1B\u7B49\u5F85\u67D0\u4E2A run \u7684\u7ED3\u679C\u4E0D\u5F97\u963B\u585E\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\u7684\u63A8\u8FDB\u3002\u5F02\u6B65\u6D3E\u53D1\u540E\uFF0C\u5148\u7EE7\u7EED\u63A8\u8FDB\u672C\u8F6E\u53EF\u6267\u884C\u7684\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\uFF1B\u7B26\u5408\u4E0B\u8FF0\u540C\u6B65\u7B49\u5F85\u6761\u4EF6\u65F6\u4ECD\u53EF\u4F7F\u7528 wait:true\u3002\u53EA\u6709\u771F\u5B9E\u6587\u4EF6\u51B2\u7A81/\u63A5\u53E3\u5951\u7EA6\u4F9D\u8D56/\u51ED\u8BC1\u6216\u914D\u989D\u51C6\u5165\u51B2\u7A81/\u4E0A\u6E38\u4EA7\u7269\u4F9D\u8D56\u624D\u53EF\u4E32\u884C\uFF08\u4E0E\u7CFB\u7EDF\u63D0\u793A\u300C\u5E76\u884C\u662F\u9ED8\u8BA4\u300D\u4E00\u81F4\uFF09\u3002\u901A\u9053\u53EF\u7528\u6027\u4EC5\u5BF9\u5F53\u6B21\u6D3E\u53D1\u6709\u6548\uFF0C\u6D3E\u53D1\u524D\u52A1\u5FC5\u91CD\u65B0\u8BFB\u53D6\u53EF\u7528\u6027\uFF0C\u5207\u52FF\u590D\u7528\u6B64\u524D\u5931\u8D25\u7ED3\u8BBA\uFF1B\u9047\u5230 config_unresolved \u7C7B\u9519\u8BEF\u964D\u7EA7\u524D\u91CD\u8BD5\u4E00\u6B21\uFF1B\u540C\u4E00\u51ED\u8BC1\u9ED8\u8BA4\u5141\u8BB8\u5E76\u53D1\uFF08\u53D7\u670D\u52A1\u7AEF\u51C6\u5165\u9884\u7B97\u7EA6\u675F\uFF1B\u6CE8\u610F\u4E0A\u6E38 429 \u9650\u6D41\uFF0C\u5FC5\u8981\u65F6\u964D\u4F4E\u5E76\u53D1\u6216\u6362\u901A\u9053\uFF09\
|
|
14588
|
+
description: "\u542F\u52A8\u4E00\u4E2A Agent \u6267\u884C\u5B50\u4EFB\u52A1\u3002\u9ED8\u8BA4\u5F02\u6B65\uFF08fork+exec\uFF09\uFF1A\u7ACB\u5373\u8FD4\u56DE runId \u4E0D\u963B\u585E\u5BF9\u8BDD\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\u901A\u77E5\uFF0C\u7981\u6B62\u8F6E\u8BE2\uFF1BcontrolAgentRun \u7528\u4E8E\u63A7\u5236\uFF08\u53EB\u505C/\u8FFD\u52A0\u6307\u4EE4\uFF09\u4E0E\u5F02\u5E38\u8BCA\u65AD\u3002\u3010\u6D3E\u53D1\u7EAA\u5F8B\u3011\u540C\u4E00\u8F6E\u5E94\u5E76\u53D1\u6D3E\u53D1\u65E0\u771F\u5B9E\u4F9D\u8D56\u7684\u591A\u4E2A run\uFF1B\u7B49\u5F85\u67D0\u4E2A run \u7684\u7ED3\u679C\u4E0D\u5F97\u963B\u585E\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\u7684\u63A8\u8FDB\u3002\u5F02\u6B65\u6D3E\u53D1\u540E\uFF0C\u5148\u7EE7\u7EED\u63A8\u8FDB\u672C\u8F6E\u53EF\u6267\u884C\u7684\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\uFF1B\u7B26\u5408\u4E0B\u8FF0\u540C\u6B65\u7B49\u5F85\u6761\u4EF6\u65F6\u4ECD\u53EF\u4F7F\u7528 wait:true\u3002\u53EA\u6709\u771F\u5B9E\u6587\u4EF6\u51B2\u7A81/\u63A5\u53E3\u5951\u7EA6\u4F9D\u8D56/\u51ED\u8BC1\u6216\u914D\u989D\u51C6\u5165\u51B2\u7A81/\u4E0A\u6E38\u4EA7\u7269\u4F9D\u8D56\u624D\u53EF\u4E32\u884C\uFF08\u4E0E\u7CFB\u7EDF\u63D0\u793A\u300C\u5E76\u884C\u662F\u9ED8\u8BA4\u300D\u4E00\u81F4\uFF09\u3002\u901A\u9053\u53EF\u7528\u6027\u4EC5\u5BF9\u5F53\u6B21\u6D3E\u53D1\u6709\u6548\uFF0C\u6D3E\u53D1\u524D\u52A1\u5FC5\u91CD\u65B0\u8BFB\u53D6\u53EF\u7528\u6027\uFF0C\u5207\u52FF\u590D\u7528\u6B64\u524D\u5931\u8D25\u7ED3\u8BBA\uFF1B\u9047\u5230 config_unresolved \u7C7B\u9519\u8BEF\u964D\u7EA7\u524D\u91CD\u8BD5\u4E00\u6B21\uFF1B\u540C\u4E00\u51ED\u8BC1\u9ED8\u8BA4\u5141\u8BB8\u5E76\u53D1\uFF08\u53D7\u670D\u52A1\u7AEF\u51C6\u5165\u9884\u7B97\u7EA6\u675F\uFF1B\u6CE8\u610F\u4E0A\u6E38 429 \u9650\u6D41\uFF0C\u5FC5\u8981\u65F6\u964D\u4F4E\u5E76\u53D1\u6216\u6362\u901A\u9053\uFF09\uFF1B\u672A\u77E5\u51ED\u8BC1\u4E0D\u5047\u5B9A\u76F8\u4E92\u72EC\u7ACB\uFF0C\u5B88\u536B\u4EC5\u9650\u5236\u8FD9\u4E9B\u5019\u9009\u5F7C\u6B64\u4E4B\u95F4\u7684\u540C\u6279\u5E76\u53D1\uFF0C\u9664\u975E\u663E\u5F0F\u4EE5 allowUnknownCredential \u786E\u8BA4\u98CE\u9669\u3002\u65E0\u5173\u901A\u9053\u4E0E\u5DE5\u4F5C\u4ECD\u53EF\u5E76\u53D1\u3002\u6309\u4EFB\u52A1\u80FD\u529B\u4E0E\u8D39\u7528\u6388\u6743\u9009\u62E9\u901A\u9053\uFF0C\u4E0D\u5E94\u4EC5\u56E0\u6863\u4F4D\u800C\u9884\u7559\u901A\u9053\u3002" + (supportsWait ? "\u8981\u540C\u6B65\u7ED3\u679C\u4F20 wait:true\uFF08\u4F1A\u51BB\u7ED3\u5BF9\u8BDD\uFF0C\u4EC5\u9650 \u2460 \u9884\u8BA1 <100s \u4E14\u9A6C\u4E0A\u8981\u7528\u7ED3\u679C \u2461 \u7528\u6237\u660E\u786E\u8981\u6C42\u540C\u6B65\u7B49\u5F85\u6216\u6B63\u5728\u4E0E\u8BE5\u5B50\u4EFB\u52A1\u5BF9\u8BDD \u2462 \u73AF\u5883\u4E0D\u652F\u6301\u7EC8\u6001\u5524\u9192\u4E14\u65E0\u5E76\u884C\u5DE5\u4F5C\uFF1B\u8BE6\u89C1 wait \u53C2\u6570\uFF09\u3002wait:true \u65F6\u53EF\u7528 resultMode \u63A7\u5236\u8FD4\u56DE\u5185\u5BB9\uFF1Afull=\u5B8C\u6574\u8F93\u51FA\uFF1Bsummary=\u53EA\u56DE\u5934\u5C3E\u603B\u7ED3\uFF08\u9632\u957F\u8F93\u51FA\u6491\u7206\u4E0A\u4E0B\u6587\uFF09\u3002" : wakeEnabled ? "\u53EA\u652F\u6301\u5F02\u6B65\u6D3E\u53D1\uFF1Brun \u5230\u7EC8\u6001\u4F1A\u81EA\u52A8\u901A\u8FC7 terminal wake \u628A\u7236\u5BF9\u8BDD\u63A5\u56DE\u6765\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u5524\u9192\uFF0C\u4E0D\u8981\u8F6E\u8BE2" : "\u53EA\u652F\u6301\u5F02\u6B65\u6D3E\u53D1\uFF0CstartAgentRun \u4E0D\u63D0\u4F9B\u540C\u6B65\u7B49\u5F85\uFF1B\u9700\u8981\u7B49\u7EC8\u6001\u65F6\u53EF\u7528 controlAgentRun(wait)\uFF08\u82E5\u8BE5 action \u53EF\u7528\uFF09\uFF1B\u4E0D\u8981\u5047\u8BBE\u4F1A\u81EA\u52A8 terminal wake"),
|
|
14321
14589
|
parameters: {
|
|
14322
14590
|
type: "object",
|
|
14323
14591
|
properties: {
|
|
@@ -14402,6 +14670,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14402
14670
|
type: "string",
|
|
14403
14671
|
description: "\u53EF\u9009\u3002\u7236\u5BF9\u8BDD id\uFF0C\u7528\u4E8E\u5EFA\u7ACB\u7236\u5B50\u5BF9\u8BDD\u5F52\u5C5E\u5173\u7CFB\u3002\u9ED8\u8BA4\u4ECE\u8FD0\u884C\u65F6\u5F53\u524D\u6FC0\u6D3B\u5BF9\u8BDD\u83B7\u53D6\u3002"
|
|
14404
14672
|
},
|
|
14673
|
+
imagePaths: { type: "array", items: { type: "string" }, minItems: 1, maxItems: 4, description: "\u672C\u673A PNG/JPEG/WebP/GIF \u56FE\u7247\u7EDD\u5BF9\u8DEF\u5F84\uFF0C1\u20134 \u5F20\u3002\u4EC5 CLI host-local \u6267\u884C\u5668\u652F\u6301\uFF1B\u5FC5\u987B runtimeKey=local\u3001allowHostWrites=true\u3002\u56FE\u7247\u4F5C\u4E3A\u5B50 run \u9996\u8F6E\u89C6\u89C9\u8F93\u5165\uFF0C\u4E0D\u662F\u8DEF\u5F84\u6587\u672C\uFF1B\u4E0D\u652F\u6301\u8DE8\u673A\u5668\u81EA\u52A8\u4E0A\u4F20\uFF0C\u4E0D\u4F20 URL/base64\u3002\u5355\u56FE\u7F16\u7801\u4E0A\u9650 2MiB\uFF0C\u603B\u8BA1 8MiB\uFF0C\u6309\u65E2\u6709 read_image \u89C4\u5219\u7F29\u653E\u3002" },
|
|
14405
14674
|
runtimeKey: {
|
|
14406
14675
|
type: "string",
|
|
14407
14676
|
description: "\u53EF\u9009\u3002\u8FD9\u6B21 run \u7684\u6267\u884C\u4F4D\u7F6E\uFF1AlistRuntimes \u8FD4\u56DE\u7684\u7A33\u5B9A key\uFF08local | server | machine:<machineId> | docker:<runtimeId> | instabox | gcp\uFF09\u3002\u4E91\u540E\u7AEF\u6309 run \u8BA1\u8D39\uFF08instabox \u514D\u8D39\u989D\u5EA6\u3001gcp \u6309\u79D2\uFF09\uFF0C\u70B9\u540D\u5373\u8868\u793A\u540C\u610F\u5728\u8BE5\u540E\u7AEF\u6267\u884C\u3002\u586B\u4E86\u5C31\u53EA\u5728\u90A3\u4E2A\u4F4D\u7F6E\u6267\u884C\uFF1Bkey \u975E\u6CD5 / \u8FD0\u884C\u65F6\u672A\u914D\u7F6E / \u673A\u5668\u79BB\u7EBF\u6216\u975E\u672C\u4EBA\u6240\u6709\u65F6\u4F1A\u663E\u5F0F\u62A5\u9519\uFF0C\u4E0D\u4F1A\u6084\u6084\u6539\u5728\u672C\u673A\u6216\u670D\u52A1\u7AEF\u6267\u884C\u3002\u4E0D\u586B = \u6CBF\u7528\u5F53\u524D\u5BBF\u4E3B\u9ED8\u8BA4\u4F4D\u7F6E\u3002"
|
|
@@ -14417,7 +14686,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14417
14686
|
instaboxAllowPaid: { type: "boolean", description: "\u663E\u5F0F\u5141\u8BB8\u4ED8\u8D39\u5EFA\u673A\uFF1B\u9ED8\u8BA4 false\uFF0C\u4FDD\u7559\u514D\u8D39\u989D\u5EA6\u95E8\u7981\u3002" },
|
|
14418
14687
|
allowHostWrites: {
|
|
14419
14688
|
type: "boolean",
|
|
14420
|
-
description: "\u53EF\u9009\
|
|
14689
|
+
description: "\u53EF\u9009\u3002CLI \u672C\u5730\u901A\u9053\u672A\u70B9\u540D runtimeKey \u7684\u5199\u578B\u6D3E\u53D1\u9ED8\u8BA4\u5BBF\u4E3B\uFF0C\u53CA\u663E\u5F0F runtimeKey='local' \u65F6\uFF0C\u5FC5\u987B\u58F0\u660E allowHostWrites: true\uFF1A\u540C\u610F\u5B50 run \u76F4\u63A5\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u8BFB\u5199\u4EE3\u7801\uFF08\u65E0\u9694\u79BB\uFF09\u3002\u672A\u786E\u8BA4\u5373\u663E\u5F0F\u62D2\u7EDD\uFF0C\u4E0D\u56DE\u843D docker\uFF1B\u9700\u8981\u6C99\u76D2\u8BF7\u663E\u5F0F\u6307\u5B9A runtimeKey='docker' \u6216 'docker:<id>'\u3002\u53EA\u8BFB\u672A\u70B9\u540D\u6D3E\u53D1\uFF08readOnly=true\uFF09\u4ECD\u7559\u5BBF\u4E3B\u4E14\u65E0\u9700\u5199\u5165\u786E\u8BA4\uFF1BreadOnly \u53EA\u79FB\u9664 nolo \u4E13\u7528\u5199\u5DE5\u5177\uFF0Cshell \u4E0E\u5916\u90E8 CLI \u4ECD\u53EF\u5199\u6587\u4EF6\uFF0C\u4E0D\u63D0\u4F9B\u6587\u4EF6\u7CFB\u7EDF\u53EA\u8BFB\u9694\u79BB\u3002"
|
|
14421
14690
|
}
|
|
14422
14691
|
},
|
|
14423
14692
|
required: ["task", "title"]
|
|
@@ -14425,19 +14694,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14425
14694
|
};
|
|
14426
14695
|
}
|
|
14427
14696
|
var startAgentRunFunctionSchema = buildStartAgentRunFunctionSchema();
|
|
14428
|
-
function
|
|
14429
|
-
try {
|
|
14430
|
-
const state2 = thunkApi?.getState?.();
|
|
14431
|
-
if (!state2) return void 0;
|
|
14432
|
-
const currentDialogKey = getActiveDialogKey();
|
|
14433
|
-
if (!currentDialogKey) return void 0;
|
|
14434
|
-
const dialogConfig = selectById(state2, currentDialogKey);
|
|
14435
|
-
return asTrimmedNonEmptyStringArray(dialogConfig?.cybots)[0];
|
|
14436
|
-
} catch {
|
|
14437
|
-
return void 0;
|
|
14438
|
-
}
|
|
14439
|
-
}
|
|
14440
|
-
async function startAgentRunFunc(args, thunkApi, _context) {
|
|
14697
|
+
async function startAgentRunFunc(args, thunkApi, context2) {
|
|
14441
14698
|
const { agentKey, task, input, agentName, batchId, wait } = args;
|
|
14442
14699
|
const continueDialogId = normalizeContinueDialogId(args.continueDialogId);
|
|
14443
14700
|
if (typeof task !== "string" || !task.trim()) throw new Error("startAgentRun \u7F3A\u5C11 task");
|
|
@@ -14459,11 +14716,16 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
14459
14716
|
throw new Error("startAgentRun: instabox workspace \u5408\u540C\u76EE\u524D\u4EC5\u7531\u672C\u673A CLI \u6267\u884C\u5668\u5151\u73B0\uFF1B\u672C\u670D\u52A1\u7AEF\u6D3E\u53D1\u901A\u9053\u4E0D\u652F\u6301\uFF0C\u5DF2\u62D2\u7EDD\uFF08\u4E0D\u4F1A\u56DE\u843D\u5BBF\u4E3B\uFF09\u3002\u8BF7\u4F7F\u7528 nolo CLI \u672C\u673A\u6D3E\u53D1\u3002");
|
|
14460
14717
|
}
|
|
14461
14718
|
const resultMode = args.resultMode ?? "full";
|
|
14719
|
+
if (args.imagePaths !== void 0) throw new Error("image_backend_unsupported: imagePaths currently requires the CLI host-local executor");
|
|
14462
14720
|
const { dispatch } = thunkApi;
|
|
14463
14721
|
const explicitBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : void 0;
|
|
14464
14722
|
const effectiveBatchId = explicitBatchId ?? `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
|
|
14465
14723
|
const rawAgentKey = typeof agentKey === "string" ? agentKey.trim() : "";
|
|
14466
|
-
const
|
|
14724
|
+
const attribution = resolveToolAttributionContext(thunkApi.getState(), context2, {
|
|
14725
|
+
requireAgentKey: true,
|
|
14726
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A startAgentRun \u5F52\u5C5E"
|
|
14727
|
+
});
|
|
14728
|
+
const currentAgentKey = attribution.agentKey;
|
|
14467
14729
|
const effectiveAgentKey = !rawAgentKey || rawAgentKey.toLowerCase() === "self" ? currentAgentKey ?? rawAgentKey : rawAgentKey;
|
|
14468
14730
|
if (!effectiveAgentKey) {
|
|
14469
14731
|
throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\uFF0C\u4E14\u65E0\u6CD5\u8BC6\u522B\u5F53\u524D Agent\u3002");
|
|
@@ -14480,9 +14742,8 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
14480
14742
|
const effectiveAllowCredentialConcurrency = args.allowCredentialConcurrency ?? true;
|
|
14481
14743
|
const content = buildDelegatedTaskContent(task, input);
|
|
14482
14744
|
const payloadMetrics = calculateDelegatedPayloadMetrics(task, input, content);
|
|
14483
|
-
const activeDialogKey = getActiveDialogKey();
|
|
14484
14745
|
const explicitParentDialogId = typeof args.parentDialogId === "string" && args.parentDialogId.trim() ? args.parentDialogId.includes("-") ? extractCustomId(args.parentDialogId) : args.parentDialogId.trim() : void 0;
|
|
14485
|
-
const parentDialogId = explicitParentDialogId ??
|
|
14746
|
+
const parentDialogId = explicitParentDialogId ?? attribution.dialogId;
|
|
14486
14747
|
const hostAgentRunDispatcher = runtimeKey === "local" ? thunkApi?.extra?.startHostAgentRun : void 0;
|
|
14487
14748
|
if (runtimeKey === "local") {
|
|
14488
14749
|
if (args.allowHostWrites !== true) {
|
|
@@ -16267,14 +16528,14 @@ var cfScreenshotFunctionSchema = {
|
|
|
16267
16528
|
}
|
|
16268
16529
|
}
|
|
16269
16530
|
};
|
|
16270
|
-
async function cfScreenshotFunc(args, thunkApi) {
|
|
16531
|
+
async function cfScreenshotFunc(args, thunkApi, context2) {
|
|
16271
16532
|
const { url, html, fullPage = false, viewport } = args;
|
|
16272
16533
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16273
16534
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16274
16535
|
const data = await callToolApi(
|
|
16275
16536
|
thunkApi,
|
|
16276
16537
|
"/api/cf-screenshot",
|
|
16277
|
-
{ url: targetUrl, html, fullPage, viewport },
|
|
16538
|
+
{ url: targetUrl, html, fullPage, viewport, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
16278
16539
|
{ withAuth: true }
|
|
16279
16540
|
);
|
|
16280
16541
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
@@ -16309,12 +16570,12 @@ var cfGetMarkdownFunctionSchema = {
|
|
|
16309
16570
|
}
|
|
16310
16571
|
}
|
|
16311
16572
|
};
|
|
16312
|
-
async function cfGetMarkdownFunc(args, thunkApi) {
|
|
16573
|
+
async function cfGetMarkdownFunc(args, thunkApi, context2) {
|
|
16313
16574
|
const { url, html, waitForNetworkIdle = false } = args;
|
|
16314
16575
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16315
16576
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16316
16577
|
const gotoOptions = waitForNetworkIdle ? { waitUntil: "networkidle0" } : void 0;
|
|
16317
|
-
const data = await callToolApi(thunkApi, "/api/cf-markdown", { url: targetUrl, html, gotoOptions }, { withAuth: true });
|
|
16578
|
+
const data = await callToolApi(thunkApi, "/api/cf-markdown", { url: targetUrl, html, gotoOptions, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
16318
16579
|
const extractionIssue = detectExtractionIssue(data.markdown ?? "", targetUrl ?? url ?? "\u7F51\u9875");
|
|
16319
16580
|
if (extractionIssue) {
|
|
16320
16581
|
throw new Error(extractionIssue.message);
|
|
@@ -16356,11 +16617,11 @@ var cfGeneratePDFFunctionSchema = {
|
|
|
16356
16617
|
}
|
|
16357
16618
|
}
|
|
16358
16619
|
};
|
|
16359
|
-
async function cfGeneratePDFFunc(args, thunkApi) {
|
|
16620
|
+
async function cfGeneratePDFFunc(args, thunkApi, context2) {
|
|
16360
16621
|
const { url, html, pdfOptions } = args;
|
|
16361
16622
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16362
16623
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16363
|
-
const data = await callToolApi(thunkApi, "/api/cf-pdf", { url: targetUrl, html, pdfOptions }, { withAuth: true });
|
|
16624
|
+
const data = await callToolApi(thunkApi, "/api/cf-pdf", { url: targetUrl, html, pdfOptions, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
16364
16625
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
16365
16626
|
return {
|
|
16366
16627
|
rawData: rewritten ? { ...data, originalUrl, resolvedUrl: targetUrl } : data,
|
|
@@ -16398,7 +16659,7 @@ var cfExtractJSONFunctionSchema = {
|
|
|
16398
16659
|
required: []
|
|
16399
16660
|
}
|
|
16400
16661
|
};
|
|
16401
|
-
async function cfExtractJSONFunc(args, thunkApi) {
|
|
16662
|
+
async function cfExtractJSONFunc(args, thunkApi, context2) {
|
|
16402
16663
|
const { url, html, prompt, response_format } = args;
|
|
16403
16664
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16404
16665
|
if (!prompt && !response_format) throw new Error("\u5FC5\u987B\u63D0\u4F9B prompt \u6216 response_format");
|
|
@@ -16406,7 +16667,7 @@ async function cfExtractJSONFunc(args, thunkApi) {
|
|
|
16406
16667
|
const data = await callToolApi(
|
|
16407
16668
|
thunkApi,
|
|
16408
16669
|
"/api/cf-json",
|
|
16409
|
-
{ url: targetUrl, html, prompt, response_format },
|
|
16670
|
+
{ url: targetUrl, html, prompt, response_format, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
16410
16671
|
{ withAuth: true }
|
|
16411
16672
|
);
|
|
16412
16673
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
@@ -18190,12 +18451,12 @@ var cfSpeechToTextFunctionSchema = {
|
|
|
18190
18451
|
required: ["audioUrl"]
|
|
18191
18452
|
}
|
|
18192
18453
|
};
|
|
18193
|
-
async function cfSpeechToTextFunc(args, thunkApi) {
|
|
18454
|
+
async function cfSpeechToTextFunc(args, thunkApi, context2) {
|
|
18194
18455
|
const { audioUrl } = args;
|
|
18195
18456
|
if (!audioUrl || typeof audioUrl !== "string") {
|
|
18196
18457
|
throw new Error("\u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 audioUrl");
|
|
18197
18458
|
}
|
|
18198
|
-
const data = await callToolApi(thunkApi, "/api/cf-speech-to-text", { audioUrl }, { withAuth: true });
|
|
18459
|
+
const data = await callToolApi(thunkApi, "/api/cf-speech-to-text", { audioUrl, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
18199
18460
|
return {
|
|
18200
18461
|
rawData: data,
|
|
18201
18462
|
displayData: `\u{1F3A4} \u8BED\u97F3\u8F6C\u6587\u5B57\u5B8C\u6210
|
|
@@ -18370,6 +18631,10 @@ function toAppSummary(record, fallbackServerOrigin) {
|
|
|
18370
18631
|
};
|
|
18371
18632
|
}
|
|
18372
18633
|
|
|
18634
|
+
// packages/create/space/contentKeyUtils.ts
|
|
18635
|
+
var isAppContentKey = (contentKey) => typeof contentKey === "string" && contentKey.startsWith("app-");
|
|
18636
|
+
var normalizeAppRouteId = (contentKey) => isAppContentKey(contentKey) ? contentKey : `app-${contentKey}`;
|
|
18637
|
+
|
|
18373
18638
|
// packages/app/utils/myContentItems.ts
|
|
18374
18639
|
var dialogSummaryStatus = (value) => value === null || typeof value === "string" && ["pending", "running", "done", "completed", "failed", "cancelled"].includes(value) ? value : void 0;
|
|
18375
18640
|
var dialogSummaryUnreadAt = (value) => value === null || typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
@@ -18482,7 +18747,7 @@ function buildMyContentItemsFromUserData(records, currentServer = "", spaceNameB
|
|
|
18482
18747
|
}
|
|
18483
18748
|
|
|
18484
18749
|
// packages/ai/tools/searchWorkspaceTool.ts
|
|
18485
|
-
var
|
|
18750
|
+
var selectCurrentSpaceIdFromState = (_state) => getCurrentSpaceId();
|
|
18486
18751
|
var selectCurrentSpaceFromState = (state2) => selectCurrentSpace(state2);
|
|
18487
18752
|
var selectAllMemberSpacesFromState = (state2) => {
|
|
18488
18753
|
const memberSpaces = getAllMemberSpaces();
|
|
@@ -18587,7 +18852,7 @@ var loadLocalMyContentResults = async (thunkApi, state2) => {
|
|
|
18587
18852
|
async function searchWorkspaceFunc(args, thunkApi) {
|
|
18588
18853
|
const { getState } = thunkApi;
|
|
18589
18854
|
const state2 = getState();
|
|
18590
|
-
const spaceId =
|
|
18855
|
+
const spaceId = selectCurrentSpaceIdFromState(state2);
|
|
18591
18856
|
if (!spaceId) {
|
|
18592
18857
|
throw new Error("\u65E0\u6CD5\u67E5\u8BE2\u5185\u5BB9\uFF0C\u56E0\u4E3A\u5F53\u524D\u7A7A\u95F4\u672A\u8BBE\u5B9A\u3002");
|
|
18593
18858
|
}
|
|
@@ -18934,7 +19199,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18934
19199
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18935
19200
|
};
|
|
18936
19201
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18937
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
19202
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-GIVRT7TQ.js");
|
|
18938
19203
|
if (getDocState().pageKey === id) {
|
|
18939
19204
|
applyExternalDocUpdate({
|
|
18940
19205
|
slateData: finalSlateData,
|
|
@@ -18959,35 +19224,20 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18959
19224
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
18960
19225
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
18961
19226
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
18962
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-
|
|
19227
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-AY76OHYX.js")).setSettings;
|
|
18963
19228
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
18964
19229
|
}
|
|
18965
19230
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
18966
19231
|
name: "updateUserPreferenceProfile",
|
|
18967
19232
|
description: [
|
|
18968
19233
|
"\u5F53\u4F60\u5DF2\u7ECF\u660E\u786E\u6536\u96C6\u5230\u7528\u6237\u7684\u4E2A\u6027\u5316\u504F\u597D\u65F6\uFF0C\u4F7F\u7528\u672C\u5DE5\u5177\u628A\u8FD9\u4E9B\u504F\u597D\u4FDD\u5B58\u5230\u7528\u6237\u8BBE\u7F6E\u91CC\u3002",
|
|
18969
|
-
"\u9002\u7528\u4E8E\u4FDD\u5B58
|
|
19234
|
+
"\u9002\u7528\u4E8E\u4FDD\u5B58\u7528\u6237\u7684 global prompt / \u81EA\u6211\u4ECB\u7ECD\u6458\u8981\u3002",
|
|
18970
19235
|
"\u53EA\u6709\u5728\u7528\u6237\u5DF2\u7ECF\u660E\u786E\u8868\u8FBE\u6216\u786E\u8BA4\u540E\u624D\u8C03\u7528\uFF1B\u4E0D\u8981\u5728\u4FE1\u606F\u4E0D\u5145\u5206\u65F6\u731C\u6D4B\u3002",
|
|
18971
19236
|
"\u8C03\u7528\u540E\uFF0C\u4F60\u5E94\u5F53\u7528\u81EA\u7136\u8BED\u8A00\u7B80\u8981\u603B\u7ED3\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\uFF0C\u5E76\u8BF4\u660E\u7528\u6237\u4E4B\u540E\u53EF\u4EE5\u7EE7\u7EED\u8C03\u6574\u3002"
|
|
18972
19237
|
].join("\n"),
|
|
18973
19238
|
parameters: {
|
|
18974
19239
|
type: "object",
|
|
18975
19240
|
properties: {
|
|
18976
|
-
userTonePreset: {
|
|
18977
|
-
type: "string",
|
|
18978
|
-
enum: ["default", "direct", "pragmatic", "friendly", "professional"],
|
|
18979
|
-
description: "\u7528\u6237\u504F\u597D\u7684\u4EA4\u6D41\u8BED\u6C14\u3002"
|
|
18980
|
-
},
|
|
18981
|
-
knowledgeCaptureLevel: {
|
|
18982
|
-
type: "integer",
|
|
18983
|
-
enum: [1, 2, 3, 4],
|
|
18984
|
-
description: "\u77E5\u8BC6\u6C89\u6DC0\u7EA7\u522B\uFF1A1 \u4E0D\u4E3B\u52A8\u521B\u5EFA\uFF1B2 \u5148\u95EE\u518D\u521B\u5EFA\uFF1B3 \u56DE\u7B54\u540E\u5EFA\u8BAE\uFF1B4 \u9AD8\u4EF7\u503C\u7ED3\u679C\u53EF\u81EA\u52A8\u521B\u5EFA\u3002"
|
|
18985
|
-
},
|
|
18986
|
-
spaceContextLevel: {
|
|
18987
|
-
type: "integer",
|
|
18988
|
-
enum: [1, 2, 3, 4],
|
|
18989
|
-
description: "\u7A7A\u95F4\u4E0A\u4E0B\u6587\u7EA7\u522B\uFF1A1 \u4E0D\u81EA\u52A8\u8BFB\u53D6\uFF1B2 \u53EA\u770B\u7ED3\u6784\u548C\u6807\u9898\uFF1B3 \u8F7B\u91CF\u8BFB\u53D6\uFF1B4 \u81EA\u9002\u5E94\u8BFB\u53D6\u3002"
|
|
18990
|
-
},
|
|
18991
19241
|
autoApproveSelfUpdateFields: {
|
|
18992
19242
|
type: "array",
|
|
18993
19243
|
items: {
|
|
@@ -19013,10 +19263,6 @@ var updateUserPreferenceProfileFunctionSchema = {
|
|
|
19013
19263
|
},
|
|
19014
19264
|
description: "\u54EA\u4E9B updateSelf \u5B57\u6BB5\u4EE5\u540E\u4E0D\u518D\u8BE2\u95EE\u7528\u6237\uFF0C\u76F4\u63A5\u81EA\u52A8\u901A\u8FC7\u3002"
|
|
19015
19265
|
},
|
|
19016
|
-
globalPrompt: {
|
|
19017
|
-
type: "string",
|
|
19018
|
-
description: "\u53EF\u9009\uFF1A\u7528\u6237\u5E0C\u671B\u957F\u671F\u4FDD\u7559\u7684\u4E00\u5C0F\u6BB5\u901A\u7528\u504F\u597D\u8BF4\u660E\u3002\u672A\u660E\u786E\u786E\u8BA4\u65F6\u4E0D\u8981\u5199\u3002"
|
|
19019
|
-
},
|
|
19020
19266
|
defaultAgentId: {
|
|
19021
19267
|
type: "string",
|
|
19022
19268
|
description: "\u53EF\u9009\uFF1A\u7528\u6237\u660E\u786E\u8981\u6C42\u5207\u6362\u9996\u9875\u9ED8\u8BA4 agent \u65F6\u624D\u586B\u5199\u3002"
|
|
@@ -19030,26 +19276,12 @@ var updateUserPreferenceProfileFunctionSchema = {
|
|
|
19030
19276
|
};
|
|
19031
19277
|
async function updateUserPreferenceProfileFunc(args, thunkApi) {
|
|
19032
19278
|
const changes = {};
|
|
19033
|
-
if (args.userTonePreset) {
|
|
19034
|
-
changes.userTonePreset = args.userTonePreset;
|
|
19035
|
-
}
|
|
19036
|
-
if (typeof args.knowledgeCaptureLevel === "number") {
|
|
19037
|
-
changes.knowledgeCaptureLevel = args.knowledgeCaptureLevel;
|
|
19038
|
-
}
|
|
19039
|
-
if (typeof args.spaceContextLevel === "number") {
|
|
19040
|
-
changes.spaceContextLevel = args.spaceContextLevel;
|
|
19041
|
-
changes.enableReadCurrentSpace = args.spaceContextLevel > 1;
|
|
19042
|
-
}
|
|
19043
19279
|
if (Array.isArray(args.autoApproveSelfUpdateFields)) {
|
|
19044
19280
|
changes.autoApproveSelfUpdateFields = normalizeAgentUpdateFieldList(
|
|
19045
19281
|
args.autoApproveSelfUpdateFields,
|
|
19046
19282
|
[]
|
|
19047
19283
|
);
|
|
19048
19284
|
}
|
|
19049
|
-
const globalPrompt = asOptionalTrimmedString(args.globalPrompt);
|
|
19050
|
-
if (globalPrompt) {
|
|
19051
|
-
changes.globalPrompt = globalPrompt;
|
|
19052
|
-
}
|
|
19053
19285
|
const defaultAgentId = asOptionalTrimmedString(args.defaultAgentId);
|
|
19054
19286
|
if (defaultAgentId) {
|
|
19055
19287
|
changes.defaultAgentId = defaultAgentId;
|
|
@@ -19064,15 +19296,9 @@ async function updateUserPreferenceProfileFunc(args, thunkApi) {
|
|
|
19064
19296
|
summary: asOptionalTrimmedString(args.summary) ?? null
|
|
19065
19297
|
};
|
|
19066
19298
|
const labels = [];
|
|
19067
|
-
if (changes.userTonePreset) labels.push(`\u8BED\u6C14=${changes.userTonePreset}`);
|
|
19068
|
-
if (changes.knowledgeCaptureLevel)
|
|
19069
|
-
labels.push(`\u77E5\u8BC6\u6C89\u6DC0=${changes.knowledgeCaptureLevel}`);
|
|
19070
|
-
if (changes.spaceContextLevel)
|
|
19071
|
-
labels.push(`\u7A7A\u95F4\u8BFB\u53D6=${changes.spaceContextLevel}`);
|
|
19072
19299
|
if (changes.autoApproveSelfUpdateFields)
|
|
19073
19300
|
labels.push("\u81EA\u6211\u66F4\u65B0\u514D\u8BE2\u95EE\u5B57\u6BB5\u5DF2\u66F4\u65B0");
|
|
19074
19301
|
if (changes.defaultAgentId) labels.push("\u9ED8\u8BA4\u52A9\u624B\u5DF2\u66F4\u65B0");
|
|
19075
|
-
if (changes.globalPrompt) labels.push("\u901A\u7528\u63D0\u793A\u8BCD\u5DF2\u66F4\u65B0");
|
|
19076
19302
|
return {
|
|
19077
19303
|
rawData,
|
|
19078
19304
|
displayData: `\u5DF2\u4FDD\u5B58\u7528\u6237\u504F\u597D\uFF1A${labels.join("\uFF0C")}`
|
|
@@ -19328,7 +19554,7 @@ async function runZiweiChart(input) {
|
|
|
19328
19554
|
const gender = normalizeGender(input.gender);
|
|
19329
19555
|
const fixLeap = input.fixLeap !== false;
|
|
19330
19556
|
const isLeapMonth = input.isLeapMonth === true;
|
|
19331
|
-
const { astro } = await import("./lib-
|
|
19557
|
+
const { astro } = await import("./lib-62SWPXNF.js");
|
|
19332
19558
|
const rawChart = calendarType === "lunar" ? astro.byLunar(dateStr, timeIndex, gender, isLeapMonth, fixLeap, language) : astro.bySolar(dateStr, timeIndex, gender, fixLeap, language);
|
|
19333
19559
|
const palaces = rawChart.palaces.map((palace) => ({
|
|
19334
19560
|
index: palace.index,
|
|
@@ -19622,7 +19848,7 @@ var baseToolDefinitions = [
|
|
|
19622
19848
|
executor: updateUserPreferenceProfileFunc,
|
|
19623
19849
|
description: {
|
|
19624
19850
|
name: "updateUserPreferenceProfile",
|
|
19625
|
-
description: "\u4FDD\u5B58\u7528\u6237\u7684\
|
|
19851
|
+
description: "\u4FDD\u5B58\u7528\u6237\u7684\u5168\u5C40\u63D0\u793A\u8BCD\u7B49\u4E2A\u6027\u5316\u8BBE\u7F6E\u3002",
|
|
19626
19852
|
category: "\u7528\u6237\u8BBE\u7F6E / \u4E2A\u6027\u5316"
|
|
19627
19853
|
},
|
|
19628
19854
|
behavior: "action"
|
|
@@ -21345,6 +21571,7 @@ var findToolExecutor = (rawName) => {
|
|
|
21345
21571
|
};
|
|
21346
21572
|
|
|
21347
21573
|
export {
|
|
21574
|
+
selectMaxExecutionTime,
|
|
21348
21575
|
readXPostFunctionSchema,
|
|
21349
21576
|
readXPostFunc,
|
|
21350
21577
|
readXhsProfileFunctionSchema,
|