nolo-cli 0.95.0 → 0.95.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.
Files changed (42) hide show
  1. package/{_executeModel-4NTXSCYT.js → _executeModel-2A5AFVBG.js} +10 -10
  2. package/{agentEmailCommands-GJ7KXHA6.js → agentEmailCommands-IX6COKHS.js} +9 -9
  3. package/{agentMachineCommands-PXJG3EDI.js → agentMachineCommands-W36VFO5M.js} +1 -1
  4. package/{agentRecordCommands-3ONMYU6P.js → agentRecordCommands-JGOTOBTW.js} +9 -9
  5. package/{agentRunCommand-L6NJGDBA.js → agentRunCommand-LJBG6YF2.js} +10 -9
  6. package/{agentSlice-X63VSE6R.js → agentSlice-FZ7GGQM2.js} +1 -1
  7. package/{authCommand-W6I6GD3F.js → authCommand-2YPMMIJN.js} +3 -1
  8. package/{authCommands-GBIFZWD3.js → authCommands-FFDS4FVX.js} +3 -1
  9. package/{chatQueueReduxAdapter-KN774OKJ.js → chatQueueReduxAdapter-PRP4YQP7.js} +2 -2
  10. package/{chunk-V2SAIXHE.js → chunk-2QZTQEW4.js} +8 -8
  11. package/{chunk-HWRQVJGX.js → chunk-4B4DAAFV.js} +3 -3
  12. package/{chunk-S3VFZW75.js → chunk-4MPGAOXS.js} +3 -3
  13. package/{chunk-CQMQXVFQ.js → chunk-4RTK7EHT.js} +21 -81
  14. package/{chunk-2JCOP36I.js → chunk-6RDFAKG7.js} +2 -2
  15. package/{chunk-IX27RP45.js → chunk-BJJL5DZF.js} +1 -1
  16. package/{chunk-M73PVOVS.js → chunk-BVWTQJAA.js} +5 -5
  17. package/{chunk-7VJHIB2S.js → chunk-HZH7RULB.js} +17 -10
  18. package/{chunk-5T2W2ZZN.js → chunk-K5UOP7AI.js} +2 -2
  19. package/{chunk-RE3CDVRX.js → chunk-LYS4T7MY.js} +4 -4
  20. package/{chunk-VPFEPRME.js → chunk-OTEMQQZI.js} +71 -5
  21. package/{chunk-CJXHT3S7.js → chunk-QYFBT4CV.js} +2 -2
  22. package/{chunk-DA54MHPJ.js → chunk-RQNHAVSR.js} +1 -1
  23. package/{chunk-6UPZ63YT.js → chunk-RS4XOX6Y.js} +1 -1
  24. package/chunk-TY3TIUJK.js +89 -0
  25. package/{chunk-XTDH3PGV.js → chunk-WIU4KIBL.js} +2 -2
  26. package/{commandRegistry-NPS6IYBO.js → commandRegistry-ESFYIRF4.js} +24 -24
  27. package/{contentThunks-EB4JFL4K.js → contentThunks-ECQ6KK3I.js} +3 -3
  28. package/{createAgentAutomationAction-NZS7N4AW.js → createAgentAutomationAction-6EES5YQO.js} +3 -3
  29. package/{createDialogAction-4Q4J7P4T.js → createDialogAction-JTKMM4VG.js} +4 -4
  30. package/{createPageAction-FPKRGV7D.js → createPageAction-WQZTMGAG.js} +3 -3
  31. package/{dialogSlice-DXEZ3PA3.js → dialogSlice-I6GN3I5B.js} +2 -2
  32. package/{docStore-2JTPJVFK.js → docStore-B2ZM4PCR.js} +1 -1
  33. package/{handleSendMessageAction-FGPHI364.js → handleSendMessageAction-BAUWHASB.js} +2 -2
  34. package/index.js +2 -2
  35. package/{machineCommands-26AZP4AS.js → machineCommands-SG3QGVOP.js} +9 -9
  36. package/{machineWsRunDispatch-GQ5XJ2DL.js → machineWsRunDispatch-RTFT3ZDL.js} +9 -9
  37. package/package.json +1 -1
  38. package/{readlineWorkspace-B7NBQCX6.js → readlineWorkspace-MCNBLA56.js} +11 -10
  39. package/{runAgentClientLoop-RVB5K6R2.js → runAgentClientLoop-XDPBFXV2.js} +8 -8
  40. package/{streamAgentChatTurn-HV3FSRHN.js → streamAgentChatTurn-BBH3QDEZ.js} +9 -9
  41. package/{tools-AZR26MXC.js → tools-OQWSBQJA.js} +6 -6
  42. package/{updateDialogTitleAction-HEWCCXZZ.js → updateDialogTitleAction-E25IG3J3.js} +3 -3
