nolo-cli 0.229.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-VYCHHZVT.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-QWQKT54A.js → agentDeleteCommand-2RFGKFAB.js} +78 -70
- package/{agentEmailCommands-EISMBIRE.js → agentEmailCommands-GQCQKKOR.js} +85 -73
- package/{agentListCommands-4WLG32IW.js → agentListCommands-HSGLDPDQ.js} +40 -47
- package/{agentMachineCommands-DC6NKWTU.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-IZYUVHME.js → agentRecordCommands-AOXPGYAJ.js} +80 -68
- package/{agentRunCommand-QM7ETUTX.js → agentRunCommand-YTZJCRAL.js} +86 -73
- package/{agentRunControl-MBG4U6SL.js → agentRunControl-VBL7UFSG.js} +1 -1
- package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-T7BX2WGL.js} +24 -19
- package/{agentSlice-UG76KEBH.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-OZ2KTP4Z.js → authCommand-4CVBDADE.js} +15 -13
- package/{authCommands-55OGQGCR.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-XTJKU3Z4.js → chunk-3FBAVU2Y.js} +11 -9
- package/{chunk-ZH3KXFHS.js → chunk-4FIO2S7Z.js} +1 -1
- package/{chunk-MJI3UAXN.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-ZOHO6MOF.js → chunk-6WOLPIPY.js} +93 -90
- package/{chunk-6QHKRARD.js → chunk-6WZVM33D.js} +9 -4
- package/{chunk-DLXMMTGM.js → chunk-7AJRJGSQ.js} +260 -359
- package/chunk-7NIBQ4HY.js +138 -0
- package/{chunk-7Z6EW7AH.js → chunk-7TTMMOKH.js} +13 -6
- package/{chunk-CNMY2XM6.js → chunk-A3LUWRQK.js} +4 -4
- package/{chunk-4ZGPHFLE.js → chunk-A5EVA6HU.js} +2 -2
- package/{chunk-YVFH2MFB.js → chunk-AEQMKYZN.js} +4 -4
- package/{chunk-YKY4OVOX.js → chunk-AH5R7BYW.js} +13 -167
- 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-7BCG67EI.js → chunk-B7DE5XJW.js} +137 -290
- package/chunk-BEM6LPD2.js +734 -0
- package/{chunk-DUUDXSLX.js → chunk-BGGAY6OK.js} +27 -3
- package/{chunk-GAYNXB6T.js → chunk-BGGV6B5O.js} +416 -232
- 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-OTKSESZR.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-LYD6C7OU.js → chunk-DXW5WDHZ.js} +4 -4
- package/{chunk-MZG5CETE.js → chunk-E5KJOZWY.js} +3 -3
- package/{chunk-45CAVC35.js → chunk-E5KY7RAY.js} +565 -103
- package/{chunk-G7IUT2V3.js → chunk-EBKHA63G.js} +103 -12
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-DGYCDA6W.js → chunk-F3XI6WQP.js} +17 -10
- package/{chunk-M3OZRQNH.js → chunk-F6YWDVIB.js} +1 -1
- package/{chunk-3VZLEKV2.js → chunk-FFYE5ATM.js} +4 -4
- package/{chunk-HXB4VDGK.js → chunk-FZKA3XFA.js} +11 -11
- package/{chunk-MNEZUL5S.js → chunk-G22P367E.js} +31 -14
- package/{chunk-WFDNADFX.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-WCFFRBL5.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-TSPMLCWI.js → chunk-P3IZUMIC.js} +2 -2
- package/{chunk-FPBJM2BW.js → chunk-PGKA77TZ.js} +26 -20
- package/{chunk-4QYJPWHH.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-HF7BLF3F.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-EGHP7KOY.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-X3E6EHJW.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-FVYPE2IN.js → commandRegistry-FIXBZJHE.js} +89 -85
- package/{contentThunks-GNFPG32S.js → contentThunks-U6OC4R2N.js} +23 -22
- package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-U7XSRVJP.js} +1 -1
- package/{createAgentAutomationAction-PB4QIFQ4.js → createAgentAutomationAction-IP4LFN3W.js} +23 -22
- package/{createDialogAction-EVTOPY7A.js → createDialogAction-IAGQJ3LH.js} +24 -23
- package/{createPageAction-2UYF2IDZ.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-5EQ2A6LY.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-OKKIKLT3.js → docStore-GIVRT7TQ.js} +10 -9
- package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-VETKSUDD.js} +26 -22
- package/{handleSendMessageAction-LNT7SZND.js → handleSendMessageAction-HKIW4ZNO.js} +48 -45
- package/{hostCredentialCreate-XUU2CSHI.js → hostCredentialCreate-6VDJFNDO.js} +82 -69
- package/index.js +8 -8
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localRuntimeAdapter-IBSTMSX7.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-HSQHDHOT.js → machineCommands-K6XIGOAD.js} +78 -66
- package/{machineWsRunDispatch-L6H7J66T.js → machineWsRunDispatch-4OO7Z6UM.js} +78 -66
- 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-FQO654Z3.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-7U272DSA.js → readlineWorkspace-XMPGXR77.js} +2946 -2367
- package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-CX3OAH4Y.js} +14 -13
- package/{runAgentClientLoop-AF4JQIJ7.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-5VNWMDBE.js → spaceCommands-G63QGYQO.js} +26 -22
- package/{streamAgentChatTurn-YSPEFY4K.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-M35PTIFB.js → tools-7RSX22FT.js} +41 -37
- package/{tuiRestart-2IL37YIB.js → tuiRestart-KAAA7TND.js} +2 -2
- package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-BVNHMWLR.js} +6 -6
- package/{updateCommands-CPATDG6J.js → updateCommands-ASK5XYPH.js} +3 -3
- package/{updateDialogTitleAction-IMIRJRQQ.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
|
@@ -1,75 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildStaticUserPolicyContext,
|
|
3
|
-
resolveSpaceContextPreloadPlan
|
|
4
|
-
} from "./chunk-ZXF6D3I6.js";
|
|
5
1
|
import {
|
|
6
2
|
fetchReferenceContents,
|
|
7
3
|
mergeReferences,
|
|
8
4
|
resolveReferenceAssets,
|
|
9
5
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y5OWZQMJ.js";
|
|
11
7
|
import {
|
|
12
8
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
9
|
getAllToolRuns,
|
|
14
10
|
parseUiCard,
|
|
15
|
-
selectAiRecentContentLimit,
|
|
16
|
-
selectGlobalPrompt,
|
|
17
|
-
selectKnowledgeCaptureLevel,
|
|
18
|
-
selectSpaceContextLevel,
|
|
19
|
-
selectUserTonePreset,
|
|
20
11
|
uiCardFallback
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
resolveToolBaseUrl
|
|
24
|
-
} from "./chunk-4JVNURX4.js";
|
|
12
|
+
} from "./chunk-VREG6ANQ.js";
|
|
25
13
|
import {
|
|
26
14
|
getDocState
|
|
27
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DXW5WDHZ.js";
|
|
16
|
+
import {
|
|
17
|
+
resolveToolBaseUrl
|
|
18
|
+
} from "./chunk-XS5A3EKX.js";
|
|
28
19
|
import {
|
|
29
20
|
getTableState
|
|
30
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FZKA3XFA.js";
|
|
31
22
|
import {
|
|
32
23
|
getCurrentSpaceIdRaw,
|
|
33
24
|
getViewMode
|
|
34
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IUTUWIKE.js";
|
|
35
26
|
import {
|
|
36
|
-
PERSONALIZATION_DIALOG_CATEGORY,
|
|
37
|
-
buildPersonalizationDialogPolicyContext,
|
|
38
27
|
selectAllMsgs
|
|
39
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-B7DE5XJW.js";
|
|
40
29
|
import {
|
|
41
30
|
selectPendingFiles
|
|
42
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-I2OYPD3Y.js";
|
|
43
32
|
import {
|
|
44
|
-
read,
|
|
45
33
|
selectById
|
|
46
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RM4UMFY4.js";
|
|
47
35
|
import {
|
|
48
36
|
getSessionSnapshotForState,
|
|
49
37
|
selectIdentityUserBalance,
|
|
50
38
|
selectIdentityUserId
|
|
51
39
|
} from "./chunk-PXYBUFDB.js";
|
|
52
|
-
import {
|
|
53
|
-
getFinalPrice,
|
|
54
|
-
getModelPricing,
|
|
55
|
-
getPrices,
|
|
56
|
-
hasExplicitAgentPricing
|
|
57
|
-
} from "./chunk-SRCCSTIM.js";
|
|
58
40
|
import {
|
|
59
41
|
projectToolMessageContent
|
|
60
42
|
} from "./chunk-WFGNWWJI.js";
|
|
61
43
|
import {
|
|
62
44
|
resolveAgentRecommendedSkillNames,
|
|
63
45
|
resolveAgentRequiredPackIds
|
|
64
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-MM73SP4K.js";
|
|
65
47
|
import {
|
|
66
48
|
attachmentKind,
|
|
67
49
|
extractReferenceKeysFromMessage,
|
|
68
50
|
normalizeAttachmentPart
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import {
|
|
71
|
-
getModelContextWindow
|
|
72
|
-
} from "./chunk-L32W3PRP.js";
|
|
51
|
+
} from "./chunk-DNZ4JJ7C.js";
|
|
73
52
|
import {
|
|
74
53
|
asRecordOrEmpty
|
|
75
54
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -82,10 +61,11 @@ import {
|
|
|
82
61
|
applyDefaultWebToolPacks,
|
|
83
62
|
applyDisabledTools,
|
|
84
63
|
applySystemBuiltinSkillFilter,
|
|
64
|
+
dedupeSkillPromptPatches,
|
|
85
65
|
expandEnabledPackPromptPatches,
|
|
86
66
|
expandEnabledPacks,
|
|
87
67
|
resolveEffectiveEnabledPacks
|
|
88
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-EBKHA63G.js";
|
|
89
69
|
import {
|
|
90
70
|
canonicalizeToolNames,
|
|
91
71
|
prioritizeToolNames
|
|
@@ -100,9 +80,11 @@ import {
|
|
|
100
80
|
asNonEmptyStringArray
|
|
101
81
|
} from "./chunk-I42VC5KR.js";
|
|
102
82
|
import {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
83
|
+
getFinalPrice,
|
|
84
|
+
getModelPricing,
|
|
85
|
+
getPrices,
|
|
86
|
+
hasExplicitAgentPricing
|
|
87
|
+
} from "./chunk-SRCCSTIM.js";
|
|
106
88
|
import {
|
|
107
89
|
asTrimmedString
|
|
108
90
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -356,12 +338,12 @@ function parseShellToolTextContent(content) {
|
|
|
356
338
|
...typeof exitCode === "number" && Number.isFinite(exitCode) ? { exitCode } : {}
|
|
357
339
|
};
|
|
358
340
|
}
|
|
359
|
-
function resolveShellCommand(
|
|
360
|
-
return asOptionalTrimmedString(
|
|
341
|
+
function resolveShellCommand(metadata2, argumentsPreview) {
|
|
342
|
+
return asOptionalTrimmedString(metadata2.command) || asOptionalTrimmedString(metadata2.cmd) || asOptionalTrimmedString(argumentsPreview) || "";
|
|
361
343
|
}
|
|
362
344
|
function projectDesktopToolUiContent(args) {
|
|
363
345
|
const toolName = asOptionalTrimmedString(args.toolName) || "tool";
|
|
364
|
-
const
|
|
346
|
+
const metadata2 = isRecord(args.metadata) ? args.metadata : {};
|
|
365
347
|
const rawContent = typeof args.content === "string" ? args.content : typeof args.summary === "string" ? args.summary : typeof args.message === "string" ? args.message : "";
|
|
366
348
|
if (toolName === "show_interaction") {
|
|
367
349
|
try {
|
|
@@ -388,36 +370,36 @@ function projectDesktopToolUiContent(args) {
|
|
|
388
370
|
if (toolName === "execShell") {
|
|
389
371
|
const existing = tryParseJsonRecord(rawContent);
|
|
390
372
|
if (existing && (typeof existing.stdout === "string" || typeof existing.command === "string" || typeof existing.stderr === "string")) {
|
|
391
|
-
const command2 = asOptionalTrimmedString(existing.command) || resolveShellCommand(
|
|
373
|
+
const command2 = asOptionalTrimmedString(existing.command) || resolveShellCommand(metadata2, args.argumentsPreview);
|
|
392
374
|
return JSON.stringify({
|
|
393
375
|
...existing,
|
|
394
376
|
command: command2,
|
|
395
|
-
cwd: asOptionalTrimmedString(existing.cwd) || asOptionalTrimmedString(
|
|
396
|
-
exitCode: asOptionalFiniteNumber(existing.exitCode) ?? asOptionalFiniteNumber(
|
|
377
|
+
cwd: asOptionalTrimmedString(existing.cwd) || asOptionalTrimmedString(metadata2.cwd) || null,
|
|
378
|
+
exitCode: asOptionalFiniteNumber(existing.exitCode) ?? asOptionalFiniteNumber(metadata2.exitCode)
|
|
397
379
|
});
|
|
398
380
|
}
|
|
399
381
|
const parsed = parseShellToolTextContent(rawContent);
|
|
400
|
-
const command = resolveShellCommand(
|
|
382
|
+
const command = resolveShellCommand(metadata2, args.argumentsPreview);
|
|
401
383
|
return JSON.stringify({
|
|
402
384
|
command,
|
|
403
|
-
cwd: asOptionalTrimmedString(
|
|
385
|
+
cwd: asOptionalTrimmedString(metadata2.cwd) || null,
|
|
404
386
|
stdout: clipUiText(parsed.stdout),
|
|
405
387
|
stderr: clipUiText(parsed.stderr),
|
|
406
|
-
exitCode: asOptionalFiniteNumber(
|
|
407
|
-
timedOut:
|
|
408
|
-
blocked:
|
|
388
|
+
exitCode: asOptionalFiniteNumber(metadata2.exitCode) ?? parsed.exitCode,
|
|
389
|
+
timedOut: metadata2.timedOut === true,
|
|
390
|
+
blocked: metadata2.blocked === true
|
|
409
391
|
});
|
|
410
392
|
}
|
|
411
393
|
if (toolName === "readFile" || toolName === "read_file") {
|
|
412
|
-
const filePath = asOptionalTrimmedString(
|
|
394
|
+
const filePath = asOptionalTrimmedString(metadata2.path) || asOptionalTrimmedString(metadata2.filePath) || asOptionalTrimmedString(metadata2.file_path) || asOptionalTrimmedString(args.argumentsPreview) || "";
|
|
413
395
|
const body = typeof args.content === "string" && args.content || typeof args.summary === "string" && args.summary || typeof args.message === "string" && args.message || "";
|
|
414
396
|
return JSON.stringify({
|
|
415
397
|
filePath,
|
|
416
398
|
content: clipUiText(body),
|
|
417
|
-
...asOptionalFiniteNumber(
|
|
418
|
-
...asOptionalFiniteNumber(
|
|
419
|
-
...asOptionalFiniteNumber(
|
|
420
|
-
...
|
|
399
|
+
...asOptionalFiniteNumber(metadata2.startLine) != null ? { startLine: asOptionalFiniteNumber(metadata2.startLine) } : {},
|
|
400
|
+
...asOptionalFiniteNumber(metadata2.endLine) != null ? { endLine: asOptionalFiniteNumber(metadata2.endLine) } : {},
|
|
401
|
+
...asOptionalFiniteNumber(metadata2.totalLines) != null ? { totalLines: asOptionalFiniteNumber(metadata2.totalLines) } : {},
|
|
402
|
+
...metadata2.truncated === true ? { truncated: true } : {}
|
|
421
403
|
});
|
|
422
404
|
}
|
|
423
405
|
const preferred = typeof args.content === "string" && args.content || typeof args.summary === "string" && args.summary || typeof args.message === "string" && args.message || "";
|
|
@@ -633,17 +615,26 @@ var deduplicateContextKeys = (keys) => {
|
|
|
633
615
|
};
|
|
634
616
|
};
|
|
635
617
|
|
|
618
|
+
// packages/ai/policy/runtimePolicy.ts
|
|
619
|
+
var buildStaticUserPolicyContext = (params) => {
|
|
620
|
+
return [
|
|
621
|
+
"\u4E3B\u52A8\u53D1\u73B0\u503C\u5F97\u4FDD\u5B58\u7684\u7ED3\u679C\u5E76\u63D0\u51FA\u7B80\u77ED\u5177\u4F53\u7684\u5EFA\u8BAE\uFF1B\u6301\u4E45\u4FDD\u5B58\u524D\u6309\u73B0\u6709\u6743\u9650\u8FB9\u754C\u53D6\u5F97\u7528\u6237\u540C\u610F\uFF0C\u5DF2\u6709\u660E\u786E\u6388\u6743\u6309\u5176\u8303\u56F4\u6267\u884C\u3002",
|
|
622
|
+
"\u6309\u4EFB\u52A1\u9700\u8981\u8BFB\u53D6\u5F53\u524D\u5DF2\u6388\u6743\u7A7A\u95F4\u7684\u5FC5\u8981\u5185\u5BB9\uFF1B\u9075\u5B88\u672C\u8F6E\u4E0D\u8BFB\u8981\u6C42\uFF0C\u8BBF\u95EE\u88AB\u62D2\u7EDD\u65F6\u505C\u6B62\uFF0C\u4E0D\u7ED5\u8FC7\u6743\u9650\u3002",
|
|
623
|
+
"\u8BF7\u5C3D\u91CF\u4FDD\u7559 agent \u81EA\u8EAB\u89D2\u8272\u8BBE\u5B9A\uFF0C\u540C\u65F6\u6309\u7528\u6237\u504F\u597D\u8C03\u6574\u8868\u8FBE\u548C\u81EA\u52A8\u5316\u7A0B\u5EA6\u3002"
|
|
624
|
+
].join("\n");
|
|
625
|
+
};
|
|
626
|
+
|
|
636
627
|
// packages/ai/agent/canvasEditingContext.ts
|
|
637
628
|
function buildCanvasNodeEditingContextSummary(runtimeOptions) {
|
|
638
629
|
if (runtimeOptions?.editingTarget?.kind !== "canvas_node") return null;
|
|
639
630
|
const editingTarget = runtimeOptions.editingTarget;
|
|
640
|
-
const
|
|
641
|
-
const selectedNodeId = typeof
|
|
642
|
-
const part = typeof
|
|
643
|
-
const nodeType = typeof
|
|
644
|
-
const path = Array.isArray(
|
|
645
|
-
const props = asRecordOrEmpty(
|
|
646
|
-
const style = asRecordOrEmpty(
|
|
631
|
+
const metadata2 = editingTarget.metadata ?? {};
|
|
632
|
+
const selectedNodeId = typeof metadata2.selectedNodeId === "string" ? metadata2.selectedNodeId : editingTarget.key ?? "(\u672A\u77E5\u8282\u70B9)";
|
|
633
|
+
const part = typeof metadata2.part === "string" ? metadata2.part : editingTarget.title ?? selectedNodeId;
|
|
634
|
+
const nodeType = typeof metadata2.type === "string" ? metadata2.type : "(\u672A\u77E5\u7C7B\u578B)";
|
|
635
|
+
const path = Array.isArray(metadata2.path) ? metadata2.path.filter((item) => typeof item === "string") : [];
|
|
636
|
+
const props = asRecordOrEmpty(metadata2.props);
|
|
637
|
+
const style = asRecordOrEmpty(metadata2.style);
|
|
647
638
|
return [
|
|
648
639
|
"\u5F53\u524D\u7F16\u8F91\u76EE\u6807\uFF1ACanvas Tree \u4E2D\u7684\u4E00\u4E2A\u9009\u4E2D\u8282\u70B9\u3002",
|
|
649
640
|
`- \u8282\u70B9 ID: ${selectedNodeId}`,
|
|
@@ -768,9 +759,9 @@ var formatAppConstraintPacks = (packs) => {
|
|
|
768
759
|
};
|
|
769
760
|
function resolveEditingTargetTableIdentity(editingTarget) {
|
|
770
761
|
if (!editingTarget || editingTarget.kind !== "table") return null;
|
|
771
|
-
const
|
|
772
|
-
const tenantId = typeof editingTarget.tenantId === "string" && editingTarget.tenantId || typeof
|
|
773
|
-
const tableId = typeof editingTarget.tableId === "string" && editingTarget.tableId || typeof
|
|
762
|
+
const metadata2 = editingTarget.metadata;
|
|
763
|
+
const tenantId = typeof editingTarget.tenantId === "string" && editingTarget.tenantId || typeof metadata2?.tenantId === "string" && metadata2.tenantId || void 0;
|
|
764
|
+
const tableId = typeof editingTarget.tableId === "string" && editingTarget.tableId || typeof metadata2?.tableId === "string" && metadata2.tableId || void 0;
|
|
774
765
|
if (!tenantId || !tableId) return null;
|
|
775
766
|
return { tenantId, tableId };
|
|
776
767
|
}
|
|
@@ -805,8 +796,8 @@ var buildEditingContextSummary = (state, runtimeOptions) => {
|
|
|
805
796
|
(entity) => entity?.type === "table_row" /* TABLE_ROW */ && entity?.tenantId === tenantId && entity?.tableId === tableId && !entity?.deletedAt
|
|
806
797
|
);
|
|
807
798
|
}
|
|
808
|
-
const
|
|
809
|
-
const focusContext =
|
|
799
|
+
const metadata2 = editingTarget?.metadata;
|
|
800
|
+
const focusContext = metadata2 && typeof metadata2 === "object" ? metadata2.focusContext : null;
|
|
810
801
|
if (!table) return null;
|
|
811
802
|
const columns = Array.isArray(table.columns) ? table.columns : [];
|
|
812
803
|
const columnSummaries = columns.length ? columns.map((c) => {
|
|
@@ -857,8 +848,8 @@ var buildEditingContextSummary = (state, runtimeOptions) => {
|
|
|
857
848
|
}
|
|
858
849
|
if (targetKind === "page" || targetKind === "article") {
|
|
859
850
|
const page = getDocState();
|
|
860
|
-
const
|
|
861
|
-
const focusContext =
|
|
851
|
+
const metadata2 = runtimeOptions?.editingTarget?.metadata;
|
|
852
|
+
const focusContext = metadata2 && typeof metadata2 === "object" ? metadata2.focusContext : null;
|
|
862
853
|
if (!page) return null;
|
|
863
854
|
const title = page.title ?? "(\u672A\u547D\u540D\u9875\u9762)";
|
|
864
855
|
return [
|
|
@@ -879,17 +870,17 @@ var buildEditingContextSummary = (state, runtimeOptions) => {
|
|
|
879
870
|
}
|
|
880
871
|
if (targetKind === "app") {
|
|
881
872
|
const editingTarget = runtimeOptions?.editingTarget;
|
|
882
|
-
const
|
|
873
|
+
const metadata2 = editingTarget?.metadata;
|
|
883
874
|
const appId = editingTarget?.key ?? "(\u672A\u77E5 appId)";
|
|
884
875
|
const title = editingTarget?.title ?? "(\u672A\u547D\u540D\u5E94\u7528)";
|
|
885
|
-
const framework = typeof
|
|
886
|
-
const appUrl = typeof
|
|
887
|
-
const fileNames = Array.isArray(
|
|
888
|
-
const externalImports = Array.isArray(
|
|
876
|
+
const framework = typeof metadata2?.framework === "string" ? metadata2.framework : "worker";
|
|
877
|
+
const appUrl = typeof metadata2?.appUrl === "string" ? metadata2.appUrl : null;
|
|
878
|
+
const fileNames = Array.isArray(metadata2?.fileNames) ? metadata2.fileNames.filter((name) => typeof name === "string") : [];
|
|
879
|
+
const externalImports = Array.isArray(metadata2?.externalImports) ? metadata2.externalImports.filter(
|
|
889
880
|
(name) => typeof name === "string"
|
|
890
881
|
) : [];
|
|
891
882
|
const sourceSummary = asOptionalTrimmedString(editingTarget?.summary) ?? null;
|
|
892
|
-
const selectedNode =
|
|
883
|
+
const selectedNode = metadata2 && typeof metadata2 === "object" && metadata2.selectedNode && typeof metadata2.selectedNode === "object" ? metadata2.selectedNode : null;
|
|
893
884
|
const constraintPacks = buildAppConstraintPacks({
|
|
894
885
|
framework,
|
|
895
886
|
fileNames,
|
|
@@ -942,8 +933,8 @@ var buildEditingContextSummary = (state, runtimeOptions) => {
|
|
|
942
933
|
].join("\n");
|
|
943
934
|
}
|
|
944
935
|
if (targetKind === "local_preview") {
|
|
945
|
-
const
|
|
946
|
-
const selectedNode =
|
|
936
|
+
const metadata2 = runtimeOptions?.editingTarget?.metadata;
|
|
937
|
+
const selectedNode = metadata2 && typeof metadata2 === "object" && metadata2.selectedNode && typeof metadata2.selectedNode === "object" ? metadata2.selectedNode : null;
|
|
947
938
|
if (!selectedNode) return null;
|
|
948
939
|
const readString = (key) => typeof selectedNode[key] === "string" ? selectedNode[key] : "";
|
|
949
940
|
const tagName = readString("tagName") || "\u5143\u7D20";
|
|
@@ -966,12 +957,12 @@ var buildEditingContextSummary = (state, runtimeOptions) => {
|
|
|
966
957
|
}
|
|
967
958
|
if (targetKind === "image" || targetKind === "file") {
|
|
968
959
|
const editingTarget = runtimeOptions?.editingTarget;
|
|
969
|
-
const
|
|
960
|
+
const metadata2 = editingTarget?.metadata;
|
|
970
961
|
const title = editingTarget?.title ?? "(\u672A\u547D\u540D\u5BF9\u8C61)";
|
|
971
962
|
const objectKey = editingTarget?.key ?? "(\u672A\u77E5 key)";
|
|
972
|
-
const fileId = typeof
|
|
973
|
-
const url = typeof
|
|
974
|
-
const size = typeof
|
|
963
|
+
const fileId = typeof metadata2?.fileId === "string" ? metadata2.fileId : null;
|
|
964
|
+
const url = typeof metadata2?.url === "string" ? metadata2.url : null;
|
|
965
|
+
const size = typeof metadata2?.size === "number" ? metadata2.size : null;
|
|
975
966
|
return [
|
|
976
967
|
`\u5F53\u524D\u7F16\u8F91\u76EE\u6807\uFF1A\u4E00\u4E2A${targetKind === "image" ? "\u56FE\u7247" : "\u6587\u4EF6"}\u5BF9\u8C61\uFF08Editing ${targetKind === "image" ? "Image" : "File"}\uFF09\u3002`,
|
|
977
968
|
`- \u5BF9\u8C61 key: ${objectKey}`,
|
|
@@ -989,10 +980,10 @@ var buildEditingContextSummary = (state, runtimeOptions) => {
|
|
|
989
980
|
}
|
|
990
981
|
if (targetKind === "artifact" || targetKind === "html_artifact") {
|
|
991
982
|
const editingTarget = runtimeOptions?.editingTarget;
|
|
992
|
-
const
|
|
993
|
-
const artifactId = typeof editingTarget?.key === "string" && editingTarget.key ? editingTarget.key : typeof
|
|
994
|
-
const title = editingTarget?.title ?? (typeof
|
|
995
|
-
const dialogKey = typeof
|
|
983
|
+
const metadata2 = editingTarget?.metadata;
|
|
984
|
+
const artifactId = typeof editingTarget?.key === "string" && editingTarget.key ? editingTarget.key : typeof metadata2?.artifactId === "string" ? metadata2.artifactId : typeof editingTarget?.artifactId === "string" ? editingTarget.artifactId : null;
|
|
985
|
+
const title = editingTarget?.title ?? (typeof metadata2?.title === "string" ? metadata2.title : "HTML \u7F51\u9875\u6210\u54C1");
|
|
986
|
+
const dialogKey = typeof metadata2?.dialogKey === "string" ? metadata2.dialogKey : typeof editingTarget?.dialogKey === "string" ? editingTarget.dialogKey : null;
|
|
996
987
|
return [
|
|
997
988
|
"\u5F53\u524D\u7F16\u8F91\u76EE\u6807\uFF1A\u5355\u6587\u4EF6 HTML \u7F51\u9875\u6210\u54C1\uFF08Editing HTML Artifact\uFF09\u3002",
|
|
998
989
|
...artifactId ? [`- \u6210\u54C1 ID (artifactId): ${artifactId}`] : ["- \u6210\u54C1 ID: (\u65B0\u5EFA\u4E2D\u6216\u672A\u6307\u5B9A)"],
|
|
@@ -1137,12 +1128,6 @@ var compressOldToolResults = (messages) => {
|
|
|
1137
1128
|
return { ...msg, content: projected };
|
|
1138
1129
|
});
|
|
1139
1130
|
};
|
|
1140
|
-
var createDbSliceTurnContextSource = (dispatch) => ({
|
|
1141
|
-
readRecord: async (dbKey) => {
|
|
1142
|
-
const result = await dispatch(read({ dbKey })).unwrap();
|
|
1143
|
-
return result ?? null;
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
1131
|
var joinMapValues = (map) => Array.from(map.values()).join("");
|
|
1147
1132
|
var formatCurrentInputContext = (pendingFiles, currentInputMap) => {
|
|
1148
1133
|
if (pendingFiles.length === 0 || currentInputMap.size === 0) {
|
|
@@ -1295,55 +1280,14 @@ var buildStaticContexts = async (state, dispatch, agentConfig, dialogConfig, ref
|
|
|
1295
1280
|
fetchReferences(finalKeys.botInstructionsContext),
|
|
1296
1281
|
fetchReferences(finalKeys.botKnowledgeContext)
|
|
1297
1282
|
]);
|
|
1298
|
-
const
|
|
1299
|
-
const
|
|
1300
|
-
const knowledgeCaptureLevel = selectKnowledgeCaptureLevel(state);
|
|
1301
|
-
const spaceContextLevel = selectSpaceContextLevel(state);
|
|
1302
|
-
const userRecentLimit = selectAiRecentContentLimit(state);
|
|
1303
|
-
const contextWindow = getModelContextWindow(agentConfig.model) || 128e3;
|
|
1304
|
-
const preloadPlan = resolveSpaceContextPreloadPlan(spaceContextLevel);
|
|
1305
|
-
const dynamicLimit = Math.floor(contextWindow * preloadPlan.preloadBudgetRatio / 150);
|
|
1306
|
-
const recentLimit = preloadPlan.includeRecentContent ? Math.max(3, Math.min(userRecentLimit, Math.max(3, dynamicLimit))) : 0;
|
|
1307
|
-
const turnContextSource = createDbSliceTurnContextSource(dispatch);
|
|
1308
|
-
let spaceContext = null;
|
|
1309
|
-
if (spaceContextLevel > 1) {
|
|
1310
|
-
const spaceLayer = await buildSpaceContextLayer({
|
|
1311
|
-
source: turnContextSource,
|
|
1312
|
-
spaceId: dialogConfig?.spaceId,
|
|
1313
|
-
recentContentLimit: recentLimit
|
|
1314
|
-
});
|
|
1315
|
-
spaceContext = spaceLayer ? spaceLayer.content.trim() : null;
|
|
1316
|
-
}
|
|
1317
|
-
const linkedSpaceIds = agentConfig.linkedSpaces || [];
|
|
1318
|
-
if (linkedSpaceIds.length > 0 && spaceContextLevel > 1) {
|
|
1319
|
-
const linkedSection = await buildLinkedSpacesSection({
|
|
1320
|
-
source: turnContextSource,
|
|
1321
|
-
linkedSpaceIds
|
|
1322
|
-
});
|
|
1323
|
-
if (linkedSection) {
|
|
1324
|
-
spaceContext = (spaceContext ?? "") + `
|
|
1325
|
-
|
|
1326
|
-
${linkedSection}`;
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
const dialogPolicyContext = dialogConfig?.category === PERSONALIZATION_DIALOG_CATEGORY ? buildPersonalizationDialogPolicyContext() : null;
|
|
1283
|
+
const spaceContext = null;
|
|
1284
|
+
const globalPrompt = null;
|
|
1330
1285
|
return {
|
|
1331
1286
|
botInstructionsContext: joinMapValues(botInstructionsMap),
|
|
1332
1287
|
botKnowledgeContext: joinMapValues(botKnowledgeMap),
|
|
1333
1288
|
spaceContext,
|
|
1334
1289
|
userGlobalPrompt: globalPrompt,
|
|
1335
|
-
userPolicyContext:
|
|
1336
|
-
buildStaticUserPolicyContext({
|
|
1337
|
-
agentConfig,
|
|
1338
|
-
settingsRecord: {
|
|
1339
|
-
userTonePreset,
|
|
1340
|
-
knowledgeCaptureLevel,
|
|
1341
|
-
spaceContextLevel,
|
|
1342
|
-
enableReadCurrentSpace: spaceContextLevel > 1
|
|
1343
|
-
}
|
|
1344
|
-
}),
|
|
1345
|
-
dialogPolicyContext
|
|
1346
|
-
].filter(Boolean).join("\n")
|
|
1290
|
+
userPolicyContext: buildStaticUserPolicyContext({ agentConfig })
|
|
1347
1291
|
};
|
|
1348
1292
|
};
|
|
1349
1293
|
var buildDynamicContexts = async (state, dispatch, agentConfig, userInput, runtimeOptions, referenceContentCache, dialogKey) => {
|
|
@@ -1454,15 +1398,21 @@ var mergeAgentToolsWithRuntime = (agentConfig, referencedTools, mentionedTools,
|
|
|
1454
1398
|
...userSkills?.recommendedSkillHints ?? []
|
|
1455
1399
|
])
|
|
1456
1400
|
];
|
|
1401
|
+
const runtimeBaseSkillPromptContributions = agentConfig.runtimeBaseSkillPromptContributions ?? agentConfig.skillPromptContributions ?? [];
|
|
1402
|
+
const runtimeBaseSkillPromptPatches = agentConfig.runtimeBaseSkillPromptPatches ?? (agentConfig.skillPromptContributions !== void 0 ? [] : asNonEmptyStringArray(agentConfig.skillPromptPatches));
|
|
1403
|
+
const skillPromptContributions = dedupeSkillPromptPatches([
|
|
1404
|
+
...runtimeBaseSkillPromptContributions,
|
|
1405
|
+
...userSkills?.skillPromptContributions ?? []
|
|
1406
|
+
]);
|
|
1457
1407
|
const skillPromptPatches = [
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
]
|
|
1408
|
+
...runtimeBaseSkillPromptPatches,
|
|
1409
|
+
// 能力包的 promptPatch(方法论文档)与 skill reference 的 patch 走同一条
|
|
1410
|
+
// 注入链(buildSkillGuidanceBlock → buildSkillGuidancePromptBlock),
|
|
1411
|
+
// 让「工具 + 配套纪律」作为一个能力包整体注入 system prompt。
|
|
1412
|
+
...expandEnabledPackPromptPatches(effectiveEnabledPacks),
|
|
1413
|
+
...skillPromptContributions.map((patch) => patch.content),
|
|
1414
|
+
// Legacy callers with no identity metadata remain unmodified prose.
|
|
1415
|
+
...userSkills?.skillPromptContributions === void 0 ? userSkillPromptPatches : []
|
|
1466
1416
|
];
|
|
1467
1417
|
const webPadded = applyDefaultWebToolPacks({
|
|
1468
1418
|
toolNames: baseTools,
|
|
@@ -1507,7 +1457,10 @@ var mergeAgentToolsWithRuntime = (agentConfig, referencedTools, mentionedTools,
|
|
|
1507
1457
|
),
|
|
1508
1458
|
recommendedSkillTools,
|
|
1509
1459
|
recommendedSkillHints,
|
|
1510
|
-
skillPromptPatches
|
|
1460
|
+
skillPromptPatches,
|
|
1461
|
+
runtimeBaseSkillPromptPatches,
|
|
1462
|
+
runtimeBaseSkillPromptContributions,
|
|
1463
|
+
skillPromptContributions
|
|
1511
1464
|
};
|
|
1512
1465
|
};
|
|
1513
1466
|
var applyImageConfigRuntimeOverride = (agentConfig, runtimeOptions) => {
|
|
@@ -1718,7 +1671,8 @@ async function resolveTurnToolContext(input) {
|
|
|
1718
1671
|
referencedTools: refAssets.referencedTools,
|
|
1719
1672
|
recommendedSkillTools: refAssets.recommendedSkillTools,
|
|
1720
1673
|
recommendedSkillHints: refAssets.recommendedSkillHints,
|
|
1721
|
-
skillPromptPatches: refAssets.skillPromptPatches
|
|
1674
|
+
skillPromptPatches: refAssets.skillPromptPatches,
|
|
1675
|
+
skillPromptContributions: refAssets.skillPromptContributions
|
|
1722
1676
|
};
|
|
1723
1677
|
const keySets = await getFullChatContextKeys(
|
|
1724
1678
|
input.state,
|
|
@@ -1775,10 +1729,11 @@ async function resolveTurnToolContext(input) {
|
|
|
1775
1729
|
...refAssets.recommendedSkillHints ?? [],
|
|
1776
1730
|
...contextToolsResult.recommendedSkillHints ?? []
|
|
1777
1731
|
];
|
|
1778
|
-
const
|
|
1779
|
-
...refAssets.
|
|
1780
|
-
...contextToolsResult.
|
|
1781
|
-
];
|
|
1732
|
+
const skillPromptContributions = dedupeSkillPromptPatches([
|
|
1733
|
+
...refAssets.skillPromptContributions ?? [],
|
|
1734
|
+
...contextToolsResult.skillPromptContributions ?? []
|
|
1735
|
+
]);
|
|
1736
|
+
const skillPromptPatches = skillPromptContributions.map((patch) => patch.content);
|
|
1782
1737
|
return {
|
|
1783
1738
|
referencedToolNames,
|
|
1784
1739
|
attachmentToolNames,
|
|
@@ -1791,6 +1746,7 @@ async function resolveTurnToolContext(input) {
|
|
|
1791
1746
|
recommendedSkillTools,
|
|
1792
1747
|
recommendedSkillHints,
|
|
1793
1748
|
skillPromptPatches,
|
|
1749
|
+
skillPromptContributions,
|
|
1794
1750
|
referenceContentCache: refAssets.contentByKey,
|
|
1795
1751
|
mergedContentCache: new Map([
|
|
1796
1752
|
...refAssets.contentByKey,
|
|
@@ -1809,6 +1765,8 @@ function targetForRunKind(kind, ctx = {}) {
|
|
|
1809
1765
|
var NEEDS_LOGIN_MESSAGE = "\u9700\u8981\u767B\u5F55\u540E\u624D\u80FD\u5904\u7406\u8BE5\u6388\u6743\u8BF7\u6C42";
|
|
1810
1766
|
var gates = /* @__PURE__ */ new Map();
|
|
1811
1767
|
var targets = /* @__PURE__ */ new Map();
|
|
1768
|
+
var failures = /* @__PURE__ */ new Map();
|
|
1769
|
+
var metadata = /* @__PURE__ */ new Map();
|
|
1812
1770
|
var errors = /* @__PURE__ */ new Map();
|
|
1813
1771
|
var listeners = /* @__PURE__ */ new Set();
|
|
1814
1772
|
var cachedSnapshot = null;
|
|
@@ -1823,22 +1781,41 @@ function notify() {
|
|
|
1823
1781
|
}
|
|
1824
1782
|
}
|
|
1825
1783
|
}
|
|
1826
|
-
function pushGate(gate, target = { kind: "desktop" }) {
|
|
1784
|
+
function pushGate(gate, target = { kind: "desktop" }, meta) {
|
|
1827
1785
|
if (!gate || typeof gate.id !== "string" || gate.id.length === 0) return;
|
|
1786
|
+
failures.delete(gate.id);
|
|
1828
1787
|
if (target.kind === "web" && !target.token) {
|
|
1788
|
+
if (meta) failures.set(gate.id, { gateId: gate.id, meta: { ...meta, storage: "web" }, message: NEEDS_LOGIN_MESSAGE });
|
|
1829
1789
|
gates.delete(gate.id);
|
|
1830
1790
|
targets.delete(gate.id);
|
|
1791
|
+
metadata.delete(gate.id);
|
|
1831
1792
|
errors.set(gate.id, NEEDS_LOGIN_MESSAGE);
|
|
1832
1793
|
invalidateSnapshot();
|
|
1833
1794
|
notify();
|
|
1834
1795
|
return;
|
|
1835
1796
|
}
|
|
1797
|
+
metadata.delete(gate.id);
|
|
1798
|
+
if (meta && target.kind !== "local") metadata.set(gate.id, { ...meta, storage: target.kind });
|
|
1836
1799
|
errors.delete(gate.id);
|
|
1837
1800
|
targets.set(gate.id, target);
|
|
1838
1801
|
gates.set(gate.id, gate);
|
|
1839
1802
|
invalidateSnapshot();
|
|
1840
1803
|
notify();
|
|
1841
1804
|
}
|
|
1805
|
+
function clearGateTurn(turnId) {
|
|
1806
|
+
for (const [id, failure] of failures) {
|
|
1807
|
+
if (failure.meta.turnId === turnId) failures.delete(id);
|
|
1808
|
+
}
|
|
1809
|
+
for (const [id, meta] of metadata) {
|
|
1810
|
+
if (meta.turnId !== turnId) continue;
|
|
1811
|
+
gates.delete(id);
|
|
1812
|
+
targets.delete(id);
|
|
1813
|
+
metadata.delete(id);
|
|
1814
|
+
errors.delete(id);
|
|
1815
|
+
}
|
|
1816
|
+
invalidateSnapshot();
|
|
1817
|
+
notify();
|
|
1818
|
+
}
|
|
1842
1819
|
|
|
1843
1820
|
export {
|
|
1844
1821
|
buildForegroundTurnAdmissionFetchInit,
|
|
@@ -1855,5 +1832,6 @@ export {
|
|
|
1855
1832
|
resolveImageGenerationStreamingState,
|
|
1856
1833
|
resolveTurnToolContext,
|
|
1857
1834
|
targetForRunKind,
|
|
1858
|
-
pushGate
|
|
1835
|
+
pushGate,
|
|
1836
|
+
clearGateTurn
|
|
1859
1837
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isTombstoneRecord
|
|
3
|
+
} from "./chunk-BV3FLP2L.js";
|
|
4
|
+
import {
|
|
5
|
+
buildDialogKey,
|
|
6
|
+
dialogMessageKey
|
|
7
|
+
} from "./chunk-OJKUU3LP.js";
|
|
8
|
+
|
|
9
|
+
// packages/ai/memory/vnext/workContextAccess.ts
|
|
10
|
+
async function resolveWorkContextAccess(db, userId, dialogId, userMessageId) {
|
|
11
|
+
if (!userId || userId === "server" || typeof dialogId !== "string" || !/^[A-Za-z0-9_-]{1,128}$/.test(dialogId)) throw new Error("invalid work dialog");
|
|
12
|
+
const dialog = await db.get(buildDialogKey(userId, dialogId));
|
|
13
|
+
if (!dialog || dialog.id !== dialogId || dialog.userId != null && dialog.userId !== userId || isTombstoneRecord(dialog)) throw new Error("work dialog forbidden");
|
|
14
|
+
const scope = { ownerId: `user:${encodeURIComponent(userId)}`, spaceId: typeof dialog.spaceId === "string" && dialog.spaceId ? dialog.spaceId : null, dialogId };
|
|
15
|
+
if (userMessageId === void 0) return { scope };
|
|
16
|
+
if (typeof userMessageId !== "string" || !/^[A-Za-z0-9_-]{1,128}$/.test(userMessageId)) throw new Error("persisted user message required");
|
|
17
|
+
const message = await db.get(dialogMessageKey(dialogId, userMessageId));
|
|
18
|
+
if (!message || message.id !== userMessageId || message.role !== "user" || message.userId !== userId || isTombstoneRecord(message) || typeof message.content !== "string" || typeof message.createdAt !== "string") throw new Error("work source forbidden");
|
|
19
|
+
return { scope, sourceRef: JSON.stringify(["dialog", dialogId, "message", userMessageId]) };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
resolveWorkContextAccess
|
|
24
|
+
};
|