nolo-cli 0.103.0-alpha.1 → 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
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
_appendRetiredStateBatch,
|
|
3
|
+
loadMemoryVNextCatalog
|
|
4
|
+
} from "./chunk-TY3TIUJK.js";
|
|
1
5
|
import {
|
|
2
6
|
resolveMachineId
|
|
3
7
|
} from "./chunk-ESHYE7WU.js";
|
|
4
8
|
import {
|
|
5
9
|
getDefaultCliLocalRuntimeDb
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FOXQ7BAB.js";
|
|
11
|
+
import {
|
|
12
|
+
resolveAuthTokenFromEnv
|
|
13
|
+
} from "./chunk-A7GB5UGH.js";
|
|
14
|
+
import {
|
|
15
|
+
DEFAULT_NOLO_SERVER_URL
|
|
16
|
+
} from "./chunk-OLZBQWZU.js";
|
|
7
17
|
import {
|
|
8
18
|
buildCliRuntimeEnv,
|
|
9
19
|
clearProfileAuthToken,
|
|
@@ -12,20 +22,14 @@ import {
|
|
|
12
22
|
getProfileTokens,
|
|
13
23
|
loadProfileConfig,
|
|
14
24
|
saveDefaultProfile
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
resolveAuthTokenFromEnv
|
|
18
|
-
} from "./chunk-A7GB5UGH.js";
|
|
19
|
-
import {
|
|
20
|
-
DEFAULT_NOLO_SERVER_URL
|
|
21
|
-
} from "./chunk-OLZBQWZU.js";
|
|
25
|
+
} from "./chunk-TNIX77YM.js";
|
|
22
26
|
import {
|
|
23
27
|
asTrimmedNonEmptyStringArray,
|
|
24
28
|
createMemoryKey,
|
|
25
29
|
createMemoryOwnerIndexKey,
|
|
26
30
|
createMemorySubjectKindIndexKey,
|
|
27
31
|
memoryOwnerRange
|
|
28
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-ODAPITXL.js";
|
|
29
33
|
import {
|
|
30
34
|
asTrimmedString
|
|
31
35
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -39,6 +43,29 @@ import { stdin as input, stdout as output } from "node:process";
|
|
|
39
43
|
import { spawn } from "node:child_process";
|
|
40
44
|
|
|
41
45
|
// packages/ai/memory/delete.ts
|
|
46
|
+
var VNEXT_STATE_ID_PREFIX = "vnext-state-";
|
|
47
|
+
var toVNextMemoryItem = (state, owner) => ({
|
|
48
|
+
id: `${VNEXT_STATE_ID_PREFIX}${state.id}`,
|
|
49
|
+
ownerType: owner.ownerType,
|
|
50
|
+
ownerId: owner.ownerId,
|
|
51
|
+
visibility: "private",
|
|
52
|
+
subjectType: "user",
|
|
53
|
+
subjectId: owner.ownerId,
|
|
54
|
+
kind: "semantic",
|
|
55
|
+
content: state.text.trim(),
|
|
56
|
+
createdAt: state.createdAt,
|
|
57
|
+
lastActivatedAt: state.createdAt,
|
|
58
|
+
activationCount: 1,
|
|
59
|
+
importance: 0.9,
|
|
60
|
+
confidence: 0.9,
|
|
61
|
+
resident: state.facet === "preference" || state.facet === "style"
|
|
62
|
+
});
|
|
63
|
+
var matchesVNextFilters = (state, idSet, contentSub) => {
|
|
64
|
+
if (!idSet && !contentSub) return false;
|
|
65
|
+
if (idSet && !idSet.has(`${VNEXT_STATE_ID_PREFIX}${state.id}`)) return false;
|
|
66
|
+
if (contentSub && !state.text.toLowerCase().includes(contentSub)) return false;
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
42
69
|
function hasExplicitDeleteFilters(filters) {
|
|
43
70
|
return Boolean(
|
|
44
71
|
filters.ids && filters.ids.length > 0 || typeof filters.contentSubstring === "string" && filters.contentSubstring.trim().length > 0 || filters.tags && filters.tags.length > 0 || typeof filters.sourceDialogId === "string" && filters.sourceDialogId.trim().length > 0 || typeof filters.patternKeyPrefix === "string" && filters.patternKeyPrefix.trim().length > 0 || filters.facets && filters.facets.length > 0 || typeof filters.subjectId === "string" && filters.subjectId.trim().length > 0
|
|
@@ -127,8 +154,32 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
|
127
154
|
matchedItems.push(item);
|
|
128
155
|
if (matchedItems.length >= limit) break;
|
|
129
156
|
}
|
|
157
|
+
const idSet = normalizeSet(filters.ids);
|
|
158
|
+
const contentSub = asTrimmedString(filters.contentSubstring).toLowerCase();
|
|
159
|
+
const vnextStateIdsToRetire = [];
|
|
160
|
+
const vnextStatesToRetire = [];
|
|
161
|
+
const vnextMatchedItems = [];
|
|
162
|
+
let vnextPrincipalId = null;
|
|
163
|
+
const hasScopingFilters = Boolean(
|
|
164
|
+
normalizeSet(filters.kinds) || normalizeSet(filters.facets) || normalizeSet(filters.tags) || asTrimmedString(filters.subjectType) || asTrimmedString(filters.subjectId) || asTrimmedString(filters.patternKeyPrefix) || asTrimmedString(filters.sourceDialogId)
|
|
165
|
+
);
|
|
166
|
+
const canMatchVNext = !hasScopingFilters && (contentSub.length > 0 || idSet !== null && [...idSet].some((id) => id.startsWith(VNEXT_STATE_ID_PREFIX)));
|
|
167
|
+
if (canMatchVNext) {
|
|
168
|
+
vnextPrincipalId = `${owner.ownerType}:${encodeURIComponent(owner.ownerId)}`;
|
|
169
|
+
const catalog = await loadMemoryVNextCatalog(db, vnextPrincipalId);
|
|
170
|
+
for (const state of catalog.states) {
|
|
171
|
+
if (matchedItems.length >= limit) break;
|
|
172
|
+
if (state.retiredAt) continue;
|
|
173
|
+
if (!matchesVNextFilters(state, idSet, contentSub)) continue;
|
|
174
|
+
vnextStateIdsToRetire.push(state.id);
|
|
175
|
+
vnextStatesToRetire.push(state);
|
|
176
|
+
const projected = toVNextMemoryItem(state, owner);
|
|
177
|
+
vnextMatchedItems.push(projected);
|
|
178
|
+
matchedItems.push(projected);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
130
181
|
if (matchedItems.length === 0) {
|
|
131
|
-
return { deletedCount: 0, deletedIds: [], matchedItems: [] };
|
|
182
|
+
return { deletedCount: 0, deletedIds: [], retiredIds: [], matchedItems: [] };
|
|
132
183
|
}
|
|
133
184
|
const token = generateMemoryDeletionToken(
|
|
134
185
|
owner.ownerId,
|
|
@@ -138,6 +189,7 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
|
138
189
|
return {
|
|
139
190
|
deletedCount: 0,
|
|
140
191
|
deletedIds: [],
|
|
192
|
+
retiredIds: [],
|
|
141
193
|
matchedItems,
|
|
142
194
|
deletionToken: token
|
|
143
195
|
};
|
|
@@ -147,14 +199,28 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
|
147
199
|
"deletionToken mismatch: memory dataset changed since preview; please rerun dry-run preview before confirming."
|
|
148
200
|
);
|
|
149
201
|
}
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
202
|
+
const vnextMatchedIdSet = new Set(
|
|
203
|
+
vnextStateIdsToRetire.map((stateId) => `${VNEXT_STATE_ID_PREFIX}${stateId}`)
|
|
204
|
+
);
|
|
205
|
+
const legacyItems = matchedItems.filter((item) => !vnextMatchedIdSet.has(item.id));
|
|
206
|
+
const shouldRetireVNext = vnextStatesToRetire.length > 0;
|
|
207
|
+
if (legacyItems.length > 0 || shouldRetireVNext) {
|
|
208
|
+
const batch = db.batch();
|
|
209
|
+
for (const item of legacyItems) {
|
|
210
|
+
deleteMemoryItemWithIndexesInBatch(batch, item);
|
|
211
|
+
}
|
|
212
|
+
if (shouldRetireVNext) {
|
|
213
|
+
const nowIso = (/* @__PURE__ */ new Date()).toISOString();
|
|
214
|
+
for (const state of vnextStatesToRetire) {
|
|
215
|
+
_appendRetiredStateBatch(batch, { ...state, retiredAt: nowIso });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
await batch.write();
|
|
153
219
|
}
|
|
154
|
-
await batch.write();
|
|
155
220
|
return {
|
|
156
221
|
deletedCount: matchedItems.length,
|
|
157
222
|
deletedIds: matchedItems.map((item) => item.id),
|
|
223
|
+
retiredIds: vnextMatchedItems.map((item) => item.id),
|
|
158
224
|
matchedItems,
|
|
159
225
|
deletionToken: token
|
|
160
226
|
};
|
|
@@ -153,6 +153,13 @@ function slateToSimplifiedMarkdown(nodes, options = {}) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// packages/ai/tools/readDocTool.ts
|
|
156
|
+
var resolvePageReadMarkdown = (pageData) => {
|
|
157
|
+
const slateData = pageData.slateData;
|
|
158
|
+
if (Array.isArray(slateData) && slateData.length > 0) {
|
|
159
|
+
return slateToSimplifiedMarkdown(slateData);
|
|
160
|
+
}
|
|
161
|
+
return typeof pageData.content === "string" ? pageData.content : "";
|
|
162
|
+
};
|
|
156
163
|
var readDocFunctionSchema = {
|
|
157
164
|
name: "readDoc",
|
|
158
165
|
description: [
|
|
@@ -175,7 +182,7 @@ var readPageFunctionSchema = {
|
|
|
175
182
|
name: "readPage"
|
|
176
183
|
};
|
|
177
184
|
var buildReadDocResult = (pageData) => {
|
|
178
|
-
const markdownContent =
|
|
185
|
+
const markdownContent = resolvePageReadMarkdown(pageData);
|
|
179
186
|
const rawData = {
|
|
180
187
|
success: true,
|
|
181
188
|
id: pageData.dbKey,
|
|
@@ -199,7 +206,7 @@ async function readDocFunc(args, thunkApi) {
|
|
|
199
206
|
throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
|
|
200
207
|
}
|
|
201
208
|
try {
|
|
202
|
-
const { readAction } = await import("./read-
|
|
209
|
+
const { readAction } = await import("./read-PJIT2YEJ.js");
|
|
203
210
|
const pageData = await readAction({ dbKey: id }, thunkApi);
|
|
204
211
|
if (!pageData) {
|
|
205
212
|
throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
|
|
@@ -213,6 +220,7 @@ var readPageFunc = readDocFunc;
|
|
|
213
220
|
|
|
214
221
|
export {
|
|
215
222
|
slateToSimplifiedMarkdown,
|
|
223
|
+
resolvePageReadMarkdown,
|
|
216
224
|
readDocFunctionSchema,
|
|
217
225
|
readPageFunctionSchema,
|
|
218
226
|
buildReadDocResult,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PLRFCQ7C.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
runtime_default
|
|
6
|
+
} from "./chunk-4A2R7KHG.js";
|
|
7
7
|
import {
|
|
8
8
|
canonicalizeToolNames
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XUWRURDF.js";
|
|
10
10
|
import {
|
|
11
11
|
isNoloHostedProvider
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Y3PMXGLH.js";
|
|
13
13
|
import {
|
|
14
14
|
asTrimmedLowercaseString
|
|
15
15
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -151,12 +151,12 @@ var PREPARE_TOOLS_CACHE_LIMIT = 128;
|
|
|
151
151
|
var warnedUnknownToolNames = /* @__PURE__ */ new Set();
|
|
152
152
|
function getTranslation(keys, defaultVal) {
|
|
153
153
|
for (const key of keys) {
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
154
|
+
if (runtime_default.exists(key)) {
|
|
155
|
+
return runtime_default.t(key);
|
|
156
156
|
}
|
|
157
157
|
const aiKey = key.startsWith("ai:") ? key : `ai:${key}`;
|
|
158
|
-
if (
|
|
159
|
-
return
|
|
158
|
+
if (runtime_default.exists(aiKey)) {
|
|
159
|
+
return runtime_default.t(aiKey);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
return defaultVal;
|
|
@@ -203,7 +203,7 @@ function translateSchema(schema) {
|
|
|
203
203
|
return nextSchema;
|
|
204
204
|
}
|
|
205
205
|
function currentI18nLanguage() {
|
|
206
|
-
return typeof
|
|
206
|
+
return typeof runtime_default.language === "string" ? runtime_default.language : "";
|
|
207
207
|
}
|
|
208
208
|
function translateSchemaCached(schema) {
|
|
209
209
|
if (!schema || typeof schema !== "object") return schema;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createFileCredentialBroker,
|
|
4
4
|
migrateAgentSecrets,
|
|
5
5
|
normalizeAgentRuntimeToolPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2H6SEVDS.js";
|
|
7
7
|
import {
|
|
8
8
|
asRecordOrEmpty
|
|
9
9
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -11,16 +11,18 @@ import {
|
|
|
11
11
|
patch,
|
|
12
12
|
remove,
|
|
13
13
|
write
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-56HJ2LAA.js";
|
|
15
|
+
import {
|
|
16
|
+
getRuntimeServerContext
|
|
17
|
+
} from "./chunk-O7SVKKLY.js";
|
|
15
18
|
import {
|
|
16
19
|
createAgentKey,
|
|
17
20
|
toTrimmedString
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ODAPITXL.js";
|
|
19
22
|
import {
|
|
20
23
|
asyncThunkCreator,
|
|
21
|
-
buildCreateSlice
|
|
22
|
-
|
|
23
|
-
} from "./chunk-UKWGR5SS.js";
|
|
24
|
+
buildCreateSlice
|
|
25
|
+
} from "./chunk-VY6VFGKR.js";
|
|
24
26
|
import {
|
|
25
27
|
asTrimmedString
|
|
26
28
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -304,7 +306,7 @@ var slice = createSliceWithThunks({
|
|
|
304
306
|
const overrides = {};
|
|
305
307
|
if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
|
|
306
308
|
if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
|
|
307
|
-
const { _executeModel } = await import("./_executeModel-
|
|
309
|
+
const { _executeModel } = await import("./_executeModel-7J7Q3WXY.js");
|
|
308
310
|
return _executeModel(
|
|
309
311
|
{
|
|
310
312
|
isStreaming: args.isStreaming ?? false,
|
|
@@ -325,7 +327,7 @@ var slice = createSliceWithThunks({
|
|
|
325
327
|
* - 循环直到无工具调用或触发其他运行时停止条件
|
|
326
328
|
*/
|
|
327
329
|
runAgent: create.asyncThunk(async (args, thunkApi) => {
|
|
328
|
-
const { runAgentClientLoop } = await import("./runAgentClientLoop-
|
|
330
|
+
const { runAgentClientLoop } = await import("./runAgentClientLoop-BGHGP5AR.js");
|
|
329
331
|
const { content: loopContent, toolCallCount } = await runAgentClientLoop(
|
|
330
332
|
{
|
|
331
333
|
agentKey: args.agentKey,
|
|
@@ -341,7 +343,7 @@ var slice = createSliceWithThunks({
|
|
|
341
343
|
* 聊天轮次流式 Agent 调用
|
|
342
344
|
*/
|
|
343
345
|
streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
|
|
344
|
-
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-
|
|
346
|
+
const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-ANE7OTCZ.js");
|
|
345
347
|
return streamAgentChatTurnHandler(args, thunkApi);
|
|
346
348
|
}),
|
|
347
349
|
/**
|
|
@@ -308,6 +308,8 @@ function saveProfileOAuthSync(provider, sync, path = getDefaultProfileConfigPath
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
export {
|
|
311
|
+
normalizeProfileServerUrl,
|
|
312
|
+
isProtectedHomeProfileWrite,
|
|
311
313
|
getDefaultProfileConfigPath,
|
|
312
314
|
loadProfileConfig,
|
|
313
315
|
clearProfileAuthToken,
|
|
@@ -319,6 +321,8 @@ export {
|
|
|
319
321
|
getCurrentProfile,
|
|
320
322
|
saveProfileLocale,
|
|
321
323
|
getAgentSelectionAuditPath,
|
|
324
|
+
redactArgvSecrets,
|
|
325
|
+
appendAgentSelectionAudit,
|
|
322
326
|
readLastAgentSelectionAudit,
|
|
323
327
|
saveProfileAgentSelection,
|
|
324
328
|
getProfileOAuthSync,
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
deleteDbRecord,
|
|
3
3
|
queryUserRecords,
|
|
4
4
|
readDbRecord
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6UEJDFF7.js";
|
|
6
6
|
import {
|
|
7
7
|
mergeAndDedupUserData
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OXME3PEE.js";
|
|
9
9
|
import {
|
|
10
10
|
toErrorMessage
|
|
11
11
|
} from "./chunk-HNMXYYJR.js";
|
|
12
12
|
import {
|
|
13
13
|
isTombstoneRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-D2MDMY2M.js";
|
|
15
15
|
|
|
16
16
|
// packages/cli/globalRecordOperations.ts
|
|
17
17
|
async function listUserRecordsFromServers(args) {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isLevelNotFoundError
|
|
3
|
+
} from "./chunk-OW765XBU.js";
|
|
4
|
+
|
|
5
|
+
// packages/ai/memory/vnext/store.ts
|
|
6
|
+
var enc = (value) => encodeURIComponent(value).replace(/-/g, "%2D");
|
|
7
|
+
var rangeOf = (prefix) => ({ gte: prefix, lte: `${prefix}\uFFFF` });
|
|
8
|
+
var entityKey = (ownerId, id) => `mem2-e-${enc(ownerId)}-${enc(id)}`;
|
|
9
|
+
var entityOwnerPrefix = (ownerId) => `mem2-e-${enc(ownerId)}-`;
|
|
10
|
+
var stateKey = (ownerId, id) => `mem2-s-${enc(ownerId)}-${enc(id)}`;
|
|
11
|
+
var stateEntityIndexKey = (ownerId, entityId, stateId) => `mem2-si-${enc(ownerId)}-${enc(entityId)}-${enc(stateId)}`;
|
|
12
|
+
var stateEntityIndexPrefix = (ownerId, entityId) => `mem2-si-${enc(ownerId)}-${enc(entityId)}-`;
|
|
13
|
+
var evidenceKey = (ownerId, id) => `mem2-v-${enc(ownerId)}-${enc(id)}`;
|
|
14
|
+
var relationKey = (ownerId, id) => `mem2-r-${enc(ownerId)}-${enc(id)}`;
|
|
15
|
+
var relationFromIndexKey = (ownerId, from, relationId) => `mem2-rf-${enc(ownerId)}-${enc(from)}-${enc(relationId)}`;
|
|
16
|
+
var relationToIndexKey = (ownerId, to, relationId) => `mem2-rt-${enc(ownerId)}-${enc(to)}-${enc(relationId)}`;
|
|
17
|
+
var readIndexed = async (db, prefix) => {
|
|
18
|
+
const refs = [];
|
|
19
|
+
for await (const [, value] of db.iterator({ ...rangeOf(prefix), reverse: false })) {
|
|
20
|
+
if (typeof value?.key === "string") refs.push(value.key);
|
|
21
|
+
}
|
|
22
|
+
const rows = await Promise.all(refs.map((key) => db.get(key).catch(() => null)));
|
|
23
|
+
return rows.filter((row) => !!row);
|
|
24
|
+
};
|
|
25
|
+
var getMemoryEntityVNext = async (db, ownerId, entityId) => db.get(entityKey(ownerId, entityId)).catch(() => null);
|
|
26
|
+
var listMemoryEntitiesVNext = async (db, ownerId) => {
|
|
27
|
+
const rows = [];
|
|
28
|
+
for await (const [, value] of db.iterator({
|
|
29
|
+
...rangeOf(entityOwnerPrefix(ownerId)),
|
|
30
|
+
reverse: false
|
|
31
|
+
})) {
|
|
32
|
+
if (value) rows.push(value);
|
|
33
|
+
}
|
|
34
|
+
return rows;
|
|
35
|
+
};
|
|
36
|
+
var loadMemoryVNextCatalog = async (db, ownerId) => {
|
|
37
|
+
const entities = await listMemoryEntitiesVNext(db, ownerId);
|
|
38
|
+
const states = (await Promise.all(entities.map((entity) => listMemoryStatesForEntityVNext(db, ownerId, entity.id)))).flat();
|
|
39
|
+
return { entities, states };
|
|
40
|
+
};
|
|
41
|
+
var getMemoryStateVNext = async (db, ownerId, stateId) => db.get(stateKey(ownerId, stateId)).catch(() => null);
|
|
42
|
+
var listMemoryStatesForEntityVNext = (db, ownerId, entityId) => readIndexed(db, stateEntityIndexPrefix(ownerId, entityId));
|
|
43
|
+
var putMemoryEvidenceVNext = async (db, evidence) => {
|
|
44
|
+
await db.put(evidenceKey(evidence.ownerId, evidence.id), evidence);
|
|
45
|
+
};
|
|
46
|
+
var getMemoryEvidenceVNext = async (db, ownerId, evidenceId) => db.get(evidenceKey(ownerId, evidenceId)).catch(() => null);
|
|
47
|
+
var getMemoryEvidenceVNextStrict = async (db, ownerId, evidenceId) => {
|
|
48
|
+
try {
|
|
49
|
+
return await db.get(evidenceKey(ownerId, evidenceId));
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (isLevelNotFoundError(error)) return null;
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var _appendEntityBatch = (batch, entity) => {
|
|
56
|
+
batch.put(entityKey(entity.ownerId, entity.id), entity);
|
|
57
|
+
};
|
|
58
|
+
var _appendEvidenceBatch = (batch, evidence) => {
|
|
59
|
+
batch.put(evidenceKey(evidence.ownerId, evidence.id), evidence);
|
|
60
|
+
};
|
|
61
|
+
var _appendStateBatch = (batch, state) => {
|
|
62
|
+
const key = stateKey(state.ownerId, state.id);
|
|
63
|
+
batch.put(key, state);
|
|
64
|
+
batch.put(stateEntityIndexKey(state.ownerId, state.entityId, state.id), { key });
|
|
65
|
+
};
|
|
66
|
+
var _appendRetiredStateBatch = (batch, state) => {
|
|
67
|
+
batch.put(stateKey(state.ownerId, state.id), state);
|
|
68
|
+
};
|
|
69
|
+
var _appendRelationBatch = (batch, relation) => {
|
|
70
|
+
const key = relationKey(relation.ownerId, relation.id);
|
|
71
|
+
batch.put(key, relation);
|
|
72
|
+
batch.put(relationFromIndexKey(relation.ownerId, relation.from, relation.id), { key });
|
|
73
|
+
batch.put(relationToIndexKey(relation.ownerId, relation.to, relation.id), { key });
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
getMemoryEntityVNext,
|
|
78
|
+
loadMemoryVNextCatalog,
|
|
79
|
+
getMemoryStateVNext,
|
|
80
|
+
listMemoryStatesForEntityVNext,
|
|
81
|
+
putMemoryEvidenceVNext,
|
|
82
|
+
getMemoryEvidenceVNext,
|
|
83
|
+
getMemoryEvidenceVNextStrict,
|
|
84
|
+
_appendEntityBatch,
|
|
85
|
+
_appendEvidenceBatch,
|
|
86
|
+
_appendStateBatch,
|
|
87
|
+
_appendRetiredStateBatch,
|
|
88
|
+
_appendRelationBatch
|
|
89
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAgentRunTerminalStatus
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E3YWHWCR.js";
|
|
4
4
|
import {
|
|
5
5
|
isCompiledBinary,
|
|
6
6
|
resolveCliEntrypointPath
|
|
@@ -1056,7 +1056,14 @@ function defaultGetProcessStartTime(pid) {
|
|
|
1056
1056
|
const output = nodeExecFileSync("ps", ["-o", "lstart=", "-p", String(pid)], {
|
|
1057
1057
|
encoding: "utf8",
|
|
1058
1058
|
stdio: ["ignore", "pipe", "ignore"],
|
|
1059
|
-
timeout: 1e3
|
|
1059
|
+
timeout: 1e3,
|
|
1060
|
+
// `ps -o lstart` 的日期串随系统 locale 变化:
|
|
1061
|
+
// LANG=en_US.UTF-8 → "Thu Oct 8 08:54:18 2026"(new Date 可解析)
|
|
1062
|
+
// LANG=zh_CN.UTF-8 → "四 10月 8 08:54:18 2026"(new Date → NaN → null)
|
|
1063
|
+
// 这会让 isPidReused 的结论依赖调用者环境:同一条 run 记录在英文
|
|
1064
|
+
// locale 下被判 pid reused → orphaned,中文 locale 下不判。强制 C
|
|
1065
|
+
// locale 让输出恒为可解析的英文格式,结果与 locale 无关。
|
|
1066
|
+
env: { ...process.env, LC_ALL: "C", LANG: "C" }
|
|
1060
1067
|
}).trim();
|
|
1061
1068
|
if (!output) return null;
|
|
1062
1069
|
const d = new Date(output);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
trimTrailingSlash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-27ONFIEY.js";
|
|
4
4
|
import {
|
|
5
5
|
toErrorMessage
|
|
6
6
|
} from "./chunk-HNMXYYJR.js";
|
|
7
|
-
import {
|
|
8
|
-
asOptionalFiniteNumber
|
|
9
|
-
} from "./chunk-WWC7I6TA.js";
|
|
10
7
|
import {
|
|
11
8
|
asTrimmedLowercaseString
|
|
12
9
|
} from "./chunk-QSJ3HFEF.js";
|
|
10
|
+
import {
|
|
11
|
+
asOptionalFiniteNumber
|
|
12
|
+
} from "./chunk-WWC7I6TA.js";
|
|
13
13
|
import {
|
|
14
14
|
asOptionalTrimmedString
|
|
15
15
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -41,7 +41,7 @@ var ANTIGRAVITY_CLOUD_CODE_BASE_URL = "https://daily-cloudcode-pa.googleapis.com
|
|
|
41
41
|
var ANTIGRAVITY_CLOUD_CODE_HOST = "cloudcode-pa.googleapis.com";
|
|
42
42
|
var ANTIGRAVITY_LEGACY_GENERIC_BASE_RE = /^https?:\/\/cloudcode-pa\.googleapis\.com$/i;
|
|
43
43
|
function getAntigravityUserAgent() {
|
|
44
|
-
const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.1
|
|
44
|
+
const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.18.1";
|
|
45
45
|
const os = process.platform === "win32" ? "windows" : process.platform;
|
|
46
46
|
const arch = process.arch === "x64" ? "amd64" : process.arch === "ia32" ? "386" : process.arch;
|
|
47
47
|
return `antigravity/hub/${version} ${os}/${arch}`;
|
|
@@ -129,7 +129,9 @@ async function refreshAntigravityToken(credential, deps = {}) {
|
|
|
129
129
|
payload = {};
|
|
130
130
|
}
|
|
131
131
|
if (!response.ok) {
|
|
132
|
-
const
|
|
132
|
+
const errorCode = typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : void 0;
|
|
133
|
+
const errorDescription = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : void 0;
|
|
134
|
+
const detail = (errorCode && errorDescription && errorDescription !== errorCode ? `${errorCode}: ${errorDescription}` : errorCode ?? errorDescription ?? rawBodyText.trim()) || `HTTP ${response.status}`;
|
|
133
135
|
throw new Error(`Antigravity token refresh failed: ${detail}`);
|
|
134
136
|
}
|
|
135
137
|
if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
|
|
@@ -35,7 +35,7 @@ var LOCAL_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "::1", "0.0
|
|
|
35
35
|
function isRemoteCustomEndpoint(url) {
|
|
36
36
|
if (typeof url !== "string") return false;
|
|
37
37
|
try {
|
|
38
|
-
const host = new URL(url).hostname.toLowerCase();
|
|
38
|
+
const host = new URL(url).hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
39
39
|
return !LOCAL_HOSTS.has(host);
|
|
40
40
|
} catch {
|
|
41
41
|
return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectCurrentServer,
|
|
3
3
|
selectRemoteServers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NWENLDMM.js";
|
|
5
5
|
import {
|
|
6
6
|
createUserKey,
|
|
7
7
|
extractAgentInfo,
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
sanitizeShareData,
|
|
11
11
|
shareKey,
|
|
12
12
|
toNonEmptyString
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ODAPITXL.js";
|
|
14
14
|
import {
|
|
15
15
|
noloDeleteRequest,
|
|
16
16
|
noloWriteRequest
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VY6VFGKR.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeTimeFields
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-HIM3FCLF.js";
|
|
21
21
|
import {
|
|
22
22
|
selectIdentityUser,
|
|
23
23
|
selectIdentityUserId
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HDJRLWTG.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LOCNXNOU.js";
|
|
7
7
|
import {
|
|
8
8
|
buildCreatedAgentRecord,
|
|
9
9
|
buildUpdatedAgentRecord,
|
|
10
10
|
normalizeAgentRecordForOutput,
|
|
11
11
|
parseAgentUpdateArgs,
|
|
12
|
+
refreshAgentRecordCache,
|
|
12
13
|
resolveAgentRecordFromHybridStore,
|
|
13
14
|
sanitizeAgentRecordForCliOutput,
|
|
14
15
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6UEJDFF7.js";
|
|
16
17
|
import {
|
|
17
18
|
resolveCliAgentKeyInput
|
|
18
19
|
} from "./chunk-SV5IJK6K.js";
|
|
@@ -130,10 +131,10 @@ async function runAgentUpdateCommand(args, deps = {}) {
|
|
|
130
131
|
userId,
|
|
131
132
|
record: built.nextRecord
|
|
132
133
|
});
|
|
133
|
-
await
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
await refreshAgentRecordCache({
|
|
135
|
+
db,
|
|
136
|
+
agentKey: built.agentKey,
|
|
137
|
+
record: built.nextRecord,
|
|
137
138
|
serverOrigin: built.serverUrl
|
|
138
139
|
});
|
|
139
140
|
clearCliLocalRuntimePreparedAgentCache();
|
|
@@ -212,7 +213,7 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
212
213
|
clearCliLocalRuntimePreparedAgentCache();
|
|
213
214
|
let verifyResult;
|
|
214
215
|
if (parsed.verify) {
|
|
215
|
-
const { verifyCustomProvider } = await import("./agentProviderCommands-
|
|
216
|
+
const { verifyCustomProvider } = await import("./agentProviderCommands-XPJYZSCE.js");
|
|
216
217
|
const rec = built.nextRecord;
|
|
217
218
|
verifyResult = await verifyCustomProvider({
|
|
218
219
|
providerUrl: rec.customProviderUrl,
|
|
@@ -222,15 +223,34 @@ async function runAgentCreateCommand(args, deps = {}) {
|
|
|
222
223
|
fetchImpl
|
|
223
224
|
});
|
|
224
225
|
}
|
|
226
|
+
const apiKeyRef = String(built.updates?.apiKeyRef || "").trim();
|
|
227
|
+
let authHint;
|
|
228
|
+
const OAUTH_REFS = /* @__PURE__ */ new Set(["claude", "chatgpt", "xai", "antigravity", "cloudflare"]);
|
|
229
|
+
if (apiKeyRef && OAUTH_REFS.has(apiKeyRef)) {
|
|
230
|
+
try {
|
|
231
|
+
const { createOAuthTokenStore } = await import("./oauthTokenStore-ITEB663N.js");
|
|
232
|
+
const store = createOAuthTokenStore();
|
|
233
|
+
if (!store.read(apiKeyRef)) {
|
|
234
|
+
authHint = `Subscription "${apiKeyRef}" is not authorized yet. Run \`nolo auth ${apiKeyRef}\` to log in.`;
|
|
235
|
+
}
|
|
236
|
+
} catch {
|
|
237
|
+
}
|
|
238
|
+
}
|
|
225
239
|
output.write(JSON.stringify({
|
|
226
240
|
ok: true,
|
|
227
241
|
agentKey: built.agentKey,
|
|
228
242
|
baseUrl: built.serverUrl,
|
|
229
243
|
updates: sanitizeAgentRecordForCliOutput(built.updates),
|
|
230
244
|
record: sanitizeAgentRecordForCliOutput(built.nextRecord),
|
|
231
|
-
...verifyResult ? { verify: verifyResult } : {}
|
|
245
|
+
...verifyResult ? { verify: verifyResult } : {},
|
|
246
|
+
...authHint ? { hint: authHint } : {}
|
|
232
247
|
}, null, 2));
|
|
233
248
|
output.write("\n");
|
|
249
|
+
if (authHint) {
|
|
250
|
+
const errorOutput = deps.error ?? process.stderr;
|
|
251
|
+
errorOutput.write(`[nolo] Hint: ${authHint}
|
|
252
|
+
`);
|
|
253
|
+
}
|
|
234
254
|
return 0;
|
|
235
255
|
} catch (error) {
|
|
236
256
|
output.write(
|