nolo-cli 0.99.0-alpha.1 → 0.99.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-CJP7VSJB.js → _executeModel-F324DLT6.js} +74 -67
- package/action-PNPQLJHG.js +20 -0
- package/{addContentAction-O7R66HEX.js → addContentAction-RBOUD7SJ.js} +12 -11
- package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-IODCR6TB.js} +18 -19
- package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-EFWZSSZA.js} +47 -42
- package/{agentEmailCommands-UH7KTTCN.js → agentEmailCommands-3TQXT2DZ.js} +97 -87
- package/agentListCommands-EDV4RJ4D.js +742 -0
- package/{agentMachineCommands-6NVUXZGQ.js → agentMachineCommands-HCHRMJRJ.js} +48 -43
- package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-IRNZXVGE.js} +1 -1
- package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
- package/agentRecordCommands-YX7CN2PH.js +138 -0
- package/agentRunCommand-BT5U3G5Q.js +167 -0
- package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
- package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-SXYAKX3A.js} +48 -39
- package/{agentSlice-OU6TZKQP.js → agentSlice-TFZX3W5R.js} +14 -13
- package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-GTTBG53T.js} +46 -41
- package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-ZZCHUJAT.js} +46 -41
- package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-GZLLGY7Z.js} +46 -41
- package/{appGetCommands-SFAPP5PB.js → appGetCommands-ZRLWHJ3C.js} +46 -41
- package/{appListCommands-EKUBDRUO.js → appListCommands-OHARWLIL.js} +46 -41
- package/{authCommand-F4EFRRX6.js → authCommand-NHDLY3IB.js} +118 -24
- package/{authCommands-RGOGCPP6.js → authCommands-UDBJVSZU.js} +7 -5
- package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MAR5LPAC.js} +10 -8
- package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
- package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
- package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
- package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
- package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
- package/chunk-36XI7AVG.js +7881 -0
- package/{chunk-CSSGXQJ3.js → chunk-3AD37QCF.js} +551 -516
- package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
- package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
- package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
- package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
- package/chunk-4LCOCOR5.js +50 -0
- package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
- package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
- package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
- package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
- package/chunk-5J3PYNUP.js +255 -0
- package/chunk-5MMAK75Q.js +15 -0
- package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
- package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
- package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
- package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
- package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
- package/{chunk-L5UXH3B2.js → chunk-7TKWCTSY.js} +22 -6
- package/chunk-7UEMHIFV.js +13536 -0
- package/chunk-A4SQRTZ6.js +15 -0
- package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
- package/chunk-AGIM7IMJ.js +147 -0
- package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
- package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
- package/{chunk-53SXIJK6.js → chunk-AW2UF3FF.js} +19 -17
- package/chunk-BMQ2MJUK.js +153 -0
- package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
- package/chunk-CHOZJMJS.js +78 -0
- package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
- 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-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
- package/{chunk-BA63USCV.js → chunk-ED7UD6EF.js} +1 -1
- package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
- package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
- package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
- package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
- package/{chunk-6IG4XSS6.js → chunk-FY7DCYW7.js} +88 -17
- package/{chunk-6VFARHZW.js → chunk-G53AA7RW.js} +934 -1091
- package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
- 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-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
- package/{chunk-WCI7KQ4F.js → chunk-HPATMUWW.js} +24 -77
- package/{chunk-WP7SWVOM.js → chunk-I5L5CBSE.js} +20 -11
- package/{chunk-7KBQIEEW.js → chunk-J6ZXSIBA.js} +11 -9
- package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
- package/{chunk-FXRSQVU4.js → chunk-L6VWRPBW.js} +24 -5
- package/{chunk-4OEFYTWL.js → chunk-LKERWYPX.js} +67 -48
- package/{chunk-OEVAY4J6.js → chunk-LNVJHIGA.js} +18 -20
- package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
- package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -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-AEOE4Z6Q.js → chunk-NZWAO6LH.js} +13 -15
- package/chunk-OCZKATRC.js +129 -0
- package/chunk-OW4APERY.js +870 -0
- package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
- package/{chunk-KIOVECFO.js → chunk-OYA47B3D.js} +873 -227
- package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
- package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
- package/{chunk-5H7KJX7J.js → chunk-SEB5HAUU.js} +5 -5
- package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
- package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
- package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
- package/{chunk-ICLAW6SN.js → chunk-TWYWQFJR.js} +10 -10
- package/chunk-TY3TIUJK.js +89 -0
- package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
- package/{chunk-RG6JBBX5.js → chunk-U7XXEI5R.js} +166 -13
- package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
- package/chunk-UJXNKP5V.js +760 -0
- package/{chunk-UKZDAFYT.js → chunk-UM4PH574.js} +6 -10
- package/{chunk-GEPUP7OO.js → chunk-UVKDJUTL.js} +3 -3
- package/{chunk-S2YPVYRY.js → chunk-UW4JVRYR.js} +67 -45
- package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
- package/{chunk-NA35QHCF.js → chunk-V7Y6KRAH.js} +1 -1
- package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
- package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
- package/chunk-VIWDGTDA.js +8 -0
- package/chunk-VJVNU77E.js +83 -0
- package/{chunk-VA2M2T36.js → chunk-VNR63IV3.js} +23 -28
- package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
- package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
- package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
- package/{chunk-ZDXFQMB4.js → chunk-WHZ67DFH.js} +47 -67
- package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
- package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
- package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
- package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
- package/{chunk-ETI2NYVF.js → chunk-YPOPJAKN.js} +4 -4
- package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
- package/chunk-YV25TM3R.js +780 -0
- package/chunk-ZRAU6T47.js +56 -0
- package/commandRegistry-MODC2W5M.js +833 -0
- package/{contentThunks-I3AWWOK4.js → contentThunks-636N2NA7.js} +36 -34
- package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
- package/{createAgentAutomationAction-QNNIWYI3.js → createAgentAutomationAction-2ZGYUIT4.js} +38 -36
- package/createDialogAction-DOZD7XW7.js +69 -0
- package/{createPageAction-G2ASSMFZ.js → createPageAction-FJQVAHIK.js} +45 -42
- package/{chunk-Q6NAY3XN.js → cursorProvider-YGGNMVWX.js} +2496 -9897
- package/{dbSlice-XVWBAGYN.js → dbSlice-Q25STFGJ.js} +11 -10
- package/{deleteFile-YG6QMJLU.js → deleteFile-AJ2EZMHT.js} +7 -6
- package/{dialogCommands-5J56DFWN.js → dialogCommands-LF7PLYAD.js} +49 -45
- package/{dialogSlice-HQLYBDH7.js → dialogSlice-FOWUVVPW.js} +40 -33
- package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
- package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-NQR3S7A4.js} +48 -43
- package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-V3IAQ2HT.js} +49 -44
- package/{docReadCommands-HOSVSBDJ.js → docReadCommands-GDX4CLSU.js} +47 -42
- package/{docStore-5LMRNCZG.js → docStore-F645L3JQ.js} +16 -12
- package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-QMYXWQOU.js} +48 -43
- package/{fetchMessages-EIU7UFFK.js → fetchMessages-I5ICDDHM.js} +5 -5
- package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
- package/{handleSendMessageAction-DMWWDWN5.js → handleSendMessageAction-6DCDAY6A.js} +110 -86
- package/index.js +87 -884
- package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
- package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
- package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
- package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
- package/{machineCommands-T4T4AUNA.js → machineCommands-465OUHT4.js} +91 -81
- package/machineWsRunDispatch-M3FUGFP4.js +154 -0
- package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.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-SRQMNO26.js} +7 -6
- package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
- package/{readlineWorkspace-LN2D7OGW.js → readlineWorkspace-LFCVKGAB.js} +2704 -2060
- package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
- package/{runAgentClientLoop-I773V27D.js → runAgentClientLoop-KBRADH67.js} +75 -69
- package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
- package/runtimeModeArgs-2Y7BALTO.js +31 -0
- package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
- package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
- package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.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-2P2X37MC.js} +51 -46
- package/{streamAgentChatTurn-PSF5RYKO.js → streamAgentChatTurn-CCOW4CUC.js} +199 -104
- package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
- package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
- package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
- package/tools-QNXUF3LE.js +116 -0
- package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
- package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
- package/{updateDialogTitleAction-QBT5WOLY.js → updateDialogTitleAction-ZLUQE6XC.js} +82 -44
- package/action-YVYQEAAV.js +0 -31
- package/agentListCommands-KMS675GZ.js +0 -406
- package/agentRecordCommands-A7AIQPNG.js +0 -128
- package/agentRunCommand-KO5UM7O6.js +0 -155
- package/browser-image-compression-MFDTD7K6.js +0 -1763
- package/chatQueueReduxAdapter-JS633LXU.js +0 -186
- 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-Y5GCAMGP.js +0 -9
- package/chunk-YHYPCMKI.js +0 -19005
- package/chunk-YPREESF4.js +0 -225
- package/createDialogAction-STKILXXW.js +0 -65
- package/machineWsRunDispatch-F6XWVLKA.js +0 -144
- package/settingSlice-ZQZVUPKK.js +0 -204
- package/syncMapping-N6RGXGBW.js +0 -437
- package/tools-2ZTTVIGF.js +0 -110
- package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
- package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
- package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSelector
|
|
3
|
+
} from "./chunk-VY6VFGKR.js";
|
|
4
|
+
import {
|
|
5
|
+
getAllServers,
|
|
6
|
+
getIsDesktopApp
|
|
7
|
+
} from "./chunk-HIM3FCLF.js";
|
|
8
|
+
import {
|
|
9
|
+
SERVERS
|
|
10
|
+
} from "./chunk-LCBAMY2M.js";
|
|
11
|
+
import {
|
|
12
|
+
isLocalServerUrl
|
|
13
|
+
} from "./chunk-4SN6J65J.js";
|
|
14
|
+
|
|
15
|
+
// packages/app/settings/serverSelectors.ts
|
|
16
|
+
var resolveDesktopSafeServer = (value) => {
|
|
17
|
+
if (!getIsDesktopApp()) return value || SERVERS.MAIN;
|
|
18
|
+
return isLocalServerUrl(value) ? SERVERS.MAIN : value || SERVERS.MAIN;
|
|
19
|
+
};
|
|
20
|
+
var selectSettings = (state) => state.settings;
|
|
21
|
+
var selectCurrentServer = createSelector(
|
|
22
|
+
[selectSettings],
|
|
23
|
+
(settings) => resolveDesktopSafeServer(settings.currentServer)
|
|
24
|
+
);
|
|
25
|
+
var selectSyncServers = createSelector(
|
|
26
|
+
[selectSettings],
|
|
27
|
+
(settings) => (settings.syncServers || []).filter(
|
|
28
|
+
(server) => !getIsDesktopApp() || !isLocalServerUrl(server)
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
var selectRemoteServer = selectCurrentServer;
|
|
32
|
+
var selectRemoteSyncServers = selectSyncServers;
|
|
33
|
+
var selectRemoteServers = createSelector(
|
|
34
|
+
[selectRemoteServer, selectRemoteSyncServers],
|
|
35
|
+
(currentServer, syncServers) => getAllServers(currentServer, syncServers)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
selectCurrentServer,
|
|
40
|
+
selectSyncServers,
|
|
41
|
+
selectRemoteServers
|
|
42
|
+
};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildLocalAgentLookupKeys,
|
|
3
3
|
shouldReadAgentKeyRemotely
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TVCAR26G.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveCliAgentKeyInput
|
|
7
7
|
} from "./chunk-SV5IJK6K.js";
|
|
8
8
|
import {
|
|
9
9
|
toErrorMessage
|
|
10
10
|
} from "./chunk-HNMXYYJR.js";
|
|
11
|
-
import {
|
|
12
|
-
readPipeText,
|
|
13
|
-
spawnProcess
|
|
14
|
-
} from "./chunk-X7HHHIOZ.js";
|
|
15
11
|
import {
|
|
16
12
|
parseUserIdFromAuthToken,
|
|
17
13
|
readOption,
|
|
@@ -19,9 +15,13 @@ import {
|
|
|
19
15
|
resolveServerCandidates,
|
|
20
16
|
resolveServerUrl
|
|
21
17
|
} from "./chunk-A7GB5UGH.js";
|
|
18
|
+
import {
|
|
19
|
+
readPipeText,
|
|
20
|
+
spawnProcess
|
|
21
|
+
} from "./chunk-Y6ROFCZO.js";
|
|
22
22
|
import {
|
|
23
23
|
createAgentKey
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3AH7LNUB.js";
|
|
25
25
|
|
|
26
26
|
// packages/cli/agentRecordHelpers.ts
|
|
27
27
|
import { readFileSync } from "node:fs";
|
|
@@ -484,7 +484,7 @@ function parseAgentUpdateArgs(args) {
|
|
|
484
484
|
);
|
|
485
485
|
const expiresAt = parseIsoTimestampOption(readOption(args, "--expires-at"), "--expires-at");
|
|
486
486
|
const handle = readOption(args, "--handle")?.trim();
|
|
487
|
-
const promptSources = [prompt, promptFile, promptDoc].filter(
|
|
487
|
+
const promptSources = [prompt, promptFile, promptDoc].filter((value) => value !== void 0);
|
|
488
488
|
if (promptSources.length > 1) {
|
|
489
489
|
throw new Error("--prompt / --prompt-file / --prompt-doc are mutually exclusive.");
|
|
490
490
|
}
|
|
@@ -492,7 +492,7 @@ function parseAgentUpdateArgs(args) {
|
|
|
492
492
|
if (cliProvider) updates.cliProvider = cliProvider;
|
|
493
493
|
if (apiSource) updates.apiSource = apiSource;
|
|
494
494
|
if (provider) updates.provider = provider;
|
|
495
|
-
if (prompt) updates.prompt = prompt;
|
|
495
|
+
if (prompt !== void 0) updates.prompt = prompt;
|
|
496
496
|
if (promptFile) updates.prompt = readFileSync(promptFile, "utf8");
|
|
497
497
|
if (tools) updates.tools = parseJsonishValue(tools);
|
|
498
498
|
if (name) updates.name = name;
|
|
@@ -511,7 +511,7 @@ function parseAgentUpdateArgs(args) {
|
|
|
511
511
|
updates[entry.slice(0, index)] = parseJsonishValue(entry.slice(index + 1));
|
|
512
512
|
}
|
|
513
513
|
if (Object.keys(updates).length === 0) {
|
|
514
|
-
if (!promptDoc && !copyProviderFrom) {
|
|
514
|
+
if (!promptDoc && !copyProviderFrom && !presetId) {
|
|
515
515
|
throw new Error("No updates provided. Use --model / --cli-provider / --api-source / --field key=value.");
|
|
516
516
|
}
|
|
517
517
|
}
|
|
@@ -523,21 +523,19 @@ async function buildCreatedAgentRecord(args) {
|
|
|
523
523
|
const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
|
|
524
524
|
const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
|
|
525
525
|
if (args.parsed.presetId) {
|
|
526
|
-
const { resolveProviderPresetFields } = await import("./providerPresetApply-
|
|
526
|
+
const { resolveProviderPresetFields } = await import("./providerPresetApply-TEBH7FDX.js");
|
|
527
527
|
const fields = resolveProviderPresetFields(args.parsed.presetId);
|
|
528
528
|
if (fields.kind === "manual") {
|
|
529
529
|
throw new Error(
|
|
530
530
|
`unknown --preset "${args.parsed.presetId}". Run \`nolo agent providers\` to list preset ids.`
|
|
531
531
|
);
|
|
532
532
|
}
|
|
533
|
-
if (fields.kind === "oauth" || fields.requiresDesktopOAuth) {
|
|
534
|
-
throw new Error(
|
|
535
|
-
`--preset "${args.parsed.presetId}" is an OAuth subscription; create it in Nolo Desktop (OAuth login required).`
|
|
536
|
-
);
|
|
537
|
-
}
|
|
538
533
|
const u = args.parsed.updates;
|
|
539
534
|
u.apiSource = "custom";
|
|
540
535
|
u.provider = u.provider ?? fields.provider;
|
|
536
|
+
if (fields.apiKeyRef && !u.apiKeyRef) {
|
|
537
|
+
u.apiKeyRef = fields.apiKeyRef;
|
|
538
|
+
}
|
|
541
539
|
if (fields.customProviderUrl && !u.customProviderUrl) {
|
|
542
540
|
u.customProviderUrl = fields.customProviderUrl;
|
|
543
541
|
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// packages/ai/chat/parseApiError.ts
|
|
2
|
+
var CONTEXT_OVERFLOW_ACTIONS = [
|
|
3
|
+
"compact-and-retry",
|
|
4
|
+
"new-dialog",
|
|
5
|
+
"switch-model",
|
|
6
|
+
"retry"
|
|
7
|
+
];
|
|
8
|
+
var CONTEXT_TOO_LARGE_ACTIONS = [
|
|
9
|
+
"new-dialog",
|
|
10
|
+
"switch-model",
|
|
11
|
+
"retry"
|
|
12
|
+
];
|
|
13
|
+
var truncateErrorMessage = (message, maxChars = 320) => message.length <= maxChars ? message : `${message.slice(0, maxChars)}\u2026`;
|
|
14
|
+
var isContextOverflowText = (message) => /maximum context|context (length|window|overflow|limit)|context_length_exceed\w*|requested about .*tokens|too many tokens|prompt is too long|exceeds? (the )?(model|max)/i.test(
|
|
15
|
+
message
|
|
16
|
+
);
|
|
17
|
+
function classifyApiError(input) {
|
|
18
|
+
const { status, message, body, code } = input;
|
|
19
|
+
const errorMessage = message;
|
|
20
|
+
let defaultMessage = `\u72B6\u6001\u7801 ${status} ${input.statusText ?? ""}`;
|
|
21
|
+
switch (status) {
|
|
22
|
+
case 400:
|
|
23
|
+
if (isContextOverflowText(errorMessage) || isContextOverflowText(body) || code === "UPSTREAM_400") {
|
|
24
|
+
return {
|
|
25
|
+
kind: "context_overflow",
|
|
26
|
+
message: "\u4E0A\u4E0B\u6587\u8FC7\u957F\uFF1A\u672C\u8F6E\u6D88\u606F\u6216\u5DE5\u5177\u7ED3\u679C\u592A\u5927\u3002\u8BF7\u7F29\u5C0F\u8303\u56F4\uFF0C\u6216\u5148\u8BFB\u53D6\u66F4\u5C0F\u7247\u6BB5\u540E\u518D\u7EE7\u7EED\u3002",
|
|
27
|
+
code,
|
|
28
|
+
status,
|
|
29
|
+
retryable: true,
|
|
30
|
+
actions: [...CONTEXT_OVERFLOW_ACTIONS]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (code === "MISSING_PROVIDER_API_KEY") {
|
|
34
|
+
return {
|
|
35
|
+
kind: "generic",
|
|
36
|
+
message: truncateErrorMessage(errorMessage),
|
|
37
|
+
code,
|
|
38
|
+
status,
|
|
39
|
+
retryable: false
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (errorMessage && errorMessage !== defaultMessage) {
|
|
43
|
+
return {
|
|
44
|
+
kind: "generic",
|
|
45
|
+
message: `\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}`,
|
|
46
|
+
code,
|
|
47
|
+
status,
|
|
48
|
+
retryable: false
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return { kind: "generic", message: "\u8BF7\u6C42\u53C2\u6570\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165", code, status, retryable: false };
|
|
52
|
+
case 413:
|
|
53
|
+
return {
|
|
54
|
+
kind: "context_too_large",
|
|
55
|
+
message: "\u8BF7\u6C42\u5185\u5BB9\u8FC7\u5927\uFF1A\u8BF7\u51CF\u5C11\u4E00\u6B21\u53D1\u9001\u7684\u6D88\u606F\u3001\u6587\u4EF6\u6216\u5DE5\u5177\u7ED3\u679C\u3002",
|
|
56
|
+
code,
|
|
57
|
+
status,
|
|
58
|
+
retryable: true,
|
|
59
|
+
actions: [...CONTEXT_TOO_LARGE_ACTIONS]
|
|
60
|
+
};
|
|
61
|
+
case 401:
|
|
62
|
+
return {
|
|
63
|
+
kind: "auth",
|
|
64
|
+
message: code === "AUTH_TOKEN_EXPIRED" ? "\u767B\u5F55\u72B6\u6001\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55" : code === "AUTH_ACCOUNT_INVALID" ? "\u8D26\u6237\u65E0\u6548\u6216\u5DF2\u88AB\u505C\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458" : code === "AUTH_NO_TOKEN" ? "\u672A\u68C0\u6D4B\u5230\u767B\u5F55\u72B6\u6001\uFF0C\u8BF7\u5148\u767B\u5F55" : code === "AUTH_INVALID_TOKEN" ? "\u767B\u5F55\u51ED\u8BC1\u65E0\u6548\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55" : code === "AUTH_TOKEN_NOT_ACTIVE" ? "\u4EE4\u724C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5" : errorMessage && errorMessage !== `\u72B6\u6001\u7801 401 Unauthorized` ? `\u8BA4\u8BC1\u9519\u8BEF: ${truncateErrorMessage(errorMessage)}` : "\u8EAB\u4EFD\u9A8C\u8BC1\u5931\u8D25\uFF0C\u8BF7\u5148\u767B\u51FA\u540E\u91CD\u65B0\u767B\u5F55",
|
|
65
|
+
code,
|
|
66
|
+
status,
|
|
67
|
+
retryable: true,
|
|
68
|
+
actions: ["retry"]
|
|
69
|
+
};
|
|
70
|
+
case 503:
|
|
71
|
+
return {
|
|
72
|
+
kind: "server",
|
|
73
|
+
message: errorMessage && errorMessage !== `\u72B6\u6001\u7801 503 Service Unavailable` ? truncateErrorMessage(errorMessage) : "\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
|
|
74
|
+
code,
|
|
75
|
+
status,
|
|
76
|
+
retryable: true,
|
|
77
|
+
actions: ["retry"]
|
|
78
|
+
};
|
|
79
|
+
case 504:
|
|
80
|
+
return {
|
|
81
|
+
kind: "timeout",
|
|
82
|
+
message: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",
|
|
83
|
+
code,
|
|
84
|
+
status,
|
|
85
|
+
retryable: true,
|
|
86
|
+
actions: ["retry"]
|
|
87
|
+
};
|
|
88
|
+
default:
|
|
89
|
+
return {
|
|
90
|
+
kind: "generic",
|
|
91
|
+
message: `API\u8BF7\u6C42\u5931\u8D25: ${truncateErrorMessage(errorMessage)}`,
|
|
92
|
+
code,
|
|
93
|
+
status,
|
|
94
|
+
retryable: true,
|
|
95
|
+
actions: ["retry"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function parseApiErrorInfo(response) {
|
|
100
|
+
const errorBody = await response.text();
|
|
101
|
+
let errorMessage = `\u72B6\u6001\u7801 ${response.status} ${response.statusText}`;
|
|
102
|
+
let errorCode = `E${response.status}`;
|
|
103
|
+
try {
|
|
104
|
+
const errorJson = JSON.parse(errorBody);
|
|
105
|
+
errorMessage = errorJson?.error?.message || errorJson?.message || errorJson?.msg || errorBody || errorMessage;
|
|
106
|
+
errorCode = errorJson?.error?.code || errorJson?.code || errorCode;
|
|
107
|
+
} catch (_e) {
|
|
108
|
+
if (errorBody) {
|
|
109
|
+
errorMessage = errorBody;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return classifyApiError({
|
|
113
|
+
status: response.status,
|
|
114
|
+
statusText: response.statusText,
|
|
115
|
+
message: errorMessage,
|
|
116
|
+
body: errorBody,
|
|
117
|
+
code: errorCode
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function parseApiError(response) {
|
|
121
|
+
return (await parseApiErrorInfo(response)).message;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
CONTEXT_OVERFLOW_ACTIONS,
|
|
126
|
+
CONTEXT_TOO_LARGE_ACTIONS,
|
|
127
|
+
isContextOverflowText,
|
|
128
|
+
parseApiError
|
|
129
|
+
};
|