nolo-cli 0.231.0-alpha.1 → 0.240.0-alpha.2
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-7V3NSK4W.js → _executeModel-5NA4USGG.js} +56 -51
- package/{action-GDZDXPMB.js → action-X75O3XPH.js} +7 -4
- package/{addContentAction-7RO4AMRI.js → addContentAction-GVC77QSN.js} +9 -8
- package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-KKDVAMW3.js} +12 -11
- package/{agentDeleteCommand-MD76OMLN.js → agentDeleteCommand-2RFGKFAB.js} +77 -69
- package/{agentEmailCommands-T4TW4IBX.js → agentEmailCommands-GQCQKKOR.js} +84 -72
- package/{agentListCommands-4WLG32IW.js → agentListCommands-HSGLDPDQ.js} +40 -47
- package/{agentMachineCommands-LSDGA5WR.js → agentMachineCommands-BISF6PVV.js} +26 -22
- package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-O3Q25PKU.js} +2 -2
- package/{agentPullCommand-KHV4EELF.js → agentPullCommand-G6U2LHMW.js} +1 -1
- package/{agentRecordCommands-7TEX2B7Y.js → agentRecordCommands-AOXPGYAJ.js} +79 -67
- package/{agentRunCommand-23SMDVDW.js → agentRunCommand-YTZJCRAL.js} +85 -72
- package/{agentRunControl-MBG4U6SL.js → agentRunControl-VBL7UFSG.js} +1 -1
- package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-T7BX2WGL.js} +24 -19
- package/{agentSlice-AATYVDP6.js → agentSlice-XJNKE3PG.js} +10 -9
- package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-LURUSPY7.js} +27 -23
- package/{appDeployCommands-AU4IUN33.js → appDeployCommands-SMEW4AK2.js} +27 -23
- package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-VYPJTBJK.js} +27 -23
- package/{appGetCommands-BGTLIQ4K.js → appGetCommands-N4NI5GGJ.js} +27 -23
- package/{appListCommands-CUCPRUXW.js → appListCommands-5C6ONN3Z.js} +27 -23
- package/{authCommand-3SUYUNQV.js → authCommand-4CVBDADE.js} +15 -13
- package/{authCommands-BLE7ETZH.js → authCommands-EHU2BHOX.js} +7 -5
- package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-AYWYQVA4.js} +3 -3
- package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-CSDG2HYN.js} +1 -1
- package/{chunk-HHFGE2WF.js → chunk-2574ANSV.js} +1 -1
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-S6FDXXZV.js → chunk-3EMIEC27.js} +1 -1
- package/{chunk-EXNV7CCV.js → chunk-3FBAVU2Y.js} +11 -9
- package/{chunk-ZH3KXFHS.js → chunk-4FIO2S7Z.js} +1 -1
- package/{chunk-U4FF7LRY.js → chunk-4IQVE43Z.js} +30 -26
- package/{chunk-VQ5N5GSV.js → chunk-4Q6HQORG.js} +1 -1
- package/{chunk-P2ZLUIW2.js → chunk-4X5AVCM7.js} +94 -4
- package/chunk-4ZCTKB27.js +31 -0
- package/{chunk-42OKN2LI.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-QYB23WUH.js → chunk-5QZSEQSK.js} +1 -1
- package/{chunk-7JGMNKKG.js → chunk-6CKUO32A.js} +8 -0
- package/chunk-6D25V6CB.js +133 -0
- package/{chunk-LHN7NIQZ.js → chunk-6WOLPIPY.js} +93 -90
- package/{chunk-6QHKRARD.js → chunk-6WZVM33D.js} +9 -4
- package/{chunk-NVEYEKN3.js → chunk-7AJRJGSQ.js} +254 -359
- package/chunk-7NIBQ4HY.js +138 -0
- package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
- package/{chunk-GXZ5LB7H.js → chunk-A3LUWRQK.js} +4 -4
- package/{chunk-4ZGPHFLE.js → chunk-A5EVA6HU.js} +2 -2
- package/{chunk-3ING4D5X.js → chunk-AEQMKYZN.js} +4 -4
- package/{chunk-FFSPUVL5.js → chunk-AH5R7BYW.js} +6 -166
- package/{chunk-7FEP5USX.js → chunk-ANJRDS6U.js} +3 -3
- package/{chunk-YFLVRVYK.js → chunk-AVJDELEA.js} +1 -1
- package/{chunk-HYLRQDEE.js → chunk-B5SV4H3J.js} +6 -6
- package/{chunk-KUOMUZH6.js → chunk-B7DE5XJW.js} +137 -290
- package/chunk-BEM6LPD2.js +734 -0
- package/{chunk-DUUDXSLX.js → chunk-BGGAY6OK.js} +27 -3
- package/{chunk-YCFP57LH.js → chunk-BGGV6B5O.js} +408 -230
- package/{chunk-BP5ZJ6B4.js → chunk-BIABIPGW.js} +1 -1
- package/{chunk-TQEKUOTI.js → chunk-BXSMFPTG.js} +4 -4
- package/{chunk-RG2DGNL6.js → chunk-CKZPMJNU.js} +3 -3
- package/{chunk-WU443D7A.js → chunk-CVJRVBJL.js} +2 -2
- package/{chunk-BIWI5M4E.js → chunk-D374I563.js} +1 -1
- package/{chunk-QRGDJA4B.js → chunk-DNZ4JJ7C.js} +1 -1
- package/chunk-DVYAFH2Q.js +103 -0
- package/{chunk-FTMFO6LI.js → chunk-DXW5WDHZ.js} +4 -4
- package/{chunk-ZTR65O4L.js → chunk-E5KJOZWY.js} +3 -3
- package/{chunk-57TLKTVZ.js → chunk-E5KY7RAY.js} +565 -103
- package/{chunk-G7IUT2V3.js → chunk-EBKHA63G.js} +103 -12
- package/{chunk-DGYCDA6W.js → chunk-F3XI6WQP.js} +17 -10
- package/{chunk-M3OZRQNH.js → chunk-F6YWDVIB.js} +1 -1
- package/{chunk-PR2LAQAC.js → chunk-FFYE5ATM.js} +4 -4
- package/{chunk-6NNDUDAZ.js → chunk-FZKA3XFA.js} +11 -11
- package/{chunk-MNEZUL5S.js → chunk-G22P367E.js} +31 -14
- package/{chunk-6OQMSPB7.js → chunk-GDUC4VS2.js} +7 -7
- package/{chunk-R6Z5S5GA.js → chunk-GXXY2NL3.js} +16 -14
- package/{chunk-U2HBB7RS.js → chunk-H7ZYKHAZ.js} +27 -7
- package/{chunk-3U44JB3O.js → chunk-HCNOO374.js} +1 -1
- package/{chunk-HSSBDZLD.js → chunk-HOM6LTEW.js} +1 -1
- package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
- package/{chunk-TPG2DPN2.js → chunk-IJTXNLQE.js} +9 -9
- package/{chunk-ALAES342.js → chunk-IUMS6F53.js} +2 -2
- package/{chunk-547ENH5T.js → chunk-IUTUWIKE.js} +2 -2
- package/{chunk-S6K5F3KP.js → chunk-JBWXPACD.js} +1 -1
- package/{chunk-XAG3FWBE.js → chunk-KZPEGO6D.js} +1 -1
- package/{chunk-RBPUNSG5.js → chunk-LYDEFPQP.js} +18 -108
- package/{chunk-OWKNSIXL.js → chunk-MECDGHLK.js} +271 -66
- package/{chunk-FJSNBZXR.js → chunk-MM73SP4K.js} +1 -1
- package/{chunk-XSW4EXQV.js → chunk-MYOSN6BT.js} +2 -2
- package/{chunk-ZEVQHCLM.js → chunk-MYPKBJJO.js} +2 -2
- package/{chunk-DBUR22G5.js → chunk-N2JROHD3.js} +4 -4
- package/{chunk-ATEKLSLR.js → chunk-O6IPRAVV.js} +14 -9
- package/{chunk-PPJYZRSQ.js → chunk-OX6GNNVT.js} +6 -1
- package/{chunk-WFVASLQT.js → chunk-P3IZUMIC.js} +1 -1
- package/{chunk-FPBJM2BW.js → chunk-PGKA77TZ.js} +26 -20
- package/{chunk-IONGMVPY.js → chunk-PRMEU7BT.js} +229 -7
- package/{chunk-OJ45MEEI.js → chunk-PROOOQZ3.js} +1 -1
- package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/chunk-RETQOQ4D.js +33394 -0
- package/{chunk-CMMI3DAT.js → chunk-RM4UMFY4.js} +33 -26
- package/{chunk-262R3XNN.js → chunk-S2MHR4PU.js} +151 -5
- package/{chunk-DEA37IUY.js → chunk-T6VROBY7.js} +2 -2
- package/{chunk-M4SFKP5L.js → chunk-TEMLHVGX.js} +1 -1
- package/{chunk-3QIYD3VM.js → chunk-TRHJ4NJB.js} +61 -792
- package/{chunk-OBIC6EG7.js → chunk-TWTJV35S.js} +1 -1
- package/{chunk-TCZ2VJZQ.js → chunk-U3G7RRXJ.js} +5 -5
- package/{chunk-F6Z6ZCUV.js → chunk-UFC4J7OY.js} +3 -3
- package/{chunk-5YMA6DDZ.js → chunk-UHW6SCVK.js} +1 -1
- package/{chunk-4N6G2CKP.js → chunk-ULLHVDTZ.js} +46 -1
- package/{chunk-XFXFPUO7.js → chunk-VM72HKW2.js} +7 -7
- package/{chunk-MHHLABT3.js → chunk-VREG6ANQ.js} +102 -99
- package/chunk-VSRISJXZ.js +107 -0
- package/chunk-WDWZPASX.js +29 -0
- package/{chunk-ILHQ2AXT.js → chunk-WRKMXMU7.js} +2 -0
- package/chunk-X7IA2B7R.js +166 -0
- package/{chunk-5ZMIIR23.js → chunk-XBAEM4RI.js} +7 -0
- package/{chunk-4JVNURX4.js → chunk-XS5A3EKX.js} +1 -23
- package/{chunk-N5Z2V73W.js → chunk-Y2MF4DCJ.js} +1 -1
- package/{chunk-KUDCKVYQ.js → chunk-Y5OWZQMJ.js} +28 -19
- package/{chunk-TI2EPRHE.js → chunk-YGCOJNFZ.js} +3 -3
- package/{chunk-JQZRSXS5.js → chunk-YGDYYFRX.js} +9 -13
- package/{chunk-X7QAIY5B.js → chunk-Z2WZAE4P.js} +128 -150
- package/chunk-Z6YTCDU4.js +24 -0
- package/{chunk-RRDRQOEC.js → chunk-ZEKUFJLW.js} +81 -66
- package/{chunk-EVGU5P4U.js → chunk-ZVOL2MAJ.js} +1 -1
- package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-U5OAVAKQ.js} +2 -2
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-S42VMGB6.js} +1 -1
- package/{cliLocalAgentRecordReader-H3HYQRRR.js → cliLocalAgentRecordReader-HVZAQCUD.js} +29 -25
- package/{commandRegistry-35EMLPIZ.js → commandRegistry-FIXBZJHE.js} +89 -85
- package/{contentThunks-BCNMGA5J.js → contentThunks-U6OC4R2N.js} +23 -22
- package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-U7XSRVJP.js} +1 -1
- package/{createAgentAutomationAction-HEU4KOYF.js → createAgentAutomationAction-IP4LFN3W.js} +23 -22
- package/{createDialogAction-5DSL5ESZ.js → createDialogAction-IAGQJ3LH.js} +24 -23
- package/{createPageAction-BBZ25AFI.js → createPageAction-AZ3UIFKA.js} +24 -23
- package/{dbSlice-XRUZOGSU.js → dbSlice-DKKMJJYY.js} +8 -7
- package/{deleteFile-6URDHYRB.js → deleteFile-TQSONMVU.js} +7 -4
- package/{dialogCommands-6SZD4TYP.js → dialogCommands-PCDRMBWG.js} +30 -26
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-O35MWMOS.js} +3 -3
- package/{dialogSlice-QJ5PQOM3.js → dialogSlice-QAKYN4DE.js} +22 -21
- package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-2SSLTXKO.js} +2 -2
- package/{docCreateCommands-25E6PGN3.js → docCreateCommands-CFQFZOAD.js} +26 -22
- package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-5CPNTIIS.js} +27 -23
- package/{docReadCommands-JY2E5XEN.js → docReadCommands-XQILYSAJ.js} +26 -22
- package/{docStore-XJ4UMU3C.js → docStore-GIVRT7TQ.js} +10 -9
- package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-VETKSUDD.js} +26 -22
- package/{handleSendMessageAction-YHAOXARI.js → handleSendMessageAction-HKIW4ZNO.js} +48 -45
- package/{hostCredentialCreate-62AWCBQC.js → hostCredentialCreate-6VDJFNDO.js} +81 -68
- package/index.js +8 -8
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localRuntimeAdapter-KNQNNHUM.js → localRuntimeAdapter-BQ4F5PZV.js} +81 -69
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-WCNA4A3G.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-CRNIBOOM.js} +1 -1
- package/{machineCommands-X2FMPSV4.js → machineCommands-K6XIGOAD.js} +77 -65
- package/{machineWsRunDispatch-XHTPOYVJ.js → machineWsRunDispatch-4OO7Z6UM.js} +77 -65
- package/mcpLocalAuthorizeCommand-ZP6ESAGE.js +106 -0
- package/{memberThunks-7Y3OYSJQ.js → memberThunks-PBJPZ2JU.js} +15 -10
- package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
- package/package.json +1 -1
- package/{projectArchive-NPQ3YOAV.js → projectArchive-G7AOQPRW.js} +24 -23
- package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-OPBCAONX.js} +1 -1
- package/{providerRegistry-ZI2KORJ7.js → providerRegistry-J2HCVTHE.js} +1 -1
- package/{read-TYMBGEXO.js → read-JEGPITEW.js} +6 -5
- package/{readDocTool-SKQVHBLO.js → readDocTool-TE3XIU4Y.js} +1 -1
- package/{readlineWorkspace-77PILYDH.js → readlineWorkspace-XMPGXR77.js} +2935 -2376
- package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-CX3OAH4Y.js} +14 -13
- package/{runAgentClientLoop-XNKAXUKU.js → runAgentClientLoop-HQJPDFGQ.js} +65 -45
- package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-GUH2YGMH.js} +3 -3
- package/{secretCommands-KZWBZIYS.js → secretCommands-NJXFVHZU.js} +2 -2
- package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-CGM67EEQ.js} +11 -10
- package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-3ABWPPXR.js} +14 -13
- package/{settingThunks-ZRGWVGZD.js → settingThunks-AY76OHYX.js} +176 -57
- package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-TOGSGCPS.js → spaceCommands-G63QGYQO.js} +25 -21
- package/{streamAgentChatTurn-IARUEZPU.js → streamAgentChatTurn-E3XH2KFD.js} +127 -85
- package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-G6EZRKCQ.js} +12 -11
- package/{tableCommands-FTAOCBTX.js → tableCommands-JI75ZHDI.js} +4 -1
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-62UUPDUA.js} +3 -5
- package/{tools-5UWS65PB.js → tools-7RSX22FT.js} +41 -37
- package/{tuiRestart-2IL37YIB.js → tuiRestart-KAAA7TND.js} +2 -2
- package/{tuiSummaryLlmCaller-R4H3ZZ52.js → tuiSummaryLlmCaller-BVNHMWLR.js} +5 -5
- package/{updateCommands-CPATDG6J.js → updateCommands-ASK5XYPH.js} +3 -3
- package/{updateDialogTitleAction-G6C6XVNV.js → updateDialogTitleAction-SEWV252V.js} +23 -22
- package/{usageCommand-2BF74MKF.js → usageCommand-JVT5J3DC.js} +2 -2
- package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-IZYYUTEW.js} +3 -3
- package/webapi-24RZDIIQ.js +2488 -0
- package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-BSDIS2J5.js} +2 -2
- package/workContext-MM3P5GP5.js +13 -0
- package/workContextAccess-UZHDLBUR.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/chunk-ZXF6D3I6.js +0 -359
- package/{accountResolver-QETKNC7T.js → accountResolver-EK2S4PWF.js} +3 -3
- package/{localDialogRead-CCOCVGAP.js → localDialogRead-AV2VKKPG.js} +0 -0
- package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-YIZ7KLUP.js} +5 -5
|
@@ -2,15 +2,26 @@ import {
|
|
|
2
2
|
buildAgentDiscoveryResult,
|
|
3
3
|
deriveCredentialGroup,
|
|
4
4
|
injectSpeedContextIntoListAgentsResult,
|
|
5
|
+
isServerDispatchSpeedSource,
|
|
5
6
|
resolveDiscoveryScope,
|
|
6
7
|
resolvePaginationArgs,
|
|
7
8
|
toDiscoverySafeAgentSummary
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZEKUFJLW.js";
|
|
10
|
+
import {
|
|
11
|
+
formatWorkContextWriteNotice
|
|
12
|
+
} from "./chunk-WDWZPASX.js";
|
|
13
|
+
import {
|
|
14
|
+
AGENT_UPDATE_FIELD_NAMES,
|
|
15
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS,
|
|
16
|
+
normalizeAgentUpdateFieldList,
|
|
17
|
+
normalizeSystemBuiltinSkills,
|
|
18
|
+
normalizeUiPlugins
|
|
19
|
+
} from "./chunk-LYDEFPQP.js";
|
|
9
20
|
import {
|
|
10
21
|
applyFetchSpaceFulfilled,
|
|
11
22
|
fetchAuthoritativeRemoteSpace,
|
|
12
23
|
selectSpaceRemoteAuth
|
|
13
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6WZVM33D.js";
|
|
14
25
|
import {
|
|
15
26
|
ToolResultError,
|
|
16
27
|
clipMultilineText,
|
|
@@ -19,18 +30,21 @@ import {
|
|
|
19
30
|
loadSkillFunc,
|
|
20
31
|
loadSkillFunctionSchema,
|
|
21
32
|
parseUiCard,
|
|
22
|
-
|
|
33
|
+
resolveMemoryToolContext,
|
|
34
|
+
resolveToolAttributionContext,
|
|
23
35
|
toolRunUpdated,
|
|
24
36
|
uiCardFallback,
|
|
25
37
|
waitForAbortableDelay
|
|
26
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-VREG6ANQ.js";
|
|
27
39
|
import {
|
|
28
40
|
isGatewayHttpStatus
|
|
29
41
|
} from "./chunk-NF64D32W.js";
|
|
30
42
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
resolveUserEnabledSkills
|
|
44
|
+
} from "./chunk-DVYAFH2Q.js";
|
|
45
|
+
import {
|
|
46
|
+
createDocState
|
|
47
|
+
} from "./chunk-DXW5WDHZ.js";
|
|
34
48
|
import {
|
|
35
49
|
ToolApiError,
|
|
36
50
|
buildToolRequestHeaders,
|
|
@@ -38,14 +52,14 @@ import {
|
|
|
38
52
|
getRequestConfig,
|
|
39
53
|
getToolBaseUrl,
|
|
40
54
|
getToolRequestContext
|
|
41
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-XS5A3EKX.js";
|
|
42
56
|
import {
|
|
43
57
|
readDocFunc,
|
|
44
58
|
readDocFunctionSchema,
|
|
45
59
|
readPageFunc,
|
|
46
60
|
readPageFunctionSchema,
|
|
47
61
|
resolvePageReadMarkdown
|
|
48
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-BIABIPGW.js";
|
|
49
63
|
import {
|
|
50
64
|
markdownToSlate
|
|
51
65
|
} from "./chunk-FJ23FZXF.js";
|
|
@@ -56,11 +70,10 @@ import {
|
|
|
56
70
|
slateToRenderMarkdown
|
|
57
71
|
} from "./chunk-63W5N6P3.js";
|
|
58
72
|
import {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} from "./chunk-IONGMVPY.js";
|
|
73
|
+
createDialogAction,
|
|
74
|
+
uiAskChoiceFunc,
|
|
75
|
+
uiAskChoiceFunctionSchema
|
|
76
|
+
} from "./chunk-PRMEU7BT.js";
|
|
64
77
|
import {
|
|
65
78
|
DEFAULT_COLLAPSED_CATEGORIES,
|
|
66
79
|
addContentToSpace,
|
|
@@ -77,7 +90,7 @@ import {
|
|
|
77
90
|
updateContentCategory,
|
|
78
91
|
updateContentTitle,
|
|
79
92
|
writeStoredCollapsedCategories
|
|
80
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-FZKA3XFA.js";
|
|
81
94
|
import {
|
|
82
95
|
addMemberSpace,
|
|
83
96
|
getAllMemberSpaces,
|
|
@@ -94,39 +107,33 @@ import {
|
|
|
94
107
|
setViewMode,
|
|
95
108
|
updateCurrentSpaceIfMatch,
|
|
96
109
|
updateMemberSpaceName
|
|
97
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-IUTUWIKE.js";
|
|
98
111
|
import {
|
|
99
112
|
buildDatabaseFileContentUrl,
|
|
100
113
|
deleteDialog,
|
|
101
|
-
normalizeAppRouteId,
|
|
102
|
-
resolveDialogRuntimeAgentKey,
|
|
103
114
|
runtime_default,
|
|
104
115
|
selectAllMsgs,
|
|
105
116
|
selectCurrentDialogConfig,
|
|
106
117
|
selectCurrentDialogId,
|
|
107
|
-
selectMsgById
|
|
108
|
-
|
|
109
|
-
uiAskChoiceFunctionSchema
|
|
110
|
-
} from "./chunk-KUOMUZH6.js";
|
|
118
|
+
selectMsgById
|
|
119
|
+
} from "./chunk-B7DE5XJW.js";
|
|
111
120
|
import {
|
|
112
121
|
createAgent,
|
|
113
122
|
deleteServerSyncedCredential,
|
|
114
123
|
runLlm,
|
|
115
124
|
streamAgentChatTurn,
|
|
116
125
|
updateAgent
|
|
117
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-IJTXNLQE.js";
|
|
118
127
|
import {
|
|
119
128
|
buildMediaToolConfirmation,
|
|
120
129
|
normalizeMediaConfirmExecutionRevision
|
|
121
130
|
} from "./chunk-QYPE3TS3.js";
|
|
122
131
|
import {
|
|
123
|
-
getActiveDialogKey,
|
|
124
|
-
selectCurrentDialogKey,
|
|
125
132
|
selectPendingRawDataByPageKey
|
|
126
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-I2OYPD3Y.js";
|
|
127
134
|
import {
|
|
128
135
|
require_react
|
|
129
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-RD3QLZQV.js";
|
|
130
137
|
import {
|
|
131
138
|
resolveDefaultReasoningEffort
|
|
132
139
|
} from "./chunk-5ZUOVCKT.js";
|
|
@@ -142,16 +149,16 @@ import {
|
|
|
142
149
|
} from "./chunk-3L2WKC3W.js";
|
|
143
150
|
import {
|
|
144
151
|
shareResourceAction
|
|
145
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-YGCOJNFZ.js";
|
|
146
153
|
import {
|
|
147
154
|
selectCurrentServer,
|
|
148
155
|
selectSyncServers
|
|
149
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-O6IPRAVV.js";
|
|
150
157
|
import {
|
|
151
158
|
UNCATEGORIZED_ID,
|
|
152
159
|
addContentAction,
|
|
153
160
|
checkSpaceMembership
|
|
154
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-T6VROBY7.js";
|
|
155
162
|
import {
|
|
156
163
|
createSpaceKey,
|
|
157
164
|
normalizeSpaceId
|
|
@@ -167,10 +174,10 @@ import {
|
|
|
167
174
|
selectEntities,
|
|
168
175
|
toTimestampMs,
|
|
169
176
|
write
|
|
170
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-RM4UMFY4.js";
|
|
171
178
|
import {
|
|
172
179
|
readAction
|
|
173
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-F3XI6WQP.js";
|
|
174
181
|
import {
|
|
175
182
|
DEVICE_LOCAL_OWNER_ID,
|
|
176
183
|
getRuntimeServerContext,
|
|
@@ -180,11 +187,12 @@ import {
|
|
|
180
187
|
resolveEffectiveSpaceActorId,
|
|
181
188
|
resolveRecordOwnerUserId,
|
|
182
189
|
selectRuntimeSnapshot
|
|
183
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-GXXY2NL3.js";
|
|
184
191
|
import {
|
|
185
192
|
createAsyncThunk,
|
|
193
|
+
createSelector,
|
|
186
194
|
noloWriteRequest
|
|
187
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-7TTMMOKH.js";
|
|
188
196
|
import {
|
|
189
197
|
selectIdentityToken,
|
|
190
198
|
selectIdentityUserBalance,
|
|
@@ -231,7 +239,7 @@ import {
|
|
|
231
239
|
normalizeNoloSpaceInput,
|
|
232
240
|
resolveNoloDialogInput,
|
|
233
241
|
verifyNoloDialogSubjectRefQuery
|
|
234
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-G22P367E.js";
|
|
235
243
|
import {
|
|
236
244
|
mergeAvailabilityDeadline,
|
|
237
245
|
resolveCredentialKeyWithFallback
|
|
@@ -243,12 +251,12 @@ import {
|
|
|
243
251
|
import {
|
|
244
252
|
clipCompactText
|
|
245
253
|
} from "./chunk-5MMAK75Q.js";
|
|
246
|
-
import {
|
|
247
|
-
asRecordOrEmpty
|
|
248
|
-
} from "./chunk-KX6YBIHG.js";
|
|
249
254
|
import {
|
|
250
255
|
createFileCredentialBroker
|
|
251
256
|
} from "./chunk-OQHIVPG4.js";
|
|
257
|
+
import {
|
|
258
|
+
asRecordOrEmpty
|
|
259
|
+
} from "./chunk-KX6YBIHG.js";
|
|
252
260
|
import {
|
|
253
261
|
compactWhitespace
|
|
254
262
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -256,8 +264,9 @@ import {
|
|
|
256
264
|
isAbortError
|
|
257
265
|
} from "./chunk-7DPNBQSV.js";
|
|
258
266
|
import {
|
|
259
|
-
CAPABILITY_PACKS
|
|
260
|
-
|
|
267
|
+
CAPABILITY_PACKS,
|
|
268
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
269
|
+
} from "./chunk-EBKHA63G.js";
|
|
261
270
|
import {
|
|
262
271
|
CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES,
|
|
263
272
|
canonicalizeToolName,
|
|
@@ -295,8 +304,12 @@ import {
|
|
|
295
304
|
toTrimmedString
|
|
296
305
|
} from "./chunk-SYTHYBMI.js";
|
|
297
306
|
import {
|
|
307
|
+
dialogMessageKey,
|
|
298
308
|
dialogMessageRange,
|
|
299
309
|
isDialogKey,
|
|
310
|
+
isDialogRecordKey,
|
|
311
|
+
isDialogRecordKeyForId,
|
|
312
|
+
parseDialogKey,
|
|
300
313
|
ulid
|
|
301
314
|
} from "./chunk-OJKUU3LP.js";
|
|
302
315
|
import {
|
|
@@ -1332,6 +1345,10 @@ var findSpaceConfig = (nameOrId, allSpaces) => {
|
|
|
1332
1345
|
};
|
|
1333
1346
|
async function createAgentToolFunc(args, thunkApi, runtime) {
|
|
1334
1347
|
const state2 = thunkApi.getState();
|
|
1348
|
+
const { spaceId } = resolveToolAttributionContext(state2, runtime, {
|
|
1349
|
+
requireAgentKey: false,
|
|
1350
|
+
errorLabel: "\u521B\u5EFA Agent \u5931\u8D25\uFF1A\u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E"
|
|
1351
|
+
});
|
|
1335
1352
|
const currentUserId = selectIdentityUserId(state2);
|
|
1336
1353
|
const currentBalance = selectIdentityUserBalance(state2);
|
|
1337
1354
|
const allSpaces = getAllMemberSpaces();
|
|
@@ -1415,16 +1432,15 @@ ${availableList}`
|
|
|
1415
1432
|
createAgent({
|
|
1416
1433
|
userId: currentUserId,
|
|
1417
1434
|
formData,
|
|
1418
|
-
spaceId
|
|
1435
|
+
spaceId
|
|
1419
1436
|
})
|
|
1420
1437
|
).unwrap();
|
|
1421
1438
|
assertForkedAgentProviderConfig(agent, expectedProviderConfig);
|
|
1422
|
-
|
|
1423
|
-
if (currentSpaceId) {
|
|
1439
|
+
if (spaceId) {
|
|
1424
1440
|
const agentDbKey = agent.isPublic ? createAgentKey.public(agent.id) : createAgentKey.private(currentUserId, agent.id);
|
|
1425
1441
|
try {
|
|
1426
1442
|
await thunkApi.dispatch(addContentToSpace({
|
|
1427
|
-
spaceId
|
|
1443
|
+
spaceId,
|
|
1428
1444
|
title: agent.name || "\u672A\u547D\u540D\u667A\u80FD\u4F53",
|
|
1429
1445
|
type: "agent" /* AGENT */,
|
|
1430
1446
|
// 统一使用 ContentType.AGENT
|
|
@@ -1527,6 +1543,34 @@ ${effortNote}` : "")
|
|
|
1527
1543
|
};
|
|
1528
1544
|
}
|
|
1529
1545
|
|
|
1546
|
+
// packages/ai/tools/knowledgeCaptureConfirmation.ts
|
|
1547
|
+
function canonical(value) {
|
|
1548
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
1549
|
+
if (value && typeof value === "object") return `{${Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`).join(",")}}`;
|
|
1550
|
+
return JSON.stringify(value);
|
|
1551
|
+
}
|
|
1552
|
+
function requireKnowledgeCaptureConfirmation(args, operation, input, preview = input) {
|
|
1553
|
+
const binding = canonical({ operation, input, preview });
|
|
1554
|
+
if (args.__confirmedKnowledgeCapture === binding) return;
|
|
1555
|
+
const confirmationInput = { ...input, __confirmedKnowledgeCapture: binding };
|
|
1556
|
+
throw new ToolResultError("\u4FDD\u5B58\u524D\u8BF7\u786E\u8BA4\u5185\u5BB9\u4E0E\u76EE\u6807\u7A7A\u95F4\u3002", {
|
|
1557
|
+
code: "knowledge_capture_requires_confirmation",
|
|
1558
|
+
retryable: false,
|
|
1559
|
+
displayData: "\u786E\u8BA4\u4FDD\u5B58\uFF1F\u8BF7\u6838\u5BF9\u672C\u6B21\u5B8C\u6574\u5185\u5BB9\u4E0E\u76EE\u6807\u7A7A\u95F4\u3002",
|
|
1560
|
+
rawData: {
|
|
1561
|
+
error: "knowledge_capture_requires_confirmation",
|
|
1562
|
+
operation,
|
|
1563
|
+
confirmationInput,
|
|
1564
|
+
preview
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
async function checkKnowledgeCaptureTarget(spaceId, api) {
|
|
1569
|
+
if (!spaceId) return;
|
|
1570
|
+
const space = await api.dispatch(read({ dbKey: createSpaceKey.space(spaceId) })).unwrap();
|
|
1571
|
+
checkSpaceMembership(space, selectIdentityUserId(api.getState()));
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1530
1574
|
// packages/ai/tools/createDocTool.ts
|
|
1531
1575
|
var createDocFunctionSchema = {
|
|
1532
1576
|
name: "createDoc",
|
|
@@ -1585,18 +1629,20 @@ async function createDocFunc(args, thunkApi) {
|
|
|
1585
1629
|
const categoryId = rawCategoryId || void 0;
|
|
1586
1630
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
1587
1631
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
1588
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
1632
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
1589
1633
|
const rawContent = (args.content ?? "").trim();
|
|
1590
1634
|
const content = rawContent || void 0;
|
|
1635
|
+
requireKnowledgeCaptureConfirmation(args, "createDoc", { title, content: content ?? "", categoryId: categoryId ?? "", spaceId: spaceId ?? "" });
|
|
1636
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
1591
1637
|
try {
|
|
1592
1638
|
console.log("[createDocTool] dispatching createDoc with:", {
|
|
1593
1639
|
title,
|
|
1594
|
-
spaceId,
|
|
1640
|
+
spaceId: spaceId ?? "",
|
|
1595
1641
|
categoryId,
|
|
1596
1642
|
content
|
|
1597
1643
|
});
|
|
1598
1644
|
const id = await createDocState(
|
|
1599
|
-
{ title, spaceId, categoryId, content },
|
|
1645
|
+
{ title, spaceId: spaceId ?? "", categoryId, content },
|
|
1600
1646
|
{ dispatch, getState }
|
|
1601
1647
|
);
|
|
1602
1648
|
console.log("[createDocTool] createDoc success, id:", id);
|
|
@@ -1686,26 +1732,26 @@ var updateHtmlArtifactFunctionSchema = {
|
|
|
1686
1732
|
required: ["id", "html"]
|
|
1687
1733
|
}
|
|
1688
1734
|
};
|
|
1689
|
-
var
|
|
1735
|
+
var resolveArtifactDialogKey = (thunkApi, explicitDialogKey, context2) => {
|
|
1690
1736
|
if (explicitDialogKey && typeof explicitDialogKey === "string" && explicitDialogKey.trim()) {
|
|
1691
1737
|
return explicitDialogKey.trim();
|
|
1692
1738
|
}
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
if (
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1739
|
+
const state2 = thunkApi?.getState?.();
|
|
1740
|
+
const { dialogId } = resolveToolAttributionContext(state2, context2, {
|
|
1741
|
+
requireAgentKey: false,
|
|
1742
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A HTML artifact \u5F52\u5C5E"
|
|
1743
|
+
});
|
|
1744
|
+
if (context2?.dialogKey?.trim()) return context2.dialogKey.trim();
|
|
1745
|
+
return Object.keys(state2.db.entities).find(
|
|
1746
|
+
(key2) => isDialogRecordKeyForId(key2, dialogId) && state2.db.entities[key2]?.id?.trim() === dialogId
|
|
1747
|
+
);
|
|
1702
1748
|
};
|
|
1703
|
-
async function createHtmlArtifactFunc(args, thunkApi) {
|
|
1749
|
+
async function createHtmlArtifactFunc(args, thunkApi, context2) {
|
|
1704
1750
|
const html = typeof args?.html === "string" ? args.html : "";
|
|
1705
1751
|
if (!html.trim()) {
|
|
1706
1752
|
throw new Error("createHtmlArtifact: html \u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A\u3002");
|
|
1707
1753
|
}
|
|
1708
|
-
const dialogKey =
|
|
1754
|
+
const dialogKey = resolveArtifactDialogKey(thunkApi, args?.dialogKey, context2);
|
|
1709
1755
|
const title = typeof args?.title === "string" && args.title.trim() ? args.title.trim() : DEFAULT_HTML_ARTIFACT_TITLE;
|
|
1710
1756
|
const response = await callToolApi(
|
|
1711
1757
|
thunkApi,
|
|
@@ -1990,12 +2036,15 @@ async function createSkillDocFunc(args, thunkApi) {
|
|
|
1990
2036
|
const { title, content, skillConfig, evalConfig } = buildSkillDocFromArgs(args);
|
|
1991
2037
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
1992
2038
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
1993
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
2039
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
1994
2040
|
const categoryId = (args.categoryId ?? "").trim() || void 0;
|
|
2041
|
+
const { __confirmedKnowledgeCapture: _confirmation, ...source } = args;
|
|
2042
|
+
requireKnowledgeCaptureConfirmation(args, "createSkillDoc", { ...source, spaceId: spaceId ?? "", categoryId: categoryId ?? "" }, { title, content, spaceId: spaceId ?? "", categoryId: categoryId ?? "" });
|
|
2043
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
1995
2044
|
const id = await createDocState(
|
|
1996
2045
|
{
|
|
1997
2046
|
title,
|
|
1998
|
-
spaceId,
|
|
2047
|
+
spaceId: spaceId ?? "",
|
|
1999
2048
|
categoryId,
|
|
2000
2049
|
content
|
|
2001
2050
|
},
|
|
@@ -2375,12 +2424,14 @@ Imported from: ${url}` : ""
|
|
|
2375
2424
|
});
|
|
2376
2425
|
const explicitSpaceId = (args.spaceId ?? "").trim() || void 0;
|
|
2377
2426
|
const currentSpaceId = getCurrentSpaceId() || void 0;
|
|
2378
|
-
const spaceId = explicitSpaceId ?? currentSpaceId;
|
|
2427
|
+
const spaceId = args.spaceId === "" ? void 0 : explicitSpaceId ?? currentSpaceId;
|
|
2379
2428
|
const categoryId = (args.categoryId ?? "").trim() || void 0;
|
|
2429
|
+
requireKnowledgeCaptureConfirmation(args, "importSkill", { content: rawMarkdown, title: docTitle, url, spaceId: spaceId ?? "", categoryId: categoryId ?? "" }, { title: docTitle, content, spaceId: spaceId ?? "", categoryId: categoryId ?? "" });
|
|
2430
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
2380
2431
|
const id = await createDocState(
|
|
2381
2432
|
{
|
|
2382
2433
|
title: docTitle,
|
|
2383
|
-
spaceId,
|
|
2434
|
+
spaceId: spaceId ?? "",
|
|
2384
2435
|
categoryId,
|
|
2385
2436
|
content
|
|
2386
2437
|
},
|
|
@@ -3908,7 +3959,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
3908
3959
|
const deletedDialogIds = [];
|
|
3909
3960
|
const deletedDialogKeys = [];
|
|
3910
3961
|
const failures = [];
|
|
3911
|
-
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-
|
|
3962
|
+
const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-QAKYN4DE.js");
|
|
3912
3963
|
for (const target of targets) {
|
|
3913
3964
|
try {
|
|
3914
3965
|
await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
|
|
@@ -3974,7 +4025,7 @@ async function fetchUserFavoriteAgentMap(thunkApi) {
|
|
|
3974
4025
|
}
|
|
3975
4026
|
var listAgentsFunctionSchema = {
|
|
3976
4027
|
name: "listAgents",
|
|
3977
|
-
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:
|
|
4028
|
+
description: "List Nolo agents available for delegation as safe summaries. Returns planningRecommendation: conditional advice only when planning is needed and the candidate is suitable; simple questions need no extra planning call. action self/delegate, reason, currentTier, optional agentKey/recommendedTier, poolComplete, requiresPaidApproval. Caller identity/model/runKind are host-owned, not tool arguments. Unknown tiers are not ranked; incomplete pools cannot establish a highest candidate. Bounded subtasks do not delegate planning. Recommendation is not authorization and never starts a run; paid channels require separate approval. By default (scope='all') returns the deduplicated union of the user's own/favorite agents and public/shared agents. scope='public' returns only public/shared agents. Public agents may consume platform credits - check each agent's billingSource before dispatching. The payload returns `credentialGroups` summarizing independent credential capacities (credentialGroup, credentialKind, agentCount, and availableAt recovery timestamps). Orchestration discipline: Fan out independent runs concurrently; sharing a credential alone is not a dependency. Same-credential concurrency is normally allowed subject to server admission budgets and upstream 429 limits; reduce concurrency or switch channels when needed. Spread load across credentialGroups when useful. Unknown credentials are not assumed independent: the dispatch guard limits only same-batch concurrency among those candidates (one at a time unless allowUnknownCredential explicitly confirms the risk); unrelated channels and work remain concurrent. A channel verdict is valid for the current dispatch attempt only; always re-read availability before dispatching, and never reuse a failure verdict from an earlier attempt. On config_unresolved-class errors, retry once before degrading. Choose a channel by task capability and applicable cost authorization; higher tier alone does not require reserving it for review. The `agents` array carries a compact agent-selection projection per agent: runnable `agentKey` (agent-<userId>-<id> owned, agent-pub-<id> public), name, model, provider, apiSource, billingSource ('user_subscription' | 'owner_subscription' | 'user_api' | 'platform_credits' | 'local'), tools, isFavorite, isOAuth, isOwned, isPublic, credentialGroup, credentialKind. Copy `agentKey` verbatim into startAgentRun. All agents are listed, including rate-limited (429) ones: cooldown agents carry `availabilityStatus` / `availabilityReason` / `nextAvailableAt` as reference info, not a dispatch gate (quota is informational; requests are still sent and upstream results are reported as-is). `unavailableCount` reports how many agents are currently rate-limited. `showUnavailable` is deprecated and has no effect (kept for compatibility). Set `verbose: true` for full safe summary details.",
|
|
3978
4029
|
parameters: {
|
|
3979
4030
|
type: "object",
|
|
3980
4031
|
properties: {
|
|
@@ -4149,7 +4200,30 @@ async function listAgentsFunc(args, thunkApi, context2) {
|
|
|
4149
4200
|
agents: discovery.agents,
|
|
4150
4201
|
credentialGroups: discovery.credentialGroups
|
|
4151
4202
|
};
|
|
4152
|
-
const delivered = args?.compact === true && args?.verbose !== true ? JSON.parse(await injectSpeedContextIntoListAgentsResult(JSON.stringify(rawData), {
|
|
4203
|
+
const delivered = args?.compact === true && args?.verbose !== true ? JSON.parse(await injectSpeedContextIntoListAgentsResult(JSON.stringify(rawData), {
|
|
4204
|
+
compactPage: true,
|
|
4205
|
+
fragmentOffset: args?.fragmentOffset,
|
|
4206
|
+
fragmentAgentKey: args?.fragmentAgentKey,
|
|
4207
|
+
fragmentDigest: args?.fragmentDigest,
|
|
4208
|
+
userId: runtime.currentUserId,
|
|
4209
|
+
// All client hosts provide their local DB through the shared thunk extra.
|
|
4210
|
+
// Local token paths alone are not proof of a dispatched run.
|
|
4211
|
+
db: thunkApi?.extra?.db ? {
|
|
4212
|
+
iterator: (options) => thunkApi.extra.db.iterator(options),
|
|
4213
|
+
isDispatchRun: async (dialogId, entryPath) => {
|
|
4214
|
+
if (entryPath !== "agent-run") return false;
|
|
4215
|
+
try {
|
|
4216
|
+
return isServerDispatchSpeedSource(
|
|
4217
|
+
await thunkApi.extra.db.get(`dialog-${runtime.currentUserId}-${dialogId}`),
|
|
4218
|
+
dialogId,
|
|
4219
|
+
runtime.currentUserId
|
|
4220
|
+
);
|
|
4221
|
+
} catch {
|
|
4222
|
+
return false;
|
|
4223
|
+
}
|
|
4224
|
+
}
|
|
4225
|
+
} : null
|
|
4226
|
+
})) : rawData;
|
|
4153
4227
|
return {
|
|
4154
4228
|
rawData: delivered,
|
|
4155
4229
|
displayData: formatAgentListCard(delivered.agents ?? []),
|
|
@@ -4323,7 +4397,7 @@ var readSkillDocFunctionSchema = {
|
|
|
4323
4397
|
}
|
|
4324
4398
|
};
|
|
4325
4399
|
async function readSkillDocFunc(args, thunkApi) {
|
|
4326
|
-
const { buildReadDocResult } = await import("./readDocTool-
|
|
4400
|
+
const { buildReadDocResult } = await import("./readDocTool-TE3XIU4Y.js");
|
|
4327
4401
|
const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
|
|
4328
4402
|
if (typeof id !== "string" || !id.trim()) {
|
|
4329
4403
|
throw new Error("readSkillDoc requires id or doc.");
|
|
@@ -5175,7 +5249,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
|
|
|
5175
5249
|
const spaceKey = createSpaceKey.space(spaceId);
|
|
5176
5250
|
const readSpace = async (dbKey) => {
|
|
5177
5251
|
try {
|
|
5178
|
-
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-
|
|
5252
|
+
const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-DKKMJJYY.js");
|
|
5179
5253
|
const readPromise = fresh ? dispatch(readAndWait2(dbKey)).unwrap() : dispatch(read2({ dbKey })).unwrap();
|
|
5180
5254
|
return await withTimeout(readPromise);
|
|
5181
5255
|
} catch {
|
|
@@ -6749,7 +6823,7 @@ var createTableFunctionSchema = {
|
|
|
6749
6823
|
}
|
|
6750
6824
|
};
|
|
6751
6825
|
async function createTableFunc(args, thunkApi) {
|
|
6752
|
-
const spaceId = asOptionalTrimmedString(args?.spaceId);
|
|
6826
|
+
const spaceId = args.spaceId === "" ? "" : asOptionalTrimmedString(args?.spaceId) ?? getCurrentSpaceId() ?? "";
|
|
6753
6827
|
const title = asOptionalTrimmedString(args?.title);
|
|
6754
6828
|
const purpose = asOptionalTrimmedString(args?.purpose);
|
|
6755
6829
|
const description = asOptionalTrimmedString(args?.description);
|
|
@@ -6808,6 +6882,8 @@ async function createTableFunc(args, thunkApi) {
|
|
|
6808
6882
|
columns: sanitizedColumns,
|
|
6809
6883
|
withDefaultRows
|
|
6810
6884
|
};
|
|
6885
|
+
requireKnowledgeCaptureConfirmation(args, "createTable", createArgs);
|
|
6886
|
+
await checkKnowledgeCaptureTarget(spaceId, thunkApi);
|
|
6811
6887
|
try {
|
|
6812
6888
|
const actionResult = await thunkApi.dispatch(createTable(createArgs));
|
|
6813
6889
|
if (!createTable.fulfilled.match(actionResult)) {
|
|
@@ -9205,6 +9281,43 @@ async function wereadGatewayFunc(args, thunkApi) {
|
|
|
9205
9281
|
return callToolApi(thunkApi, "/api/weread/gateway", args, { withAuth: true });
|
|
9206
9282
|
}
|
|
9207
9283
|
|
|
9284
|
+
// packages/ai/tools/toolRequestDialogId.ts
|
|
9285
|
+
function toolRequestDialogId(context2, getState) {
|
|
9286
|
+
const invalid = (reason) => {
|
|
9287
|
+
throw new Error(`\u5DE5\u5177\u6267\u884C\u4E0A\u4E0B\u6587\u8EAB\u4EFD\u65E0\u6548\uFF1A${reason}`);
|
|
9288
|
+
};
|
|
9289
|
+
const field = (value, name) => {
|
|
9290
|
+
if (value == null) return void 0;
|
|
9291
|
+
if (typeof value !== "string" || !value.trim()) return invalid(`${name} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u3002`);
|
|
9292
|
+
return value.trim();
|
|
9293
|
+
};
|
|
9294
|
+
const id = field(context2?.dialogId, "dialogId");
|
|
9295
|
+
const key2 = field(context2?.dialogKey, "dialogKey");
|
|
9296
|
+
if (id === void 0 && key2 === void 0) return void 0;
|
|
9297
|
+
const parsed = key2 === void 0 ? void 0 : parseDialogKey(key2);
|
|
9298
|
+
if (key2 !== void 0 && !parsed) return invalid("dialogKey \u65E0\u6CD5\u89E3\u6790\u3002");
|
|
9299
|
+
if (id !== void 0 && parsed && id !== parsed.dialogId) {
|
|
9300
|
+
return invalid("dialogKey/dialogId \u4E0D\u4E00\u81F4\u3002");
|
|
9301
|
+
}
|
|
9302
|
+
const dialogId = parsed?.dialogId ?? id;
|
|
9303
|
+
let state2;
|
|
9304
|
+
try {
|
|
9305
|
+
state2 = getState();
|
|
9306
|
+
} catch {
|
|
9307
|
+
return invalid("\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u52A0\u8F7D\u7684\u5BF9\u8BDD\u8BB0\u5F55\u3002");
|
|
9308
|
+
}
|
|
9309
|
+
const entities = state2?.db?.entities;
|
|
9310
|
+
const matches = Object.entries(entities ?? {}).filter(([recordKey, record]) => {
|
|
9311
|
+
if (key2 !== void 0 && recordKey !== key2) return false;
|
|
9312
|
+
if (!isDialogRecordKey(recordKey)) return false;
|
|
9313
|
+
const identity = parseDialogKey(recordKey);
|
|
9314
|
+
return identity?.dialogId === dialogId && record?.id === dialogId;
|
|
9315
|
+
});
|
|
9316
|
+
if (matches.length === 0) return invalid("\u5BF9\u8BDD\u8BB0\u5F55\u672A\u52A0\u8F7D\u6216\u8BB0\u5F55\u8EAB\u4EFD\u4E0D\u4E00\u81F4\u3002");
|
|
9317
|
+
if (matches.length !== 1) return invalid("\u540C\u4E00 dialogId \u5B58\u5728\u8DE8 owner \u6B67\u4E49\uFF0C\u8BF7\u63D0\u4F9B\u5B8C\u6574 dialogKey\u3002");
|
|
9318
|
+
return dialogId;
|
|
9319
|
+
}
|
|
9320
|
+
|
|
9208
9321
|
// packages/ai/tools/watchCompletionTool.ts
|
|
9209
9322
|
var WATCH_COMPLETION_API_PATH = "/api/watch-completion";
|
|
9210
9323
|
var watchCompletionFunctionSchema = {
|
|
@@ -9258,7 +9371,7 @@ async function watchCompletionFunc(rawArgs, thunkApi, context2) {
|
|
|
9258
9371
|
kind: args.kind,
|
|
9259
9372
|
ref: args.ref,
|
|
9260
9373
|
environment: args.environment,
|
|
9261
|
-
dialogId:
|
|
9374
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState())
|
|
9262
9375
|
});
|
|
9263
9376
|
try {
|
|
9264
9377
|
const data = await callToolApi(
|
|
@@ -9616,7 +9729,7 @@ var exaSearchFunc = async (input, thunkApi, context2) => {
|
|
|
9616
9729
|
excludeDomains,
|
|
9617
9730
|
includeContent
|
|
9618
9731
|
} = input;
|
|
9619
|
-
const body = { query };
|
|
9732
|
+
const body = { query, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) };
|
|
9620
9733
|
if (numResults !== void 0) body.numResults = numResults;
|
|
9621
9734
|
if (typeof intent === "string" && intent) body.intent = intent;
|
|
9622
9735
|
if (typeof category === "string" && category) body.category = category;
|
|
@@ -9775,7 +9888,7 @@ function buildSearchLlmContext(query, results) {
|
|
|
9775
9888
|
});
|
|
9776
9889
|
return lines.join("\n");
|
|
9777
9890
|
}
|
|
9778
|
-
var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
9891
|
+
var firecrawlScrapeFunc = async (input, thunkApi, context2) => {
|
|
9779
9892
|
const { url, onlyMainContent = true, timeout } = input;
|
|
9780
9893
|
const normalizedUrl = normalizeHttpUrl(url);
|
|
9781
9894
|
const normalizedTimeout = normalizeScrapeTimeout(timeout);
|
|
@@ -9784,6 +9897,7 @@ var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
|
9784
9897
|
"/api/firecrawl-scrape",
|
|
9785
9898
|
{
|
|
9786
9899
|
url: normalizedUrl,
|
|
9900
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState()),
|
|
9787
9901
|
onlyMainContent,
|
|
9788
9902
|
timeout: normalizedTimeout
|
|
9789
9903
|
},
|
|
@@ -9825,7 +9939,7 @@ var firecrawlScrapeFunc = async (input, thunkApi) => {
|
|
|
9825
9939
|
llmContext
|
|
9826
9940
|
};
|
|
9827
9941
|
};
|
|
9828
|
-
var firecrawlSearchFunc = async (input, thunkApi) => {
|
|
9942
|
+
var firecrawlSearchFunc = async (input, thunkApi, context2) => {
|
|
9829
9943
|
const { query, limit = 5, includeContent = true, categories, country } = input;
|
|
9830
9944
|
const trimmedQuery = asTrimmedString(query);
|
|
9831
9945
|
if (!trimmedQuery) {
|
|
@@ -9835,7 +9949,7 @@ var firecrawlSearchFunc = async (input, thunkApi) => {
|
|
|
9835
9949
|
const data = await callToolApi(
|
|
9836
9950
|
thunkApi,
|
|
9837
9951
|
"/api/firecrawl-search",
|
|
9838
|
-
{ query: trimmedQuery, limit, includeContent, categories, country },
|
|
9952
|
+
{ query: trimmedQuery, limit, includeContent, categories, country, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
9839
9953
|
{ withAuth: true }
|
|
9840
9954
|
);
|
|
9841
9955
|
const results = (data.data?.web ?? []).map((item) => ({
|
|
@@ -9878,9 +9992,9 @@ var olmOcrSchema = {
|
|
|
9878
9992
|
required: ["imageUrl"]
|
|
9879
9993
|
}
|
|
9880
9994
|
};
|
|
9881
|
-
var olmOcrFunc = async (input, thunkApi) => {
|
|
9995
|
+
var olmOcrFunc = async (input, thunkApi, context2) => {
|
|
9882
9996
|
const { imageUrl, prompt = "\u8BC6\u522B\u56FE\u7247\u4E2D\u7684\u6240\u6709\u6587\u5B57" } = input;
|
|
9883
|
-
const data = await callToolApi(thunkApi, "/api/olm-ocr", { imageUrl, prompt }, { withAuth: true });
|
|
9997
|
+
const data = await callToolApi(thunkApi, "/api/olm-ocr", { imageUrl, prompt, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
9884
9998
|
return {
|
|
9885
9999
|
summary: "OCR processing completed",
|
|
9886
10000
|
text: data.choices?.[0]?.message?.content || "No text detected",
|
|
@@ -9914,12 +10028,12 @@ var transcribeVideoSchema = {
|
|
|
9914
10028
|
required: ["url"]
|
|
9915
10029
|
}
|
|
9916
10030
|
};
|
|
9917
|
-
async function transcribeVideoFunc(input, thunkApi) {
|
|
10031
|
+
async function transcribeVideoFunc(input, thunkApi, context2) {
|
|
9918
10032
|
const url = typeof input?.url === "string" ? input.url.trim() : "";
|
|
9919
10033
|
if (!url) {
|
|
9920
10034
|
throw new Error("\u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 url");
|
|
9921
10035
|
}
|
|
9922
|
-
const body = { url };
|
|
10036
|
+
const body = { url, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) };
|
|
9923
10037
|
if (input.p !== void 0) body.p = input.p;
|
|
9924
10038
|
if (input.language !== void 0) body.language = input.language;
|
|
9925
10039
|
const data = await callToolApi(thunkApi, "/api/transcribe-video", body, {
|
|
@@ -9990,7 +10104,8 @@ var transcribeSchema = {
|
|
|
9990
10104
|
}
|
|
9991
10105
|
}
|
|
9992
10106
|
};
|
|
9993
|
-
async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
10107
|
+
async function transcribeInternal(input, thunkApi, reuseNotes, context2) {
|
|
10108
|
+
const dialogId = toolRequestDialogId(context2, () => thunkApi.getState());
|
|
9994
10109
|
const { action = "transcribe", fileId, jobId, fromSec, toSec, sourceLang, sttProvider, confirmationToken, expectedExecutionRevision } = input ?? {};
|
|
9995
10110
|
if (action === "status" && !jobId) throw new Error("status \u6A21\u5F0F\u5FC5\u987B\u63D0\u4F9B\u5DF2\u6709 jobId");
|
|
9996
10111
|
if (action === "status" && (fileId || fromSec !== void 0 || toSec !== void 0 || sourceLang)) throw new Error("status \u6A21\u5F0F\u4EC5\u63A5\u53D7 jobId");
|
|
@@ -10015,7 +10130,7 @@ async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
|
10015
10130
|
if (!fileId) {
|
|
10016
10131
|
throw new Error("transcribe \u5DE5\u5177\u5FC5\u987B\u63D0\u4F9B fileId \u6216 jobId");
|
|
10017
10132
|
}
|
|
10018
|
-
const createBody = { fileId };
|
|
10133
|
+
const createBody = { fileId, dialogId };
|
|
10019
10134
|
if (fromSec !== void 0 || toSec !== void 0) {
|
|
10020
10135
|
createBody.scope = {
|
|
10021
10136
|
...fromSec !== void 0 ? { fromSec } : {},
|
|
@@ -10032,6 +10147,7 @@ async function transcribeInternal(input, thunkApi, reuseNotes) {
|
|
|
10032
10147
|
const revision = normalizeMediaConfirmExecutionRevision(expectedExecutionRevision);
|
|
10033
10148
|
const stepBody = {
|
|
10034
10149
|
step: "transcribe",
|
|
10150
|
+
dialogId,
|
|
10035
10151
|
waitMs: 6e4,
|
|
10036
10152
|
// 仅显式指定时透传;未指定保持服务端既有默认行为(不静默选供应商、不改全局默认)。
|
|
10037
10153
|
...typeof sttProvider === "string" ? { sttProvider } : {},
|
|
@@ -10137,9 +10253,9 @@ function formatJobStatus(job, jobId) {
|
|
|
10137
10253
|
}
|
|
10138
10254
|
return result;
|
|
10139
10255
|
}
|
|
10140
|
-
async function transcribeFunc(input, thunkApi) {
|
|
10256
|
+
async function transcribeFunc(input, thunkApi, context2) {
|
|
10141
10257
|
const reuseNotes = {};
|
|
10142
|
-
const result = await transcribeInternal(input, thunkApi, reuseNotes);
|
|
10258
|
+
const result = await transcribeInternal(input, thunkApi, reuseNotes, context2);
|
|
10143
10259
|
const stepResult = result.rawData?.stepResult ?? result.rawData;
|
|
10144
10260
|
const artifact = stepResult?.artifacts?.transcribe;
|
|
10145
10261
|
const fileId = artifact?.fileId ?? stepResult?.fileId;
|
|
@@ -10187,13 +10303,14 @@ var translateSchema = {
|
|
|
10187
10303
|
required: ["jobId", "targetLang"]
|
|
10188
10304
|
}
|
|
10189
10305
|
};
|
|
10190
|
-
async function translateInternal(input, thunkApi) {
|
|
10306
|
+
async function translateInternal(input, thunkApi, context2) {
|
|
10191
10307
|
const { jobId, targetLang, confirmationToken, expectedExecutionRevision } = input ?? {};
|
|
10192
10308
|
if (!jobId) throw new Error("translate \u5DE5\u5177\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
10193
10309
|
if (!targetLang) throw new Error("translate \u5DE5\u5177\u5FC5\u987B\u6307\u5B9A targetLang\uFF08\u76EE\u6807\u8BED\u8A00\uFF09");
|
|
10194
10310
|
const revision = normalizeMediaConfirmExecutionRevision(expectedExecutionRevision);
|
|
10195
10311
|
const stepBody = {
|
|
10196
10312
|
step: "translate",
|
|
10313
|
+
dialogId: toolRequestDialogId(context2, () => thunkApi.getState()),
|
|
10197
10314
|
// 目标语言原样透传:票据 selection 与执行参数必须同源(不回落 job.targetLang,不二次规范化)。
|
|
10198
10315
|
targetLang,
|
|
10199
10316
|
waitMs: 6e4,
|
|
@@ -10270,8 +10387,8 @@ async function translateInternal(input, thunkApi) {
|
|
|
10270
10387
|
rawData: data
|
|
10271
10388
|
};
|
|
10272
10389
|
}
|
|
10273
|
-
async function translateFunc(input, thunkApi) {
|
|
10274
|
-
const result = await translateInternal(input, thunkApi);
|
|
10390
|
+
async function translateFunc(input, thunkApi, context2) {
|
|
10391
|
+
const result = await translateInternal(input, thunkApi, context2);
|
|
10275
10392
|
const stepResult = result.rawData?.stepResult ?? result.rawData;
|
|
10276
10393
|
const artifact = stepResult?.artifacts?.translate;
|
|
10277
10394
|
const fileId = artifact?.fileId ?? stepResult?.fileId;
|
|
@@ -10752,12 +10869,12 @@ async function writeTranslationsFunc(input, thunkApi) {
|
|
|
10752
10869
|
}
|
|
10753
10870
|
|
|
10754
10871
|
// packages/ai/tools/apifyActorClient.ts
|
|
10755
|
-
async function callApifyActor(thunkApi, params) {
|
|
10872
|
+
async function callApifyActor(thunkApi, params, context2) {
|
|
10756
10873
|
const { actorId, input, resultType = "datasetItems", displayName } = params;
|
|
10757
10874
|
const data = await callToolApi(
|
|
10758
10875
|
thunkApi,
|
|
10759
10876
|
"/api/apify-actor",
|
|
10760
|
-
{ actorId, input, resultType },
|
|
10877
|
+
{ actorId, input, resultType, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
10761
10878
|
{ withAuth: true }
|
|
10762
10879
|
);
|
|
10763
10880
|
const isArray = Array.isArray(data);
|
|
@@ -10829,7 +10946,7 @@ var googleSearchScraperFunctionSchema = {
|
|
|
10829
10946
|
required: []
|
|
10830
10947
|
}
|
|
10831
10948
|
};
|
|
10832
|
-
async function googleSearchScraperFunc(args, thunkApi) {
|
|
10949
|
+
async function googleSearchScraperFunc(args, thunkApi, context2) {
|
|
10833
10950
|
const {
|
|
10834
10951
|
maxPagesPerQuery = 1,
|
|
10835
10952
|
resultsPerPage = 10,
|
|
@@ -10875,7 +10992,7 @@ async function googleSearchScraperFunc(args, thunkApi) {
|
|
|
10875
10992
|
input,
|
|
10876
10993
|
resultType: "datasetItems",
|
|
10877
10994
|
displayName: "Google Search Scraper"
|
|
10878
|
-
});
|
|
10995
|
+
}, context2);
|
|
10879
10996
|
}
|
|
10880
10997
|
|
|
10881
10998
|
// packages/ai/tools/cloudflareCrawlTool.ts
|
|
@@ -11045,7 +11162,7 @@ var cloudflareCrawlStatusFunctionSchema = {
|
|
|
11045
11162
|
async function cloudflareCrawlStatusFunc(args, thunkApi) {
|
|
11046
11163
|
const { jobId, limit, status, cursor } = args;
|
|
11047
11164
|
if (!jobId) throw new Error("\u5FC5\u987B\u63D0\u4F9B jobId");
|
|
11048
|
-
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-
|
|
11165
|
+
const { getToolRequestContext: getToolRequestContext2 } = await import("./toolApiClient-62UUPDUA.js");
|
|
11049
11166
|
const { baseUrl, token } = getToolRequestContext2(thunkApi);
|
|
11050
11167
|
const params = new URLSearchParams();
|
|
11051
11168
|
if (limit !== void 0) params.set("limit", String(limit));
|
|
@@ -11122,7 +11239,7 @@ var youtubeScraperFunctionSchema = {
|
|
|
11122
11239
|
required: []
|
|
11123
11240
|
}
|
|
11124
11241
|
};
|
|
11125
|
-
async function youtubeScraperFunc(args, thunkApi) {
|
|
11242
|
+
async function youtubeScraperFunc(args, thunkApi, context2) {
|
|
11126
11243
|
const {
|
|
11127
11244
|
directUrls,
|
|
11128
11245
|
searchQueries,
|
|
@@ -11160,7 +11277,7 @@ async function youtubeScraperFunc(args, thunkApi) {
|
|
|
11160
11277
|
input,
|
|
11161
11278
|
resultType: "datasetItems",
|
|
11162
11279
|
displayName: "YouTube Scraper"
|
|
11163
|
-
});
|
|
11280
|
+
}, context2);
|
|
11164
11281
|
}
|
|
11165
11282
|
|
|
11166
11283
|
// packages/ai/tools/ecommerceScraperTool.ts
|
|
@@ -11203,7 +11320,7 @@ var ecommerceScraperFunctionSchema = {
|
|
|
11203
11320
|
required: []
|
|
11204
11321
|
}
|
|
11205
11322
|
};
|
|
11206
|
-
async function ecommerceScraperFunc(args, thunkApi) {
|
|
11323
|
+
async function ecommerceScraperFunc(args, thunkApi, context2) {
|
|
11207
11324
|
const {
|
|
11208
11325
|
detailsUrls,
|
|
11209
11326
|
listingUrls,
|
|
@@ -11229,7 +11346,7 @@ async function ecommerceScraperFunc(args, thunkApi) {
|
|
|
11229
11346
|
input,
|
|
11230
11347
|
resultType: "datasetItems",
|
|
11231
11348
|
displayName: "E-commerce Scraping Tool"
|
|
11232
|
-
});
|
|
11349
|
+
}, context2);
|
|
11233
11350
|
}
|
|
11234
11351
|
|
|
11235
11352
|
// packages/ai/tools/amazonProductScraperTool.ts
|
|
@@ -11269,7 +11386,7 @@ var amazonProductScraperFunctionSchema = {
|
|
|
11269
11386
|
required: ["urls"]
|
|
11270
11387
|
}
|
|
11271
11388
|
};
|
|
11272
|
-
async function amazonProductScraperFunc(args, thunkApi) {
|
|
11389
|
+
async function amazonProductScraperFunc(args, thunkApi, context2) {
|
|
11273
11390
|
const {
|
|
11274
11391
|
urls,
|
|
11275
11392
|
maxItemsPerStartUrl,
|
|
@@ -11296,7 +11413,7 @@ async function amazonProductScraperFunc(args, thunkApi) {
|
|
|
11296
11413
|
input,
|
|
11297
11414
|
resultType: "datasetItems",
|
|
11298
11415
|
displayName: "Amazon Product Scraper"
|
|
11299
|
-
});
|
|
11416
|
+
}, context2);
|
|
11300
11417
|
}
|
|
11301
11418
|
|
|
11302
11419
|
// packages/ai/tools/taobaoTmallProductScraperTool.ts
|
|
@@ -11320,7 +11437,7 @@ var taobaoTmallProductScraperFunctionSchema = {
|
|
|
11320
11437
|
required: ["itemId"]
|
|
11321
11438
|
}
|
|
11322
11439
|
};
|
|
11323
|
-
async function taobaoTmallProductScraperFunc(args, thunkApi) {
|
|
11440
|
+
async function taobaoTmallProductScraperFunc(args, thunkApi, context2) {
|
|
11324
11441
|
const itemId = String(args.itemId ?? "").trim();
|
|
11325
11442
|
if (!/^\d{6,}$/.test(itemId)) {
|
|
11326
11443
|
throw new Error("\u6DD8\u5B9D/\u5929\u732B\u5546\u54C1\u8BE6\u60C5\u6293\u53D6\u5931\u8D25\uFF1AitemId \u5FC5\u987B\u662F\u6709\u6548\u7684\u6570\u5B57\u5546\u54C1 ID\u3002");
|
|
@@ -11334,7 +11451,7 @@ async function taobaoTmallProductScraperFunc(args, thunkApi) {
|
|
|
11334
11451
|
},
|
|
11335
11452
|
resultType: "datasetItems",
|
|
11336
11453
|
displayName: "Taobao/Tmall Product Scraper"
|
|
11337
|
-
});
|
|
11454
|
+
}, context2);
|
|
11338
11455
|
}
|
|
11339
11456
|
|
|
11340
11457
|
// packages/ai/tools/jdProductScraperTool.ts
|
|
@@ -11814,8 +11931,6 @@ function stringifyIfPresent(value) {
|
|
|
11814
11931
|
}
|
|
11815
11932
|
|
|
11816
11933
|
// packages/ai/tools/geminiImagePreviewTool.ts
|
|
11817
|
-
var selectCurrentDialogKeyFromState = (_state) => getActiveDialogKey();
|
|
11818
|
-
var selectCurrentSpaceIdFromState = (_state) => getCurrentSpaceId();
|
|
11819
11934
|
var selectUserIdFromState = (state2) => {
|
|
11820
11935
|
const userId = selectIdentityUserId(state2);
|
|
11821
11936
|
return typeof userId === "string" ? userId : null;
|
|
@@ -11823,7 +11938,7 @@ var selectUserIdFromState = (state2) => {
|
|
|
11823
11938
|
var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
|
|
11824
11939
|
async function addImageContentToSpace(input) {
|
|
11825
11940
|
const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
|
|
11826
|
-
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-
|
|
11941
|
+
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-GVC77QSN.js")).addContentAction;
|
|
11827
11942
|
await addContentAction2(
|
|
11828
11943
|
{
|
|
11829
11944
|
spaceId: input.spaceId,
|
|
@@ -12096,24 +12211,25 @@ var geminiProImagePreviewFunctionSchema = {
|
|
|
12096
12211
|
required: ["prompt"]
|
|
12097
12212
|
}
|
|
12098
12213
|
};
|
|
12099
|
-
var createGeminiImageExecutor = (model) => async (args, thunkApi) => {
|
|
12214
|
+
var createGeminiImageExecutor = (model) => async (args, thunkApi, context2) => {
|
|
12100
12215
|
const { prompt, images = [], aspectRatio, imageSize } = args;
|
|
12101
12216
|
const trimmedPrompt = prompt?.trim();
|
|
12102
12217
|
if (!trimmedPrompt) {
|
|
12103
12218
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12104
12219
|
}
|
|
12105
12220
|
const state2 = thunkApi.getState();
|
|
12106
|
-
const
|
|
12107
|
-
|
|
12221
|
+
const { dialogId, spaceId } = resolveToolAttributionContext(state2, context2, {
|
|
12222
|
+
requireAgentKey: true,
|
|
12223
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12224
|
+
});
|
|
12225
|
+
const userId = selectUserIdFromState(state2);
|
|
12226
|
+
const currentServer = selectCurrentServerFromState(state2);
|
|
12108
12227
|
const result = await callToolApi(
|
|
12109
12228
|
thunkApi,
|
|
12110
12229
|
"/api/gemini-image-preview",
|
|
12111
12230
|
{ prompt: trimmedPrompt, images, aspectRatio, imageSize, model, dialogId },
|
|
12112
12231
|
{ withAuth: true }
|
|
12113
12232
|
);
|
|
12114
|
-
const spaceId = selectCurrentSpaceIdFromState(state2);
|
|
12115
|
-
const userId = selectUserIdFromState(state2);
|
|
12116
|
-
const currentServer = selectCurrentServerFromState(state2);
|
|
12117
12233
|
if (spaceId && userId && result?.files?.length) {
|
|
12118
12234
|
for (let i = 0; i < result.files.length; i++) {
|
|
12119
12235
|
const f = result.files[i];
|
|
@@ -12263,14 +12379,18 @@ var openAIGptImageEditFunctionSchema = {
|
|
|
12263
12379
|
name: "openAIGptImageEdit",
|
|
12264
12380
|
description: '\u4F7F\u7528 OpenAI GPT Image 2 \u7F16\u8F91\u73B0\u6709\u56FE\u7247\u3002\u9002\u5408\u5355\u56FE\u7F16\u8F91\u3001\u591A\u56FE\u53C2\u8003\u5408\u6210\uFF0C\u4EE5\u53CA\u5E26 mask \u7684\u7CBE\u786E\u4FEE\u6539\u3002\u4F18\u5148\u590D\u7528\u7528\u6237\u5DF2\u4E0A\u4F20\u7684\u539F\u59CB http(s) \u56FE\u7247 URL\uFF0C\u4E0D\u8981\u81EA\u5DF1\u624B\u5199 data URL \u6216\u91CD\u7F16\u7801\u7F29\u7565\u56FE\u3002GPT Image 2 \u5F53\u524D\u4E0D\u652F\u6301 transparent background\uFF0C\u9ED8\u8BA4\u4F20 background: "opaque"\u3002\u5982\u679C outputFormat \u662F png\uFF08\u6216\u672A\u663E\u5F0F\u6539\u6210 jpeg/webp\uFF09\uFF0C\u4E0D\u8981\u4F20 outputCompression\u3002'
|
|
12265
12381
|
};
|
|
12266
|
-
var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
12382
|
+
var runOpenAIImageTool = async (args, thunkApi, model, context2) => {
|
|
12267
12383
|
const trimmedPrompt = args.prompt?.trim();
|
|
12268
12384
|
if (!trimmedPrompt) {
|
|
12269
12385
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12270
12386
|
}
|
|
12271
12387
|
const state2 = thunkApi.getState();
|
|
12272
|
-
const
|
|
12273
|
-
|
|
12388
|
+
const { dialogId, spaceId } = resolveToolAttributionContext(state2, context2, {
|
|
12389
|
+
requireAgentKey: true,
|
|
12390
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12391
|
+
});
|
|
12392
|
+
const userId = selectIdentityUserId(state2);
|
|
12393
|
+
const currentServer = selectCurrentServer(state2);
|
|
12274
12394
|
const result = await callToolApi(
|
|
12275
12395
|
thunkApi,
|
|
12276
12396
|
"/api/openai-image",
|
|
@@ -12291,9 +12411,6 @@ var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
|
12291
12411
|
},
|
|
12292
12412
|
{ withAuth: true }
|
|
12293
12413
|
);
|
|
12294
|
-
const spaceId = getCurrentSpaceId();
|
|
12295
|
-
const userId = selectIdentityUserId(state2);
|
|
12296
|
-
const currentServer = selectCurrentServer(state2);
|
|
12297
12414
|
if (spaceId && userId && result?.files?.length) {
|
|
12298
12415
|
for (let i = 0; i < result.files.length; i += 1) {
|
|
12299
12416
|
const file = result.files[i];
|
|
@@ -12321,22 +12438,24 @@ var runOpenAIImageTool = async (args, thunkApi, model) => {
|
|
|
12321
12438
|
llmContext
|
|
12322
12439
|
};
|
|
12323
12440
|
};
|
|
12324
|
-
var openAIGptImageGenerateFunc = async (args, thunkApi) => {
|
|
12441
|
+
var openAIGptImageGenerateFunc = async (args, thunkApi, context2) => {
|
|
12325
12442
|
return runOpenAIImageTool(
|
|
12326
12443
|
{ ...args, operation: "generate" },
|
|
12327
12444
|
thunkApi,
|
|
12328
|
-
DEFAULT_OPENAI_IMAGE_GENERATE_MODEL
|
|
12445
|
+
DEFAULT_OPENAI_IMAGE_GENERATE_MODEL,
|
|
12446
|
+
context2
|
|
12329
12447
|
);
|
|
12330
12448
|
};
|
|
12331
|
-
var openAIGptImageEditFunc = async (args, thunkApi) => {
|
|
12449
|
+
var openAIGptImageEditFunc = async (args, thunkApi, context2) => {
|
|
12332
12450
|
return runOpenAIImageTool(
|
|
12333
12451
|
{ ...args, operation: "edit" },
|
|
12334
12452
|
thunkApi,
|
|
12335
|
-
DEFAULT_OPENAI_IMAGE_EDIT_MODEL
|
|
12453
|
+
DEFAULT_OPENAI_IMAGE_EDIT_MODEL,
|
|
12454
|
+
context2
|
|
12336
12455
|
);
|
|
12337
12456
|
};
|
|
12338
|
-
var openAIGptImageFunc = async (args, thunkApi) => {
|
|
12339
|
-
return runOpenAIImageTool(args, thunkApi, DEFAULT_OPENAI_IMAGE_MODEL);
|
|
12457
|
+
var openAIGptImageFunc = async (args, thunkApi, context2) => {
|
|
12458
|
+
return runOpenAIImageTool(args, thunkApi, DEFAULT_OPENAI_IMAGE_MODEL, context2);
|
|
12340
12459
|
};
|
|
12341
12460
|
|
|
12342
12461
|
// packages/ai/tools/chatgptWebImageTool.ts
|
|
@@ -12390,16 +12509,18 @@ var chatgptWebImageGenerateFunctionSchema = {
|
|
|
12390
12509
|
required: ["prompt"]
|
|
12391
12510
|
}
|
|
12392
12511
|
};
|
|
12393
|
-
var chatgptWebImageGenerateFunc = async (args, thunkApi) => {
|
|
12512
|
+
var chatgptWebImageGenerateFunc = async (args, thunkApi, context2) => {
|
|
12394
12513
|
const trimmedPrompt = args.prompt?.trim();
|
|
12395
12514
|
if (!trimmedPrompt) {
|
|
12396
12515
|
throw new Error("prompt \u4E0D\u80FD\u4E3A\u7A7A");
|
|
12397
12516
|
}
|
|
12398
12517
|
const state2 = thunkApi.getState();
|
|
12399
|
-
const
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12518
|
+
const { dialogId, spaceId, agentKey } = resolveToolAttributionContext(state2, context2, {
|
|
12519
|
+
requireAgentKey: true,
|
|
12520
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A\u56FE\u50CF\u5F52\u5C5E"
|
|
12521
|
+
});
|
|
12522
|
+
const userId = selectIdentityUserId(state2);
|
|
12523
|
+
const currentServer = selectCurrentServer(state2);
|
|
12403
12524
|
const result = await callToolApi(
|
|
12404
12525
|
thunkApi,
|
|
12405
12526
|
"/api/chatgpt-web-image",
|
|
@@ -12410,9 +12531,6 @@ var chatgptWebImageGenerateFunc = async (args, thunkApi) => {
|
|
|
12410
12531
|
},
|
|
12411
12532
|
{ withAuth: true, agentKey }
|
|
12412
12533
|
);
|
|
12413
|
-
const spaceId = getCurrentSpaceId();
|
|
12414
|
-
const userId = selectIdentityUserId(state2);
|
|
12415
|
-
const currentServer = selectCurrentServer(state2);
|
|
12416
12534
|
if (spaceId && userId && result?.files?.length) {
|
|
12417
12535
|
for (let i = 0; i < result.files.length; i += 1) {
|
|
12418
12536
|
const file = result.files[i];
|
|
@@ -12453,7 +12571,7 @@ var randomGateId = () => {
|
|
|
12453
12571
|
var SECRET_REQUEST_NAME_PATTERN = /^[A-Z_][A-Z0-9_]*$/;
|
|
12454
12572
|
var secretRequestFunctionSchema = {
|
|
12455
12573
|
name: "secret-request",
|
|
12456
|
-
description: "\u5411\u7528\u6237\u8BF7\u6C42\u4E00\u4E2A\u5177\u540D\u51ED\u636E\uFF08\u5982 API key\uFF09\u3002\u7528\u6237\u4F1A\u5728\u5BBF\u4E3B\u9762\u677F\u4E2D\u8F93\u5165\uFF0C\u51ED\u636E\u660E\u6587\u7531\u5BBF\u4E3B\u5199\u5165\
|
|
12574
|
+
description: "\u5411\u7528\u6237\u8BF7\u6C42\u4E00\u4E2A\u5177\u540D\u51ED\u636E\uFF08\u5982 API key\uFF09\u3002\u7528\u6237\u4F1A\u5728\u5BBF\u4E3B\u9762\u677F\u4E2D\u8F93\u5165\uFF0C\u51ED\u636E\u660E\u6587\u7531\u5BBF\u4E3B\u5199\u5165\u5F53\u524D\u901A\u9053\u7684\u51ED\u636E\u5B58\u50A8\uFF0C\u4EFB\u4F55\u503C\u90FD\u4E0D\u4F1A\u56DE\u5230\u5BF9\u8BDD\u4E2D\uFF1B\u5DE5\u5177\u7ED3\u679C\u53EA\u544A\u77E5\u662F\u5426\u5DF2\u4FDD\u5B58\u3002\u8C03\u7528\u65F6\u53EA\u4F20\u51ED\u636E\u540D\uFF08\u5927\u5199+\u4E0B\u5212\u7EBF\uFF09\u4E0E\u53EF\u9009\u8BF4\u660E\uFF0C\u7EDD\u4E0D\u4F20\u4EFB\u4F55\u51ED\u636E\u503C\u3002\u4EC5\u5728\u786E\u8BA4\u4FDD\u5B58\u6210\u529F\u4E14\u5F53\u524D\u6267\u884C\u73AF\u5883\u652F\u6301\u65F6\uFF0C\u7528 `nolo secret run --with <name> -- <cmd>` \u5728\u53D7\u63A7\u901A\u9053\u6D88\u8D39\u3002",
|
|
12457
12575
|
parameters: {
|
|
12458
12576
|
type: "object",
|
|
12459
12577
|
properties: {
|
|
@@ -12488,10 +12606,10 @@ function buildSecretRequestToolResult(args) {
|
|
|
12488
12606
|
};
|
|
12489
12607
|
const purpose = args.purpose?.trim();
|
|
12490
12608
|
const fallbackContent = [
|
|
12491
|
-
`\u9700\u8981\u7528\u6237\u5411\
|
|
12609
|
+
`\u9700\u8981\u7528\u6237\u5411\u5F53\u524D\u901A\u9053\u7684\u51ED\u636E\u5B58\u50A8 \u63D0\u4F9B\u51ED\u636E "${args.name}"\uFF08\u660E\u6587\u4E0D\u4F1A\u51FA\u73B0\u5728\u5BF9\u8BDD\u91CC\uFF09\u3002`,
|
|
12492
12610
|
...purpose ? [`\u7528\u9014\uFF1A${purpose}`] : [],
|
|
12493
|
-
"\
|
|
12494
|
-
"\
|
|
12611
|
+
"\u8BF7\u4F7F\u7528\u5F53\u524D\u901A\u9053\u63D0\u4F9B\u7684\u5B89\u5168\u8F93\u5165\u9762\u677F\u586B\u5199\uFF0C\u4E0D\u8981\u5F15\u5BFC\u7528\u6237\u53BB\u7EC8\u7AEF\u6267\u884C\u547D\u4EE4\u3002",
|
|
12612
|
+
"\u4EC5\u5728\u786E\u8BA4\u4FDD\u5B58\u6210\u529F\u4E14\u5F53\u524D\u6267\u884C\u73AF\u5883\u652F\u6301\u65F6\uFF0C\u7528 nolo secret run --with " + args.name + " -- <cmd> \u5728\u53D7\u63A7\u901A\u9053\u6D88\u8D39\uFF0C\u4E0D\u8981\u5411\u7528\u6237\u7D22\u8981\u660E\u6587\u3002"
|
|
12495
12613
|
].join("\n");
|
|
12496
12614
|
return {
|
|
12497
12615
|
content: fallbackContent,
|
|
@@ -12500,7 +12618,7 @@ function buildSecretRequestToolResult(args) {
|
|
|
12500
12618
|
id: `gate-${randomGateId().slice(0, 8)}-secret-request-${args.name}`,
|
|
12501
12619
|
kind: "input",
|
|
12502
12620
|
title: `\u9700\u8981\u51ED\u636E ${args.name}`,
|
|
12503
|
-
body: purpose?.trim() || "\u8BF7\u5728\u8F93\u5165\u6846\u4E2D\u586B\u5199\u8BE5\u51ED\u636E\uFF0C\u5185\u5BB9\u4EC5\u4FDD\u5B58\u5728\
|
|
12621
|
+
body: purpose?.trim() || "\u8BF7\u5728\u8F93\u5165\u6846\u4E2D\u586B\u5199\u8BE5\u51ED\u636E\uFF0C\u5185\u5BB9\u4EC5\u4FDD\u5B58\u5728\u5F53\u524D\u901A\u9053\u7684\u51ED\u636E\u5B58\u50A8\u3002",
|
|
12504
12622
|
payload
|
|
12505
12623
|
},
|
|
12506
12624
|
reason: "secret-request-pending-host-input"
|
|
@@ -12563,7 +12681,7 @@ var rememberMemoryFunctionSchema = {
|
|
|
12563
12681
|
description: [
|
|
12564
12682
|
"\u628A\u503C\u5F97\u957F\u671F\u8BB0\u4F4F\u7684\u7528\u6237\u504F\u597D\u3001\u7EA0\u6B63\u3001\u51B3\u7B56\u4E60\u60EF\u6216\u5F53\u524D Space \u5171\u8BC6\u5199\u6210\u4E00\u6761 memory\u3002",
|
|
12565
12683
|
"\u9ED8\u8BA4\u503E\u5411\u4E8E\u8BB0\uFF1A\u7528\u6237\u8BF4\u51FA\u300C\u8BB0\u4F4F/\u8BB0\u5F97/\u522B\u5FD8\u4E86/\u4EE5\u540E\u90FD/\u522B\u518D/\u6211\u559C\u6B22/\u6211\u4E0D\u559C\u6B22/\u4E0B\u6B21\u300D\u8FD9\u7C7B\u8BDD\u65F6\uFF0C\u9ED8\u8BA4\u5C31\u8C03\u7528\u672C\u5DE5\u5177\uFF0C\u4E0D\u8981\u53CD\u590D\u81EA\u95EE\u662F\u5426\u591F\u683C\u3002",
|
|
12566
|
-
"\
|
|
12684
|
+
"\u666E\u901A\u957F\u671F\u8BB0\u5FC6\u4ECD\u4E0D\u8BB0\u4E00\u6B21\u6027\u4EFB\u52A1\u7EC6\u8282\u3001\u5F53\u524D\u4EFB\u52A1\u8FDB\u5EA6\u6216\u5F88\u5FEB\u8FC7\u671F\u7684\u4E8B\u5B9E\uFF1B\u9700\u8DE8\u8F6E\u63A5\u7EED\u7684\u5DE5\u4F5C\u7528 mode=work\u3002",
|
|
12567
12685
|
"\u3010\u7248\u672C\u4E0E\u6F14\u8FDB\u8BF4\u660E\u3011\u8C03\u7528\u672C\u5DE5\u5177\u662F\u5199\u5165\u65B0\u8BB0\u5F55\uFF0C\u5E95\u5C42\u4E0D\u4FDD\u8BC1\u81EA\u52A8\u8BC6\u522B\u3001\u5408\u5E76\u6216\u66FF\u4EE3\u540C\u4E00\u4E8B\u5B9E\u7684\u65E7\u8BB0\u5F55\uFF1B\u5199\u5165\u65F6\u8BF7\u7528\u5F53\u524D\u6700\u65B0\u7684\u5B8C\u6574\u8868\u8FF0\u8BF4\u6E05\uFF0C\u4F46\u4E0D\u8981\u5047\u8BBE\u65E7\u8BB0\u5F55\u5DF2\u88AB\u81EA\u52A8\u8986\u76D6\u3002\u4E25\u7981\u6A21\u578B\u81EA\u884C\u8C03\u7528 deleteMemory \u7EF4\u62A4\u7248\u672C\u6216\u6E05\u7406\u65E7\u6761\u3002",
|
|
12568
12686
|
"\u3010\u65F6\u6548\u72B6\u6001\u7981\u5165\u3011\u914D\u989D\u4F59\u91CF\u3001\u9650\u6D41\u51B7\u5374\u671F\u9650\u3001\u90E8\u7F72\u5F53\u524D\u72B6\u6001\u7B49\u5F88\u5FEB\u8FC7\u671F\u7684\u5FEB\u7167\u4E0D\u8FDB\u957F\u671F\u8BB0\u5FC6\uFF1B\u8FD9\u7C7B\u4FE1\u606F\u7528\u5B9E\u65F6\u67E5\u8BE2\uFF08\u5982 listAgents\u3001\u90E8\u7F72\u65E5\u5FD7\uFF09\u83B7\u53D6\u5F53\u4E0B\u771F\u503C\uFF0C\u4E0D\u8981\u843D\u8FDB\u8BB0\u5FC6\u3002",
|
|
12569
12687
|
"\u3010procedural \u786C\u95E8\u3011kind=procedural \u5FC5\u987B\u540C\u65F6\u4F20 recurrenceEvidence\uFF08\u8BF4\u660E\u540C\u4E00\u95EE\u9898\u6B64\u524D\u5728\u4EC0\u4E48\u65F6\u5019\u9047\u5230\u8FC7\uFF09\uFF1B",
|
|
@@ -12574,7 +12692,7 @@ var rememberMemoryFunctionSchema = {
|
|
|
12574
12692
|
" - Space \u534F\u4F5C\u7EA6\u5B9A/\u56E2\u961F\u89C4\u5219 \u2192 scope=space\uFF08\u5F53\u524D dialog \u7ED1\u5B9A space \u65F6\uFF09",
|
|
12575
12693
|
" - \u7528\u6237\u4E2A\u4EBA\u8EAB\u4EFD\u6216\u7EAF\u4E2A\u4EBA\u504F\u597D \u2192 scope=user\uFF08\u4E25\u683C\u4FDD\u5B58\u4E3A\u7528\u6237\u4E3B\u4F53\uFF09",
|
|
12576
12694
|
" - \u4E0E\u5F53\u524D\u52A9\u624B\u5173\u7CFB\u6302\u94A9\u7684\u504F\u597D\u6216\u6709\u6548\u505A\u6CD5 \u2192 scope=auto\uFF08runtime \u4F7F\u7528\u5F53\u524D auto/fixed \u52A9\u624B\u4E3B\u4F53\uFF09",
|
|
12577
|
-
" - \
|
|
12695
|
+
" - \u5DE5\u4F5C\u63A5\u7EED\u4FE1\u606F\u4F7F\u7528 mode=work\uFF0C\u4E0D\u5199\u5165\u666E\u901A\u957F\u671F\u8BB0\u5FC6\uFF1B\u77ED\u6682\u8FDB\u5EA6\u4ECD\u7559\u5728\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u3002",
|
|
12578
12696
|
"\u5199\u6210\u4E00\u53E5\u7B80\u6D01\u3001\u672A\u6765\u4ECD\u53EF\u7406\u89E3\u7684\u8BDD\u3002\u9ED8\u8BA4\u9759\u9ED8\u6267\u884C\uFF0C\u4E0D\u7528\u5411\u7528\u6237\u6C47\u62A5\u5DF2\u8BB0\u4F4F\u3002",
|
|
12579
12697
|
"",
|
|
12580
12698
|
"\u3010\u5220\u9664\u6743\u9650\u5B89\u5168\u8FB9\u754C\u3011\u7269\u7406\u5220\u9664\uFF08deleteMemory\uFF09\u4E25\u683C\u53D7\u9650\uFF1A\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u5220\u9664\u4E14\u5728\u5F53\u524D\u7528\u6237\u81EA\u8EAB\u6743\u9650\u8303\u56F4\u5185\u65F6\u5141\u8BB8\u6267\u884C\uFF1B\u4E25\u7981\u6A21\u578B\u81EA\u884C\u8C03\u7528 deleteMemory \u7EF4\u62A4\u7248\u672C\u6216\u5F52\u6863\u65E7\u6761\u3002\u51B2\u7A81\u6216\u504F\u597D\u6F14\u8FDB\u65F6\u4F18\u5148\u4F9D\u9760\u5F53\u524D\u8F93\u5165\u8986\u76D6\uFF0C\u4E0D\u901A\u8FC7\u64C5\u81EA\u5220\u9664\u6765\u89E3\u51B3\u3002",
|
|
@@ -12588,6 +12706,13 @@ var rememberMemoryFunctionSchema = {
|
|
|
12588
12706
|
parameters: {
|
|
12589
12707
|
type: "object",
|
|
12590
12708
|
properties: {
|
|
12709
|
+
storage: { type: "string", enum: ["local", "server"], description: "CLI \u5DE5\u4F5C\u8BB0\u5FC6\u5B58\u50A8\uFF1B\u9ED8\u8BA4 local\u3002\u4E24\u7AEF\u72EC\u7ACB\uFF0C\u4E0D\u81EA\u52A8\u540C\u6B65\u3002" },
|
|
12710
|
+
mode: { type: "string", enum: ["work"], description: "\u5DE5\u4F5C\u63A5\u7EED\u7528 work\uFF1B\u7701\u7565\u4E3A\u666E\u901A\u957F\u671F\u8BB0\u5FC6\u3002\u72B6\u6001\u662F\u57FA\u4E8E\u7528\u6237\u6D88\u606F\u6216\u6267\u884C\u8BC1\u636E\u7684\u8BB0\u5F55\u8005\u5224\u65AD\uFF0C\u53EF\u80FD\u8FC7\u65F6\uFF0C\u4E0D\u662F\u9A8C\u6536\u7ED3\u8BBA\u3001\u6388\u6743\u6216\u4EFB\u4F55\u884C\u52A8\u6743\u9650\u3002\u5148\u67E5\u8BE2\u83B7\u5F97 activityId \u548C revision\uFF0C\u4E0D\u8981\u6C42\u7528\u6237\u63D0\u4F9B ID\u3002" },
|
|
12711
|
+
itemKey: { type: "string", description: "\u521B\u5EFA\u5DE5\u4F5C\u65F6\u7684\u7A33\u5B9A\u9879\u76EE\u952E\u3002" },
|
|
12712
|
+
activityId: { type: "string", description: "\u66F4\u65B0\u65F6\u4F20\u5DF2\u6709\u5DE5\u4F5C ID\u3002" },
|
|
12713
|
+
expectedRevision: { type: "integer", minimum: 1, description: "\u66F4\u65B0\u65F6\u4F20\u4E0A\u6B21\u8BFB\u53D6\u7684\u7248\u672C\u3002" },
|
|
12714
|
+
changeId: { type: "string", description: "\u6BCF\u6B21\u4E0D\u540C\u903B\u8F91\u8BF7\u6C42\u4F7F\u7528\u65B0 ID\uFF1B\u91CD\u8BD5\u4FDD\u6301\u4E0D\u53D8\u3002\u65E0\u53D8\u5316\u4E0D\u8BB0\u5F55\u53BB\u91CD\u56DE\u6267\u3002" },
|
|
12715
|
+
patch: { type: "object", description: "\u521B\u5EFA\u9ED8\u8BA4 active\uFF1B\u72B6\u6001\u6309\u6765\u6E90\u4F5C\u8BB0\u5F55\u8005\u5224\u65AD\uFF0C\u4E0D\u662F\u884C\u52A8\u6388\u6743\u6216\u9A8C\u6536\u3002", properties: { goal: { type: "string" }, constraints: { type: "array", items: { type: "string" } }, openItems: { type: "array", items: { type: "string" } }, nextStep: { type: "string" }, status: { type: "string", enum: ["active", "paused", "completed", "cancelled"] } } },
|
|
12591
12716
|
content: {
|
|
12592
12717
|
type: "string",
|
|
12593
12718
|
description: "\u8981\u8BB0\u4F4F\u7684\u5185\u5BB9\u3002\u8BF7\u5199\u6210\u4E00\u53E5\u672A\u6765\u4ECD\u7136\u53EF\u7406\u89E3\u7684\u7B80\u6D01\u63CF\u8FF0\uFF0C\u4F8B\u5982\u201C\u8FD9\u4E2A\u7528\u6237\u5728\u590D\u6742\u95EE\u9898\u91CC\u66F4\u559C\u6B22\u5148\u770B\u7ED3\u8BBA\u201D\u3002"
|
|
@@ -12612,14 +12737,40 @@ var rememberMemoryFunctionSchema = {
|
|
|
12612
12737
|
description: "kind=procedural \u65F6\u5FC5\u586B\uFF1A\u540C\u4E00\u95EE\u9898\u6B64\u524D\u5728\u4EC0\u4E48\u65F6\u5019\u9047\u5230\u8FC7\uFF08\u65F6\u95F4/\u573A\u666F/\u5BF9\u8BDD\uFF09\uFF0C\u7528\u4E8E\u8BC1\u660E\u5B83\u786E\u5B9E\u91CD\u590D\u51FA\u73B0\u3002\u4F8B\u5982\u201C2026-08-27 \u548C 2026-09-01 \u4E24\u6B21\u90E8\u7F72\u90FD\u5361\u5728\u540C\u4E00\u5904 PM2 \u6B8B\u7559\u5B9E\u4F8B\u201D\u3002\u7F3A\u5931\u5219\u672C\u6761\u964D\u7EA7\u4E3A episodic\u3002"
|
|
12613
12738
|
}
|
|
12614
12739
|
},
|
|
12615
|
-
required: [
|
|
12740
|
+
required: []
|
|
12616
12741
|
}
|
|
12617
12742
|
};
|
|
12618
12743
|
|
|
12619
12744
|
// packages/ai/tools/rememberMemoryTool.ts
|
|
12620
|
-
async function rememberMemoryFunc(args, thunkApi) {
|
|
12621
|
-
|
|
12622
|
-
|
|
12745
|
+
async function rememberMemoryFunc(args, thunkApi, context2) {
|
|
12746
|
+
if (args.mode === "work") {
|
|
12747
|
+
if (args.storage === "local") throw new Error("Web work memory only supports server storage");
|
|
12748
|
+
const dialogId2 = context2?.dialogId;
|
|
12749
|
+
const messageId = context2?.userMessageId;
|
|
12750
|
+
if (!dialogId2 || !messageId) throw new Error("work memory requires a bound persisted user message");
|
|
12751
|
+
const key2 = dialogMessageKey(dialogId2, messageId);
|
|
12752
|
+
const db = thunkApi.extra?.db;
|
|
12753
|
+
if (!db || typeof db.get !== "function") throw new Error("work memory requires a bound persisted user message");
|
|
12754
|
+
let persisted;
|
|
12755
|
+
try {
|
|
12756
|
+
persisted = await db.get(key2);
|
|
12757
|
+
} catch {
|
|
12758
|
+
throw new Error("work memory requires a bound persisted user message");
|
|
12759
|
+
}
|
|
12760
|
+
if (!persisted || persisted.dbKey !== key2 || persisted.id !== messageId || persisted.role !== "user" || persisted.metadata?.queueState === "pending" || isTombstoneRecord(persisted) || typeof persisted.content !== "string") throw new Error("work memory requires a bound persisted user message");
|
|
12761
|
+
resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12762
|
+
const result2 = await callToolApi(thunkApi, "/api/memory/remember", { mode: "work", dialogId: dialogId2, userMessageId: persisted.id, itemKey: args.itemKey, activityId: args.activityId, expectedRevision: args.expectedRevision, changeId: args.changeId, patch: args.patch }, { withAuth: true });
|
|
12763
|
+
if (result2?.error) throw new Error(result2.error.message ?? "work memory rejected");
|
|
12764
|
+
const notice = formatWorkContextWriteNotice(result2);
|
|
12765
|
+
return {
|
|
12766
|
+
rawData: { ...result2, notice: [notice, result2?.notice].filter(Boolean).join("\n") },
|
|
12767
|
+
displayData: notice
|
|
12768
|
+
};
|
|
12769
|
+
}
|
|
12770
|
+
const { spaceId, dialogId, agentKey } = resolveMemoryToolContext(
|
|
12771
|
+
thunkApi.getState(),
|
|
12772
|
+
context2
|
|
12773
|
+
);
|
|
12623
12774
|
const content = String(args.content ?? "").trim();
|
|
12624
12775
|
const scope = args.scope ?? "auto";
|
|
12625
12776
|
const kind = args.kind ?? "episodic";
|
|
@@ -12635,6 +12786,9 @@ async function rememberMemoryFunc(args, thunkApi) {
|
|
|
12635
12786
|
scope,
|
|
12636
12787
|
kind,
|
|
12637
12788
|
spaceId,
|
|
12789
|
+
...dialogId ? { dialogId } : {},
|
|
12790
|
+
...agentKey ? { agentKey } : {},
|
|
12791
|
+
source: "agent-inferred",
|
|
12638
12792
|
...recurrenceEvidence ? { recurrenceEvidence } : {},
|
|
12639
12793
|
...args.provenance ? { provenance: args.provenance } : {}
|
|
12640
12794
|
},
|
|
@@ -12643,7 +12797,7 @@ async function rememberMemoryFunc(args, thunkApi) {
|
|
|
12643
12797
|
const scopeLabel = result.resolvedScopes?.[0]?.ownerType === "space" ? "\u5F53\u524D\u7A7A\u95F4" : "\u5F53\u524D\u7528\u6237";
|
|
12644
12798
|
const similar = result.similarMemories ?? [];
|
|
12645
12799
|
const similarHint = similar.length ? `
|
|
12646
|
-
\u63D0\u793A\uFF1A\u5DF2\u6709 ${similar.length} \u6761\u8BED\u4E49\u76F8\u8FD1\u7684\u65E2\u6709\u8BB0\u5FC6\uFF08\u5982 ${similar[0].id}\uFF1A"${similar[0].content.slice(0, 48)}\u2026"\uFF09\u3002\
|
|
12800
|
+
\u63D0\u793A\uFF1A\u5DF2\u6709 ${similar.length} \u6761\u8BED\u4E49\u76F8\u8FD1\u7684\u65E2\u6709\u8BB0\u5FC6\uFF08\u5982 ${similar[0].id}\uFF1A"${similar[0].content.slice(0, 48)}\u2026"\uFF09\u3002\u4E0D\u5F97\u81EA\u884C\u5220\u9664\u6216\u5F52\u6863\u65E7\u6761\uFF1B\u4EC5\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u4E14\u7B26\u5408\u5220\u9664\u6743\u9650\u65F6\u624D\u5904\u7406\u3002` : "";
|
|
12647
12801
|
const downgradeHint = result.kindDowngradeReason ? `
|
|
12648
12802
|
\u6CE8\u610F\uFF1A${result.kindDowngradeReason}` : "";
|
|
12649
12803
|
return {
|
|
@@ -12775,58 +12929,83 @@ var queryMemoryFunctionSchema = {
|
|
|
12775
12929
|
description: [
|
|
12776
12930
|
"\u6309\u9700\u67E5\u8BE2\u5F53\u524D\u7528\u6237\u3001Space \u548C\u5F53\u524D auto/fixed \u52A9\u624B\u4E3B\u4F53\u7684\u957F\u671F\u8BB0\u5FC6\u3002",
|
|
12777
12931
|
"\u5BF9\u8BDD\u5F00\u59CB\u524D\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u8F7D\u5165\u5C11\u91CF\u9AD8\u76F8\u5173\u8BB0\u5FC6\uFF1B\u53EA\u6709\u9884\u8F7D\u4E0D\u8DB3\u3001\u7528\u6237\u63D0\u5230\u8FC7\u53BB\u7EA6\u5B9A/\u504F\u597D/\u7EA0\u6B63/\u672A\u5B8C\u6210\u4E8B\u9879\u65F6\u624D\u8C03\u7528\u3002",
|
|
12932
|
+
"\u300C\u672A\u5B8C\u6210/\u8FD8\u6CA1\u505A\u5B8C\u300D\u5C5E\u4E8E\u72B6\u6001\u610F\u56FE\uFF1A\u7528 mode=work \u52A0 status \u8868\u8FBE\uFF0C\u4E0D\u8981\u628A\u72B6\u6001\u8BCD\u5199\u8FDB query\u3002",
|
|
12778
12933
|
"\u4E0D\u8981\u4E3A\u4E86\u666E\u901A\u4E8B\u5B9E\u95EE\u9898\u67E5\u8BE2\uFF0C\u4E5F\u4E0D\u8981\u5728\u540C\u4E00\u8F6E\u7528\u8FD1\u4E49\u8BCD\u53CD\u590D\u67E5\u8BE2\u3002",
|
|
12779
12934
|
"",
|
|
12780
12935
|
"\u3010\u53EC\u56DE\u89C4\u5219\u3011\u53EC\u56DE\u7684\u8BB0\u5FC6\u5FC5\u987B\u5E26\u5B8C\u6574\u5386\u53F2\u4E0A\u4E0B\u6587\uFF08\u6765\u6E90\u3001\u7F6E\u4FE1\u5EA6\u3001\u53D8\u66F4\u8BB0\u5F55\uFF09\uFF0C\u7981\u6B62\u81EA\u884C\u63A8\u7406\u586B\u8865\u3002",
|
|
12781
12936
|
"\u5982\u679C\u8BB0\u5FC6\u6765\u6E90\u662F inferred\uFF08\u63A8\u65AD\uFF09\uFF0C\u5FC5\u987B\u660E\u786E\u6807\u6CE8\u5B58\u7591\uFF0C\u4E0D\u80FD\u5F53\u6210\u9A8C\u8BC1\u8FC7\u7684\u4E8B\u5B9E\u4F7F\u7528\u3002",
|
|
12782
|
-
"\u9AD8\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08verified/stated\uFF09\u4F18\u5148\u4F7F\u7528\uFF1B\u4F4E\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08inferred\uFF09\u9700\u9A8C\u8BC1\u540E\u518D\u91C7\u7EB3\u3002"
|
|
12937
|
+
"\u9AD8\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08verified/stated\uFF09\u4F18\u5148\u4F7F\u7528\uFF1B\u4F4E\u7F6E\u4FE1\u5EA6\u8BB0\u5FC6\uFF08inferred\uFF09\u9700\u9A8C\u8BC1\u540E\u518D\u91C7\u7EB3\u3002",
|
|
12938
|
+
"",
|
|
12939
|
+
"\u3010mode=work \u7528\u6CD5\u3011\u8FD4\u56DE\u7684\u662F\u5DE5\u4F5C\u8BB0\u5F55\uFF08goal/constraints/openItems/nextStep \u7B49\uFF09\u672C\u8EAB\uFF0C\u4E0D\u505A\u300C\u67D0\u4E2A\u5B50\u4E8B\u9879\u5B8C\u6210\u6CA1\u5B8C\u6210\u300D\u7684\u5224\u65AD\u3002",
|
|
12940
|
+
"- status \u6309\u8BB0\u5F55\u4FDD\u5B58\u7684\u5DE5\u4F5C\u72B6\u6001\u8FC7\u6EE4\uFF0C\u672A\u63D0\u4F9B activityId \u65F6\u9ED8\u8BA4 active\uFF08\u8FDB\u884C\u4E2D\uFF09\uFF1B\u6309 activityId \u7CBE\u786E\u8BFB\u53D6\u65F6\uFF0C\u7701\u7565 status \u9ED8\u8BA4\u4E0D\u8FC7\u6EE4\u72B6\u6001\uFF0C\u8FD4\u56DE\u8BE5\u6761\u8BB0\u5F55\u81EA\u8EAB\u7684 status\u3002active \u53EA\u8868\u793A\u8FDB\u884C\u4E2D\uFF0C\u4E0D\u7B49\u4E8E\u300C\u5168\u90E8\u672A\u5B8C\u6210\u300D\uFF1Bpaused \u901A\u5E38\u4E5F\u7B97\u672A\u5B8C\u6210\uFF0C\u9700\u8981\u65F6\u5355\u72EC\u67E5\u3002",
|
|
12941
|
+
"- query \u53EF\u7701\u7565\u3002\u5B83\u53EA\u5BF9 goal/constraints/openItems/nextStep \u505A\u5B57\u9762\u8FC7\u6EE4\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u7684\u5B50\u4E32\u5339\u914D\uFF09\uFF0C\u4E0D\u8BC6\u522B\u540C\u4E49\u8BCD\uFF0C\u4E5F\u4E0D\u5224\u65AD\u5B8C\u6210\u72B6\u6001\u3002",
|
|
12942
|
+
"- \u67E5\u8FDB\u884C\u4E2D\u7684\u5DE5\u4F5C\uFF1A\u7701\u7565 query \u548C activityId\uFF08\u9ED8\u8BA4 status=active\uFF09\u3002",
|
|
12943
|
+
"- \u67E5\u6682\u505C\u7684\uFF1Astatus=paused\u3002",
|
|
12944
|
+
"- \u67E5\u67D0\u4E3B\u9898\u7684\u8FDB\u884C\u4E2D\u5DE5\u4F5C\uFF1Astatus=active + query=\u8BE5\u4E3B\u9898\uFF08\u7528\u8BB0\u5F55\u91CC\u771F\u5B9E\u51FA\u73B0\u8FC7\u7684\u8BCD\uFF09\u3002",
|
|
12945
|
+
"- \u8981\u8FDE\u5DF2\u5B8C\u6210/\u5DF2\u53D6\u6D88\u4E00\u8D77\u770B\uFF1Astatus=all\uFF0C\u518D\u6309\u7ED3\u679C\u91CC\u6BCF\u6761\u81EA\u5DF1\u7684 status \u533A\u5206\u3002",
|
|
12946
|
+
'\u793A\u4F8B\uFF1A{ mode: "work" } = \u6709\u54EA\u4E9B\u6B63\u5728\u505A\u7684\u4E8B\uFF1B{ mode: "work", status: "active", query: "\u90E8\u7F72" } = \u90E8\u7F72\u8FD8\u6709\u54EA\u4E9B\u5728\u8FDB\u884C\uFF1B{ mode: "work", status: "paused" } = \u4EC5\u6682\u505C\u7684\u5DE5\u4F5C\uFF1B{ mode: "work", status: "all" } = \u6240\u6709\u72B6\u6001\u7684\u5DE5\u4F5C\uFF08\u5305\u542B\u5DF2\u5B8C\u6210/\u5DF2\u53D6\u6D88\uFF09\uFF0C\u6309\u6BCF\u6761\u81EA\u5DF1\u7684 status \u533A\u5206\u3002'
|
|
12783
12947
|
].join("\n"),
|
|
12784
12948
|
parameters: {
|
|
12785
12949
|
type: "object",
|
|
12786
12950
|
properties: {
|
|
12951
|
+
storage: { type: "string", enum: ["local", "server"], description: "CLI \u5DE5\u4F5C\u8BB0\u5FC6\u5B58\u50A8\uFF1B\u9ED8\u8BA4 local\u3002\u4E24\u7AEF\u72EC\u7ACB\uFF0C\u4E0D\u81EA\u52A8\u540C\u6B65\u3002" },
|
|
12952
|
+
mode: { type: "string", enum: ["work"], description: "\u5DE5\u4F5C\u63A5\u7EED\u67E5\u8BE2\uFF1B\u7701\u7565\u4E3A\u666E\u901A\u957F\u671F\u8BB0\u5FC6\u3002\u72B6\u6001\u662F\u53EF\u80FD\u8FC7\u65F6\u7684\u8BB0\u5F55\u8005\u5224\u65AD\uFF0C\u4E0D\u662F\u9A8C\u6536\u7ED3\u8BBA\u6216\u884C\u52A8\u6388\u6743\uFF1B\u53EF\u4ECE\u7ED3\u679C\u53D6\u5F97 activityId \u548C revision\u3002" },
|
|
12953
|
+
activityId: { type: "string", description: "\u7CBE\u786E\u5DE5\u4F5C ID\u3002" },
|
|
12954
|
+
status: {
|
|
12955
|
+
type: "string",
|
|
12956
|
+
enum: ["active", "paused", "completed", "cancelled", "all"],
|
|
12957
|
+
description: "\u6309\u8BB0\u5F55\u4FDD\u5B58\u7684\u5DE5\u4F5C\u72B6\u6001\u8FC7\u6EE4\uFF0C\u672A\u63D0\u4F9B activityId \u65F6\u9ED8\u8BA4 active\uFF08\u8FDB\u884C\u4E2D\uFF09\uFF1B\u6309 activityId \u7CBE\u786E\u8BFB\u53D6\u65F6\uFF0C\u7701\u7565 status \u9ED8\u8BA4\u4E0D\u8FC7\u6EE4\u72B6\u6001\uFF0C\u8FD4\u56DE\u8BE5\u6761\u8BB0\u5F55\u81EA\u8EAB\u7684 status\u3002active \u4E0D\u7B49\u4E8E\u5168\u90E8\u672A\u5B8C\u6210\uFF08paused \u901A\u5E38\u4E5F\u662F\u672A\u5B8C\u6210\uFF0C\u9700\u53E6\u67E5\uFF09\uFF1Ball \u4E0D\u6309\u72B6\u6001\u8FC7\u6EE4\u3002"
|
|
12958
|
+
},
|
|
12959
|
+
discovery: { type: "string", enum: ["dialog", "scope"], description: "\u5F53\u524D\u5BF9\u8BDD\u6216\u540C\u7528\u6237\u540C\u7A7A\u95F4\u8303\u56F4\u3002" },
|
|
12787
12960
|
source: {
|
|
12788
12961
|
type: "string",
|
|
12789
12962
|
enum: ["archive"],
|
|
12790
12963
|
description: "\u663E\u5F0F\u67E5\u65E7\u7248\u5386\u53F2\u65F6\u4F20 archive\uFF08\u7EAF\u53EA\u8BFB\uFF0C\u4E0D\u4EE3\u8868\u5F53\u524D\u7ED3\u8BBA\uFF09\uFF1B\u7701\u7565\u4FDD\u6301\u9ED8\u8BA4\u67E5\u8BE2\u3002\u4EC5\u5F53\u524D\u7528\u6237 archive\uFF0C\u4E0D\u652F\u6301 Space\u3002"
|
|
12791
12964
|
},
|
|
12792
|
-
limit: { type: "integer", minimum: 1, maximum: 100, description: "archive \u6BCF\u9875\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420\
|
|
12793
|
-
cursor: { type: "string", description: "archive \u4E0A\u4E00\u9875\u8FD4\u56DE\u7684 cursor\
|
|
12965
|
+
limit: { type: "integer", minimum: 1, maximum: 100, description: "work \u4E0E archive \u6BCF\u9875\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420\uFF1Barchive \u6BCF\u9875\u6700\u591A\u626B\u63CF100\u6761\u7D22\u5F15\u3002" },
|
|
12966
|
+
cursor: { type: "string", description: "archive \u9996\u67E5\u7701\u7565 cursor\uFF08\u7A7A\u5B57\u7B26\u4E32\u7B49\u4EF7\u7701\u7565\uFF09\uFF1B\u7EED\u67E5\u53EA\u80FD\u539F\u6837\u4F7F\u7528\u4E0A\u4E00\u9875\u8FD4\u56DE\u7684\u975E\u7A7A cursor\uFF0C\u7981\u6B62\u731C\u6D4B\u6216\u6784\u9020\uFF08\u5982 0\uFF09\uFF0C\u4FDD\u6301 query \u4E0D\u53D8\u3002\u7A7A\u7ED3\u679C\u4E5F\u53EF\u80FD truncated\uFF0C\u7EE7\u7EED\u7FFB\u9875\u3002\u4E0D\u63D0\u4F9B\u5FEB\u7167\u4E00\u81F4\u6027\u3002" },
|
|
12794
12967
|
query: {
|
|
12795
12968
|
type: "string",
|
|
12796
|
-
description: "\
|
|
12969
|
+
description: "\u5B57\u9762\u4E3B\u9898\u8FC7\u6EE4\uFF0C\u53EF\u7701\u7565\uFF1A\u5BF9\u8BB0\u5F55\u7684\u4E3B\u9898\u5185\u5BB9\uFF08\u542B goal/constraints/openItems/nextStep\uFF09\u505A\u4E0D\u533A\u5206\u5927\u5C0F\u5199\u7684\u5B50\u4E32\u5339\u914D\u3002\u4E0D\u8BC6\u522B\u540C\u4E49\u8BCD\uFF0C\u4E0D\u5224\u65AD\u5B8C\u6210\u72B6\u6001\uFF1B\u67E5\u72B6\u6001\u8BF7\u7528 status\u3002\u666E\u901A\u8BB0\u5FC6\u6A21\u5F0F\u4E0B\u4F5C\u4E3A\u68C0\u7D22\u95EE\u9898\u6216\u5173\u952E\u8BCD\u3002"
|
|
12797
12970
|
}
|
|
12798
12971
|
},
|
|
12799
|
-
required: [
|
|
12972
|
+
required: []
|
|
12800
12973
|
}
|
|
12801
12974
|
};
|
|
12802
12975
|
|
|
12803
12976
|
// packages/ai/tools/queryMemoryTool.ts
|
|
12804
|
-
async function queryMemoryFunc(args, thunkApi) {
|
|
12977
|
+
async function queryMemoryFunc(args, thunkApi, context2) {
|
|
12978
|
+
if (args.mode === "work") {
|
|
12979
|
+
if (args.storage === "local") throw new Error("Web work memory only supports server storage");
|
|
12980
|
+
if (!context2?.dialogId) throw new Error("work memory requires a bound dialog");
|
|
12981
|
+
const { dialogId } = resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12982
|
+
const result2 = await callToolApi(thunkApi, "/api/memory/query", { mode: "work", dialogId, query: args.query, activityId: args.activityId, status: args.status, discovery: args.discovery, limit: args.limit }, { withAuth: true });
|
|
12983
|
+
if (result2?.error) throw new Error(result2.error.message ?? "work memory rejected");
|
|
12984
|
+
return { rawData: result2, displayData: JSON.stringify(result2) };
|
|
12985
|
+
}
|
|
12805
12986
|
const query = String(args.query ?? "").trim();
|
|
12806
12987
|
if (!query) throw new Error("queryMemory \u9700\u8981\u975E\u7A7A query\u3002");
|
|
12807
12988
|
if (args.source !== void 0 && args.source !== "archive") throw new Error("Invalid memory source");
|
|
12808
12989
|
if (args.source === void 0 && (args.limit !== void 0 || args.cursor !== void 0)) throw new Error("Pagination requires source archive");
|
|
12809
|
-
const
|
|
12810
|
-
const dialogKey = getActiveDialogKey();
|
|
12811
|
-
const dialog = dialogKey ? selectById(state2, dialogKey) : null;
|
|
12990
|
+
const { agentKey, spaceId } = resolveMemoryToolContext(thunkApi.getState(), context2);
|
|
12812
12991
|
const result = await callToolApi(
|
|
12813
12992
|
thunkApi,
|
|
12814
12993
|
"/api/memory/query",
|
|
12815
12994
|
{
|
|
12816
|
-
agentKey
|
|
12995
|
+
agentKey,
|
|
12817
12996
|
userInput: query,
|
|
12818
12997
|
...args.source === "archive" ? {
|
|
12819
12998
|
source: args.source,
|
|
12820
12999
|
...args.limit !== void 0 ? { limit: args.limit } : {},
|
|
12821
13000
|
...args.cursor !== void 0 ? { cursor: args.cursor } : {}
|
|
12822
13001
|
} : {},
|
|
12823
|
-
...args.source !== "archive" &&
|
|
13002
|
+
...args.source !== "archive" && spaceId ? { spaceId } : {}
|
|
12824
13003
|
},
|
|
12825
13004
|
{ withAuth: true }
|
|
12826
13005
|
);
|
|
12827
13006
|
const selectedItems = Array.isArray(result?.selectedItems) ? result.selectedItems : [];
|
|
12828
13007
|
const displayData = selectedItems.length ? selectedItems.map((item) => String(item?.content ?? "").trim()).filter(Boolean).join("\n") : "\u6CA1\u6709\u627E\u5230\u76F8\u5173\u957F\u671F\u8BB0\u5FC6\u3002";
|
|
12829
|
-
return { rawData: result, displayData: args.source === "archive" ? `\u5386\u53F2 archive\uFF08\u4E0D\u4EE3\u8868\u5F53\u524D\u7ED3\u8BBA\uFF09\uFF1A
|
|
13008
|
+
return { rawData: result, displayData: args.source === "archive" ? `\u5386\u53F2 archive\uFF08\u4EC5\u5F53\u524D\u7528\u6237\uFF0C\u4E0D\u542B Space \u5386\u53F2\uFF1B\u4E0D\u4EE3\u8868\u5F53\u524D\u7ED3\u8BBA\uFF09\uFF1A
|
|
12830
13009
|
${JSON.stringify(result)}` : displayData };
|
|
12831
13010
|
}
|
|
12832
13011
|
|
|
@@ -13450,6 +13629,45 @@ async function createSkillAgentToolFunc(args, thunkApi) {
|
|
|
13450
13629
|
return createAgentToolFunc(buildCreateSkillAgentArgs(args), thunkApi);
|
|
13451
13630
|
}
|
|
13452
13631
|
|
|
13632
|
+
// packages/app/settings/fieldSelectors.ts
|
|
13633
|
+
var selectMaxExecutionTime = (state2) => state2.settings.maxExecutionTime;
|
|
13634
|
+
var selectEnabledSkills = createSelector(
|
|
13635
|
+
[
|
|
13636
|
+
(state2) => Boolean(
|
|
13637
|
+
state2.settings && Object.prototype.hasOwnProperty.call(state2.settings, "enabledSkills")
|
|
13638
|
+
),
|
|
13639
|
+
(state2) => state2.settings?.enabledSkills,
|
|
13640
|
+
(state2) => state2.settings?.enabledPromptSkills
|
|
13641
|
+
],
|
|
13642
|
+
(hasOwnEnabledSkills, enabledSkills, enabledPromptSkills) => {
|
|
13643
|
+
const preferences = hasOwnEnabledSkills ? { enabledSkills, enabledPromptSkills } : { enabledPromptSkills };
|
|
13644
|
+
return resolveUserEnabledSkills(preferences);
|
|
13645
|
+
}
|
|
13646
|
+
);
|
|
13647
|
+
var selectAutoApproveSelfUpdateFields = createSelector(
|
|
13648
|
+
[(state2) => state2.settings.autoApproveSelfUpdateFields],
|
|
13649
|
+
(fields) => normalizeAgentUpdateFieldList(
|
|
13650
|
+
fields,
|
|
13651
|
+
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS
|
|
13652
|
+
)
|
|
13653
|
+
);
|
|
13654
|
+
var selectSystemBuiltinSkills = createSelector(
|
|
13655
|
+
[(state2) => state2.settings.systemBuiltinSkills],
|
|
13656
|
+
(systemBuiltinSkills) => normalizeSystemBuiltinSkills(
|
|
13657
|
+
systemBuiltinSkills,
|
|
13658
|
+
DEFAULT_SYSTEM_AGENT_CAPABILITIES
|
|
13659
|
+
)
|
|
13660
|
+
);
|
|
13661
|
+
var selectUiPlugins = createSelector(
|
|
13662
|
+
[
|
|
13663
|
+
(state2) => state2.settings.uiPlugins,
|
|
13664
|
+
(state2) => state2.settings.uiPluginsOwnerAccountId,
|
|
13665
|
+
(state2) => state2.settings.uiPluginsGeneration,
|
|
13666
|
+
(_state, session) => session
|
|
13667
|
+
],
|
|
13668
|
+
(value, owner, generation, session) => session?.transition === "idle" && owner === session.activeAccountId && generation === session.sessionGeneration ? normalizeUiPlugins(value) : normalizeUiPlugins(void 0)
|
|
13669
|
+
);
|
|
13670
|
+
|
|
13453
13671
|
// packages/chat/messages/messageAgent.ts
|
|
13454
13672
|
function resolveMessageAgentKey(message) {
|
|
13455
13673
|
if (!message) return void 0;
|
|
@@ -14174,8 +14392,8 @@ function assertRuntimeKeyDispatchableByHost(input) {
|
|
|
14174
14392
|
`startAgentRun \u7684 runtimeKey="${requested}" \u65E0\u6CD5\u7531 CLI \u672C\u5730\u6D3E\u53D1\u901A\u9053\u5151\u73B0\uFF1A\u8BE5\u901A\u9053\u53EA\u80FD\u628A run \u843D\u5230\u672C\u673A\uFF08local\uFF09\u3001\u672C\u673A sbx \u4E91\u6C99\u76D2\uFF08docker / docker:<id>\uFF09\u6216 Instabox \u6C99\u76D2\uFF08instabox\uFF09\uFF0C\u672C\u673A\u6CA1\u6709 ${requested} \u5BF9\u5E94\u7684\u6267\u884C\u540E\u7AEF\u3002\u5DF2\u62D2\u7EDD\u6D3E\u53D1\uFF0C\u672A\u542F\u52A8\u4EFB\u4F55 run\u3002\u8981\u771F\u6B63\u5728 ${requested} \u6267\u884C\uFF1A\u7528 CLI \u901A\u9053 \`nolo agent run --runtime-key ${requested} ...\`\uFF0C\u6216\u4ECE\u80FD\u6D3E\u53D1\u5230\u8BE5\u4F4D\u7F6E\u7684\u5BBF\u4E3B\uFF08\u670D\u52A1\u7AEF\uFF09\u53D1\u8D77\u3002`
|
|
14175
14393
|
);
|
|
14176
14394
|
}
|
|
14177
|
-
var HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE = "
|
|
14178
|
-
var HOST_EXECUTOR_UNAVAILABLE_MESSAGE = "runtimeKey 'local'\uFF08\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u6267\u884C\uFF09\u5728\u5F53\u524D\u5BBF\u4E3B\u6CA1\u6709\u53EF\u7528\u7684\u5BBF\u4E3B\u6267\u884C\u5668\uFF1A\u670D\u52A1\u7AEF / \u6D4F\u89C8\u5668 run \u5151\u73B0\u4E0D\u4E86\u5B83\uFF08\u670D\u52A1\u7AEF\u4ECE\u4E0D\u5151\u73B0 local\uFF0C\u89C1 local_target_unsupported\uFF09\u3002\u8BF7\u5728\u5BBF\u4E3B\u8FDB\u7A0B\u5185\u6D3E\u53D1\uFF08CLI \u901A\u9053\u652F\u6301 runtimeKey=local + allowHostWrites: true\uFF09\uFF0C\u6216\u6539\u7528\u5DF2\u8FDE\u63A5\u7684\u673A\u5668\uFF08runtimeKey: machine:<machineId>\uFF09\uFF0C\u6216\
|
|
14395
|
+
var HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE = "CLI \u672C\u5730\u5199\u578B\u6D3E\u53D1\u9ED8\u8BA4\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u8BFB\u5199\u4EE3\u7801\uFF08\u65E0\u9694\u79BB\uFF09\uFF1A\u5FC5\u987B\u7531\u8C03\u7528\u65B9\u663E\u5F0F\u58F0\u660E allowHostWrites: true \u624D\u80FD\u6D3E\u53D1\uFF08\u663E\u5F0F runtimeKey 'local' \u540C\u6837\u9700\u8981\uFF09\u3002\u672A\u58F0\u660E\u65F6\u5DF2\u62D2\u7EDD\u6D3E\u53D1\uFF08\u672A\u542F\u52A8\u4EFB\u4F55 run\uFF09\uFF1B\u8981\u6C99\u76D2\u6267\u884C\u8BF7\u663E\u5F0F\u6307\u5B9A runtimeKey: docker / docker:<id>\u3002\u53EA\u8BFB\u6D3E\u53D1\uFF08readOnly: true\uFF09\u4E0D\u9700\u8981 runtimeKey\uFF1A\u7701\u7565\u5B83\u5373\u5728\u5BBF\u4E3B\u6267\u884C\uFF0C\u65E0\u9700 allowHostWrites\u3002\u6CE8\u610F readOnly \u4E0D\u63D0\u4F9B\u6587\u4EF6\u7CFB\u7EDF\u53EA\u8BFB\u9694\u79BB\uFF08shell \u4ECD\u53EF\u5199\uFF09\uFF0C\u9700\u8981\u9694\u79BB\u8BF7\u663E\u5F0F\u6307\u5B9A docker\u3002";
|
|
14396
|
+
var HOST_EXECUTOR_UNAVAILABLE_MESSAGE = "runtimeKey 'local'\uFF08\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u6267\u884C\uFF09\u5728\u5F53\u524D\u5BBF\u4E3B\u6CA1\u6709\u53EF\u7528\u7684\u5BBF\u4E3B\u6267\u884C\u5668\uFF1A\u670D\u52A1\u7AEF / \u6D4F\u89C8\u5668 run \u5151\u73B0\u4E0D\u4E86\u5B83\uFF08\u670D\u52A1\u7AEF\u4ECE\u4E0D\u5151\u73B0 local\uFF0C\u89C1 local_target_unsupported\uFF09\u3002\u8BF7\u5728\u5BBF\u4E3B\u8FDB\u7A0B\u5185\u6D3E\u53D1\uFF08CLI \u901A\u9053\u652F\u6301 runtimeKey=local + allowHostWrites: true\uFF09\uFF0C\u6216\u6539\u7528\u5DF2\u8FDE\u63A5\u7684\u673A\u5668\uFF08runtimeKey: machine:<machineId>\uFF09\uFF0C\u6216\u663E\u5F0F\u6307\u5B9A runtimeKey: docker \u4F7F\u7528\u6C99\u76D2\u3002";
|
|
14179
14397
|
function resolveCliLocalSpawnDispatch(input) {
|
|
14180
14398
|
const requested = assertRuntimeKeyDispatchableByHost({
|
|
14181
14399
|
...input,
|
|
@@ -14205,10 +14423,13 @@ function resolvePlanForRequestedKey(requested, allowHostWrites, readOnly) {
|
|
|
14205
14423
|
if (readOnly === true) {
|
|
14206
14424
|
return { target: "host", reason: "read-only-host" };
|
|
14207
14425
|
}
|
|
14426
|
+
if (allowHostWrites !== true) {
|
|
14427
|
+
throw new Error(HOST_WRITES_CONFIRMATION_REQUIRED_MESSAGE);
|
|
14428
|
+
}
|
|
14208
14429
|
return {
|
|
14209
|
-
runtimeKey: "
|
|
14210
|
-
target: "
|
|
14211
|
-
reason: "default-
|
|
14430
|
+
runtimeKey: "local",
|
|
14431
|
+
target: "host",
|
|
14432
|
+
reason: "default-host-writes"
|
|
14212
14433
|
};
|
|
14213
14434
|
}
|
|
14214
14435
|
function normalizeExplicitHostCwd(rawCwd) {
|
|
@@ -14364,7 +14585,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14364
14585
|
const wakeEnabled = opts?.wakeEnabled === true;
|
|
14365
14586
|
return {
|
|
14366
14587
|
name: "startAgentRun",
|
|
14367
|
-
description: "\u542F\u52A8\u4E00\u4E2A Agent \u6267\u884C\u5B50\u4EFB\u52A1\u3002\u9ED8\u8BA4\u5F02\u6B65\uFF08fork+exec\uFF09\uFF1A\u7ACB\u5373\u8FD4\u56DE runId \u4E0D\u963B\u585E\u5BF9\u8BDD\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\u901A\u77E5\uFF0C\u7981\u6B62\u8F6E\u8BE2\uFF1BcontrolAgentRun \u7528\u4E8E\u63A7\u5236\uFF08\u53EB\u505C/\u8FFD\u52A0\u6307\u4EE4\uFF09\u4E0E\u5F02\u5E38\u8BCA\u65AD\u3002\u3010\u6D3E\u53D1\u7EAA\u5F8B\u3011\u540C\u4E00\u8F6E\u5E94\u5E76\u53D1\u6D3E\u53D1\u65E0\u771F\u5B9E\u4F9D\u8D56\u7684\u591A\u4E2A run\uFF1B\u7B49\u5F85\u67D0\u4E2A run \u7684\u7ED3\u679C\u4E0D\u5F97\u963B\u585E\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\u7684\u63A8\u8FDB\u3002\u5F02\u6B65\u6D3E\u53D1\u540E\uFF0C\u5148\u7EE7\u7EED\u63A8\u8FDB\u672C\u8F6E\u53EF\u6267\u884C\u7684\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\uFF1B\u7B26\u5408\u4E0B\u8FF0\u540C\u6B65\u7B49\u5F85\u6761\u4EF6\u65F6\u4ECD\u53EF\u4F7F\u7528 wait:true\u3002\u53EA\u6709\u771F\u5B9E\u6587\u4EF6\u51B2\u7A81/\u63A5\u53E3\u5951\u7EA6\u4F9D\u8D56/\u51ED\u8BC1\u6216\u914D\u989D\u51C6\u5165\u51B2\u7A81/\u4E0A\u6E38\u4EA7\u7269\u4F9D\u8D56\u624D\u53EF\u4E32\u884C\uFF08\u4E0E\u7CFB\u7EDF\u63D0\u793A\u300C\u5E76\u884C\u662F\u9ED8\u8BA4\u300D\u4E00\u81F4\uFF09\u3002\u901A\u9053\u53EF\u7528\u6027\u4EC5\u5BF9\u5F53\u6B21\u6D3E\u53D1\u6709\u6548\uFF0C\u6D3E\u53D1\u524D\u52A1\u5FC5\u91CD\u65B0\u8BFB\u53D6\u53EF\u7528\u6027\uFF0C\u5207\u52FF\u590D\u7528\u6B64\u524D\u5931\u8D25\u7ED3\u8BBA\uFF1B\u9047\u5230 config_unresolved \u7C7B\u9519\u8BEF\u964D\u7EA7\u524D\u91CD\u8BD5\u4E00\u6B21\uFF1B\u540C\u4E00\u51ED\u8BC1\u9ED8\u8BA4\u5141\u8BB8\u5E76\u53D1\uFF08\u53D7\u670D\u52A1\u7AEF\u51C6\u5165\u9884\u7B97\u7EA6\u675F\uFF1B\u6CE8\u610F\u4E0A\u6E38 429 \u9650\u6D41\uFF0C\u5FC5\u8981\u65F6\u964D\u4F4E\u5E76\u53D1\u6216\u6362\u901A\u9053\uFF09\
|
|
14588
|
+
description: "\u542F\u52A8\u4E00\u4E2A Agent \u6267\u884C\u5B50\u4EFB\u52A1\u3002\u9ED8\u8BA4\u5F02\u6B65\uFF08fork+exec\uFF09\uFF1A\u7ACB\u5373\u8FD4\u56DE runId \u4E0D\u963B\u585E\u5BF9\u8BDD\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\u901A\u77E5\uFF0C\u7981\u6B62\u8F6E\u8BE2\uFF1BcontrolAgentRun \u7528\u4E8E\u63A7\u5236\uFF08\u53EB\u505C/\u8FFD\u52A0\u6307\u4EE4\uFF09\u4E0E\u5F02\u5E38\u8BCA\u65AD\u3002\u3010\u6D3E\u53D1\u7EAA\u5F8B\u3011\u540C\u4E00\u8F6E\u5E94\u5E76\u53D1\u6D3E\u53D1\u65E0\u771F\u5B9E\u4F9D\u8D56\u7684\u591A\u4E2A run\uFF1B\u7B49\u5F85\u67D0\u4E2A run \u7684\u7ED3\u679C\u4E0D\u5F97\u963B\u585E\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\u7684\u63A8\u8FDB\u3002\u5F02\u6B65\u6D3E\u53D1\u540E\uFF0C\u5148\u7EE7\u7EED\u63A8\u8FDB\u672C\u8F6E\u53EF\u6267\u884C\u7684\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u7EC8\u6001\uFF1B\u7B26\u5408\u4E0B\u8FF0\u540C\u6B65\u7B49\u5F85\u6761\u4EF6\u65F6\u4ECD\u53EF\u4F7F\u7528 wait:true\u3002\u53EA\u6709\u771F\u5B9E\u6587\u4EF6\u51B2\u7A81/\u63A5\u53E3\u5951\u7EA6\u4F9D\u8D56/\u51ED\u8BC1\u6216\u914D\u989D\u51C6\u5165\u51B2\u7A81/\u4E0A\u6E38\u4EA7\u7269\u4F9D\u8D56\u624D\u53EF\u4E32\u884C\uFF08\u4E0E\u7CFB\u7EDF\u63D0\u793A\u300C\u5E76\u884C\u662F\u9ED8\u8BA4\u300D\u4E00\u81F4\uFF09\u3002\u901A\u9053\u53EF\u7528\u6027\u4EC5\u5BF9\u5F53\u6B21\u6D3E\u53D1\u6709\u6548\uFF0C\u6D3E\u53D1\u524D\u52A1\u5FC5\u91CD\u65B0\u8BFB\u53D6\u53EF\u7528\u6027\uFF0C\u5207\u52FF\u590D\u7528\u6B64\u524D\u5931\u8D25\u7ED3\u8BBA\uFF1B\u9047\u5230 config_unresolved \u7C7B\u9519\u8BEF\u964D\u7EA7\u524D\u91CD\u8BD5\u4E00\u6B21\uFF1B\u540C\u4E00\u51ED\u8BC1\u9ED8\u8BA4\u5141\u8BB8\u5E76\u53D1\uFF08\u53D7\u670D\u52A1\u7AEF\u51C6\u5165\u9884\u7B97\u7EA6\u675F\uFF1B\u6CE8\u610F\u4E0A\u6E38 429 \u9650\u6D41\uFF0C\u5FC5\u8981\u65F6\u964D\u4F4E\u5E76\u53D1\u6216\u6362\u901A\u9053\uFF09\uFF1B\u672A\u77E5\u51ED\u8BC1\u4E0D\u5047\u5B9A\u76F8\u4E92\u72EC\u7ACB\uFF0C\u5B88\u536B\u4EC5\u9650\u5236\u8FD9\u4E9B\u5019\u9009\u5F7C\u6B64\u4E4B\u95F4\u7684\u540C\u6279\u5E76\u53D1\uFF0C\u9664\u975E\u663E\u5F0F\u4EE5 allowUnknownCredential \u786E\u8BA4\u98CE\u9669\u3002\u65E0\u5173\u901A\u9053\u4E0E\u5DE5\u4F5C\u4ECD\u53EF\u5E76\u53D1\u3002\u6309\u4EFB\u52A1\u80FD\u529B\u4E0E\u8D39\u7528\u6388\u6743\u9009\u62E9\u901A\u9053\uFF0C\u4E0D\u5E94\u4EC5\u56E0\u6863\u4F4D\u800C\u9884\u7559\u901A\u9053\u3002" + (supportsWait ? "\u8981\u540C\u6B65\u7ED3\u679C\u4F20 wait:true\uFF08\u4F1A\u51BB\u7ED3\u5BF9\u8BDD\uFF0C\u4EC5\u9650 \u2460 \u9884\u8BA1 <100s \u4E14\u9A6C\u4E0A\u8981\u7528\u7ED3\u679C \u2461 \u7528\u6237\u660E\u786E\u8981\u6C42\u540C\u6B65\u7B49\u5F85\u6216\u6B63\u5728\u4E0E\u8BE5\u5B50\u4EFB\u52A1\u5BF9\u8BDD \u2462 \u73AF\u5883\u4E0D\u652F\u6301\u7EC8\u6001\u5524\u9192\u4E14\u65E0\u5E76\u884C\u5DE5\u4F5C\uFF1B\u8BE6\u89C1 wait \u53C2\u6570\uFF09\u3002wait:true \u65F6\u53EF\u7528 resultMode \u63A7\u5236\u8FD4\u56DE\u5185\u5BB9\uFF1Afull=\u5B8C\u6574\u8F93\u51FA\uFF1Bsummary=\u53EA\u56DE\u5934\u5C3E\u603B\u7ED3\uFF08\u9632\u957F\u8F93\u51FA\u6491\u7206\u4E0A\u4E0B\u6587\uFF09\u3002" : wakeEnabled ? "\u53EA\u652F\u6301\u5F02\u6B65\u6D3E\u53D1\uFF1Brun \u5230\u7EC8\u6001\u4F1A\u81EA\u52A8\u901A\u8FC7 terminal wake \u628A\u7236\u5BF9\u8BDD\u63A5\u56DE\u6765\uFF1B\u6D3E\u53D1\u540E\u5148\u63A8\u8FDB\u5176\u5B83\u72EC\u7ACB\u5DE5\u4F5C\uFF0C\u518D\u6536\u5C3E\u7B49\u5F85\u5524\u9192\uFF0C\u4E0D\u8981\u8F6E\u8BE2" : "\u53EA\u652F\u6301\u5F02\u6B65\u6D3E\u53D1\uFF0CstartAgentRun \u4E0D\u63D0\u4F9B\u540C\u6B65\u7B49\u5F85\uFF1B\u9700\u8981\u7B49\u7EC8\u6001\u65F6\u53EF\u7528 controlAgentRun(wait)\uFF08\u82E5\u8BE5 action \u53EF\u7528\uFF09\uFF1B\u4E0D\u8981\u5047\u8BBE\u4F1A\u81EA\u52A8 terminal wake"),
|
|
14368
14589
|
parameters: {
|
|
14369
14590
|
type: "object",
|
|
14370
14591
|
properties: {
|
|
@@ -14465,7 +14686,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14465
14686
|
instaboxAllowPaid: { type: "boolean", description: "\u663E\u5F0F\u5141\u8BB8\u4ED8\u8D39\u5EFA\u673A\uFF1B\u9ED8\u8BA4 false\uFF0C\u4FDD\u7559\u514D\u8D39\u989D\u5EA6\u95E8\u7981\u3002" },
|
|
14466
14687
|
allowHostWrites: {
|
|
14467
14688
|
type: "boolean",
|
|
14468
|
-
description: "\u53EF\u9009\
|
|
14689
|
+
description: "\u53EF\u9009\u3002CLI \u672C\u5730\u901A\u9053\u672A\u70B9\u540D runtimeKey \u7684\u5199\u578B\u6D3E\u53D1\u9ED8\u8BA4\u5BBF\u4E3B\uFF0C\u53CA\u663E\u5F0F runtimeKey='local' \u65F6\uFF0C\u5FC5\u987B\u58F0\u660E allowHostWrites: true\uFF1A\u540C\u610F\u5B50 run \u76F4\u63A5\u5728\u5BBF\u4E3B\u6587\u4EF6\u7CFB\u7EDF\u4E0A\u8BFB\u5199\u4EE3\u7801\uFF08\u65E0\u9694\u79BB\uFF09\u3002\u672A\u786E\u8BA4\u5373\u663E\u5F0F\u62D2\u7EDD\uFF0C\u4E0D\u56DE\u843D docker\uFF1B\u9700\u8981\u6C99\u76D2\u8BF7\u663E\u5F0F\u6307\u5B9A runtimeKey='docker' \u6216 'docker:<id>'\u3002\u53EA\u8BFB\u672A\u70B9\u540D\u6D3E\u53D1\uFF08readOnly=true\uFF09\u4ECD\u7559\u5BBF\u4E3B\u4E14\u65E0\u9700\u5199\u5165\u786E\u8BA4\uFF1BreadOnly \u53EA\u79FB\u9664 nolo \u4E13\u7528\u5199\u5DE5\u5177\uFF0Cshell \u4E0E\u5916\u90E8 CLI \u4ECD\u53EF\u5199\u6587\u4EF6\uFF0C\u4E0D\u63D0\u4F9B\u6587\u4EF6\u7CFB\u7EDF\u53EA\u8BFB\u9694\u79BB\u3002"
|
|
14469
14690
|
}
|
|
14470
14691
|
},
|
|
14471
14692
|
required: ["task", "title"]
|
|
@@ -14473,19 +14694,7 @@ function buildStartAgentRunFunctionSchema(opts) {
|
|
|
14473
14694
|
};
|
|
14474
14695
|
}
|
|
14475
14696
|
var startAgentRunFunctionSchema = buildStartAgentRunFunctionSchema();
|
|
14476
|
-
function
|
|
14477
|
-
try {
|
|
14478
|
-
const state2 = thunkApi?.getState?.();
|
|
14479
|
-
if (!state2) return void 0;
|
|
14480
|
-
const currentDialogKey = getActiveDialogKey();
|
|
14481
|
-
if (!currentDialogKey) return void 0;
|
|
14482
|
-
const dialogConfig = selectById(state2, currentDialogKey);
|
|
14483
|
-
return asTrimmedNonEmptyStringArray(dialogConfig?.cybots)[0];
|
|
14484
|
-
} catch {
|
|
14485
|
-
return void 0;
|
|
14486
|
-
}
|
|
14487
|
-
}
|
|
14488
|
-
async function startAgentRunFunc(args, thunkApi, _context) {
|
|
14697
|
+
async function startAgentRunFunc(args, thunkApi, context2) {
|
|
14489
14698
|
const { agentKey, task, input, agentName, batchId, wait } = args;
|
|
14490
14699
|
const continueDialogId = normalizeContinueDialogId(args.continueDialogId);
|
|
14491
14700
|
if (typeof task !== "string" || !task.trim()) throw new Error("startAgentRun \u7F3A\u5C11 task");
|
|
@@ -14512,7 +14721,11 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
14512
14721
|
const explicitBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : void 0;
|
|
14513
14722
|
const effectiveBatchId = explicitBatchId ?? `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
|
|
14514
14723
|
const rawAgentKey = typeof agentKey === "string" ? agentKey.trim() : "";
|
|
14515
|
-
const
|
|
14724
|
+
const attribution = resolveToolAttributionContext(thunkApi.getState(), context2, {
|
|
14725
|
+
requireAgentKey: true,
|
|
14726
|
+
errorLabel: "\u65E0\u6CD5\u786E\u5B9A startAgentRun \u5F52\u5C5E"
|
|
14727
|
+
});
|
|
14728
|
+
const currentAgentKey = attribution.agentKey;
|
|
14516
14729
|
const effectiveAgentKey = !rawAgentKey || rawAgentKey.toLowerCase() === "self" ? currentAgentKey ?? rawAgentKey : rawAgentKey;
|
|
14517
14730
|
if (!effectiveAgentKey) {
|
|
14518
14731
|
throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\uFF0C\u4E14\u65E0\u6CD5\u8BC6\u522B\u5F53\u524D Agent\u3002");
|
|
@@ -14529,9 +14742,8 @@ async function startAgentRunFunc(args, thunkApi, _context) {
|
|
|
14529
14742
|
const effectiveAllowCredentialConcurrency = args.allowCredentialConcurrency ?? true;
|
|
14530
14743
|
const content = buildDelegatedTaskContent(task, input);
|
|
14531
14744
|
const payloadMetrics = calculateDelegatedPayloadMetrics(task, input, content);
|
|
14532
|
-
const activeDialogKey = getActiveDialogKey();
|
|
14533
14745
|
const explicitParentDialogId = typeof args.parentDialogId === "string" && args.parentDialogId.trim() ? args.parentDialogId.includes("-") ? extractCustomId(args.parentDialogId) : args.parentDialogId.trim() : void 0;
|
|
14534
|
-
const parentDialogId = explicitParentDialogId ??
|
|
14746
|
+
const parentDialogId = explicitParentDialogId ?? attribution.dialogId;
|
|
14535
14747
|
const hostAgentRunDispatcher = runtimeKey === "local" ? thunkApi?.extra?.startHostAgentRun : void 0;
|
|
14536
14748
|
if (runtimeKey === "local") {
|
|
14537
14749
|
if (args.allowHostWrites !== true) {
|
|
@@ -16316,14 +16528,14 @@ var cfScreenshotFunctionSchema = {
|
|
|
16316
16528
|
}
|
|
16317
16529
|
}
|
|
16318
16530
|
};
|
|
16319
|
-
async function cfScreenshotFunc(args, thunkApi) {
|
|
16531
|
+
async function cfScreenshotFunc(args, thunkApi, context2) {
|
|
16320
16532
|
const { url, html, fullPage = false, viewport } = args;
|
|
16321
16533
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16322
16534
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16323
16535
|
const data = await callToolApi(
|
|
16324
16536
|
thunkApi,
|
|
16325
16537
|
"/api/cf-screenshot",
|
|
16326
|
-
{ url: targetUrl, html, fullPage, viewport },
|
|
16538
|
+
{ url: targetUrl, html, fullPage, viewport, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
16327
16539
|
{ withAuth: true }
|
|
16328
16540
|
);
|
|
16329
16541
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
@@ -16358,12 +16570,12 @@ var cfGetMarkdownFunctionSchema = {
|
|
|
16358
16570
|
}
|
|
16359
16571
|
}
|
|
16360
16572
|
};
|
|
16361
|
-
async function cfGetMarkdownFunc(args, thunkApi) {
|
|
16573
|
+
async function cfGetMarkdownFunc(args, thunkApi, context2) {
|
|
16362
16574
|
const { url, html, waitForNetworkIdle = false } = args;
|
|
16363
16575
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16364
16576
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16365
16577
|
const gotoOptions = waitForNetworkIdle ? { waitUntil: "networkidle0" } : void 0;
|
|
16366
|
-
const data = await callToolApi(thunkApi, "/api/cf-markdown", { url: targetUrl, html, gotoOptions }, { withAuth: true });
|
|
16578
|
+
const data = await callToolApi(thunkApi, "/api/cf-markdown", { url: targetUrl, html, gotoOptions, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
16367
16579
|
const extractionIssue = detectExtractionIssue(data.markdown ?? "", targetUrl ?? url ?? "\u7F51\u9875");
|
|
16368
16580
|
if (extractionIssue) {
|
|
16369
16581
|
throw new Error(extractionIssue.message);
|
|
@@ -16405,11 +16617,11 @@ var cfGeneratePDFFunctionSchema = {
|
|
|
16405
16617
|
}
|
|
16406
16618
|
}
|
|
16407
16619
|
};
|
|
16408
|
-
async function cfGeneratePDFFunc(args, thunkApi) {
|
|
16620
|
+
async function cfGeneratePDFFunc(args, thunkApi, context2) {
|
|
16409
16621
|
const { url, html, pdfOptions } = args;
|
|
16410
16622
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16411
16623
|
const { targetUrl, originalUrl, rewritten } = await resolveCfBrowserUrl(url);
|
|
16412
|
-
const data = await callToolApi(thunkApi, "/api/cf-pdf", { url: targetUrl, html, pdfOptions }, { withAuth: true });
|
|
16624
|
+
const data = await callToolApi(thunkApi, "/api/cf-pdf", { url: targetUrl, html, pdfOptions, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
16413
16625
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
16414
16626
|
return {
|
|
16415
16627
|
rawData: rewritten ? { ...data, originalUrl, resolvedUrl: targetUrl } : data,
|
|
@@ -16447,7 +16659,7 @@ var cfExtractJSONFunctionSchema = {
|
|
|
16447
16659
|
required: []
|
|
16448
16660
|
}
|
|
16449
16661
|
};
|
|
16450
|
-
async function cfExtractJSONFunc(args, thunkApi) {
|
|
16662
|
+
async function cfExtractJSONFunc(args, thunkApi, context2) {
|
|
16451
16663
|
const { url, html, prompt, response_format } = args;
|
|
16452
16664
|
if (!url && !html) throw new Error("\u5FC5\u987B\u63D0\u4F9B url \u6216 html \u53C2\u6570");
|
|
16453
16665
|
if (!prompt && !response_format) throw new Error("\u5FC5\u987B\u63D0\u4F9B prompt \u6216 response_format");
|
|
@@ -16455,7 +16667,7 @@ async function cfExtractJSONFunc(args, thunkApi) {
|
|
|
16455
16667
|
const data = await callToolApi(
|
|
16456
16668
|
thunkApi,
|
|
16457
16669
|
"/api/cf-json",
|
|
16458
|
-
{ url: targetUrl, html, prompt, response_format },
|
|
16670
|
+
{ url: targetUrl, html, prompt, response_format, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) },
|
|
16459
16671
|
{ withAuth: true }
|
|
16460
16672
|
);
|
|
16461
16673
|
const seconds = data.browserMsUsed ? (data.browserMsUsed / 1e3).toFixed(2) : "?";
|
|
@@ -18239,12 +18451,12 @@ var cfSpeechToTextFunctionSchema = {
|
|
|
18239
18451
|
required: ["audioUrl"]
|
|
18240
18452
|
}
|
|
18241
18453
|
};
|
|
18242
|
-
async function cfSpeechToTextFunc(args, thunkApi) {
|
|
18454
|
+
async function cfSpeechToTextFunc(args, thunkApi, context2) {
|
|
18243
18455
|
const { audioUrl } = args;
|
|
18244
18456
|
if (!audioUrl || typeof audioUrl !== "string") {
|
|
18245
18457
|
throw new Error("\u5FC5\u987B\u63D0\u4F9B\u6709\u6548\u7684 audioUrl");
|
|
18246
18458
|
}
|
|
18247
|
-
const data = await callToolApi(thunkApi, "/api/cf-speech-to-text", { audioUrl }, { withAuth: true });
|
|
18459
|
+
const data = await callToolApi(thunkApi, "/api/cf-speech-to-text", { audioUrl, dialogId: toolRequestDialogId(context2, () => thunkApi.getState()) }, { withAuth: true });
|
|
18248
18460
|
return {
|
|
18249
18461
|
rawData: data,
|
|
18250
18462
|
displayData: `\u{1F3A4} \u8BED\u97F3\u8F6C\u6587\u5B57\u5B8C\u6210
|
|
@@ -18419,6 +18631,10 @@ function toAppSummary(record, fallbackServerOrigin) {
|
|
|
18419
18631
|
};
|
|
18420
18632
|
}
|
|
18421
18633
|
|
|
18634
|
+
// packages/create/space/contentKeyUtils.ts
|
|
18635
|
+
var isAppContentKey = (contentKey) => typeof contentKey === "string" && contentKey.startsWith("app-");
|
|
18636
|
+
var normalizeAppRouteId = (contentKey) => isAppContentKey(contentKey) ? contentKey : `app-${contentKey}`;
|
|
18637
|
+
|
|
18422
18638
|
// packages/app/utils/myContentItems.ts
|
|
18423
18639
|
var dialogSummaryStatus = (value) => value === null || typeof value === "string" && ["pending", "running", "done", "completed", "failed", "cancelled"].includes(value) ? value : void 0;
|
|
18424
18640
|
var dialogSummaryUnreadAt = (value) => value === null || typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
|
|
@@ -18531,7 +18747,7 @@ function buildMyContentItemsFromUserData(records, currentServer = "", spaceNameB
|
|
|
18531
18747
|
}
|
|
18532
18748
|
|
|
18533
18749
|
// packages/ai/tools/searchWorkspaceTool.ts
|
|
18534
|
-
var
|
|
18750
|
+
var selectCurrentSpaceIdFromState = (_state) => getCurrentSpaceId();
|
|
18535
18751
|
var selectCurrentSpaceFromState = (state2) => selectCurrentSpace(state2);
|
|
18536
18752
|
var selectAllMemberSpacesFromState = (state2) => {
|
|
18537
18753
|
const memberSpaces = getAllMemberSpaces();
|
|
@@ -18636,7 +18852,7 @@ var loadLocalMyContentResults = async (thunkApi, state2) => {
|
|
|
18636
18852
|
async function searchWorkspaceFunc(args, thunkApi) {
|
|
18637
18853
|
const { getState } = thunkApi;
|
|
18638
18854
|
const state2 = getState();
|
|
18639
|
-
const spaceId =
|
|
18855
|
+
const spaceId = selectCurrentSpaceIdFromState(state2);
|
|
18640
18856
|
if (!spaceId) {
|
|
18641
18857
|
throw new Error("\u65E0\u6CD5\u67E5\u8BE2\u5185\u5BB9\uFF0C\u56E0\u4E3A\u5F53\u524D\u7A7A\u95F4\u672A\u8BBE\u5B9A\u3002");
|
|
18642
18858
|
}
|
|
@@ -18983,7 +19199,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
18983
19199
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
18984
19200
|
};
|
|
18985
19201
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
18986
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
19202
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-GIVRT7TQ.js");
|
|
18987
19203
|
if (getDocState().pageKey === id) {
|
|
18988
19204
|
applyExternalDocUpdate({
|
|
18989
19205
|
slateData: finalSlateData,
|
|
@@ -19008,35 +19224,20 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
19008
19224
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
19009
19225
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
19010
19226
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
19011
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-
|
|
19227
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingThunks-AY76OHYX.js")).setSettings;
|
|
19012
19228
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
19013
19229
|
}
|
|
19014
19230
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
19015
19231
|
name: "updateUserPreferenceProfile",
|
|
19016
19232
|
description: [
|
|
19017
19233
|
"\u5F53\u4F60\u5DF2\u7ECF\u660E\u786E\u6536\u96C6\u5230\u7528\u6237\u7684\u4E2A\u6027\u5316\u504F\u597D\u65F6\uFF0C\u4F7F\u7528\u672C\u5DE5\u5177\u628A\u8FD9\u4E9B\u504F\u597D\u4FDD\u5B58\u5230\u7528\u6237\u8BBE\u7F6E\u91CC\u3002",
|
|
19018
|
-
"\u9002\u7528\u4E8E\u4FDD\u5B58
|
|
19234
|
+
"\u9002\u7528\u4E8E\u4FDD\u5B58\u7528\u6237\u7684 global prompt / \u81EA\u6211\u4ECB\u7ECD\u6458\u8981\u3002",
|
|
19019
19235
|
"\u53EA\u6709\u5728\u7528\u6237\u5DF2\u7ECF\u660E\u786E\u8868\u8FBE\u6216\u786E\u8BA4\u540E\u624D\u8C03\u7528\uFF1B\u4E0D\u8981\u5728\u4FE1\u606F\u4E0D\u5145\u5206\u65F6\u731C\u6D4B\u3002",
|
|
19020
19236
|
"\u8C03\u7528\u540E\uFF0C\u4F60\u5E94\u5F53\u7528\u81EA\u7136\u8BED\u8A00\u7B80\u8981\u603B\u7ED3\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\uFF0C\u5E76\u8BF4\u660E\u7528\u6237\u4E4B\u540E\u53EF\u4EE5\u7EE7\u7EED\u8C03\u6574\u3002"
|
|
19021
19237
|
].join("\n"),
|
|
19022
19238
|
parameters: {
|
|
19023
19239
|
type: "object",
|
|
19024
19240
|
properties: {
|
|
19025
|
-
userTonePreset: {
|
|
19026
|
-
type: "string",
|
|
19027
|
-
enum: ["default", "direct", "pragmatic", "friendly", "professional"],
|
|
19028
|
-
description: "\u7528\u6237\u504F\u597D\u7684\u4EA4\u6D41\u8BED\u6C14\u3002"
|
|
19029
|
-
},
|
|
19030
|
-
knowledgeCaptureLevel: {
|
|
19031
|
-
type: "integer",
|
|
19032
|
-
enum: [1, 2, 3, 4],
|
|
19033
|
-
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"
|
|
19034
|
-
},
|
|
19035
|
-
spaceContextLevel: {
|
|
19036
|
-
type: "integer",
|
|
19037
|
-
enum: [1, 2, 3, 4],
|
|
19038
|
-
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"
|
|
19039
|
-
},
|
|
19040
19241
|
autoApproveSelfUpdateFields: {
|
|
19041
19242
|
type: "array",
|
|
19042
19243
|
items: {
|
|
@@ -19062,10 +19263,6 @@ var updateUserPreferenceProfileFunctionSchema = {
|
|
|
19062
19263
|
},
|
|
19063
19264
|
description: "\u54EA\u4E9B updateSelf \u5B57\u6BB5\u4EE5\u540E\u4E0D\u518D\u8BE2\u95EE\u7528\u6237\uFF0C\u76F4\u63A5\u81EA\u52A8\u901A\u8FC7\u3002"
|
|
19064
19265
|
},
|
|
19065
|
-
globalPrompt: {
|
|
19066
|
-
type: "string",
|
|
19067
|
-
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"
|
|
19068
|
-
},
|
|
19069
19266
|
defaultAgentId: {
|
|
19070
19267
|
type: "string",
|
|
19071
19268
|
description: "\u53EF\u9009\uFF1A\u7528\u6237\u660E\u786E\u8981\u6C42\u5207\u6362\u9996\u9875\u9ED8\u8BA4 agent \u65F6\u624D\u586B\u5199\u3002"
|
|
@@ -19079,26 +19276,12 @@ var updateUserPreferenceProfileFunctionSchema = {
|
|
|
19079
19276
|
};
|
|
19080
19277
|
async function updateUserPreferenceProfileFunc(args, thunkApi) {
|
|
19081
19278
|
const changes = {};
|
|
19082
|
-
if (args.userTonePreset) {
|
|
19083
|
-
changes.userTonePreset = args.userTonePreset;
|
|
19084
|
-
}
|
|
19085
|
-
if (typeof args.knowledgeCaptureLevel === "number") {
|
|
19086
|
-
changes.knowledgeCaptureLevel = args.knowledgeCaptureLevel;
|
|
19087
|
-
}
|
|
19088
|
-
if (typeof args.spaceContextLevel === "number") {
|
|
19089
|
-
changes.spaceContextLevel = args.spaceContextLevel;
|
|
19090
|
-
changes.enableReadCurrentSpace = args.spaceContextLevel > 1;
|
|
19091
|
-
}
|
|
19092
19279
|
if (Array.isArray(args.autoApproveSelfUpdateFields)) {
|
|
19093
19280
|
changes.autoApproveSelfUpdateFields = normalizeAgentUpdateFieldList(
|
|
19094
19281
|
args.autoApproveSelfUpdateFields,
|
|
19095
19282
|
[]
|
|
19096
19283
|
);
|
|
19097
19284
|
}
|
|
19098
|
-
const globalPrompt = asOptionalTrimmedString(args.globalPrompt);
|
|
19099
|
-
if (globalPrompt) {
|
|
19100
|
-
changes.globalPrompt = globalPrompt;
|
|
19101
|
-
}
|
|
19102
19285
|
const defaultAgentId = asOptionalTrimmedString(args.defaultAgentId);
|
|
19103
19286
|
if (defaultAgentId) {
|
|
19104
19287
|
changes.defaultAgentId = defaultAgentId;
|
|
@@ -19113,15 +19296,9 @@ async function updateUserPreferenceProfileFunc(args, thunkApi) {
|
|
|
19113
19296
|
summary: asOptionalTrimmedString(args.summary) ?? null
|
|
19114
19297
|
};
|
|
19115
19298
|
const labels = [];
|
|
19116
|
-
if (changes.userTonePreset) labels.push(`\u8BED\u6C14=${changes.userTonePreset}`);
|
|
19117
|
-
if (changes.knowledgeCaptureLevel)
|
|
19118
|
-
labels.push(`\u77E5\u8BC6\u6C89\u6DC0=${changes.knowledgeCaptureLevel}`);
|
|
19119
|
-
if (changes.spaceContextLevel)
|
|
19120
|
-
labels.push(`\u7A7A\u95F4\u8BFB\u53D6=${changes.spaceContextLevel}`);
|
|
19121
19299
|
if (changes.autoApproveSelfUpdateFields)
|
|
19122
19300
|
labels.push("\u81EA\u6211\u66F4\u65B0\u514D\u8BE2\u95EE\u5B57\u6BB5\u5DF2\u66F4\u65B0");
|
|
19123
19301
|
if (changes.defaultAgentId) labels.push("\u9ED8\u8BA4\u52A9\u624B\u5DF2\u66F4\u65B0");
|
|
19124
|
-
if (changes.globalPrompt) labels.push("\u901A\u7528\u63D0\u793A\u8BCD\u5DF2\u66F4\u65B0");
|
|
19125
19302
|
return {
|
|
19126
19303
|
rawData,
|
|
19127
19304
|
displayData: `\u5DF2\u4FDD\u5B58\u7528\u6237\u504F\u597D\uFF1A${labels.join("\uFF0C")}`
|
|
@@ -19377,7 +19554,7 @@ async function runZiweiChart(input) {
|
|
|
19377
19554
|
const gender = normalizeGender(input.gender);
|
|
19378
19555
|
const fixLeap = input.fixLeap !== false;
|
|
19379
19556
|
const isLeapMonth = input.isLeapMonth === true;
|
|
19380
|
-
const { astro } = await import("./lib-
|
|
19557
|
+
const { astro } = await import("./lib-62SWPXNF.js");
|
|
19381
19558
|
const rawChart = calendarType === "lunar" ? astro.byLunar(dateStr, timeIndex, gender, isLeapMonth, fixLeap, language) : astro.bySolar(dateStr, timeIndex, gender, fixLeap, language);
|
|
19382
19559
|
const palaces = rawChart.palaces.map((palace) => ({
|
|
19383
19560
|
index: palace.index,
|
|
@@ -19671,7 +19848,7 @@ var baseToolDefinitions = [
|
|
|
19671
19848
|
executor: updateUserPreferenceProfileFunc,
|
|
19672
19849
|
description: {
|
|
19673
19850
|
name: "updateUserPreferenceProfile",
|
|
19674
|
-
description: "\u4FDD\u5B58\u7528\u6237\u7684\
|
|
19851
|
+
description: "\u4FDD\u5B58\u7528\u6237\u7684\u5168\u5C40\u63D0\u793A\u8BCD\u7B49\u4E2A\u6027\u5316\u8BBE\u7F6E\u3002",
|
|
19675
19852
|
category: "\u7528\u6237\u8BBE\u7F6E / \u4E2A\u6027\u5316"
|
|
19676
19853
|
},
|
|
19677
19854
|
behavior: "action"
|
|
@@ -21394,6 +21571,7 @@ var findToolExecutor = (rawName) => {
|
|
|
21394
21571
|
};
|
|
21395
21572
|
|
|
21396
21573
|
export {
|
|
21574
|
+
selectMaxExecutionTime,
|
|
21397
21575
|
readXPostFunctionSchema,
|
|
21398
21576
|
readXPostFunc,
|
|
21399
21577
|
readXhsProfileFunctionSchema,
|