nolo-cli 0.33.0-alpha.9 → 0.34.0-alpha.3

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 (164) hide show
  1. package/{_executeModel-2WR4RTZZ.js → _executeModel-TMUXL7J5.js} +64 -65
  2. package/{action-OQWPNKAH.js → action-KMBZ3LCZ.js} +12 -12
  3. package/{addContentAction-YVINZQTF.js → addContentAction-KQ44UT2U.js} +10 -10
  4. package/{addDialogAgentAction-6IOCIEPI.js → addDialogAgentAction-ILSDCMYL.js} +9 -9
  5. package/{agentDeleteCommand-H22WRYC6.js → agentDeleteCommand-KA2IQAPG.js} +40 -39
  6. package/{agentEmailCommands-DGJVCMCG.js → agentEmailCommands-UIYBGCZW.js} +74 -75
  7. package/{agentListCommands-6NWMLIMQ.js → agentListCommands-L6JNUOLH.js} +47 -37
  8. package/{agentMachineCommands-5MUO6RDI.js → agentMachineCommands-5CQW5NZR.js} +37 -36
  9. package/agentProviderCommands-65ZC2WB4.js +122 -0
  10. package/{agentPullCommand-YH5GEBK4.js → agentPullCommand-TSWAJPS2.js} +1 -1
  11. package/agentRecordCommands-VUDJQIZH.js +112 -0
  12. package/agentRunCommand-EJWYF3BL.js +132 -0
  13. package/{agentRunControl-SCIVRZWX.js → agentRunControl-7MUPSYDQ.js} +7 -1
  14. package/{agentRuntimeLocal-PRAR3NCW.js → agentRuntimeLocal-XXBMDMBU.js} +33 -33
  15. package/{agentSlice-AMDSTXP5.js → agentSlice-HTIEYKIU.js} +12 -12
  16. package/agentSuperviseCommands-MKWW3ICX.js +640 -0
  17. package/{appDeleteCommands-L5PKC42V.js → appDeleteCommands-OUBL6VHB.js} +35 -34
  18. package/{appDeployCommands-3J7Z4XWV.js → appDeployCommands-BZSS2MX4.js} +35 -34
  19. package/{appDeployStatusCommands-YTRPXE72.js → appDeployStatusCommands-P2ZQOY5X.js} +35 -34
  20. package/{appGetCommands-JVXV5WXD.js → appGetCommands-WCFWQZZM.js} +35 -34
  21. package/{appListCommands-7KDEOJSO.js → appListCommands-FVJ3QNL7.js} +35 -34
  22. package/{authCommand-6Y5LTMZB.js → authCommand-B2XRHNJH.js} +19 -19
  23. package/{authCommands-EAPFGNHN.js → authCommands-GWABTFMR.js} +6 -6
  24. package/{chatQueueReduxAdapter-ZKSS6XRV.js → chatQueueReduxAdapter-ZP2ZS63U.js} +28 -28
  25. package/{chunk-UM4H3URE.js → chunk-23KKIMD5.js} +7 -7
  26. package/chunk-2BWU4ORW.js +2574 -0
  27. package/{chunk-2UECQ7RE.js → chunk-3AOLVADY.js} +1 -1
  28. package/{chunk-M2YMQOLC.js → chunk-4APLX2RT.js} +75 -10
  29. package/{chunk-ZHYK3N56.js → chunk-4AWH4LQA.js} +3 -1
  30. package/{chunk-3GZXL6FM.js → chunk-4DMPISV6.js} +7 -3
  31. package/{chunk-BQ3OHLR5.js → chunk-5GQ6XCJY.js} +1217 -691
  32. package/{chunk-GOIDVXK5.js → chunk-5LDKQUOT.js} +21 -8
  33. package/{chunk-OIQPORYI.js → chunk-64KIQZA2.js} +175 -2
  34. package/{chunk-6XIE5ZGI.js → chunk-6HIGYUBQ.js} +1 -1
  35. package/chunk-6XG52ZQ6.js +146 -0
  36. package/{chunk-FMEVI5TG.js → chunk-7CH6U3FL.js} +1 -1
  37. package/chunk-AA2YUJNV.js +54 -0
  38. package/{chunk-7INB7NXF.js → chunk-AE5GVFMG.js} +294 -54
  39. package/{chunk-UNOTBWZZ.js → chunk-B6H5XCT2.js} +8 -8
  40. package/{chunk-NNWHHCVP.js → chunk-BMB563Y6.js} +10 -4
  41. package/{chunk-DFUPZE6V.js → chunk-C6ELZQ7H.js} +249 -34
  42. package/{chunk-7KNERA53.js → chunk-E2OQ5N2F.js} +87 -13
  43. package/{chunk-6HYVJV7B.js → chunk-ESHYE7WU.js} +2 -1
  44. package/{chunk-KHCLMKZZ.js → chunk-EY7V7REW.js} +280 -6
  45. package/{chunk-JZPBVBIY.js → chunk-FD36SCCD.js} +19 -8
  46. package/{chunk-DKMOY3QI.js → chunk-FGLKRJDI.js} +54 -3
  47. package/{chunk-MQWVAOIU.js → chunk-FT4XBCK4.js} +33 -158
  48. package/{chunk-2QTEYCR7.js → chunk-FTM4KUOZ.js} +17 -17
  49. package/{chunk-U4TRT5V4.js → chunk-GEPHJJW4.js} +1 -1
  50. package/{chunk-7YYHKBJP.js → chunk-GKHV4UH5.js} +1 -1
  51. package/{chunk-2IVEXF7P.js → chunk-GUYMR3JL.js} +6 -33
  52. package/{chunk-YDTYDA5W.js → chunk-GZRMWK5R.js} +6 -4
  53. package/{chunk-X664KVEV.js → chunk-HHBXCRJS.js} +204 -123
  54. package/{chunk-AN7DGYMW.js → chunk-I7VDDN45.js} +4579 -3131
  55. package/{chunk-DSBGWT2C.js → chunk-IEEEWIVO.js} +10 -10
  56. package/{chunk-75U775RZ.js → chunk-IFS5CUEH.js} +1 -1
  57. package/{chunk-WLH5BAKX.js → chunk-IIOHYLIG.js} +9 -4
  58. package/{chunk-UEAUAXYS.js → chunk-ILZY5B4U.js} +2063 -214
  59. package/chunk-IMHO5LC6.js +370 -0
  60. package/{chunk-ADLYMQB6.js → chunk-IZCHPD7T.js} +52 -3
  61. package/{chunk-ITIA6OAQ.js → chunk-IZNJDUJ4.js} +5 -5
  62. package/{chunk-X2DAEZ3X.js → chunk-J5NMOM35.js} +1 -1
  63. package/{chunk-RPRRIFXV.js → chunk-JI2TIPLP.js} +1 -1
  64. package/{chunk-EGRJC4ZN.js → chunk-JIADXJYU.js} +1 -1
  65. package/{chunk-IHEC7VBF.js → chunk-K4KIFRIN.js} +1 -1
  66. package/{chunk-WJSW43QZ.js → chunk-L3JWI7WX.js} +0 -1
  67. package/{chunk-3RUW3ONU.js → chunk-LD6Y6RJY.js} +4 -4
  68. package/chunk-M3JQWYBC.js +387 -0
  69. package/{chunk-GM6PU7B6.js → chunk-MEYIRKDN.js} +0 -1
  70. package/{chunk-6YXDOOSH.js → chunk-MGIHZ5CJ.js} +4 -4
  71. package/{chunk-4F5M2MW5.js → chunk-MJWX4JQO.js} +2 -2
  72. package/{chunk-Q5ITEGIN.js → chunk-N4XRDM26.js} +1 -1
  73. package/{chunk-5CS33IBL.js → chunk-NQ4N4IGO.js} +11 -12
  74. package/{chunk-ZZ2MH7LE.js → chunk-O6OSWFZQ.js} +0 -1
  75. package/{chunk-RJKIB55Y.js → chunk-OSCSEJJR.js} +15 -8
  76. package/{chunk-HUCT7HID.js → chunk-P2I7ELDC.js} +3 -3
  77. package/{chunk-BXPBZVRE.js → chunk-PILJX4DH.js} +285 -251
  78. package/{chunk-SCUETSRP.js → chunk-PV734VZX.js} +1 -1
  79. package/{chunk-XLLTJXAD.js → chunk-QI3CHZUT.js} +39 -2672
  80. package/{chunk-WNHST4IE.js → chunk-RKRXAL3V.js} +5451 -5013
  81. package/{chunk-7E72JMBB.js → chunk-SMPAUSX5.js} +46 -5
  82. package/{chunk-5X4GQ53C.js → chunk-TLBZMLLJ.js} +7 -7
  83. package/{chunk-ASDXPOJH.js → chunk-U6QQLXWI.js} +1 -1
  84. package/{chunk-NUO3QFWD.js → chunk-UNHKVD2N.js} +1 -1
  85. package/{chunk-GE6IWA5N.js → chunk-UNZDCI3O.js} +126 -1
  86. package/{chunk-CPYYM4RJ.js → chunk-V5GA74HI.js} +19 -5
  87. package/{chunk-FXFGNOT2.js → chunk-VFVCYIRQ.js} +1 -1
  88. package/{chunk-G7E4NWFE.js → chunk-W445DPVT.js} +1 -1
  89. package/{chunk-EMW55KKX.js → chunk-WBZE7C6S.js} +1 -1
  90. package/{chunk-3UG2IIZ3.js → chunk-WN5AJG5I.js} +1 -1
  91. package/{chunk-KSRFVP36.js → chunk-WRN7L5CS.js} +1 -1
  92. package/{chunk-GJXRIOLS.js → chunk-WRP5TTM6.js} +4 -84
  93. package/chunk-X2K2JSO4.js +163 -0
  94. package/{chunk-OR2HNLVO.js → chunk-X6EN3KJX.js} +279 -477
  95. package/{chunk-VWY2CZD2.js → chunk-XMFDQYWA.js} +3 -3
  96. package/{chunk-IKWTTKWG.js → chunk-XQES6LXQ.js} +2 -2
  97. package/{chunk-IR6W62Q6.js → chunk-XT73C4VH.js} +18 -21
  98. package/{chunk-7L5CQQIT.js → chunk-Y5W623XU.js} +15 -15
  99. package/{chunk-RY57GLGW.js → chunk-YPREESF4.js} +42 -5
  100. package/{chunk-BQXOGBFN.js → chunk-YZ2WE6CW.js} +2 -2
  101. package/{chunk-DNQK7M7K.js → chunk-Z7COG62J.js} +4 -4
  102. package/{chunk-3WXRAHCG.js → chunk-ZBB3MZR3.js} +3 -3
  103. package/{cliExecutor-DW3PHGEL.js → cliExecutor-BBUVQU4L.js} +2 -2
  104. package/{clipboardy-MMBYVRLF.js → clipboardy-PRUHGPGC.js} +4 -3
  105. package/{codingSkills-DY5MINPG.js → codingSkills-6F4EQFCM.js} +4 -5
  106. package/cooldownCommands-C2SZLEEO.js +90 -0
  107. package/{createAgentAutomationAction-GVSJL2CI.js → createAgentAutomationAction-TGUXUZCY.js} +28 -30
  108. package/createDialogAction-FD5AEOUF.js +58 -0
  109. package/{createPageAction-M2VDKBYS.js → createPageAction-NPC3LYNK.js} +31 -34
  110. package/{dbSlice-UI2VCBLG.js → dbSlice-PIQGICNM.js} +9 -9
  111. package/{deleteFile-XQXPBFFB.js → deleteFile-NPZ64DFN.js} +4 -4
  112. package/{dialogCommands-26DBYNBT.js → dialogCommands-ZF2RSNCG.js} +37 -36
  113. package/{dialogSlice-FFGLRCBL.js → dialogSlice-6BINHWQT.js} +27 -27
  114. package/dist-VODFSGNG.js +7442 -0
  115. package/{docCreateCommands-F2ASWG6B.js → docCreateCommands-4VQ5MOHP.js} +36 -36
  116. package/{docDeleteCommands-A4URDZPI.js → docDeleteCommands-M7WLNVPB.js} +37 -37
  117. package/{docReadCommands-DO6VHDZD.js → docReadCommands-6LU6P2WT.js} +36 -36
  118. package/{docStore-EDAE7RNT.js → docStore-SIUFLABN.js} +29 -31
  119. package/{docUpdateCommands-ZTXZ3RTP.js → docUpdateCommands-S2LX4ENL.js} +39 -39
  120. package/{fetchMessages-7QRCCRYK.js → fetchMessages-CUEFN4GQ.js} +4 -4
  121. package/{getPricing-L2ENXWHV.js → getPricing-P3E2WRIH.js} +5 -5
  122. package/{handleSendMessageAction-CIRLGHOC.js → handleSendMessageAction-QVG5YNZY.js} +29 -29
  123. package/index.js +92 -77
  124. package/{localDialogRead-SLMPV5SK.js → localDialogRead-P7CHFMIC.js} +1 -1
  125. package/{localRuntimeAuthority-E3R24J4T.js → localRuntimeAuthority-S77B5QVB.js} +6 -2
  126. package/{localRuntimeDb-DDZCJFQZ.js → localRuntimeDb-N3H3HQ7G.js} +1 -1
  127. package/{machineCommands-NIQNCYJV.js → machineCommands-OSEBN7BZ.js} +76 -77
  128. package/{machineInfo-M6KB6HZN.js → machineInfo-66ZFUMLE.js} +1 -1
  129. package/{machineWsRunDispatch-EMTSQGAR.js → machineWsRunDispatch-NTJQCIIF.js} +68 -69
  130. package/{models-OX2S5C6Q.js → models-L7S2EKPM.js} +2 -2
  131. package/package.json +1 -1
  132. package/{read-2VHEHCAN.js → read-6C2XD3YZ.js} +5 -5
  133. package/{readDocTool-CSWD6NPC.js → readDocTool-Y7AB365O.js} +1 -1
  134. package/{readlineWorkspace-A2JBJWLI.js → readlineWorkspace-JPME5S7A.js} +4860 -3476
  135. package/{removeDialogAgentAction-2T7BPM3T.js → removeDialogAgentAction-KG5WMJRZ.js} +13 -13
  136. package/{runAgentClientLoop-BV4736ED.js → runAgentClientLoop-SOKEXCUF.js} +61 -61
  137. package/{runtimeDoctorCommands-KIKM6BIO.js → runtimeDoctorCommands-HT4O2PXL.js} +6 -6
  138. package/{setDialogExtraReferencesAction-GPT37HTW.js → setDialogExtraReferencesAction-O2NLXMSM.js} +10 -10
  139. package/{setPrimaryDialogAgentAction-3746P7IW.js → setPrimaryDialogAgentAction-FYYUY7PB.js} +13 -13
  140. package/{settingSlice-FIFOQ6OR.js → settingSlice-GPLI6E3M.js} +11 -11
  141. package/{skillDiscovery-KLLKXPUO.js → skillDiscovery-GPUDHDTZ.js} +3 -4
  142. package/{slateUtils-VO2FU36K.js → slateUtils-RIZES3PV.js} +1 -1
  143. package/{spaceCommands-AYZQHDB3.js → spaceCommands-Z5JLMFFJ.js} +223 -37
  144. package/{spaceSlice-43BNF22B.js → spaceSlice-Z3BGCLGX.js} +28 -30
  145. package/{streamAgentChatTurn-OLLRSITV.js → streamAgentChatTurn-INF5RGK4.js} +115 -129
  146. package/{switchDialogAgentAction-MQTUTQHL.js → switchDialogAgentAction-GH5P6Q3Z.js} +9 -9
  147. package/{chunk-IDAU4UFS.js → syncMapping-N6RGXGBW.js} +11 -11
  148. package/{tableCommands-QE47K72R.js → tableCommands-PQUJ55AS.js} +3 -3
  149. package/{tools-2SI3FXLL.js → tools-ZELMSJZ3.js} +45 -47
  150. package/{tuiSummaryLlmCaller-EAWQ3IZX.js → tuiSummaryLlmCaller-LH7F2SP7.js} +18 -18
  151. package/{updateCommands-AK2RDOFR.js → updateCommands-MNDUIKN7.js} +2 -2
  152. package/{updateDialogTitleAction-YJEQFYOA.js → updateDialogTitleAction-EDUCIB7G.js} +31 -33
  153. package/agentRecordCommands-YMGKT2WF.js +0 -113
  154. package/agentRunCommand-LYEMVQJH.js +0 -131
  155. package/chunk-AETZ7AD6.js +0 -274
  156. package/chunk-D5JI6VDM.js +0 -1800
  157. package/chunk-M3JEW6N6.js +0 -193
  158. package/chunk-ZURFOV5J.js +0 -105
  159. package/chunk-ZWS6DUHX.js +0 -480
  160. package/createDialogAction-VVR46Q2A.js +0 -61
  161. package/syncMapping-RK2MANUX.js +0 -43
  162. package/{chunk-KMSZPTM6.js → chunk-2WKUUY2E.js} +3 -3
  163. package/{chunk-CWMSB67P.js → chunk-AGGIDPCZ.js} +0 -0
  164. package/{chunk-SAQQLJZ5.js → chunk-JDSUTNYY.js} +3 -3
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveMachineId
3
- } from "./chunk-6HYVJV7B.js";
3
+ } from "./chunk-ESHYE7WU.js";
4
4
  import {
5
5
  getDefaultCliLocalRuntimeDb
6
- } from "./chunk-Q5ITEGIN.js";
6
+ } from "./chunk-N4XRDM26.js";
7
7
  import {
8
8
  buildCliRuntimeEnv,
9
9
  clearProfileAuthToken,
@@ -11,7 +11,7 @@ import {
11
11
  getDefaultProfileConfigPath,
12
12
  loadProfileConfig,
13
13
  saveDefaultProfile
14
- } from "./chunk-GE6IWA5N.js";
14
+ } from "./chunk-UNZDCI3O.js";
15
15
  import {
16
16
  resolveAuthTokenFromEnv
17
17
  } from "./chunk-A7GB5UGH.js";
