nolo-cli 0.66.0-alpha.3 → 0.66.0-alpha.5

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 (91) hide show
  1. package/{_executeModel-TBSKCSBE.js → _executeModel-C63UG367.js} +26 -26
  2. package/{action-76JX3JX3.js → action-AOORTHTU.js} +6 -6
  3. package/{addContentAction-V3NAZRTJ.js → addContentAction-E3S6F3IS.js} +5 -5
  4. package/{addDialogAgentAction-RZOAF46K.js → addDialogAgentAction-EUBNJ5SS.js} +4 -4
  5. package/{agentDeleteCommand-22K5XPEC.js → agentDeleteCommand-AHCJ2KJ7.js} +14 -14
  6. package/{agentEmailCommands-U56B5FHS.js → agentEmailCommands-JOMRC3W2.js} +30 -30
  7. package/{agentListCommands-D6JN4CL4.js → agentListCommands-6KB4IHQS.js} +16 -16
  8. package/{agentMachineCommands-KTW5UF5B.js → agentMachineCommands-SDRE2NTN.js} +14 -14
  9. package/{agentRecordCommands-TVNB6F7R.js → agentRecordCommands-5YZGXSK7.js} +30 -30
  10. package/{agentRunCommand-ORQVEPWY.js → agentRunCommand-AEY7AB2D.js} +30 -30
  11. package/{agentRuntimeLocal-5ENMNOG5.js → agentRuntimeLocal-COPOV7R7.js} +11 -11
  12. package/{agentSlice-FYVXEVSO.js → agentSlice-TV2HZX2H.js} +5 -5
  13. package/{appDeleteCommands-TCJYBQHN.js → appDeleteCommands-F6M2UEWG.js} +15 -15
  14. package/{appDeployCommands-2O4Y7BB3.js → appDeployCommands-THWNABDT.js} +15 -15
  15. package/{appDeployStatusCommands-M6U7ZLJ7.js → appDeployStatusCommands-A4XSWHFX.js} +15 -15
  16. package/{appGetCommands-H2JW2R4K.js → appGetCommands-62FK5II3.js} +15 -15
  17. package/{appListCommands-MWFD4SXY.js → appListCommands-MQTHZLHV.js} +15 -15
  18. package/{chatQueueReduxAdapter-ZFRURUPP.js → chatQueueReduxAdapter-BK5MJ4TA.js} +11 -11
  19. package/{chunk-KWSQR2KK.js → chunk-3RAG2NAD.js} +5 -1
  20. package/{chunk-DNNSCSA2.js → chunk-4K6DB3GJ.js} +5 -5
  21. package/{chunk-L7B47JXR.js → chunk-4MKPBCTN.js} +1 -1
  22. package/{chunk-2PGGC63K.js → chunk-5TJQUZQ7.js} +1 -1
  23. package/{chunk-4NJEIGBQ.js → chunk-76JAMDUT.js} +2 -2
  24. package/{chunk-CP7VIDZ7.js → chunk-7JS3F5ZR.js} +1 -1
  25. package/{chunk-AQPKZXCQ.js → chunk-7TSLWGZZ.js} +10 -10
  26. package/{chunk-FHAGENAS.js → chunk-AUKZOZFG.js} +1 -1
  27. package/{chunk-UZPQSVM6.js → chunk-B62OSA77.js} +1 -1
  28. package/{chunk-ZZXMGOIJ.js → chunk-FER25LZS.js} +7 -7
  29. package/{chunk-YEI76VEX.js → chunk-FPUHDMMQ.js} +3 -3
  30. package/{chunk-AM3KKSJJ.js → chunk-G6LSVBWG.js} +2 -2
  31. package/{chunk-2WB3CWWX.js → chunk-HHR4KGYD.js} +11 -11
  32. package/{chunk-Q6FPSY5O.js → chunk-HQ3ZLBSI.js} +1 -1
  33. package/{chunk-5RHCYQBK.js → chunk-I7SDLO23.js} +1 -1
  34. package/{chunk-RVWRKFUB.js → chunk-IM5EETJX.js} +2 -2
  35. package/{chunk-KFE6BJJS.js → chunk-IOZR6BLM.js} +3 -3
  36. package/{chunk-37XDGCY7.js → chunk-JWO3RQSH.js} +1 -1
  37. package/{chunk-MBOEV4L2.js → chunk-K647EQV3.js} +1 -1
  38. package/{chunk-4TNFXQTF.js → chunk-K76ZXWUZ.js} +36 -26
  39. package/{chunk-NPZQNQFD.js → chunk-KFOJI4XK.js} +3 -3
  40. package/{chunk-WF4MZQFZ.js → chunk-LNEAO4U2.js} +55 -39
  41. package/{chunk-PGX53HOY.js → chunk-M3HN7RBV.js} +1 -1
  42. package/{chunk-2NVUXKVF.js → chunk-MW4F6TUJ.js} +9 -9
  43. package/{chunk-VMWYBIXG.js → chunk-OPNHMILE.js} +3 -3
  44. package/{chunk-LNFMVJK5.js → chunk-OXZDMKZW.js} +5 -5
  45. package/{chunk-P7OOB7QP.js → chunk-Q4OT2DC7.js} +1 -1
  46. package/{chunk-CTCW7U7N.js → chunk-Q6FF2MCK.js} +1 -1
  47. package/{chunk-PAETKIBR.js → chunk-RIDW26NK.js} +7 -7
  48. package/{chunk-LAFC3B2I.js → chunk-RJ5HQDHL.js} +1 -1
  49. package/{chunk-ROXJVF7X.js → chunk-RXVVFYIF.js} +1 -1
  50. package/{chunk-SOJM57FX.js → chunk-SREASRV5.js} +1 -1
  51. package/{chunk-PEZJEQAO.js → chunk-T7PQFKJU.js} +105 -35
  52. package/{chunk-Z4QSJILV.js → chunk-TDTSQVDX.js} +3 -3
  53. package/{chunk-EIBTZ5WF.js → chunk-TG3YNAWW.js} +2 -2
  54. package/{chunk-JMVS6OB2.js → chunk-TWGLYE3V.js} +21 -21
  55. package/{chunk-N2COMZCD.js → chunk-UFTOGLCE.js} +5 -5
  56. package/{chunk-RJ2SAFB5.js → chunk-V3ZKNK5D.js} +550 -1
  57. package/{chunk-JX5PJCWS.js → chunk-WMRPXIZY.js} +2 -2
  58. package/{chunk-WVP4TZ4A.js → chunk-WTP5HY67.js} +4 -4
  59. package/{contentThunks-NUN6NRHW.js → contentThunks-GJEIIFO7.js} +12 -12
  60. package/{createAgentAutomationAction-3MOAQ3JB.js → createAgentAutomationAction-Q2NJFK36.js} +12 -12
  61. package/{createDialogAction-AYGXU34I.js → createDialogAction-M2XLDVIY.js} +13 -13
  62. package/{createPageAction-Y77VWMIU.js → createPageAction-YALT3K3T.js} +12 -12
  63. package/{dbSlice-IBVOBVMS.js → dbSlice-WL5T2LVF.js} +4 -4
  64. package/{deleteFile-FWP2PSBG.js → deleteFile-LWSR674W.js} +2 -2
  65. package/{dialogCommands-23KV3AP6.js → dialogCommands-LM7MOWRV.js} +15 -15
  66. package/{dialogSlice-FEJXMIMV.js → dialogSlice-UXLPONP7.js} +11 -11
  67. package/{docCreateCommands-7H24OAVG.js → docCreateCommands-VBWFWLUP.js} +14 -14
  68. package/{docDeleteCommands-FUAMVMAV.js → docDeleteCommands-B657OXLD.js} +15 -15
  69. package/{docReadCommands-ZOSN3RRZ.js → docReadCommands-STNB2GJG.js} +14 -14
  70. package/{docStore-5LRRKLQA.js → docStore-VA4ZDSQB.js} +5 -5
  71. package/{docUpdateCommands-Q3FFXNVX.js → docUpdateCommands-KFNCAZNJ.js} +14 -14
  72. package/{handleSendMessageAction-YMQD6VXX.js → handleSendMessageAction-QY3N4ZWZ.js} +11 -11
  73. package/index.js +41 -41
  74. package/{machineCommands-O2SEOXVE.js → machineCommands-4CFWCR6F.js} +29 -29
  75. package/{machineWsRunDispatch-SZ2M5MMG.js → machineWsRunDispatch-37NTQTHK.js} +29 -29
  76. package/{memberThunks-VZI6G7YZ.js → memberThunks-OBDDU3NR.js} +5 -5
  77. package/package.json +1 -1
  78. package/{read-2BYWW7AA.js → read-OOTHDABU.js} +2 -2
  79. package/{readDocTool-LC3A7QTB.js → readDocTool-OU4QXJT6.js} +1 -1
  80. package/{readlineWorkspace-EZ2IKTXS.js → readlineWorkspace-TNK2UNEK.js} +33 -33
  81. package/{removeDialogAgentAction-SFYZXHNK.js → removeDialogAgentAction-BVU6E27N.js} +6 -6
  82. package/{runAgentClientLoop-FJFKDMVZ.js → runAgentClientLoop-K27WYC5U.js} +24 -24
  83. package/{setDialogExtraReferencesAction-Q32RGFTA.js → setDialogExtraReferencesAction-AUKADSTQ.js} +5 -5
  84. package/{setPrimaryDialogAgentAction-BFYJHUJS.js → setPrimaryDialogAgentAction-HMHZWURC.js} +6 -6
  85. package/{settingSlice-IRUU4VFB.js → settingSlice-HIQRILF5.js} +5 -5
  86. package/{spaceCommands-7XAOMP6I.js → spaceCommands-PBYDQ77V.js} +14 -14
  87. package/{streamAgentChatTurn-4O2VTVPB.js → streamAgentChatTurn-CDS3RVB2.js} +26 -26
  88. package/{switchDialogAgentAction-L2KOKCGG.js → switchDialogAgentAction-Y66ZTIGP.js} +4 -4
  89. package/{tools-CHXW6V2S.js → tools-WI4AE3VP.js} +21 -21
  90. package/{tuiSummaryLlmCaller-D7CCLLS7.js → tuiSummaryLlmCaller-VL5RDGLT.js} +7 -7
  91. package/{updateDialogTitleAction-Y4UFJSEB.js → updateDialogTitleAction-EDDSMWSX.js} +12 -12
