nolo-cli 0.107.0-alpha.4 → 0.107.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-UDCSOTD2.js → _executeModel-C4EH5TZG.js} +77 -69
- package/action-GVA5ARSJ.js +20 -0
- package/{addContentAction-MB2HHMDZ.js → addContentAction-M2WOWZCL.js} +13 -12
- package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-QMAQ5Z6N.js} +19 -20
- package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-D3RICSHX.js} +118 -43
- package/{agentEmailCommands-AU5I4M4W.js → agentEmailCommands-YC2A4USQ.js} +99 -89
- package/agentListCommands-UDJELMYP.js +741 -0
- package/{agentMachineCommands-YMNME2L6.js → agentMachineCommands-XH4IBGTO.js} +48 -44
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-CMVTBY5X.js} +97 -2
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-3EOC2QMN.js +138 -0
- package/agentRunCommand-BTHYOVVS.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-N4YGKL7M.js} +44 -40
- package/{agentSlice-R7PR6KYM.js → agentSlice-NIN4T6CF.js} +15 -14
- package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-7DAF33AM.js} +46 -42
- package/{appDeployCommands-UTB76XFM.js → appDeployCommands-ZPZSMFGZ.js} +46 -42
- package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-FWBDSSS5.js} +46 -42
- package/{appGetCommands-PX2BFHOB.js → appGetCommands-SZZOHGEP.js} +46 -42
- package/{appListCommands-BSMPTWKC.js → appListCommands-FPMUBDPM.js} +46 -42
- package/{authCommand-YW42YZA4.js → authCommand-VL3G26NQ.js} +119 -25
- package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZK4K67Y5.js} +11 -9
- package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
- package/{chunk-JDPFV2JV.js → chunk-2NNRWRM5.js} +20 -11
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
- package/{chunk-UVA7OYO3.js → chunk-2ZHBFX5R.js} +29 -9
- package/{chunk-QTGQ2LTL.js → chunk-3DQY5IFB.js} +6 -10
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-IBOOZVVD.js → chunk-6IJDSYUA.js} +849 -279
- package/{chunk-4MK3I7Y4.js → chunk-6MAW4XOF.js} +5 -5
- package/chunk-76HO2DP6.js +15 -0
- package/chunk-7AY2H3GA.js +13692 -0
- package/{chunk-4CR5I7BD.js → chunk-7HYOPBUW.js} +47 -67
- package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-6OZ36FXI.js → chunk-BIPGGSJS.js} +22 -4
- package/{chunk-EYAQT56M.js → chunk-BNQMNUKZ.js} +9 -6
- package/{chunk-62CATUYY.js → chunk-CBUMFIFE.js} +834 -962
- package/{chunk-OIVSQH2O.js → chunk-CDEEFJXN.js} +308 -11
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-ETI2NYVF.js → chunk-CIP3AAMT.js} +4 -4
- package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
- package/{chunk-IBOZNTG2.js → chunk-DGEUP3DK.js} +23 -28
- package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
- package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
- package/{chunk-HKNXJGEC.js → chunk-ECFHBYUW.js} +85 -50
- package/{chunk-ACTMNVHM.js → chunk-EHSYSKXV.js} +1 -1
- package/{chunk-WV42OMV7.js → chunk-ELUDRSRD.js} +8 -8
- package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-BFDFRLLQ.js → chunk-EZ4VZHAG.js} +5 -5
- package/{chunk-GO3Z72MT.js → chunk-FHLMQIU7.js} +65 -95
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
- package/chunk-GMZLP5DV.js +82 -0
- package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
- 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-BNGW5ASC.js → chunk-I2RGRVQ7.js} +22 -2
- package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
- package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
- package/{chunk-GQBOR3G6.js → chunk-JBKHQOYK.js} +8 -4
- package/{chunk-XD2MJFUG.js → chunk-JEFXP73H.js} +1 -1
- package/{chunk-PBA4UJBK.js → chunk-JIXGJTBU.js} +4 -4
- package/{chunk-AEOE4Z6Q.js → chunk-K6L5PNXK.js} +39 -15
- package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
- package/{chunk-GPCZ7UXG.js → chunk-KD6D6BLA.js} +1 -1
- package/{chunk-UZGQNTVW.js → chunk-KHKTDMYG.js} +8 -6
- package/{chunk-MRIHM22T.js → chunk-LBFL6RZG.js} +58 -9
- package/{chunk-C3M4465B.js → chunk-LKIVH2I2.js} +403 -658
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
- package/{chunk-NA35QHCF.js → chunk-LVBFKW65.js} +1 -1
- package/chunk-LWLNLZC5.js +265 -0
- package/{chunk-EEGDMATE.js → chunk-M3NMHYRB.js} +86 -81
- package/chunk-N4NGJDT6.js +929 -0
- package/{chunk-GL3EHUR4.js → chunk-N7NLLRQQ.js} +68 -46
- 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-6Z7MY3V7.js → chunk-OEJLGVBL.js} +5 -5
- package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
- package/{chunk-GEPUP7OO.js → chunk-OR2UWD6X.js} +3 -3
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-J4MOO56S.js → chunk-PNXHPLRU.js} +10 -2
- package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
- package/{chunk-P5EVSOPA.js → chunk-R6EBQEQE.js} +22 -29
- package/{chunk-NOF3HDSN.js → chunk-RLSF5CSE.js} +11 -9
- package/chunk-RQ6CTX2E.js +164 -0
- package/{chunk-3UZPUAES.js → chunk-RSB4PWX4.js} +1 -1
- package/{chunk-KQ4ONNQD.js → chunk-RXA3HAVW.js} +190 -8
- package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
- package/chunk-SQHMSDDU.js +8004 -0
- package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
- package/{chunk-JRQFUXY7.js → chunk-TBAXFWOS.js} +99 -22
- package/{chunk-PQFHGD77.js → chunk-TBM2RS3U.js} +161 -14
- package/{chunk-XT35TTFG.js → chunk-TCYU7L6V.js} +18 -20
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
- package/chunk-UM7TA3K4.js +1008 -0
- package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-W7HLWAQ7.js → chunk-VPLUU4IX.js} +118 -90
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/chunk-VZLO4XJD.js +17 -0
- package/{chunk-AHAHBQMU.js → chunk-WDLSZMTA.js} +2 -2
- package/{chunk-53HEEOTT.js → chunk-WF5X57VW.js} +83 -16
- package/{chunk-VRTTFDBM.js → chunk-WPHY3VPF.js} +35 -22
- package/{chunk-ASIFZ2WY.js → chunk-YKZLFY5J.js} +66 -54
- package/chunk-YV25TM3R.js +780 -0
- package/{chunk-MS7TSPZR.js → chunk-YXKNBVYW.js} +19 -17
- package/chunk-ZRAU6T47.js +56 -0
- package/commandRegistry-UU6IOTHI.js +833 -0
- package/{contentThunks-IV2T3EJC.js → contentThunks-ARD56LKI.js} +39 -36
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-JCOIEYY4.js → createAgentAutomationAction-HWJLU6DD.js} +40 -37
- package/createDialogAction-CHYA6PZE.js +70 -0
- package/{createPageAction-D2VOOLP3.js → createPageAction-TSCYNFX7.js} +47 -43
- package/{chunk-FG3HKPQP.js → cursorProvider-YGGNMVWX.js} +2751 -10185
- package/{dbSlice-A6C6H32X.js → dbSlice-TG4MZ5EB.js} +12 -11
- package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
- package/{dialogCommands-H7FPUYUQ.js → dialogCommands-IJYQAQMB.js} +49 -46
- package/{dialogSlice-6JZOOTDS.js → dialogSlice-H476I77R.js} +57 -37
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-AZSK4NAG.js} +48 -44
- package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-DDJMSMFZ.js} +49 -45
- package/{docReadCommands-WJN3WT6O.js → docReadCommands-5F5Q6EBZ.js} +47 -43
- package/{docStore-HUPQ2FSS.js → docStore-HW2RDZDM.js} +17 -13
- package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-XPNPVZOC.js} +48 -44
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-DOBBZLOK.js} +4 -4
- package/{handleSendMessageAction-DFPMQ7YM.js → handleSendMessageAction-IOXE7ILC.js} +109 -42
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-M2T2I5NF.js → machineCommands-Q7TDGM6P.js} +96 -86
- package/machineWsRunDispatch-T5VFOQ3R.js +154 -0
- package/{memberThunks-P2ECUJ56.js → memberThunks-5S5D3N4U.js} +20 -18
- package/{models-T3SG6MJ5.js → models-PQU25T6Q.js} +2 -2
- package/oauthTokenStore-ITEB663N.js +23 -0
- package/package.json +1 -1
- package/processSpawn-SOAV3FEV.js +11 -0
- package/profileConfig-ZGOFORWV.js +43 -0
- package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HAQWVAQX.js} +7 -7
- package/{providerRegistry-757OWH3O.js → providerRegistry-5FGWB3X5.js} +11 -7
- package/{read-COE3ZYR6.js → read-LSYFLSIM.js} +8 -7
- package/{readDocTool-5USN4A6V.js → readDocTool-XWRXV3DR.js} +5 -3
- package/{readlineWorkspace-XQRDGWRZ.js → readlineWorkspace-25U6P3DG.js} +2595 -2031
- package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-4TEFC3VL.js} +22 -26
- package/{runAgentClientLoop-5ZA62FBA.js → runAgentClientLoop-CZOYWHDN.js} +78 -71
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-WX5VTY6O.js → setDialogExtraReferencesAction-LSEN44OY.js} +16 -14
- package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-SR366X5A.js} +23 -27
- package/{chunk-GP5LKBUZ.js → settingThunks-CTVPPGIN.js} +226 -940
- package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
- package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
- package/{spaceCommands-5GLCWZPO.js → spaceCommands-3UK63WPE.js} +51 -47
- package/{streamAgentChatTurn-6UZJMYRB.js → streamAgentChatTurn-LV6ZWUD4.js} +214 -114
- package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-M6NAFOOU.js} +19 -20
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
- package/tools-UJOV6CQZ.js +117 -0
- package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-DEH7ZEM6.js} +25 -23
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-QTKNIURB.js → updateDialogTitleAction-JYXKIBNJ.js} +84 -45
- package/action-P4TNFGAD.js +0 -31
- package/agentListCommands-B2V4YAC4.js +0 -410
- package/agentRecordCommands-G4KK4R7H.js +0 -128
- package/agentRunCommand-UTZJA23G.js +0 -156
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-2P6NFX64.js +0 -186
- package/chunk-CQ3WA2NE.js +0 -299
- package/chunk-M76ECQRD.js +0 -13658
- package/chunk-MEYIRKDN.js +0 -8967
- package/chunk-PUOC4YRO.js +0 -394
- package/chunk-Q5FJJ6XI.js +0 -103
- package/chunk-S7Z2HMCN.js +0 -25
- package/chunk-T75QD6AB.js +0 -20923
- package/chunk-Y5GCAMGP.js +0 -9
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-NGG7YVNU.js +0 -65
- package/machineWsRunDispatch-ISBKOOD7.js +0 -144
- package/settingSlice-P4ZW7K5X.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-KMGFWO43.js +0 -110
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createChatQueueRuntime,
|
|
3
|
-
createTurnRequest
|
|
4
|
-
} from "./chunk-YPREESF4.js";
|
|
5
|
-
import {
|
|
6
|
-
handleSendMessage
|
|
7
|
-
} from "./chunk-T75QD6AB.js";
|
|
8
|
-
import "./chunk-MC4XLIJ7.js";
|
|
9
|
-
import "./chunk-3BMYXEUW.js";
|
|
10
|
-
import "./chunk-YYLHWIW6.js";
|
|
11
|
-
import "./chunk-AGGIDPCZ.js";
|
|
12
|
-
import "./chunk-NOF3HDSN.js";
|
|
13
|
-
import "./chunk-BFDFRLLQ.js";
|
|
14
|
-
import "./chunk-5RGU3J7P.js";
|
|
15
|
-
import {
|
|
16
|
-
clearPendingUserInputQueue,
|
|
17
|
-
dequeueUserInput,
|
|
18
|
-
enqueueUserInput,
|
|
19
|
-
getLoopStopReason,
|
|
20
|
-
getPendingUserInputQueue
|
|
21
|
-
} from "./chunk-6YTOJY35.js";
|
|
22
|
-
import "./chunk-M76ECQRD.js";
|
|
23
|
-
import "./chunk-YDH3FDFQ.js";
|
|
24
|
-
import "./chunk-HKNXJGEC.js";
|
|
25
|
-
import "./chunk-P5EVSOPA.js";
|
|
26
|
-
import "./chunk-PSCNXBYA.js";
|
|
27
|
-
import "./chunk-GQBOR3G6.js";
|
|
28
|
-
import "./chunk-BYXBJQAS.js";
|
|
29
|
-
import "./chunk-OIVSQH2O.js";
|
|
30
|
-
import "./chunk-DWLEOOGR.js";
|
|
31
|
-
import "./chunk-HVURBGF3.js";
|
|
32
|
-
import "./chunk-ONXOABJR.js";
|
|
33
|
-
import "./chunk-W7XHHYWM.js";
|
|
34
|
-
import "./chunk-HNMXYYJR.js";
|
|
35
|
-
import "./chunk-7S4YWN7P.js";
|
|
36
|
-
import "./chunk-ACTMNVHM.js";
|
|
37
|
-
import "./chunk-Q67DOFOO.js";
|
|
38
|
-
import "./chunk-GP5LKBUZ.js";
|
|
39
|
-
import "./chunk-Y5GCAMGP.js";
|
|
40
|
-
import "./chunk-QDSINZM3.js";
|
|
41
|
-
import "./chunk-KX6YBIHG.js";
|
|
42
|
-
import "./chunk-AHAHBQMU.js";
|
|
43
|
-
import "./chunk-UAD2WT54.js";
|
|
44
|
-
import "./chunk-VRTTFDBM.js";
|
|
45
|
-
import "./chunk-VMFTFOWF.js";
|
|
46
|
-
import "./chunk-WWC7I6TA.js";
|
|
47
|
-
import "./chunk-ABQYVJBJ.js";
|
|
48
|
-
import "./chunk-QSJ3HFEF.js";
|
|
49
|
-
import "./chunk-WV42OMV7.js";
|
|
50
|
-
import "./chunk-BNGW5ASC.js";
|
|
51
|
-
import "./chunk-M2EJHDJP.js";
|
|
52
|
-
import "./chunk-UKWGR5SS.js";
|
|
53
|
-
import "./chunk-QOKAKDPE.js";
|
|
54
|
-
import "./chunk-OW765XBU.js";
|
|
55
|
-
import "./chunk-SEJ5OS6F.js";
|
|
56
|
-
import "./chunk-GBRG75BQ.js";
|
|
57
|
-
import "./chunk-KUG52IAP.js";
|
|
58
|
-
import "./chunk-3EUW3WEO.js";
|
|
59
|
-
import "./chunk-U6VC4MU4.js";
|
|
60
|
-
import "./chunk-LCBAMY2M.js";
|
|
61
|
-
import "./chunk-4SN6J65J.js";
|
|
62
|
-
import "./chunk-CF7PE763.js";
|
|
63
|
-
import "./chunk-G3SUCT4W.js";
|
|
64
|
-
import "./chunk-4VNS5WPM.js";
|
|
65
|
-
|
|
66
|
-
// packages/chat/queue/chatQueueReduxAdapter.ts
|
|
67
|
-
var ChatQueueReduxAdapter = class {
|
|
68
|
-
runtimes = /* @__PURE__ */ new Map();
|
|
69
|
-
store;
|
|
70
|
-
opts;
|
|
71
|
-
/** Pending drain promises per dialog, so notifyTurnEnd can be awaited. */
|
|
72
|
-
pendingDrains = /* @__PURE__ */ new Map();
|
|
73
|
-
constructor(store, opts = {}) {
|
|
74
|
-
this.store = store;
|
|
75
|
-
this.opts = opts;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Get (or lazily create) the runtime for a dialog. The runtime is seeded from
|
|
79
|
-
* dialogRuntimeStore `pendingUserInputQueue` so we don't lose queued items
|
|
80
|
-
* written before the adapter existed.
|
|
81
|
-
*/
|
|
82
|
-
getRuntime(dialogKey) {
|
|
83
|
-
let rt = this.runtimes.get(dialogKey);
|
|
84
|
-
if (rt) return rt;
|
|
85
|
-
const legacyQueue = getPendingUserInputQueue(dialogKey);
|
|
86
|
-
const seed = {
|
|
87
|
-
running: false,
|
|
88
|
-
queue: Array.isArray(legacyQueue) ? legacyQueue.map((t) => createTurnRequest(t)) : [],
|
|
89
|
-
drainPaused: getLoopStopReason(dialogKey) === "pending",
|
|
90
|
-
lastDrainError: null
|
|
91
|
-
};
|
|
92
|
-
rt = createChatQueueRuntime(seed);
|
|
93
|
-
this.runtimes.set(dialogKey, rt);
|
|
94
|
-
rt.on("drain-ready", ({ text }) => {
|
|
95
|
-
const dispatch = this.store.dispatch;
|
|
96
|
-
const runtime = rt;
|
|
97
|
-
const promise = (async () => {
|
|
98
|
-
try {
|
|
99
|
-
if (this.opts.sendDrainedText) {
|
|
100
|
-
await this.opts.sendDrainedText({ dialogKey, text, dispatch });
|
|
101
|
-
} else {
|
|
102
|
-
await dispatch(
|
|
103
|
-
handleSendMessage({
|
|
104
|
-
dialogKey,
|
|
105
|
-
userInput: text
|
|
106
|
-
})
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
runtime.send({ type: "dequeue" });
|
|
110
|
-
dequeueUserInput({ dialogKey });
|
|
111
|
-
} catch (error) {
|
|
112
|
-
const message = error instanceof Error ? error.message : typeof error === "string" ? error : "drain send failed";
|
|
113
|
-
runtime.send({ type: "drain-error", message });
|
|
114
|
-
} finally {
|
|
115
|
-
this.pendingDrains.delete(dialogKey);
|
|
116
|
-
}
|
|
117
|
-
})();
|
|
118
|
-
this.pendingDrains.set(dialogKey, promise);
|
|
119
|
-
});
|
|
120
|
-
return rt;
|
|
121
|
-
}
|
|
122
|
-
/** Drop a dialog's runtime (e.g. when the dialog is closed/deleted). */
|
|
123
|
-
disposeRuntime(dialogKey) {
|
|
124
|
-
const rt = this.runtimes.get(dialogKey);
|
|
125
|
-
if (rt) {
|
|
126
|
-
rt.dispose();
|
|
127
|
-
this.runtimes.delete(dialogKey);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/** Call when an agent turn starts streaming for this dialog. */
|
|
131
|
-
notifyTurnStart(dialogKey) {
|
|
132
|
-
this.getRuntime(dialogKey).send({ type: "turn-start" });
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Call when an agent turn ends for this dialog.
|
|
136
|
-
* `ok` false without `aborted` keeps the queue (failure stop); `aborted`
|
|
137
|
-
* clears the queue (user abandoned follow-ups) both in the core and in the
|
|
138
|
-
* dialogRuntimeStore shadow.
|
|
139
|
-
*
|
|
140
|
-
* Returns a promise that resolves once any drain triggered by this turn-end
|
|
141
|
-
* has committed (sent + dequeued) or failed. Callers that need to assert on
|
|
142
|
-
* the post-drain state should await it.
|
|
143
|
-
*/
|
|
144
|
-
notifyTurnEnd(dialogKey, outcome) {
|
|
145
|
-
const rt = this.getRuntime(dialogKey);
|
|
146
|
-
rt.send({ type: "turn-end", ...outcome });
|
|
147
|
-
if (outcome.aborted) {
|
|
148
|
-
clearPendingUserInputQueue({ dialogKey });
|
|
149
|
-
}
|
|
150
|
-
const pending = this.pendingDrains.get(dialogKey);
|
|
151
|
-
return pending ? pending.then(() => void 0) : Promise.resolve();
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Enqueue a user input through the adapter. This writes to both the core
|
|
155
|
-
* runtime and the dialogRuntimeStore queue so existing UI hooks keep working
|
|
156
|
-
* during the migration.
|
|
157
|
-
*
|
|
158
|
-
* Order matters: we touch the runtime first (creating it if needed, seeded
|
|
159
|
-
* from the *current* store shadow) and then mirror into the store. Doing it
|
|
160
|
-
* the other way around would let the seed read back the value we just wrote
|
|
161
|
-
* and double-count it.
|
|
162
|
-
*/
|
|
163
|
-
enqueue(dialogKey, text) {
|
|
164
|
-
const runtime = this.getRuntime(dialogKey);
|
|
165
|
-
runtime.send({ type: "enqueue", text });
|
|
166
|
-
enqueueUserInput({ text, dialogKey });
|
|
167
|
-
return {
|
|
168
|
-
accepted: true,
|
|
169
|
-
queueLength: runtime.getState().queue.length
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
/** Current queue snapshot (from the core runtime). */
|
|
173
|
-
getQueue(dialogKey) {
|
|
174
|
-
return this.getRuntime(dialogKey).getState().queue.map((req) => req.text);
|
|
175
|
-
}
|
|
176
|
-
/** Reflect `loopStopReason === "pending"` into the runtime's pause flag. */
|
|
177
|
-
syncDrainPause(dialogKey) {
|
|
178
|
-
const paused = getLoopStopReason(dialogKey) === "pending";
|
|
179
|
-
const rt = this.getRuntime(dialogKey);
|
|
180
|
-
if (paused) rt.send({ type: "pause-drain" });
|
|
181
|
-
else rt.send({ type: "resume-drain" });
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
export {
|
|
185
|
-
ChatQueueReduxAdapter
|
|
186
|
-
};
|
package/chunk-CQ3WA2NE.js
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
// packages/agent-runtime/declaredToolNames.ts
|
|
2
|
-
function extractDeclaredToolNames(tools) {
|
|
3
|
-
if (!Array.isArray(tools)) return void 0;
|
|
4
|
-
const names = /* @__PURE__ */ new Set();
|
|
5
|
-
for (const t of tools) {
|
|
6
|
-
const fn = t?.function;
|
|
7
|
-
if (fn && typeof fn.name === "string" && fn.name) names.add(fn.name);
|
|
8
|
-
}
|
|
9
|
-
return names;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// packages/agent-runtime/outboundHistorySanitize.ts
|
|
13
|
-
function sanitizeForOutbound(messages, tools) {
|
|
14
|
-
return sanitizeOutboundHistory(messages, {
|
|
15
|
-
declaredToolNames: extractDeclaredToolNames(tools)
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function stableToolCallId(assistantIndex, callIndex) {
|
|
19
|
-
return `call_sanitize_${assistantIndex}_${callIndex}`;
|
|
20
|
-
}
|
|
21
|
-
function isString(v) {
|
|
22
|
-
return typeof v === "string";
|
|
23
|
-
}
|
|
24
|
-
function isNonEmptyString(v) {
|
|
25
|
-
return typeof v === "string" && v.length > 0;
|
|
26
|
-
}
|
|
27
|
-
function joinLines(...parts) {
|
|
28
|
-
return parts.filter(isNonEmptyString).join("\n");
|
|
29
|
-
}
|
|
30
|
-
function jsonStringifyArguments(args) {
|
|
31
|
-
if (typeof args === "string") return args;
|
|
32
|
-
try {
|
|
33
|
-
return JSON.stringify(args ?? "");
|
|
34
|
-
} catch {
|
|
35
|
-
return "";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function renderToolCallAsText(call) {
|
|
39
|
-
const name = call?.function?.name ?? "unknown";
|
|
40
|
-
const rawArgs = call?.function?.arguments;
|
|
41
|
-
const args = jsonStringifyArguments(rawArgs);
|
|
42
|
-
return `[tool_call: ${name}(${args})]`;
|
|
43
|
-
}
|
|
44
|
-
function renderToolResultAsText(message) {
|
|
45
|
-
const name = isNonEmptyString(message.toolName) ? message.toolName : "tool";
|
|
46
|
-
const body = typeof message.content === "string" ? message.content : "";
|
|
47
|
-
return `[tool_result: ${name}: ${body}]`;
|
|
48
|
-
}
|
|
49
|
-
function normalizeToolCall(call, assistantIndex, callIndex) {
|
|
50
|
-
if (!call || typeof call !== "object") return null;
|
|
51
|
-
const c = call;
|
|
52
|
-
const fn = c.function;
|
|
53
|
-
if (!fn || typeof fn !== "object" || !isString(fn.name)) return null;
|
|
54
|
-
const id = isNonEmptyString(c.id) ? c.id : stableToolCallId(assistantIndex, callIndex);
|
|
55
|
-
return {
|
|
56
|
-
id,
|
|
57
|
-
type: isString(c.type) && c.type ? c.type : "function",
|
|
58
|
-
function: { name: fn.name, arguments: jsonStringifyArguments(fn.arguments) },
|
|
59
|
-
...typeof c.thought_signature === "string" ? { thought_signature: c.thought_signature } : {}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function sanitizeOutboundHistory(messages, options) {
|
|
63
|
-
if (!Array.isArray(messages) || messages.length === 0) return messages;
|
|
64
|
-
const declared = options?.declaredToolNames;
|
|
65
|
-
const candidateCallIds = /* @__PURE__ */ new Set();
|
|
66
|
-
for (let i = 0; i < messages.length; i++) {
|
|
67
|
-
const m = messages[i];
|
|
68
|
-
if (m.role !== "assistant" || !Array.isArray(m.tool_calls)) continue;
|
|
69
|
-
m.tool_calls.forEach((call, callIndex) => {
|
|
70
|
-
const name = call?.function?.name;
|
|
71
|
-
const declaredAllows = !declared || isString(name) && declared.has(name);
|
|
72
|
-
if (!declaredAllows) return;
|
|
73
|
-
if (!hasParsableObjectArguments(call?.function?.arguments)) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const id = isNonEmptyString(call?.id) ? call.id : stableToolCallId(i, callIndex);
|
|
77
|
-
candidateCallIds.add(id);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
const resultIds = /* @__PURE__ */ new Set();
|
|
81
|
-
for (const m of messages) {
|
|
82
|
-
if (m.role === "tool" && isNonEmptyString(m.tool_call_id)) {
|
|
83
|
-
resultIds.add(m.tool_call_id);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
const keepCallIds = /* @__PURE__ */ new Set();
|
|
87
|
-
for (const id of candidateCallIds) {
|
|
88
|
-
if (resultIds.has(id)) keepCallIds.add(id);
|
|
89
|
-
}
|
|
90
|
-
const out = [];
|
|
91
|
-
for (let i = 0; i < messages.length; i++) {
|
|
92
|
-
const m = messages[i];
|
|
93
|
-
if (m.role === "assistant") {
|
|
94
|
-
let toolCalls;
|
|
95
|
-
const downgradedLines = [];
|
|
96
|
-
if (Array.isArray(m.tool_calls) && m.tool_calls.length > 0) {
|
|
97
|
-
const kept = [];
|
|
98
|
-
m.tool_calls.forEach((call, callIndex) => {
|
|
99
|
-
const name = call?.function?.name;
|
|
100
|
-
const declaredAllows = !declared || isString(name) && declared.has(name);
|
|
101
|
-
const id = isNonEmptyString(call?.id) ? call.id : stableToolCallId(i, callIndex);
|
|
102
|
-
const keepStructural = declaredAllows && keepCallIds.has(id);
|
|
103
|
-
if (keepStructural) {
|
|
104
|
-
const normalized = normalizeToolCall(call, i, callIndex);
|
|
105
|
-
if (normalized) kept.push(normalized);
|
|
106
|
-
} else {
|
|
107
|
-
downgradedLines.push(renderToolCallAsText(call));
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
toolCalls = kept.length > 0 ? kept : void 0;
|
|
111
|
-
}
|
|
112
|
-
const downgradedText = joinLines(...downgradedLines);
|
|
113
|
-
const contentWithDowngrade = downgradedText.length > 0 ? combineContentWithText(m.content, downgradedText) : m.content;
|
|
114
|
-
const sanitizedAssistant = {
|
|
115
|
-
...m,
|
|
116
|
-
content: contentWithDowngrade,
|
|
117
|
-
tool_calls: toolCalls
|
|
118
|
-
};
|
|
119
|
-
if (!toolCalls) delete sanitizedAssistant.tool_calls;
|
|
120
|
-
out.push(sanitizedAssistant);
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
if (m.role === "tool") {
|
|
124
|
-
const id = isNonEmptyString(m.tool_call_id) ? m.tool_call_id : "";
|
|
125
|
-
if (id && keepCallIds.has(id)) {
|
|
126
|
-
out.push({ ...m, content: m.content ?? "", tool_call_id: id });
|
|
127
|
-
} else {
|
|
128
|
-
out.push({
|
|
129
|
-
role: "assistant",
|
|
130
|
-
content: renderToolResultAsText(m)
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
out.push({ ...m });
|
|
136
|
-
}
|
|
137
|
-
return out;
|
|
138
|
-
}
|
|
139
|
-
function combineContentWithText(base, extra) {
|
|
140
|
-
if (typeof base === "string") {
|
|
141
|
-
return base ? `${base}
|
|
142
|
-
${extra}` : extra;
|
|
143
|
-
}
|
|
144
|
-
if (Array.isArray(base)) {
|
|
145
|
-
return [...base, { type: "text", text: extra }];
|
|
146
|
-
}
|
|
147
|
-
return extra;
|
|
148
|
-
}
|
|
149
|
-
function hasParsableObjectArguments(raw) {
|
|
150
|
-
if (raw === void 0) return true;
|
|
151
|
-
if (raw === null || typeof raw === "number" || typeof raw === "boolean") {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
if (typeof raw !== "string") return true;
|
|
155
|
-
if (raw.trim() === "") return true;
|
|
156
|
-
try {
|
|
157
|
-
const parsed = JSON.parse(raw);
|
|
158
|
-
return parsed !== null && typeof parsed === "object";
|
|
159
|
-
} catch {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
var STRICT_JSON_STRING_TOKEN = /^"(?:[^"\\\u0000-\u001F]|\\["\\/bfnrt]|\\u[0-9A-Fa-f]{4})*"$/;
|
|
164
|
-
function isStrictJsonStringToken(value) {
|
|
165
|
-
if (!STRICT_JSON_STRING_TOKEN.test(value)) return false;
|
|
166
|
-
try {
|
|
167
|
-
return typeof JSON.parse(value) === "string";
|
|
168
|
-
} catch {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function closersOf(openStack) {
|
|
173
|
-
return openStack.slice().reverse().map((ch) => ch === "{" ? "}" : "]").join("");
|
|
174
|
-
}
|
|
175
|
-
function scanJsonForTailRepair(input) {
|
|
176
|
-
const stack = [];
|
|
177
|
-
let inString = false;
|
|
178
|
-
let escaped = false;
|
|
179
|
-
let lastCommaOutsideString = null;
|
|
180
|
-
for (let i = 0; i < input.length; i += 1) {
|
|
181
|
-
const ch = input[i];
|
|
182
|
-
if (inString) {
|
|
183
|
-
if (escaped) escaped = false;
|
|
184
|
-
else if (ch === "\\") escaped = true;
|
|
185
|
-
else if (ch === '"') inString = false;
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
if (ch === '"') {
|
|
189
|
-
inString = true;
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
if (ch === "{" || ch === "[") {
|
|
193
|
-
stack.push(ch);
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
196
|
-
if (ch === "}" || ch === "]") {
|
|
197
|
-
const open = stack.pop();
|
|
198
|
-
if (open !== (ch === "}" ? "{" : "[")) return null;
|
|
199
|
-
continue;
|
|
200
|
-
}
|
|
201
|
-
if (ch === ",") {
|
|
202
|
-
lastCommaOutsideString = { index: i, closers: closersOf(stack) };
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return { inString, closers: closersOf(stack), lastCommaOutsideString };
|
|
207
|
-
}
|
|
208
|
-
function repairTruncatedToolArguments(raw) {
|
|
209
|
-
if (typeof raw !== "string") return null;
|
|
210
|
-
const withoutTrailingSpace = raw.replace(/\s+$/, "");
|
|
211
|
-
const endsWithComma = withoutTrailingSpace.endsWith(",");
|
|
212
|
-
const trimmed = endsWithComma ? withoutTrailingSpace.slice(0, -1).replace(/\s+$/, "") : withoutTrailingSpace;
|
|
213
|
-
if (trimmed === "" || trimmed.endsWith(",")) return null;
|
|
214
|
-
const scan = scanJsonForTailRepair(trimmed);
|
|
215
|
-
if (!scan || scan.inString) return null;
|
|
216
|
-
const lastChar = trimmed[trimmed.length - 1];
|
|
217
|
-
const tailIsCompleteToken = endsWithComma || lastChar === '"' || lastChar === "}" || lastChar === "]";
|
|
218
|
-
if (!tailIsCompleteToken) return null;
|
|
219
|
-
const candidates = [trimmed + scan.closers];
|
|
220
|
-
const lastComma = scan.lastCommaOutsideString;
|
|
221
|
-
if (lastComma && lastComma.index > 0) {
|
|
222
|
-
const tailAfterComma = trimmed.slice(lastComma.index + 1).trim();
|
|
223
|
-
if (isStrictJsonStringToken(tailAfterComma)) {
|
|
224
|
-
const head = trimmed.slice(0, lastComma.index);
|
|
225
|
-
candidates.push(head + lastComma.closers);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
for (const candidate of candidates) {
|
|
229
|
-
try {
|
|
230
|
-
const parsed = JSON.parse(candidate);
|
|
231
|
-
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && Object.keys(parsed).length > 0) {
|
|
232
|
-
return candidate;
|
|
233
|
-
}
|
|
234
|
-
} catch {
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
function downgradeUnparsableToolCalls(messages) {
|
|
240
|
-
if (!Array.isArray(messages) || messages.length === 0) {
|
|
241
|
-
return { messages, downgraded: 0 };
|
|
242
|
-
}
|
|
243
|
-
const poisonIds = /* @__PURE__ */ new Set();
|
|
244
|
-
for (let i = 0; i < messages.length; i++) {
|
|
245
|
-
const m = messages[i];
|
|
246
|
-
if (m.role !== "assistant" || !Array.isArray(m.tool_calls)) continue;
|
|
247
|
-
m.tool_calls.forEach((call, callIndex) => {
|
|
248
|
-
if (!hasParsableObjectArguments(call?.function?.arguments)) {
|
|
249
|
-
const id = isNonEmptyString(call?.id) ? call.id : stableToolCallId(i, callIndex);
|
|
250
|
-
poisonIds.add(id);
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
if (poisonIds.size === 0) return { messages, downgraded: 0 };
|
|
255
|
-
let downgraded = 0;
|
|
256
|
-
const out = [];
|
|
257
|
-
for (const m of messages) {
|
|
258
|
-
if (m.role === "assistant" && Array.isArray(m.tool_calls) && m.tool_calls.length > 0) {
|
|
259
|
-
const kept = [];
|
|
260
|
-
const lines = [];
|
|
261
|
-
for (const call of m.tool_calls) {
|
|
262
|
-
if (!hasParsableObjectArguments(call?.function?.arguments)) {
|
|
263
|
-
lines.push(renderToolCallAsText(call));
|
|
264
|
-
downgraded++;
|
|
265
|
-
} else {
|
|
266
|
-
kept.push(call);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
if (lines.length === 0) {
|
|
270
|
-
out.push(m);
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
const sanitized = {
|
|
274
|
-
...m,
|
|
275
|
-
content: combineContentWithText(m.content, joinLines(...lines)),
|
|
276
|
-
tool_calls: kept.length > 0 ? kept : void 0
|
|
277
|
-
};
|
|
278
|
-
if (kept.length === 0) delete sanitized.tool_calls;
|
|
279
|
-
out.push(sanitized);
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
if (m.role === "tool") {
|
|
283
|
-
const id = isNonEmptyString(m.tool_call_id) ? m.tool_call_id : "";
|
|
284
|
-
if (id && poisonIds.has(id)) {
|
|
285
|
-
out.push({ role: "assistant", content: renderToolResultAsText(m) });
|
|
286
|
-
continue;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
out.push(m);
|
|
290
|
-
}
|
|
291
|
-
return { messages: out, downgraded };
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export {
|
|
295
|
-
sanitizeForOutbound,
|
|
296
|
-
hasParsableObjectArguments,
|
|
297
|
-
repairTruncatedToolArguments,
|
|
298
|
-
downgradeUnparsableToolCalls
|
|
299
|
-
};
|