@@ -23,7 +23,7 @@ import {
23
23
  createMemoryOwnerIndexKey,
24
24
  createMemorySubjectKindIndexKey,
25
25
  memoryOwnerRange
26
- } from "./chunk-KMSZPTM6.js";
26
+ } from "./chunk-2WKUUY2E.js";
27
27
  import {
28
28
  asTrimmedNonEmptyStringArray
29
29
  } from "./chunk-I42VC5KR.js";
@@ -40,6 +40,20 @@ import { stdin as input, stdout as output } from "node:process";
40
40
  import { spawn } from "node:child_process";
41
41
 
42
42
  // packages/ai/memory/delete.ts
43
+ function hasExplicitDeleteFilters(filters) {
44
+ return Boolean(
45
+ 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
46
+ );
47
+ }
48
+ function generateMemoryDeletionToken(ownerId, itemIds) {
49
+ const sorted = [...itemIds].sort().join(",");
50
+ const seed = `${ownerId}:${sorted}`;
51
+ let hash = 0;
52
+ for (let i = 0; i < seed.length; i++) {
53
+ hash = (hash << 5) - hash + seed.charCodeAt(i) | 0;
54
+ }
55
+ return `tok-${Math.abs(hash).toString(36)}-${itemIds.length}`;
56
+ }
43
57
  var normalizeSet = (values) => {
44
58
  if (!Array.isArray(values) || values.length === 0) return null;
45
59
  const normalized = asTrimmedNonEmptyStringArray(values);
@@ -66,6 +80,10 @@ var matchesFilters = (item, filters) => {
66
80
  if (!itemTags.has(tag)) return false;
67
81
  }
68
82
  }