@@ -8,7 +8,7 @@ import {
8
8
  readSseFrames,
9
9
  streamSseDataValues,
10
10
  throwIfChatCompletionStreamFailed
11
- } from "./chunk-PGX53HOY.js";
11
+ } from "./chunk-M3HN7RBV.js";
12
12
  import {
13
13
  clipToolText,
14
14
  hasImageInRuntimeMessages,
@@ -39,7 +39,7 @@ import {
39
39
  requiresBareImageUrl,
40
40
  resolveToolGuidedSections,
41
41
  toBareImageUrlMessages
42
- } from "./chunk-AM3KKSJJ.js";
42
+ } from "./chunk-G6LSVBWG.js";
43
43
  import {
44
44
  convertMessagesToResponsesInput,
45
45
  extractReasoningFromResponseOutput,
@@ -60,14 +60,19 @@ import {
60
60
  buildProviderExecutionPlan
61
61
  } from "./chunk-VLQRD7ZJ.js";
62
62
  import {
63
+ BRIDGE_STREAM_MAX_CHARS,
64
+ DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
63
65
  NOLO_WORKSPACE_TOOL_NAMES,
64
66
  applyToolSurfaceConstraints,
67
+ buildDialogReadEnvelope,
65
68
  buildNoloWorkspaceCommandArgs,
69
+ createStreamingDialogReadProjector,
66
70
  noloPositiveIntegerString,
67
71
  noloStringArg,
68
72
  parseNoloWorkspaceToolArguments,
73
+ readTextStreamUpToChars,
69
74
  resolveNoloDialogInput
70
- } from "./chunk-RJ2SAFB5.js";
75
+ } from "./chunk-V3ZKNK5D.js";
71
76
  import {
72
77
  buildDialogFallbackTitleFromUserInput
73
78
  } from "./chunk-2MBTWINN.js";
