nolo-cli 0.66.0-alpha.4 → 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 (62) hide show
  1. package/{_executeModel-UYF2UEIG.js → _executeModel-C63UG367.js} +13 -13
  2. package/{agentDeleteCommand-7SWSSU4X.js → agentDeleteCommand-AHCJ2KJ7.js} +6 -6
  3. package/{agentEmailCommands-UAF3YDG6.js → agentEmailCommands-JOMRC3W2.js} +15 -15
  4. package/{agentListCommands-473D3OB3.js → agentListCommands-6KB4IHQS.js} +8 -8
  5. package/{agentMachineCommands-NWHVKMP7.js → agentMachineCommands-SDRE2NTN.js} +6 -6
  6. package/{agentRecordCommands-G5ZQQNEC.js → agentRecordCommands-5YZGXSK7.js} +15 -15
  7. package/{agentRunCommand-ZTRT252J.js → agentRunCommand-AEY7AB2D.js} +15 -15
  8. package/{agentRuntimeLocal-3JLUMWN7.js → agentRuntimeLocal-COPOV7R7.js} +3 -3
  9. package/{agentSlice-RPMDYBLC.js → agentSlice-TV2HZX2H.js} +1 -1
  10. package/{appDeleteCommands-SCJZAMUA.js → appDeleteCommands-F6M2UEWG.js} +7 -7
  11. package/{appDeployCommands-RVBQZJUT.js → appDeployCommands-THWNABDT.js} +7 -7
  12. package/{appDeployStatusCommands-BUPLMNTO.js → appDeployStatusCommands-A4XSWHFX.js} +7 -7
  13. package/{appGetCommands-NQ34IZRG.js → appGetCommands-62FK5II3.js} +7 -7
  14. package/{appListCommands-KZHI5DQM.js → appListCommands-MQTHZLHV.js} +7 -7
  15. package/{chatQueueReduxAdapter-2Z6DYXAG.js → chatQueueReduxAdapter-BK5MJ4TA.js} +2 -2
  16. package/{chunk-RRY4U37C.js → chunk-7TSLWGZZ.js} +7 -7
  17. package/{chunk-FHAGENAS.js → chunk-AUKZOZFG.js} +1 -1
  18. package/{chunk-UZPQSVM6.js → chunk-B62OSA77.js} +1 -1
  19. package/{chunk-XOPPOOTE.js → chunk-FER25LZS.js} +4 -4
  20. package/{chunk-XCNSZUQA.js → chunk-FPUHDMMQ.js} +2 -2
  21. package/{chunk-76JYRUX4.js → chunk-G6LSVBWG.js} +1 -1
  22. package/{chunk-BWHZ4H2Q.js → chunk-HHR4KGYD.js} +7 -7
  23. package/{chunk-GVYMHBG3.js → chunk-I7SDLO23.js} +1 -1
  24. package/{chunk-RNYLWVME.js → chunk-IOZR6BLM.js} +3 -3
  25. package/{chunk-37XDGCY7.js → chunk-JWO3RQSH.js} +1 -1
  26. package/{chunk-ZSR7L46Q.js → chunk-K76ZXWUZ.js} +33 -23
  27. package/{chunk-4SCMOQRM.js → chunk-KFOJI4XK.js} +2 -2
  28. package/{chunk-J2WQUFGG.js → chunk-LNEAO4U2.js} +40 -24
  29. package/{chunk-6B2AUXKR.js → chunk-MW4F6TUJ.js} +5 -5
  30. package/{chunk-UMIARYFE.js → chunk-OXZDMKZW.js} +3 -3
  31. package/{chunk-P7OOB7QP.js → chunk-Q4OT2DC7.js} +1 -1
  32. package/{chunk-CTCW7U7N.js → chunk-Q6FF2MCK.js} +1 -1
  33. package/{chunk-YDNDUOB5.js → chunk-RIDW26NK.js} +1 -1
  34. package/{chunk-G2MPS44L.js → chunk-RXVVFYIF.js} +1 -1
  35. package/{chunk-PEZJEQAO.js → chunk-T7PQFKJU.js} +105 -35
  36. package/{chunk-HUZUAHZ6.js → chunk-TG3YNAWW.js} +2 -2
  37. package/{chunk-6AAQCFLQ.js → chunk-TWGLYE3V.js} +8 -8
  38. package/{chunk-6X5B2VF5.js → chunk-UFTOGLCE.js} +1 -1
  39. package/{chunk-RJ2SAFB5.js → chunk-V3ZKNK5D.js} +550 -1
  40. package/{chunk-5P6YOSF3.js → chunk-WTP5HY67.js} +4 -4
  41. package/{contentThunks-GMRDVLFD.js → contentThunks-GJEIIFO7.js} +3 -3
  42. package/{createAgentAutomationAction-CH6Q7JMD.js → createAgentAutomationAction-Q2NJFK36.js} +3 -3
  43. package/{createDialogAction-ARYHXJ2V.js → createDialogAction-M2XLDVIY.js} +4 -4
  44. package/{createPageAction-RAPK4J4H.js → createPageAction-YALT3K3T.js} +3 -3
  45. package/{dialogCommands-JAAYSIOE.js → dialogCommands-LM7MOWRV.js} +7 -7
  46. package/{dialogSlice-CJNADK2R.js → dialogSlice-UXLPONP7.js} +2 -2
  47. package/{docCreateCommands-U5OCW42O.js → docCreateCommands-VBWFWLUP.js} +6 -6
  48. package/{docDeleteCommands-6RAGSIKC.js → docDeleteCommands-B657OXLD.js} +7 -7
  49. package/{docReadCommands-ID6VUNQD.js → docReadCommands-STNB2GJG.js} +6 -6
  50. package/{docStore-6ZFYOHQT.js → docStore-VA4ZDSQB.js} +1 -1
  51. package/{docUpdateCommands-UIC4LWFG.js → docUpdateCommands-KFNCAZNJ.js} +6 -6
  52. package/{handleSendMessageAction-36NZDUHT.js → handleSendMessageAction-QY3N4ZWZ.js} +2 -2
  53. package/index.js +40 -40
  54. package/{machineCommands-25QIEYZQ.js → machineCommands-4CFWCR6F.js} +14 -14
  55. package/{machineWsRunDispatch-HWYVWOIE.js → machineWsRunDispatch-37NTQTHK.js} +14 -14
  56. package/package.json +1 -1
  57. package/{readlineWorkspace-22XWLYEH.js → readlineWorkspace-TNK2UNEK.js} +18 -18
  58. package/{runAgentClientLoop-NYNYXB5C.js → runAgentClientLoop-K27WYC5U.js} +11 -11
  59. package/{spaceCommands-VWJ2BUYK.js → spaceCommands-PBYDQ77V.js} +6 -6
  60. package/{streamAgentChatTurn-EK4UVC2Y.js → streamAgentChatTurn-CDS3RVB2.js} +12 -12
  61. package/{tools-U4GOB2KS.js → tools-WI4AE3VP.js} +8 -8
  62. package/{updateDialogTitleAction-EXREKMC5.js → updateDialogTitleAction-EDDSMWSX.js} +3 -3