83
+ const contentSub = asTrimmedString(filters.contentSubstring);
84
+ if (contentSub && !(item.content ?? "").toLowerCase().includes(contentSub.toLowerCase())) {
85
+ return false;
86
+ }
69
87
  return true;
70
88
  };
71
89
  var deleteMemoryItemWithIndexesInBatch = (batch, item) => {
@@ -89,6 +107,11 @@ var deleteMemoryItemWithIndexesInBatch = (batch, item) => {
89
107
  );
90
108
  };
91
109
  var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
110
+ if (!hasExplicitDeleteFilters(filters)) {
111
+ throw new Error(
112
+ "At least one filter is required; delete operation will not delete all memory implicitly."
113
+ );
114
+ }
92
115
  const range = memoryOwnerRange(owner.ownerType, owner.ownerId);
93
116
  const matchedItems = [];
94
117
  const limit = typeof filters.limit === "number" && filters.limit > 0 ? filters.limit : Number.POSITIVE_INFINITY;
@@ -108,6 +131,23 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
108
131
  if (matchedItems.length === 0) {
109
132
  return { deletedCount: 0, deletedIds: [], matchedItems: [] };
110
133
  }
134
+ const token = generateMemoryDeletionToken(
135
+ owner.ownerId,
136
+ matchedItems.map((i) => i.id)
137
+ );
138
+ if (filters.dryRun) {
139
+ return {
140
+ deletedCount: 0,
141
+ deletedIds: [],
142
+ matchedItems,
143
+ deletionToken: token
144
+ };
145
+ }
146
+ if (filters.deletionToken && filters.deletionToken !== token) {
147
+ throw new Error(
148
+ "deletionToken mismatch: memory dataset changed since preview; please rerun dry-run preview before confirming."
149
+ );
150
+ }
111
151
  const batch = db.batch();