@@ -80,7 +85,7 @@ import {
80
85
  resolveEmptyAssistantFallbackMessage,
81
86
  resolveEmptyAssistantOutcome,
82
87
  resolveTruncatedReasoningTailLog
83
- } from "./chunk-Q6FPSY5O.js";
88
+ } from "./chunk-HQ3ZLBSI.js";
84
89
  import {
85
90
  COMPACTION_SUMMARY_SCHEMA_VERSION,
86
91
  COMPACTION_SUMMARY_SYSTEM_PROMPT,
@@ -98,7 +103,7 @@ import {
98
103
  planCompression,
99
104
  planContextUsage,
100
105
  withProviderCallTimingFields
101
- } from "./chunk-Z4QSJILV.js";
106
+ } from "./chunk-TDTSQVDX.js";
102
107
  import {
103
108
  estimateTokenCount
104
109
  } from "./chunk-PSCNXBYA.js";
@@ -19102,8 +19107,7 @@ function buildLocalDialogWritePlan(args2) {
19102
19107
 
19103
19108
  // packages/agent-runtime/noloWorkspaceTools.node.ts
19104
19109
  async function readNoloProcessStream(readable) {
19105
- if (!readable) return "";
19106
- return new Response(readable).text();
19110
+ return readTextStreamUpToChars(readable, BRIDGE_STREAM_MAX_CHARS);
19107
19111
  }
19108
19112
  async function runNoloWorkspaceCliTool(call, args2) {
19109
19113
  const cliArgs = buildNoloWorkspaceCommandArgs(call);
@@ -19123,16 +19127,18 @@ async function runNoloWorkspaceCliTool(call, args2) {
19123
19127
  readNoloProcessStream(proc.stderr),
19124
19128
  proc.exited
19125
19129
  ]);
19126
- const content = `${stdout}${stderr}`;
19130
+ const content = `${stdout.text}${stderr.text}`;
19127
19131
  if (exitCode !== 0) {
19128
19132
  throw new Error(content.trim() || `nolo ${cliArgs.join(" ")} exited ${exitCode}`);
19129
19133
  }
19134
+ const bridgedOutputTruncated = stdout.truncated || stderr.truncated;
19130
19135
  return {
19131
19136
  content,
19132
19137
  metadata: {
19133
19138
  [args2.metadataKind ?? "noloWorkspaceTool"]: true,
19134
19139
  command: ["nolo", ...cliArgs].join(" "),
19135
- exitCode
19140
+ exitCode,
19141
+ ...bridgedOutputTruncated ? { bridgedOutputTruncated: true } : {}
19136
19142
  }
19137
19143
  };
19138
19144
  }