@@ -4,12 +4,12 @@ import {
4
4
  } from "./chunk-YPREESF4.js";
5
5
  import {
6
6
  handleSendMessage
7
- } from "./chunk-6AAQCFLQ.js";
7
+ } from "./chunk-TWGLYE3V.js";
8
8
  import "./chunk-EVBFYPDC.js";
9
9
  import "./chunk-HQUORJTM.js";
10
10
  import "./chunk-YYLHWIW6.js";
11
11
  import "./chunk-AGGIDPCZ.js";
12
- import "./chunk-UMIARYFE.js";
12
+ import "./chunk-OXZDMKZW.js";
13
13
  import "./chunk-76JAMDUT.js";
14
14
  import "./chunk-5RGU3J7P.js";
15
15
  import {
@@ -27,7 +27,7 @@ import {
27
27
  resolveLocalUserId,
28
28
  t,
29
29
  toolLabel
30
- } from "./chunk-BWHZ4H2Q.js";
30
+ } from "./chunk-HHR4KGYD.js";
31
31
  import {
32
32
  createRunActivityTracker,
33
33
  popSingleQueueMessage,
@@ -47,7 +47,7 @@ import {
47
47
  import {
48
48
  readDbRecord,
49
49
  resolveAgentRecordFromHybridStore
50
- } from "./chunk-FHAGENAS.js";
50
+ } from "./chunk-AUKZOZFG.js";
51
51
  import {
52
52
  isLocalCliAgentKey
53
53
  } from "./chunk-SPAQ4PVV.js";
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-LTRXGFMS.js";
64
64
  import {
65
65
  formatAgentListCard
66
- } from "./chunk-J2WQUFGG.js";
66
+ } from "./chunk-LNEAO4U2.js";
67
67
  import {
68
68
  isTransientFetchError
69
69
  } from "./chunk-5XTOKQLW.js";
