nolo-cli 0.225.0-alpha.1 → 0.225.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-L5VHAXSU.js → _executeModel-UCWDB72C.js} +79 -73
- package/{action-CK64LS6S.js → action-24MZYW2B.js} +11 -8
- package/{addContentAction-EQXMFNPR.js → addContentAction-HEMCSSHT.js} +14 -13
- package/{addDialogAgentAction-RSDZDASD.js → addDialogAgentAction-SQYDOXHA.js} +15 -14
- package/{agentDeleteCommand-4WC7INCX.js → agentDeleteCommand-P7O3ACNJ.js} +131 -124
- package/{agentEmailCommands-3XFR6WY7.js → agentEmailCommands-A5BRSYWK.js} +134 -123
- package/{agentFavoriteCommands-2LKGKSUD.js → agentFavoriteCommands-7LOP3HUD.js} +5 -5
- package/{agentGrantCommands-QQV4N4JW.js → agentGrantCommands-L6O2HVJI.js} +5 -5
- package/{agentListCommands-BBCP5XYW.js → agentListCommands-LDRCOOMO.js} +112 -496
- package/{agentMachineCommands-YZDCOLQL.js → agentMachineCommands-AYL53KJV.js} +65 -58
- package/{agentProviderCommands-7BSJH7TO.js → agentProviderCommands-N5EA3ED2.js} +6 -6
- package/{agentPullCommand-XN6ZPBUW.js → agentPullCommand-QQQZSC6S.js} +6 -6
- package/agentRecordCommands-FICBZ57C.js +188 -0
- package/{agentRunCommand-NHYBV4G5.js → agentRunCommand-CTXQGDUM.js} +135 -120
- package/{agentRunControl-7A2FOXIJ.js → agentRunControl-CO6BASZF.js} +20 -14
- package/{agentRuntimeLocal-GSTYFEX4.js → agentRuntimeLocal-5YN4D5WT.js} +48 -41
- package/{agentSlice-O6IGTM3Y.js → agentSlice-DJ5D4DU4.js} +18 -17
- package/{appDeleteCommands-L7HL4AWF.js → appDeleteCommands-B4E7N7M2.js} +58 -51
- package/{appDeployCommands-SGSUNFZR.js → appDeployCommands-E4DTXRRM.js} +58 -51
- package/{appDeployStatusCommands-AAA3XD54.js → appDeployStatusCommands-FCNHYHZM.js} +58 -51
- package/{appGetCommands-LN72GAOA.js → appGetCommands-4DXSQHUZ.js} +58 -51
- package/{appListCommands-IJQQ3VND.js → appListCommands-2NN5E4F6.js} +58 -51
- package/{authCommand-7JXW54U4.js → authCommand-47DR6GZT.js} +33 -28
- package/{authCommands-YDNAIDEY.js → authCommands-ZZ3L5IFM.js} +16 -11
- package/{builtinSkillRegistry-PXH7EGQB.js → builtinSkillRegistry-AYWYQVA4.js} +5 -5
- package/{chromeOpsCommands-YKX2QX3A.js → chromeOpsCommands-VZWAY2KR.js} +6 -6
- package/{chunk-YDBMZ7FV.js → chunk-24GVXSWK.js} +3 -3
- package/{chunk-JCK3EFZS.js → chunk-25OCZXSX.js} +63 -32
- package/{chunk-P2ZLUIW2.js → chunk-2BSLGODA.js} +350 -25
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-N5PQJKCY.js → chunk-2XMKW2OY.js} +13 -12
- package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
- package/{chunk-UKS7D2NL.js → chunk-3NFWMSTA.js} +111 -26
- package/{chunk-TZEP5J4A.js → chunk-3V6JT6WN.js} +2935 -1412
- package/{chunk-SBVTHMEG.js → chunk-4FE3IWRE.js} +1 -1
- package/{chunk-4JVNURX4.js → chunk-4YFC3DWW.js} +68 -16
- package/chunk-4ZCTKB27.js +31 -0
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-VFBVA3U2.js → chunk-5TJE4QCL.js} +131 -40
- package/{chunk-YXMBJ7UH.js → chunk-6BGJHJRN.js} +21 -21
- package/chunk-6D25V6CB.js +133 -0
- package/chunk-6RSNVJGO.js +279 -0
- package/{chunk-IZIN2UNJ.js → chunk-6X3CS6NJ.js} +203 -24
- package/{chunk-XZGQ6ZCV.js → chunk-6XBOPKUH.js} +27 -90
- package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
- package/{chunk-62HXNQVV.js → chunk-776CXKMX.js} +1 -1
- package/chunk-7NIBQ4HY.js +138 -0
- package/{chunk-7Z6EW7AH.js → chunk-7OTNBI77.js} +13 -6
- package/{chunk-HOK3ILHA.js → chunk-7Q7MKJZN.js} +590 -330
- package/{chunk-KZU52OJ5.js → chunk-7U2TFUWW.js} +6 -6
- package/{chunk-IUD7YR3B.js → chunk-B72AFRR2.js} +15 -15
- package/{chunk-4HFTBHBF.js → chunk-BDERPCJW.js} +8 -8
- package/chunk-BEM6LPD2.js +734 -0
- package/chunk-BIDSIRTS.js +307 -0
- package/{chunk-6J4TTPS2.js → chunk-BIJTI5SX.js} +5 -5
- package/chunk-BWW6WRX6.js +1438 -0
- package/{chunk-AGP3YSEC.js → chunk-C3GOEQJF.js} +46 -1
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-MOMR7NMG.js → chunk-C646JEUV.js} +2 -2
- package/{chunk-YI5CDUJD.js → chunk-CT6GT2BG.js} +9 -9
- package/{chunk-PVZY6P3S.js → chunk-CZLSTOVM.js} +2 -2
- package/{chunk-LJSNEV7M.js → chunk-DGUUOHBF.js} +8 -8
- package/{chunk-C4WTX5TU.js → chunk-DIBQXNGW.js} +2 -2
- package/{chunk-YFLVRVYK.js → chunk-DLT2DN4M.js} +1 -1
- package/{chunk-K44HIUBX.js → chunk-DLTMAXLF.js} +13 -13
- package/chunk-DVYAFH2Q.js +103 -0
- package/{chunk-SOG7OEXX.js → chunk-DWWUVRB5.js} +1 -1
- package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
- package/{chunk-GNHMRBYZ.js → chunk-EBKHA63G.js} +106 -14
- package/{chunk-KC4SCKXO.js → chunk-EIFSCI4C.js} +990 -1370
- package/{chunk-F3YK7KIU.js → chunk-EW37CXCQ.js} +4 -4
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-2VUZSVAS.js → chunk-F3FQPVHE.js} +57 -20
- package/{chunk-ZRAARRA3.js → chunk-FCAMGBLY.js} +1399 -2978
- package/{chunk-AK5O76CC.js → chunk-FPMPWNVQ.js} +3 -3
- package/{chunk-WQEMD4Z4.js → chunk-FSIEHQNH.js} +420 -120
- package/{chunk-FNDSBM4J.js → chunk-FXX6VFMV.js} +571 -348
- package/{chunk-7XS4W5KP.js → chunk-G6OPRPXH.js} +128 -149
- package/{chunk-PMDVQBGA.js → chunk-GAHJLSDO.js} +14 -7
- package/{chunk-2TIQO6TC.js → chunk-GCVFX6ZL.js} +206 -308
- package/{chunk-P25E3CKY.js → chunk-H6CHPU6M.js} +4 -4
- package/chunk-HNWZJI4N.js +33394 -0
- package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
- package/{chunk-KNIIRXHF.js → chunk-IPRPYKBP.js} +46 -8
- package/{chunk-C4VAR65S.js → chunk-IUXBKS5L.js} +200 -120
- package/{chunk-JVRQ6YVK.js → chunk-JBWXPACD.js} +1 -1
- package/{chunk-Z6USB65D.js → chunk-KGIIZXPL.js} +347 -14
- package/chunk-KK3FCYZM.js +647 -0
- package/{chunk-GBZ4YKEO.js → chunk-KOIDLCAQ.js} +8 -8
- package/{chunk-2ZKFCIJJ.js → chunk-LCQJH7KN.js} +1 -1
- package/{chunk-N5Z2V73W.js → chunk-LELADM5Q.js} +1 -1
- package/{chunk-4NA3YTBC.js → chunk-LMFMV5UC.js} +8 -8
- package/{chunk-XN23AUVU.js → chunk-LMZRXDWG.js} +8 -5
- package/{chunk-EWPDMS4N.js → chunk-LN4ZVSO7.js} +30 -15
- package/{chunk-GOAPXKQU.js → chunk-LT3DMEIB.js} +4 -4
- package/{chunk-GGKNJ42M.js → chunk-LYDEFPQP.js} +18 -108
- package/{chunk-FTQWYWUI.js → chunk-MDVP5TLI.js} +1 -1
- package/{chunk-EOWLBDY6.js → chunk-MM73SP4K.js} +1 -1
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-3QFLXA24.js → chunk-N6EN3HK3.js} +3 -3
- package/{chunk-D726I5AZ.js → chunk-NBB2EBQD.js} +2 -2
- package/{chunk-DISQCYPE.js → chunk-NL7J2J5Z.js} +6 -6
- package/{chunk-JM5C4EUA.js → chunk-NQQL2DKF.js} +6 -6
- package/{chunk-LS2MGTUS.js → chunk-NWWQY2J5.js} +15 -15
- package/{chunk-TXGQ4O5S.js → chunk-OATIWAKN.js} +20 -174
- package/{chunk-KYH7XW3K.js → chunk-OJRTTERA.js} +77 -2
- package/{chunk-VV7TXWOC.js → chunk-OYHJ4TW7.js} +6 -6
- package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
- package/{chunk-2VA6TU4I.js → chunk-QES2NCVM.js} +17 -14
- package/{chunk-WG2LFJYB.js → chunk-QGMIUVBT.js} +39 -30
- 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-AMEOV5VZ.js → chunk-S25VJYXV.js} +41 -35
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
- package/{chunk-GVGOEMNV.js → chunk-T444ENEC.js} +3 -3
- package/{chunk-67BE44IS.js → chunk-TE2XH4KH.js} +1 -1
- package/{chunk-5RKUPJYL.js → chunk-TFGGNRT6.js} +11 -3
- package/{chunk-ZH6MUQEO.js → chunk-TTEBPPUV.js} +1 -1
- package/{chunk-QVBXJNZ2.js → chunk-TUSTONB3.js} +1 -1
- package/{chunk-AVHRSJUH.js → chunk-TXFYIWAW.js} +32 -25
- package/{chunk-KOXKKHFE.js → chunk-TXQVH72L.js} +9 -4
- package/{chunk-OBSEKCVK.js → chunk-U4VSBDO5.js} +88 -0
- package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
- package/{chunk-KDAGMRDA.js → chunk-UAHUJ4HH.js} +100 -32
- package/{chunk-BGGHA5DV.js → chunk-UAOFSUG7.js} +1 -1
- package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
- package/chunk-UKSKCDBG.js +62 -0
- package/{chunk-KEN3N2TN.js → chunk-VMJVAJ6W.js} +13 -10
- package/{chunk-SOF4OWDM.js → chunk-VS276URX.js} +0 -2
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-UYOICCYG.js → chunk-WHO3LYDW.js} +64 -89
- package/{chunk-UJKTI5PG.js → chunk-WRKMXMU7.js} +2 -1
- package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
- package/{chunk-QLFCTYRH.js → chunk-X37RQEA3.js} +17 -10
- package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
- package/chunk-X7IA2B7R.js +166 -0
- package/{chunk-GIABSSWQ.js → chunk-XAFOLWLU.js} +4 -4
- package/{chunk-45LZIYXB.js → chunk-XNEDFWT4.js} +2 -2
- package/{chunk-EOJZGQAE.js → chunk-Y5RN44VH.js} +103 -100
- package/{chunk-OB6DVWPF.js → chunk-YFRJAE3R.js} +319 -95
- package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-3KNEE64G.js → chunk-YMCSR7PA.js} +14 -14
- package/chunk-YUZ2DAIH.js +34 -0
- package/chunk-Z6YTCDU4.js +24 -0
- package/{chunk-XQBIZRGW.js → chunk-ZBQ5UGYY.js} +3 -3
- package/{chunk-VREDDN25.js → chunk-ZQUCJBS4.js} +14 -9
- package/{chunk-UEKXWO7A.js → chunk-ZT3DYK5T.js} +15 -4
- package/{chunk-LM2PS3YS.js → chunk-ZTLTDUV6.js} +24 -11
- package/{chunk-KN3HEZIQ.js → chunk-ZVOL2MAJ.js} +1 -1
- package/{cliAgentConfigHelpers-KICKKNYQ.js → cliAgentConfigHelpers-RFR7ZCSK.js} +12 -12
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliEnvHelpers-VPSJ4XWC.js → cliEnvHelpers-CNMP3RDX.js} +1 -1
- package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
- package/{cliLocalAgentRecordReader-6FXGFBI3.js → cliLocalAgentRecordReader-AJ4UKHKT.js} +51 -45
- package/{commandRegistry-HJDPQSQ4.js → commandRegistry-IHWZVV4G.js} +98 -94
- package/{contentThunks-I6OR5ENG.js → contentThunks-YQRCBDKF.js} +38 -35
- package/{cooldownCommands-X7P5M2V5.js → cooldownCommands-W67DE765.js} +4 -4
- package/{createAgentAutomationAction-7BCCTWO5.js → createAgentAutomationAction-ERSDNR4R.js} +38 -35
- package/{createDialogAction-CU27KSCJ.js → createDialogAction-QXC7JZPE.js} +39 -37
- package/{createPageAction-CWRTEYVA.js → createPageAction-RLZ7776F.js} +40 -37
- package/{db-CS4ZJQKV.js → db-6NRZLEW2.js} +10 -7
- package/{dbSlice-ZJPDIFER.js → dbSlice-7M2ESEUO.js} +13 -12
- package/{deleteFile-Q3YDB4ML.js → deleteFile-WO6WSSNK.js} +10 -7
- package/{dialogCommands-OPTRZWTE.js → dialogCommands-UIRO4QNN.js} +62 -56
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-77B57PL6.js → dialogNotifyCommand-VDUFYBZV.js} +14 -14
- package/{dialogSlice-XODSLDHY.js → dialogSlice-A4U3C76D.js} +36 -33
- package/{dialogUsageCommand-HTVPR2CX.js → dialogUsageCommand-SEC6UZWM.js} +3 -3
- package/{docCreateCommands-36WS33BK.js → docCreateCommands-MHPYTJWR.js} +56 -49
- package/{docDeleteCommands-C4CS4XLF.js → docDeleteCommands-VYULMBAQ.js} +58 -51
- package/{docReadCommands-QZMSFMPN.js → docReadCommands-FV3GGZ7V.js} +56 -49
- package/{docStore-TVN4SNVE.js → docStore-AWWI72FA.js} +15 -14
- package/{docUpdateCommands-BYI64HVV.js → docUpdateCommands-JNS3HX7F.js} +56 -49
- package/fetchMessages-TQEUZD7H.js +2 -2
- package/{getPricing-VNGFM4PN.js → getPricing-U5AR7ZHS.js} +5 -5
- package/{handleSendMessageAction-NSEMVHWX.js → handleSendMessageAction-WDJOUDNV.js} +68 -63
- package/{hostCredentialCreate-WBZY7DZB.js → hostCredentialCreate-H3FF2SAO.js} +123 -111
- package/index.js +56 -18
- package/keys-RWF7UCB4.js +2 -2
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-SVTPA5GY.js → localDialogRead-3T2KMCRC.js} +1 -1
- package/{localRuntimeAdapter-OAIWERFA.js → localRuntimeAdapter-JAQQXZJP.js} +126 -113
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-7DKIT7UH.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
- package/{machineCommands-OI37ZUQ4.js → machineCommands-WYOFNB5I.js} +146 -120
- package/{machineWsRunDispatch-73HKPV6D.js → machineWsRunDispatch-Y7UIAZNM.js} +118 -107
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/mcpLocalAuthorizeCommand-SCYEFLRK.js +106 -0
- package/{memberThunks-JRYNONYV.js → memberThunks-DIITWU4M.js} +22 -17
- package/{memoryCommands-5WC3T66U.js → memoryCommands-BC6REPQB.js} +4 -4
- package/{models-H5NNZRLH.js → models-CINY5UZR.js} +2 -2
- package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
- package/package.json +1 -1
- package/{projectArchive-GVEARCOG.js → projectArchive-IZJXBW5N.js} +43 -40
- package/{providerPresetApply-J3WMRPD2.js → providerPresetApply-2QWXPJXZ.js} +6 -6
- package/{providerRegistry-KJGB5XWS.js → providerRegistry-W4LCKK6V.js} +6 -6
- package/{read-Q7GOHGNP.js → read-OBLJNMA2.js} +9 -8
- package/{readDocTool-Z5OQ6422.js → readDocTool-QQZ4DAER.js} +1 -1
- package/{readlineWorkspace-5DWUGNSU.js → readlineWorkspace-WF3SWZGR.js} +7055 -5248
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-U3F2MNAY.js → removeDialogAgentAction-HC3SOY3G.js} +17 -16
- package/{runAgentClientLoop-RDXIPF34.js → runAgentClientLoop-Z7V6TA3O.js} +97 -72
- package/{runtimeDoctorCommands-UXKXYBW6.js → runtimeDoctorCommands-KX6YLPWV.js} +17 -17
- package/{secretCommands-LJXOOYA7.js → secretCommands-STRAX275.js} +4 -4
- package/{setDialogExtraReferencesAction-G3WSJ7EM.js → setDialogExtraReferencesAction-DDZUQPY6.js} +16 -15
- package/{setPrimaryDialogAgentAction-6FHAHZBB.js → setPrimaryDialogAgentAction-EB67OMAJ.js} +17 -16
- package/{settingThunks-AXTBX3Q5.js → settingThunks-TN6GFASU.js} +181 -62
- package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-GUKMDRWN.js → spaceCommands-HBYQUVJI.js} +61 -54
- package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
- package/{streamAgentChatTurn-XEYQZPDJ.js → streamAgentChatTurn-CM7QQXOS.js} +178 -173
- package/{switchDialogAgentAction-UOFIAGPL.js → switchDialogAgentAction-XY5TKQQE.js} +15 -14
- package/{tableCommands-HITDSLHS.js → tableCommands-MXFL3JIT.js} +13 -10
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-53YMJ2G6.js} +8 -6
- package/{tools-6DFTHCFX.js → tools-AT6H73LD.js} +66 -62
- package/tuiRestart-272SAYSK.js +41 -0
- package/{tuiSummaryLlmCaller-7WLUKNP2.js → tuiSummaryLlmCaller-K2OVRVHG.js} +20 -19
- package/{updateCommands-RJVCRSBP.js → updateCommands-O3BOVVVN.js} +8 -6
- package/{updateDialogTitleAction-AMSBV2H7.js → updateDialogTitleAction-PGY4UPLH.js} +38 -35
- package/{usageCommand-YPJ2ZI2F.js → usageCommand-SCF3ROV2.js} +4 -4
- package/{usageRebuildCommand-FERQO74C.js → usageRebuildCommand-K5WPIBA5.js} +5 -5
- package/webapi-24RZDIIQ.js +2488 -0
- package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-WJDUZLEO.js} +2 -2
- package/workContext-Y3ADAPZU.js +14 -0
- package/workContextAccess-UZHDLBUR.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/agentRecordCommands-KLYKI4Z7.js +0 -177
- package/chunk-2THCNKE4.js +0 -147
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-5ZMIIR23.js +0 -265
- package/chunk-652XYZGP.js +0 -352
- package/chunk-BJF2MHJ3.js +0 -118
- package/chunk-KEPOVMF4.js +0 -91
- package/chunk-QZI44GWV.js +0 -776
- package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +3 -3
- 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/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
- package/{offlineMarxistsAgentCommand-4IC3Y4C6.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +3 -3
- package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-HFJIN5IZ.js} +8 -8
|
@@ -1,13 +1,30 @@
|
|
|
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-BWW6WRX6.js";
|
|
10
|
+
import {
|
|
11
|
+
normalizeTopicKey
|
|
12
|
+
} from "./chunk-MVOZ22RZ.js";
|
|
13
|
+
import {
|
|
14
|
+
formatWorkContextWriteNotice
|
|
15
|
+
} from "./chunk-WDWZPASX.js";
|
|
16
|
+
import {
|
|
17
|
+
AGENT_UPDATE_FIELD_NAMES,
|
|
18
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS,
|
|
19
|
+
normalizeAgentUpdateFieldList,
|
|
20
|
+
normalizeSystemBuiltinSkills,
|
|
21
|
+
normalizeUiPlugins
|
|
22
|
+
} from "./chunk-LYDEFPQP.js";
|
|
23
|
+
import {
|
|
24
|
+
applyFetchSpaceFulfilled,
|
|
25
|
+
fetchAuthoritativeRemoteSpace,
|
|
26
|
+
selectSpaceRemoteAuth
|
|
27
|
+
} from "./chunk-TXQVH72L.js";
|
|
11
28
|
import {
|
|
12
29
|
ToolResultError,
|
|
13
30
|
clipMultilineText,
|
|
@@ -16,42 +33,21 @@ import {
|
|
|
16
33
|
loadSkillFunc,
|
|
17
34
|
loadSkillFunctionSchema,
|
|
18
35
|
parseUiCard,
|
|
19
|
-
|
|
36
|
+
resolveMemoryToolContext,
|
|
37
|
+
resolveToolAttributionContext,
|
|
20
38
|
toolRunUpdated,
|
|
21
39
|
uiCardFallback,
|
|
22
40
|
waitForAbortableDelay
|
|
23
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-Y5RN44VH.js";
|
|
24
42
|
import {
|
|
25
43
|
isGatewayHttpStatus
|
|
26
44
|
} from "./chunk-NF64D32W.js";
|
|
27
45
|
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";
|
|
46
|
+
resolveUserEnabledSkills
|
|
47
|
+
} from "./chunk-DVYAFH2Q.js";
|
|
47
48
|
import {
|
|
48
49
|
createDocState
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import {
|
|
51
|
-
applyFetchSpaceFulfilled,
|
|
52
|
-
fetchAuthoritativeRemoteSpace,
|
|
53
|
-
selectSpaceRemoteAuth
|
|
54
|
-
} from "./chunk-KOXKKHFE.js";
|
|
50
|
+
} from "./chunk-EW37CXCQ.js";
|
|
55
51
|
import {
|
|
56
52
|
ToolApiError,
|
|
57
53
|
buildToolRequestHeaders,
|
|
@@ -59,20 +55,19 @@ import {
|
|
|
59
55
|
getRequestConfig,
|
|
60
56
|
getToolBaseUrl,
|
|
61
57
|
getToolRequestContext
|
|
62
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-4YFC3DWW.js";
|
|
63
59
|
import {
|
|
64
60
|
readDocFunc,
|
|
65
61
|
readDocFunctionSchema,
|
|
66
62
|
readPageFunc,
|
|
67
63
|
readPageFunctionSchema,
|
|
68
64
|
resolvePageReadMarkdown
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import {
|
|
71
|
-
shareResourceAction
|
|
72
|
-
} from "./chunk-AK5O76CC.js";
|
|
65
|
+
} from "./chunk-UAOFSUG7.js";
|
|
73
66
|
import {
|
|
74
|
-
createDialogAction
|
|
75
|
-
|
|
67
|
+
createDialogAction,
|
|
68
|
+
uiAskChoiceFunc,
|
|
69
|
+
uiAskChoiceFunctionSchema
|
|
70
|
+
} from "./chunk-KGIIZXPL.js";
|
|
76
71
|
import {
|
|
77
72
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
78
73
|
addContentToSpace,
|
|
@@ -89,27 +84,7 @@ import {
|
|
|
89
84
|
updateContentCategory,
|
|
90
85
|
updateContentTitle,
|
|
91
86
|
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-FNDSBM4J.js";
|
|
106
|
-
import {
|
|
107
|
-
createAgent,
|
|
108
|
-
deleteServerSyncedCredential,
|
|
109
|
-
runLlm,
|
|
110
|
-
streamAgentChatTurn,
|
|
111
|
-
updateAgent
|
|
112
|
-
} from "./chunk-K44HIUBX.js";
|
|
87
|
+
} from "./chunk-6BGJHJRN.js";
|
|
113
88
|
import {
|
|
114
89
|
addMemberSpace,
|
|
115
90
|
getAllMemberSpaces,
|
|
@@ -126,28 +101,58 @@ import {
|
|
|
126
101
|
setViewMode,
|
|
127
102
|
updateCurrentSpaceIfMatch,
|
|
128
103
|
updateMemberSpaceName
|
|
129
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-C646JEUV.js";
|
|
105
|
+
import {
|
|
106
|
+
buildDatabaseFileContentUrl,
|
|
107
|
+
deleteDialog,
|
|
108
|
+
runtime_default,
|
|
109
|
+
selectAllMsgs,
|
|
110
|
+
selectCurrentDialogConfig,
|
|
111
|
+
selectCurrentDialogId,
|
|
112
|
+
selectMsgById
|
|
113
|
+
} from "./chunk-FXX6VFMV.js";
|
|
114
|
+
import {
|
|
115
|
+
createAgent,
|
|
116
|
+
deleteServerSyncedCredential,
|
|
117
|
+
runLlm,
|
|
118
|
+
streamAgentChatTurn,
|
|
119
|
+
updateAgent
|
|
120
|
+
} from "./chunk-DLTMAXLF.js";
|
|
130
121
|
import {
|
|
131
122
|
buildMediaToolConfirmation,
|
|
132
123
|
normalizeMediaConfirmExecutionRevision
|
|
133
124
|
} from "./chunk-QYPE3TS3.js";
|
|
134
125
|
import {
|
|
135
|
-
getActiveDialogKey,
|
|
136
|
-
selectCurrentDialogKey,
|
|
137
126
|
selectPendingRawDataByPageKey
|
|
138
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-I2OYPD3Y.js";
|
|
139
128
|
import {
|
|
140
129
|
require_react
|
|
141
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-RD3QLZQV.js";
|
|
131
|
+
import {
|
|
132
|
+
resolveDefaultReasoningEffort
|
|
133
|
+
} from "./chunk-YUZ2DAIH.js";
|
|
134
|
+
import {
|
|
135
|
+
fetchWithTransientRetry
|
|
136
|
+
} from "./chunk-DXWGFL2Z.js";
|
|
137
|
+
import {
|
|
138
|
+
CORE_DRAIN_REASON,
|
|
139
|
+
DRAIN_EXHAUSTED_USER_MESSAGE,
|
|
140
|
+
isDrainExhaustedResponse,
|
|
141
|
+
normalizeNonNegativeMs,
|
|
142
|
+
parseRetryAfterHeaderMs
|
|
143
|
+
} from "./chunk-3L2WKC3W.js";
|
|
144
|
+
import {
|
|
145
|
+
shareResourceAction
|
|
146
|
+
} from "./chunk-FPMPWNVQ.js";
|
|
142
147
|
import {
|
|
143
148
|
selectCurrentServer,
|
|
144
149
|
selectSyncServers
|
|
145
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-ZQUCJBS4.js";
|
|
146
151
|
import {
|
|
147
152
|
UNCATEGORIZED_ID,
|
|
148
153
|
addContentAction,
|
|
149
154
|
checkSpaceMembership
|
|
150
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-CZLSTOVM.js";
|
|
151
156
|
import {
|
|
152
157
|
createSpaceKey,
|
|
153
158
|
normalizeSpaceId
|
|
@@ -163,14 +168,10 @@ import {
|
|
|
163
168
|
selectEntities,
|
|
164
169
|
toTimestampMs,
|
|
165
170
|
write
|
|
166
|
-
} from "./chunk-
|
|
167
|
-
import {
|
|
168
|
-
getUserDataItemTimestamp,
|
|
169
|
-
mergeAndDedupUserData
|
|
170
|
-
} from "./chunk-GBWGPTA7.js";
|
|
171
|
+
} from "./chunk-TXFYIWAW.js";
|
|
171
172
|
import {
|
|
172
173
|
readAction
|
|
173
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-X37RQEA3.js";
|
|
174
175
|
import {
|
|
175
176
|
DEVICE_LOCAL_OWNER_ID,
|
|
176
177
|
getRuntimeServerContext,
|
|
@@ -180,16 +181,36 @@ import {
|
|
|
180
181
|
resolveEffectiveSpaceActorId,
|
|
181
182
|
resolveRecordOwnerUserId,
|
|
182
183
|
selectRuntimeSnapshot
|
|
183
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-F3FQPVHE.js";
|
|
184
185
|
import {
|
|
185
186
|
createAsyncThunk,
|
|
187
|
+
createSelector,
|
|
186
188
|
noloWriteRequest
|
|
187
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-7OTNBI77.js";
|
|
188
190
|
import {
|
|
189
191
|
selectIdentityToken,
|
|
190
192
|
selectIdentityUserBalance,
|
|
191
193
|
selectIdentityUserId
|
|
192
194
|
} from "./chunk-PXYBUFDB.js";
|
|
195
|
+
import {
|
|
196
|
+
getUserDataItemTimestamp,
|
|
197
|
+
mergeAndDedupUserData
|
|
198
|
+
} from "./chunk-GBWGPTA7.js";
|
|
199
|
+
import {
|
|
200
|
+
RUN_TITLE_MAX,
|
|
201
|
+
TASK_PREVIEW_MAX,
|
|
202
|
+
buildDelegatedTaskContent,
|
|
203
|
+
calculateDelegatedPayloadMetrics,
|
|
204
|
+
formatAgentListCard,
|
|
205
|
+
formatListRunsCard,
|
|
206
|
+
formatNotFoundRunCard,
|
|
207
|
+
formatStartRunCard,
|
|
208
|
+
formatStatusRunCard,
|
|
209
|
+
formatStopRunCard,
|
|
210
|
+
normalizeRunTitle,
|
|
211
|
+
resolveAgentRunName,
|
|
212
|
+
resolveRunLabel
|
|
213
|
+
} from "./chunk-S25VJYXV.js";
|
|
193
214
|
import {
|
|
194
215
|
buildTombstoneRecord,
|
|
195
216
|
isTombstoneRecord
|
|
@@ -212,24 +233,24 @@ import {
|
|
|
212
233
|
normalizeNoloSpaceInput,
|
|
213
234
|
resolveNoloDialogInput,
|
|
214
235
|
verifyNoloDialogSubjectRefQuery
|
|
215
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-IUXBKS5L.js";
|
|
216
237
|
import {
|
|
217
238
|
mergeAvailabilityDeadline,
|
|
218
239
|
resolveCredentialKeyWithFallback
|
|
219
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-QJTZ76CP.js";
|
|
220
241
|
import {
|
|
221
242
|
redactAgentRecordForWorkspaceTool,
|
|
222
243
|
resolveReadOnlyToolConstraints
|
|
223
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-VS276URX.js";
|
|
224
245
|
import {
|
|
225
246
|
clipCompactText
|
|
226
247
|
} from "./chunk-5MMAK75Q.js";
|
|
248
|
+
import {
|
|
249
|
+
createFileCredentialBroker
|
|
250
|
+
} from "./chunk-OQHIVPG4.js";
|
|
227
251
|
import {
|
|
228
252
|
asRecordOrEmpty
|
|
229
253
|
} from "./chunk-KX6YBIHG.js";
|
|
230
|
-
import {
|
|
231
|
-
createFileCredentialBroker
|
|
232
|
-
} from "./chunk-SNBZZPYH.js";
|
|
233
254
|
import {
|
|
234
255
|
compactWhitespace
|
|
235
256
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -237,8 +258,9 @@ import {
|
|
|
237
258
|
isAbortError
|
|
238
259
|
} from "./chunk-7DPNBQSV.js";
|
|
239
260
|
import {
|
|
240
|
-
CAPABILITY_PACKS
|
|
241
|
-
|
|
261
|
+
CAPABILITY_PACKS,
|
|
262
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
263
|
+
} from "./chunk-EBKHA63G.js";
|
|
242
264
|
import {
|
|
243
265
|
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
244
266
|
canonicalizeToolName,
|
|
@@ -276,8 +298,12 @@ import {
|
|
|
276
298
|
toTrimmedString
|
|
277
299
|
} from "./chunk-SYTHYBMI.js";
|
|
278
300
|
import {
|
|
301
|
+
dialogMessageKey,
|
|
279
302
|
dialogMessageRange,
|
|
280
303
|
isDialogKey,
|
|
304
|
+
isDialogRecordKey,
|
|
305
|
+
isDialogRecordKeyForId,
|
|
306
|
+
parseDialogKey,
|
|
281
307
|
ulid
|
|
282
308
|
} from "./chunk-OJKUU3LP.js";
|
|
283
309
|
import {
|
|
@@ -285,20 +311,8 @@ import {
|
|
|
285
311
|
asTrimmedNonEmptyStringArray
|
|
286
312
|
} from "./chunk-I42VC5KR.js";
|
|
287
313
|
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";
|
|
314
|
+
API_ENDPOINTS
|
|
315
|
+
} from "./chunk-LCBAMY2M.js";
|
|
302
316
|
import {
|
|
303
317
|
toErrorMessage
|
|
304
318
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -309,19 +323,13 @@ import {
|
|
|
309
323
|
DEFAULT_MODEL,
|
|
310
324
|
clampReasoningEffort,
|
|
311
325
|
resolveModelReasoningCapabilityWithCache
|
|
312
|
-
} from "./chunk-
|
|
326
|
+
} from "./chunk-OJRTTERA.js";
|
|
313
327
|
import {
|
|
314
328
|
isRecord
|
|
315
329
|
} from "./chunk-KUG52IAP.js";
|
|
316
|
-
import {
|
|
317
|
-
asTrimmedLowercaseString
|
|
318
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
319
330
|
import {
|
|
320
331
|
asOptionalFiniteNumber
|
|
321
332
|
} from "./chunk-WWC7I6TA.js";
|
|
322
|
-
import {
|
|
323
|
-
API_ENDPOINTS
|
|
324
|
-
} from "./chunk-LCBAMY2M.js";
|
|
325
333
|
import {
|
|
326
334
|
asOptionalTrimmedString
|
|
327
335
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -331,6 +339,9 @@ import {
|
|
|
331
339
|
import {
|
|
332
340
|
normalizeServerOrigin
|
|
333
341
|
} from "./chunk-CF7PE763.js";
|
|
342
|
+
import {
|
|
343
|
+
asTrimmedLowercaseString
|
|
344
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
334
345
|
import {
|
|
335
346
|
__toESM
|
|
336
347
|
} from "./chunk-U67V476Y.js";
|
|
@@ -1023,7 +1034,7 @@ var HOSTED_EXEC_RUNTIME_TOOL_POLICY = {
|
|
|
1023
1034
|
workspace: { mode: "lease" }
|
|
1024
1035
|
};
|
|
1025
1036
|
var findModelConfig = async (modelName, provider) => {
|
|
1026
|
-
const { ALL_MODELS } = await import("./models-
|
|
1037
|
+
const { ALL_MODELS } = await import("./models-CINY5UZR.js");
|
|
1027
1038
|
const name = toTrimmedString(modelName);
|
|
1028
1039
|
const prov = toTrimmedString(provider ?? "");
|
|
1029
1040
|
if (!name) return null;
|
|
@@ -1268,7 +1279,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
|
|
|
1268
1279
|
const trimmedModel = toTrimmedString(model);
|
|
1269
1280
|
const trimmedProvider = toTrimmedString(provider);
|
|
1270
1281
|
const modelConfig = await findModelConfig(trimmedModel, trimmedProvider);
|
|
1271
|
-
const { getModelPricing } = await import("./getPricing-
|
|
1282
|
+
const { getModelPricing } = await import("./getPricing-U5AR7ZHS.js");
|
|
1272
1283
|
const normalizedTools = tools ?? [];
|
|
1273
1284
|
const resolvedRuntimeToolPolicy = runtimeToolPolicy ?? (normalizedTools.includes("execShell") ? HOSTED_EXEC_RUNTIME_TOOL_POLICY : void 0);
|
|
1274
1285
|
const formData = {
|
|
@@ -1310,7 +1321,7 @@ var buildPlatformFormDataFromArgs = async (args) => {
|
|
|
1310
1321
|
frequency_penalty,
|
|
1311
1322
|
presence_penalty,
|
|
1312
1323
|
max_tokens,
|
|
1313
|
-
reasoning_effort: reasoning_effort ?? "medium",
|
|
1324
|
+
reasoning_effort: reasoning_effort ?? resolveDefaultReasoningEffort({ provider: trimmedProvider, model: trimmedModel, fallback: "medium" }),
|
|
1314
1325
|
whitelist: []
|
|
1315
1326
|
};
|
|
1316
1327
|
return formData;
|
|
@@ -1328,6 +1339,10 @@ var findSpaceConfig = (nameOrId, allSpaces) => {
|
|
|
1328
1339
|
};
|
|
1329
1340
|
async function createAgentToolFunc(args, thunkApi, runtime) {
|
|
1330
1341
|
const state2 = thunkApi.getState();
|
|
1342
|
+
const { spaceId } = resolveToolAttributionContext(state2, runtime, {
|
|
1343
|
+
requireAgentKey: false,
|
|
1344
|
+
errorLabel: "\u521B\u5EFA Agent \u5931\u8D25\uFF1A\u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E"
|
|
1345
|
+
});
|
|
1331
1346
|
const currentUserId = selectIdentityUserId(state2);
|
|
1332
1347
|
const currentBalance = selectIdentityUserBalance(state2);
|
|
1333
1348
|
const allSpaces = getAllMemberSpaces();
|
|
@@ -1411,16 +1426,15 @@ ${availableList}`
|
|
|
1411
1426
|
createAgent({
|
|
1412
1427
|
userId: currentUserId,
|
|
1413
1428
|
formData,
|
|
1414
|
-
spaceId
|
|
1429
|
+
spaceId
|
|
1415
1430
|
})
|
|
1416
1431
|
).unwrap();
|
|
1417
1432
|
assertForkedAgentProviderConfig(agent, expectedProviderConfig);
|
|
1418
|
-
|
|
1419
|
-
if (currentSpaceId) {
|
|
1433
|
+
if (spaceId) {
|
|
1420
1434
|
const agentDbKey = agent.isPublic ? createAgentKey.public(agent.id) : createAgentKey.private(currentUserId, agent.id);
|
|
1421
1435
|
try {
|
|
1422
1436
|
await thunkApi.dispatch(addContentToSpace({
|
|
1423
|
-
spaceId
|
|
1437
|
+
spaceId,
|
|
1424
1438
|
title: agent.name || "\u672A\u547D\u540D\u667A\u80FD\u4F53",
|
|
1425
1439
|
type: "agent" /* AGENT */,
|
|
1426
1440
|
// 统一使用 ContentType.AGENT
|
|
@@ -1523,6 +1537,34 @@ ${effortNote}` : "")
|
|
|
1523
1537
|
};
|
|
1524
1538
|
}
|
|
1525
1539
|
|
|
1540
|
+
// packages/ai/tools/knowledgeCaptureConfirmation.ts
|
|
1541
|
+
function canonical(value) {
|
|
1542
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
1543
|
+
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(",")}}`;
|
|
1544
|
+
return JSON.stringify(value);
|
|
1545
|
+
}
|
|
1546
|
+
function requireKnowledgeCaptureConfirmation(args, operation, input, preview = input) {
|
|
1547
|
+
const binding = canonical({ operation, input, preview });
|
|
1548
|
+
if (args.__confirmedKnowledgeCapture === binding) return;
|
|
1549
|
+
const confirmationInput = { ...input, __confirmedKnowledgeCapture: binding };
|
|
1550
|
+
throw new ToolResultError("\u4FDD\u5B58\u524D\u8BF7\u786E\u8BA4\u5185\u5BB9\u4E0E\u76EE\u6807\u7A7A\u95F4\u3002", {
|
|
1551
|
+
code: "knowledge_capture_requires_confirmation",
|
|
1552
|
+
retryable: false,
|
|
1553
|
+
displayData: "\u786E\u8BA4\u4FDD\u5B58\uFF1F\u8BF7\u6838\u5BF9\u672C\u6B21\u5B8C\u6574\u5185\u5BB9\u4E0E\u76EE\u6807\u7A7A\u95F4\u3002",
|
|
1554
|
+
rawData: {
|
|
1555
|
+
error: "knowledge_capture_requires_confirmation",
|
|
1556
|
+
operation,
|
|
1557
|
+
confirmationInput,
|
|
1558
|
+
preview
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
async function checkKnowledgeCaptureTarget(spaceId, api) {
|
|
1563
|
+
if (!spaceId) return;
|
|
1564
|
+
const space = await api.dispatch(read({ dbKey: createSpaceKey.space(spaceId) })).unwrap();
|
|
1565
|
+
checkSpaceMembership(space, selectIdentityUserId(api.getState()));
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1526
1568
|
// packages/ai/tools/createDocTool.ts
|
|
1527
1569
|
var createDocFunctionSchema = {
|
|
1528
1570
|
name: "createDoc",
|
|
@@ -1581,18 +1623,20 @@ async function createDocFunc(args, thunkApi) {
|
|
|
1581
1623
|
const categoryId = rawCategoryId || void 0;
|
|
1582
1624
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
1583
1625
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
1584
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
1626
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
1585
1627
|
const rawContent = (args.content ?? "").trim();
|
|
1586
1628
|
const content = rawContent || void 0;
|
|
1629
|
+
requireKnowledgeCaptureConfirmation(args, "createDoc", { title, content: content ?? "", categoryId: categoryId ?? "", spaceId: spaceId ?? "" });
|
|
1630
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
1587
1631
|
try {
|
|
1588
1632
|
console.log("[createDocTool] dispatching createDoc with:", {
|
|
1589
1633
|
title,
|
|
1590
|
-
spaceId,
|
|
1634
|
+
spaceId: spaceId ?? "",
|
|
1591
1635
|
categoryId,
|
|
1592
1636
|
content
|
|
1593
1637
|
});
|
|
1594
1638
|
const id = await createDocState(
|
|
1595
|
-
{ title, spaceId, categoryId, content },
|
|
1639
|
+
{ title, spaceId: spaceId ?? "", categoryId, content },
|
|
1596
1640
|
{ dispatch, getState }
|
|
1597
1641
|
);
|
|
1598
1642
|
console.log("[createDocTool] createDoc success, id:", id);
|
|
@@ -1682,26 +1726,26 @@ var updateHtmlArtifactFunctionSchema = {
|
|
|
1682
1726
|
required: ["id", "html"]
|
|
1683
1727
|
}
|
|
1684
1728
|
};
|
|
1685
|
-
var
|
|
1729
|
+
var resolveArtifactDialogKey = (thunkApi, explicitDialogKey, context2) => {
|
|
1686
1730
|
if (explicitDialogKey && typeof explicitDialogKey === "string" && explicitDialogKey.trim()) {
|
|
1687
1731
|
return explicitDialogKey.trim();
|
|
1688
1732
|
}
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
if (
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1733
|
+
const state2 = thunkApi?.getState?.();
|
|
1734
|
+
const { dialogId } = resolveToolAttributionContext(state2, context2, {
|
|
1735
|
+
requireAgentKey: false,
|
|
1736
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A HTML artifact \u5F52\u5C5E"
|
|
1737
|
+
});
|
|
1738
|
+
if (context2?.dialogKey?.trim()) return context2.dialogKey.trim();
|
|
1739
|
+
return Object.keys(state2.db.entities).find(
|
|
1740
|
+
(key2) => isDialogRecordKeyForId(key2, dialogId) && state2.db.entities[key2]?.id?.trim() === dialogId
|
|
1741
|
+
);
|
|
1698
1742
|
};
|
|
1699
|
-
async function createHtmlArtifactFunc(args, thunkApi) {
|
|
1743
|
+
async function createHtmlArtifactFunc(args, thunkApi, context2) {
|
|
1700
1744
|
const html = typeof args?.html === "string" ? args.html : "";
|
|
1701
1745
|
if (!html.trim()) {
|
|
1702
1746
|
throw new Error("createHtmlArtifact: html \u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A\u3002");
|
|
1703
1747
|
}
|
|
1704
|
-
const dialogKey =
|
|
1748
|
+
const dialogKey = resolveArtifactDialogKey(thunkApi, args?.dialogKey, context2);
|
|
1705
1749
|
const title = typeof args?.title === "string" && args.title.trim() ? args.title.trim() : DEFAULT_HTML_ARTIFACT_TITLE;
|
|
1706
1750
|
const response = await callToolApi(
|
|
1707
1751
|
thunkApi,
|
|
@@ -1986,12 +2030,15 @@ async function createSkillDocFunc(args, thunkApi) {
|
|
|
1986
2030
|
const { title, content, skillConfig, evalConfig } = buildSkillDocFromArgs(args);
|
|
1987
2031
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
1988
2032
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
1989
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
2033
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
1990
2034
|
const categoryId = (args.categoryId ?? "").trim() || void 0;
|
|
2035
|
+
const { __confirmedKnowledgeCapture: _confirmation, ...source } = args;
|
|
2036
|
+
requireKnowledgeCaptureConfirmation(args, "createSkillDoc", { ...source, spaceId: spaceId ?? "", categoryId: categoryId ?? "" }, { title, content, spaceId: spaceId ?? "", categoryId: categoryId ?? "" });
|
|
2037
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
1991
2038
|
const id = await createDocState(
|
|
1992
2039
|
{
|
|
1993
2040
|
title,
|
|
1994
|
-
spaceId,
|
|
2041
|
+
spaceId: spaceId ?? "",
|
|
1995
2042
|
categoryId,
|
|
1996
2043
|
content
|
|
1997
2044
|
},
|
|
@@ -2371,12 +2418,14 @@ Imported from: ${url}` : ""
|
|
|
2371
2418
|
});
|
|
2372
2419
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
2373
2420
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
2374
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
2421
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
2375
2422
|
const categoryId = (args.categoryId ?? "").trim() || void 0;
|
|
2423
|
+
requireKnowledgeCaptureConfirmation(args, "importSkill", { content: rawMarkdown, title: docTitle, url, spaceId: spaceId ?? "", categoryId: categoryId ?? "" }, { title: docTitle, content, spaceId: spaceId ?? "", categoryId: categoryId ?? "" });
|
|
2424
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
2376
2425
|
const id = await createDocState(
|
|
2377
2426
|
{
|
|
2378
2427
|
title: docTitle,
|
|
2379
|
-
spaceId,
|
|
2428
|
+
spaceId: spaceId ?? "",
|
|
2380
2429
|
categoryId,
|
|
2381
2430
|
content
|
|
2382
2431
|
},
|
|
@@ -3904,7 +3953,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3904
3953
|
const deletedDialogIds = [];
|
|
3905
3954
|
const deletedDialogKeys = [];
|
|
3906
3955
|
const failures = [];
|
|
3907
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3956
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-A4U3C76D.js");
|
|
3908
3957
|
for (const target of targets) {
|
|
3909
3958
|
try {
|
|
3910
3959
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -3970,7 +4019,7 @@ async function fetchUserFavoriteAgentMap(thunkApi) {
|
|
|
3970
4019
|
}
|
|
3971
4020
|
var listAgentsFunctionSchema = {
|
|
3972
4021
|
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:
|
|
4022
|
+
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
4023
|
parameters: {
|
|
3975
4024
|
type: "object",
|
|
3976
4025
|
properties: {
|
|
@@ -3987,23 +4036,34 @@ var listAgentsFunctionSchema = {
|
|
|
3987
4036
|
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
4037
|
},
|
|
3989
4038
|
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." }
|
|
4039
|
+
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." },
|
|
4040
|
+
offset: { type: "integer", description: "Optional pagination offset for agent candidates. Default 0." },
|
|
4041
|
+
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." },
|
|
4042
|
+
fragmentAgentKey: { type: "string", description: "Exact agentKey from the oversized-candidate response." },
|
|
4043
|
+
fragmentDigest: { type: "string", description: "SHA-256 digest from the first fragment; required for subsequent fragments to detect candidate changes." }
|
|
3992
4044
|
}
|
|
3993
4045
|
}
|
|
3994
4046
|
};
|
|
3995
|
-
async function listAgentsFunc(args, thunkApi) {
|
|
4047
|
+
async function listAgentsFunc(args, thunkApi, context2) {
|
|
3996
4048
|
const runtime = getRuntime(thunkApi);
|
|
3997
4049
|
if (!runtime?.currentUserId || !runtime?.currentToken) {
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
total: 0,
|
|
4002
|
-
unavailableCount: 0,
|
|
4050
|
+
const rawData2 = {
|
|
4051
|
+
success: true,
|
|
4052
|
+
...buildAgentDiscoveryResult({
|
|
4003
4053
|
agents: [],
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4054
|
+
upstreamTruncated: true,
|
|
4055
|
+
caller: {
|
|
4056
|
+
agentKey: context2?.agentKey,
|
|
4057
|
+
effectiveModel: context2?.effectiveModel,
|
|
4058
|
+
runKind: context2?.runKind ?? (context2?.origin === "agent" ? "subtask" : "interactive")
|
|
4059
|
+
}
|
|
4060
|
+
})
|
|
4061
|
+
};
|
|
4062
|
+
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;
|
|
4063
|
+
return {
|
|
4064
|
+
rawData: delivered2,
|
|
4065
|
+
displayData: formatAgentListCard([]),
|
|
4066
|
+
...args?.compact === true && args?.verbose !== true ? { llmContext: JSON.stringify(delivered2) } : {}
|
|
4007
4067
|
};
|
|
4008
4068
|
}
|
|
4009
4069
|
const pagination = resolvePaginationArgs({ limit: args?.limit, offset: args?.offset });
|
|
@@ -4017,7 +4077,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4017
4077
|
const favoritesMap = await fetchUserFavoriteAgentMap(thunkApi);
|
|
4018
4078
|
const scope = resolveDiscoveryScope({ scope: args?.scope, publicOnly: args?.publicOnly });
|
|
4019
4079
|
let publicRecords = [];
|
|
4020
|
-
let upstreamTruncated =
|
|
4080
|
+
let upstreamTruncated = userRecords.length >= (Number.isFinite(upstreamFetchLimit) ? upstreamFetchLimit : 500);
|
|
4021
4081
|
let upstreamTotal;
|
|
4022
4082
|
if (scope !== "preferred") {
|
|
4023
4083
|
const discoveryRes = await fetchPublicAgentsForDiscovery({
|
|
@@ -4026,7 +4086,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4026
4086
|
limit: upstreamFetchLimit
|
|
4027
4087
|
});
|
|
4028
4088
|
publicRecords = discoveryRes.agents;
|
|
4029
|
-
upstreamTruncated = discoveryRes.truncated;
|
|
4089
|
+
upstreamTruncated = upstreamTruncated || discoveryRes.truncated;
|
|
4030
4090
|
upstreamTotal = discoveryRes.total;
|
|
4031
4091
|
}
|
|
4032
4092
|
const recordsMap = /* @__PURE__ */ new Map();
|
|
@@ -4075,7 +4135,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4075
4135
|
localDeadline = mergeAvailabilityDeadline(localDeadline, at);
|
|
4076
4136
|
}
|
|
4077
4137
|
}
|
|
4078
|
-
for (const ref of [record?.apiKeyRef, record?.credentialRef]) {
|
|
4138
|
+
for (const ref of credKey?.includes("|quota:") ? [] : [record?.apiKeyRef, record?.credentialRef]) {
|
|
4079
4139
|
if (typeof ref === "string" && ref.trim()) {
|
|
4080
4140
|
const at = localCooldowns[ref.trim()];
|
|
4081
4141
|
if (typeof at === "number" && at > now) {
|
|
@@ -4083,7 +4143,7 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4083
4143
|
}
|
|
4084
4144
|
}
|
|
4085
4145
|
}
|
|
4086
|
-
if (summary.credentialGroup && summary.isOwned !== false) {
|
|
4146
|
+
if (summary.credentialGroup && summary.isOwned !== false && !credKey?.includes("|quota:")) {
|
|
4087
4147
|
const at = localCooldowns[summary.credentialGroup];
|
|
4088
4148
|
if (typeof at === "number" && at > now) {
|
|
4089
4149
|
localDeadline = mergeAvailabilityDeadline(localDeadline, at);
|
|
@@ -4100,6 +4160,12 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4100
4160
|
});
|
|
4101
4161
|
const discovery = buildAgentDiscoveryResult({
|
|
4102
4162
|
agents,
|
|
4163
|
+
poolRestricted: Boolean(args?.space),
|
|
4164
|
+
caller: {
|
|
4165
|
+
agentKey: context2?.agentKey,
|
|
4166
|
+
effectiveModel: context2?.effectiveModel,
|
|
4167
|
+
runKind: context2?.runKind ?? (context2?.origin === "agent" ? "subtask" : "interactive")
|
|
4168
|
+
},
|
|
4103
4169
|
scope: args?.scope,
|
|
4104
4170
|
query: args?.query,
|
|
4105
4171
|
publicOnly: args?.publicOnly,
|
|
@@ -4113,21 +4179,49 @@ async function listAgentsFunc(args, thunkApi) {
|
|
|
4113
4179
|
upstreamTotal,
|
|
4114
4180
|
now
|
|
4115
4181
|
});
|
|
4182
|
+
const rawData = {
|
|
4183
|
+
success: true,
|
|
4184
|
+
planningRecommendation: discovery.planningRecommendation,
|
|
4185
|
+
total: discovery.total,
|
|
4186
|
+
...typeof discovery.offset === "number" ? { offset: discovery.offset } : {},
|
|
4187
|
+
...typeof discovery.limit === "number" ? { limit: discovery.limit } : {},
|
|
4188
|
+
...discovery.truncated ? { truncated: true } : {},
|
|
4189
|
+
unavailableCount: discovery.unavailableCount,
|
|
4190
|
+
availableCount: discovery.availableCount,
|
|
4191
|
+
// 顺序即序列化顺序:agents 在前(派发必需),大块说明字段在后。
|
|
4192
|
+
// 限流 agent 已合入 agents(带 availabilityStatus / nextAvailableAt
|
|
4193
|
+
// 参考标注),不再单列 unavailableAgents,避免两套真相。
|
|
4194
|
+
agents: discovery.agents,
|
|
4195
|
+
credentialGroups: discovery.credentialGroups
|
|
4196
|
+
};
|
|
4197
|
+
const delivered = args?.compact === true && args?.verbose !== true ? JSON.parse(await injectSpeedContextIntoListAgentsResult(JSON.stringify(rawData), {
|
|
4198
|
+
compactPage: true,
|
|
4199
|
+
fragmentOffset: args?.fragmentOffset,
|
|
4200
|
+
fragmentAgentKey: args?.fragmentAgentKey,
|
|
4201
|
+
fragmentDigest: args?.fragmentDigest,
|
|
4202
|
+
userId: runtime.currentUserId,
|
|
4203
|
+
// All client hosts provide their local DB through the shared thunk extra.
|
|
4204
|
+
// Local token paths alone are not proof of a dispatched run.
|
|
4205
|
+
db: thunkApi?.extra?.db ? {
|
|
4206
|
+
iterator: (options) => thunkApi.extra.db.iterator(options),
|
|
4207
|
+
isDispatchRun: async (dialogId, entryPath) => {
|
|
4208
|
+
if (entryPath !== "agent-run") return false;
|
|
4209
|
+
try {
|
|
4210
|
+
return isServerDispatchSpeedSource(
|
|
4211
|
+
await thunkApi.extra.db.get(`dialog-${runtime.currentUserId}-${dialogId}`),
|
|
4212
|
+
dialogId,
|
|
4213
|
+
runtime.currentUserId
|
|
4214
|
+
);
|
|
4215
|
+
} catch {
|
|
4216
|
+
return false;
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
} : null
|
|
4220
|
+
})) : rawData;
|
|
4116
4221
|
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)
|
|
4222
|
+
rawData: delivered,
|
|
4223
|
+
displayData: formatAgentListCard(delivered.agents ?? []),
|
|
4224
|
+
...args?.compact === true && args?.verbose !== true ? { llmContext: JSON.stringify(delivered) } : {}
|
|
4131
4225
|
};
|
|
4132
4226
|
}
|
|
4133
4227
|
var readAgentFunctionSchema = {
|
|
@@ -4297,7 +4391,7 @@ var readSkillDocFunctionSchema = {
|
|
|
4297
4391
|
}
|
|
4298
4392
|
};
|
|
4299
4393
|
async function readSkillDocFunc(args, thunkApi) {
|
|
4300
|
-
const { buildReadDocResult } = await import("./readDocTool-
|
|
4394
|
+
const { buildReadDocResult } = await import("./readDocTool-QQZ4DAER.js");
|
|
4301
4395
|
const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
|
|
4302
4396
|
if (typeof id !== "string" || !id.trim()) {
|
|
4303
4397
|
throw new Error("readSkillDoc requires id or doc.");
|
|
@@ -4675,7 +4769,8 @@ var performDirectDelete = async (dispatch, getState, contentKey, preferredServer
|
|
|
4675
4769
|
return;
|
|
4676
4770
|
}
|
|
4677
4771
|
if (isTableMetaKey(contentKey)) {
|
|
4678
|
-
await dispatch(deleteTable({ dbKey: contentKey }))
|
|
4772
|
+
const result = await dispatch(deleteTable({ dbKey: contentKey }));
|
|
4773
|
+
await result.unwrap();
|
|
4679
4774
|
return;
|
|
4680
4775
|
}
|
|
4681
4776
|
if (isAgentKey(contentKey)) {
|
|
@@ -5148,7 +5243,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
|
|
|
5148
5243
|
const spaceKey = createSpaceKey.space(spaceId);
|
|
5149
5244
|
const readSpace = async (dbKey) => {
|
|
5150
5245
|
try {
|
|
5151
|
-
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-
|
|
5246
|
+
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-7M2ESEUO.js");
|
|
5152
5247
|
const readPromise = fresh ? dispatch(readAndWait2(dbKey)).unwrap() : dispatch(read2({ dbKey })).unwrap();
|
|
5153
5248
|
return await withTimeout(readPromise);
|
|
5154
5249
|
} catch {
|
|
@@ -6722,7 +6817,7 @@ var createTableFunctionSchema = {
|
|
|
6722
6817
|
}
|
|
6723
6818
|
};
|
|
6724
6819
|
async function createTableFunc(args, thunkApi) {
|
|
6725
|
-
const spaceId = asOptionalTrimmedString(args?.spaceId);
|
|
6820
|
+
const spaceId = args.spaceId === "" ? "" : asOptionalTrimmedString(args?.spaceId) ?? getCurrentSpaceId() ?? "";
|
|
6726
6821
|
const title = asOptionalTrimmedString(args?.title);
|
|
6727
6822
|
const purpose = asOptionalTrimmedString(args?.purpose);
|
|
6728
6823
|
const description = asOptionalTrimmedString(args?.description);
|
|
@@ -6781,6 +6876,8 @@ async function createTableFunc(args, thunkApi) {
|
|
|
6781
6876
|
columns: sanitizedColumns,
|
|
6782
6877
|
withDefaultRows
|
|
6783
6878
|
};
|
|
6879
|
+
requireKnowledgeCaptureConfirmation(args, "createTable", createArgs);
|
|
6880
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
6784
6881
|
try {
|
|
6785
6882
|
const actionResult = await thunkApi.dispatch(createTable(createArgs));
|
|
6786
6883
|
if (!createTable.fulfilled.match(actionResult)) {
|
|
@@ -9178,6 +9275,43 @@ async function wereadGatewayFunc(args, thunkApi) {
|
|
|
9178
9275
|
return callToolApi(thunkApi, "/api/weread/gateway", args, { withAuth: true });
|
|
9179
9276
|
}
|
|
9180
9277
|
|
|
9278
|
+
// packages/ai/tools/toolRequestDialogId.ts
|
|
9279
|
+
function toolRequestDialogId(context2, getState) {
|
|
9280
|
+
const invalid = (reason) => {
|
|
9281
|
+
throw new Error(`\u5DE5\u5177\u6267\u884C\u4E0A\u4E0B\u6587\u8EAB\u4EFD\u65E0\u6548\uFF1A${reason}`);
|
|
9282
|
+
};
|
|
9283
|
+
const field = (value, name) => {
|
|
9284
|
+
if (value == null) return void 0;
|
|
9285
|
+
if (typeof value !== "string" || !value.trim()) return invalid(`${name} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
|
|
9286
|
+
return value.trim();
|
|
9287
|
+
};
|
|
9288
|
+
const id = field(context2?.dialogId, "dialogId");
|
|
9289
|
+
const key2 = field(context2?.dialogKey, "dialogKey");
|
|
9290
|
+
if (id === void 0 && key2 === void 0) return void 0;
|
|
9291
|
+
const parsed = key2 === void 0 ? void 0 : parseDialogKey(key2);
|
|
9292
|
+
if (key2 !== void 0 && !parsed) return invalid("dialogKey \u65E0\u6CD5\u89E3\u6790\u3002");
|
|
9293
|
+
if (id !== void 0 && parsed && id !== parsed.dialogId) {
|
|
9294
|
+
return invalid("dialogKey/dialogId \u4E0D\u4E00\u81F4\u3002");
|
|
9295
|
+
}
|
|
9296
|
+
const dialogId = parsed?.dialogId ?? id;
|
|
9297
|
+
let state2;
|
|
9298
|
+
try {
|
|
9299
|
+
state2 = getState();
|
|
9300
|
+
} catch {
|
|
9301
|
+
return invalid("\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u52A0\u8F7D\u7684\u5BF9\u8BDD\u8BB0\u5F55\u3002");
|
|
9302
|
+
}
|
|
9303
|
+
const entities = state2?.db?.entities;
|
|
9304
|
+
const matches = Object.entries(entities ?? {}).filter(([recordKey, record]) => {
|
|
9305
|
+
if (key2 !== void 0 && recordKey !== key2) return false;
|
|
9306
|
+
if (!isDialogRecordKey(recordKey)) return false;
|
|
9307
|
+
const identity = parseDialogKey(recordKey);
|
|
9308
|
+
return identity?.dialogId === dialogId && record?.id === dialogId;
|
|
9309
|
+
});
|
|
9310
|
+
if (matches.length === 0) return invalid("\u5BF9\u8BDD\u8BB0\u5F55\u672A\u52A0\u8F7D\u6216\u8BB0\u5F55\u8EAB\u4EFD\u4E0D\u4E00\u81F4\u3002");
|
|
9311
|
+
if (matches.length !== 1) return invalid("\u540C\u4E00 dialogId \u5B58\u5728\u8DE8 owner \u6B67\u4E49\uFF0C\u8BF7\u63D0\u4F9B\u5B8C\u6574 dialogKey\u3002");
|
|
9312
|
+
return dialogId;
|
|
9313
|
+
}
|
|
9314
|
+
|
|
9181
9315
|
// packages/ai/tools/watchCompletionTool.ts
|
|
9182
9316
|
var WATCH_COMPLETION_API_PATH = "/api/watch-completion";
|
|
9183
9317
|
var watchCompletionFunctionSchema = {
|
|
@@ -9231,7 +9365,7 @@ async function watchCompletionFunc(rawArgs, thunkApi, context2) {
|
|
|
9231
9365
|
kind: args.kind,
|
|
9232
9366
|
ref: args.ref,
|
|
9233
9367
|
environment: args.environment,
|
|
9234
|
-
dialogId:
|
|
9368
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState())
|
|
9235
9369
|
});
|
|
9236
9370
|
try {
|
|
9237
9371
|
const data = await callToolApi(
|
|
@@ -9589,7 +9723,7 @@ var exaSearchFunc = async (input, thunkApi, context2) => {
|
|
|
9589
9723
|
excludeDomains,
|
|
9590
9724
|
includeContent
|
|
9591
9725
|
} = input;
|
|
9592
|
-
const body = { query };
|
|
9726
|
+
const body = { query, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) };
|
|
9593
9727
|
if (numResults !== void 0) body.numResults = numResults;
|
|
9594
9728
|
if (typeof intent === "string" && intent) body.intent = intent;
|
|
9595
9729
|
if (typeof category === "string" && category) body.category = category;
|
|
@@ -9748,7 +9882,7 @@ function buildSearchLlmContext(query, results) {
|
|
|
9748
9882
|
});
|
|
9749
9883
|
return lines.join("\n");
|
|
9750
9884
|
}
|
|
9751
|
-
var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
9885
|
+
var firecrawlScrapeFunc = async (input, thunkApi, context2) => {
|
|
9752
9886
|
const { url, onlyMainContent = true, timeout } = input;
|
|
9753
9887
|
const normalizedUrl = normalizeHttpUrl(url);
|
|
9754
9888
|
const normalizedTimeout = normalizeScrapeTimeout(timeout);
|
|
@@ -9757,6 +9891,7 @@ var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
|
9757
9891
|
"/api/firecrawl-scrape",
|
|
9758
9892
|
{
|
|
9759
9893
|
url: normalizedUrl,
|
|
9894
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState()),
|
|
9760
9895
|
onlyMainContent,
|
|
9761
9896
|
timeout: normalizedTimeout
|
|
9762
9897
|
},
|
|
@@ -9798,7 +9933,7 @@ var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
|
9798
9933
|
llmContext
|
|
9799
9934
|
};
|
|
9800
9935
|
};
|
|
9801
|
-
var firecrawlSearchFunc = async (input, thunkApi) => {
|
|
9936
|
+
var firecrawlSearchFunc = async (input, thunkApi, context2) => {
|
|
9802
9937
|
const { query, limit = 5, includeContent = true, categories, country } = input;
|
|
9803
9938
|
const trimmedQuery = asTrimmedString(query);
|
|
9804
9939
|
if (!trimmedQuery) {
|
|
@@ -9808,7 +9943,7 @@ var firecrawlSearchFunc = async (input, thunkApi) => {
|
|
|
9808
9943
|
const data = await callToolApi(
|
|
9809
9944
|
thunkApi,
|
|
9810
9945
|
"/api/firecrawl-search",
|
|
9811
|
-
{ query: trimmedQuery, limit, includeContent, categories, country },
|
|
9946
|
+
{ query: trimmedQuery, limit, includeContent, categories, country, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
9812
9947
|
{ withAuth: true }
|
|
9813
9948
|
);
|
|
9814
9949
|
const results = (data.data?.web ?? []).map((item) => ({
|
|
@@ -9851,9 +9986,9 @@ var olmOcrSchema = {
|
|
|
9851
9986
|
required: ["imageUrl"]
|
|
9852
9987
|
}
|
|
9853
9988
|
};
|
|
9854
|
-
var olmOcrFunc = async (input, thunkApi) => {
|
|
9989
|
+
var olmOcrFunc = async (input, thunkApi, context2) => {
|
|
9855
9990
|
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 });
|
|
9991
|
+
const data = await callToolApi(thunkApi, "/api/olm-ocr", { imageUrl, prompt, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
9857
9992
|
return {
|
|
9858
9993
|
summary: "OCR processing completed",
|
|
9859
9994
|
text: data.choices?.[0]?.message?.content || "No text detected",
|
|
@@ -9887,12 +10022,12 @@ var transcribeVideoSchema = {
|
|
|
9887
10022
|
required: ["url"]
|
|
9888
10023
|
}
|
|
9889
10024
|
};
|
|
9890
|
-
async function transcribeVideoFunc(input, thunkApi) {
|
|
10025
|
+
async function transcribeVideoFunc(input, thunkApi, context2) {
|
|
9891
10026
|
const url = typeof input?.url === "string" ? input.url.trim() : "";
|
|
9892
10027
|
if (!url) {
|
|
9893
10028
|
throw new Error("\u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 url");
|
|
9894
10029
|
}
|
|
9895
|
-
const body = { url };
|
|
10030
|
+
const body = { url, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) };
|
|
9896
10031
|
if (input.p !== void 0) body.p = input.p;
|
|
9897
10032
|
if (input.language !== void 0) body.language = input.language;
|
|
9898
10033
|
const data = await callToolApi(thunkApi, "/api/transcribe-video", body, {
|
|
@@ -9963,7 +10098,8 @@ var transcribeSchema = {
|
|
|
9963
10098
|
}
|
|
9964
10099
|
}
|
|
9965
10100
|
};
|
|
9966
|
-
async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
10101
|
+
async function transcribeInternal(input, thunkApi, reuseNotes, context2) {
|
|
10102
|
+
const dialogId = toolRequestDialogId(context2, () => thunkApi.getState());
|
|
9967
10103
|
const { action = "transcribe", fileId, jobId, fromSec, toSec, sourceLang, sttProvider, confirmationToken, expectedExecutionRevision } = input ?? {};
|
|
9968
10104
|
if (action === "status" && !jobId) throw new Error("status \u6A21\u5F0F\u5FC5\u987B\u63D0\u4F9B\u5DF2\u6709 jobId");
|
|
9969
10105
|
if (action === "status" && (fileId || fromSec !== void 0 || toSec !== void 0 || sourceLang)) throw new Error("status \u6A21\u5F0F\u4EC5\u63A5\u53D7 jobId");
|
|
@@ -9988,7 +10124,7 @@ async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
|
9988
10124
|
if (!fileId) {
|
|
9989
10125
|
throw new Error("transcribe \u5DE5\u5177\u5FC5\u987B\u63D0\u4F9B fileId \u6216 jobId");
|
|
9990
10126
|
}
|
|
9991
|
-
const createBody = { fileId };
|
|
10127
|
+
const createBody = { fileId, dialogId };
|
|
9992
10128
|
if (fromSec !== void 0 || toSec !== void 0) {
|
|
9993
10129
|
createBody.scope = {
|
|
9994
10130
|
...fromSec !== void 0 ? { fromSec } : {},
|
|
@@ -10005,6 +10141,7 @@ async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
|
10005
10141
|
const revision = normalizeMediaConfirmExecutionRevision(expectedExecutionRevision);
|
|
10006
10142
|
const stepBody = {
|
|
10007
10143
|
step: "transcribe",
|
|
10144
|
+
dialogId,
|
|
10008
10145
|
waitMs: 6e4,
|
|
10009
10146
|
// 仅显式指定时透传;未指定保持服务端既有默认行为(不静默选供应商、不改全局默认)。
|
|
10010
10147
|
...typeof sttProvider === "string" ? { sttProvider } : {},
|
|
@@ -10110,9 +10247,9 @@ function formatJobStatus(job, jobId) {
|
|
|
10110
10247
|
}
|
|
10111
10248
|
return result;
|
|
10112
10249
|
}
|
|
10113
|
-
async function transcribeFunc(input, thunkApi) {
|
|
10250
|
+
async function transcribeFunc(input, thunkApi, context2) {
|
|
10114
10251
|
const reuseNotes = {};
|
|
10115
|
-
const result = await transcribeInternal(input, thunkApi, reuseNotes);
|
|
10252
|
+
const result = await transcribeInternal(input, thunkApi, reuseNotes, context2);
|
|
10116
10253
|
const stepResult = result.rawData?.stepResult ?? result.rawData;
|
|
10117
10254
|
const artifact = stepResult?.artifacts?.transcribe;
|
|
10118
10255
|
const fileId = artifact?.fileId ?? stepResult?.fileId;
|
|
@@ -10160,13 +10297,14 @@ var translateSchema = {
|
|
|
10160
10297
|
required: ["jobId", "targetLang"]
|
|
10161
10298
|
}
|
|
10162
10299
|
};
|
|
10163
|
-
async function translateInternal(input, thunkApi) {
|
|
10300
|
+
async function translateInternal(input, thunkApi, context2) {
|
|
10164
10301
|
const { jobId, targetLang, confirmationToken, expectedExecutionRevision } = input ?? {};
|
|
10165
10302
|
if (!jobId) throw new Error("translate \u5DE5\u5177\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
10166
10303
|
if (!targetLang) throw new Error("translate \u5DE5\u5177\u5FC5\u987B\u6307\u5B9A targetLang\uFF08\u76EE\u6807\u8BED\u8A00\uFF09");
|
|
10167
10304
|
const revision = normalizeMediaConfirmExecutionRevision(expectedExecutionRevision);
|
|
10168
10305
|
const stepBody = {
|
|
10169
10306
|
step: "translate",
|
|
10307
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState()),
|
|
10170
10308
|
// 目标语言原样透传:票据 selection 与执行参数必须同源(不回落 job.targetLang,不二次规范化)。
|
|
10171
10309
|
targetLang,
|
|
10172
10310
|
waitMs: 6e4,
|
|
@@ -10243,8 +10381,8 @@ async function translateInternal(input, thunkApi) {
|
|
|
10243
10381
|
rawData: data
|
|
10244
10382
|
};
|
|
10245
10383
|
}
|
|
10246
|
-
async function translateFunc(input, thunkApi) {
|
|
10247
|
-
const result = await translateInternal(input, thunkApi);
|
|
10384
|
+
async function translateFunc(input, thunkApi, context2) {
|
|
10385
|
+
const result = await translateInternal(input, thunkApi, context2);
|
|
10248
10386
|
const stepResult = result.rawData?.stepResult ?? result.rawData;
|
|
10249
10387
|
const artifact = stepResult?.artifacts?.translate;
|
|
10250
10388
|
const fileId = artifact?.fileId ?? stepResult?.fileId;
|
|
@@ -10725,12 +10863,12 @@ async function writeTranslationsFunc(input, thunkApi) {
|
|
|
10725
10863
|
}
|
|
10726
10864
|
|
|
10727
10865
|
// packages/ai/tools/apifyActorClient.ts
|
|
10728
|
-
async function callApifyActor(thunkApi, params) {
|
|
10866
|
+
async function callApifyActor(thunkApi, params, context2) {
|
|
10729
10867
|
const { actorId, input, resultType = "datasetItems", displayName } = params;
|
|
10730
10868
|
const data = await callToolApi(
|
|
10731
10869
|
thunkApi,
|
|
10732
10870
|
"/api/apify-actor",
|
|
10733
|
-
{ actorId, input, resultType },
|
|
10871
|
+
{ actorId, input, resultType, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
10734
10872
|
{ withAuth: true }
|
|
10735
10873
|
);
|
|
10736
10874
|
const isArray = Array.isArray(data);
|
|
@@ -10802,7 +10940,7 @@ var googleSearchScraperFunctionSchema = {
|
|
|
10802
10940
|
required: []
|
|
10803
10941
|
}
|
|
10804
10942
|
};
|
|
10805
|
-
async function googleSearchScraperFunc(args, thunkApi) {
|
|
10943
|
+
async function googleSearchScraperFunc(args, thunkApi, context2) {
|
|
10806
10944
|
const {
|
|
10807
10945
|
maxPagesPerQuery = 1,
|
|
10808
10946
|
resultsPerPage = 10,
|
|
@@ -10848,7 +10986,7 @@ async function googleSearchScraperFunc(args, thunkApi) {
|
|
|
10848
10986
|
input,
|
|
10849
10987
|
resultType: "datasetItems",
|
|
10850
10988
|
displayName: "Google Search Scraper"
|
|
10851
|
-
});
|
|
10989
|
+
}, context2);
|
|
10852
10990
|
}
|
|
10853
10991
|
|
|
10854
10992
|
// packages/ai/tools/cloudflareCrawlTool.ts
|
|
@@ -11018,7 +11156,7 @@ var cloudflareCrawlStatusFunctionSchema = {
|
|
|
11018
11156
|
async function cloudflareCrawlStatusFunc(args, thunkApi) {
|
|
11019
11157
|
const { jobId, limit, status, cursor } = args;
|
|
11020
11158
|
if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
11021
|
-
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-
|
|
11159
|
+
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-53YMJ2G6.js");
|
|
11022
11160
|
const { baseUrl, token } = getToolRequestContext2(thunkApi);
|
|
11023
11161
|
const params = new URLSearchParams();
|
|
11024
11162
|
if (limit !== void 0) params.set("limit", String(limit));
|
|
@@ -11095,7 +11233,7 @@ var youtubeScraperFunctionSchema = {
|
|
|
11095
11233
|
required: []
|
|
11096
11234
|
}
|
|
11097
11235
|
};
|
|
11098
|
-
async function youtubeScraperFunc(args, thunkApi) {
|
|
11236
|
+
async function youtubeScraperFunc(args, thunkApi, context2) {
|
|
11099
11237
|
const {
|
|
11100
11238
|
directUrls,
|
|
11101
11239
|
searchQueries,
|
|
@@ -11133,7 +11271,7 @@ async function youtubeScraperFunc(args, thunkApi) {
|
|
|
11133
11271
|
input,
|
|
11134
11272
|
resultType: "datasetItems",
|
|
11135
11273
|
displayName: "YouTube Scraper"
|
|
11136
|
-
});
|
|
11274
|
+
}, context2);
|
|
11137
11275
|
}
|
|
11138
11276
|
|
|
11139
11277
|
// packages/ai/tools/ecommerceScraperTool.ts
|
|
@@ -11176,7 +11314,7 @@ var ecommerceScraperFunctionSchema = {
|
|
|
11176
11314
|
required: []
|
|
11177
11315
|
}
|
|
11178
11316
|
};
|
|
11179
|
-
async function ecommerceScraperFunc(args, thunkApi) {
|
|
11317
|
+
async function ecommerceScraperFunc(args, thunkApi, context2) {
|
|
11180
11318
|
const {
|
|
11181
11319
|
detailsUrls,
|
|
11182
11320
|
listingUrls,
|
|
@@ -11202,7 +11340,7 @@ async function ecommerceScraperFunc(args, thunkApi) {
|
|
|
11202
11340
|
input,
|
|
11203
11341
|
resultType: "datasetItems",
|
|
11204
11342
|
displayName: "E-commerce Scraping Tool"
|
|
11205
|
-
});
|
|
11343
|
+
}, context2);
|
|
11206
11344
|
}
|
|
11207
11345
|
|
|
11208
11346
|
// packages/ai/tools/amazonProductScraperTool.ts
|
|
@@ -11242,7 +11380,7 @@ var amazonProductScraperFunctionSchema = {
|
|
|
11242
11380
|
required: ["urls"]
|
|
11243
11381
|
}
|
|
11244
11382
|
};
|
|
11245
|
-
async function amazonProductScraperFunc(args, thunkApi) {
|
|
11383
|
+
async function amazonProductScraperFunc(args, thunkApi, context2) {
|
|
11246
11384
|
const {
|
|
11247
11385
|
urls,
|
|
11248
11386
|
maxItemsPerStartUrl,
|
|
@@ -11269,7 +11407,7 @@ async function amazonProductScraperFunc(args, thunkApi) {
|
|
|
11269
11407
|
input,
|
|
11270
11408
|
resultType: "datasetItems",
|
|
11271
11409
|
displayName: "Amazon Product Scraper"
|
|
11272
|
-
});
|
|
11410
|
+
}, context2);
|
|
11273
11411
|
}
|
|
11274
11412
|
|
|
11275
11413
|
// packages/ai/tools/taobaoTmallProductScraperTool.ts
|
|
@@ -11293,7 +11431,7 @@ var taobaoTmallProductScraperFunctionSchema = {
|
|
|
11293
11431
|
required: ["itemId"]
|
|
11294
11432
|
}
|
|
11295
11433
|
};
|
|
11296
|
-
async function taobaoTmallProductScraperFunc(args, thunkApi) {
|
|
11434
|
+
async function taobaoTmallProductScraperFunc(args, thunkApi, context2) {
|
|
11297
11435
|
const itemId = String(args.itemId ?? "").trim();
|
|
11298
11436
|
if (!/^\d{6,}$/.test(itemId)) {
|
|
11299
11437
|
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 +11445,7 @@ async function taobaoTmallProductScraperFunc(args, thunkApi) {
|
|
|
11307
11445
|
},
|
|
11308
11446
|
resultType: "datasetItems",
|
|
11309
11447
|
displayName: "Taobao/Tmall Product Scraper"
|
|
11310
|
-
});
|
|
11448
|
+
}, context2);
|
|
11311
11449
|
}
|
|
11312
11450
|
|
|
11313
11451
|
// packages/ai/tools/jdProductScraperTool.ts
|
|
@@ -11787,8 +11925,6 @@ function stringifyIfPresent(value) {
|
|
|
11787
11925
|
}
|
|
11788
11926
|
|
|
11789
11927
|
// packages/ai/tools/geminiImagePreviewTool.ts
|
|
11790
|
-
var selectCurrentDialogKeyFromState = (_state) => getActiveDialogKey();
|
|
11791
|
-
var selectCurrentSpaceIdFromState = (_state) => getCurrentSpaceId();
|
|
11792
11928
|
var selectUserIdFromState = (state2) => {
|
|
11793
11929
|
const userId = selectIdentityUserId(state2);
|
|
11794
11930
|
return typeof userId === "string" ? userId : null;
|
|
@@ -11796,7 +11932,7 @@ var selectUserIdFromState = (state2) => {
|
|
|
11796
11932
|
var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
|
|
11797
11933
|
async function addImageContentToSpace(input) {
|
|
11798
11934
|
const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
|
|
11799
|
-
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-
|
|
11935
|
+
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-HEMCSSHT.js")).addContentAction;
|
|
11800
11936
|
await addContentAction2(
|
|
11801
11937
|
{
|
|
11802
11938
|
spaceId: input.spaceId,
|
|
@@ -12069,24 +12205,25 @@ var geminiProImagePreviewFunctionSchema = {
|
|
|
12069
12205
|
required: ["prompt"]
|
|
12070
12206
|
}
|
|
12071
12207
|
};
|
|
12072
|
-
var createGeminiImageExecutor = (model) => async (args, thunkApi) => {
|
|
12208
|
+
var createGeminiImageExecutor = (model) => async (args, thunkApi, context2) => {
|
|
12073
12209
|
const { prompt, images = [], aspectRatio, imageSize } = args;
|
|
12074
12210
|
const trimmedPrompt = prompt?.trim();
|
|
12075
12211
|
if (!trimmedPrompt) {
|
|
12076
12212
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12077
12213
|
}
|
|
12078
12214
|
const state2 = thunkApi.getState();
|
|
12079
|
-
const
|
|
12080
|
-
|
|
12215
|
+
const { dialogId, spaceId } = resolveToolAttributionContext(state2, context2, {
|
|
12216
|
+
requireAgentKey: true,
|
|
12217
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12218
|
+
});
|
|
12219
|
+
const userId = selectUserIdFromState(state2);
|
|
12220
|
+
const currentServer = selectCurrentServerFromState(state2);
|
|
12081
12221
|
const result = await callToolApi(
|
|
12082
12222
|
thunkApi,
|
|
12083
12223
|
"/api/gemini-image-preview",
|
|
12084
12224
|
{ prompt: trimmedPrompt, images, aspectRatio, imageSize, model, dialogId },
|
|
12085
12225
|
{ withAuth: true }
|
|
12086
12226
|
);
|
|
12087
|
-
const spaceId = selectCurrentSpaceIdFromState(state2);
|
|
12088
|
-
const userId = selectUserIdFromState(state2);
|
|
12089
|
-
const currentServer = selectCurrentServerFromState(state2);
|
|
12090
12227
|
if (spaceId && userId && result?.files?.length) {
|
|
12091
12228
|
for (let i = 0; i < result.files.length; i++) {
|
|
12092
12229
|
const f = result.files[i];
|
|
@@ -12236,14 +12373,18 @@ var openAIGptImageEditFunctionSchema = {
|
|
|
12236
12373
|
name: "openAIGptImageEdit",
|
|
12237
12374
|
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
12375
|
};
|
|
12239
|
-
var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
12376
|
+
var runOpenAIImageTool = async (args, thunkApi, model, context2) => {
|
|
12240
12377
|
const trimmedPrompt = args.prompt?.trim();
|
|
12241
12378
|
if (!trimmedPrompt) {
|
|
12242
12379
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12243
12380
|
}
|
|
12244
12381
|
const state2 = thunkApi.getState();
|
|
12245
|
-
const
|
|
12246
|
-
|
|
12382
|
+
const { dialogId, spaceId } = resolveToolAttributionContext(state2, context2, {
|
|
12383
|
+
requireAgentKey: true,
|
|
12384
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12385
|
+
});
|
|
12386
|
+
const userId = selectIdentityUserId(state2);
|
|
12387
|
+
const currentServer = selectCurrentServer(state2);
|
|
12247
12388
|
const result = await callToolApi(
|
|
12248
12389
|
thunkApi,
|
|
12249
12390
|
"/api/openai-image",
|
|
@@ -12264,9 +12405,6 @@ var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
|
12264
12405
|
},
|
|
12265
12406
|
{ withAuth: true }
|
|
12266
12407
|
);
|
|
12267
|
-
const spaceId = getCurrentSpaceId();
|
|
12268
|
-
const userId = selectIdentityUserId(state2);
|
|
12269
|
-
const currentServer = selectCurrentServer(state2);
|
|
12270
12408
|
if (spaceId && userId && result?.files?.length) {
|
|
12271
12409
|
for (let i = 0; i < result.files.length; i += 1) {
|
|
12272
12410
|
const file = result.files[i];
|
|
@@ -12294,22 +12432,24 @@ var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
|
12294
12432
|
llmContext
|
|
12295
12433
|
};
|
|
12296
12434
|
};
|
|
12297
|
-
var openAIGptImageGenerateFunc = async (args, thunkApi) => {
|
|
12435
|
+
var openAIGptImageGenerateFunc = async (args, thunkApi, context2) => {
|
|
12298
12436
|
return runOpenAIImageTool(
|
|
12299
12437
|
{ ...args, operation: "generate" },
|
|
12300
12438
|
thunkApi,
|
|
12301
|
-
DEFAULT_OPENAI_IMAGE_GENERATE_MODEL
|
|
12439
|
+
DEFAULT_OPENAI_IMAGE_GENERATE_MODEL,
|
|
12440
|
+
context2
|
|
12302
12441
|
);
|
|
12303
12442
|
};
|
|
12304
|
-
var openAIGptImageEditFunc = async (args, thunkApi) => {
|
|
12443
|
+
var openAIGptImageEditFunc = async (args, thunkApi, context2) => {
|
|
12305
12444
|
return runOpenAIImageTool(
|
|
12306
12445
|
{ ...args, operation: "edit" },
|
|
12307
12446
|
thunkApi,
|
|
12308
|
-
DEFAULT_OPENAI_IMAGE_EDIT_MODEL
|
|
12447
|
+
DEFAULT_OPENAI_IMAGE_EDIT_MODEL,
|
|
12448
|
+
context2
|
|
12309
12449
|
);
|
|
12310
12450
|
};
|
|
12311
|
-
var openAIGptImageFunc = async (args, thunkApi) => {
|
|
12312
|
-
return runOpenAIImageTool(args, thunkApi, DEFAULT_OPENAI_IMAGE_MODEL);
|
|
12451
|
+
var openAIGptImageFunc = async (args, thunkApi, context2) => {
|
|
12452
|
+
return runOpenAIImageTool(args, thunkApi, DEFAULT_OPENAI_IMAGE_MODEL, context2);
|
|
12313
12453
|
};
|
|
12314
12454
|
|
|
12315
12455
|
// packages/ai/tools/chatgptWebImageTool.ts
|
|
@@ -12363,16 +12503,18 @@ var chatgptWebImageGenerateFunctionSchema = {
|
|
|
12363
12503
|
required: ["prompt"]
|
|
12364
12504
|
}
|
|
12365
12505
|
};
|
|
12366
|
-
var chatgptWebImageGenerateFunc = async (args, thunkApi) => {
|
|
12506
|
+
var chatgptWebImageGenerateFunc = async (args, thunkApi, context2) => {
|
|
12367
12507
|
const trimmedPrompt = args.prompt?.trim();
|
|
12368
12508
|
if (!trimmedPrompt) {
|
|
12369
12509
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12370
12510
|
}
|
|
12371
12511
|
const state2 = thunkApi.getState();
|
|
12372
|
-
const
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12512
|
+
const { dialogId, spaceId, agentKey } = resolveToolAttributionContext(state2, context2, {
|
|
12513
|
+
requireAgentKey: true,
|
|
12514
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12515
|
+
});
|
|
12516
|
+
const userId = selectIdentityUserId(state2);
|
|
12517
|
+
const currentServer = selectCurrentServer(state2);
|
|
12376
12518
|
const result = await callToolApi(
|
|
12377
12519
|
thunkApi,
|
|
12378
12520
|
"/api/chatgpt-web-image",
|
|
@@ -12383,9 +12525,6 @@ var chatgptWebImageGenerateFunc = async (args, thunkApi) => {
|
|
|
12383
12525
|
},
|
|
12384
12526
|
{ withAuth: true, agentKey }
|
|
12385
12527
|
);
|
|
12386
|
-
const spaceId = getCurrentSpaceId();
|
|
12387
|
-
const userId = selectIdentityUserId(state2);
|
|
12388
|
-
const currentServer = selectCurrentServer(state2);
|
|
12389
12528
|
if (spaceId && userId && result?.files?.length) {
|
|
12390
12529
|
for (let i = 0; i < result.files.length; i += 1) {
|
|
12391
12530
|
const file = result.files[i];
|
|
@@ -12426,7 +12565,7 @@ var randomGateId = () => {
|
|
|
12426
12565
|
var SECRET_REQUEST_NAME_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
|
|
12427
12566
|
var secretRequestFunctionSchema = {
|
|
12428
12567
|
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\
|
|
12568
|
+
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
12569
|
parameters: {
|
|
12431
12570
|
type: "object",
|
|
12432
12571
|
properties: {
|
|
@@ -12461,10 +12600,10 @@ function buildSecretRequestToolResult(args) {
|
|
|
12461
12600
|
};
|
|
12462
12601
|
const purpose = args.purpose?.trim();
|
|
12463
12602
|
const fallbackContent = [
|
|
12464
|
-
`\u9700\u8981\u7528\u6237\u5411\
|
|
12603
|
+
`\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
12604
|
...purpose ? [`\u7528\u9014\uFF1A${purpose}`] : [],
|
|
12466
|
-
"\
|
|
12467
|
-
"\
|
|
12605
|
+
"\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",
|
|
12606
|
+
"\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
12607
|
].join("\n");
|
|
12469
12608
|
return {
|
|
12470
12609
|
content: fallbackContent,
|
|
@@ -12473,7 +12612,7 @@ function buildSecretRequestToolResult(args) {
|
|
|
12473
12612
|
id: `gate-${randomGateId().slice(0, 8)}-secret-request-${args.name}`,
|
|
12474
12613
|
kind: "input",
|
|
12475
12614
|
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\
|
|
12615
|
+
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
12616
|
payload
|
|
12478
12617
|
},
|
|
12479
12618
|
reason: "secret-request-pending-host-input"
|
|
@@ -12536,8 +12675,8 @@ var rememberMemoryFunctionSchema = {
|
|
|
12536
12675
|
description: [
|
|
12537
12676
|
"\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
12677
|
"\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
|
-
|
|
12678
|
+
"\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",
|
|
12679
|
+
'\u3010\u7248\u672C\u4E0E\u6F14\u8FDB\u8BF4\u660E\u3011\u672A\u4F20 topicKey \u65F6\uFF0C\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\u82E5\u540C\u4E00\u504F\u597D/\u4E8B\u5B9E\u53D1\u751F\u6F14\u8FDB\uFF0C\u8BF7\u4F20\u76F8\u540C\u7684\u7A33\u5B9A topicKey\uFF08\u5982 "code-formatter"\uFF09\u4EE5\u81EA\u52A8\u9000\u5F79\u65E7\u7248\u672C\u5E76\u4FDD\u7559\u5386\u53F2\u5BA1\u8BA1\u94FE\u3002\u4E25\u7981\u6A21\u578B\u81EA\u884C\u8C03\u7528 deleteMemory \u7EF4\u62A4\u7248\u672C\u6216\u6E05\u7406\u65E7\u6761\u3002',
|
|
12541
12680
|
"\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
12681
|
"\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
12682
|
"\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 +12686,13 @@ var rememberMemoryFunctionSchema = {
|
|
|
12547
12686
|
" - Space \u534F\u4F5C\u7EA6\u5B9A/\u56E2\u961F\u89C4\u5219 \u2192 scope=space\uFF08\u5F53\u524D dialog \u7ED1\u5B9A space \u65F6\uFF09",
|
|
12548
12687
|
" - \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
12688
|
" - \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
|
-
" - \
|
|
12689
|
+
" - \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
12690
|
"\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
12691
|
"",
|
|
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",
|
|
12692
|
+
"\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
12693
|
"",
|
|
12556
12694
|
"\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\
|
|
12695
|
+
" - verified\uFF1A\u8C03\u7528\u8005\u58F0\u660E\u5DE5\u5177/\u547D\u4EE4\u5B9E\u6D4B\u8FC7\uFF08\u5BBF\u4E3B\u672A\u72EC\u7ACB\u9A8C\u8BC1\uFF09",
|
|
12558
12696
|
" - stated\uFF1A\u7528\u6237\u660E\u786E\u9648\u8FF0\uFF08\u4E2D\u9AD8\u7F6E\u4FE1\u5EA6\uFF09",
|
|
12559
12697
|
" - 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
12698
|
"\u8C03\u7528\u65F6\u5C3D\u91CF\u660E\u786E\u6765\u6E90\uFF0C\u65E0\u6CD5\u5224\u65AD\u7684\u4FDD\u5B88\u6807 inferred\u3002"
|
|
@@ -12562,6 +12700,13 @@ var rememberMemoryFunctionSchema = {
|
|
|
12562
12700
|
parameters: {
|
|
12563
12701
|
type: "object",
|
|
12564
12702
|
properties: {
|
|
12703
|
+
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" },
|
|
12704
|
+
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" },
|
|
12705
|
+
itemKey: { type: "string", description: "\u521B\u5EFA\u5DE5\u4F5C\u65F6\u7684\u7A33\u5B9A\u9879\u76EE\u952E\u3002" },
|
|
12706
|
+
activityId: { type: "string", description: "\u66F4\u65B0\u65F6\u4F20\u5DF2\u6709\u5DE5\u4F5C ID\u3002" },
|
|
12707
|
+
expectedRevision: { type: "integer", minimum: 1, description: "\u66F4\u65B0\u65F6\u4F20\u4E0A\u6B21\u8BFB\u53D6\u7684\u7248\u672C\u3002" },
|
|
12708
|
+
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" },
|
|
12709
|
+
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
12710
|
content: {
|
|
12566
12711
|
type: "string",
|
|
12567
12712
|
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,23 +12721,81 @@ var rememberMemoryFunctionSchema = {
|
|
|
12576
12721
|
enum: ["episodic", "semantic", "procedural"],
|
|
12577
12722
|
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
12723
|
},
|
|
12724
|
+
provenance: {
|
|
12725
|
+
type: "string",
|
|
12726
|
+
enum: ["verified", "stated", "inferred"],
|
|
12727
|
+
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"
|
|
12728
|
+
},
|
|
12579
12729
|
recurrenceEvidence: {
|
|
12580
12730
|
type: "string",
|
|
12581
12731
|
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"
|
|
12732
|
+
},
|
|
12733
|
+
topicKey: {
|
|
12734
|
+
type: "string",
|
|
12735
|
+
description: '\u53EF\u9009\u7A33\u5B9A\u4E3B\u9898\u952E\uFF08\u5982 "code-formatter"\u3001"report-language"\uFF0C\u4EC5\u7528\u5C0F\u5199\u5B57\u6BCD/\u6570\u5B57/._:-\uFF0C\u2264128 \u5B57\u7B26\uFF09\u3002\u540C\u4E00\u504F\u597D\u6216\u4E8B\u5B9E\u6F14\u8FDB\u65F6\u4F20\u76F8\u540C\u7A33\u5B9A\u952E\uFF0C\u5E95\u5C42\u4F1A\u81EA\u52A8\u9000\u5F79\u540C\u4E3B\u4F53\u540C\u7C7B\u578B\u7684\u65E7\u7248\u672C\u5E76\u4FDD\u7559\u5386\u53F2\u5BA1\u8BA1\u94FE\uFF1B\u4E0D\u4F20\u5219\u6309\u72EC\u7ACB\u65B0\u8BB0\u5F55\u4FDD\u7559\u3002'
|
|
12582
12736
|
}
|
|
12583
12737
|
},
|
|
12584
|
-
required: [
|
|
12738
|
+
required: []
|
|
12585
12739
|
}
|
|
12586
12740
|
};
|
|
12587
12741
|
|
|
12588
12742
|
// packages/ai/tools/rememberMemoryTool.ts
|
|
12589
|
-
async function rememberMemoryFunc(args, thunkApi) {
|
|
12590
|
-
|
|
12591
|
-
|
|
12743
|
+
async function rememberMemoryFunc(args, thunkApi, context2) {
|
|
12744
|
+
if (args.mode === "work") {
|
|
12745
|
+
if (args.storage === "local")
|
|
12746
|
+
throw new Error("Web work memory only supports server storage");
|
|
12747
|
+
const dialogId2 = context2?.dialogId;
|
|
12748
|
+
const messageId = context2?.userMessageId;
|
|
12749
|
+
if (!dialogId2 || !messageId)
|
|
12750
|
+
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")
|
|
12754
|
+
throw new Error("work memory requires a bound persisted user message");
|
|
12755
|
+
let persisted;
|
|
12756
|
+
try {
|
|
12757
|
+
persisted = await db.get(key2);
|
|
12758
|
+
} catch {
|
|
12759
|
+
throw new Error("work memory requires a bound persisted user message");
|
|
12760
|
+
}
|
|
12761
|
+
if (!persisted || persisted.dbKey !== key2 || persisted.id !== messageId || persisted.role !== "user" || persisted.metadata?.queueState === "pending" || isTombstoneRecord(persisted) || typeof persisted.content !== "string")
|
|
12762
|
+
throw new Error("work memory requires a bound persisted user message");
|
|
12763
|
+
resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12764
|
+
const result2 = await callToolApi(
|
|
12765
|
+
thunkApi,
|
|
12766
|
+
"/api/memory/remember",
|
|
12767
|
+
{
|
|
12768
|
+
mode: "work",
|
|
12769
|
+
dialogId: dialogId2,
|
|
12770
|
+
userMessageId: persisted.id,
|
|
12771
|
+
itemKey: args.itemKey,
|
|
12772
|
+
activityId: args.activityId,
|
|
12773
|
+
expectedRevision: args.expectedRevision,
|
|
12774
|
+
changeId: args.changeId,
|
|
12775
|
+
patch: args.patch
|
|
12776
|
+
},
|
|
12777
|
+
{ withAuth: true }
|
|
12778
|
+
);
|
|
12779
|
+
if (result2?.error)
|
|
12780
|
+
throw new Error(result2.error.message ?? "work memory rejected");
|
|
12781
|
+
const notice = formatWorkContextWriteNotice(result2);
|
|
12782
|
+
return {
|
|
12783
|
+
rawData: {
|
|
12784
|
+
...result2,
|
|
12785
|
+
notice: [notice, result2?.notice].filter(Boolean).join("\n")
|
|
12786
|
+
},
|
|
12787
|
+
displayData: notice
|
|
12788
|
+
};
|
|
12789
|
+
}
|
|
12790
|
+
const { spaceId, dialogId, agentKey } = resolveMemoryToolContext(
|
|
12791
|
+
thunkApi.getState(),
|
|
12792
|
+
context2
|
|
12793
|
+
);
|
|
12592
12794
|
const content = String(args.content ?? "").trim();
|
|
12593
12795
|
const scope = args.scope ?? "auto";
|
|
12594
12796
|
const kind = args.kind ?? "episodic";
|
|
12595
12797
|
const recurrenceEvidence = String(args.recurrenceEvidence ?? "").trim();
|
|
12798
|
+
const topicKey = normalizeTopicKey(args.topicKey);
|
|
12596
12799
|
if (!content) {
|
|
12597
12800
|
throw new Error("rememberMemory \u9700\u8981\u975E\u7A7A content\u3002");
|
|
12598
12801
|
}
|
|
@@ -12604,19 +12807,26 @@ async function rememberMemoryFunc(args, thunkApi) {
|
|
|
12604
12807
|
scope,
|
|
12605
12808
|
kind,
|
|
12606
12809
|
spaceId,
|
|
12607
|
-
...
|
|
12810
|
+
...dialogId ? { dialogId } : {},
|
|
12811
|
+
...agentKey ? { agentKey } : {},
|
|
12812
|
+
source: "agent-inferred",
|
|
12813
|
+
...recurrenceEvidence ? { recurrenceEvidence } : {},
|
|
12814
|
+
...args.provenance ? { provenance: args.provenance } : {},
|
|
12815
|
+
...topicKey ? { topicKey } : {}
|
|
12608
12816
|
},
|
|
12609
12817
|
{ withAuth: true }
|
|
12610
12818
|
);
|
|
12611
12819
|
const scopeLabel = result.resolvedScopes?.[0]?.ownerType === "space" ? "\u5F53\u524D\u7A7A\u95F4" : "\u5F53\u524D\u7528\u6237";
|
|
12820
|
+
const supersededCount = result.savedItems?.[0]?.supersedesStateIds?.length ?? 0;
|
|
12821
|
+
const supersedeHint = supersededCount ? "\uFF08\u5DF2\u81EA\u52A8\u9000\u5F79\u540C\u4E3B\u9898\u65E7\u7248\u672C\u5E76\u4FDD\u7559\u5386\u53F2\u8BB0\u5F55\uFF09" : "";
|
|
12612
12822
|
const similar = result.similarMemories ?? [];
|
|
12613
12823
|
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\
|
|
12824
|
+
\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
12825
|
const downgradeHint = result.kindDowngradeReason ? `
|
|
12616
12826
|
\u6CE8\u610F\uFF1A${result.kindDowngradeReason}` : "";
|
|
12617
12827
|
return {
|
|
12618
12828
|
rawData: result,
|
|
12619
|
-
displayData: `\u5DF2\u8BB0\u4F4F\u8FD9\u6761${scopeLabel}\u8BB0\u5FC6\u3002${downgradeHint}${similarHint}`
|
|
12829
|
+
displayData: `\u5DF2\u8BB0\u4F4F\u8FD9\u6761${scopeLabel}\u8BB0\u5FC6\u3002${supersedeHint}${downgradeHint}${similarHint}`
|
|
12620
12830
|
};
|
|
12621
12831
|
}
|
|
12622
12832
|
|
|
@@ -12743,44 +12953,84 @@ var queryMemoryFunctionSchema = {
|
|
|
12743
12953
|
description: [
|
|
12744
12954
|
"\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
12955
|
"\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",
|
|
12956
|
+
"\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
12957
|
"\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
12958
|
"",
|
|
12748
12959
|
"\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
12960
|
"\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"
|
|
12961
|
+
"\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",
|
|
12962
|
+
"",
|
|
12963
|
+
"\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",
|
|
12964
|
+
"- 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",
|
|
12965
|
+
"- 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",
|
|
12966
|
+
"- \u67E5\u8FDB\u884C\u4E2D\u7684\u5DE5\u4F5C\uFF1A\u7701\u7565 query \u548C activityId\uFF08\u9ED8\u8BA4 status=active\uFF09\u3002",
|
|
12967
|
+
"- \u67E5\u6682\u505C\u7684\uFF1Astatus=paused\u3002",
|
|
12968
|
+
"- \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",
|
|
12969
|
+
"- \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",
|
|
12970
|
+
'\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
12971
|
].join("\n"),
|
|
12752
12972
|
parameters: {
|
|
12753
12973
|
type: "object",
|
|
12754
12974
|
properties: {
|
|
12975
|
+
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" },
|
|
12976
|
+
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" },
|
|
12977
|
+
activityId: { type: "string", description: "\u7CBE\u786E\u5DE5\u4F5C ID\u3002" },
|
|
12978
|
+
status: {
|
|
12979
|
+
type: "string",
|
|
12980
|
+
enum: ["active", "paused", "completed", "cancelled", "all"],
|
|
12981
|
+
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"
|
|
12982
|
+
},
|
|
12983
|
+
discovery: { type: "string", enum: ["dialog", "scope"], description: "\u5F53\u524D\u5BF9\u8BDD\u6216\u540C\u7528\u6237\u540C\u7A7A\u95F4\u8303\u56F4\u3002" },
|
|
12984
|
+
source: {
|
|
12985
|
+
type: "string",
|
|
12986
|
+
enum: ["archive"],
|
|
12987
|
+
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"
|
|
12988
|
+
},
|
|
12989
|
+
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" },
|
|
12990
|
+
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
12991
|
query: {
|
|
12756
12992
|
type: "string",
|
|
12757
|
-
description: "\
|
|
12993
|
+
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
12994
|
}
|
|
12759
12995
|
},
|
|
12760
|
-
required: [
|
|
12996
|
+
required: []
|
|
12761
12997
|
}
|
|
12762
12998
|
};
|
|
12763
12999
|
|
|
12764
13000
|
// packages/ai/tools/queryMemoryTool.ts
|
|
12765
|
-
async function queryMemoryFunc(args, thunkApi) {
|
|
13001
|
+
async function queryMemoryFunc(args, thunkApi, context2) {
|
|
13002
|
+
if (args.mode === "work") {
|
|
13003
|
+
if (args.storage === "local") throw new Error("Web work memory only supports server storage");
|
|
13004
|
+
if (!context2?.dialogId) throw new Error("work memory requires a bound dialog");
|
|
13005
|
+
const { dialogId } = resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
13006
|
+
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 });
|
|
13007
|
+
if (result2?.error) throw new Error(result2.error.message ?? "work memory rejected");
|
|
13008
|
+
return { rawData: result2, displayData: JSON.stringify(result2) };
|
|
13009
|
+
}
|
|
12766
13010
|
const query = String(args.query ?? "").trim();
|
|
12767
13011
|
if (!query) throw new Error("queryMemory \u9700\u8981\u975E\u7A7A query\u3002");
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
const
|
|
13012
|
+
if (args.source !== void 0 && args.source !== "archive") throw new Error("Invalid memory source");
|
|
13013
|
+
if (args.source === void 0 && (args.limit !== void 0 || args.cursor !== void 0)) throw new Error("Pagination requires source archive");
|
|
13014
|
+
const { agentKey, spaceId } = resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12771
13015
|
const result = await callToolApi(
|
|
12772
13016
|
thunkApi,
|
|
12773
13017
|
"/api/memory/query",
|
|
12774
13018
|
{
|
|
12775
|
-
agentKey
|
|
13019
|
+
agentKey,
|
|
12776
13020
|
userInput: query,
|
|
12777
|
-
...
|
|
13021
|
+
...args.source === "archive" ? {
|
|
13022
|
+
source: args.source,
|
|
13023
|
+
...args.limit !== void 0 ? { limit: args.limit } : {},
|
|
13024
|
+
...args.cursor !== void 0 ? { cursor: args.cursor } : {}
|
|
13025
|
+
} : {},
|
|
13026
|
+
...args.source !== "archive" && spaceId ? { spaceId } : {}
|
|
12778
13027
|
},
|
|
12779
13028
|
{ withAuth: true }
|
|
12780
13029
|
);
|
|
12781
13030
|
const selectedItems = Array.isArray(result?.selectedItems) ? result.selectedItems : [];
|
|
12782
13031
|
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
|
|
13032
|
+
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
|
|
13033
|
+
${JSON.stringify(result)}` : displayData };
|
|
12784
13034
|
}
|
|
12785
13035
|
|
|
12786
13036
|
// packages/ai/tools/execShellTool.ts
|
|
@@ -13346,7 +13596,7 @@ var buildCreateSkillAgentArgs = (args) => {
|
|
|
13346
13596
|
references: args.references ?? [],
|
|
13347
13597
|
linkedSpaces: args.linkedSpaces ?? [],
|
|
13348
13598
|
temperature: 0.3,
|
|
13349
|
-
reasoning_effort: "medium"
|
|
13599
|
+
reasoning_effort: resolveDefaultReasoningEffort({ provider: (args.provider ?? "").trim() || DEFAULT_PROVIDER, model: (args.model ?? "").trim() || DEFAULT_MODEL2, fallback: "medium" })
|
|
13350
13600
|
};
|
|
13351
13601
|
};
|
|
13352
13602
|
|
|
@@ -13403,6 +13653,45 @@ async function createSkillAgentToolFunc(args, thunkApi) {
|
|
|
13403
13653
|
return createAgentToolFunc(buildCreateSkillAgentArgs(args), thunkApi);
|
|
13404
13654
|
}
|
|
13405
13655
|
|
|
13656
|
+
// packages/app/settings/fieldSelectors.ts
|
|
13657
|
+
var selectMaxExecutionTime = (state2) => state2.settings.maxExecutionTime;
|
|
13658
|
+
var selectEnabledSkills = createSelector(
|
|
13659
|
+
[
|
|
13660
|
+
(state2) => Boolean(
|
|
13661
|
+
state2.settings && Object.prototype.hasOwnProperty.call(state2.settings, "enabledSkills")
|
|
13662
|
+
),
|
|
13663
|
+
(state2) => state2.settings?.enabledSkills,
|
|
13664
|
+
(state2) => state2.settings?.enabledPromptSkills
|
|
13665
|
+
],
|
|
13666
|
+
(hasOwnEnabledSkills, enabledSkills, enabledPromptSkills) => {
|
|
13667
|
+
const preferences = hasOwnEnabledSkills ? { enabledSkills, enabledPromptSkills } : { enabledPromptSkills };
|
|
13668
|
+
return resolveUserEnabledSkills(preferences);
|
|
13669
|
+
}
|
|
13670
|
+
);
|
|
13671
|
+
var selectAutoApproveSelfUpdateFields = createSelector(
|
|
13672
|
+
[(state2) => state2.settings.autoApproveSelfUpdateFields],
|
|
13673
|
+
(fields) => normalizeAgentUpdateFieldList(
|
|
13674
|
+
fields,
|
|
13675
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS
|
|
13676
|
+
)
|
|
13677
|
+
);
|
|
13678
|
+
var selectSystemBuiltinSkills = createSelector(
|
|
13679
|
+
[(state2) => state2.settings.systemBuiltinSkills],
|
|
13680
|
+
(systemBuiltinSkills) => normalizeSystemBuiltinSkills(
|
|
13681
|
+
systemBuiltinSkills,
|
|
13682
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
13683
|
+
)
|
|
13684
|
+
);
|
|
13685
|
+
var selectUiPlugins = createSelector(
|
|
13686
|
+
[
|
|
13687
|
+
(state2) => state2.settings.uiPlugins,
|
|
13688
|
+
(state2) => state2.settings.uiPluginsOwnerAccountId,
|
|
13689
|
+
(state2) => state2.settings.uiPluginsGeneration,
|
|
13690
|
+
(_state, session) => session
|
|
13691
|
+
],
|
|
13692
|
+
(value, owner, generation, session) => session?.transition === "idle" && owner === session.activeAccountId && generation === session.sessionGeneration ? normalizeUiPlugins(value) : normalizeUiPlugins(void 0)
|
|
13693
|
+
);
|
|
13694
|
+
|
|
13406
13695
|
// packages/chat/messages/messageAgent.ts
|
|
13407
13696
|
function resolveMessageAgentKey(message) {
|
|
13408
13697
|
if (!message) return void 0;
|
|
@@ -14127,8 +14416,8 @@ function assertRuntimeKeyDispatchableByHost(input) {
|
|
|
14127
14416
|
`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
14417
|
);
|
|
14129
14418
|
}
|
|
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\
|
|
14419
|
+
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";
|
|
14420
|
+
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
14421
|
function resolveCliLocalSpawnDispatch(input) {
|
|
14133
14422
|
const requested = assertRuntimeKeyDispatchableByHost({
|
|
14134
14423
|
...input,
|
|
@@ -14158,10 +14447,13 @@ function resolvePlanForRequestedKey(requested, allowHostWrites, readOnly) {
|
|
|
14158
14447
|
if (readOnly === true) {
|
|
14159
14448
|
return { target: "host", reason: "read-only-host" };
|
|
14160
14449
|
}
|
|
14450
|
+
if (allowHostWrites !== true) {
|
|
14451
|
+
throw new Error(HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE);
|
|
14452
|
+
}
|
|
14161
14453
|
return {
|
|
14162
|
-
runtimeKey: "
|
|
14163
|
-
target: "
|
|
14164
|
-
reason: "default-
|
|
14454
|
+
runtimeKey: "local",
|
|
14455
|
+
target: "host",
|
|
14456
|
+
reason: "default-host-writes"
|
|
14165
14457
|
};
|
|
14166
14458
|
}
|
|
14167
14459
|
function normalizeExplicitHostCwd(rawCwd) {
|
|
@@ -14317,7 +14609,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14317
14609
|
const wakeEnabled = opts?.wakeEnabled === true;
|
|
14318
14610
|
return {
|
|
14319
14611
|
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\
|
|
14612
|
+
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
14613
|
parameters: {
|
|
14322
14614
|
type: "object",
|
|
14323
14615
|
properties: {
|
|
@@ -14402,6 +14694,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14402
14694
|
type: "string",
|
|
14403
14695
|
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
14696
|
},
|
|
14697
|
+
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
14698
|
runtimeKey: {
|
|
14406
14699
|
type: "string",
|
|
14407
14700
|
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 +14710,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14417
14710
|
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
14711
|
allowHostWrites: {
|
|
14419
14712
|
type: "boolean",
|
|
14420
|
-
description: "\u53EF\u9009\
|
|
14713
|
+
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
14714
|
}
|
|
14422
14715
|
},
|
|
14423
14716
|
required: ["task", "title"]
|
|
@@ -14425,19 +14718,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14425
14718
|
};
|
|
14426
14719
|
}
|
|
14427
14720
|
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) {
|
|
14721
|
+
async function startAgentRunFunc(args, thunkApi, context2) {
|
|
14441
14722
|
const { agentKey, task, input, agentName, batchId, wait } = args;
|
|
14442
14723
|
const continueDialogId = normalizeContinueDialogId(args.continueDialogId);
|
|
14443
14724
|
if (typeof task !== "string" || !task.trim()) throw new Error("startAgentRun \u7F3A\u5C11 task");
|
|
@@ -14459,11 +14740,16 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
14459
14740
|
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
14741
|
}
|
|
14461
14742
|
const resultMode = args.resultMode ?? "full";
|
|
14743
|
+
if (args.imagePaths !== void 0) throw new Error("image_backend_unsupported: imagePaths currently requires the CLI host-local executor");
|
|
14462
14744
|
const { dispatch } = thunkApi;
|
|
14463
14745
|
const explicitBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : void 0;
|
|
14464
14746
|
const effectiveBatchId = explicitBatchId ?? `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
|
|
14465
14747
|
const rawAgentKey = typeof agentKey === "string" ? agentKey.trim() : "";
|
|
14466
|
-
const
|
|
14748
|
+
const attribution = resolveToolAttributionContext(thunkApi.getState(), context2, {
|
|
14749
|
+
requireAgentKey: true,
|
|
14750
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A startAgentRun \u5F52\u5C5E"
|
|
14751
|
+
});
|
|
14752
|
+
const currentAgentKey = attribution.agentKey;
|
|
14467
14753
|
const effectiveAgentKey = !rawAgentKey || rawAgentKey.toLowerCase() === "self" ? currentAgentKey ?? rawAgentKey : rawAgentKey;
|
|
14468
14754
|
if (!effectiveAgentKey) {
|
|
14469
14755
|
throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\uFF0C\u4E14\u65E0\u6CD5\u8BC6\u522B\u5F53\u524D Agent\u3002");
|
|
@@ -14480,9 +14766,8 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
14480
14766
|
const effectiveAllowCredentialConcurrency = args.allowCredentialConcurrency ?? true;
|
|
14481
14767
|
const content = buildDelegatedTaskContent(task, input);
|
|
14482
14768
|
const payloadMetrics = calculateDelegatedPayloadMetrics(task, input, content);
|
|
14483
|
-
const activeDialogKey = getActiveDialogKey();
|
|
14484
14769
|
const explicitParentDialogId = typeof args.parentDialogId === "string" && args.parentDialogId.trim() ? args.parentDialogId.includes("-") ? extractCustomId(args.parentDialogId) : args.parentDialogId.trim() : void 0;
|
|
14485
|
-
const parentDialogId = explicitParentDialogId ??
|
|
14770
|
+
const parentDialogId = explicitParentDialogId ?? attribution.dialogId;
|
|
14486
14771
|
const hostAgentRunDispatcher = runtimeKey === "local" ? thunkApi?.extra?.startHostAgentRun : void 0;
|
|
14487
14772
|
if (runtimeKey === "local") {
|
|
14488
14773
|
if (args.allowHostWrites !== true) {
|
|
@@ -16267,14 +16552,14 @@ var cfScreenshotFunctionSchema = {
|
|
|
16267
16552
|
}
|
|
16268
16553
|
}
|
|
16269
16554
|
};
|
|
16270
|
-
async function cfScreenshotFunc(args, thunkApi) {
|
|
16555
|
+
async function cfScreenshotFunc(args, thunkApi, context2) {
|
|
16271
16556
|
const { url, html, fullPage = false, viewport } = args;
|
|
16272
16557
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16273
16558
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16274
16559
|
const data = await callToolApi(
|
|
16275
16560
|
thunkApi,
|
|
16276
16561
|
"/api/cf-screenshot",
|
|
16277
|
-
{ url: targetUrl, html, fullPage, viewport },
|
|
16562
|
+
{ url: targetUrl, html, fullPage, viewport, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
16278
16563
|
{ withAuth: true }
|
|
16279
16564
|
);
|
|
16280
16565
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
@@ -16309,12 +16594,12 @@ var cfGetMarkdownFunctionSchema = {
|
|
|
16309
16594
|
}
|
|
16310
16595
|
}
|
|
16311
16596
|
};
|
|
16312
|
-
async function cfGetMarkdownFunc(args, thunkApi) {
|
|
16597
|
+
async function cfGetMarkdownFunc(args, thunkApi, context2) {
|
|
16313
16598
|
const { url, html, waitForNetworkIdle = false } = args;
|
|
16314
16599
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16315
16600
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16316
16601
|
const gotoOptions = waitForNetworkIdle ? { waitUntil: "networkidle0" } : void 0;
|
|
16317
|
-
const data = await callToolApi(thunkApi, "/api/cf-markdown", { url: targetUrl, html, gotoOptions }, { withAuth: true });
|
|
16602
|
+
const data = await callToolApi(thunkApi, "/api/cf-markdown", { url: targetUrl, html, gotoOptions, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
16318
16603
|
const extractionIssue = detectExtractionIssue(data.markdown ?? "", targetUrl ?? url ?? "\u7F51\u9875");
|
|
16319
16604
|
if (extractionIssue) {
|
|
16320
16605
|
throw new Error(extractionIssue.message);
|
|
@@ -16356,11 +16641,11 @@ var cfGeneratePDFFunctionSchema = {
|
|
|
16356
16641
|
}
|
|
16357
16642
|
}
|
|
16358
16643
|
};
|
|
16359
|
-
async function cfGeneratePDFFunc(args, thunkApi) {
|
|
16644
|
+
async function cfGeneratePDFFunc(args, thunkApi, context2) {
|
|
16360
16645
|
const { url, html, pdfOptions } = args;
|
|
16361
16646
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16362
16647
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16363
|
-
const data = await callToolApi(thunkApi, "/api/cf-pdf", { url: targetUrl, html, pdfOptions }, { withAuth: true });
|
|
16648
|
+
const data = await callToolApi(thunkApi, "/api/cf-pdf", { url: targetUrl, html, pdfOptions, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
16364
16649
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
16365
16650
|
return {
|
|
16366
16651
|
rawData: rewritten ? { ...data, originalUrl, resolvedUrl: targetUrl } : data,
|
|
@@ -16398,7 +16683,7 @@ var cfExtractJSONFunctionSchema = {
|
|
|
16398
16683
|
required: []
|
|
16399
16684
|
}
|
|
16400
16685
|
};
|
|
16401
|
-
async function cfExtractJSONFunc(args, thunkApi) {
|
|
16686
|
+
async function cfExtractJSONFunc(args, thunkApi, context2) {
|
|
16402
16687
|
const { url, html, prompt, response_format } = args;
|
|
16403
16688
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16404
16689
|
if (!prompt && !response_format) throw new Error("\u5FC5\u987B\u63D0\u4F9B prompt \u6216 response_format");
|
|
@@ -16406,7 +16691,7 @@ async function cfExtractJSONFunc(args, thunkApi) {
|
|
|
16406
16691
|
const data = await callToolApi(
|
|
16407
16692
|
thunkApi,
|
|
16408
16693
|
"/api/cf-json",
|
|
16409
|
-
{ url: targetUrl, html, prompt, response_format },
|
|
16694
|
+
{ url: targetUrl, html, prompt, response_format, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
16410
16695
|
{ withAuth: true }
|
|
16411
16696
|
);
|
|
16412
16697
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
@@ -18190,12 +18475,12 @@ var cfSpeechToTextFunctionSchema = {
|
|
|
18190
18475
|
required: ["audioUrl"]
|
|
18191
18476
|
}
|
|
18192
18477
|
};
|
|
18193
|
-
async function cfSpeechToTextFunc(args, thunkApi) {
|
|
18478
|
+
async function cfSpeechToTextFunc(args, thunkApi, context2) {
|
|
18194
18479
|
const { audioUrl } = args;
|
|
18195
18480
|
if (!audioUrl || typeof audioUrl !== "string") {
|
|
18196
18481
|
throw new Error("\u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 audioUrl");
|
|
18197
18482
|
}
|
|
18198
|
-
const data = await callToolApi(thunkApi, "/api/cf-speech-to-text", { audioUrl }, { withAuth: true });
|
|
18483
|
+
const data = await callToolApi(thunkApi, "/api/cf-speech-to-text", { audioUrl, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
18199
18484
|
return {
|
|
18200
18485
|
rawData: data,
|
|
18201
18486
|
displayData: `\u{1F3A4} \u8BED\u97F3\u8F6C\u6587\u5B57\u5B8C\u6210
|
|
@@ -18370,6 +18655,10 @@ function toAppSummary(record, fallbackServerOrigin) {
|
|
|
18370
18655
|
};
|
|
18371
18656
|
}
|
|
18372
18657
|
|
|
18658
|
+
// packages/create/space/contentKeyUtils.ts
|
|
18659
|
+
var isAppContentKey = (contentKey) => typeof contentKey === "string" && contentKey.startsWith("app-");
|
|
18660
|
+
var normalizeAppRouteId = (contentKey) => isAppContentKey(contentKey) ? contentKey : `app-${contentKey}`;
|
|
18661
|
+
|
|
18373
18662
|
// packages/app/utils/myContentItems.ts
|
|
18374
18663
|
var dialogSummaryStatus = (value) => value === null || typeof value === "string" && ["pending", "running", "done", "completed", "failed", "cancelled"].includes(value) ? value : void 0;
|
|
18375
18664
|
var dialogSummaryUnreadAt = (value) => value === null || typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
@@ -18482,7 +18771,7 @@ function buildMyContentItemsFromUserData(records, currentServer = "", spaceNameB
|
|
|
18482
18771
|
}
|
|
18483
18772
|
|
|
18484
18773
|
// packages/ai/tools/searchWorkspaceTool.ts
|
|
18485
|
-
var
|
|
18774
|
+
var selectCurrentSpaceIdFromState = (_state) => getCurrentSpaceId();
|
|
18486
18775
|
var selectCurrentSpaceFromState = (state2) => selectCurrentSpace(state2);
|
|
18487
18776
|
var selectAllMemberSpacesFromState = (state2) => {
|
|
18488
18777
|
const memberSpaces = getAllMemberSpaces();
|
|
@@ -18587,7 +18876,7 @@ var loadLocalMyContentResults = async (thunkApi, state2) => {
|
|
|
18587
18876
|
async function searchWorkspaceFunc(args, thunkApi) {
|
|
18588
18877
|
const { getState } = thunkApi;
|
|
18589
18878
|
const state2 = getState();
|
|
18590
|
-
const spaceId =
|
|
18879
|
+
const spaceId = selectCurrentSpaceIdFromState(state2);
|
|
18591
18880
|
if (!spaceId) {
|
|
18592
18881
|
throw new Error("\u65E0\u6CD5\u67E5\u8BE2\u5185\u5BB9\uFF0C\u56E0\u4E3A\u5F53\u524D\u7A7A\u95F4\u672A\u8BBE\u5B9A\u3002");
|
|
18593
18882
|
}
|
|
@@ -18914,6 +19203,15 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18914
19203
|
if (!originalData) {
|
|
18915
19204
|
throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
|
|
18916
19205
|
}
|
|
19206
|
+
const [
|
|
19207
|
+
{ markdownToSlate },
|
|
19208
|
+
{ slateToRenderMarkdown },
|
|
19209
|
+
{ extractMentionsFromSlate }
|
|
19210
|
+
] = await Promise.all([
|
|
19211
|
+
import("./markdownToSlate-KIYM7B3P.js"),
|
|
19212
|
+
import("./slateToRenderMarkdown-R3X74MCX.js"),
|
|
19213
|
+
import("./slateUtils-ESQAJ6RN.js")
|
|
19214
|
+
]);
|
|
18917
19215
|
const currentMarkdown = typeof originalData.content === "string" && originalData.content.trim() ? originalData.content : slateToRenderMarkdown(
|
|
18918
19216
|
Array.isArray(originalData.slateData) ? originalData.slateData : []
|
|
18919
19217
|
);
|
|
@@ -18934,7 +19232,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18934
19232
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18935
19233
|
};
|
|
18936
19234
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18937
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
19235
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-AWWI72FA.js");
|
|
18938
19236
|
if (getDocState().pageKey === id) {
|
|
18939
19237
|
applyExternalDocUpdate({
|
|
18940
19238
|
slateData: finalSlateData,
|
|
@@ -18959,35 +19257,20 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18959
19257
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
18960
19258
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
18961
19259
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
18962
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-
|
|
19260
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-TN6GFASU.js")).setSettings;
|
|
18963
19261
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
18964
19262
|
}
|
|
18965
19263
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
18966
19264
|
name: "updateUserPreferenceProfile",
|
|
18967
19265
|
description: [
|
|
18968
19266
|
"\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
|
|
19267
|
+
"\u9002\u7528\u4E8E\u4FDD\u5B58\u7528\u6237\u7684 global prompt / \u81EA\u6211\u4ECB\u7ECD\u6458\u8981\u3002",
|
|
18970
19268
|
"\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
19269
|
"\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
19270
|
].join("\n"),
|
|
18973
19271
|
parameters: {
|
|
18974
19272
|
type: "object",
|
|
18975
19273
|
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
19274
|
autoApproveSelfUpdateFields: {
|
|
18992
19275
|
type: "array",
|
|
18993
19276
|
items: {
|
|
@@ -19013,10 +19296,6 @@ var updateUserPreferenceProfileFunctionSchema = {
|
|
|
19013
19296
|
},
|
|
19014
19297
|
description: "\u54EA\u4E9B updateSelf \u5B57\u6BB5\u4EE5\u540E\u4E0D\u518D\u8BE2\u95EE\u7528\u6237\uFF0C\u76F4\u63A5\u81EA\u52A8\u901A\u8FC7\u3002"
|
|
19015
19298
|
},
|
|
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
19299
|
defaultAgentId: {
|
|
19021
19300
|
type: "string",
|
|
19022
19301
|
description: "\u53EF\u9009\uFF1A\u7528\u6237\u660E\u786E\u8981\u6C42\u5207\u6362\u9996\u9875\u9ED8\u8BA4 agent \u65F6\u624D\u586B\u5199\u3002"
|
|
@@ -19030,26 +19309,12 @@ var updateUserPreferenceProfileFunctionSchema = {
|
|
|
19030
19309
|
};
|
|
19031
19310
|
async function updateUserPreferenceProfileFunc(args, thunkApi) {
|
|
19032
19311
|
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
19312
|
if (Array.isArray(args.autoApproveSelfUpdateFields)) {
|
|
19044
19313
|
changes.autoApproveSelfUpdateFields = normalizeAgentUpdateFieldList(
|
|
19045
19314
|
args.autoApproveSelfUpdateFields,
|
|
19046
19315
|
[]
|
|
19047
19316
|
);
|
|
19048
19317
|
}
|
|
19049
|
-
const globalPrompt = asOptionalTrimmedString(args.globalPrompt);
|
|
19050
|
-
if (globalPrompt) {
|
|
19051
|
-
changes.globalPrompt = globalPrompt;
|
|
19052
|
-
}
|
|
19053
19318
|
const defaultAgentId = asOptionalTrimmedString(args.defaultAgentId);
|
|
19054
19319
|
if (defaultAgentId) {
|
|
19055
19320
|
changes.defaultAgentId = defaultAgentId;
|
|
@@ -19064,15 +19329,9 @@ async function updateUserPreferenceProfileFunc(args, thunkApi) {
|
|
|
19064
19329
|
summary: asOptionalTrimmedString(args.summary) ?? null
|
|
19065
19330
|
};
|
|
19066
19331
|
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
19332
|
if (changes.autoApproveSelfUpdateFields)
|
|
19073
19333
|
labels.push("\u81EA\u6211\u66F4\u65B0\u514D\u8BE2\u95EE\u5B57\u6BB5\u5DF2\u66F4\u65B0");
|
|
19074
19334
|
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
19335
|
return {
|
|
19077
19336
|
rawData,
|
|
19078
19337
|
displayData: `\u5DF2\u4FDD\u5B58\u7528\u6237\u504F\u597D\uFF1A${labels.join("\uFF0C")}`
|
|
@@ -19328,7 +19587,7 @@ async function runZiweiChart(input) {
|
|
|
19328
19587
|
const gender = normalizeGender(input.gender);
|
|
19329
19588
|
const fixLeap = input.fixLeap !== false;
|
|
19330
19589
|
const isLeapMonth = input.isLeapMonth === true;
|
|
19331
|
-
const { astro } = await import("./lib-
|
|
19590
|
+
const { astro } = await import("./lib-62SWPXNF.js");
|
|
19332
19591
|
const rawChart = calendarType === "lunar" ? astro.byLunar(dateStr, timeIndex, gender, isLeapMonth, fixLeap, language) : astro.bySolar(dateStr, timeIndex, gender, fixLeap, language);
|
|
19333
19592
|
const palaces = rawChart.palaces.map((palace) => ({
|
|
19334
19593
|
index: palace.index,
|
|
@@ -19622,7 +19881,7 @@ var baseToolDefinitions = [
|
|
|
19622
19881
|
executor: updateUserPreferenceProfileFunc,
|
|
19623
19882
|
description: {
|
|
19624
19883
|
name: "updateUserPreferenceProfile",
|
|
19625
|
-
description: "\u4FDD\u5B58\u7528\u6237\u7684\
|
|
19884
|
+
description: "\u4FDD\u5B58\u7528\u6237\u7684\u5168\u5C40\u63D0\u793A\u8BCD\u7B49\u4E2A\u6027\u5316\u8BBE\u7F6E\u3002",
|
|
19626
19885
|
category: "\u7528\u6237\u8BBE\u7F6E / \u4E2A\u6027\u5316"
|
|
19627
19886
|
},
|
|
19628
19887
|
behavior: "action"
|
|
@@ -21345,6 +21604,7 @@ var findToolExecutor = (rawName) => {
|
|
|
21345
21604
|
};
|
|
21346
21605
|
|
|
21347
21606
|
export {
|
|
21607
|
+
selectMaxExecutionTime,
|
|
21348
21608
|
readXPostFunctionSchema,
|
|
21349
21609
|
readXPostFunc,
|
|
21350
21610
|
readXhsProfileFunctionSchema,
|