@@ -19148,7 +19154,7 @@ async function readDialogInProcess(call, store, env) {
19148
19154
  const { dbKey: dialogKey, dialogId } = resolveNoloDialogInput(dialogInput, userId);
19149
19155
  const meta = await store.read(dialogKey, { remote: false });
19150
19156
  if (mode === "status") {
19151
- const result5 = {
19157
+ const result4 = {
19152
19158
  dialogId,
19153
19159
  dialogKey,
19154
19160
  meta,
@@ -19157,35 +19163,39 @@ async function readDialogInProcess(call, store, env) {
19157
19163
  source: "in-process"
19158
19164
  };
19159
19165
  return {
19160
- content: JSON.stringify(result5, null, 2),
19166
+ content: JSON.stringify(result4, null, 2),
19161
19167
  metadata: { noloWorkspaceTool: true, readDialog: true, inProcess: true, mode: "status" }
19162
19168
  };
19163
19169
  }
19164
19170
  const limitNum = noloPositiveIntegerString(args2.limit);
19165
19171
  const limit = limitNum ? Number(limitNum) : void 0;
19166
- const rawMessages = [];
19172
+ const projector = createStreamingDialogReadProjector({
19173
+ maxResponseChars: DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
19174
+ ...limit !== void 0 ? { maxMessages: limit } : {}
19175
+ });
19167
19176
  if (store.iterator) {
19168
19177
  const { start, end: end3 } = dialogMessageRange(dialogId);
19169
19178
  for await (const [, value] of store.iterator({ gte: start, lte: end3 })) {
19170
- const message = localDialogMessageRecordToRuntimeMessage(value);
19179
+ const message = localDialogMessageRecordToRuntimeMessage(value) ?? value;
19171
19180
  if (message) {
19172
- rawMessages.push(message);
19173
- } else if (value) {
19174
- rawMessages.push(value);
19181
+ projector.addMessage(message);
19175
19182
  }
19176
19183
  }
19177
19184
  }
19178
- const messages = limit !== void 0 && rawMessages.length > limit ? rawMessages.slice(rawMessages.length - limit) : rawMessages;
19179
- const result4 = {
19180
- dialogId,
19181
- dialogKey,
19182
- meta,
19183
- messages,
19184
- messagesCount: messages.length,
19185
- source: "in-process"
19186
- };
19185
+ const projected = projector.finish(meta);
19186
+ const built = buildDialogReadEnvelope({
19187
+ meta: projected.meta,
19188
+ messages: projected.messages,
19189
+ stats: projected.stats,
19190
+ envelope: {
19191
+ dialogId,
19192
+ dialogKey,
19193
+ messagesCount: projected.stats.messagesReturned,
19194
+ source: "in-process"
19195
+ }
19196
+ });
19187
19197
  return {
19188
- content: JSON.stringify(result4, null, 2),
19198
+ content: built.serialized,
19189
19199
  metadata: { noloWorkspaceTool: true, readDialog: true, inProcess: true }
19190
19200
  };
19191
19201
  }
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-PAETKIBR.js";
3
+ } from "./chunk-RIDW26NK.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-JMVS6OB2.js";
8
+ } from "./chunk-TWGLYE3V.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
@@ -25,7 +25,7 @@ import {
25
25
  removeCachedEntity,
26
26
  upsertSSREntity,
27
27
  write
28
- } from "./chunk-DNNSCSA2.js";
28
+ } from "./chunk-4K6DB3GJ.js";
29
29
  import {
30
30
  createAgentKey,
31
31
  createDialogKey,
@@ -29,7 +29,7 @@ import {
29
29
  toCompactAgentSummary,
30
30
  toSafeAgentSummary,
31
31
  toUnavailableAgentSummary
32
- } from "./chunk-N2COMZCD.js";
32
+ } from "./chunk-UFTOGLCE.js";
33
33
  import {
34
34
  getUserDataItemTimestamp,
35
35
  mergeAndDedupUserData
@@ -40,7 +40,7 @@ import {
40
40
  readPageFunc,
41
41
  readPageFunctionSchema,
42
42
  slateToSimplifiedMarkdown
43
- } from "./chunk-2PGGC63K.js";
43
+ } from "./chunk-5TJQUZQ7.js";
44
44
  import {
45
45
  addMemberSpace,
46
46
  fetchAuthoritativeRemoteSpace,
@@ -52,7 +52,7 @@ import {
52
52
  setMembershipRejected,
53
53
  setSpaceInitialized,
54
54
  updateMemberSpaceName
55
- } from "./chunk-MBOEV4L2.js";
55
+ } from "./chunk-K647EQV3.js";
56
56
  import {
57
57
  ToolApiError,
58
58
  buildToolRequestHeaders,
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-OZX2IPKM.js";
64
64
  import {
65
65
  setDialogExtraReferencesAction
66
- } from "./chunk-CP7VIDZ7.js";
66
+ } from "./chunk-7JS3F5ZR.js";
67
67
  import {
68
68
  waitForAbortableDelay
69
69
  } from "./chunk-N4G4PKQ6.js";