@@ -35,7 +35,7 @@ import {
35
35
  } from "./chunk-I3QNET24.js";
36
36
  import {
37
37
  createDialogAction
38
- } from "./chunk-5T2W2ZZN.js";
38
+ } from "./chunk-K5UOP7AI.js";
39
39
  import {
40
40
  addMemberSpace,
41
41
  fetchAuthoritativeRemoteSpace,
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-VF4K2QE6.js";
60
60
  import {
61
61
  createDocState
62
- } from "./chunk-XTDH3PGV.js";
62
+ } from "./chunk-WIU4KIBL.js";
63
63
  import {
64
64
  setDialogExtraReferencesAction
65
65
  } from "./chunk-DSSTTEKI.js";
@@ -98,7 +98,7 @@ import {
98
98
  updateContentCategory,
99
99
  updateContentTitle,
100
100
  writeStoredCollapsedCategories
101
- } from "./chunk-DA54MHPJ.js";
101
+ } from "./chunk-RQNHAVSR.js";
102
102
  import {
103
103
  getCurrentSpaceId,
104
104
  getCurrentSpaceIdRaw,
@@ -120,14 +120,14 @@ import {
120
120
  selectMsgById,
121
121
  uiAskChoiceFunc,
122
122
  uiAskChoiceFunctionSchema
123
- } from "./chunk-V2SAIXHE.js";
123
+ } from "./chunk-2QZTQEW4.js";
124
124
  import {
125
125
  createAgent,
126
126
  deleteServerSyncedCredential,
127
127
  runLlm,
128
128
  streamAgentChatTurn,
129
129
  updateAgent
130
- } from "./chunk-HWRQVJGX.js";
130
+ } from "./chunk-4B4DAAFV.js";
131
131
  import {
132
132
  getActiveDialogKey,
133
133
  selectCurrentDialogKey,
@@ -3983,7 +3983,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3983
3983
  const deletedDialogIds = [];
3984
3984
  const deletedDialogKeys = [];
3985
3985
  const failures = [];
3986
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-DXEZ3PA3.js");
3986
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-I6GN3I5B.js");
3987
3987
  for (const target of targets) {
3988
3988
  try {
3989
3989
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -11756,6 +11756,7 @@ var deleteMemoryFunctionSchema = {
11756
11756
  };
11757
11757
 
11758
11758
  // packages/ai/tools/deleteMemoryTool.ts
11759
+ var VNEXT_STATE_ID_PREFIX = "vnext-state-";
11759
11760
  async function deleteMemoryFunc(args, thunkApi) {
11760
11761
  const reason = String(args.reason ?? "").trim();
11761
11762
  if (!reason && !args.ids?.length && !args.contentKeyword && !args.tags?.length) {
@@ -11792,11 +11793,15 @@ async function deleteMemoryFunc(args, thunkApi) {
11792
11793
  displayData: "\u672A\u627E\u5230\u5339\u914D\u7684\u8BB0\u5FC6\uFF0C\u65E0\u9700\u5220\u9664\u3002"
11793
11794
  };
11794
11795
  }
11796
+ const retiredCount2 = result.retiredIds?.length ?? (result.preview ?? []).filter(
11797
+ (item) => item.id.startsWith(VNEXT_STATE_ID_PREFIX)
11798
+ ).length;
11799
+ const physicalCount2 = Math.max(0, matched - retiredCount2);
11795
11800
  const previewList = (result.preview ?? []).map((item, idx) => `${idx + 1}. [${item.kind}] ${item.content}`).join("\n");
11796
11801
  return {
11797
11802
  rawData: result,
11798
11803
  displayData: [
11799
- `\u3010\u5F85\u7528\u6237\u786E\u8BA4\u3011\u5339\u914D\u5230 ${matched} \u6761\u7B26\u5408\u6761\u4EF6\u7684\u8BB0\u5FC6\uFF0C\u5373\u5C06\u7269\u7406\u5220\u9664\u3002`,
11804
+ `\u3010\u5F85\u7528\u6237\u786E\u8BA4\u3011\u5339\u914D\u5230 ${matched} \u6761\u7B26\u5408\u6761\u4EF6\u7684\u8BB0\u5FC6\uFF1A\u7269\u7406\u5220\u9664 ${physicalCount2} \u6761\uFF0C\u9000\u5F79 ${retiredCount2} \u6761\uFF08\u9000\u5F79\u4EC5\u8868\u793A\u505C\u6B62\u53EC\u56DE\uFF0C\u8BB0\u5F55\u672C\u8EAB\u4FDD\u7559\uFF09\u3002`,
11800
11805
  previewList ? `\u9884\u89C8\u524D ${result.preview?.length} \u6761\uFF1A
11801
11806
  ${previewList}` : "",
11802
11807
  `\u8FD9\u662F\u4E0D\u53EF\u9006\u64CD\u4F5C\u3002\u8BF7\u5411\u7528\u6237\u5C55\u793A\u4E0A\u8FF0\u9884\u89C8\u5E76\u83B7\u5F97\u660E\u786E\u786E\u8BA4\u3002\u786E\u8BA4\u540E\uFF0C\u8BF7\u4F20\u5165 confirmed: true${result.deletionToken ? ` \u4E0E deletionToken: "${result.deletionToken}"` : ""} \u518D\u6B21\u8C03\u7528\u672C\u5DE5\u5177\u3002`
@@ -11804,9 +11809,11 @@ ${previewList}` : "",
11804
11809
  };
11805
11810
  }
11806
11811
  const count = result.deletedCount ?? 0;
11812
+ const retiredCount = result.retiredIds?.length ?? 0;
11813
+ const physicalCount = Math.max(0, count - retiredCount);
11807
11814
  return {
11808
11815
  rawData: result,
11809
- displayData: `\u5DF2\u5728\u7528\u6237\u6743\u9650\u8303\u56F4\u5185\u786E\u8BA4\u5E76\u7269\u7406\u5220\u9664 ${count} \u6761\u8BB0\u5FC6\u3002`
11816
+ displayData: `\u5DF2\u5728\u7528\u6237\u6743\u9650\u8303\u56F4\u5185\u786E\u8BA4\u5E76\u6267\u884C\uFF1A\u7269\u7406\u5220\u9664 ${physicalCount} \u6761\u8BB0\u5FC6\uFF0C\u9000\u5F79 ${retiredCount} \u6761\uFF08\u8BB0\u5F55\u4FDD\u7559\u3001\u4E0D\u518D\u53EC\u56DE\uFF09\u3002`
11810
11817
  };
11811
11818
  }
11812
11819
 
@@ -14886,7 +14893,7 @@ var executeToolRun = createAsyncThunk(
14886
14893
  if (!executionInput) {
14887
14894
  throw new Error(`ToolRun ${id} has no input to execute with.`);
14888
14895
  }
14889
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-AZR26MXC.js");
14896
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-OQWSBQJA.js");
14890
14897
  const { executor } = findToolExecutor2(run.toolName);
14891
14898
  toolRunStarted({
14892
14899
  id: run.id,
@@ -17393,7 +17400,7 @@ async function updateDocFunc(args, thunkApi) {
17393
17400
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
17394
17401
  };
17395
17402
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
17396
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-2JTPJVFK.js");
17403
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-B2ZM4PCR.js");
17397
17404
  if (getDocState().pageKey === id) {
17398
17405
  applyExternalDocUpdate({
17399
17406
  slateData: finalSlateData,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-DA54MHPJ.js";
3
+ } from "./chunk-RQNHAVSR.js";
4
4
  import {
5
5
  formatISO
6
6
  } from "./chunk-ZRAU6T47.js";
@@ -9,7 +9,7 @@ import {
9
9
  prepareAndPersistMessage,
10
10
  uiAskChoiceFunc,
11
11
  uiAskChoiceFunctionSchema
12
- } from "./chunk-V2SAIXHE.js";
12
+ } from "./chunk-2QZTQEW4.js";
13
13
  import {
14
14
  buildBuiltinObjectSkillReference
15
15
  } from "./chunk-6TPOEJMQ.js";
@@ -66,7 +66,7 @@ import {
66
66
  import {
67
67
  inlineImageUrlsForCustomProvider,
68
68
  prepareTools
69
- } from "./chunk-2JCOP36I.js";
69
+ } from "./chunk-6RDFAKG7.js";
70
70
  import {
71
71
  getServerProviderSecret
72
72
  } from "./chunk-HS7MLR74.js";
@@ -84,7 +84,7 @@ import {
84
84
  rememberMemoryFunctionSchema,
85
85
  resolveAgentRequiredPackIds,
86
86
  setTodoListFunc
87
- } from "./chunk-7VJHIB2S.js";
87
+ } from "./chunk-HZH7RULB.js";
88
88
  import {
89
89
  deriveCredentialGroup,
90
90
  deriveCustomProviderCredentialGroup
@@ -112,14 +112,14 @@ import {
112
112
  prepareTokenUsageData,
113
113
  resolveBuiltinPlatformAgentConfig,
114
114
  runKeyed
115
- } from "./chunk-V2SAIXHE.js";
115
+ } from "./chunk-2QZTQEW4.js";
116
116
  import {
117
117
  BUILTIN_DIALOG_LLM_CHAT_FALLBACK_MODEL,
118
118
  BUILTIN_TITLE_LLM_CONFIG
119
119
  } from "./chunk-523DITKR.js";
120
120
  import {
121
121
  fetchServerSyncedCredential
122
- } from "./chunk-HWRQVJGX.js";
122
+ } from "./chunk-4B4DAAFV.js";
123
123
  import {
124
124
  getModelPricing
125
125
  } from "./chunk-4DPP773Q.js";
@@ -1,3 +1,7 @@
1
+ import {
2
+ _appendRetiredStateBatch,
3
+ loadMemoryVNextCatalog
4
+ } from "./chunk-TY3TIUJK.js";
1
5
  import {
2
6
  resolveMachineId
3
7
  } from "./chunk-ESHYE7WU.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 batch = db.batch();
151
- for (const item of matchedItems) {
152
- deleteMemoryItemWithIndexesInBatch(batch, item);
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
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-RE3CDVRX.js";
4
+ } from "./chunk-LYS4T7MY.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-7VJHIB2S.js";
7
+ } from "./chunk-HZH7RULB.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
10
  } from "./chunk-6IHBIRPK.js";
@@ -11,7 +11,7 @@ import {
11
11
  i18nBaseConfig,
12
12
  instance,
13
13
  toast
14
- } from "./chunk-V2SAIXHE.js";
14
+ } from "./chunk-2QZTQEW4.js";
15
15
  import {
16
16
  require_react
17
17
  } from "./chunk-YDH3FDFQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-RE3CDVRX.js";
3
+ } from "./chunk-LYS4T7MY.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-CTUQJVQM.js";
@@ -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
+ };
@@ -325,7 +325,7 @@ async function saveDocState(arg, { dispatch, getState }) {
325
325
  ).unwrap();
326
326
  if (dbSpaceId) {
327
327
  try {
328
- const { updateContentTitle } = await import("./contentThunks-EB4JFL4K.js");
328
+ const { updateContentTitle } = await import("./contentThunks-ECQ6KK3I.js");
329
329
  await dispatch(
330
330
  updateContentTitle({
331
331
  spaceId: dbSpaceId,
@@ -364,7 +364,7 @@ async function saveDocState(arg, { dispatch, getState }) {
364
364
  }
365
365
  }
366
366
  async function createDocState(args, thunkApi) {
367
- const { createPageAction } = await import("./createPageAction-FPKRGV7D.js");
367
+ const { createPageAction } = await import("./createPageAction-WQZTMGAG.js");
368
368
  return createPageAction(args, thunkApi);
369
369
  }
370
370
  function subscribe(listener) {
@@ -103,7 +103,7 @@ function createDaemonShortcutCommand(path, description, command) {
103
103
  // packages/cli/agentInternalCommandEntries.ts
104
104
  function getAgentInternalCommandEntries() {
105
105
  const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args, ctx) => {
106
- const { runAgentRunCommand } = await import("./agentRunCommand-L6NJGDBA.js");
106
+ const { runAgentRunCommand } = await import("./agentRunCommand-LJBG6YF2.js");
107
107
  return runAgentRunCommand(args, {
108
108
  env: ctx.env,
109
109
  scriptDir: ctx.scriptDir,
@@ -119,7 +119,7 @@ function getAgentInternalCommandEntries() {
119
119
  return runAgentListCommand(args, deps);
120
120
  }),
121
121
  createEnvCommand(["agent", "create"], "Create a new agent", async (args, deps) => {
122
- const { runAgentCreateCommand } = await import("./agentRecordCommands-3ONMYU6P.js");
122
+ const { runAgentCreateCommand } = await import("./agentRecordCommands-JGOTOBTW.js");
123
123
  return runAgentCreateCommand(args, deps);
124
124
  }),
125
125
  createEnvCommand(["agent", "models"], "List models available on an OpenAI-compatible provider", async (args, deps) => {
@@ -135,7 +135,7 @@ function getAgentInternalCommandEntries() {
135
135
  return runAgentPullCommand(args, deps);
136
136
  }),
137
137
  createEnvCommand(["agent", "read"], "Read a single agent", async (args, deps) => {
138
- const { runAgentReadCommand } = await import("./agentRecordCommands-3ONMYU6P.js");
138
+ const { runAgentReadCommand } = await import("./agentRecordCommands-JGOTOBTW.js");
139
139
  return runAgentReadCommand(args, deps);
140
140
  }),
141
141
  createAgentRunCommand(["agent", "run"], "Run an agent"),
@@ -164,26 +164,26 @@ function getAgentInternalCommandEntries() {
164
164
  return runSetupOfflineMarxistsAgentCommand(args, deps);
165
165
  }),
166
166
  createEnvCommand(["agent", "update"], "Update agent fields", async (args, deps) => {
167
- const { runAgentUpdateCommand } = await import("./agentRecordCommands-3ONMYU6P.js");
167
+ const { runAgentUpdateCommand } = await import("./agentRecordCommands-JGOTOBTW.js");
168
168
  return runAgentUpdateCommand(args, deps);
169
169
  }),
170
170
  createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args, deps) => {
171
- const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-GJ7KXHA6.js");
171
+ const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-IX6COKHS.js");
172
172
  return runAgentEmailProvisionCommand(args, deps);
173
173
  }),
174
174
  createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args, deps) => {
175
- const { runAgentEmailBindCommand } = await import("./agentEmailCommands-GJ7KXHA6.js");
175
+ const { runAgentEmailBindCommand } = await import("./agentEmailCommands-IX6COKHS.js");
176
176
  return runAgentEmailBindCommand(args, deps);
177
177
  }),
178
178
  createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args, deps) => {
179
- const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-GJ7KXHA6.js");
179
+ const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-IX6COKHS.js");
180
180
  return runAgentEmailTransferCommand(args, deps);
181
181
  }),
182
182
  createEnvCommand(
183
183
  ["agent", "email", "create-and-provision"],
184
184
  "Create an agent and provision its controlled inbox",
185
185
  async (args, deps) => {
186
- const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-GJ7KXHA6.js");
186
+ const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-IX6COKHS.js");
187
187
  return runAgentEmailCreateAndProvisionCommand(args, deps);
188
188
  }
189
189
  ),
@@ -204,15 +204,15 @@ function getAgentInternalCommandEntries() {
204
204
  return runAgentRevokeGrantCommand(args, deps);
205
205
  }),
206
206
  createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args, deps) => {
207
- const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-PXJG3EDI.js");
207
+ const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-W36VFO5M.js");
208
208
  return runAgentBindCurrentCommand(args, deps);
209
209
  }),
210
210
  createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args, deps) => {
211
- const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-PXJG3EDI.js");
211
+ const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-W36VFO5M.js");
212
212
  return runAgentSmokeCurrentCommand(args, deps);
213
213
  }),
214
214
  createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args, deps) => {
215
- const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-PXJG3EDI.js");
215
+ const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-W36VFO5M.js");
216
216
  return runAgentRuntimeDoctorCommand(args, deps);
217
217
  }),
218
218
  createAgentRunCommand(["agent", "chat"], "Chat with an agent")
@@ -433,55 +433,55 @@ function getSystemInternalCommandEntries(renderHelpText2) {
433
433
  return runAuthCooldownCommand(_args, ctx.env);
434
434
  }),
435
435
  createArgsCommand(["auth", "cloudflare"], "Authorize Cloudflare OAuth", async (args) => {
436
- const { runAuthCloudflareCommand } = await import("./authCommand-W6I6GD3F.js");
436
+ const { runAuthCloudflareCommand } = await import("./authCommand-2YPMMIJN.js");
437
437
  return runAuthCloudflareCommand(args);
438
438
  }),
439
439
  createArgsCommand(["auth", "chatgpt"], "Authorize ChatGPT / OpenAI Codex OAuth", async (args) => {
440
- const { runAuthChatgptCommand } = await import("./authCommand-W6I6GD3F.js");
440
+ const { runAuthChatgptCommand } = await import("./authCommand-2YPMMIJN.js");
441
441
  return runAuthChatgptCommand(args);
442
442
  }),
443
443
  createArgsCommand(["auth", "xai"], "Authorize xAI Grok OAuth (SuperGrok subscription)", async (args) => {
444
- const { runAuthXaiCommand } = await import("./authCommand-W6I6GD3F.js");
444
+ const { runAuthXaiCommand } = await import("./authCommand-2YPMMIJN.js");
445
445
  return runAuthXaiCommand(args);
446
446
  }),
447
447
  createArgsCommand(["auth", "antigravity"], "Authorize Google Antigravity OAuth", async (args) => {
448
- const { runAuthAntigravityCommand } = await import("./authCommand-W6I6GD3F.js");
448
+ const { runAuthAntigravityCommand } = await import("./authCommand-2YPMMIJN.js");
449
449
  return runAuthAntigravityCommand(args);
450
450
  }),
451
451
  createArgsCommand(["auth", "claude"], "Authorize Claude Pro/Max OAuth", async (args) => {
452
- const { runAuthClaudeCommand } = await import("./authCommand-W6I6GD3F.js");
452
+ const { runAuthClaudeCommand } = await import("./authCommand-2YPMMIJN.js");
453
453
  return runAuthClaudeCommand(args);
454
454
  }),
455
455
  createArgsCommand(["auth", "cursor"], "Authorize Cursor Pro OAuth", async (args) => {
456
- const { runAuthCursorCommand } = await import("./authCommand-W6I6GD3F.js");
456
+ const { runAuthCursorCommand } = await import("./authCommand-2YPMMIJN.js");
457
457
  return runAuthCursorCommand(args);
458
458
  }),
459
459
  createArgsCommand(["auth", "devin"], "Authorize Devin OAuth (Free SWE-2)", async (args) => {
460
- const { runAuthDevinCommand } = await import("./authCommand-W6I6GD3F.js");
460
+ const { runAuthDevinCommand } = await import("./authCommand-2YPMMIJN.js");
461
461
  return runAuthDevinCommand(args);
462
462
  }),
463
463
  createArgsCommand(["login"], "Log in to Nolo", async (args) => {
464
- const { runLoginCommand } = await import("./authCommands-GBIFZWD3.js");
464
+ const { runLoginCommand } = await import("./authCommands-FFDS4FVX.js");
465
465
  return runLoginCommand(args);
466
466
  }),
467
467
  createContextCommand(["logout"], "Log out of Nolo", async (args, ctx) => {
468
- const { runLogoutCommand } = await import("./authCommands-GBIFZWD3.js");
468
+ const { runLogoutCommand } = await import("./authCommands-FFDS4FVX.js");
469
469
  return runLogoutCommand({ args, env: ctx.env });
470
470
  }),
471
471
  createContextCommand(["whoami"], "Show the current login state", async (args, ctx) => {
472
- const { runWhoamiCommand } = await import("./authCommands-GBIFZWD3.js");
472
+ const { runWhoamiCommand } = await import("./authCommands-FFDS4FVX.js");
473
473
  return runWhoamiCommand({ args, env: ctx.env });
474
474
  }),
475
475
  createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args, deps) => {
476
- const { runMachineConnectCommand } = await import("./machineCommands-26AZP4AS.js");
476
+ const { runMachineConnectCommand } = await import("./machineCommands-SG3QGVOP.js");
477
477
  return runMachineConnectCommand(args, deps);
478
478
  }),
479
479
  createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args, deps) => {
480
- const { runMachineConnectCommand } = await import("./machineCommands-26AZP4AS.js");
480
+ const { runMachineConnectCommand } = await import("./machineCommands-SG3QGVOP.js");
481
481
  return runMachineConnectCommand(args, deps);
482
482
  }),
483
483
  createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args, deps) => {
484
- const { runMachineStatusCommand } = await import("./machineCommands-26AZP4AS.js");
484
+ const { runMachineStatusCommand } = await import("./machineCommands-SG3QGVOP.js");
485
485
  return runMachineStatusCommand(args, deps);
486
486
  }),
487
487
  createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args, deps) => {
@@ -7,14 +7,14 @@ import {
7
7
  updateContentPinned,
8
8
  updateContentTitle,
9
9
  uploadAndAddFileToSpace
10
- } from "./chunk-DA54MHPJ.js";
10
+ } from "./chunk-RQNHAVSR.js";
11
11
  import "./chunk-ZJ7UHBJS.js";
12
12
  import "./chunk-ZRAU6T47.js";
13
- import "./chunk-V2SAIXHE.js";
13
+ import "./chunk-2QZTQEW4.js";
14
14
  import "./chunk-523DITKR.js";
15
15
  import "./chunk-YYLHWIW6.js";
16
16
  import "./chunk-6O4IK4V2.js";
17
- import "./chunk-HWRQVJGX.js";
17
+ import "./chunk-4B4DAAFV.js";
18
18
  import "./chunk-Z4CSIXYP.js";
19
19
  import "./chunk-5RGU3J7P.js";
20
20
  import "./chunk-4LCOCOR5.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-DA54MHPJ.js";
3
+ } from "./chunk-RQNHAVSR.js";
4
4
  import "./chunk-ZJ7UHBJS.js";
5
5
  import "./chunk-ZRAU6T47.js";
6
- import "./chunk-V2SAIXHE.js";
6
+ import "./chunk-2QZTQEW4.js";
7
7
  import "./chunk-523DITKR.js";
8
8
  import "./chunk-YYLHWIW6.js";
9
9
  import "./chunk-6O4IK4V2.js";
10
- import "./chunk-HWRQVJGX.js";
10
+ import "./chunk-4B4DAAFV.js";
11
11
  import "./chunk-Z4CSIXYP.js";
12
12
  import "./chunk-5RGU3J7P.js";
13
13
  import "./chunk-4LCOCOR5.js";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  createDialogAction,
3
3
  isLocalOwnerDialogAgents
4
- } from "./chunk-5T2W2ZZN.js";
5
- import "./chunk-DA54MHPJ.js";
4
+ } from "./chunk-K5UOP7AI.js";
5
+ import "./chunk-RQNHAVSR.js";
6
6
  import "./chunk-ZJ7UHBJS.js";
7
7
  import "./chunk-ZRAU6T47.js";
8
- import "./chunk-V2SAIXHE.js";
8
+ import "./chunk-2QZTQEW4.js";
9
9
  import "./chunk-523DITKR.js";
10
10
  import "./chunk-YYLHWIW6.js";
11
11
  import "./chunk-6O4IK4V2.js";
12
- import "./chunk-HWRQVJGX.js";
12
+ import "./chunk-4B4DAAFV.js";
13
13
  import "./chunk-Z4CSIXYP.js";
14
14
  import "./chunk-5RGU3J7P.js";
15
15
  import "./chunk-4LCOCOR5.js";
@@ -14,16 +14,16 @@ import {
14
14
  import {
15
15
  addContentToSpace,
16
16
  client_default
17
- } from "./chunk-DA54MHPJ.js";
17
+ } from "./chunk-RQNHAVSR.js";
18
18
  import {
19
19
  getCurrentSpaceId
20
20
  } from "./chunk-ZJ7UHBJS.js";
21
21
  import "./chunk-ZRAU6T47.js";
22
- import "./chunk-V2SAIXHE.js";
22
+ import "./chunk-2QZTQEW4.js";
23
23
  import "./chunk-523DITKR.js";
24
24
  import "./chunk-YYLHWIW6.js";
25
25
  import "./chunk-6O4IK4V2.js";
26
- import "./chunk-HWRQVJGX.js";
26
+ import "./chunk-4B4DAAFV.js";
27
27
  import "./chunk-Z4CSIXYP.js";
28
28
  import "./chunk-5RGU3J7P.js";
29
29
  import "./chunk-4LCOCOR5.js";
@@ -20,11 +20,11 @@ import {
20
20
  switchDialogAgent,
21
21
  updateDialogTitle,
22
22
  updateTokens
23
- } from "./chunk-V2SAIXHE.js";
23
+ } from "./chunk-2QZTQEW4.js";
24
24
  import "./chunk-523DITKR.js";
25
25
  import "./chunk-YYLHWIW6.js";
26
26
  import "./chunk-6O4IK4V2.js";
27
- import "./chunk-HWRQVJGX.js";
27
+ import "./chunk-4B4DAAFV.js";
28
28
  import "./chunk-Z4CSIXYP.js";
29
29
  import {
30
30
  getActiveDialogAgentId