@@ -84,12 +84,12 @@ import {
84
84
  chooseMemoryOwners,
85
85
  loadMemoryCandidatesFromDb,
86
86
  resolveAgentMemoryPolicy
87
- } from "./chunk-4SCMOQRM.js";
87
+ } from "./chunk-KFOJI4XK.js";
88
88
  import {
89
89
  API_REPORTED_COST_MULTIPLIER,
90
90
  normalizeUsage,
91
91
  parseUiAskChoiceContent
92
- } from "./chunk-6AAQCFLQ.js";
92
+ } from "./chunk-TWGLYE3V.js";
93
93
  import {
94
94
  isOAuthApiKeyRef
95
95
  } from "./chunk-YYLHWIW6.js";
@@ -112,7 +112,7 @@ import {
112
112
  LOCAL_AGENT_CONFIG_MISSING_CODE,
113
113
  LOCAL_TURN_ABORTED_CODE,
114
114
  readActionGate
115
- } from "./chunk-ZSR7L46Q.js";
115
+ } from "./chunk-K76ZXWUZ.js";
116
116
  import {
117
117
  resolveAgentRuntimeConfigFromRecord
118
118
  } from "./chunk-Y7PULBIA.js";
@@ -5176,7 +5176,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
5176
5176
  // packages/cli/client/agentRun.ts
5177
5177
  import { ulid } from "ulid";
5178
5178
  async function loadRunLocalAgentTurn() {
5179
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-3JLUMWN7.js");
5179
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-COPOV7R7.js");
5180
5180
  return runLocalAgentTurn;
5181
5181
  }
5182
5182
  var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildLocalAgentLookupKeys,
3
3
  shouldReadAgentKeyRemotely
4
- } from "./chunk-CTCW7U7N.js";
4
+ } from "./chunk-Q6FF2MCK.js";
5
5
  import {
6
6
  resolveCliAgentKeyInput
7
7
  } from "./chunk-SPAQ4PVV.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-FHAGENAS.js";
4
+ } from "./chunk-AUKZOZFG.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
@@ -8,7 +8,7 @@ import {
8
8
  clipMultilineText,
9
9
  fetchAndSerializeTable,
10
10
  resolveBuiltinSkillPage
11
- } from "./chunk-J2WQUFGG.js";
11
+ } from "./chunk-LNEAO4U2.js";
12
12
  import {
13
13
  isGatewayHttpStatus
14
14
  } from "./chunk-NF64D32W.js";
@@ -29,13 +29,13 @@ import {
29
29
  } from "./chunk-MEYIRKDN.js";
30
30
  import {
31
31
  fetchAndCacheMessages
32
- } from "./chunk-6AAQCFLQ.js";
32
+ } from "./chunk-TWGLYE3V.js";
33
33
  import {
34
34
  shouldUseServerProxy
35
35
  } from "./chunk-YYLHWIW6.js";