@@ -81,14 +81,14 @@ import {
81
81
  } from "./chunk-VF4K2QE6.js";
82
82
  import {
83
83
  createDocState
84
- } from "./chunk-YEI76VEX.js";
84
+ } from "./chunk-FPUHDMMQ.js";
85
85
  import {
86
86
  BUILTIN_OBJECT_SKILL_IDS,
87
87
  buildBuiltinObjectSkillConfig,
88
88
  buildBuiltinObjectSkillDbKey,
89
89
  buildBuiltinObjectSkillPageContent,
90
90
  createDialogAction
91
- } from "./chunk-NPZQNQFD.js";
91
+ } from "./chunk-KFOJI4XK.js";
92
92
  import {
93
93
  DEFAULT_COLLAPSED_CATEGORIES,
94
94
  addContentToSpace,
@@ -109,7 +109,7 @@ import {
109
109
  updateContentCategory,
110
110
  updateContentTitle,
111
111
  writeStoredCollapsedCategories
112
- } from "./chunk-PAETKIBR.js";
112
+ } from "./chunk-RIDW26NK.js";
113
113
  import {
114
114
  getCurrentSpaceId,
115
115
  getCurrentSpaceIdRaw,
@@ -130,14 +130,14 @@ import {
130
130
  selectMsgById,
131
131
  uiAskChoiceFunc,
132
132
  uiAskChoiceFunctionSchema
133
- } from "./chunk-JMVS6OB2.js";
133
+ } from "./chunk-TWGLYE3V.js";
134
134
  import {
135
135
  createAgent,
136
136
  deleteServerSyncedCredential,
137
137
  runLlm,
138
138
  streamAgentChatTurn,
139
139
  updateAgent
140
- } from "./chunk-LNFMVJK5.js";
140
+ } from "./chunk-OXZDMKZW.js";
141
141
  import {
142
142
  getActiveDialogKey,
143
143
  selectCurrentDialogKey,
@@ -165,8 +165,10 @@ import {
165
165
  resolvePageSkillMetadata
166
166
  } from "./chunk-AETZ7AD6.js";
167
167
  import {
168
+ DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS,
168
169
  NOLO_WORKSPACE_TOOL_NAMES,
169
170
  buildAgentRuntimeAgentLookupKeys,
171
+ buildDialogReadEnvelope,
170
172
  buildNoloSubjectRefQueryTarget,
171
173
  buildNoloTableQueryRequest,
172
174
  clampNoloPositiveInteger,
@@ -178,13 +180,13 @@ import {
178
180
  redactAgentRecordForWorkspaceTool,
179
181
  resolveNoloDialogInput,
180
182
  verifyNoloDialogSubjectRefQuery
181
- } from "./chunk-RJ2SAFB5.js";
183
+ } from "./chunk-V3ZKNK5D.js";
182
184
  import {
183
185
  isAgentUnavailableNow
184
186
  } from "./chunk-CJCJF5XB.js";
185
187
  import {
186
188
  buildDatabaseFileContentUrl
187
- } from "./chunk-Z4QSJILV.js";
189
+ } from "./chunk-TDTSQVDX.js";
188
190
  import {
189
191
  DEFAULT_MODEL
190
192
  } from "./chunk-TQC77XVE.js";
@@ -203,7 +205,7 @@ import {
203
205
  } from "./chunk-O6OSWFZQ.js";
204
206
  import {
205
207
  shareResourceAction
206
- } from "./chunk-JX5PJCWS.js";
208
+ } from "./chunk-WMRPXIZY.js";
207
209
  import {
208
210
  AGENT_UPDATE_FIELD_NAMES,
209
211
  nolotusId,
@@ -211,7 +213,7 @@ import {
211
213
  selectAutoApproveSelfUpdateFields,
212
214
  selectCurrentServer,
213
215
  selectSyncServers
214
- } from "./chunk-VMWYBIXG.js";
216
+ } from "./chunk-OPNHMILE.js";
215
217
  import {
216
218
  asRecordOrEmpty
217
219
  } from "./chunk-KX6YBIHG.js";
@@ -219,7 +221,7 @@ import {
219
221
  UNCATEGORIZED_ID,
220
222
  addContentAction,
221
223
  checkSpaceMembership
222
- } from "./chunk-RVWRKFUB.js";
224
+ } from "./chunk-IM5EETJX.js";
223
225
  import {
224
226
  createSpaceKey,
225
227
  normalizeSpaceId
@@ -234,7 +236,7 @@ import {
234
236
  selectEntities,
235
237
  toTimestampMs,
236
238
  write
237
- } from "./chunk-DNNSCSA2.js";
239
+ } from "./chunk-4K6DB3GJ.js";
238
240
  import {
239
241
  SEPARATOR,
240
242
  TYPE_STORAGE_PREFIXES,
@@ -266,7 +268,7 @@ import {
266
268
  } from "./chunk-QSJ3HFEF.js";
267
269
  import {
268
270
  readAction
269
- } from "./chunk-L7B47JXR.js";
271
+ } from "./chunk-4MKPBCTN.js";
270
272
  import {
271
273
  extractCustomId
272
274
  } from "./chunk-BJIRLHJR.js";
