nolo-cli 0.88.0-alpha.1 → 0.89.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-OYYN3KQN.js → _executeModel-I3XRMAJ2.js} +30 -30
- package/{action-JZ62BXLX.js → action-7GHFPDSQ.js} +4 -4
- package/{addContentAction-2ETXWERA.js → addContentAction-ZNVB2NOV.js} +2 -2
- package/{addDialogAgentAction-COSPGJ4K.js → addDialogAgentAction-CIDFWATM.js} +1 -1
- package/{agentDeleteCommand-7R63ZEJO.js → agentDeleteCommand-DCTG26JW.js} +18 -18
- package/{agentEmailCommands-FHUDZF3O.js → agentEmailCommands-MRRHBLDQ.js} +40 -40
- package/{agentListCommands-CWSKIM2T.js → agentListCommands-CUE46CSP.js} +20 -20
- package/{agentMachineCommands-I76OX5RH.js → agentMachineCommands-FYDEKBIO.js} +18 -18
- package/{agentProviderCommands-65ZC2WB4.js → agentProviderCommands-X3FA6BUM.js} +87 -0
- package/{agentPullCommand-N7L2CT7L.js → agentPullCommand-U73W5IBM.js} +1 -1
- package/{agentRecordCommands-NNSHYOJJ.js → agentRecordCommands-P2MSNP7R.js} +39 -39
- package/{agentRunCommand-5XIUOB6M.js → agentRunCommand-QJGP7JEN.js} +39 -39
- package/{agentRuntimeLocal-HJJ75IEL.js → agentRuntimeLocal-T43UNWAY.js} +15 -15
- package/{agentSlice-BY4B7SZN.js → agentSlice-7GDS5Q2S.js} +2 -2
- package/{appDeleteCommands-I5FFT4AP.js → appDeleteCommands-YBKY3VEI.js} +18 -18
- package/{appDeployCommands-KGPV55WA.js → appDeployCommands-EBC76HO4.js} +18 -18
- package/{appDeployStatusCommands-E7G63JHG.js → appDeployStatusCommands-WXRC5KEK.js} +18 -18
- package/{appGetCommands-SM467V6N.js → appGetCommands-VZZQEDOV.js} +18 -18
- package/{appListCommands-HXMRWXQV.js → appListCommands-HYSPVQ77.js} +18 -18
- package/{authCommand-NNFLRLGJ.js → authCommand-E4GDVKMW.js} +9 -9
- package/{authCommands-364ESL7K.js → authCommands-VOTT6XWX.js} +2 -2
- package/{builtinSkillRegistry-VXSNE7LM.js → builtinSkillRegistry-5SYVTS6Z.js} +3 -3
- package/{chatQueueReduxAdapter-BO46SLAF.js → chatQueueReduxAdapter-CXEWIDFZ.js} +13 -13
- package/{chunk-NG4UT4K4.js → chunk-23RQKXP6.js} +1 -1
- package/{chunk-C3FZR5EC.js → chunk-2F7RJC6L.js} +1 -1
- package/{chunk-SR2I44ML.js → chunk-2XEVK4BT.js} +1 -1
- package/{chunk-BQKN5ZHZ.js → chunk-3T4PRBHV.js} +1 -1
- package/{chunk-BT5QS32P.js → chunk-4FRNB4ZG.js} +4 -4
- package/{chunk-X7WAX4JU.js → chunk-5EJZGJS2.js} +1 -1
- package/{chunk-MXUSPS2N.js → chunk-6H7GN3JL.js} +1554 -1529
- package/{chunk-WRAQE6NT.js → chunk-6RCZYDDC.js} +5 -5
- package/{chunk-IX2C6U5S.js → chunk-6ZC5KPXV.js} +303 -18
- package/{chunk-GJ7OZ5AA.js → chunk-AYT2OKNM.js} +3 -3
- package/{chunk-PY4QMA4R.js → chunk-BNMZ7QUV.js} +1 -1
- package/{chunk-LHDV2QUI.js → chunk-DS3SQTDT.js} +1 -1
- package/{chunk-6LUUGZTS.js → chunk-EXWOCYCR.js} +3 -3
- package/{chunk-N4X2KIYL.js → chunk-GIG262ZG.js} +1 -1
- package/{chunk-WKJC6UOK.js → chunk-GRJTR4PU.js} +2 -2
- package/{chunk-T2EUOLNJ.js → chunk-GXWEF4IZ.js} +1 -1
- package/{chunk-PUBG45E7.js → chunk-IMDA4FW4.js} +19 -19
- package/{chunk-6IHWRTUK.js → chunk-IO7DYRPW.js} +3 -3
- package/{chunk-BEQGQMYW.js → chunk-IZAWJCG7.js} +1 -1
- package/{chunk-JGFQXKOI.js → chunk-JC2WQS66.js} +14 -14
- package/{chunk-S6FCVZ4I.js → chunk-JITSBA52.js} +2 -2
- package/{chunk-DJM4BCSB.js → chunk-KT6LENVP.js} +2 -2
- package/{chunk-NRCMG4QP.js → chunk-L2VNQQ7M.js} +20 -20
- package/{chunk-PZ7KLSR5.js → chunk-LEYH5NOH.js} +5 -5
- package/{chunk-RXX4GDIH.js → chunk-LS2ZANRJ.js} +1 -1
- package/{chunk-4YIWJYIX.js → chunk-LSV2BOJL.js} +1 -1
- package/{chunk-5HKWE6OQ.js → chunk-MFW4BGJS.js} +1 -1
- package/{chunk-LOQUOFNY.js → chunk-NVHJWYUO.js} +25 -25
- package/{chunk-IZWQKAGJ.js → chunk-OCL2YCAU.js} +3 -3
- package/{chunk-BXLB7DXE.js → chunk-P3AS5IPM.js} +97 -2
- package/{chunk-M67M3AK5.js → chunk-PHDKTASK.js} +1 -1
- package/{chunk-HOMTDPWW.js → chunk-Q246OUG5.js} +3 -3
- package/{chunk-B7W5GH7Z.js → chunk-Q4KVAB6L.js} +3 -3
- package/{chunk-N3AFKM63.js → chunk-S6STPUMG.js} +4 -4
- package/{chunk-PZCTYKGU.js → chunk-T4F2EQGN.js} +2 -2
- package/{chunk-A3GDWRW6.js → chunk-TGRQUFLU.js} +1 -1
- package/{chunk-KIAHQ37Z.js → chunk-UINEAQ2R.js} +1 -1
- package/{chunk-CADAR6QU.js → chunk-UO66QKGI.js} +2 -2
- package/{chunk-XPMTSMUR.js → chunk-US463UAD.js} +2 -2
- package/{chunk-AJHEFRGJ.js → chunk-UWMQ6FPM.js} +4 -0
- package/{chunk-TR54UTFI.js → chunk-VARZWSKW.js} +2 -2
- package/{chunk-AXTSU2GN.js → chunk-VQD6BTML.js} +3 -3
- package/{chunk-5377HH3Q.js → chunk-VW3YGKWR.js} +8 -8
- package/{chunk-SI2EE4UA.js → chunk-W7PGACND.js} +9 -9
- package/{chunk-5XV64MAU.js → chunk-WSOMSDQB.js} +1 -1
- package/{chunk-TMPLPCVX.js → chunk-X77EN2BJ.js} +2 -2
- package/{chunk-WVXCW7DR.js → chunk-XCSSFPTB.js} +9 -4
- package/{chunk-2LX7X7HX.js → chunk-Y2IFJ7VM.js} +29 -1
- package/{chunk-EDZAJS6E.js → chunk-ZIHJVHFH.js} +1 -1
- package/{chunk-UMYXJWI3.js → chunk-ZKGIAM7I.js} +1 -1
- package/chunk-ZSG2AQU4.js +626 -0
- package/{contentThunks-NN3ZOJU6.js → contentThunks-Y2ACIFDB.js} +14 -14
- package/{createAgentAutomationAction-UQVM5MV6.js → createAgentAutomationAction-TNE3QMJR.js} +14 -14
- package/{createDialogAction-2STXHX6L.js → createDialogAction-BMGHBTQB.js} +16 -16
- package/{createPageAction-242235N5.js → createPageAction-FFNIZPIS.js} +14 -14
- package/{dbSlice-JNK4XZ27.js → dbSlice-4CUQE35F.js} +1 -1
- package/{dialogCommands-PHA2BBME.js → dialogCommands-3JC3BIXC.js} +18 -18
- package/{dialogSlice-NOUIL5BO.js → dialogSlice-3E7Z7HZV.js} +13 -13
- package/{docCreateCommands-DBC54QNT.js → docCreateCommands-6LNQLCTA.js} +17 -17
- package/{docDeleteCommands-BZX7G4OR.js → docDeleteCommands-ZJOAPWZS.js} +18 -18
- package/{docReadCommands-Q2HY6WCP.js → docReadCommands-LJTRSBG6.js} +17 -17
- package/{docStore-QDYR4FZ2.js → docStore-R47ABXBB.js} +2 -2
- package/{docUpdateCommands-BTZO5DTY.js → docUpdateCommands-7P3QF3N2.js} +17 -17
- package/{getPricing-QVTUQQTM.js → getPricing-TV6ZB7ES.js} +3 -3
- package/{handleSendMessageAction-W6GXLCWS.js → handleSendMessageAction-FFYOGXAO.js} +13 -13
- package/index.js +58 -54
- package/{localDialogRead-GKTRZFAP.js → localDialogRead-BTFJ4V2I.js} +1 -1
- package/{localRuntimeDb-P37ZTX55.js → localRuntimeDb-SYQGUF4U.js} +1 -1
- package/{machineCommands-7HE2HX56.js → machineCommands-FN5GGQV3.js} +37 -37
- package/{machineWsRunDispatch-FBWKBESO.js → machineWsRunDispatch-H47IA7ZT.js} +37 -37
- package/{memberThunks-A6OAY77F.js → memberThunks-N35XAOC6.js} +2 -2
- package/{models-GS72DVJS.js → models-CMXFDBQH.js} +2 -2
- package/package.json +1 -1
- package/providerPresetApply-D2GGHPI7.js +214 -0
- package/providerRegistry-MU6C4ABD.js +31 -0
- package/{readlineWorkspace-RLN3EILV.js → readlineWorkspace-NXKHYZEU.js} +45 -45
- package/{removeDialogAgentAction-6SGBZWSW.js → removeDialogAgentAction-O2POGBOE.js} +4 -4
- package/{runAgentClientLoop-6DEWS4PV.js → runAgentClientLoop-CEBV5UPD.js} +28 -28
- package/{runtimeDoctorCommands-CROTMULY.js → runtimeDoctorCommands-X6WDBEQX.js} +2 -2
- package/{setDialogExtraReferencesAction-LC3SOVJO.js → setDialogExtraReferencesAction-KPSVVY3C.js} +2 -2
- package/{setPrimaryDialogAgentAction-XE2HIEVY.js → setPrimaryDialogAgentAction-RMJETONI.js} +4 -4
- package/{settingSlice-GJYAXZZ6.js → settingSlice-I6MTTNDX.js} +3 -3
- package/{spaceCommands-5GJJVW46.js → spaceCommands-JHT4ALCQ.js} +17 -17
- package/{streamAgentChatTurn-FMX2IFTN.js → streamAgentChatTurn-SFCZP4GY.js} +34 -34
- package/{switchDialogAgentAction-EDYI5RLR.js → switchDialogAgentAction-OQSGWVQQ.js} +1 -1
- package/{tools-ZHD6MQ7J.js → tools-K3YOTESV.js} +25 -25
- package/{tuiSummaryLlmCaller-CCYGQDGB.js → tuiSummaryLlmCaller-T2OA5ZVB.js} +8 -8
- package/{updateDialogTitleAction-XOTA3PMK.js → updateDialogTitleAction-CSPKYQRO.js} +14 -14
- package/{db-VQSAOWAO.js → db-WK5MDZVN.js} +1 -1
- package/{localRuntimeAuthority-R5UBODT3.js → localRuntimeAuthority-6IR6BBXE.js} +3 -3
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addContentToSpace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S6STPUMG.js";
|
|
4
4
|
import {
|
|
5
5
|
prepareAndPersistMessage,
|
|
6
6
|
uiAskChoiceFunc,
|
|
7
7
|
uiAskChoiceFunctionSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-L2VNQQ7M.js";
|
|
9
9
|
import {
|
|
10
10
|
require_date_fns
|
|
11
11
|
} from "./chunk-M76ECQRD.js";
|
|
12
12
|
import {
|
|
13
13
|
buildBuiltinObjectSkillReference
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XCSSFPTB.js";
|
|
15
15
|
import {
|
|
16
16
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
17
17
|
PLATFORM_HOSTED_KIMI_PROVIDER
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UWMQ6FPM.js";
|
|
19
19
|
import {
|
|
20
20
|
read,
|
|
21
21
|
readAndWait,
|
|
22
22
|
removeCachedEntity,
|
|
23
23
|
upsertSSREntity,
|
|
24
24
|
write
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-5EJZGJS2.js";
|
|
26
26
|
import {
|
|
27
27
|
createAgentKey,
|
|
28
28
|
createDialogKey,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
resolveLocalUserId,
|
|
28
28
|
t,
|
|
29
29
|
toolLabel
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-IMDA4FW4.js";
|
|
31
31
|
import {
|
|
32
32
|
createRunActivityTracker,
|
|
33
33
|
popSingleQueueMessage,
|
|
@@ -43,11 +43,11 @@ import {
|
|
|
43
43
|
} from "./chunk-DWUCB2A3.js";
|
|
44
44
|
import {
|
|
45
45
|
getReadableCliDb
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-LS2ZANRJ.js";
|
|
47
47
|
import {
|
|
48
48
|
readDbRecord,
|
|
49
49
|
resolveAgentRecordFromHybridStore
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-Y2IFJ7VM.js";
|
|
51
51
|
import {
|
|
52
52
|
isLocalCliAgentKey
|
|
53
53
|
} from "./chunk-SPAQ4PVV.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "./chunk-LTRXGFMS.js";
|
|
64
64
|
import {
|
|
65
65
|
formatAgentListCard
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-NVHJWYUO.js";
|
|
67
67
|
import {
|
|
68
68
|
isTransientFetchError
|
|
69
69
|
} from "./chunk-5XTOKQLW.js";
|
|
@@ -84,11 +84,11 @@ import {
|
|
|
84
84
|
chooseMemoryOwners,
|
|
85
85
|
loadMemoryCandidatesFromDb,
|
|
86
86
|
resolveAgentMemoryPolicy
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-6RCZYDDC.js";
|
|
88
88
|
import {
|
|
89
89
|
API_REPORTED_COST_MULTIPLIER,
|
|
90
90
|
parseUiAskChoiceContent
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-L2VNQQ7M.js";
|
|
92
92
|
import {
|
|
93
93
|
isOAuthApiKeyRef
|
|
94
94
|
} from "./chunk-YYLHWIW6.js";
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
} from "./chunk-TRV2MIDW.js";
|
|
100
100
|
import {
|
|
101
101
|
getDefaultCliLocalRuntimeDb
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-2F7RJC6L.js";
|
|
103
103
|
import {
|
|
104
104
|
buildSkillDiscoveryContextLayer
|
|
105
105
|
} from "./chunk-E4MARS3Q.js";
|
|
@@ -111,10 +111,10 @@ import {
|
|
|
111
111
|
LOCAL_AGENT_CONFIG_MISSING_CODE,
|
|
112
112
|
LOCAL_TURN_ABORTED_CODE,
|
|
113
113
|
readActionGate
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-VW3YGKWR.js";
|
|
115
115
|
import {
|
|
116
116
|
resolveAgentRuntimeConfigFromRecord
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-WSOMSDQB.js";
|
|
118
118
|
import {
|
|
119
119
|
createThinkParserState,
|
|
120
120
|
flushThinkParser,
|
|
@@ -128,21 +128,21 @@ import {
|
|
|
128
128
|
} from "./chunk-CJCJF5XB.js";
|
|
129
129
|
import {
|
|
130
130
|
isAntigravityOAuthAgent
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-DS3SQTDT.js";
|
|
132
132
|
import {
|
|
133
133
|
resolveClientVersion
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-X77EN2BJ.js";
|
|
135
135
|
import {
|
|
136
136
|
DEFAULT_CONTEXT_WINDOW,
|
|
137
137
|
getModelContextWindow,
|
|
138
138
|
normalizeUsage
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-OCL2YCAU.js";
|
|
140
140
|
import {
|
|
141
141
|
clipCompactText
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-KT6LENVP.js";
|
|
143
143
|
import {
|
|
144
144
|
findModelConfig
|
|
145
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-6H7GN3JL.js";
|
|
146
146
|
import {
|
|
147
147
|
compactWhitespace
|
|
148
148
|
} from "./chunk-DWLEOOGR.js";
|
|
@@ -167,7 +167,7 @@ import {
|
|
|
167
167
|
CLIENT_VERSION_TOO_OLD_CODE,
|
|
168
168
|
NOLO_CLIENT_VERSION_HEADER,
|
|
169
169
|
buildClientVersionUpgradeMessage
|
|
170
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-UWMQ6FPM.js";
|
|
171
171
|
import {
|
|
172
172
|
parsePositiveFiniteNumberOrFallback
|
|
173
173
|
} from "./chunk-Y5GCAMGP.js";
|
|
@@ -10413,7 +10413,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
|
|
|
10413
10413
|
// packages/cli/client/agentRun.ts
|
|
10414
10414
|
import { ulid } from "ulid";
|
|
10415
10415
|
async function loadRunLocalAgentTurn() {
|
|
10416
|
-
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-
|
|
10416
|
+
const { runLocalAgentTurn } = await import("./agentRuntimeLocal-T43UNWAY.js");
|
|
10417
10417
|
return runLocalAgentTurn;
|
|
10418
10418
|
}
|
|
10419
10419
|
var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
|
|
@@ -12073,6 +12073,273 @@ var rankMemoryCandidates = (items, query, context) => {
|
|
|
12073
12073
|
});
|
|
12074
12074
|
};
|
|
12075
12075
|
|
|
12076
|
+
// packages/ai/memory/vnext/store.ts
|
|
12077
|
+
var enc = (value) => encodeURIComponent(value).replace(/-/g, "%2D");
|
|
12078
|
+
var rangeOf = (prefix) => ({ gte: prefix, lte: `${prefix}\uFFFF` });
|
|
12079
|
+
var entityOwnerPrefix = (ownerId) => `mem2-e-${enc(ownerId)}-`;
|
|
12080
|
+
var stateEntityIndexPrefix = (ownerId, entityId) => `mem2-si-${enc(ownerId)}-${enc(entityId)}-`;
|
|
12081
|
+
var readIndexed = async (db, prefix) => {
|
|
12082
|
+
const refs = [];
|
|
12083
|
+
for await (const [, value] of db.iterator({ ...rangeOf(prefix), reverse: false })) {
|
|
12084
|
+
if (typeof value?.key === "string") refs.push(value.key);
|
|
12085
|
+
}
|
|
12086
|
+
const rows = await Promise.all(refs.map((key) => db.get(key).catch(() => null)));
|
|
12087
|
+
return rows.filter((row) => !!row);
|
|
12088
|
+
};
|
|
12089
|
+
var listMemoryEntitiesVNext = async (db, ownerId) => {
|
|
12090
|
+
const rows = [];
|
|
12091
|
+
for await (const [, value] of db.iterator({
|
|
12092
|
+
...rangeOf(entityOwnerPrefix(ownerId)),
|
|
12093
|
+
reverse: false
|
|
12094
|
+
})) {
|
|
12095
|
+
if (value) rows.push(value);
|
|
12096
|
+
}
|
|
12097
|
+
return rows;
|
|
12098
|
+
};
|
|
12099
|
+
var listMemoryStatesForEntityVNext = (db, ownerId, entityId) => readIndexed(db, stateEntityIndexPrefix(ownerId, entityId));
|
|
12100
|
+
|
|
12101
|
+
// packages/ai/memory/vnext/recall.ts
|
|
12102
|
+
var MAX_RECALL_REFS = 6;
|
|
12103
|
+
var stripFence = (raw) => {
|
|
12104
|
+
const trimmed = raw.trim();
|
|
12105
|
+
const match = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
|
|
12106
|
+
return match ? match[1].trim() : trimmed;
|
|
12107
|
+
};
|
|
12108
|
+
var parseSelection = (raw) => {
|
|
12109
|
+
let parsed;
|
|
12110
|
+
try {
|
|
12111
|
+
parsed = JSON.parse(stripFence(raw));
|
|
12112
|
+
} catch {
|
|
12113
|
+
throw new Error("memory recall selector output is not valid JSON");
|
|
12114
|
+
}
|
|
12115
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
12116
|
+
throw new Error("memory recall selector output must be an object");
|
|
12117
|
+
}
|
|
12118
|
+
const obj = parsed;
|
|
12119
|
+
if (!Array.isArray(obj.refs) || !obj.refs.every((item) => typeof item === "string")) {
|
|
12120
|
+
throw new Error("memory recall selector refs must be string[]");
|
|
12121
|
+
}
|
|
12122
|
+
if (typeof obj.reason !== "string") {
|
|
12123
|
+
throw new Error("memory recall selector reason must be string");
|
|
12124
|
+
}
|
|
12125
|
+
return {
|
|
12126
|
+
refs: [...new Set(obj.refs)].slice(0, MAX_RECALL_REFS),
|
|
12127
|
+
reason: obj.reason
|
|
12128
|
+
};
|
|
12129
|
+
};
|
|
12130
|
+
var buildCatalog = async (db, ownerId) => {
|
|
12131
|
+
const entities = await listMemoryEntitiesVNext(db, ownerId);
|
|
12132
|
+
const states = [];
|
|
12133
|
+
for (const entity of entities) {
|
|
12134
|
+
states.push(...await listMemoryStatesForEntityVNext(db, ownerId, entity.id));
|
|
12135
|
+
}
|
|
12136
|
+
return { entities, states };
|
|
12137
|
+
};
|
|
12138
|
+
var catalogText = (entities, states) => JSON.stringify(
|
|
12139
|
+
{
|
|
12140
|
+
entities: entities.map((entity) => ({
|
|
12141
|
+
id: entity.id,
|
|
12142
|
+
type: entity.type,
|
|
12143
|
+
name: entity.name,
|
|
12144
|
+
...entity.subtype ? { subtype: entity.subtype } : {},
|
|
12145
|
+
...entity.aliases?.length ? { aliases: entity.aliases } : {}
|
|
12146
|
+
})),
|
|
12147
|
+
states: states.map((state2) => ({
|
|
12148
|
+
id: state2.id,
|
|
12149
|
+
entityId: state2.entityId,
|
|
12150
|
+
facet: state2.facet,
|
|
12151
|
+
text: state2.text,
|
|
12152
|
+
// Retired (superseded) States stay listed as recoverable history; the
|
|
12153
|
+
// boolean — not the retiredAt timestamp — enters the prompt so no
|
|
12154
|
+
// timestamps reach LLM text.
|
|
12155
|
+
...state2.retiredAt ? { retired: true } : {}
|
|
12156
|
+
}))
|
|
12157
|
+
},
|
|
12158
|
+
null,
|
|
12159
|
+
2
|
|
12160
|
+
);
|
|
12161
|
+
var createMemoryVNextRecall = (input) => async (query) => {
|
|
12162
|
+
const startedAt = performance.now();
|
|
12163
|
+
const { entities, states } = await buildCatalog(input.db, input.ownerId);
|
|
12164
|
+
if (entities.length === 0 && states.length === 0) {
|
|
12165
|
+
return {
|
|
12166
|
+
query,
|
|
12167
|
+
refs: [],
|
|
12168
|
+
entities: [],
|
|
12169
|
+
states: [],
|
|
12170
|
+
reason: "memory catalog is empty",
|
|
12171
|
+
trace: {
|
|
12172
|
+
candidateEntities: 0,
|
|
12173
|
+
candidateStates: 0,
|
|
12174
|
+
selectedRefs: 0,
|
|
12175
|
+
elapsedMs: Math.round((performance.now() - startedAt) * 10) / 10
|
|
12176
|
+
}
|
|
12177
|
+
};
|
|
12178
|
+
}
|
|
12179
|
+
const result = await input.provider.complete(
|
|
12180
|
+
[
|
|
12181
|
+
{
|
|
12182
|
+
role: "system",
|
|
12183
|
+
content: [
|
|
12184
|
+
"Select the smallest useful set of long-lived memory entrances for the user query.",
|
|
12185
|
+
'Return ONLY JSON: {"refs":["exact-id"],"reason":"short explanation"}.',
|
|
12186
|
+
`Select at most ${MAX_RECALL_REFS} exact ids from the supplied catalog.`,
|
|
12187
|
+
"Prefer State ids when current durable understanding answers the query.",
|
|
12188
|
+
"Select an Entity id when it is a useful navigation anchor and no single State is enough.",
|
|
12189
|
+
"Do not select unrelated memories merely because they are personal or interesting.",
|
|
12190
|
+
"Historical-detail questions may select the relevant current State/Entity as an entrance; deeper evidence is handled by inspect, not here."
|
|
12191
|
+
].join("\n")
|
|
12192
|
+
},
|
|
12193
|
+
{
|
|
12194
|
+
role: "user",
|
|
12195
|
+
content: `Query:
|
|
12196
|
+
${query}
|
|
12197
|
+
|
|
12198
|
+
Memory catalog:
|
|
12199
|
+
${catalogText(entities, states)}`
|
|
12200
|
+
}
|
|
12201
|
+
],
|
|
12202
|
+
input.timeoutMs ? { timeoutMs: input.timeoutMs } : void 0
|
|
12203
|
+
);
|
|
12204
|
+
const selected = parseSelection(result.content);
|
|
12205
|
+
const entityById = new Map(entities.map((entity) => [entity.id, entity]));
|
|
12206
|
+
const stateById = new Map(states.map((state2) => [state2.id, state2]));
|
|
12207
|
+
const validRefs = selected.refs.filter((ref) => entityById.has(ref) || stateById.has(ref));
|
|
12208
|
+
return {
|
|
12209
|
+
query,
|
|
12210
|
+
refs: validRefs,
|
|
12211
|
+
entities: validRefs.flatMap((ref) => {
|
|
12212
|
+
const entity = entityById.get(ref);
|
|
12213
|
+
return entity ? [entity] : [];
|
|
12214
|
+
}),
|
|
12215
|
+
states: validRefs.flatMap((ref) => {
|
|
12216
|
+
const state2 = stateById.get(ref);
|
|
12217
|
+
return state2 ? [state2] : [];
|
|
12218
|
+
}),
|
|
12219
|
+
reason: selected.reason,
|
|
12220
|
+
trace: {
|
|
12221
|
+
candidateEntities: entities.length,
|
|
12222
|
+
candidateStates: states.length,
|
|
12223
|
+
selectedRefs: validRefs.length,
|
|
12224
|
+
elapsedMs: Math.round((performance.now() - startedAt) * 10) / 10
|
|
12225
|
+
}
|
|
12226
|
+
};
|
|
12227
|
+
};
|
|
12228
|
+
|
|
12229
|
+
// packages/ai/memory/vnext/legacyMigration.ts
|
|
12230
|
+
var resolveLegacyMemoryPrincipal = (item) => ({
|
|
12231
|
+
ownerType: item.ownerType,
|
|
12232
|
+
ownerId: item.ownerId,
|
|
12233
|
+
principalId: `${item.ownerType}:${encodeURIComponent(item.ownerId)}`
|
|
12234
|
+
});
|
|
12235
|
+
|
|
12236
|
+
// packages/ai/memory/vnext/shadowRead.ts
|
|
12237
|
+
var SHADOW_TIMEOUT_MS = 2e4;
|
|
12238
|
+
var ERROR_MESSAGE_MAX = 120;
|
|
12239
|
+
var normalizeTextKey = (text) => text.trim().replace(/\s+/g, " ").toLowerCase();
|
|
12240
|
+
var legacyItemKeys = (item) => {
|
|
12241
|
+
const keys = [normalizeTextKey(item.content ?? "")];
|
|
12242
|
+
return keys.filter((key) => key.length > 0);
|
|
12243
|
+
};
|
|
12244
|
+
var vnextResultKeys = (result) => {
|
|
12245
|
+
const keys = [];
|
|
12246
|
+
for (const entity of result.entities) {
|
|
12247
|
+
if (entity.name) keys.push(normalizeTextKey(entity.name));
|
|
12248
|
+
}
|
|
12249
|
+
for (const state2 of result.states) {
|
|
12250
|
+
if (state2.text) keys.push(normalizeTextKey(state2.text));
|
|
12251
|
+
}
|
|
12252
|
+
return keys.filter((key) => key.length > 0);
|
|
12253
|
+
};
|
|
12254
|
+
var vnextContextChars = (result) => result.entities.reduce(
|
|
12255
|
+
(sum, entity) => sum + (entity.name?.length ?? 0),
|
|
12256
|
+
result.states.reduce((sum, state2) => sum + (state2.text?.length ?? 0), 0)
|
|
12257
|
+
);
|
|
12258
|
+
var shortError = (error) => {
|
|
12259
|
+
const message = error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
12260
|
+
return message.length > ERROR_MESSAGE_MAX ? `${message.slice(0, ERROR_MESSAGE_MAX)}\u2026` : message;
|
|
12261
|
+
};
|
|
12262
|
+
var withTimeout = async (promise, timeoutMs, label) => {
|
|
12263
|
+
let timer;
|
|
12264
|
+
const timeout = new Promise((_, reject) => {
|
|
12265
|
+
timer = setTimeout(() => reject(new Error(label)), timeoutMs);
|
|
12266
|
+
});
|
|
12267
|
+
try {
|
|
12268
|
+
return await Promise.race([promise, timeout]);
|
|
12269
|
+
} finally {
|
|
12270
|
+
if (timer) clearTimeout(timer);
|
|
12271
|
+
}
|
|
12272
|
+
};
|
|
12273
|
+
var runMemoryVNextShadowRead = async (input) => {
|
|
12274
|
+
const now = input.ctx.now ?? (() => performance.now());
|
|
12275
|
+
const emit = input.emit ?? ((observation2) => console.info("[memory] vnext shadow read", {
|
|
12276
|
+
event: "memory_vnext_shadow_read",
|
|
12277
|
+
...observation2
|
|
12278
|
+
}));
|
|
12279
|
+
const legacyKeys = new Set(
|
|
12280
|
+
input.legacyItems.flatMap((item) => legacyItemKeys(item))
|
|
12281
|
+
);
|
|
12282
|
+
const vnextStartedAt = now();
|
|
12283
|
+
let vnextHitCount = 0;
|
|
12284
|
+
let vnextChars = 0;
|
|
12285
|
+
const vnextKeys = /* @__PURE__ */ new Set();
|
|
12286
|
+
let vnextError;
|
|
12287
|
+
try {
|
|
12288
|
+
const shadowTimeoutMs = input.ctx.shadowTimeoutMs ?? SHADOW_TIMEOUT_MS;
|
|
12289
|
+
const perOwner = async (owner) => {
|
|
12290
|
+
const principal = resolveLegacyMemoryPrincipal({
|
|
12291
|
+
ownerType: owner.ownerType,
|
|
12292
|
+
ownerId: owner.ownerId
|
|
12293
|
+
});
|
|
12294
|
+
const recall = createMemoryVNextRecall({
|
|
12295
|
+
db: input.ctx.db,
|
|
12296
|
+
ownerId: principal.principalId,
|
|
12297
|
+
provider: input.ctx.provider,
|
|
12298
|
+
timeoutMs: input.ctx.timeoutMs
|
|
12299
|
+
});
|
|
12300
|
+
return recall(input.ctx.query);
|
|
12301
|
+
};
|
|
12302
|
+
const results = await withTimeout(
|
|
12303
|
+
Promise.all(input.ctx.owners.map((owner) => perOwner(owner))),
|
|
12304
|
+
shadowTimeoutMs,
|
|
12305
|
+
`memory vnext shadow read timed out after ${shadowTimeoutMs}ms`
|
|
12306
|
+
);
|
|
12307
|
+
for (const result of results) {
|
|
12308
|
+
vnextHitCount += result.refs.length;
|
|
12309
|
+
vnextChars += vnextContextChars(result);
|
|
12310
|
+
for (const key of vnextResultKeys(result)) vnextKeys.add(key);
|
|
12311
|
+
}
|
|
12312
|
+
} catch (error) {
|
|
12313
|
+
vnextError = shortError(error);
|
|
12314
|
+
}
|
|
12315
|
+
const vnextLatencyMs = Math.round((now() - vnextStartedAt) * 10) / 10;
|
|
12316
|
+
let overlapCount = null;
|
|
12317
|
+
let legacyOnlyCount = null;
|
|
12318
|
+
let vnextOnlyCount = null;
|
|
12319
|
+
if (!vnextError) {
|
|
12320
|
+
let overlap = 0;
|
|
12321
|
+
for (const key of vnextKeys) if (legacyKeys.has(key)) overlap += 1;
|
|
12322
|
+
overlapCount = overlap;
|
|
12323
|
+
legacyOnlyCount = Math.max(0, legacyKeys.size - overlap);
|
|
12324
|
+
vnextOnlyCount = Math.max(0, vnextKeys.size - overlap);
|
|
12325
|
+
}
|
|
12326
|
+
const observation = {
|
|
12327
|
+
legacyHitCount: input.legacyItems.length,
|
|
12328
|
+
vnextHitCount,
|
|
12329
|
+
overlapCount,
|
|
12330
|
+
legacyOnlyCount,
|
|
12331
|
+
vnextOnlyCount,
|
|
12332
|
+
legacyLatencyMs: input.legacyLatencyMs,
|
|
12333
|
+
vnextLatencyMs,
|
|
12334
|
+
legacyContextChars: input.legacyContextChars,
|
|
12335
|
+
vnextContextChars: vnextChars,
|
|
12336
|
+
...vnextError ? { vnextError } : {}
|
|
12337
|
+
};
|
|
12338
|
+
emit(observation);
|
|
12339
|
+
return observation;
|
|
12340
|
+
};
|
|
12341
|
+
var isMemoryVNextShadowReadEnabled = (env = typeof process !== "undefined" ? process.env : {}) => env.NOLO_MEMORY_VNEXT_SHADOW_READ === "1" || env.NOLO_MEMORY_VNEXT_SHADOW_READ === "true";
|
|
12342
|
+
|
|
12076
12343
|
// packages/ai/memory/runtime.ts
|
|
12077
12344
|
var COLD_STORAGE_CONFIDENCE = 0.3;
|
|
12078
12345
|
var MEMORY_OVERLAY_TOKEN_BUDGET = DEFAULT_MEMORY_OVERLAY_TOKEN_BUDGET;
|
|
@@ -12196,6 +12463,7 @@ var resolveMemoryRuntime = async (input) => {
|
|
|
12196
12463
|
return { selectedItems: [], promptBlock: null };
|
|
12197
12464
|
}
|
|
12198
12465
|
const policy = resolveAgentMemoryPolicy({ agentKey: input.agentKey });
|
|
12466
|
+
const legacyStartedAt = performance.now();
|
|
12199
12467
|
const candidates = await loadMemoryCandidatesFromDb(input.db, {
|
|
12200
12468
|
owners,
|
|
12201
12469
|
subjects: buildMemorySubjectsForAgent({
|
|
@@ -12222,13 +12490,29 @@ var resolveMemoryRuntime = async (input) => {
|
|
|
12222
12490
|
input.userInput
|
|
12223
12491
|
);
|
|
12224
12492
|
const selected = [...residentItems, ...ranked];
|
|
12493
|
+
const legacyLatencyMs = Math.round((performance.now() - legacyStartedAt) * 10) / 10;
|
|
12494
|
+
const promptBlock = selected.length === 0 ? null : buildMemoryOverlay(selected, { maxTokens: MEMORY_OVERLAY_TOKEN_BUDGET });
|
|
12495
|
+
const shadowEnabled = input.vNextShadowProvider != null && isMemoryVNextShadowReadEnabled();
|
|
12496
|
+
if (shadowEnabled) {
|
|
12497
|
+
await runMemoryVNextShadowRead({
|
|
12498
|
+
ctx: {
|
|
12499
|
+
db: input.db,
|
|
12500
|
+
owners,
|
|
12501
|
+
query: input.userInput,
|
|
12502
|
+
provider: input.vNextShadowProvider
|
|
12503
|
+
},
|
|
12504
|
+
legacyItems: selected,
|
|
12505
|
+
legacyLatencyMs,
|
|
12506
|
+
legacyContextChars: promptBlock?.length ?? 0
|
|
12507
|
+
});
|
|
12508
|
+
}
|
|
12225
12509
|
if (selected.length === 0) {
|
|
12226
12510
|
return { selectedItems: [], promptBlock: null };
|
|
12227
12511
|
}
|
|
12228
12512
|
await touchMemoryItemsInDb(input.db, selected);
|
|
12229
12513
|
return {
|
|
12230
12514
|
selectedItems: selected,
|
|
12231
|
-
promptBlock
|
|
12515
|
+
promptBlock
|
|
12232
12516
|
};
|
|
12233
12517
|
};
|
|
12234
12518
|
|
|
@@ -12272,7 +12556,8 @@ var queryLocalMemory = async (env, agentKey, userInput, spaceId) => {
|
|
|
12272
12556
|
userId: machineId,
|
|
12273
12557
|
agentKey,
|
|
12274
12558
|
userInput,
|
|
12275
|
-
...spaceId ? { spaceId } : {}
|
|
12559
|
+
...spaceId ? { spaceId } : {},
|
|
12560
|
+
...isMemoryVNextShadowReadEnabled(env) ? { vNextShadowProvider: void 0 } : {}
|
|
12276
12561
|
});
|
|
12277
12562
|
return resolution.promptBlock;
|
|
12278
12563
|
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
patch,
|
|
12
12
|
readAndWait
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5EJZGJS2.js";
|
|
14
14
|
import {
|
|
15
15
|
asOptionalTrimmedString
|
|
16
16
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -326,7 +326,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
326
326
|
).unwrap();
|
|
327
327
|
if (dbSpaceId) {
|
|
328
328
|
try {
|
|
329
|
-
const { updateContentTitle } = await import("./contentThunks-
|
|
329
|
+
const { updateContentTitle } = await import("./contentThunks-Y2ACIFDB.js");
|
|
330
330
|
await dispatch(
|
|
331
331
|
updateContentTitle({
|
|
332
332
|
spaceId: dbSpaceId,
|
|
@@ -365,7 +365,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
async function createDocState(args, thunkApi) {
|
|
368
|
-
const { createPageAction } = await import("./createPageAction-
|
|
368
|
+
const { createPageAction } = await import("./createPageAction-FFNIZPIS.js");
|
|
369
369
|
return createPageAction(args, thunkApi);
|
|
370
370
|
}
|
|
371
371
|
function subscribe(listener) {
|
|
@@ -35,15 +35,15 @@ import {
|
|
|
35
35
|
resolvePlatformAuthToken,
|
|
36
36
|
resolvePlatformServerUrl,
|
|
37
37
|
resolveProviderTransportDecision
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-X77EN2BJ.js";
|
|
39
39
|
import {
|
|
40
40
|
clipCompactText,
|
|
41
41
|
isMeaningfulChatCompletionOutput,
|
|
42
42
|
isMeaningfulResponsesOutput
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-KT6LENVP.js";
|
|
44
44
|
import {
|
|
45
45
|
NOLO_CLIENT_VERSION_HEADER
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-UWMQ6FPM.js";
|
|
47
47
|
import {
|
|
48
48
|
isRecord
|
|
49
49
|
} from "./chunk-KUG52IAP.js";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-OKCTLCKS.js";
|
|
7
7
|
import {
|
|
8
8
|
isAntigravityOAuthAgent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DS3SQTDT.js";
|
|
10
10
|
import {
|
|
11
11
|
getModelAbility
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-23RQKXP6.js";
|
|
13
13
|
import {
|
|
14
14
|
isOwnedAgentKey,
|
|
15
15
|
ownedAgentKey,
|