36
36
  import {
37
37
  fetchServerSyncedCredential
38
- } from "./chunk-UMIARYFE.js";
38
+ } from "./chunk-OXZDMKZW.js";
39
39
  import {
40
40
  buildSkillGuidancePromptBlock,
41
41
  extractRuntimePageCapabilities,
@@ -47,7 +47,7 @@ import {
47
47
  compileContextLayers,
48
48
  normalizeChatCompletionsBodyForProvider,
49
49
  resolveToolGuidedSections
50
- } from "./chunk-76JYRUX4.js";
50
+ } from "./chunk-G6LSVBWG.js";
51
51
  import {
52
52
  convertMessagesToResponsesInput,
53
53
  getUsageRequestOptions,
@@ -326,7 +326,7 @@ async function saveDocState(arg, { dispatch, getState }) {
326
326
  ).unwrap();
327
327
  if (dbSpaceId) {
328
328
  try {
329
- const { updateContentTitle } = await import("./contentThunks-GMRDVLFD.js");
329
+ const { updateContentTitle } = await import("./contentThunks-GJEIIFO7.js");
330
330
  await dispatch(
331
331
  updateContentTitle({
332
332
  spaceId: dbSpaceId,
@@ -365,7 +365,7 @@ async function saveDocState(arg, { dispatch, getState }) {
365
365
  }
366
366
  }
367
367
  async function createDocState(args, thunkApi) {
368
- const { createPageAction } = await import("./createPageAction-RAPK4J4H.js");
368
+ const { createPageAction } = await import("./createPageAction-YALT3K3T.js");
369
369
  return createPageAction(args, thunkApi);
370
370
  }
371
371
  function subscribe(listener) {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XTJTN3RW.js";
5
5
  import {
6
6
  AGENT_SELECTION_PRIORITY_INSTRUCTIONS
7
- } from "./chunk-RJ2SAFB5.js";
7
+ } from "./chunk-V3ZKNK5D.js";
8
8
  import {
9
9
  getModelContextWindow
10
10
  } from "./chunk-HQ3ZLBSI.js";
@@ -35,7 +35,7 @@ import {
35
35
  } from "./chunk-DWUCB2A3.js";
36
36
  import {
37
37
  buildLocalAgentLookupKeys
38
- } from "./chunk-CTCW7U7N.js";
38
+ } from "./chunk-Q6FF2MCK.js";
39
39
  import {
40
40
  LOCAL_CODEX_AGENT_ID,
41
41
  LOCAL_CODEX_AGENT_KEY,
@@ -55,7 +55,7 @@ import {
55
55
  import {
56
56
  inlineImageUrlsForCustomProvider,
57
57
  prepareTools
58
- } from "./chunk-GVYMHBG3.js";
58
+ } from "./chunk-I7SDLO23.js";
59
59
  import {
60
60
  getServerProviderSecret
61
61
  } from "./chunk-HS7MLR74.js";
@@ -72,7 +72,7 @@ import {
72
72
  rememberMemoryFunctionSchema,
73
73
  resolveAgentRequiredPackIds,
74
74
  setTodoListFunc
75
- } from "./chunk-J2WQUFGG.js";
75
+ } from "./chunk-LNEAO4U2.js";
76
76
  import {
77
77
  fetchWithTransientRetry,
78
78
  isTransientFetchError
@@ -96,13 +96,13 @@ import {
96
96
  prepareTokenUsageData,
97
97
  resolveBuiltinPlatformAgentConfig,
98
98
  runKeyed
99
- } from "./chunk-6AAQCFLQ.js";
99
+ } from "./chunk-TWGLYE3V.js";
100
100
  import {
101
101
  BUILTIN_TITLE_LLM_CONFIG
102
102
  } from "./chunk-EVBFYPDC.js";
103
103
  import {
104
104
  fetchServerSyncedCredential
105
- } from "./chunk-UMIARYFE.js";
105
+ } from "./chunk-OXZDMKZW.js";
106
106
  import {
107
107
  require_date_fns
108
108
  } from "./chunk-M76ECQRD.js";
@@ -154,7 +154,7 @@ import {
154
154
  resolveOpenAiCompatibleProviderConfig,
155
155
  shouldUseGeminiNativeToolRoute,
156
156
  summarizeToolArguments
157
- } from "./chunk-ZSR7L46Q.js";
157
+ } from "./chunk-K76ZXWUZ.js";
158
158
  import {
159
159
  PlatformStreamInterruptedError,
160
160
  buildPlatformChatCompletionRequest,
@@ -187,7 +187,7 @@ import {
187
187
  buildNoloWorkspaceOpenAiTools,
188
188
  parseNoloWorkspaceToolArguments,
189
189
  resolveRuntimeToolSurfaceForAgent
190
- } from "./chunk-RJ2SAFB5.js";
190
+ } from "./chunk-V3ZKNK5D.js";
191
191
  import {
192
192
  mergeAvailabilityDeadline,
193
193
  resolveAvailabilityAction,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  i18n_default,
3
3
  toolRegistry
4
- } from "./chunk-J2WQUFGG.js";
4
+ } from "./chunk-LNEAO4U2.js";
5
5
  import {
6
6
  canonicalizeToolNames
7
7
  } from "./chunk-O6OSWFZQ.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-P7OOB7QP.js";
4
+ } from "./chunk-Q4OT2DC7.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-FHAGENAS.js";
7
+ } from "./chunk-AUKZOZFG.js";
8
8
  import {
9
9
  deriveCredentialGroup,
10
10
  toSafeAgentSummary
11
- } from "./chunk-6X5B2VF5.js";
11
+ } from "./chunk-UFTOGLCE.js";
12
12
  import {
13
13
  PUBLIC_AGENT_KEY_PREFIX,
14
14
  isOwnedAgentKey,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  requireTokenUser
3
- } from "./chunk-UZPQSVM6.js";
3
+ } from "./chunk-B62OSA77.js";
4
4
  import {
5
5
  resolveServerUrl
6
6
  } from "./chunk-A7GB5UGH.js";