112
152
  for (const item of matchedItems) {
113
153
  deleteMemoryItemWithIndexesInBatch(batch, item);
@@ -116,7 +156,8 @@ var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
116
156
  return {
117
157
  deletedCount: matchedItems.length,
118
158
  deletedIds: matchedItems.map((item) => item.id),
119
- matchedItems
159
+ matchedItems,
160
+ deletionToken: token
120
161
  };
121
162
  };
122
163
 
@@ -3,7 +3,7 @@ import {
3
3
  createFileCredentialBroker,
4
4
  migrateAgentSecrets,
5
5
  normalizeAgentRuntimeToolPolicy
6
- } from "./chunk-5CS33IBL.js";
6
+ } from "./chunk-NQ4N4IGO.js";
7
7
  import {
8
8
  asRecordOrEmpty
9
9
  } from "./chunk-KX6YBIHG.js";
@@ -11,16 +11,16 @@ import {
11
11
  patch,
12
12
  remove,
13
13
  write
14
- } from "./chunk-UM4H3URE.js";
14
+ } from "./chunk-23KKIMD5.js";
15
15
  import {
16
16
  createAgentKey,
17
17
  toTrimmedString
18
- } from "./chunk-KMSZPTM6.js";
18
+ } from "./chunk-2WKUUY2E.js";
19
19
  import {
20
20
  asyncThunkCreator,
21
21
  buildCreateSlice,
22
22
  getRuntimeServerContext
23
- } from "./chunk-X664KVEV.js";
23
+ } from "./chunk-HHBXCRJS.js";
24
24
  import {
25
25
  asTrimmedString
26
26
  } from "./chunk-3EUW3WEO.js";
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
304
304
  const overrides = {};
