nolo-cli 0.16.0-alpha.12 → 0.16.0-alpha.13

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 (38) hide show
  1. package/{_executeModel-LGHYA5XS.js → _executeModel-Y43RS7DI.js} +10 -9
  2. package/{agentEmailCommands-KC2QCPQV.js → agentEmailCommands-AJFG5HBG.js} +10 -9
  3. package/{agentMachineCommands-P7S5WAVA.js → agentMachineCommands-2ACKQSTE.js} +1 -1
  4. package/{agentRecordCommands-JKZR2TZJ.js → agentRecordCommands-RQTFDKKJ.js} +10 -9
  5. package/{agentRunCommand-2ELKCBWR.js → agentRunCommand-FAHV33ML.js} +14 -10
  6. package/{agentRunControl-6ADXVYMR.js → agentRunControl-YVLQ4BW5.js} +24 -1
  7. package/{agentSlice-NXLMDKR7.js → agentSlice-XEQOAOC6.js} +1 -1
  8. package/{chunk-ZH62XNZE.js → chunk-6IZTYSJK.js} +641 -31
  9. package/{chunk-EQTZPEID.js → chunk-A3S7ITGN.js} +17 -40
  10. package/{chunk-HSASSW4L.js → chunk-BE3IKV5X.js} +5 -5
  11. package/{chunk-ZXQ52OY2.js → chunk-COIZN2AL.js} +3 -3
  12. package/{chunk-MYMMNKYL.js → chunk-E5CLOOG5.js} +153 -6
  13. package/{chunk-47QUPRHO.js → chunk-EPCM5E6C.js} +1 -1
  14. package/chunk-FKXFCYVO.js +221 -0
  15. package/{chunk-2WXMU64E.js → chunk-IQJOXIYF.js} +2 -2
  16. package/{chunk-4LXOVZ4W.js → chunk-KEPSRWXW.js} +8 -8
  17. package/{chunk-BXXECNBU.js → chunk-MDNZEE6B.js} +1 -1
  18. package/{chunk-22NGXGN3.js → chunk-N3IKEYV7.js} +1 -1
  19. package/{chunk-WBA6SIBB.js → chunk-PFAN32FJ.js} +1 -1
  20. package/{chunk-XEWUC53Z.js → chunk-QSJNZQFD.js} +4 -4
  21. package/{chunk-6CRACQXW.js → chunk-SPHXTAG6.js} +2 -2
  22. package/{chunk-D4NCEGGR.js → chunk-TSGUTKW2.js} +83 -233
  23. package/{createAgentAutomationAction-RKWIMKHW.js → createAgentAutomationAction-G5ZEEBMB.js} +2 -2
  24. package/{createDialogAction-VN7MEBS3.js → createDialogAction-3EJL6XK6.js} +3 -3
  25. package/{createPageAction-JBUWBHHC.js → createPageAction-FIUQXAI4.js} +2 -2
  26. package/{dialogSlice-NNYBU35K.js → dialogSlice-H24LGUPG.js} +2 -2
  27. package/{docStore-DR22GGF3.js → docStore-EFEUV2FP.js} +3 -3
  28. package/{handleSendMessageAction-FHITDM7H.js → handleSendMessageAction-PMKHJZGP.js} +2 -2
  29. package/index.js +20 -20
  30. package/{machineCommands-3B4IHHVK.js → machineCommands-U3N22344.js} +10 -9
  31. package/{machineWsRunDispatch-AXZ6OL3V.js → machineWsRunDispatch-BGYPVQPM.js} +10 -9
  32. package/package.json +1 -1
  33. package/{readlineWorkspace-DBZCXS7Y.js → readlineWorkspace-HWYYQ2KL.js} +18 -16
  34. package/{runAgentClientLoop-AB7PQ3TB.js → runAgentClientLoop-3NESZLYZ.js} +8 -7
  35. package/{spaceSlice-TEJDCU6A.js → spaceSlice-YBORJR2H.js} +2 -2
  36. package/{streamAgentChatTurn-NZ3HLAXS.js → streamAgentChatTurn-XAPKGQ6M.js} +10 -9
  37. package/{tools-M4USUF3R.js → tools-RXIDHJ2C.js} +6 -5
  38. package/{updateDialogTitleAction-SMPQVKWT.js → updateDialogTitleAction-S7AG3P44.js} +2 -2
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  deleteServerSyncedCredential,
17
17
  runLlm
18
- } from "./chunk-ZXQ52OY2.js";
18
+ } from "./chunk-COIZN2AL.js";
19
19
  import {
20
20
  cleanupCliSessionForDialog
21
21
  } from "./chunk-RPDGJO4D.js";
@@ -5529,7 +5529,7 @@ var messageSlice = createSliceWithThunks({
5529
5529
  runtimeOptions: args.runtimeOptions
5530
5530
  });
