nolo-cli 0.170.0 → 0.171.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/{_executeModel-7J6IIHWQ.js → _executeModel-YJW2HPFY.js} +29 -29
  2. package/{agentDeleteCommand-4RAEG26P.js → agentDeleteCommand-O3EG3HS4.js} +37 -37
  3. package/{agentEmailCommands-MS6MACO5.js → agentEmailCommands-AIWZNMRW.js} +41 -41
  4. package/{agentListCommands-4BBFWXHX.js → agentListCommands-377PQ6K4.js} +25 -25
  5. package/{agentMachineCommands-4OQUFTD2.js → agentMachineCommands-TYL7KKSL.js} +21 -21
  6. package/{agentProviderCommands-4USYTCL3.js → agentProviderCommands-TWVILNAN.js} +2 -2
  7. package/{agentRecordCommands-YNLE7IBY.js → agentRecordCommands-YPRND72K.js} +37 -37
  8. package/{agentRunCommand-76DUQVWC.js → agentRunCommand-T7AQKKH5.js} +38 -38
  9. package/{agentRunControl-QBONJVI4.js → agentRunControl-SBHIICUQ.js} +7 -5
  10. package/{agentRuntimeLocal-7EZYBR6X.js → agentRuntimeLocal-7ZE2ZQAL.js} +19 -19
  11. package/{agentSlice-UN7ZHCAM.js → agentSlice-BHH2DZKN.js} +3 -3
  12. package/{appDeleteCommands-WS3UFMCB.js → appDeleteCommands-LHOX4HM3.js} +22 -22
  13. package/{appDeployCommands-W5B7I73P.js → appDeployCommands-A6CQQTI3.js} +22 -22
  14. package/{appDeployStatusCommands-UEHNV2GU.js → appDeployStatusCommands-7TTNQODL.js} +22 -22
  15. package/{appGetCommands-XJOBVREN.js → appGetCommands-22F4E37N.js} +22 -22
  16. package/{appListCommands-BISQV6BQ.js → appListCommands-WCDOJUVV.js} +22 -22
  17. package/{authCommand-H35CPF25.js → authCommand-BSOLJFPV.js} +12 -12
  18. package/{builtinSkillRegistry-LJV7FHNI.js → builtinSkillRegistry-V76JTNCJ.js} +2 -2
  19. package/{chunk-2AZSL4GL.js → chunk-22FIHMYU.js} +3 -3
  20. package/{chunk-SH3XD4E2.js → chunk-3LNVSFTH.js} +2 -1
  21. package/{chunk-SAZSXMTR.js → chunk-6OC2YMGH.js} +4 -4
  22. package/{chunk-2DXGW4UO.js → chunk-6OYC7NDH.js} +160 -37
  23. package/{chunk-7NKZA46B.js → chunk-72T5DXRH.js} +4 -4
  24. package/{chunk-3USFOET4.js → chunk-7CDMXZJA.js} +3 -3
  25. package/{chunk-DI7ZFGDQ.js → chunk-7L2HZQNN.js} +2 -2
  26. package/{chunk-XLBQQ5SB.js → chunk-7MBN2JZ5.js} +4 -4
  27. package/{chunk-FQU23S3P.js → chunk-AGAB26VE.js} +11 -11
  28. package/{chunk-G3VYRPTV.js → chunk-AJ52EA72.js} +4 -4
  29. package/{chunk-JPPQ3GUO.js → chunk-APB44JID.js} +3 -3
  30. package/{chunk-CEXJ6Y3C.js → chunk-AUGBRK3P.js} +2 -1
  31. package/{chunk-B4VCTNZL.js → chunk-BJWOOJX5.js} +89 -36
  32. package/{chunk-URO44BCD.js → chunk-BQSW7453.js} +1 -1
  33. package/{chunk-AIHY74D3.js → chunk-C2OYZYJ7.js} +3 -3
  34. package/{chunk-O4R4M4M5.js → chunk-CAAH5LNN.js} +2 -2
  35. package/{chunk-RKKJ6SVM.js → chunk-CEYUVQYU.js} +18 -16
  36. package/{chunk-WO5P2HTX.js → chunk-CI5DVWU7.js} +70 -26
  37. package/{chunk-3URJF2TW.js → chunk-DWQD3JTX.js} +3 -3
  38. package/{chunk-45IOFLGH.js → chunk-EPMWJ7X7.js} +11 -11
  39. package/{chunk-IOFLVIKF.js → chunk-EWLPIR2S.js} +1 -1
  40. package/{chunk-6EQD4AQL.js → chunk-GC64WGMD.js} +1 -1
  41. package/{chunk-FYYSDHVQ.js → chunk-HLAL63BZ.js} +1 -1
  42. package/{chunk-PIG2IUVZ.js → chunk-I2QHI2XM.js} +2 -2
  43. package/{chunk-BSKTDOGA.js → chunk-JHXY4H3P.js} +56 -56
  44. package/{chunk-7VWWGKEQ.js → chunk-K2NTGYVK.js} +3 -3
  45. package/{chunk-I7S63QUU.js → chunk-KNDA4K34.js} +1 -1
  46. package/{chunk-CMRP4XHV.js → chunk-MIME4XKU.js} +12 -12
  47. package/{chunk-HEC32F3G.js → chunk-O3FUFEUI.js} +1 -1
  48. package/{chunk-KJETBEEN.js → chunk-OPNHKULV.js} +1 -1
  49. package/{chunk-EWO77ZGF.js → chunk-OQ3DOBYB.js} +3 -3
  50. package/{chunk-WLPUUBFR.js → chunk-P4V35AFD.js} +3 -3
  51. package/{chunk-DHNQA4VI.js → chunk-Q7UPF643.js} +1 -1
  52. package/{chunk-TOUKACDK.js → chunk-RATR6VCP.js} +1 -1
  53. package/{chunk-XITIONPS.js → chunk-SC5TDLTP.js} +6 -6
  54. package/{chunk-LEZLJTQ4.js → chunk-SUBKVXFM.js} +1 -1
  55. package/{chunk-ZPKUJROL.js → chunk-TDNAAXUQ.js} +2 -2
  56. package/{chunk-SQX235S2.js → chunk-TSCI6X6C.js} +1 -1
  57. package/{chunk-V7PCFWX3.js → chunk-TVGX5QIN.js} +2 -2
  58. package/{chunk-XLQFVHNX.js → chunk-TYQZRSL6.js} +1 -1
  59. package/{chunk-46OQD3AP.js → chunk-UIVOLTFM.js} +4 -4
  60. package/{chunk-3ELX6JK5.js → chunk-UPC23AAN.js} +10 -10
  61. package/{chunk-MFVOJ6KF.js → chunk-W6E5IXIP.js} +3 -3
  62. package/{chunk-HZMWJUSD.js → chunk-WPOSH6PA.js} +2 -2
  63. package/{chunk-YCRROBDY.js → chunk-WXOKJP3W.js} +2 -1
  64. package/{chunk-CEQFVBI2.js → chunk-X2Q5GT5J.js} +3 -3
  65. package/{chunk-ASSNAASW.js → chunk-XHR22EKE.js} +5 -5
  66. package/{chunk-KMDDG73K.js → chunk-XWX5ZGWR.js} +1 -1
  67. package/{chunk-QW6SSF7V.js → chunk-ZJ66I757.js} +15 -15
  68. package/{commandRegistry-PDKCQHG3.js → commandRegistry-EAPXP4BC.js} +56 -56
  69. package/{contentThunks-OO3MJAED.js → contentThunks-SJAKJV4V.js} +11 -11
  70. package/{createAgentAutomationAction-F3O6FJ5W.js → createAgentAutomationAction-IBSAZBSP.js} +11 -11
  71. package/{createDialogAction-UBQKDUK5.js → createDialogAction-MQDTLASD.js} +13 -13
  72. package/{createPageAction-RDEDO4GF.js → createPageAction-EOPBBQMH.js} +11 -11
  73. package/{dialogCommands-6POPB6FB.js → dialogCommands-SV4M5HAV.js} +23 -23
  74. package/{dialogSlice-WZCWWYR3.js → dialogSlice-6CC3YDDL.js} +10 -10
  75. package/{docCreateCommands-B2M3MGX7.js → docCreateCommands-UC2CPMH7.js} +21 -21
  76. package/{docDeleteCommands-NHCUX4XL.js → docDeleteCommands-SRPTGMZ2.js} +22 -22
  77. package/{docReadCommands-FOLST4JD.js → docReadCommands-U3TDUPOY.js} +21 -21
  78. package/{docStore-PTSCGC6T.js → docStore-RSBDE3UH.js} +1 -1
  79. package/{docUpdateCommands-YZT2PQP2.js → docUpdateCommands-G5J5UKGP.js} +21 -21
  80. package/{getPricing-XQ3N3RBP.js → getPricing-2UPNNW3Y.js} +3 -3
  81. package/{handleSendMessageAction-3YMQS6XO.js → handleSendMessageAction-EM43KNSP.js} +23 -23
  82. package/index.js +4 -4
  83. package/{localRuntimeAdapter-6P7JHQOK.js → localRuntimeAdapter-N5WDXYSY.js} +35 -35
  84. package/{machineCommands-CTE5QJBU.js → machineCommands-L34XTTLG.js} +36 -36
  85. package/{machineWsRunDispatch-7CRVOKDC.js → machineWsRunDispatch-IKI7FGKI.js} +36 -36
  86. package/{models-PZQC7VV4.js → models-UUNO6DOL.js} +2 -2
  87. package/package.json +1 -1
  88. package/{providerPresetApply-PKUOHQJT.js → providerPresetApply-5K4PBX4J.js} +6 -6
  89. package/{providerRegistry-HNQLIFN2.js → providerRegistry-K5MSZ3Y5.js} +6 -6
  90. package/{readlineWorkspace-3WLNCNV4.js → readlineWorkspace-ZANIHEDR.js} +44 -44
  91. package/{runAgentClientLoop-F6EQK26A.js → runAgentClientLoop-HPF2WFFQ.js} +27 -27
  92. package/{runtimeDoctorCommands-LYMJEM4F.js → runtimeDoctorCommands-DXJH5HIB.js} +6 -6
  93. package/{secretCommands-DNY56NSU.js → secretCommands-7S6REMJV.js} +2 -2
  94. package/{spaceCommands-XESXH5CW.js → spaceCommands-6KPBWGGE.js} +21 -21
  95. package/{streamAgentChatTurn-KXELVHFR.js → streamAgentChatTurn-3SNWCCK2.js} +33 -33
  96. package/{tools-FMNDEVTZ.js → tools-7SMCO2GW.js} +21 -21
  97. package/{tuiSummaryLlmCaller-FQOEF4IE.js → tuiSummaryLlmCaller-H6WX54WY.js} +8 -8
  98. package/{updateDialogTitleAction-65R3Y22L.js → updateDialogTitleAction-XIMLNROU.js} +11 -11
  99. package/{chunk-CGFNDIKK.js → chunk-5KTQVMCX.js} +0 -0
  100. package/{chunk-UHTDNB5Y.js → chunk-76YUTLOT.js} +3 -3
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-WACI5I6V.js";
9
9
  import {
10
10
  resolvePlatformAuthToken
11
- } from "./chunk-PIG2IUVZ.js";
11
+ } from "./chunk-I2QHI2XM.js";
12
12
 