@@ -281,7 +283,7 @@ import {
281
283
  resolveEffectiveSpaceActorId,
282
284
  resolveRecordOwnerUserId,
283
285
  selectRuntimeSnapshot
284
- } from "./chunk-KWSQR2KK.js";
286
+ } from "./chunk-3RAG2NAD.js";
285
287
  import {
286
288
  isAbortError
287
289
  } from "./chunk-QOKAKDPE.js";
@@ -15960,7 +15962,8 @@ var readDialogFunctionSchema = {
15960
15962
  description: [
15961
15963
  "Read one persisted Nolo dialog, including metadata and recent messages.",
15962
15964
  "Prefer the full dialog dbKey (dialog-<userId>-<id>) or a dialog URL; a bare id only resolves for the currently logged-in user and cannot reliably read other users' or cross-server dialogs. Use listDialogs first when the target dialog is unclear.",
15963
- "If a read fails, first confirm the dbKey via listDialogs; the returned meta includes runtime checkpoint/status info for agent-run dialogs; a local run's dialog lives in the local environment/local server and must be read there."
15965
+ "If a read fails, first confirm the dbKey via listDialogs; the returned meta includes runtime checkpoint/status info for agent-run dialogs; a local run's dialog lives in the local environment/local server and must be read there.",
15966
+ 'The response is budgeted: reasoning_content, tool_calls arguments, tool result content and metadata are head-truncated with projection stats (truncated, messagesTotal/messagesReturned, estimatedOriginalChars/omittedChars). For review or verification, read mode="status" or the final verdict and take diffs from the worktree instead of pulling the full execution transcript.'
15964
15967
  ].join("\n"),
15965
15968
  parameters: {
15966
15969
  type: "object",
@@ -15969,7 +15972,7 @@ var readDialogFunctionSchema = {
15969
15972
  type: "string",
15970
15973
  description: "Dialog dbKey (dialog-<userId>-<id>), dialog URL, or bare id (current user only)."
15971
15974
  },
15972
- limit: { type: "integer", description: "Message limit. Default 120, max 1000." }
15975
+ limit: { type: "integer", description: "Message limit. Default 120, max 1000. The total serialized response is additionally capped (default 32000 chars) regardless of limit." }
15973
15976
  },
15974
15977
  required: ["dialog"]
15975
15978
  }
@@ -16077,6 +16080,7 @@ async function readDialogFunc(args, thunkApi) {
16077
16080
  const limit = clampNoloPositiveInteger(args?.limit, 120, 1e3);
16078
16081
  const meta = await readBestRecord(thunkApi, resolved.dbKey, true);
16079
16082
  let messages = [];
16083
+ let sourceProjection = void 0;
16080
16084
  const serverBase = normalizeServerOrigin(runtime?.currentServer);
16081
16085
  if (serverBase && runtime?.currentToken) {
16082
16086
  const response = await fetchWithTransientRetry(fetch, `${serverBase}/rpc/getConvMsgs`, {
@@ -16085,28 +16089,40 @@ async function readDialogFunc(args, thunkApi) {
16085
16089
  "Content-Type": "application/json",
16086
16090
  ...authHeaders2(runtime.currentToken)
16087
16091
  },
16088
- body: JSON.stringify({ dialogId: resolved.dialogId, limit })
16092
+ // Agent-safe bounded 模式:数据源侧完成预算 projection,本进程不再
16093
+ // 对全量消息做 materialize + 整体 stringify。
16094
+ body: JSON.stringify({
16095
+ dialogId: resolved.dialogId,
16096
+ limit,
16097
+ maxChars: DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS
16098
+ })
16089
16099
  }).catch(() => null);
16090
16100
  if (response?.ok) {
16091
- const payload = await response.json().catch(() => []);
16092
- messages = Array.isArray(payload) ? payload : [];
16101
+ const payload = await response.json().catch(() => null);
16102
+ if (payload && typeof payload === "object" && Array.isArray(payload.messages)) {
16103
+ messages = payload.messages;
16104
+ sourceProjection = payload.projection ?? void 0;
16105
+ } else if (Array.isArray(payload)) {
16106
+ messages = [...payload].reverse();
16107
+ }
16093
16108
  } else if (response) {
16094
16109
  await throwIfDrainExhausted(response);
16095
16110
  }
16096
16111
  }
16112
+ const built = buildDialogReadEnvelope({
16113
+ meta,
16114
+ messages,
16115
+ ...sourceProjection ? { stats: sourceProjection } : {},
16116
+ envelope: { success: true, dialogKey: resolved.dbKey, dialogId: resolved.dialogId },
16117
+ options: { maxResponseChars: DEFAULT_READ_DIALOG_MAX_RESPONSE_CHARS }
16118
+ });
16097
16119
  return {
16098
- rawData: {
16099
- success: true,
16100
- dialogKey: resolved.dbKey,
16101
- dialogId: resolved.dialogId,
16102
- meta,
16103
- messages
16104
- },
16120
+ rawData: built.envelope,
16105
16121
  displayData: jsonPreview({
16106
16122
  dialogKey: resolved.dbKey,
16107
16123
  title: meta?.title,
16108
- messageCount: messages.length,
16109
- messages
16124
+ messageCount: built.envelope.messages.length,
16125
+ messages: built.envelope.messages
16110
16126
  })
16111
16127
  };
16112
16128
  }