5531
5531
  if (agentKeyToUse) {
5532
- const { streamAgentChatTurn } = await import("./agentSlice-NXLMDKR7.js");
5532
+ const { streamAgentChatTurn } = await import("./agentSlice-XEQOAOC6.js");
5533
5533
  await dispatch(
5534
5534
  streamAgentChatTurn({
5535
5535
  agentKey: agentKeyToUse,
@@ -8249,7 +8249,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
8249
8249
  }
8250
8250
  if (isCurrentDialog) {
8251
8251
  await thunkApi.dispatch(resetMsgs());
8252
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-NNYBU35K.js");
8252
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-H24LGUPG.js");
8253
8253
  dispatch(clearPendingAttachments2());
8254
8254
  clearWorkflow();
8255
8255
  }
@@ -8258,15 +8258,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
8258
8258
 
8259
8259
  // packages/chat/dialog/dialogSlice.ts
8260
8260
  var runCreateDialogAction = async (args, thunkApi) => {
8261
- const { createDialogAction } = await import("./createDialogAction-VN7MEBS3.js");
8261
+ const { createDialogAction } = await import("./createDialogAction-3EJL6XK6.js");
8262
8262
  return createDialogAction(args, thunkApi);
8263
8263
  };
8264
8264
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
8265
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-RKWIMKHW.js");
8265
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-G5ZEEBMB.js");
8266
8266
  return createAgentAutomationAction(args, thunkApi);
8267
8267
  };
8268
8268
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
8269
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-SMPQVKWT.js");
8269
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-S7AG3P44.js");
8270
8270
  return updateDialogTitleAction(args, thunkApi);
8271
8271
  };
8272
8272
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -8286,7 +8286,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
8286
8286
  return setDialogExtraReferencesAction(args, thunkApi);
8287
8287
  };
8288
8288
  var runHandleSendMessageAction = async (args, thunkApi) => {
8289
- const { handleSendMessageAction } = await import("./handleSendMessageAction-FHITDM7H.js");
8289
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-PMKHJZGP.js");
8290
8290
  return handleSendMessageAction(args, thunkApi);
8291
8291
  };