@@ -39,7 +39,7 @@ import {
39
39
  requiresBareImageUrl,
40
40
  resolveToolGuidedSections,
41
41
  toBareImageUrlMessages
42
- } from "./chunk-76JYRUX4.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";
@@ -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-YDNDUOB5.js";
3
+ } from "./chunk-RIDW26NK.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-6AAQCFLQ.js";
8
+ } from "./chunk-TWGLYE3V.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
@@ -29,7 +29,7 @@ import {
29
29
  toCompactAgentSummary,
30
30
  toSafeAgentSummary,
31
31
  toUnavailableAgentSummary
32
- } from "./chunk-6X5B2VF5.js";
32
+ } from "./chunk-UFTOGLCE.js";
33
33
  import {
34
34
  getUserDataItemTimestamp,
35
35
  mergeAndDedupUserData
@@ -81,14 +81,14 @@ import {
81
81
  } from "./chunk-VF4K2QE6.js";
82
82
  import {
83
83
  createDocState
84
- } from "./chunk-XCNSZUQA.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-4SCMOQRM.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-YDNDUOB5.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-6AAQCFLQ.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-UMIARYFE.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,7 +180,7 @@ 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";
@@ -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-CJNADK2R.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();
@@ -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-U4GOB2KS.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,
@@ -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-6ZFYOHQT.js");
29464
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-VA4ZDSQB.js");
29449
29465
  if (getDocState().pageKey === id) {
29450
29466
  applyExternalDocUpdate({
29451
29467
  slateData: finalSlateData,
@@ -5,14 +5,14 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-GVYMHBG3.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-XOPPOOTE.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-J2WQUFGG.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-6AAQCFLQ.js";
38
+ } from "./chunk-TWGLYE3V.js";
39
39
  import {
40
40
  streamAgentChatTurn
41
- } from "./chunk-UMIARYFE.js";
41
+ } from "./chunk-OXZDMKZW.js";
42
42
  import {
43
43
  addActiveController,
44
44
  removeActiveController,
@@ -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-UYF2UEIG.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-NYNYXB5C.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-EK4UVC2Y.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;
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  deleteDialog,
8
8
  toast
9
- } from "./chunk-6AAQCFLQ.js";
9
+ } from "./chunk-TWGLYE3V.js";
10
10
  import {
11
11
  require_date_fns
12
12
  } from "./chunk-M76ECQRD.js";