305
305
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
306
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-2WR4RTZZ.js");
307
+ const { _executeModel } = await import("./_executeModel-TMUXL7J5.js");
308
308
  return _executeModel(
309
309
  {
310
310
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
325
325
  * - 循环直到无工具调用或触发其他运行时停止条件
326
326
  */
327
327
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-BV4736ED.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-SOKEXCUF.js");
329
329
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
330
  {
331
331
  agentKey: args.agentKey,
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
341
341
  * 聊天轮次流式 Agent 调用
342
342
  */
343
343
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-OLLRSITV.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-INF5RGK4.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  patch,
9
9
  selectById
10
- } from "./chunk-UM4H3URE.js";
10
+ } from "./chunk-23KKIMD5.js";
11
11
  import {
12
12
  __toESM
13
13
  } from "./chunk-4VNS5WPM.js";
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // packages/cli/agentCommandSupport.ts
6
6
  async function getDefaultCliDb() {
7
- const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-DDZCJFQZ.js");
7
+ const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-N3H3HQ7G.js");
8
8
  return getDefaultCliLocalRuntimeDb();
9
9
  }
10
10
  function createNullCliDb() {
@@ -1,5 +1,13 @@
1
1
  // packages/cli/client/profileConfig.ts
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import {
3
+ appendFileSync,
4
+ chmodSync,
5
+ existsSync,
6
+ mkdirSync,
7
+ readFileSync,
8
+ statSync,
9
+ writeFileSync
10
+ } from "node:fs";
3
11
  import { dirname, join } from "node:path";
4
12
  import { homedir } from "node:os";
5
13
 
@@ -27,6 +35,10 @@ function canonicalizeNoloServerUrl(value) {
27
35
 
28
36
  // packages/cli/client/profileConfig.ts
29
37
  var normalizeProfileServerUrl = canonicalizeNoloServerUrl;
38
+ function isProtectedHomeProfileWrite(path) {
39
+ if (process.env.NODE_ENV !== "test") return false;
40
+ return path === join(homedir(), ".nolo", "config.json");
41
+ }
30
42
  function getDefaultProfileConfigPath() {
31
43
  const noloHome = process.env.NOLO_HOME?.trim();
32
44
  return noloHome ? join(noloHome, "config.json") : join(homedir(), ".nolo", "config.json");
@@ -43,6 +55,7 @@ function loadProfileConfig(path = getDefaultProfileConfigPath()) {
43
55
  return parsed;
44
56
  }
45
57
  function clearProfileAuthToken(path = getDefaultProfileConfigPath()) {
58
+ if (isProtectedHomeProfileWrite(path)) return false;
46
59
  const config = loadProfileConfig(path);
47
60
  if (!config) return false;
48
61
  const profile = config.profiles[config.currentProfile];
@@ -54,6 +67,11 @@ function clearProfileAuthToken(path = getDefaultProfileConfigPath()) {
54
67
  return true;
55
68
  }
56
69
  function saveDefaultProfile(path, profile) {
70
+ if (isProtectedHomeProfileWrite(path)) {
71
+ throw new Error(
72
+ `Refusing to write the developer's real profile from a test process: ${path}. Pass a temp path or set NOLO_HOME.`
73
+ );
74
+ }
57
75
  const existing = loadProfileConfig(path);
58
76
  const mergedDefault = {
59
77
  ...existing?.profiles?.default ?? {},
@@ -89,9 +107,11 @@ function buildCliRuntimeEnv(processEnv, config) {
89
107
  const profileEnv = buildEnvFromProfile(config);
90
108
  const explicitAuthToken = processEnv.AUTH_TOKEN || processEnv.AUTH;
91
109
  const explicitServerUrl = processEnv.NOLO_SERVER || processEnv.NOLO_SERVER_URL || processEnv.BASE_URL;
110
+ const agentSource = processEnv.NOLO_AGENT?.trim() ? "env" : profileEnv.NOLO_AGENT ? "profile" : void 0;
92
111
  return {
93
112
  ...profileEnv,
94
113
  ...processEnv,
114
+ NOLO_AGENT_SOURCE: agentSource,
95
115
  ...explicitAuthToken ? { AUTH_TOKEN: explicitAuthToken } : {},
96
116
  ...explicitServerUrl ? {
97
117
  NOLO_SERVER: explicitServerUrl,
@@ -104,6 +124,7 @@ function getCurrentProfile(config) {
104
124
  return config.profiles[config.currentProfile] ?? null;
105
125
  }
106
126
  function saveProfileLocale(locale, path = getDefaultProfileConfigPath()) {
127
+ if (isProtectedHomeProfileWrite(path)) return null;
107
128
  const config = loadProfileConfig(path);
108
129
  if (!config) return null;
109
130
  const profile = config.profiles[config.currentProfile];
@@ -114,13 +135,115 @@ function saveProfileLocale(locale, path = getDefaultProfileConfigPath()) {
114
135
  `, "utf8");
115
136
  return config;
116
137
  }
138
+ function getAgentSelectionAuditPath(configPath = getDefaultProfileConfigPath()) {
139
+ return join(dirname(configPath), "agent-selection.log");
140
+ }
141
+ var AGENT_SELECTION_AUDIT_MAX_BYTES = 512 * 1024;
142
+ var AGENT_SELECTION_AUDIT_KEEP_LINES = 200;
143
+ var SECRET_ARGV_FLAGS = /* @__PURE__ */ new Set([
144
+ "--token",
145
+ "--auth",
146
+ "--auth-token",
147
+ "--key",
148
+ "--api-key",
149
+ "--app-key",
150
+ "--machine-key",
151
+ "--provider-api-key",
152
+ "--invite-token",
153
+ "--password",
154
+ "--secret"
155
+ ]);
156
+ function redactArgvSecrets(argv) {
157
+ const redacted = [];
158
+ let maskNext = false;
159
+ for (const arg of argv) {
160
+ if (maskNext) {
161
+ maskNext = false;
162
+ redacted.push("[REDACTED]");
163
+ continue;
164
+ }
165
+ const equals = arg.indexOf("=");
166
+ if (equals > 0 && SECRET_ARGV_FLAGS.has(arg.slice(0, equals))) {
167
+ redacted.push(`${arg.slice(0, equals)}=[REDACTED]`);
168
+ continue;
169
+ }
170
+ maskNext = SECRET_ARGV_FLAGS.has(arg);
171
+ redacted.push(arg);
172
+ }
173
+ return redacted;
174
+ }
175
+ function appendAgentSelectionAudit(entry, auditPath = getAgentSelectionAuditPath(entry.configPath)) {
176
+ try {
177
+ const stack = (new Error().stack ?? "").split("\n").slice(2, 8).map((line2) => line2.trim()).filter(Boolean);
178
+ const line = `${JSON.stringify({
179
+ at: (/* @__PURE__ */ new Date()).toISOString(),
180
+ pid: process.pid,
181
+ // Distinguishes repo source / installed binary / bundled desktop build —
182
+ // the field that says whether a stale build is doing the writing.
183
+ execPath: process.execPath,
184
+ argv: redactArgvSecrets(process.argv),
185
+ cwd: process.cwd(),
186
+ previous: entry.previous,
187
+ next: entry.next,
188
+ stack
189
+ })}
190
+ `;
191
+ mkdirSync(dirname(auditPath), { recursive: true });
192
+ const auditMode = 384;
193
+ if (existsSync(auditPath) && statSync(auditPath).size > AGENT_SELECTION_AUDIT_MAX_BYTES) {
194
+ const kept = readFileSync(auditPath, "utf8").split("\n").filter((entry2) => entry2.trim()).slice(-AGENT_SELECTION_AUDIT_KEEP_LINES).join("\n");
195
+ writeFileSync(auditPath, `${kept}
196
+ `, {
197
+ encoding: "utf8",
198
+ mode: auditMode
199
+ });
200
+ }
201
+ appendFileSync(auditPath, line, { encoding: "utf8", mode: auditMode });
202
+ try {
203
+ chmodSync(auditPath, auditMode);
204
+ } catch {
205
+ }
206
+ } catch {
207
+ }
208
+ }
209
+ function readLastAgentSelectionAudit(auditPath = getAgentSelectionAuditPath()) {
210
+ try {
211
+ if (!existsSync(auditPath)) return { logExists: false, last: null };
212
+ const lines = readFileSync(auditPath, "utf8").trim().split("\n");
213
+ for (let index = lines.length - 1; index >= 0; index -= 1) {
214
+ const raw = lines[index]?.trim();
215
+ if (!raw) continue;
216
+ const parsed = JSON.parse(raw);
217
+ if (!parsed.next) continue;
218
+ return {
219
+ logExists: true,
220
+ last: {
221
+ agentKey: parsed.next.agentKey ?? "",
222
+ agentName: parsed.next.agentName ?? ""
223
+ }
224
+ };
225
+ }
226
+ return { logExists: true, last: null };
227
+ } catch {
228
+ return { logExists: false, last: null };
229
+ }
230
+ }
117
231
  function saveProfileAgentSelection(selection, path = getDefaultProfileConfigPath()) {
232
+ if (isProtectedHomeProfileWrite(path)) return null;
118
233
  const config = loadProfileConfig(path);
119
234
  if (!config) return null;
120
235
  const profile = config.profiles[config.currentProfile];
121
236
  if (!profile) return null;
122
237
  const agentKey = selection.agentKey.trim();
123
238
  const agentName = selection.agentName.trim();
239
+ appendAgentSelectionAudit({
240
+ previous: {
241
+ ...profile.agentKey ? { agentKey: profile.agentKey } : {},
242
+ ...profile.agentName ? { agentName: profile.agentName } : {}
243
+ },
244
+ next: { agentKey, agentName },
245
+ configPath: path
246
+ });
124
247
  if (!agentKey) {
125
248
  delete profile.agentKey;
126
249
  delete profile.agentName;
@@ -143,5 +266,7 @@ export {
143
266
  buildCliRuntimeEnv,
144
267
  getCurrentProfile,
145
268
  saveProfileLocale,
269
+ getAgentSelectionAuditPath,
270
+ readLastAgentSelectionAudit,
146
271
  saveProfileAgentSelection
147
272
  };
@@ -1,16 +1,18 @@
1
1
  import {
2
2
  getModelConfig
3
- } from "./chunk-DFUPZE6V.js";
3
+ } from "./chunk-C6ELZQ7H.js";
4
4
  import {
5
5
  PLATFORM_HOSTED_KIMI_K3_MODEL,
6
6
  isPlatformHostedClaudeModel,
7
7
  isPlatformHostedDeepseekModel,
8
+ isPlatformHostedGeminiImageModel,
8
9
  isPlatformHostedGeminiModel,
10
+ isPlatformHostedGlm53FlashModel,
9
11
  isPlatformHostedGlmModel,
10
12
  isPlatformHostedGrokModel,
11
13
  isPlatformHostedKimiK26Model,
12
- isPlatformHostedQwen37FlashModel
13
- } from "./chunk-OR2HNLVO.js";
14
+ isPlatformHostedOpenAIImageModel
15
+ } from "./chunk-X6EN3KJX.js";
14
16
  import {
15
17
  asTrimmedLowercaseString
16
18
  } from "./chunk-QSJ3HFEF.js";
@@ -30,7 +32,9 @@ var PLATFORM_CHAT_COMPLETIONS_ENDPOINTS = {
30
32
  // Moonshot AI(月之暗面)开放平台 OpenAI 兼容模式(按量计费)
31
33
  moonshot: "https://api.moonshot.cn/v1/chat/completions",
32
34
  // 平台托管 Kimi K3 的实际上游
33
- crof: "https://crof.ai/v1/chat/completions"
35
+ crof: "https://crof.ai/v1/chat/completions",
36
+ // 平台托管 GLM 5.3 Flash 的实际上游(RunInfra 独家廉价快档)
37
+ runinfra: "https://api.runinfra.ai/v1/chat/completions"
34
38
  // 无 nolo 默认上游:平台托管模型全部显式分流,未识别模型返回 undefined
35
39
  };
36
40
  function isOpenAiResponsesModel(args) {
@@ -46,6 +50,7 @@ function isOpenAiResponsesModel(args) {
46
50
  }
47
51
  if (provider === "deepseek" || provider === "nolo" || provider === "ollama-cloud") {
48
52
  if (isPlatformHostedDeepseekModel(args.model)) return true;
53
+ if (isPlatformHostedOpenAIImageModel(args.model)) return true;
49
54
  }
50
55
  return false;
51
56
  }
@@ -53,6 +58,9 @@ function resolvePlatformResponsesEndpoint(provider, model) {
53
58
  const normalized = asTrimmedLowercaseString(provider);
54
59
  if (normalized === "openai") return OPENAI_RESPONSES_ENDPOINT;
55
60
  if (normalized === "deepseek" || normalized === "nolo" || normalized === "ollama-cloud") {
61
+ if (isPlatformHostedOpenAIImageModel(model)) {
62
+ return OPENAI_RESPONSES_ENDPOINT;
63
+ }
56
64
  if (!model || isPlatformHostedDeepseekModel(model)) {
57
65
  return DEEPSEEK_RESPONSES_ENDPOINT;
58
66
  }
@@ -76,12 +84,18 @@ function resolvePlatformChatCompletionsEndpoint(provider, model) {
76
84
  if (aliased === "nolo" && (isPlatformHostedKimiK26Model(model) || isPlatformHostedGlmModel(model))) {
77
85
  return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS.openrouter;
78
86
  }
87
+ if (aliased === "nolo" && isPlatformHostedGlm53FlashModel(model)) {
88
+ return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS.runinfra;
89
+ }
79
90
  if (aliased === "nolo" && asTrimmedLowercaseString(model) === PLATFORM_HOSTED_KIMI_K3_MODEL) {
80
91
  return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS.crof;
81
92
  }
82
- if (aliased === "nolo" && (isPlatformHostedGeminiModel(model) || isPlatformHostedQwen37FlashModel(model))) {
93
+ if (aliased === "nolo" && (isPlatformHostedGeminiModel(model) || isPlatformHostedGeminiImageModel(model))) {
83
94
  return PLATFORM_CHAT_COMPLETIONS_ENDPOINTS.google;
84
95
  }
96
+ if (aliased === "nolo" && isPlatformHostedOpenAIImageModel(model)) {
97
+ return void 0;
98
+ }
85
99
  if (aliased === "nolo" && isPlatformHostedDeepseekModel(model)) {
86
100
  return void 0;
87
101
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadProfileConfig
3
- } from "./chunk-GE6IWA5N.js";
3
+ } from "./chunk-UNZDCI3O.js";
4
4
  import {
5
5
  resolveDefaultSpawn
6
6
  } from "./chunk-IDZTNRP2.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generatePkcePair,
3
3
  startCallbackServer
4
- } from "./chunk-ITIA6OAQ.js";
4
+ } from "./chunk-IZNJDUJ4.js";
5
5
  import {
6
6
  toErrorMessage
7
7
  } from "./chunk-HNMXYYJR.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-7INB7NXF.js";
4
+ } from "./chunk-AE5GVFMG.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-IKWTTKWG.js";
3
+ } from "./chunk-XQES6LXQ.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-A7GB5UGH.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  dialogMessageRange
3
- } from "./chunk-KMSZPTM6.js";
3
+ } from "./chunk-2WKUUY2E.js";
4
4
  import {
5
5
  isTombstoneRecord
6
6
  } from "./chunk-GBRG75BQ.js";
@@ -1,89 +1,12 @@
1
1
  import {
2
2
  MODEL_LOOKUP_MAP
3
- } from "./chunk-DFUPZE6V.js";
3
+ } from "./chunk-C6ELZQ7H.js";
4
4
  import {
5
5
  ALL_MODELS
6
- } from "./chunk-2QTEYCR7.js";
6
+ } from "./chunk-FTM4KUOZ.js";
7
7
  import {
8
- PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY,
9
- builtinAgentCatalogEntryById,
10
- builtinRuntimeFallbackEntries,
11
- isBuiltinPlatformAgentKey
12
- } from "./chunk-IR6W62Q6.js";
13
- import {
14
- parsePublicAgentId,
15
- publicAgentKey
16
- } from "./chunk-BJIRLHJR.js";
17
-
18
- // packages/agent-runtime/builtinPlatformAgentRoute.ts
19
- function resolveBuiltinAgentRuntimeFields(agentKey) {
20
- if (!isBuiltinPlatformAgentKey(agentKey)) return null;
21
- const entry = builtinAgentCatalogEntryById(parsePublicAgentId(agentKey));
22
- if (!entry) return null;
23
- return { provider: entry.provider, model: entry.model };
24
- }
25
-
26
- // packages/agent-runtime/builtinPlatformAgentConfigs.ts
27
- function buildConfig(e) {
28
- const key = publicAgentKey(e.id);
29
- const rawRecord = {
30
- dbKey: key,
31
- isPublic: true,
32
- provider: e.provider,
33
- model: e.model,
34
- apiSource: e.apiSource ?? "platform",
35
- useServerProxy: e.useServerProxy ?? true
36
- };
37
- if (e.hasImageOutput) rawRecord.hasImageOutput = true;
38
- if (e.imageModel) rawRecord.imageModel = e.imageModel;
39
- if (e.imageWorkflow) rawRecord.imageWorkflow = e.imageWorkflow;
40
- if (e.imageConfig) rawRecord.imageConfig = e.imageConfig;
41
- return {
42
- key,
43
- name: e.name,
44
- provider: e.provider,
45
- model: e.model,
46
- apiSource: e.apiSource ?? "platform",
47
- useServerProxy: e.useServerProxy ?? true,
48
- rawRecord
49
- };
50
- }
51
- var BUILTIN_PLATFORM_AGENT_CONFIGS = Object.fromEntries(
52
- builtinRuntimeFallbackEntries().map((e) => [publicAgentKey(e.id), buildConfig(e)])
53
- );
54
- function resolveBuiltinPlatformAgentConfig(agentRef) {
55
- return BUILTIN_PLATFORM_AGENT_CONFIGS[agentRef] ?? null;
56
- }
57
- function resolveBuiltinPlatformAgentRecord(agentRef) {
58
- const config = resolveBuiltinPlatformAgentConfig(agentRef);
59
- if (!config) return null;
60
- return {
61
- ...config.rawRecord,
62
- dbKey: agentRef,
63
- ...config.name ? { name: config.name } : {}
64
- };
65
- }
66
- function applyBuiltinAgentRuntimeOverride(agentKey, record) {
67
- const fields = resolveBuiltinAgentRuntimeFields(agentKey);
68
- if (!fields) return record;
69
- const current = record;
70
- const rawNeedsOverride = current.rawRecord != null && (current.rawRecord.provider !== fields.provider || current.rawRecord.model !== fields.model);
71
- if (current.provider === fields.provider && current.model === fields.model && !rawNeedsOverride) {
72
- return record;
73
- }
74
- return {
75
- ...record,
76
- provider: fields.provider,
77
- model: fields.model,
78
- ...current.rawRecord ? {
79
- rawRecord: {
80
- ...current.rawRecord,
81
- provider: fields.provider,
82
- model: fields.model
83
- }
84
- } : {}
85
- };
86
- }
8
+ PUBLIC_DEEPSEEK_V4_FLASH_AGENT_KEY
9
+ } from "./chunk-XT73C4VH.js";
87
10
 
88
11
  // packages/ai/llm/getModelContextWindow.ts
89
12
  var DEFAULT_CONTEXT_WINDOW = 256e3;
@@ -230,9 +153,6 @@ var DEFAULT_AUTO_EXECUTION_PROFILE = AUTO_EXECUTION_PROFILES[DEFAULT_AUTO_EXECUT
230
153
  var resolveAutoExecutionProfile = (tier) => AUTO_EXECUTION_PROFILES[tier ?? DEFAULT_AUTO_EXECUTION_TIER] ?? DEFAULT_AUTO_EXECUTION_PROFILE;
231
154
 
232
155
  export {
233
- resolveBuiltinPlatformAgentConfig,
234
- resolveBuiltinPlatformAgentRecord,
235
- applyBuiltinAgentRuntimeOverride,
236
156
  DEFAULT_CONTEXT_WINDOW,
237
157
  getModelContextWindow,
238
158
  getModelInfo,