13
13
  // packages/cli/client/originShellApprovalTransport.ts
14
14
  import { realpathSync } from "node:fs";
@@ -828,7 +828,7 @@ function scanActiveReservations(reservationsDir, deps) {
828
828
  } catch {
829
829
  }
830
830
  const reused = expectedStart && actualStart && Number.isFinite(actualStart.getTime()) && actualStart.toISOString() !== expectedStart;
831
- if (!alive || reused || record.status === "active" && ageMs >= startupWindowMs) {
831
+ if (!alive || reused || record.status === "active" && !!expectedStart && record.childIdentity !== "unverified" && ageMs >= startupWindowMs) {
832
832
  updateReservationFile(filePath, fs, (r) => {
833
833
  r.status = "reclaimed";
834
834
  r.reclaimedAt = new Date(nowMs).toISOString();
@@ -909,14 +909,14 @@ function reserveHostMemory(deps) {
909
909
  const validStart = !!params.processStartedAt && Number.isFinite(Date.parse(params.processStartedAt));
910
910
  locked(() => updateReservationFile(recordPath, fs, (r) => {
911
911
  if (r.status !== "reserved") throw new Error("Reservation is not reserved");
912
+ r.status = "active";
913
+ r.childIdentity = validStart ? "verified" : "unverified";
912
914
  if (validStart) {
913
- r.status = "active";
914
915
  r.childStartedAt = params.processStartedAt;
915
916
  }
916
917
  if (params.runId) r.runId = params.runId;
917
918
  if (typeof params.pid === "number") r.childPid = params.pid;
918
919
  }));
919
- if (!validStart) throw new Error("Child starttime unknown; reservation retained");
920
920
  },
921
921
  release(reason) {
922
922
  locked(() => updateReservationFile(recordPath, fs, (r) => {
@@ -1472,6 +1472,17 @@ function writeRunRecord(record, deps = {}) {
1472
1472
  }
1473
1473
  fs.writeFileSync(path, payload);
1474
1474
  }
1475
+ function reportRunProcessIdentity(runId, deps = {}) {
1476
+ const processStartedAt = new Date(Date.now() - process.uptime() * 1e3).toISOString();
1477
+ withRunRecordLock(runId, deps, () => {
1478
+ const record = readRunRecord(runId, deps);
1479
+ if (!record || record.pid !== void 0 && record.pid !== process.pid) return;
1480
+ record.pid = process.pid;
1481
+ record.processStartedAt = processStartedAt;
1482
+ record.processIdentity = "verified";
1483
+ writeRunRecord(record, deps);
1484
+ }, { strict: true });
1485
+ }
1475
1486
  var FILE_EDIT_TOOL_NAMES = /* @__PURE__ */ new Set(["writeFile", "editFile"]);
1476
1487
  var DEFAULT_ACTIVITY_WRITE_INTERVAL_MS = 2e3;
1477
1488
  function createRunActivityTracker(runId, deps = {}, options = {}) {
@@ -1932,7 +1943,8 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
1932
1943
  fs: reservationFs,
1933
1944
  now: resolvedDeps.now,
1934
1945
  readHostMemory: () => hostMemory = (resolvedDeps.readHostMemory ?? readHostMemory)(),
1935
- getProcessStartTime: resolvedDeps.getProcessStartTime ?? defaultGetProcessStartTime,
1946
+ // Admission remains conservative for existing reservations; no OS probes on startup.
1947
+ getProcessStartTime: () => null,
1936
1948
  withLock: (id, fn, opts) => withRunRecordLock(id, resolvedDeps, fn, opts)
1937
1949
  });
1938
1950
  proc = spawn(execPath, childArgs, {
@@ -1966,24 +1978,17 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
1966
1978
  });
1967
1979
  const hostMemoryNotice = emitHostMemoryNotice(hostMemory, input.output);
1968
1980
  if (typeof proc.pid === "number") {
1969
- let processStartedAt;
1970
- try {
1971
- processStartedAt = (resolvedDeps.getProcessStartTime ?? defaultGetProcessStartTime)(proc.pid);
1972
- if (processStartedAt && !Number.isFinite(processStartedAt.getTime())) processStartedAt = null;
1973
- } catch {
1974
- processStartedAt = null;
1975
- }
1976
1981
  withRunRecordLock(runId, resolvedDeps, () => {
1977
1982
  const latest = readRunRecord(runId, resolvedDeps) ?? record;
1978
1983
  latest.pid = proc.pid;
1979
- if (processStartedAt) latest.processStartedAt = processStartedAt.toISOString();
1984
+ latest.processIdentity ??= "unverified";
1980
1985
  writeRunRecord(latest, resolvedDeps);
1981
1986
  return true;
1982
1987
  }, { strict: true });
1983
1988
  try {
1984
1989
  const persisted = readRunRecord(runId, resolvedDeps);
1985
- reservation.associate({ runId, pid: proc.pid, processStartedAt: processStartedAt?.toISOString() });
1986
- if (persisted?.pid !== proc.pid || !persisted.processStartedAt) throw new Error("Child identity persistence failed");
1990
+ reservation.associate({ runId, pid: proc.pid, processStartedAt: persisted?.processStartedAt });
1991
+ if (persisted?.pid !== proc.pid) throw new Error("Child identity persistence failed: pid not bound");
1987
1992
  } catch (error) {
1988
1993
  throw new Error(`[host-memory-reservation] child ${proc.pid}, run ${runId}: association failed: ${error}`);
1989
1994
  }
@@ -2187,12 +2192,14 @@ function isPidGone(pid, deps = {}) {
2187
2192
  return error.code === "ESRCH";
2188
2193
  }
2189
2194
  }
2190
- function defaultGetProcessStartTime(pid) {
2195
+ function defaultGetProcessStartTime(pid, deps = {}) {
2191
2196
  if (!Number.isSafeInteger(pid) || pid <= 0) return null;
2192
2197
  try {
2193
- if (process.platform === "win32") {
2194
- const shell = process.env.SystemRoot ? join2(process.env.SystemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe") : "powershell.exe";
2195
- const output2 = nodeExecFileSync(shell, [
2198
+ const execFileSync = deps.execFileSync ?? nodeExecFileSync;
2199
+ if ((deps.platform ?? process.platform) === "win32") {
2200
+ const systemRoot = (deps.env ?? process.env).SystemRoot;
2201
+ const shell = systemRoot ? join2(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe") : "powershell.exe";
2202
+ const output2 = execFileSync(shell, [
2196
2203
  "-NoProfile",
2197
2204
  "-NonInteractive",
2198
2205
  "-Command",
@@ -2207,7 +2214,7 @@ function defaultGetProcessStartTime(pid) {
2207
2214
  const date = new Date(output2);
2208
2215
  return Number.isFinite(date.getTime()) ? date : null;
2209
2216
  }
2210
- const output = nodeExecFileSync("ps", ["-o", "lstart=", "-p", String(pid)], {
2217
+ const output = execFileSync("ps", ["-o", "lstart=", "-p", String(pid)], {
2211
2218
  encoding: "utf8",
2212
2219
  stdio: ["ignore", "pipe", "ignore"],
2213
2220
  timeout: 1e3,
@@ -2228,6 +2235,14 @@ function defaultGetProcessStartTime(pid) {
2228
2235
  }
2229
2236
  var MAX_PROCESS_START_TIME_DIFF_MS = 3e4;
2230
2237
  var MAX_PERSISTED_PROCESS_START_TIME_DIFF_MS = 2e3;
2238
+ function probeProcessStartTime(pid, deps) {
2239
+ try {
2240
+ const date = deps.getProcessStartTime ? deps.getProcessStartTime(pid) : defaultGetProcessStartTime(pid, deps);
2241
+ return date && Number.isFinite(date.getTime()) ? date : null;
2242
+ } catch {
2243
+ return null;
2244
+ }
2245
+ }
2231
2246
  var ORPHAN_HEARTBEAT_GRACE_MS = 1e4;
2232
2247
  function readTimestampMs(value) {
2233
2248
  if (!value) return null;
@@ -2235,8 +2250,7 @@ function readTimestampMs(value) {
2235
2250
  return Number.isNaN(ms) ? null : ms;
2236
2251
  }
2237
2252
  function isPidReused(pid, expectedStartedAt, deps = {}, maxDiffMs = MAX_PROCESS_START_TIME_DIFF_MS) {
2238
- const getStartTime = deps.getProcessStartTime ?? defaultGetProcessStartTime;
2239
- const procStartTime = getStartTime(pid);
2253
+ const procStartTime = probeProcessStartTime(pid, deps);
2240
2254
  if (!procStartTime) {
2241
2255
  return false;
2242
2256
  }
@@ -2253,7 +2267,7 @@ function checkStaleRun(runId, deps = {}) {
2253
2267
  const pidGone = isPidGone(record.pid, deps);
2254
2268
  const expectedStartedAt = record.processStartedAt ?? record.startedAt;
2255
2269
  const maxStartTimeDiffMs = record.processStartedAt ? MAX_PERSISTED_PROCESS_START_TIME_DIFF_MS : MAX_PROCESS_START_TIME_DIFF_MS;
2256
- const pidReused = !pidGone && isPidReused(record.pid, expectedStartedAt, deps, maxStartTimeDiffMs);
2270
+ const pidReused = !pidGone && record.processIdentity !== "unverified" && isPidReused(record.pid, expectedStartedAt, deps, maxStartTimeDiffMs);
2257
2271
  if (!pidGone && !pidReused) return record;
2258
2272
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
2259
2273
  const heartbeatAt = readTimestampMs(record.activity?.updatedAt);
@@ -2621,8 +2635,30 @@ async function terminateRunProcess(record, initialSignal, deps) {
2621
2635
  const sleep = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
2622
2636
  const nowMs = () => deps.now ? deps.now().getTime() : Date.now();
2623
2637
  const signalGroup = (sig) => {
2638
+ const fail = (reason) => {
2639
+ throw new Error(`Run ${record.runId}, pid ${pid}, platform ${deps.platform ?? process.platform}: \u8EAB\u4EFD\u672A\u9A8C\u8BC1\uFF0C\u65E0\u6CD5\u5B89\u5168\u7EC8\u6B62 (${reason}). \u53EF\u5148\u786E\u8BA4\u8FDB\u7A0B\u72B6\u6001\u6216\u91CD\u542F\u8BE5 run\uFF1B\u786E\u8BA4\u8EAB\u4EFD\u540E\u91CD\u8BD5 stop/kill\u3002`);
2640
+ };
2641
+ const expectedMs = readTimestampMs(record.processStartedAt ?? record.startedAt);
2642
+ if (expectedMs === null) fail("no trusted process start baseline");
2643
+ const maxDiffMs = record.processStartedAt ? MAX_PERSISTED_PROCESS_START_TIME_DIFF_MS : MAX_PROCESS_START_TIME_DIFF_MS;
2644
+ const actual = probeProcessStartTime(pid, deps);
2645
+ if (!actual || Math.abs(actual.getTime() - expectedMs) > maxDiffMs) {
2646
+ fail("identity probe failed or PID start time mismatch");
2647
+ }
2648
+ const persisted = withRunRecordLock(record.runId, deps, () => {
2649
+ const latest = readRunRecord(record.runId, deps);
2650
+ if (latest) {
2651
+ if (latest.pid !== pid || latest.processStartedAt !== record.processStartedAt || latest.startedAt !== record.startedAt) {
2652
+ fail("record changed");
2653
+ }
2654
+ latest.processIdentity = "verified";
2655
+ writeRunRecord(latest, deps);
2656
+ }
2657
+ return true;
2658
+ }, { strict: true });
2659
+ if (persisted !== true) fail("identity persistence lock contended");
2624
2660
  try {
2625
- if (process.platform !== "win32") {
2661
+ if ((deps.platform ?? process.platform) !== "win32") {
2626
2662
  kill(-pid, sig);
2627
2663
  } else {
2628
2664
  kill(pid, sig);
@@ -2666,7 +2702,7 @@ async function runSignalCommand(args, signal, verb, deps) {
2666
2702
  `);
2667
2703
  return 1;
2668
2704
  }
2669
- const reconciled = checkStaleRun(record.runId, deps) ?? record;
2705
+ const reconciled = record.status === "running" && typeof record.pid === "number" && isPidGone(record.pid, deps) ? checkStaleRun(record.runId, deps) ?? record : record;
2670
2706
  if (isAgentRunTerminalStatus(reconciled.status)) {
2671
2707
  deps.output.write(`Run ${reconciled.runId} is already ${reconciled.status}.
2672
2708
  `);
@@ -2677,7 +2713,14 @@ async function runSignalCommand(args, signal, verb, deps) {
2677
2713
  `);
2678
2714
  return 1;
2679
2715
  }
2680
- const confirmed = await terminateRunProcess(reconciled, signal, deps);
2716
+ let confirmed;
2717
+ try {
2718
+ confirmed = await terminateRunProcess(reconciled, signal, deps);
2719
+ } catch (error) {
2720
+ deps.output.write(`${error instanceof Error ? error.message : String(error)}
2721
+ `);
2722
+ return 1;
2723
+ }
2681
2724
  if (!confirmed) {
2682
2725
  deps.output.write(
2683
2726
  `Failed to ${verb} ${record.runId} (pid ${record.pid}): process still alive after SIGKILL.
@@ -2743,6 +2786,7 @@ export {
2743
2786
  defaultGenerateBatchId,
2744
2787
  withRunRecordLock,
2745
2788
  writeRunRecord,
2789
+ reportRunProcessIdentity,
2746
2790
  createRunActivityTracker,
2747
2791
  readRunRecord,
2748
2792
  backfillRunRecordParentDialog,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-62TBKWTV.js";
7
7
  import {
8
8
  clearCliLocalRuntimePreparedAgentCache
9
- } from "./chunk-B4VCTNZL.js";
9
+ } from "./chunk-BJWOOJX5.js";
10
10
  import {
11
11
  readCredentialAvailability
12
12
  } from "./chunk-R4BMKAR5.js";
@@ -19,7 +19,7 @@ import {
19
19
  resolveAgentRecordFromHybridStore,
20
20
  sanitizeAgentRecordForCliOutput,
21
21
  writeAgentRecord
22
- } from "./chunk-KJETBEEN.js";
22
+ } from "./chunk-OPNHKULV.js";
23
23
  import {
24
24
  resolveCliAgentKeyInput
25
25
  } from "./chunk-NBTY7YJF.js";
@@ -244,7 +244,7 @@ async function runAgentCreateCommand(args, deps = {}) {
244
244
  let verifyResult;
245
245
  if (parsed.verify) {
246
246
  try {
247
- const { verifyCustomProvider } = await import("./agentProviderCommands-4USYTCL3.js");
247
+ const { verifyCustomProvider } = await import("./agentProviderCommands-TWVILNAN.js");
248
248
  const rec = built.nextRecord;
249
249
  verifyResult = await verifyCustomProvider({
250
250
  providerUrl: rec.customProviderUrl,
@@ -7,7 +7,7 @@ import {
7
7
  mergeReferences,
8
8
  resolveReferenceAssets,
9
9
  resolveToolsFromKeys
10
- } from "./chunk-CEQFVBI2.js";
10
+ } from "./chunk-X2Q5GT5J.js";
11
11
  import {
12
12
  UI_CARD_ENVELOPE_MAX_BYTES,
13
13
  getAllToolRuns,
@@ -20,7 +20,7 @@ import {
20
20
  selectSpaceContextLevel,
21
21
  selectUserTonePreset,
22
22
  uiCardFallback
23
- } from "./chunk-WLPUUBFR.js";
23
+ } from "./chunk-P4V35AFD.js";
24
24
  import {
25
25
  resolveToolBaseUrl
26
26
  } from "./chunk-MYOH447Z.js";
@@ -29,18 +29,18 @@ import {
29
29
  getModelPricing,
30
30
  getPrices,
31
31
  hasExplicitAgentPricing
32
- } from "./chunk-ZPKUJROL.js";
32
+ } from "./chunk-TDNAAXUQ.js";
33
33
  import {
34
34
  getDocState
35
- } from "./chunk-HZMWJUSD.js";
35
+ } from "./chunk-WPOSH6PA.js";
36
36
  import {
37
37
  getTableState
38
- } from "./chunk-URO44BCD.js";
38
+ } from "./chunk-BQSW7453.js";
39
39
  import {
40
40
  PERSONALIZATION_DIALOG_CATEGORY,
41
41
  buildPersonalizationDialogPolicyContext,
42
42
  selectAllMsgs
43
- } from "./chunk-CMRP4XHV.js";
43
+ } from "./chunk-MIME4XKU.js";
44
44
  import {
45
45
  getCurrentSpaceIdRaw,
46
46
  getViewMode
@@ -66,21 +66,21 @@ import {
66
66
  expandEnabledPackPromptPatches,
67
67
  expandEnabledPacks,
68
68
  resolveEffectiveEnabledPacks
69
- } from "./chunk-YCRROBDY.js";
69
+ } from "./chunk-WXOKJP3W.js";
70
70
  import {
71
71
  projectToolMessageContent
72
- } from "./chunk-BSKTDOGA.js";
72
+ } from "./chunk-JHXY4H3P.js";
73
73
  import {
74
74
  attachmentKind,
75
75
  normalizeAttachmentPart
76
76
  } from "./chunk-WJZOQR2J.js";
77
77
  import {
78
78
  extractReferenceKeysFromMessage
79
- } from "./chunk-HEC32F3G.js";
79
+ } from "./chunk-O3FUFEUI.js";
80
80
  import {
81
81
  getModelContextWindow,
82
82
  planContextUsage
83
- } from "./chunk-ASSNAASW.js";
83
+ } from "./chunk-XHR22EKE.js";
84
84
  import {
85
85
  asRecordOrEmpty
86
86
  } from "./chunk-KX6YBIHG.js";
@@ -113,7 +113,7 @@ import {
113
113
  import {
114
114
  getModelConfig,
115
115
  getProviderByModelName
116
- } from "./chunk-6EQD4AQL.js";
116
+ } from "./chunk-GC64WGMD.js";
117
117
  import {
118
118
  isRecord
119
119
  } from "./chunk-KUG52IAP.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readDbRecord,
3
3
  writeAgentRecord
4
- } from "./chunk-KJETBEEN.js";
4
+ } from "./chunk-OPNHKULV.js";
5
5
  import {
6
6
  buildSkillSummaryMarker
7
7
  } from "./chunk-VF4K2QE6.js";
@@ -9,7 +9,7 @@ import {
9
9
  platformHostedModels,
10
10
  toCnyCredits,
11
11
  zaiModels
12
- } from "./chunk-CGFNDIKK.js";
12
+ } from "./chunk-5KTQVMCX.js";
13
13
 
14
14
  // packages/integrations/qwen/models.ts
15
15
  var qwenModels = [
@@ -4,7 +4,7 @@ import {
4
4
  openrouterModels,
5
5
  platformHostedModels,
6
6
  zaiModels
7
- } from "./chunk-CGFNDIKK.js";
7
+ } from "./chunk-5KTQVMCX.js";
8
8
 
9
9
  // packages/ai/llm/modelAbility.ts
10
10
  var MODEL_ABILITY_TABLE = {
@@ -4,7 +4,7 @@ import {
4
4
  resolvePlatformHostedCredentialProvider,
5
5
  resolvePlatformProxyChatGatewayEndpoint,
6
6
  resolvePlatformResponsesEndpoint
7
- } from "./chunk-V7PCFWX3.js";
7
+ } from "./chunk-TVGX5QIN.js";
8
8
  import {
9
9
  CLI_PROVIDER_VALUES
10
10
  } from "./chunk-5BHQICF2.js";
@@ -21,7 +21,7 @@ import {
21
21
  CLIENT_VERSION_TOO_OLD_CODE,
22
22
  buildClientVersionGateErrorDetail,
23
23
  evaluatePlatformHostedClientVersionGate
24
- } from "./chunk-CGFNDIKK.js";
24
+ } from "./chunk-5KTQVMCX.js";
25
25
  import {
26
26
  asTrimmedLowercaseString
27
27
  } from "./chunk-QSJ3HFEF.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  resolveAgentCallPlan
3
- } from "./chunk-SAZSXMTR.js";
3
+ } from "./chunk-6OC2YMGH.js";
4
4
  import {
5
5
  SUBSCRIPTION_OAUTH_PROVIDERS
6
- } from "./chunk-EWO77ZGF.js";
6
+ } from "./chunk-OQ3DOBYB.js";
7
7
  import {
8
8
  findModelConfig,
9
9
  getProviderByModelName
10
- } from "./chunk-6EQD4AQL.js";
10
+ } from "./chunk-GC64WGMD.js";
11
11
  import {
12
12
  asOptionalTrimmedString
13
13
  } from "./chunk-G3SUCT4W.js";
@@ -15,57 +15,6 @@ import {
15
15
  asTrimmedLowercaseString
16
16
  } from "./chunk-QSJ3HFEF.js";
17
17
 
18
- // packages/ai/agent/toolOutputPolicy.ts
19
- var MAX_IN_TURN_TOOL_CONTENT_CHARS = 4e3;
20
- var DEFAULT_TOOL_OUTPUT_PROFILE = {
21
- maxChars: MAX_IN_TURN_TOOL_CONTENT_CHARS,
22
- headRatio: 0.5
23
- };
24
- var TOOL_OUTPUT_PROFILES = {
25
- readFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
26
- read_file: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
27
- readWorkspaceFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
28
- globFiles: { maxChars: 2800, headRatio: 0.85 },
29
- execShell: { maxChars: 4e3, headRatio: 0.35 },
30
- runCommand: { maxChars: 4e3, headRatio: 0.35 },
31
- launchProcess: { maxChars: 2800, headRatio: 0.35 },
32
- editFile: { maxChars: 1200, headRatio: 0.62 },
33
- writeFile: { maxChars: 1e3, headRatio: 0.62 },
34
- readPastedText: { maxChars: 4800, headRatio: 0.5, historicalMaxChars: 4800 },
35
- // loadSkill 内联的是文档正文(SKILL.md 全文),与 readFile 同类,不该因为工具名未登记就退回
36
- // DEFAULT 的 4000。历史事故(nolo-plan omitted middle)正是 headRatio 0.5 掐掉中段,把
37
- // 「MUST / 禁止」所在的中段静默省略。取 4800(与 readFile 同级),不激进放大;headRatio 同 DEFAULT。
38
- loadSkill: { maxChars: 4800, headRatio: 0.5 }
39
- };
40
- function resolveToolOutputProfile(toolName) {
41
- return (toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0) ?? DEFAULT_TOOL_OUTPUT_PROFILE;
42
- }
43
- function resolveHistoricalToolContentCap(toolName, historicalMaxChars) {
44
- const profile = toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0;
45
- return profile?.historicalMaxChars !== void 0 ? Math.max(historicalMaxChars, profile.historicalMaxChars) : historicalMaxChars;
46
- }
47
- function projectToolMessageContent(input) {
48
- const { content, toolName } = input;
49
- const maxChars = resolveToolOutputProfile(toolName).maxChars;
50
- if (content.length <= maxChars) return content;
51
- return clipToolText(
52
- content,
53
- maxChars,
54
- resolveToolOutputProfile(toolName).headRatio,
55
- `
56
- \u2026[\u622A\u65AD\uFF0C\u539F\u59CB\u957F\u5EA6 ${content.length} \u5B57\u7B26]`
57
- );
58
- }
59
- function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool output middle omitted; head/tail preserved ...]\n\n") {
60
- const normalized = content.replace(/\r\n/g, "\n").trim();
61
- if (normalized.length <= maxChars) return normalized;
62
- if (maxChars <= marker.length + 2) return normalized.slice(0, maxChars);
63
- const available = maxChars - marker.length;
64
- const headChars = Math.max(1, Math.floor(available * headRatio));
65
- const tailChars = Math.max(1, available - headChars);
66
- return `${normalized.slice(0, headChars)}${marker}${normalized.slice(-tailChars)}`;
67
- }
68
-
69
18
  // packages/ai/llm/agentCapabilities.ts
70
19
  var ANTIGRAVITY_EFFORT_SUFFIXES = [
71
20
  "-tiered",
@@ -145,10 +94,61 @@ var resolveAgentImageInputSupport = (agent) => {
145
94
  return true;
146
95
  };
147
96
 
97
+ // packages/ai/agent/toolOutputPolicy.ts
98
+ var MAX_IN_TURN_TOOL_CONTENT_CHARS = 4e3;
99
+ var DEFAULT_TOOL_OUTPUT_PROFILE = {
100
+ maxChars: MAX_IN_TURN_TOOL_CONTENT_CHARS,
101
+ headRatio: 0.5
102
+ };
103
+ var TOOL_OUTPUT_PROFILES = {
104
+ readFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
105
+ read_file: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
106
+ readWorkspaceFile: { maxChars: 4800, headRatio: 0.68, historicalMaxChars: 4800 },
107
+ globFiles: { maxChars: 2800, headRatio: 0.85 },
108
+ execShell: { maxChars: 4e3, headRatio: 0.35 },
109
+ runCommand: { maxChars: 4e3, headRatio: 0.35 },
110
+ launchProcess: { maxChars: 2800, headRatio: 0.35 },
111
+ editFile: { maxChars: 1200, headRatio: 0.62 },
112
+ writeFile: { maxChars: 1e3, headRatio: 0.62 },
113
+ readPastedText: { maxChars: 4800, headRatio: 0.5, historicalMaxChars: 4800 },
114
+ // loadSkill 内联的是文档正文(SKILL.md 全文),与 readFile 同类,不该因为工具名未登记就退回
115
+ // DEFAULT 的 4000。历史事故(nolo-plan omitted middle)正是 headRatio 0.5 掐掉中段,把
116
+ // 「MUST / 禁止」所在的中段静默省略。取 4800(与 readFile 同级),不激进放大;headRatio 同 DEFAULT。
117
+ loadSkill: { maxChars: 4800, headRatio: 0.5 }
118
+ };
119
+ function resolveToolOutputProfile(toolName) {
120
+ return (toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0) ?? DEFAULT_TOOL_OUTPUT_PROFILE;
121
+ }
122
+ function resolveHistoricalToolContentCap(toolName, historicalMaxChars) {
123
+ const profile = toolName ? TOOL_OUTPUT_PROFILES[toolName] : void 0;
124
+ return profile?.historicalMaxChars !== void 0 ? Math.max(historicalMaxChars, profile.historicalMaxChars) : historicalMaxChars;
125
+ }
126
+ function projectToolMessageContent(input) {
127
+ const { content, toolName } = input;
128
+ const maxChars = resolveToolOutputProfile(toolName).maxChars;
129
+ if (content.length <= maxChars) return content;
130
+ return clipToolText(
131
+ content,
132
+ maxChars,
133
+ resolveToolOutputProfile(toolName).headRatio,
134
+ `
135
+ \u2026[\u622A\u65AD\uFF0C\u539F\u59CB\u957F\u5EA6 ${content.length} \u5B57\u7B26]`
136
+ );
137
+ }
138
+ function clipToolText(content, maxChars, headRatio, marker = "\n\n[... tool output middle omitted; head/tail preserved ...]\n\n") {
139
+ const normalized = content.replace(/\r\n/g, "\n").trim();
140
+ if (normalized.length <= maxChars) return normalized;
141
+ if (maxChars <= marker.length + 2) return normalized.slice(0, maxChars);
142
+ const available = maxChars - marker.length;
143
+ const headChars = Math.max(1, Math.floor(available * headRatio));
144
+ const tailChars = Math.max(1, available - headChars);
145
+ return `${normalized.slice(0, headChars)}${marker}${normalized.slice(-tailChars)}`;
146
+ }
147
+
148
148
  export {
149
+ resolveAgentImageInputSupport,
149
150
  resolveToolOutputProfile,
150
151
  resolveHistoricalToolContentCap,
151
152
  projectToolMessageContent,
152
- clipToolText,
153
- resolveAgentImageInputSupport
153
+ clipToolText
154
154
  };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-LEZLJTQ4.js";
4
+ } from "./chunk-SUBKVXFM.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-KJETBEEN.js";
7
+ } from "./chunk-OPNHKULV.js";
8
8
  import {
9
9
  deriveCredentialGroup
10
- } from "./chunk-XITIONPS.js";
10
+ } from "./chunk-SC5TDLTP.js";
11
11
  import {
12
12
  isTombstoneRecord
13
13
  } from "./chunk-D2MDMY2M.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generatePkcePair,
3
3
  startCallbackServer
4
- } from "./chunk-G3VYRPTV.js";
4
+ } from "./chunk-AJ52EA72.js";
5
5
  import {
6
6
  asOptionalFiniteNumber
7
7
  } from "./chunk-WWC7I6TA.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-QYPE3TS3.js";
12
12
  import {
13
13
  runLlm
14
- } from "./chunk-XLBQQ5SB.js";
14
+ } from "./chunk-7MBN2JZ5.js";
15
15
  import {
16
16
  getApproxPricePerImage
17
17
  } from "./chunk-4JH2UMJR.js";
@@ -104,7 +104,7 @@ import {
104
104
  isOAuthApiKeyRef,
105
105
  normalizeUsage,
106
106
  resolveAutoExecutionProfile
107
- } from "./chunk-HEC32F3G.js";
107
+ } from "./chunk-O3FUFEUI.js";
108
108
  import {
109
109
  isDevinOAuthAgent
110
110
  } from "./chunk-5ZUL4CUO.js";
@@ -121,7 +121,7 @@ import {
121
121
  getModelInfo,
122
122
  planCompression,
123
123
  serializeMessageContent
124
- } from "./chunk-ASSNAASW.js";
124
+ } from "./chunk-XHR22EKE.js";
125
125
  import {
126
126
  asRecordOrEmpty
127
127
  } from "./chunk-KX6YBIHG.js";
@@ -160,7 +160,7 @@ import {
160
160
  import {
161
161
  findModelConfig,
162
162
  getModelConfig
163
- } from "./chunk-6EQD4AQL.js";
163
+ } from "./chunk-GC64WGMD.js";
164
164
  import {
165
165
  isRecord
166
166
  } from "./chunk-KUG52IAP.js";
@@ -193,7 +193,7 @@ import {
193
193
  isPlatformManagedProvider,
194
194
  resolvePlatformEffectiveModel,
195
195
  resolvePlatformHostedRouting
196
- } from "./chunk-CGFNDIKK.js";
196
+ } from "./chunk-5KTQVMCX.js";
197
197
  import {
198
198
  asTrimmedLowercaseString
199
199
  } from "./chunk-QSJ3HFEF.js";
@@ -11062,7 +11062,7 @@ var messageSlice = createSliceWithThunks({
11062
11062
  runtimeOptions: args.runtimeOptions
11063
11063
  });
11064
11064
  if (agentKeyToUse) {
11065
- const { streamAgentChatTurn } = await import("./agentSlice-UN7ZHCAM.js");
11065
+ const { streamAgentChatTurn } = await import("./agentSlice-BHH2DZKN.js");
11066
11066
  await dispatch(
11067
11067
  streamAgentChatTurn({
11068
11068
  agentKey: agentKeyToUse,
@@ -13879,7 +13879,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
13879
13879
  }
13880
13880
  if (isCurrentDialog) {
13881
13881
  await thunkApi.dispatch(resetMsgs());
13882
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-WZCWWYR3.js");
13882
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-6CC3YDDL.js");
13883
13883
  dispatch(clearPendingAttachments2());
13884
13884
  }
13885
13885
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -13887,15 +13887,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
13887
13887
 
13888
13888
  // packages/chat/dialog/dialogSlice.ts
13889
13889
  var runCreateDialogAction = async (args, thunkApi) => {
13890
- const { createDialogAction } = await import("./createDialogAction-UBQKDUK5.js");
13890
+ const { createDialogAction } = await import("./createDialogAction-MQDTLASD.js");
13891
13891
  return createDialogAction(args, thunkApi);
13892
13892
  };
13893
13893
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
13894
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-F3O6FJ5W.js");
13894
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-IBSAZBSP.js");
13895
13895
  return createAgentAutomationAction(args, thunkApi);
13896
13896
  };
13897
13897
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
13898
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-65R3Y22L.js");
13898
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-XIMLNROU.js");
13899
13899
  return updateDialogTitleAction(args, thunkApi);
13900
13900
  };
13901
13901
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -13919,7 +13919,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
13919
13919
  return setDialogExtraReferencesAction(args, thunkApi);
13920
13920
  };
13921
13921
  var runHandleSendMessageAction = async (args, thunkApi) => {
13922
- const { handleSendMessageAction } = await import("./handleSendMessageAction-3YMQS6XO.js");
13922
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-EM43KNSP.js");
13923
13923
  return handleSendMessageAction(args, thunkApi);
13924
13924
  };
13925
13925
  function clearDialogState() {
@@ -13932,7 +13932,7 @@ var createPageAndAddReference = createAsyncThunk(
13932
13932
  async (payload, { dispatch, getState, rejectWithValue }) => {
13933
13933
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
13934
13934
  try {
13935
- const { createDocState } = await import("./docStore-PTSCGC6T.js");
13935
+ const { createDocState } = await import("./docStore-RSBDE3UH.js");
13936
13936
  const pageKey = await createDocState(
13937
13937
  { slateData, title },
13938
13938
  { dispatch, getState }
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getModelContextWindow,
6
6
  normalizeTimingMs
7
- } from "./chunk-ASSNAASW.js";
7
+ } from "./chunk-XHR22EKE.js";
8
8
  import {
9
9
  BUILTIN_NOLO_AGENT_KEY
10
10
  } from "./chunk-LOEO7LRC.js";
@@ -556,7 +556,7 @@ async function buildCreatedAgentRecord(args) {
556
556
  const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
557
557
  const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
558
558
  if (args.parsed.presetId) {
559
- const { resolveProviderPresetFields } = await import("./providerPresetApply-PKUOHQJT.js");
559
+ const { resolveProviderPresetFields } = await import("./providerPresetApply-5K4PBX4J.js");
560
560
  const fields = resolveProviderPresetFields(args.parsed.presetId);
561
561
  if (fields.kind === "manual") {
562
562
  throw new Error(