@@ -16181,7 +16197,7 @@ async function deleteDialogsFunc(args, thunkApi) {
16181
16197
  const deletedDialogIds = [];
16182
16198
  const deletedDialogKeys = [];
16183
16199
  const failures = [];
16184
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-FEJXMIMV.js");
16200
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-UXLPONP7.js");
16185
16201
  for (const target of targets) {
16186
16202
  try {
16187
16203
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -16488,7 +16504,7 @@ var readSkillDocFunctionSchema = {
16488
16504
  }
16489
16505
  };
16490
16506
  async function readSkillDocFunc(args, thunkApi) {
16491
- const { buildReadDocResult } = await import("./readDocTool-LC3A7QTB.js");
16507
+ const { buildReadDocResult } = await import("./readDocTool-OU4QXJT6.js");
16492
16508
  const id = args?.id ?? args?.doc ?? args?.docKey ?? args?.pageKey;
16493
16509
  if (typeof id !== "string" || !id.trim()) {
16494
16510
  throw new Error("readSkillDoc requires id or doc.");
@@ -17291,7 +17307,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
17291
17307
  const spaceKey = createSpaceKey.space(spaceId);
17292
17308
  const readSpace = async (dbKey) => {
17293
17309
  try {
17294
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-IBVOBVMS.js");
17310
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-WL5T2LVF.js");
17295
17311
  if (fresh) {
17296
17312
  return await dispatch(readAndWait2(dbKey)).unwrap();
17297
17313
  }
@@ -23017,7 +23033,7 @@ var selectUserIdFromState = (state2) => {
23017
23033
  var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
23018
23034
  async function addImageContentToSpace(input) {
23019
23035
  const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
23020
- const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-V3NAZRTJ.js")).addContentAction;
23036
+ const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-E3S6F3IS.js")).addContentAction;
23021
23037
  await addContentAction2(
23022
23038
  {
23023
23039
  spaceId: input.spaceId,
@@ -26938,7 +26954,7 @@ var executeToolRun = createAsyncThunk(
26938
26954
  if (!executionInput) {
26939
26955
  throw new Error(`ToolRun ${id} has no input to execute with.`);
26940
26956
  }
26941
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-CHXW6V2S.js");
26957
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-WI4AE3VP.js");
26942
26958
  const { executor } = findToolExecutor2(run.toolName);
26943
26959
  toolRunStarted({
26944
26960
  id: run.id,
@@ -26962,7 +26978,7 @@ var executeToolRun = createAsyncThunk(
26962
26978
  const latestState = thunkApi.getState();
26963
26979
  const userId = selectIdentityUserId(latestState);
26964
26980
  if (userId) {
26965
- const { fetchUserSpaceMemberships } = await import("./memberThunks-VZI6G7YZ.js");
26981
+ const { fetchUserSpaceMemberships } = await import("./memberThunks-OBDDU3NR.js");
26966
26982
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
26967
26983
  }
26968
26984
  }
@@ -29445,7 +29461,7 @@ async function updateDocFunc(args, thunkApi) {
29445
29461
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
29446
29462
  };
29447
29463
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
29448
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-5LRRKLQA.js");
29464
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-VA4ZDSQB.js");
29449
29465
  if (getDocState().pageKey === id) {
29450
29466
  applyExternalDocUpdate({
29451
29467
  slateData: finalSlateData,
@@ -29470,7 +29486,7 @@ async function updateDocFunc(args, thunkApi) {
29470
29486
  // packages/ai/tools/updateUserPreferenceProfileTool.ts
29471
29487
  async function dispatchSetSettings(thunkApi, changes) {
29472
29488
  const injectedSetSettings = thunkApi?.extra?.setSettings;
29473
- const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-IRUU4VFB.js")).setSettings;
29489
+ const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-HIQRILF5.js")).setSettings;
29474
29490
  await thunkApi.dispatch(setSettings(changes)).unwrap();
29475
29491
  }
29476
29492
  var updateUserPreferenceProfileFunctionSchema = {
@@ -40,7 +40,7 @@ import {
40
40
  clipCompactText,
41
41
  isMeaningfulChatCompletionOutput,
42
42
  isMeaningfulResponsesOutput
43
- } from "./chunk-Z4QSJILV.js";
43
+ } from "./chunk-TDTSQVDX.js";
44
44
  import {
45
45
  NOLO_CLIENT_VERSION_HEADER
46
46
  } from "./chunk-5YIL5WDC.js";
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-5RHCYQBK.js";
8
+ } from "./chunk-I7SDLO23.js";
9
9
  import {
10
10
  INVALID_TOOL_ARGS_REPLACEMENT,
11
11
  buildInvalidToolCallSelfHealResult,
12
12
  parseToolCallArguments,
13
13
  performFetchRequest,
14
14
  sanitizeOutboundMessages
15
- } from "./chunk-ZZXMGOIJ.js";
15
+ } from "./chunk-FER25LZS.js";
16
16
  import {
17
17
  createSSEParser,
18
18
  createToolRunId,
@@ -23,7 +23,7 @@ import {
23
23
  toolRunSetPending,
24
24
  toolRunStarted,
25
25
  toolRunSucceeded
26
- } from "./chunk-WF4MZQFZ.js";
26
+ } from "./chunk-LNEAO4U2.js";
27
27
  import {
28
28
  getPublicImageAgentMode
29
29
  } from "./chunk-VIDPVFP3.js";
@@ -35,10 +35,10 @@ import {
35
35
  messageStreamEnd,
36
36
  messageStreaming,
37
37
  updateToolMessage
38
- } from "./chunk-JMVS6OB2.js";
38
+ } from "./chunk-TWGLYE3V.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-LNFMVJK5.js";
41
+ } from "./chunk-OXZDMKZW.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,
@@ -56,7 +56,7 @@ import {
56
56
  import {
57
57
  EMPTY_ASSISTANT_REPAIR_PROMPT,
58
58
  getModelInfo
59
- } from "./chunk-Q6FPSY5O.js";
59
+ } from "./chunk-HQ3ZLBSI.js";
60
60
  import {
61
61
  getApiEndpoint
62
62
  } from "./chunk-TQC77XVE.js";
@@ -65,10 +65,10 @@ import {
65
65
  } from "./chunk-HNMXYYJR.js";
66
66
  import {
67
67
  selectCurrentServer
68
- } from "./chunk-VMWYBIXG.js";
68
+ } from "./chunk-OPNHMILE.js";
69
69
  import {
70
70
  write
71
- } from "./chunk-DNNSCSA2.js";
71
+ } from "./chunk-4K6DB3GJ.js";
72
72
  import {
73
73
  createDialogMessageKeyAndId,
74
74
  dialogMessageKey,
@@ -79,7 +79,7 @@ import {
79
79
  } from "./chunk-BJIRLHJR.js";
80
80
  import {
81
81
  createAsyncThunk
82
- } from "./chunk-KWSQR2KK.js";
82
+ } from "./chunk-3RAG2NAD.js";
83
83
  import {
84
84
  isAbortError
85
85
  } from "./chunk-QOKAKDPE.js";
@@ -13,7 +13,7 @@ import {
13
13
  toTimestampMs,
14
14
  upsert,
15
15
  write
16
- } from "./chunk-DNNSCSA2.js";
16
+ } from "./chunk-4K6DB3GJ.js";
17
17
  import {
18
18
  createUserKey,
19
19
  createUserPreferenceKey,
@@ -24,14 +24,14 @@ import {
24
24
  } from "./chunk-QSJ3HFEF.js";
25
25
  import {
26
26
  BUILTIN_NOLO_AGENT_KEY
27
- } from "./chunk-L7B47JXR.js";
27
+ } from "./chunk-4MKPBCTN.js";
28
28
  import {
29
29
  asyncThunkCreator,
30
30
  buildCreateSlice,
31
31
  createAction,
32
32
  createAsyncThunk,
33
33
  createSelector
34
- } from "./chunk-KWSQR2KK.js";
34
+ } from "./chunk-3RAG2NAD.js";
35
35
  import {
36
36
  getAllServers,
37
37
  getIsDesktopApp,
@@ -11,7 +11,7 @@ import {
11
11
  patch,
12
12
  remove,
13
13
  write
14
- } from "./chunk-DNNSCSA2.js";
14
+ } from "./chunk-4K6DB3GJ.js";
15
15
  import {
16
16
  createAgentKey,
17
17
  toTrimmedString
@@ -20,7 +20,7 @@ import {
20
20
  asyncThunkCreator,
21
21
  buildCreateSlice,
22
22
  getRuntimeServerContext
23
- } from "./chunk-KWSQR2KK.js";
23
+ } from "./chunk-3RAG2NAD.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-TBSKCSBE.js");
307
+ const { _executeModel } = await import("./_executeModel-C63UG367.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-FJFKDMVZ.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-K27WYC5U.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-4O2VTVPB.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-CDS3RVB2.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-FHAGENAS.js";
5
+ } from "./chunk-AUKZOZFG.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-KQHGZWSV.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildAgentRuntimeAgentLookupKeys,
3
3
  shouldFetchAgentRuntimeRecordRemotely
4
- } from "./chunk-RJ2SAFB5.js";
4
+ } from "./chunk-V3ZKNK5D.js";
5
5
 
6
6
  // packages/cli/client/localAgentRecords.ts
7
7
  var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;