nolo-cli 0.103.0-alpha.2 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/{_executeModel-3UCNJCQA.js → _executeModel-7J7Q3WXY.js} +75 -68
- package/action-C4KMTCJF.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-7TNIOVZI.js} +12 -11
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-O47J3MVW.js} +18 -19
- package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-YPJHK7JA.js} +117 -42
- package/{agentEmailCommands-WLYF3JRS.js → agentEmailCommands-AWEXOHWM.js} +98 -88
- package/agentListCommands-2DTLLJZD.js +742 -0
- package/{agentMachineCommands-HNGAR5GI.js → agentMachineCommands-PGEEQ4JJ.js} +48 -43
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-XPJYZSCE.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-DZVLCPLJ.js +138 -0
- package/agentRunCommand-AX5CYQ46.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-PITRQ2EU.js} +48 -39
- package/{agentSlice-SICQBMCM.js → agentSlice-4TLSG6FB.js} +14 -13
- package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-UC2JW5FJ.js} +46 -41
- package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-OL2RKVJ3.js} +46 -41
- package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-B3PLC62M.js} +46 -41
- package/{appGetCommands-SFAPP5PB.js → appGetCommands-REESA2XQ.js} +46 -41
- package/{appListCommands-EKUBDRUO.js → appListCommands-UF6XX7HR.js} +46 -41
- package/{authCommand-F4EFRRX6.js → authCommand-NQPMGYHP.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-LWLOZETU.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-GFY77VRN.js} +10 -8
- package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
- package/{chunk-UKZDAFYT.js → chunk-22RVE2PC.js} +6 -10
- package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
- package/{chunk-HVURBGF3.js → chunk-2H6SEVDS.js} +6 -6
- package/{chunk-TOP2VXOR.js → chunk-2K4TM6AW.js} +5 -5
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
- package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
- package/chunk-4A2R7KHG.js +13545 -0
- package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
- package/{chunk-JRQFUXY7.js → chunk-4G4C5SXT.js} +99 -22
- package/{chunk-DHDMC6FO.js → chunk-4HTMUQIZ.js} +14 -9
- package/{chunk-B3TVQ6PI.js → chunk-4IVA6UUE.js} +20 -11
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-H62HCIUP.js → chunk-56HJ2LAA.js} +35 -22
- package/{chunk-V4MJDUSR.js → chunk-5EPHWMP5.js} +2 -2
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/{chunk-3WLK2JQ5.js → chunk-5IWONK6X.js} +68 -46
- package/chunk-5J3PYNUP.js +255 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-LW4VFPAY.js → chunk-5ZDLVKNG.js} +873 -228
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-AEOE4Z6Q.js → chunk-6UEJDFF7.js} +39 -15
- package/{chunk-JPGCXHNM.js → chunk-7JWCVINR.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
- package/{chunk-IIVGDG4I.js → chunk-7KWFIKKK.js} +13 -7
- package/chunk-A4SQRTZ6.js +15 -0
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-L5UXH3B2.js → chunk-B455PEFD.js} +27 -8
- package/{chunk-XS5SWEDQ.js → chunk-BELZY72F.js} +1 -1
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-3BMYXEUW.js → chunk-CUF4MYKI.js} +1 -1
- package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
- package/{chunk-WV42OMV7.js → chunk-D2GQE6AF.js} +8 -8
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/chunk-DZ7R5V3Y.js +164 -0
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-AGVEIAQA.js → chunk-F442UK5V.js} +29 -78
- package/{chunk-HJUYAD4A.js → chunk-FBTNYNAL.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-ETI2NYVF.js → chunk-GCTKWVLU.js} +4 -4
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- package/{chunk-6VFARHZW.js → chunk-H7TQORR4.js} +994 -1079
- package/{chunk-5H7KJX7J.js → chunk-HD3S2F7U.js} +5 -5
- package/chunk-HDJRLWTG.js +8002 -0
- package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
- package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
- package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
- package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
- package/{chunk-4OEFYTWL.js → chunk-IRZTHHNM.js} +67 -48
- package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
- package/{chunk-OZGZPSEG.js → chunk-KGRP4VOK.js} +47 -67
- package/{chunk-DNCEALKX.js → chunk-LB5A6JTU.js} +22 -29
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
- package/{chunk-Z77CRGTW.js → chunk-MSFZ7FMO.js} +1 -1
- package/chunk-NKWIS6G2.js +442 -0
- package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
- package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
- package/chunk-NWENLDMM.js +42 -0
- package/chunk-O7SVKKLY.js +875 -0
- package/chunk-OCZKATRC.js +129 -0
- package/{chunk-PQFHGD77.js → chunk-OM2RUOEU.js} +161 -14
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-TQBHNYVR.js → chunk-PLRFCQ7C.js} +567 -519
- package/{chunk-6D6VBVEW.js → chunk-Q7O72MF5.js} +80 -14
- package/{chunk-J4MOO56S.js → chunk-RILRSUGC.js} +10 -2
- package/{chunk-RSONHHPE.js → chunk-RNUDNZJW.js} +10 -10
- package/{chunk-3N3W7KBB.js → chunk-RZJAZVCF.js} +11 -9
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-GEPUP7OO.js → chunk-TSXNDTXL.js} +3 -3
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/{chunk-BP4XNZRM.js → chunk-UNAOTLKO.js} +4 -4
- package/{chunk-CUQEXCAU.js → chunk-UQ5P2WHS.js} +29 -9
- package/{chunk-NA35QHCF.js → chunk-V6YASAZR.js} +1 -1
- package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-ZCYXJSTU.js → chunk-VL3H5ZU3.js} +66 -94
- package/{chunk-Q554LLSI.js → chunk-VLGL7FOL.js} +1 -1
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/{chunk-4EG4QFTK.js → chunk-WI6TUGLJ.js} +19 -17
- package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
- package/{chunk-OEVAY4J6.js → chunk-XMUZHRSB.js} +18 -20
- package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
- package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
- package/{chunk-7S4YWN7P.js → chunk-YDO5ERB4.js} +4 -4
- package/chunk-YK5MHOWM.js +915 -0
- package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
- package/chunk-YV25TM3R.js +780 -0
- package/{chunk-IONPPCL5.js → chunk-YZZREBID.js} +86 -16
- package/{chunk-DNUUJ45N.js → chunk-Z3WSAK6A.js} +23 -28
- package/chunk-ZRAU6T47.js +56 -0
- package/commandRegistry-VQPFWVDH.js +833 -0
- package/{contentThunks-S4S7QPSO.js → contentThunks-A26ME6OJ.js} +37 -35
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-ODGL2YGP.js → createAgentAutomationAction-BSAMZJ5W.js} +39 -37
- package/createDialogAction-CMCQXYHD.js +69 -0
- package/{createPageAction-FBV3OWX7.js → createPageAction-ANGKJTK2.js} +46 -43
- package/{chunk-F2RNI7ZR.js → cursorProvider-YGGNMVWX.js} +2496 -9897
- package/{dbSlice-XVWBAGYN.js → dbSlice-QOLNF5GN.js} +11 -10
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-5J56DFWN.js → dialogCommands-AMPAWLX4.js} +49 -45
- package/{dialogSlice-LEO27SQG.js → dialogSlice-DGWDEBYC.js} +41 -34
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-7NMIYL5D.js} +48 -43
- package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-BD4OM5PV.js} +49 -44
- package/{docReadCommands-HOSVSBDJ.js → docReadCommands-5IOVAKU2.js} +47 -42
- package/{docStore-MNX5MHA5.js → docStore-TP4QDER4.js} +16 -12
- package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-ZTKJ6UPC.js} +48 -43
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-5L7OVM5Y.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
- package/{handleSendMessageAction-YB6KQFJS.js → handleSendMessageAction-N4WKFRSQ.js} +111 -87
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-O5A26FDK.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-7GVQCUAK.js → machineCommands-47WKGY5Z.js} +92 -82
- package/machineWsRunDispatch-CYW5FJ52.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-25K6DDRA.js} +20 -18
- package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/pdf-U6KSUEZZ.js +26435 -0
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
- package/{read-COE3ZYR6.js → read-PJIT2YEJ.js} +7 -6
- package/{readDocTool-5USN4A6V.js → readDocTool-DRSXHGNL.js} +5 -3
- package/{readlineWorkspace-WA7JNI6J.js → readlineWorkspace-CK7GOVOC.js} +2698 -2055
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-VIWJL6MX.js} +21 -25
- package/{runAgentClientLoop-JGFQ6KIR.js → runAgentClientLoop-BGHGP5AR.js} +76 -70
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-A7VA3NFM.js} +15 -13
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-B4P7YQX2.js} +22 -26
- package/{chunk-AFUORTY4.js → settingThunks-KOYSAT65.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-NKJVJCQQ.js → spaceCommands-QJCYG27F.js} +51 -46
- package/{streamAgentChatTurn-XLFZ66UC.js → streamAgentChatTurn-ANE7OTCZ.js} +214 -108
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-3VYWHZKH.js} +18 -19
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
- package/tools-WPOVVP7M.js +116 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-QCHCULPM.js} +25 -22
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-6MBTD4UE.js → updateDialogTitleAction-C4GRCXL4.js} +82 -44
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-JP7S7PT2.js +0 -469
- package/agentRecordCommands-SXFPW3DL.js +0 -128
- package/agentRunCommand-JIQ4HY4D.js +0 -155
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-HHMUDNXL.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-XVZ22N6C.js +0 -20782
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-GFKRXTK4.js +0 -65
- package/machineWsRunDispatch-XA7TD7Z7.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-NF5AB34X.js +0 -110
- package/{chunk-VMFTFOWF.js → chunk-ODAPITXL.js} +7 -7
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -4,23 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
buildStaticUserPolicyContext,
|
|
6
6
|
resolveSpaceContextPreloadPlan
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VCAQFMVN.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCliPrompt
|
|
10
10
|
} from "./chunk-ATNTHIZI.js";
|
|
11
11
|
import {
|
|
12
12
|
filterAndCleanMessages,
|
|
13
13
|
handleToolCalls,
|
|
14
|
-
parseApiError,
|
|
15
14
|
persistToolMessages,
|
|
16
15
|
readStreamChunk,
|
|
17
16
|
sendOpenAICompletionsRequest,
|
|
18
17
|
updateTotalUsage
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-F442UK5V.js";
|
|
20
19
|
import "./chunk-JEXVIMYZ.js";
|
|
21
20
|
import {
|
|
22
21
|
prepareTools
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RNUDNZJW.js";
|
|
24
23
|
import {
|
|
25
24
|
INVALID_TOOL_ARGS_REPLACEMENT,
|
|
26
25
|
buildInvalidToolCallSelfHealResult,
|
|
@@ -38,53 +37,64 @@ import {
|
|
|
38
37
|
sanitizeOutboundResponsesInput,
|
|
39
38
|
selectResponsesConversationState,
|
|
40
39
|
updateResponsesConversationState
|
|
41
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-5IWONK6X.js";
|
|
42
41
|
import "./chunk-EOARMOVD.js";
|
|
43
42
|
import "./chunk-HS7MLR74.js";
|
|
44
43
|
import {
|
|
45
44
|
createSSEParser,
|
|
46
45
|
getAllToolRuns,
|
|
47
46
|
resolveAgentRecommendedSkillNames,
|
|
48
|
-
resolveAgentRequiredPackIds
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
resolveAgentRequiredPackIds,
|
|
48
|
+
selectAiRecentContentLimit,
|
|
49
|
+
selectGlobalPrompt,
|
|
50
|
+
selectKnowledgeCaptureLevel,
|
|
51
|
+
selectMaxExecutionTime,
|
|
52
|
+
selectSpaceContextLevel,
|
|
53
|
+
selectUserTonePreset
|
|
54
|
+
} from "./chunk-PLRFCQ7C.js";
|
|
51
55
|
import "./chunk-NF64D32W.js";
|
|
56
|
+
import "./chunk-OM2RUOEU.js";
|
|
57
|
+
import "./chunk-AOTBKDRK.js";
|
|
52
58
|
import "./chunk-3L2WKC3W.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-HJUYAD4A.js";
|
|
59
|
+
import "./chunk-OXME3PEE.js";
|
|
60
|
+
import "./chunk-DZ7R5V3Y.js";
|
|
61
|
+
import "./chunk-RILRSUGC.js";
|
|
62
|
+
import "./chunk-FBTNYNAL.js";
|
|
58
63
|
import {
|
|
59
64
|
getFinalPrice,
|
|
60
65
|
getModelPricing,
|
|
61
66
|
getPrices,
|
|
62
67
|
hasExplicitAgentPricing
|
|
63
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-4DPP773Q.js";
|
|
64
69
|
import {
|
|
65
70
|
getPublicImageAgentDefaultProfile,
|
|
66
71
|
getPublicImageAgentMode
|
|
67
72
|
} from "./chunk-VIDPVFP3.js";
|
|
68
73
|
import {
|
|
69
74
|
resolveToolBaseUrl
|
|
70
|
-
} from "./chunk-
|
|
71
|
-
import "./chunk-
|
|
75
|
+
} from "./chunk-HP57OUJO.js";
|
|
76
|
+
import "./chunk-22RVE2PC.js";
|
|
77
|
+
import {
|
|
78
|
+
isContextOverflowText,
|
|
79
|
+
parseApiError
|
|
80
|
+
} from "./chunk-OCZKATRC.js";
|
|
72
81
|
import {
|
|
73
82
|
waitForAbortableDelay
|
|
74
83
|
} from "./chunk-N4G4PKQ6.js";
|
|
75
|
-
import "./chunk-
|
|
84
|
+
import "./chunk-NUHHBEJC.js";
|
|
76
85
|
import {
|
|
77
86
|
extractCategorizedMentions
|
|
78
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-AGIM7IMJ.js";
|
|
79
88
|
import "./chunk-63W5N6P3.js";
|
|
80
89
|
import "./chunk-VF4K2QE6.js";
|
|
81
90
|
import {
|
|
82
91
|
getDocState
|
|
83
|
-
} from "./chunk-
|
|
84
|
-
import "./chunk-
|
|
92
|
+
} from "./chunk-4IVA6UUE.js";
|
|
93
|
+
import "./chunk-Z3WSAK6A.js";
|
|
94
|
+
import "./chunk-E3YWHWCR.js";
|
|
85
95
|
import {
|
|
86
96
|
getTableState
|
|
87
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-KGRP4VOK.js";
|
|
88
98
|
import {
|
|
89
99
|
getCurrentSpaceId,
|
|
90
100
|
getCurrentSpaceIdRaw,
|
|
@@ -106,34 +116,38 @@ import {
|
|
|
106
116
|
selectAllMsgs,
|
|
107
117
|
selectCurrentDialogConfig,
|
|
108
118
|
selectDialogConfigByKey,
|
|
109
|
-
shouldBlockForGptPro,
|
|
110
119
|
updateTokens,
|
|
111
120
|
updateToolMessage
|
|
112
|
-
} from "./chunk-
|
|
113
|
-
import "./chunk-
|
|
114
|
-
import "./chunk-
|
|
115
|
-
import "./chunk-
|
|
121
|
+
} from "./chunk-4A2R7KHG.js";
|
|
122
|
+
import "./chunk-UKZX3NHN.js";
|
|
123
|
+
import "./chunk-CUF4MYKI.js";
|
|
124
|
+
import "./chunk-523DITKR.js";
|
|
116
125
|
import "./chunk-AGGIDPCZ.js";
|
|
117
|
-
import "./chunk-
|
|
126
|
+
import "./chunk-RZJAZVCF.js";
|
|
118
127
|
import {
|
|
119
128
|
createCliChatTurnStream,
|
|
120
129
|
getCliChatSession,
|
|
121
130
|
startCliChatSession
|
|
122
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-2K4TM6AW.js";
|
|
123
132
|
import "./chunk-5RGU3J7P.js";
|
|
133
|
+
import "./chunk-ZRAU6T47.js";
|
|
124
134
|
import {
|
|
125
135
|
addActiveController,
|
|
136
|
+
claimDialogTurnPhase,
|
|
137
|
+
clearDialogTurnPhase,
|
|
126
138
|
clearPendingUserInputQueue,
|
|
127
139
|
dequeueUserInput,
|
|
128
140
|
removeActiveController,
|
|
129
141
|
selectActiveControllers,
|
|
130
142
|
selectPendingFiles,
|
|
131
143
|
selectPendingUserInputQueue,
|
|
144
|
+
setDialogTurnPhase,
|
|
132
145
|
tokenUsageLiveUpdate
|
|
133
|
-
} from "./chunk-
|
|
134
|
-
import "./chunk-
|
|
146
|
+
} from "./chunk-BZ7NPA6G.js";
|
|
147
|
+
import "./chunk-4LCOCOR5.js";
|
|
135
148
|
import "./chunk-YDH3FDFQ.js";
|
|
136
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-YDO5ERB4.js";
|
|
150
|
+
import "./chunk-4G4C5SXT.js";
|
|
137
151
|
import {
|
|
138
152
|
TOOL_PACKS,
|
|
139
153
|
addDefaultSystemCapabilityTools,
|
|
@@ -143,8 +157,10 @@ import {
|
|
|
143
157
|
expandEnabledPackPromptPatches,
|
|
144
158
|
expandEnabledPacks,
|
|
145
159
|
resolveEffectiveEnabledPacks
|
|
146
|
-
} from "./chunk-
|
|
147
|
-
import "./chunk-
|
|
160
|
+
} from "./chunk-4HTMUQIZ.js";
|
|
161
|
+
import "./chunk-WJ3B6FX6.js";
|
|
162
|
+
import "./chunk-VLGL7FOL.js";
|
|
163
|
+
import "./chunk-A4SQRTZ6.js";
|
|
148
164
|
import "./chunk-KHCLMKZZ.js";
|
|
149
165
|
import {
|
|
150
166
|
assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets,
|
|
@@ -153,108 +169,109 @@ import {
|
|
|
153
169
|
projectToolMessageContent,
|
|
154
170
|
resolveAgentContextWindow,
|
|
155
171
|
stripImagePartsForTextOnlyAgent
|
|
156
|
-
} from "./chunk-
|
|
157
|
-
import "./chunk-CQ3WA2NE.js";
|
|
172
|
+
} from "./chunk-HD3S2F7U.js";
|
|
158
173
|
import "./chunk-5ZUL4CUO.js";
|
|
174
|
+
import "./chunk-NKWIS6G2.js";
|
|
159
175
|
import "./chunk-N7J63Q6C.js";
|
|
160
|
-
import "./chunk-
|
|
176
|
+
import "./chunk-B455PEFD.js";
|
|
161
177
|
import {
|
|
162
178
|
extractImagePartsFromResponseOutput,
|
|
163
179
|
extractTextFromResponseOutput,
|
|
164
180
|
toResponsesTools
|
|
165
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-M7VLQGQP.js";
|
|
166
182
|
import {
|
|
167
183
|
resolveRuntimeToolSurfaceForAgent
|
|
168
|
-
} from "./chunk-
|
|
169
|
-
import "./chunk-
|
|
170
|
-
import "./chunk-UZGQNTVW.js";
|
|
171
|
-
import "./chunk-6OZ36FXI.js";
|
|
184
|
+
} from "./chunk-7KWFIKKK.js";
|
|
185
|
+
import "./chunk-H6A6X4EK.js";
|
|
172
186
|
import {
|
|
173
187
|
getModelContextWindow,
|
|
174
188
|
getModelInfo
|
|
175
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-IRZTHHNM.js";
|
|
176
190
|
import {
|
|
177
191
|
planContextUsage
|
|
178
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-LB5A6JTU.js";
|
|
193
|
+
import "./chunk-5MMAK75Q.js";
|
|
194
|
+
import "./chunk-BYXBJQAS.js";
|
|
195
|
+
import "./chunk-DWLEOOGR.js";
|
|
196
|
+
import "./chunk-2H6SEVDS.js";
|
|
197
|
+
import {
|
|
198
|
+
asRecordOrEmpty
|
|
199
|
+
} from "./chunk-KX6YBIHG.js";
|
|
179
200
|
import {
|
|
180
201
|
estimateTokenCount
|
|
181
202
|
} from "./chunk-PSCNXBYA.js";
|
|
203
|
+
import "./chunk-5EPHWMP5.js";
|
|
204
|
+
import "./chunk-UAD2WT54.js";
|
|
205
|
+
import {
|
|
206
|
+
patch,
|
|
207
|
+
read,
|
|
208
|
+
selectById,
|
|
209
|
+
write
|
|
210
|
+
} from "./chunk-56HJ2LAA.js";
|
|
211
|
+
import "./chunk-EV235ILT.js";
|
|
212
|
+
import "./chunk-HNGRBWYF.js";
|
|
213
|
+
import {
|
|
214
|
+
buildLinkedSpacesSection,
|
|
215
|
+
buildSpaceContextLayer
|
|
216
|
+
} from "./chunk-HDLLCBRF.js";
|
|
217
|
+
import "./chunk-4VJAC32I.js";
|
|
218
|
+
import {
|
|
219
|
+
canonicalizeToolNames,
|
|
220
|
+
prioritizeToolNames
|
|
221
|
+
} from "./chunk-XUWRURDF.js";
|
|
222
|
+
import "./chunk-5J3PYNUP.js";
|
|
223
|
+
import "./chunk-EKPKW6RM.js";
|
|
224
|
+
import "./chunk-UA324D4O.js";
|
|
225
|
+
import "./chunk-27ONFIEY.js";
|
|
182
226
|
import {
|
|
183
227
|
isOpenAiResponsesModel
|
|
184
|
-
} from "./chunk-
|
|
185
|
-
import "./chunk-BYXBJQAS.js";
|
|
228
|
+
} from "./chunk-7KVZ5LDQ.js";
|
|
186
229
|
import {
|
|
187
230
|
getApiEndpoint,
|
|
188
231
|
getModelConfig,
|
|
189
232
|
getProviderByModelName
|
|
190
|
-
} from "./chunk-
|
|
191
|
-
import "./chunk-DWLEOOGR.js";
|
|
192
|
-
import "./chunk-HVURBGF3.js";
|
|
193
|
-
import "./chunk-ONXOABJR.js";
|
|
233
|
+
} from "./chunk-3BXNTXYI.js";
|
|
194
234
|
import "./chunk-W7XHHYWM.js";
|
|
195
235
|
import {
|
|
196
236
|
toErrorMessage
|
|
197
237
|
} from "./chunk-HNMXYYJR.js";
|
|
238
|
+
import "./chunk-CYSYR67N.js";
|
|
239
|
+
import "./chunk-Y3PMXGLH.js";
|
|
198
240
|
import {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
import "./chunk-2GRGFCF6.js";
|
|
241
|
+
asTrimmedLowercaseString
|
|
242
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
243
|
+
import "./chunk-D2GQE6AF.js";
|
|
203
244
|
import {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
import "./chunk-7S4YWN7P.js";
|
|
208
|
-
import "./chunk-ACTMNVHM.js";
|
|
209
|
-
import "./chunk-Q67DOFOO.js";
|
|
210
|
-
import "./chunk-BP4XNZRM.js";
|
|
245
|
+
selectRuntimeCurrentServer
|
|
246
|
+
} from "./chunk-O7SVKKLY.js";
|
|
247
|
+
import "./chunk-D2MDMY2M.js";
|
|
211
248
|
import {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
selectGlobalPrompt,
|
|
215
|
-
selectKnowledgeCaptureLevel,
|
|
216
|
-
selectMaxExecutionTime,
|
|
217
|
-
selectSpaceContextLevel,
|
|
218
|
-
selectUserTonePreset
|
|
219
|
-
} from "./chunk-AFUORTY4.js";
|
|
220
|
-
import "./chunk-Y5GCAMGP.js";
|
|
221
|
-
import "./chunk-QDSINZM3.js";
|
|
249
|
+
isSystemBuiltinTrustedAgentKey
|
|
250
|
+
} from "./chunk-BNGW5ASC.js";
|
|
222
251
|
import {
|
|
223
|
-
|
|
224
|
-
} from "./chunk-
|
|
225
|
-
import "./chunk-V4MJDUSR.js";
|
|
226
|
-
import "./chunk-UAD2WT54.js";
|
|
252
|
+
extractCustomId
|
|
253
|
+
} from "./chunk-M2EJHDJP.js";
|
|
227
254
|
import {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
255
|
+
isRecord
|
|
256
|
+
} from "./chunk-KUG52IAP.js";
|
|
257
|
+
import "./chunk-UNAOTLKO.js";
|
|
258
|
+
import {
|
|
259
|
+
selectCurrentServer
|
|
260
|
+
} from "./chunk-NWENLDMM.js";
|
|
233
261
|
import {
|
|
234
262
|
asNonEmptyStringArray,
|
|
235
263
|
createDialogMessageKeyAndId,
|
|
236
264
|
dialogMessageKey,
|
|
237
265
|
metaKey
|
|
238
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-ODAPITXL.js";
|
|
239
267
|
import {
|
|
240
268
|
asOptionalFiniteNumber
|
|
241
269
|
} from "./chunk-WWC7I6TA.js";
|
|
242
|
-
import "./chunk-
|
|
243
|
-
import "./chunk-QSJ3HFEF.js";
|
|
244
|
-
import "./chunk-WV42OMV7.js";
|
|
245
|
-
import {
|
|
246
|
-
isSystemBuiltinTrustedAgentKey
|
|
247
|
-
} from "./chunk-BNGW5ASC.js";
|
|
248
|
-
import {
|
|
249
|
-
extractCustomId
|
|
250
|
-
} from "./chunk-M2EJHDJP.js";
|
|
251
|
-
import {
|
|
252
|
-
selectRuntimeCurrentServer
|
|
253
|
-
} from "./chunk-UKWGR5SS.js";
|
|
270
|
+
import "./chunk-VY6VFGKR.js";
|
|
254
271
|
import {
|
|
255
272
|
getIsDesktopApp,
|
|
256
273
|
isAbortError
|
|
257
|
-
} from "./chunk-
|
|
274
|
+
} from "./chunk-HIM3FCLF.js";
|
|
258
275
|
import "./chunk-OW765XBU.js";
|
|
259
276
|
import {
|
|
260
277
|
getSessionSnapshotForState,
|
|
@@ -263,14 +280,10 @@ import {
|
|
|
263
280
|
selectIdentityUserBalance,
|
|
264
281
|
selectIdentityUserId
|
|
265
282
|
} from "./chunk-SEJ5OS6F.js";
|
|
266
|
-
import "./chunk-
|
|
267
|
-
import {
|
|
268
|
-
isRecord
|
|
269
|
-
} from "./chunk-KUG52IAP.js";
|
|
283
|
+
import "./chunk-U6VC4MU4.js";
|
|
270
284
|
import {
|
|
271
285
|
asTrimmedString
|
|
272
286
|
} from "./chunk-3EUW3WEO.js";
|
|
273
|
-
import "./chunk-U6VC4MU4.js";
|
|
274
287
|
import "./chunk-LCBAMY2M.js";
|
|
275
288
|
import "./chunk-4SN6J65J.js";
|
|
276
289
|
import "./chunk-CF7PE763.js";
|
|
@@ -856,6 +869,7 @@ var sendOpenAIResponseRequest = async ({
|
|
|
856
869
|
const toolMessage = {
|
|
857
870
|
id: runningToolMessageId,
|
|
858
871
|
dbKey: runningToolDbKey,
|
|
872
|
+
dialogId,
|
|
859
873
|
role: "tool",
|
|
860
874
|
content: selfHealContent,
|
|
861
875
|
toolCallId: callId,
|
|
@@ -1788,6 +1802,8 @@ var buildRecentAppToolMemory = (messages, toolRuns) => {
|
|
|
1788
1802
|
// packages/ai/agent/streamAgentChatTurnUtils.ts
|
|
1789
1803
|
var BROWSER_UNAVAILABLE_CORE_TOOLS = {
|
|
1790
1804
|
createAgentAutomation: true,
|
|
1805
|
+
updateAgentAutomation: true,
|
|
1806
|
+
deleteAgentAutomation: true,
|
|
1791
1807
|
notifyUser: true
|
|
1792
1808
|
};
|
|
1793
1809
|
var getRuntimeCoreTools = () => {
|
|
@@ -2336,10 +2352,35 @@ var resolveImageGenerationStreamingState = (agentConfig, args) => {
|
|
|
2336
2352
|
};
|
|
2337
2353
|
};
|
|
2338
2354
|
|
|
2355
|
+
// packages/core/gptProTier.ts
|
|
2356
|
+
var GPT_PRO_REQUIRED_RECHARGE_AMOUNT = 199;
|
|
2357
|
+
function isGptProModel(provider, model) {
|
|
2358
|
+
const normalizedProvider = asTrimmedLowercaseString(provider);
|
|
2359
|
+
const normalizedModel = asTrimmedLowercaseString(model);
|
|
2360
|
+
if (normalizedProvider === "openai") {
|
|
2361
|
+
return /^gpt-[a-z0-9.-]+-pro(?:-|$)/.test(normalizedModel);
|
|
2362
|
+
}
|
|
2363
|
+
if (normalizedProvider === "deepinfra") {
|
|
2364
|
+
return normalizedModel.includes("claude") && (normalizedModel.includes("opus") || normalizedModel.includes("fable"));
|
|
2365
|
+
}
|
|
2366
|
+
if (normalizedProvider === "nolo") {
|
|
2367
|
+
return normalizedModel === "kimi-k3";
|
|
2368
|
+
}
|
|
2369
|
+
return false;
|
|
2370
|
+
}
|
|
2371
|
+
var GPT_PRO_BLOCKED_MESSAGE = `GPT Pro / Kimi K3 \u7B49\u9AD8\u7EA7\u6A21\u578B\u9700\u8981\u5148\u5F00\u901A ${GPT_PRO_REQUIRED_RECHARGE_AMOUNT} \u79EF\u5206\u6863\u4F4D\u3002`;
|
|
2372
|
+
function shouldBlockForGptPro(agent, gptProStatus) {
|
|
2373
|
+
if (!agent) return { blocked: false };
|
|
2374
|
+
if (agent.apiSource === "cli") return { blocked: false };
|
|
2375
|
+
if (!isGptProModel(agent.provider, agent.model)) return { blocked: false };
|
|
2376
|
+
if (gptProStatus === "active") return { blocked: false };
|
|
2377
|
+
return { blocked: true, message: GPT_PRO_BLOCKED_MESSAGE };
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2339
2380
|
// packages/ai/agent/persistMessageWithFixedId.ts
|
|
2340
2381
|
async function persistMessageWithFixedId(dispatch, message) {
|
|
2341
2382
|
dispatch(addUserMessage(message));
|
|
2342
|
-
const { controller, ...messageToWrite } = message;
|
|
2383
|
+
const { controller, dialogId: _dialogId, ...messageToWrite } = message;
|
|
2343
2384
|
try {
|
|
2344
2385
|
const writeRequest = dispatch(
|
|
2345
2386
|
write({
|
|
@@ -2418,6 +2459,7 @@ function normalizeDesktopAgentRuntimeTurnError(data) {
|
|
|
2418
2459
|
async function* runDesktopAgentRuntimeTurnStream({
|
|
2419
2460
|
fetchImpl = fetch,
|
|
2420
2461
|
signal,
|
|
2462
|
+
noEventWatchdogMs,
|
|
2421
2463
|
...args
|
|
2422
2464
|
}) {
|
|
2423
2465
|
try {
|
|
@@ -2474,7 +2516,13 @@ async function* runDesktopAgentRuntimeTurnStream({
|
|
|
2474
2516
|
yield { type: "error", error: "The operation was aborted." };
|
|
2475
2517
|
return;
|
|
2476
2518
|
}
|
|
2477
|
-
const { done, value } = await readStreamChunk(reader, {
|
|
2519
|
+
const { done, value } = await readStreamChunk(reader, {
|
|
2520
|
+
signal,
|
|
2521
|
+
...noEventWatchdogMs && noEventWatchdogMs > 0 ? {
|
|
2522
|
+
timeoutMs: noEventWatchdogMs,
|
|
2523
|
+
timeoutErrorMessage: `Desktop turn stream stalled: no event within ${noEventWatchdogMs}ms`
|
|
2524
|
+
} : {}
|
|
2525
|
+
});
|
|
2478
2526
|
if (done) break;
|
|
2479
2527
|
buffer += decoder.decode(value, { stream: true });
|
|
2480
2528
|
const lines = buffer.split("\n");
|
|
@@ -2596,7 +2644,8 @@ var toolMessageWillPersist = (toolMsg) => {
|
|
|
2596
2644
|
if (typeof content === "string") return content.trim().length > 0;
|
|
2597
2645
|
return Array.isArray(content) && content.length > 0;
|
|
2598
2646
|
};
|
|
2599
|
-
var shouldUseDesktopLocalRuntime = (agentConfig) => {
|
|
2647
|
+
var shouldUseDesktopLocalRuntime = (agentConfig, explicitTarget) => {
|
|
2648
|
+
if (explicitTarget?.kind === "machine") return false;
|
|
2600
2649
|
if (!getIsDesktopApp()) return false;
|
|
2601
2650
|
return agentConfig?.apiSource !== "cli";
|
|
2602
2651
|
};
|
|
@@ -3048,6 +3097,28 @@ function hasInlineExecutedToolCalls(result) {
|
|
|
3048
3097
|
const output = result?.output;
|
|
3049
3098
|
return Array.isArray(output) && output.some((b) => b?.type === "toolCall" && b?.result != null);
|
|
3050
3099
|
}
|
|
3100
|
+
var COMPACTION_TIMEOUT_PATTERN = /compaction[^\n]{0,40}(timed\s*out|timeout|deadline)|(timed\s*out|timeout|deadline)[^\n]{0,40}compaction|summary[^\n]{0,30}(timed\s*out|timeout)/i;
|
|
3101
|
+
var DESKTOP_SSE_NO_EVENT_WATCHDOG_MS = 20 * 60 * 1e3;
|
|
3102
|
+
function classifyLocalTurnStreamError(errorText) {
|
|
3103
|
+
const text = typeof errorText === "string" ? errorText : "";
|
|
3104
|
+
if (COMPACTION_TIMEOUT_PATTERN.test(text)) {
|
|
3105
|
+
return {
|
|
3106
|
+
kind: "compaction_timeout",
|
|
3107
|
+
retryable: true,
|
|
3108
|
+
summary: "\u5386\u53F2\u538B\u7F29\u8D85\u65F6",
|
|
3109
|
+
actionHint: "\u5386\u53F2\u538B\u7F29\u672A\u80FD\u5728\u65F6\u9650\u5185\u5B8C\u6210\uFF0C\u672C\u56DE\u5408\u5DF2\u505C\u6B62\u3002\u4F60\u7684\u6D88\u606F\u4E0E\u9644\u4EF6\u5747\u5DF2\u4FDD\u7559\uFF1B\u53EF\u91CD\u8BD5\u3001\u5F00\u542F\u65B0\u5BF9\u8BDD\uFF0C\u6216\u5207\u6362\u5230\u66F4\u5927\u7A97\u53E3\u7684\u6A21\u578B\u3002\uFF08\u8D85\u65F6\u540E\u4E0D\u4F1A\u81EA\u52A8\u91CD\u8BD5\u540C\u4E00\u4ED8\u8D39\u8BF7\u6C42\u3002\uFF09"
|
|
3110
|
+
};
|
|
3111
|
+
}
|
|
3112
|
+
if (isContextOverflowText(text)) {
|
|
3113
|
+
return {
|
|
3114
|
+
kind: "context_overflow",
|
|
3115
|
+
retryable: true,
|
|
3116
|
+
summary: "\u4E0A\u4E0B\u6587\u8FC7\u957F",
|
|
3117
|
+
actionHint: "\u5F53\u524D\u4E0A\u4E0B\u6587\u8D85\u51FA\u6A21\u578B\u7A97\u53E3\u3002\u53EF\u81EA\u52A8\u538B\u7F29\u5E76\u91CD\u8BD5\u3001\u5F00\u542F\u65B0\u5BF9\u8BDD\uFF0C\u6216\u5207\u6362\u5230\u66F4\u5927\u7A97\u53E3\u7684\u6A21\u578B\u3002"
|
|
3118
|
+
};
|
|
3119
|
+
}
|
|
3120
|
+
return { kind: "generic", retryable: true, summary: "", actionHint: "" };
|
|
3121
|
+
}
|
|
3051
3122
|
function createRemoteToolEventHandlers(opts) {
|
|
3052
3123
|
const { dialogId, dispatch, messageMetadata } = opts;
|
|
3053
3124
|
const activeToolMessages = /* @__PURE__ */ new Map();
|
|
@@ -3182,6 +3253,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3182
3253
|
thunkApi.signal.addEventListener("abort", onAbort);
|
|
3183
3254
|
let loopKey = null;
|
|
3184
3255
|
let runtimeDialogKey = explicitDialogKey ?? null;
|
|
3256
|
+
let turnPhaseTurnId = null;
|
|
3185
3257
|
let remoteTransientMessageId = null;
|
|
3186
3258
|
let remoteTransientMessageFinalized = false;
|
|
3187
3259
|
let modelRequestStarted = false;
|
|
@@ -3290,8 +3362,14 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3290
3362
|
const configuredBoundMachineId = asTrimmedString(
|
|
3291
3363
|
agentConfig.runtimeBinding?.machineId
|
|
3292
3364
|
);
|
|
3293
|
-
const
|
|
3294
|
-
|
|
3365
|
+
const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
|
|
3366
|
+
const explicitTarget = runtimeOptions?.runtimeTarget ?? (currentDialog?.runtimeBinding?.target?.kind === "server" || currentDialog?.runtimeBinding?.target?.kind === "machine" ? currentDialog.runtimeBinding.target : void 0);
|
|
3367
|
+
const boundMachineId = explicitTarget ? explicitTarget.kind === "machine" ? asTrimmedString(explicitTarget.machineId) : null : resolveRemoteBoundMachineId(configuredBoundMachineId);
|
|
3368
|
+
const hasExplicitMachineTarget = explicitTarget?.kind === "machine";
|
|
3369
|
+
if (hasExplicitMachineTarget && !boundMachineId) {
|
|
3370
|
+
return rejectWithValue("\u663E\u5F0F\u9009\u62E9\u7684\u7535\u8111\u76EE\u6807\u7F3A\u5C11 machineId\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6267\u884C\u7535\u8111\u3002");
|
|
3371
|
+
}
|
|
3372
|
+
if (hasExplicitMachineTarget || agentConfig.apiSource === "cli" && !explicitTarget || boundMachineId && !getIsDesktopApp()) {
|
|
3295
3373
|
console.info("[streamAgentChatTurn] Triggered CLI/machine route. apiSource:", agentConfig.apiSource, "boundMachineId:", boundMachineId, "agentKey:", agentKey);
|
|
3296
3374
|
const currentState = getState();
|
|
3297
3375
|
const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
|
|
@@ -3326,6 +3404,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3326
3404
|
let accumulated2 = "";
|
|
3327
3405
|
let totalTurnUsage2 = void 0;
|
|
3328
3406
|
const buildMachineAssistantMessage = () => ({
|
|
3407
|
+
dialogId: dialogId2,
|
|
3329
3408
|
id: messageId,
|
|
3330
3409
|
dbKey: msgKey,
|
|
3331
3410
|
role: "assistant",
|
|
@@ -3375,6 +3454,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3375
3454
|
stream: true,
|
|
3376
3455
|
persistDialog: false,
|
|
3377
3456
|
clientDialogId: dialogId2,
|
|
3457
|
+
...explicitTarget ? { runtimeTarget: explicitTarget } : {},
|
|
3378
3458
|
runtimeContext: {
|
|
3379
3459
|
surface: "web",
|
|
3380
3460
|
host: "browser",
|
|
@@ -3600,6 +3680,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3600
3680
|
let cliTurnUsage = null;
|
|
3601
3681
|
const decoder = new TextDecoder();
|
|
3602
3682
|
const buildCliAssistantMessage = () => ({
|
|
3683
|
+
dialogId: dialogId2,
|
|
3603
3684
|
id: messageId,
|
|
3604
3685
|
dbKey: msgKey,
|
|
3605
3686
|
role: "assistant",
|
|
@@ -3722,7 +3803,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3722
3803
|
}
|
|
3723
3804
|
return;
|
|
3724
3805
|
}
|
|
3725
|
-
const currentDialog = selectDialogConfigByKey(state, explicitDialogKey) ?? selectCurrentDialogConfig(state);
|
|
3726
3806
|
const activeDialogKey = currentDialog?.dbKey;
|
|
3727
3807
|
const dialogKey = explicitDialogKey || activeDialogKey;
|
|
3728
3808
|
if (!dialogKey) {
|
|
@@ -3734,11 +3814,13 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3734
3814
|
dialogKey,
|
|
3735
3815
|
dialogId
|
|
3736
3816
|
});
|
|
3737
|
-
if (shouldUseDesktopLocalRuntime(agentConfig)) {
|
|
3817
|
+
if (shouldUseDesktopLocalRuntime(agentConfig, explicitTarget)) {
|
|
3738
3818
|
const desktopMessageMetadata = buildMessageMetadata(agentConfig);
|
|
3739
3819
|
const w2 = typeof globalThis !== "undefined" && globalThis.window ? globalThis.window : null;
|
|
3740
3820
|
loopKey = `loop:${dialogId}`;
|
|
3741
3821
|
dispatch(addActiveController({ messageId: loopKey, controller: loopController, dialogKey }));
|
|
3822
|
+
turnPhaseTurnId = `turn-phase:${dialogId}:${Date.now().toString(36)}:${Math.random().toString(36).slice(2, 8)}`;
|
|
3823
|
+
claimDialogTurnPhase({ dialogKey, turnId: turnPhaseTurnId });
|
|
3742
3824
|
let currentContent = "";
|
|
3743
3825
|
const assistantSegments = [];
|
|
3744
3826
|
let assistantMessageKeys = null;
|
|
@@ -3811,7 +3893,18 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3811
3893
|
workspaceToolsHint: runtimeOptions?.workspaceToolsHint === true,
|
|
3812
3894
|
agentConfigSnapshot: agentConfig,
|
|
3813
3895
|
dialogMessages: selectAllMsgs(getState(), dialogId),
|
|
3814
|
-
signal: loopController.signal
|
|
3896
|
+
signal: loopController.signal,
|
|
3897
|
+
// SSE 传输层兜底(review 修复 4):此前本调用方从不传
|
|
3898
|
+
// noEventWatchdogMs,watchdog 永远关闭——「已有安全网」只是
|
|
3899
|
+
// 错觉,挂起点若在 provider.complete 之外(resolveProvider /
|
|
3900
|
+
// adapter 内部,runtime 没有任何 deadline)就会无限静默。
|
|
3901
|
+
// 量级必须大于 runtime 自己的 idle 窗(默认 10 分钟无新输出
|
|
3902
|
+
// 才放弃,见 localLoop.DEFAULT_LLM_REQUEST_TIMEOUT_MS),
|
|
3903
|
+
// 否则一个健康的慢思考轮次会被客户端提前判死,用户拿到的是
|
|
3904
|
+
// 未分类的 "stream stalled" 而不是 runtime 的
|
|
3905
|
+
// LLM_REQUEST_TIMEOUT 可操作文案。取 2× = 20 分钟:
|
|
3906
|
+
// 只兜「runtime 完全没 deadline」的真悬挂。
|
|
3907
|
+
noEventWatchdogMs: DESKTOP_SSE_NO_EVENT_WATCHDOG_MS
|
|
3815
3908
|
});
|
|
3816
3909
|
for await (const event of eventStream) {
|
|
3817
3910
|
if (loopController.signal.aborted || thunkApi.signal.aborted) {
|
|
@@ -3884,6 +3977,9 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3884
3977
|
dispatch(messageStreaming(toolResultMsg));
|
|
3885
3978
|
}
|
|
3886
3979
|
}
|
|
3980
|
+
} else if (event.type === "status") {
|
|
3981
|
+
const phase = event.phase === "validating-context" ? "validating" : event.phase;
|
|
3982
|
+
setDialogTurnPhase({ phase, dialogKey, turnId: turnPhaseTurnId ?? void 0 });
|
|
3887
3983
|
} else if (event.type === "done") {
|
|
3888
3984
|
streamResult = event.result;
|
|
3889
3985
|
} else if (event.type === "error") {
|
|
@@ -3924,6 +4020,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3924
4020
|
stopToolNameById
|
|
3925
4021
|
);
|
|
3926
4022
|
await persistMessageWithFixedId(dispatch, {
|
|
4023
|
+
dialogId,
|
|
3927
4024
|
id: segment2.messageId,
|
|
3928
4025
|
dbKey: segment2.key,
|
|
3929
4026
|
role: "assistant",
|
|
@@ -3974,6 +4071,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
3974
4071
|
errorToolNameById
|
|
3975
4072
|
);
|
|
3976
4073
|
await persistMessageWithFixedId(dispatch, {
|
|
4074
|
+
dialogId,
|
|
3977
4075
|
id: segment2.messageId,
|
|
3978
4076
|
dbKey: segment2.key,
|
|
3979
4077
|
role: "assistant",
|
|
@@ -4015,8 +4113,12 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
4015
4113
|
setLoopStopReason("error");
|
|
4016
4114
|
};
|
|
4017
4115
|
if (streamError) {
|
|
4018
|
-
|
|
4019
|
-
|
|
4116
|
+
const info = classifyLocalTurnStreamError(streamError);
|
|
4117
|
+
const finalError = info.actionHint ? `${streamError}
|
|
4118
|
+
|
|
4119
|
+
${info.actionHint}` : streamError;
|
|
4120
|
+
await finalizeDesktopTurnOnError(finalError);
|
|
4121
|
+
return rejectWithValue(finalError);
|
|
4020
4122
|
}
|
|
4021
4123
|
if (!streamResult) {
|
|
4022
4124
|
const message = "Local turn stream closed unexpectedly without result";
|
|
@@ -4146,6 +4248,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
4146
4248
|
let accumulated = "";
|
|
4147
4249
|
let totalTurnUsage2 = void 0;
|
|
4148
4250
|
const buildRemoteAssistantMessage = () => ({
|
|
4251
|
+
dialogId,
|
|
4149
4252
|
id: messageId,
|
|
4150
4253
|
dbKey: msgKey,
|
|
4151
4254
|
role: "assistant",
|
|
@@ -4190,6 +4293,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
4190
4293
|
stream: true,
|
|
4191
4294
|
persistDialog: false,
|
|
4192
4295
|
clientDialogId: dialogId,
|
|
4296
|
+
...explicitTarget ? { runtimeTarget: explicitTarget } : {},
|
|
4193
4297
|
runtimeContext: {
|
|
4194
4298
|
surface: "web",
|
|
4195
4299
|
host: "browser",
|
|
@@ -4982,6 +5086,7 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
4982
5086
|
error?.message || "An unexpected error occurred in streamAgentChatTurn."
|
|
4983
5087
|
);
|
|
4984
5088
|
} finally {
|
|
5089
|
+
clearDialogTurnPhase({ dialogKey: runtimeDialogKey ?? void 0, turnId: turnPhaseTurnId ?? void 0 });
|
|
4985
5090
|
if (loopKey && runtimeDialogKey) {
|
|
4986
5091
|
dispatch(removeActiveController({ messageId: loopKey, dialogKey: runtimeDialogKey }));
|
|
4987
5092
|
} else if (loopKey) {
|
|
@@ -5001,5 +5106,6 @@ var streamAgentChatTurnHandler = async (args, thunkApi) => {
|
|
|
5001
5106
|
}
|
|
5002
5107
|
};
|
|
5003
5108
|
export {
|
|
5109
|
+
classifyLocalTurnStreamError,
|
|
5004
5110
|
streamAgentChatTurnHandler
|
|
5005
5111
|
};
|