8292
8292
  function clearDialogState() {
@@ -8299,7 +8299,7 @@ var createPageAndAddReference = createAsyncThunk(
8299
8299
  async (payload, { dispatch, getState, rejectWithValue }) => {
8300
8300
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
8301
8301
  try {
8302
- const { createDocState } = await import("./docStore-DR22GGF3.js");
8302
+ const { createDocState } = await import("./docStore-EFEUV2FP.js");
8303
8303
  const pageKey = await createDocState(
8304
8304
  { slateData, title },
8305
8305
  { dispatch, getState }
@@ -3,7 +3,7 @@ import {
3
3
  prepareAndPersistMessage,
4
4
  uiAskChoiceFunc,
5
5
  uiAskChoiceFunctionSchema
6
- } from "./chunk-4LXOVZ4W.js";
6
+ } from "./chunk-KEPSRWXW.js";
7
7
  import {
8
8
  require_date_fns
9
9
  } from "./chunk-M76ECQRD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-ZH62XNZE.js";
3
+ } from "./chunk-6IZTYSJK.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-W4NVOSFF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-XEWUC53Z.js";
4
+ } from "./chunk-QSJNZQFD.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -6,7 +6,7 @@ import {
6
6
  clipMultilineText,
7
7
  fetchAndSerializeTable,
8
8
  waitForAbortableDelay
9
- } from "./chunk-D4NCEGGR.js";
9
+ } from "./chunk-TSGUTKW2.js";
10
10
  import {
11
11
  createDrainExhaustedResponse,
12
12
  isCoreDrainingBody,
@@ -26,10 +26,10 @@ import {
26
26
  import {
27
27
  fetchAndCacheMessages,
28
28
  shouldUseServerProxy
29
- } from "./chunk-4LXOVZ4W.js";
29
+ } from "./chunk-KEPSRWXW.js";
30
30
  import {
31
31
  fetchServerSyncedCredential
32
- } from "./chunk-ZXQ52OY2.js";
32
+ } from "./chunk-COIZN2AL.js";
33
33
  import {
34
34
  buildCurrentTimeBlock,
35
35
  buildIdentityBlock,
@@ -1499,7 +1499,7 @@ var generateRequestBody = ({
1499
1499
  // packages/ai/chat/serverProxyRetry.ts
1500
1500
  var DEFAULT_SERVER_PROXY_RETRY_AFTER_MS = 1500;
1501
1501
  var MAX_SERVER_PROXY_RETRIES = 2;
1502
- var MAX_STATUS_RETRIES = 1;
1502
+ var MAX_STATUS_RETRIES = 3;
1503
1503
  var MAX_SERVER_DRAIN_STATUS_RETRIES = 30;
1504
1504
  var readRetryableResponseBody = async (response) => {
1505
1505
  try {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-4LXOVZ4W.js";
3
+ } from "./chunk-KEPSRWXW.js";
4
4
  import {
5
5
  require_date_fns
6
6
  } from "./chunk-M76ECQRD.js";
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
367
367
  }
368
368
  }
369
369
  async function createDocState(args, thunkApi) {
370
- const { createPageAction } = await import("./createPageAction-JBUWBHHC.js");
370
+ const { createPageAction } = await import("./createPageAction-FIUQXAI4.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-KQHGZWSV.js";
16
16
  import {
17
17
  createDocState
18
- } from "./chunk-6CRACQXW.js";
18
+ } from "./chunk-SPHXTAG6.js";
19
19
  import {
20
20
  readDocFunc,
21
21
  readDocFunctionSchema,
@@ -37,7 +37,7 @@ import {
37
37
  } from "./chunk-VF4K2QE6.js";
38
38
  import {
39
39
  createDialogAction
40
- } from "./chunk-BXXECNBU.js";
40
+ } from "./chunk-MDNZEE6B.js";
41
41
  import {
42
42
  buildSkillDocMarkdown,
43
43
  normalizeSkillBudgetTier,
@@ -76,13 +76,13 @@ import {
76
76
  updateContentCategory,
77
77
  updateContentTitle,
78
78
  updateStep
79
- } from "./chunk-4LXOVZ4W.js";
79
+ } from "./chunk-KEPSRWXW.js";
80
80
  import {
81
81
  createAgent,
82
82
  runLlm,
83
83
  streamAgentChatTurn,
84
84
  updateAgent
85
- } from "./chunk-ZXQ52OY2.js";
85
+ } from "./chunk-COIZN2AL.js";
86
86
  import {
87
87
  NOLO_WORKSPACE_TOOL_NAMES,
88
88
  buildNoloSubjectRefQueryTarget,
@@ -125,6 +125,14 @@ import {
125
125
  import {
126
126
  compactWhitespace
127
127
  } from "./chunk-DWLEOOGR.js";
128
+ import {
129
+ TASK_PREVIEW_MAX,
130
+ formatListRunsCard,
131
+ formatStartRunCard,
132
+ formatStatusRunCard,
133
+ formatStopRunCard,
134
+ resolveRunLabel
135
+ } from "./chunk-FKXFCYVO.js";
128
136
  import {
129
137
  toErrorMessage
130
138
  } from "./chunk-HNMXYYJR.js";
@@ -14158,7 +14166,7 @@ async function deleteDialogsFunc(args, thunkApi) {
14158
14166
  const deletedDialogIds = [];
14159
14167
  const deletedDialogKeys = [];
14160
14168
  const failures = [];
14161
- const { deleteDialog } = await import("./dialogSlice-NNYBU35K.js");
14169
+ const { deleteDialog } = await import("./dialogSlice-H24LGUPG.js");
14162
14170
  for (const target of targets) {
14163
14171
  try {
14164
14172
  await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
@@ -21919,205 +21927,6 @@ async function runLlmToolFunc(args, thunkApi, _context) {
21919
21927
  }
21920
21928
  }
21921
21929
 
21922
- // packages/ai/tools/agent/agentRunDisplayHelpers.ts
21923
- function getAgentRunStatusIcon(status) {
21924
- switch (status) {
21925
- case "running":
21926
- case "pending":
21927
- return "\u23F3";
21928
- case "done":
21929
- return "\u2713";
21930
- case "failed":
21931
- case "timeout":
21932
- return "\u2717";
21933
- case "killed":
21934
- case "cancelled":
21935
- case "cancelling":
21936
- return "\u{1F6D1}";
21937
- case "not_found":
21938
- default:
21939
- return "?";
21940
- }
21941
- }
21942
- var DEFAULT_LABELS = {
21943
- runStatus: "Run status",
21944
- runStarted: "Run started",
21945
- runStopped: "Run stopped",
21946
- runFinished: "Run finished",
21947
- logTail: "Log tail:",
21948
- runs: (count) => `Runs (${count})`
21949
- };
21950
- function resolveLabels(labels) {
21951
- return {
21952
- runStatus: labels?.runStatus ?? DEFAULT_LABELS.runStatus,
21953
- runStarted: labels?.runStarted ?? DEFAULT_LABELS.runStarted,
21954
- runStopped: labels?.runStopped ?? DEFAULT_LABELS.runStopped,
21955
- runFinished: labels?.runFinished ?? DEFAULT_LABELS.runFinished,
21956
- logTail: labels?.logTail ?? DEFAULT_LABELS.logTail,
21957
- runs: labels?.runs ?? DEFAULT_LABELS.runs
21958
- };
21959
- }
21960
- function shortRunId(runId) {
21961
- const trimmed = typeof runId === "string" ? runId.trim() : "";
21962
- if (!trimmed) return "";
21963
- const segments = trimmed.split("-").filter(Boolean);
21964
- let pick = segments[segments.length - 1] ?? trimmed;
21965
- if (pick.length < 4 && segments.length >= 2) pick = segments.slice(-2).join("-");
21966
- if (!pick) pick = trimmed;
21967
- return pick.length > 8 ? pick.slice(-8) : pick;
21968
- }
21969
- function clipText(text, max) {
21970
- const collapsed = text.replace(/\s+/g, " ").trim();
21971
- return collapsed.length > max ? `${collapsed.slice(0, max - 1)}\u2026` : collapsed;
21972
- }
21973
- function formatDuration(ms) {
21974
- const totalSec = Math.max(0, Math.floor(ms / 1e3));
21975
- if (totalSec < 60) return `${totalSec}s`;
21976
- const totalMin = Math.floor(totalSec / 60);
21977
- if (totalMin < 60) return `${totalMin}m${String(totalSec % 60).padStart(2, "0")}s`;
21978
- return `${Math.floor(totalMin / 60)}h${String(totalMin % 60).padStart(2, "0")}m`;
21979
- }
21980
- function formatRunAge(timing, now = Date.now()) {
21981
- const startedAt = timing?.startedAt;
21982
- if (typeof startedAt !== "number" || !Number.isFinite(startedAt) || startedAt <= 0) {
21983
- return "";
21984
- }
21985
- const end = typeof timing?.finishedAt === "number" && Number.isFinite(timing.finishedAt) && timing.finishedAt > 0 ? timing.finishedAt : now;
21986
- return formatDuration(end - startedAt);
21987
- }
21988
- function formatIdentityRow(agentName, runId) {
21989
- const parts = [];
21990
- if (!isAgentNameFallback(agentName)) parts.push(agentName);
21991
- const short = shortRunId(runId);
21992
- if (short) parts.push(`#${short}`);
21993
- return parts.join(" ");
21994
- }
21995
- function isAgentNameFallback(agentName) {
21996
- const trimmed = typeof agentName === "string" ? agentName.trim() : "";
21997
- return !trimmed || trimmed === "agent";
21998
- }
21999
- function resolveRunLabel(run) {
22000
- for (const candidate of [run.agentName, run.name, run.agentKey, run.runId]) {
22001
- if (typeof candidate === "string" && !isAgentNameFallback(candidate)) {
22002
- return candidate.trim();
22003
- }
22004
- }
22005
- return "agent";
22006
- }
22007
- function formatStartRunCard(agentName, status = "running", opts) {
22008
- const L = resolveLabels(opts?.labels);
22009
- const icon = getAgentRunStatusIcon(status);
22010
- const lines = [L.runStarted];
22011
- const identity = formatIdentityRow(agentName, opts?.runId);
22012
- if (identity) {
22013
- lines.push(` agent ${identity}`);
22014
- }
22015
- lines.push(` status ${icon} ${status}`);
22016
- const task = opts?.task?.trim();
22017
- if (task) {
22018
- lines.push(` task ${clipText(task, TASK_PREVIEW_MAX)}`);
22019
- }
22020
- return lines.join("\n");
22021
- }
22022
- var TASK_PREVIEW_MAX = 72;
22023
- var NOTE_PREVIEW_MAX = 72;
22024
- function formatProgressRow(toolCallCount, lastToolNames) {
22025
- const parts = [];
22026
- if (typeof toolCallCount === "number" && Number.isFinite(toolCallCount)) {
22027
- parts.push(`${toolCallCount} tools`);
22028
- }
22029
- if (lastToolNames && lastToolNames.length > 0) {
22030
- parts.push(lastToolNames.join(", "));
22031
- }
22032
- return parts.join(" \xB7 ");
22033
- }
22034
- function formatStatusRunCard(agentName, status = "running", opts) {
22035
- const L = resolveLabels(opts?.labels);
22036
- const icon = getAgentRunStatusIcon(status);
22037
- const age = formatRunAge(opts?.timing, opts?.now);
22038
- const lines = [L.runStatus, ` ${icon} ${status}${age ? ` ${age}` : ""}`];
22039
- const identity = formatIdentityRow(agentName, opts?.runId);
22040
- if (identity) {
22041
- lines.push(` agent ${identity}`);
22042
- }
22043
- const progress = formatProgressRow(opts?.toolCallCount, opts?.lastToolNames);
22044
- if (progress) {
22045
- lines.push(` tools ${progress}`);
22046
- }
22047
- const note = opts?.lastAssistantText?.trim();
22048
- if (note) {
22049
- lines.push(` note ${clipText(note, NOTE_PREVIEW_MAX)}`);
22050
- }
22051
- if (opts?.errorMessage?.trim()) {
22052
- lines.push(` error ${opts.errorMessage.trim()}`);
22053
- }
22054
- if (shouldShowLogTail(status, opts?.includeLogTail, opts?.logLines)) {
22055
- lines.push("", L.logTail, ...opts.logLines.map((l) => ` ${l}`));
22056
- }
22057
- return lines.join("\n");
22058
- }
22059
- function runShowsLogTail(status) {
22060
- return status === "failed" || status === "timeout";
22061
- }
22062
- function shouldShowLogTail(status, includeLogTail, logLines) {
22063
- if (includeLogTail === false) return false;
22064
- if (!logLines || logLines.length === 0) return false;
22065
- return runShowsLogTail(status);
22066
- }
22067
- function formatFinishedRunCard(agentName, status, opts) {
22068
- const L = resolveLabels(opts?.labels);
22069
- const icon = getAgentRunStatusIcon(status);
22070
- const age = formatRunAge(opts?.timing, opts?.now);
22071
- const summary = [status, age, formatProgressRow(opts?.toolCallCount, opts?.lastToolNames)].filter(Boolean).join(" \xB7 ");
22072
- const lines = [L.runFinished, ` ${icon} ${summary}`];
22073
- const identity = formatIdentityRow(agentName, opts?.runId);
22074
- if (identity) {
22075
- lines.push(` agent ${identity}`);
22076
- }
22077
- const note = opts?.lastAssistantText?.trim();
22078
- if (note) {
22079
- lines.push(` note ${clipText(note, NOTE_PREVIEW_MAX)}`);
22080
- }
22081
- if (opts?.errorMessage?.trim()) {
22082
- lines.push(` error ${opts.errorMessage.trim()}`);
22083
- }
22084
- if (shouldShowLogTail(status, opts?.includeLogTail, opts?.logLines)) {
22085
- lines.push("", L.logTail, ...opts.logLines.map((l) => ` ${l}`));
22086
- }
22087
- return lines.join("\n");
22088
- }
22089
- function formatStopRunCard(status = "killed", labels) {
22090
- const L = resolveLabels(labels);
22091
- const icon = getAgentRunStatusIcon(status);
22092
- return `${L.runStopped}
22093
- ${icon} ${status}`;
22094
- }
22095
- function formatListRunsCard(runs, labels) {
22096
- const L = resolveLabels(labels);
22097
- const lines = [L.runs(runs.length)];
22098
- for (const run of runs) {
22099
- const status = run.status ?? "\u2014";
22100
- const icon = getAgentRunStatusIcon(status);
22101
- lines.push(` ${icon} ${resolveRunLabel(run)}`);
22102
- }
22103
- return lines.join("\n");
22104
- }
22105
- function formatNotFoundRunCard(labels) {
22106
- const L = resolveLabels(labels);
22107
- return `${L.runStatus}
22108
- ? not_found`;
22109
- }
22110
- var AGENT_RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
22111
- "done",
22112
- "failed",
22113
- "timeout",
22114
- "killed",
22115
- "cancelled"
22116
- ]);
22117
- function isAgentRunTerminalStatus(status) {
22118
- return typeof status === "string" && AGENT_RUN_TERMINAL_STATUSES.has(status);
22119
- }
22120
-
22121
21930
  // packages/ai/tools/agent/startAgentRunTool.ts
22122
21931
  var startAgentRunFunctionSchema = {
22123
21932
  name: "startAgentRun",
@@ -22143,14 +21952,23 @@ var startAgentRunFunctionSchema = {
22143
21952
  ephemeral: {
22144
21953
  type: "boolean",
22145
21954
  description: "\u53EF\u9009\u3002\u4E3A true \u65F6\u672C\u6B21 run \u4E0D\u6301\u4E45\u5316 dialog\uFF08\u4E0D\u7559\u8BB0\u5F55\uFF09\u3002\u7528\u4E8E\u4E00\u6B21\u6027\u5BA1\u67E5\uFF08review\uFF09\u7B49\u4E0D\u9700\u7559\u75D5\u7684\u573A\u666F\u3002\u9ED8\u8BA4 false\u3002"
21955
+ },
21956
+ batchId: {
21957
+ type: "string",
21958
+ description: "\u53EF\u9009\u3002\u6279\u6B21 id\uFF0C\u7528\u4E8E\u628A\u591A\u4E2A\u5E76\u884C run \u5F52\u4E3A\u4E00\u7EC4\uFF0C\u4FBF\u4E8E\u540E\u7EED controlAgentRun(list, batchId=...) \u6309\u6279\u67E5\u8BE2\u3002\u672A\u4F20\u65F6\u81EA\u52A8\u751F\u6210\u4E00\u4E2A\u5E76\u5728\u8FD4\u56DE\u503C\u4E2D\u5E26\u56DE\uFF0C\u8C03\u7528\u65B9\u65E0\u9700\u5148\u521B\u5EFA\u3002"
21959
+ },
21960
+ trackTodo: {
21961
+ type: "boolean",
21962
+ description: '\u53EF\u9009\u3002\u4E3A true \u65F6\u672C\u6B21 run \u4F1A\u88AB\u8BB0\u5F55\u8FDB runtime todo\uFF08~/.nolo/todos.json\uFF09\u3002\u4F20\u4E86 batchId \u65F6\u9ED8\u8BA4\u5373\u8BB0\u5F55\uFF08\u6BCF\u6279\u5BF9\u5E94\u4E00\u9879 todo\uFF09\u3002todo \u72B6\u6001\u7531\u5173\u8054 run \u72B6\u6001 + review \u7ED3\u8BBA\u63A8\u5BFC\uFF0C\u7528 controlAgentRun(action:"todo") \u67E5\u8BE2\u3002'
22146
21963
  }
22147
21964
  },
22148
21965
  required: ["agentKey", "task"]
22149
21966
  }
22150
21967
  };
22151
21968
  async function startAgentRunFunc(args, thunkApi, _context) {
22152
- const { agentKey, task, input, agentName, ephemeral } = args;
21969
+ const { agentKey, task, input, agentName, ephemeral, batchId } = args;
22153
21970
  const { dispatch } = thunkApi;
21971
+ const effectiveBatchId = typeof batchId === "string" && batchId.trim() ? batchId.trim() : `batch-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
22154
21972
  if (!agentKey) {
22155
21973
  throw new Error("startAgentRun: \u7F3A\u5C11 agentKey \u53C2\u6570\u3002");
22156
21974
  }
@@ -22180,6 +21998,11 @@ async function startAgentRunFunc(args, thunkApi, _context) {
22180
21998
  runId,
22181
21999
  status,
22182
22000
  agentKey,
22001
+ // batchId is always returned — minted above when the caller didn't
22002
+ // supply one — so controlAgentRun(list, batchId=...) works on every
22003
+ // host. On the server path the id lives in the tool return; on the
22004
+ // CLI local path it is also persisted on the run record.
22005
+ batchId: effectiveBatchId,
22183
22006
  ...resolvedName ? { agentName: resolvedName } : {},
22184
22007
  ...taskPreview ? { taskPreview } : {}
22185
22008
  },
@@ -22196,14 +22019,14 @@ async function startAgentRunFunc(args, thunkApi, _context) {
22196
22019
  // packages/ai/tools/agent/controlAgentRunTool.ts
22197
22020
  var controlAgentRunFunctionSchema = {
22198
22021
  name: "controlAgentRun",
22199
- description: "\u89C2\u5BDF\u548C\u63A7\u5236\u540E\u53F0 agent run\u3002\u4E00\u4E2A\u5DE5\u5177\u4E09\u4E2A action\uFF1Alist\uFF08\u5217\u51FA\u6240\u6709 run\uFF09\u3001status\uFF08\u67E5\u5355\u6761 + \u53EF\u9009\u65E5\u5FD7\uFF09\u3001stop\uFF08\u53D6\u6D88 run\uFF09\u3002\u76F8\u5F53\u4E8E Unix \u7684 wait + signal + /proc\u3002\u7528 startAgentRun \u62FF\u5230 runId \u540E\uFF0C\u7528\u672C\u5DE5\u5177\u8DDF\u8FDB\u5EA6\u6216\u53EB\u505C\u3002",
22022
+ description: "\u89C2\u5BDF\u548C\u63A7\u5236\u540E\u53F0 agent run\u3002\u4E00\u4E2A\u5DE5\u5177\u4E09\u4E2A action\uFF1Alist\uFF08\u5217\u51FA run\uFF0C\u652F\u6301\u6309\u6279\u6B21/\u72B6\u6001\u8FC7\u6EE4\u4E0E\u5206\u9875\uFF09\u3001status\uFF08\u67E5\u5355\u6761 + \u53EF\u9009\u65E5\u5FD7\uFF09\u3001stop\uFF08\u53D6\u6D88 run\uFF09\u3002\u76F8\u5F53\u4E8E Unix \u7684 wait + signal + /proc\u3002\u7528 startAgentRun \u62FF\u5230 runId \u540E\uFF0C\u7528\u672C\u5DE5\u5177\u8DDF\u8FDB\u5EA6\u6216\u53EB\u505C\u3002list \u9ED8\u8BA4\u53EA\u8FD4\u56DE\u6700\u8FD1 20 \u6761\uFF0C\u907F\u514D\u5168\u91CF\u51B2\u7206\u4E0A\u4E0B\u6587\uFF1B\u7528 status/batchId/limit/offset \u53D6\u6240\u9700\u5206\u9875\u3002",
22200
22023
  parameters: {
22201
22024
  type: "object",
22202
22025
  properties: {
22203
22026
  action: {
22204
22027
  type: "string",
22205
- enum: ["list", "status", "stop"],
22206
- description: "\u8981\u6267\u884C\u7684\u64CD\u4F5C\uFF1Alist=\u5217\u51FA\u6240\u6709 run\uFF08\u7701\u7565 runId\uFF09\uFF1Bstatus=\u67E5\u5355\u6761 run \u72B6\u6001 + \u53EF\u9009\u65E5\u5FD7\uFF1Bstop=\u53D6\u6D88 run\u3002"
22028
+ enum: ["list", "status", "stop", "todo"],
22029
+ description: "\u8981\u6267\u884C\u7684\u64CD\u4F5C\uFF1Alist=\u5217\u51FA run\uFF08\u7701\u7565 runId\uFF09\uFF1Bstatus=\u67E5\u5355\u6761 run \u72B6\u6001 + \u53EF\u9009\u65E5\u5FD7\uFF1Bstop=\u53D6\u6D88 run\uFF1Btodo=\u5217\u51FA runtime todo\uFF08\u7531 startAgentRun \u7684 batchId/trackTodo \u4EA7\u751F\uFF0C\u72B6\u6001\u7531\u5173\u8054 run \u63A8\u5BFC\uFF09\u3002"
22207
22030
  },
22208
22031
  runId: {
22209
22032
  type: "string",
@@ -22214,23 +22037,38 @@ var controlAgentRunFunctionSchema = {
22214
22037
  description: "\u53EF\u9009\u3002action=status \u65F6\uFF1A0=\u53EA\u8FD4\u56DE\u72B6\u6001\u6458\u8981\uFF0C>0=\u540C\u65F6\u8FD4\u56DE\u6700\u8FD1 N \u884C\u65E5\u5FD7\uFF08\u9ED8\u8BA4 0\uFF09\u3002",
22215
22038
  default: 0
22216
22039
  },
22040
+ batchId: {
22041
+ type: "string",
22042
+ description: "\u53EF\u9009\u3002action=list \u65F6\u53EA\u8FD4\u56DE\u8BE5\u6279\u6B21\u7684 run\uFF08startAgentRun \u8FD4\u56DE\u503C\u6216\u5165\u53C2\u4E2D\u7684 batchId\uFF09\u3002"
22043
+ },
22044
+ status: {
22045
+ type: "string",
22046
+ description: "\u53EF\u9009\u3002action=list \u65F6\u6309\u72B6\u6001\u8FC7\u6EE4\uFF0C\u652F\u6301\u5355\u503C\u6216\u9017\u53F7\u5206\u9694\u591A\u503C\uFF08\u5982 'running,orphaned'\uFF09\u3002\u4E0E statusFilter \u540C\u4E49\uFF0Cstatus \u4F18\u5148\uFF1B\u53D6\u503C\u5305\u542B orphaned\uFF08pid \u5DF2\u6B7B\u4F46\u8BB0\u5F55\u4ECD running \u7684\u5B64\u513F run\uFF09\u3002\u9ED8\u8BA4 all\uFF08\u4E0D\u8FC7\u6EE4\uFF09\u3002"
22047
+ },
22217
22048
  statusFilter: {
22218
22049
  type: "string",
22219
- enum: ["running", "done", "failed", "cancelled", "all"],
22220
- description: "\u53EF\u9009\u3002action=list \u65F6\u6309\u72B6\u6001\u8FC7\u6EE4\uFF0C\u9ED8\u8BA4 all\u3002"
22050
+ enum: ["running", "done", "failed", "cancelled", "orphaned", "all"],
22051
+ description: "\u53EF\u9009\u3002action=list \u65F6\u6309\u72B6\u6001\u8FC7\u6EE4\uFF0C\u9ED8\u8BA4 all\u3002\u4E0E status \u540C\u4E49\uFF08status \u4F18\u5148\uFF0C\u4E14 status \u652F\u6301\u591A\u503C\uFF09\u3002"
22221
22052
  },
22222
22053
  limit: {
22223
22054
  type: "number",
22224
- description: "\u53EF\u9009\u3002action=list \u65F6\u9650\u5236\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 20\u3002"
22055
+ description: "\u53EF\u9009\u3002action=list \u65F6\u9650\u5236\u8FD4\u56DE\u6570\u91CF\uFF0C\u9ED8\u8BA4 20\uFF0C\u4E0A\u9650 200\u3002\u4E0D\u5E26\u4EFB\u4F55\u53C2\u6570\u4E0D\u4F1A\u8FD4\u56DE\u5168\u91CF\u3002"
22056
+ },
22057
+ offset: {
22058
+ type: "number",
22059
+ description: "\u53EF\u9009\u3002action=list \u65F6\u8DF3\u8FC7\u524D N \u6761\uFF0C\u914D\u5408 limit \u7FFB\u9875\u3002\u9ED8\u8BA4 0\u3002"
22225
22060
  }
22226
22061
  },
22227
22062
  required: ["action"]
22228
22063
  }
22229
22064
  };
22230
22065
  async function controlAgentRunFunc(args, thunkApi, _context) {
22231
- const { action, runId, tailLines, statusFilter, limit } = args;
22066
+ const { action, runId, tailLines, batchId, status, statusFilter, limit, offset } = args;
22232
22067
  if (action === "list") {
22233
- return handleList(thunkApi, { statusFilter, limit });
22068
+ return handleList(thunkApi, { batchId, status, statusFilter, limit, offset });
22069
+ }
22070
+ if (action === "todo") {
22071
+ return handleTodo(thunkApi, { status });
22234
22072
  }
22235
22073
  if (action === "status") {
22236
22074
  if (!runId) throw new Error('controlAgentRun(action:"status"): \u7F3A\u5C11 runId\u3002');
@@ -22245,8 +22083,11 @@ async function controlAgentRunFunc(args, thunkApi, _context) {
22245
22083
  async function handleList(thunkApi, opts) {
22246
22084
  try {
22247
22085
  const body = { action: "list" };
22248
- if (opts.statusFilter) body.statusFilter = opts.statusFilter;
22086
+ const statusVal = opts.status ?? opts.statusFilter;
22087
+ if (statusVal) body.statusFilter = statusVal;
22088
+ if (opts.batchId) body.batchId = opts.batchId;
22249
22089
  if (opts.limit !== void 0) body.limit = opts.limit;
22090
+ if (opts.offset !== void 0) body.offset = opts.offset;
22250
22091
  const data = await callToolApi(
22251
22092
  thunkApi,
22252
22093
  "/api/agent/runs/control",
@@ -22255,9 +22096,10 @@ async function handleList(thunkApi, opts) {
22255
22096
  );
22256
22097
  const resData = data?.data ?? data;
22257
22098
  const runs = resData?.runs ?? [];
22258
- const count = resData?.count ?? runs.length;
22099
+ const total = typeof resData?.total === "number" ? resData.total : runs.length;
22100
+ const hasMore = typeof resData?.hasMore === "boolean" ? resData.hasMore : false;
22259
22101
  return {
22260
- rawData: { runs, count },
22102
+ rawData: { runs, count: runs.length, total, hasMore },
22261
22103
  displayData: formatListRunsCard(runs)
22262
22104
  };
22263
22105
  } catch (e) {
@@ -22317,6 +22159,28 @@ async function handleStop(thunkApi, opts) {
22317
22159
  throw new Error(`controlAgentRun(stop) \u5931\u8D25: ${toErrorMessage(e)}`);
22318
22160
  }
22319
22161
  }
22162
+ async function handleTodo(thunkApi, opts) {
22163
+ try {
22164
+ const body = { action: "todo" };
22165
+ if (opts.status) body.status = opts.status;
22166
+ const data = await callToolApi(
22167
+ thunkApi,
22168
+ "/api/agent/runs/control",
22169
+ body,
22170
+ { withAuth: true }
22171
+ );
22172
+ const resData = data?.data ?? data;
22173
+ const todos = resData?.todos ?? [];
22174
+ return {
22175
+ rawData: { todos, count: todos.length },
22176
+ displayData: formatListRunsCard(
22177
+ todos.map((t) => ({ agentName: t?.title ?? t?.id, status: t?.status }))
22178
+ )
22179
+ };
22180
+ } catch (e) {
22181
+ throw new Error(`controlAgentRun(todo) \u5931\u8D25: ${toErrorMessage(e)}`);
22182
+ }
22183
+ }
22320
22184
 
22321
22185
  // packages/ai/tools/agent/agentTools.ts
22322
22186
  var agentToolDefinitions = [
@@ -23510,7 +23374,7 @@ var executeToolRun = createAsyncThunk(
23510
23374
  if (!executionInput) {
23511
23375
  throw new Error(`ToolRun ${id} has no input to execute with.`);
23512
23376
  }
23513
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-M4USUF3R.js");
23377
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-RXIDHJ2C.js");
23514
23378
  const { executor } = findToolExecutor2(run.toolName);
23515
23379
  toolRunStarted({
23516
23380
  id: run.id,
@@ -23534,7 +23398,7 @@ var executeToolRun = createAsyncThunk(
23534
23398
  const latestState = thunkApi.getState();
23535
23399
  const userId = latestState.auth?.currentUser?.userId;
23536
23400
  if (userId) {
23537
- const { fetchUserSpaceMemberships } = await import("./spaceSlice-TEJDCU6A.js");
23401
+ const { fetchUserSpaceMemberships } = await import("./spaceSlice-YBORJR2H.js");
23538
23402
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
23539
23403
  }
23540
23404
  }
@@ -26017,7 +25881,7 @@ async function updateDocFunc(args, thunkApi) {
26017
25881
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
26018
25882
  };
26019
25883
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
26020
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-DR22GGF3.js");
25884
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-EFEUV2FP.js");
26021
25885
  if (getDocState().pageKey === id) {
26022
25886
  applyExternalDocUpdate({
26023
25887
  slateData: finalSlateData,
@@ -28283,20 +28147,6 @@ export {
28283
28147
  readXPostFunc,
28284
28148
  readXhsProfileFunctionSchema,
28285
28149
  readXhsProfileFunc,
28286
- getAgentRunStatusIcon,
28287
- shortRunId,
28288
- formatRunAge,
28289
- isAgentNameFallback,
28290
- resolveRunLabel,
28291
- formatStartRunCard,
28292
- TASK_PREVIEW_MAX,
28293
- formatStatusRunCard,
28294
- runShowsLogTail,
28295
- formatFinishedRunCard,
28296
- formatStopRunCard,
28297
- formatListRunsCard,
28298
- formatNotFoundRunCard,
28299
- isAgentRunTerminalStatus,
28300
28150
  TOOL_PACKS,
28301
28151
  resolveEffectiveEnabledPacks,
28302
28152
  addDefaultSystemCapabilityTools,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-4LXOVZ4W.js";
3
+ } from "./chunk-KEPSRWXW.js";
4
4
  import "./chunk-XOIF2TNF.js";
5
5
  import "./chunk-MRC4Q34M.js";
6
6
  import "./chunk-MTU75CZ2.js";
7
7
  import "./chunk-CWMSB67P.js";
8
- import "./chunk-ZXQ52OY2.js";
8
+ import "./chunk-COIZN2AL.js";
9
9
  import "./chunk-RPDGJO4D.js";
10
10
  import "./chunk-SOTZ6RDN.js";
11
11
  import "./chunk-Z4NR32XR.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createDialogAction,
3
3
  isLocalOwnerDialogAgents
4
- } from "./chunk-BXXECNBU.js";
4
+ } from "./chunk-MDNZEE6B.js";
5
5
  import "./chunk-VC6OZXO5.js";
6
- import "./chunk-4LXOVZ4W.js";
6
+ import "./chunk-KEPSRWXW.js";
7
7
  import "./chunk-XOIF2TNF.js";
8
8
  import "./chunk-MRC4Q34M.js";
9
9
  import "./chunk-MTU75CZ2.js";
10
10
  import "./chunk-CWMSB67P.js";
11
- import "./chunk-ZXQ52OY2.js";
11
+ import "./chunk-COIZN2AL.js";
12
12
  import "./chunk-RPDGJO4D.js";
13
13
  import "./chunk-SOTZ6RDN.js";
14
14
  import "./chunk-Z4NR32XR.js";
@@ -18,12 +18,12 @@ import {
18
18
  addContentToSpace,
19
19
  client_default,
20
20
  selectCurrentSpaceId
21
- } from "./chunk-4LXOVZ4W.js";
21
+ } from "./chunk-KEPSRWXW.js";
22
22
  import "./chunk-XOIF2TNF.js";
23
23
  import "./chunk-MRC4Q34M.js";
24
24
  import "./chunk-MTU75CZ2.js";
25
25
  import "./chunk-CWMSB67P.js";
26
- import "./chunk-ZXQ52OY2.js";
26
+ import "./chunk-COIZN2AL.js";
27
27
  import "./chunk-RPDGJO4D.js";
28
28
  import "./chunk-SOTZ6RDN.js";
29
29
  import "./chunk-Z4NR32XR.js";
@@ -19,12 +19,12 @@ import {
19
19
  setPrimaryDialogAgent,
20
20
  updateDialogTitle,
21
21
  updateTokens
22
- } from "./chunk-4LXOVZ4W.js";
22
+ } from "./chunk-KEPSRWXW.js";
23
23
  import "./chunk-XOIF2TNF.js";
24
24
  import "./chunk-MRC4Q34M.js";
25
25
  import "./chunk-MTU75CZ2.js";
26
26
  import "./chunk-CWMSB67P.js";
27
- import "./chunk-ZXQ52OY2.js";
27
+ import "./chunk-COIZN2AL.js";
28
28
  import "./chunk-RPDGJO4D.js";
29
29
  import "./chunk-SOTZ6RDN.js";
30
30
  import "./chunk-Z4NR32XR.js";