nolo-cli 0.16.0 → 0.17.0

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 (132) hide show
  1. package/{_executeModel-AVCA2NAV.js → _executeModel-WPNX5DH4.js} +49 -43
  2. package/{action-F5JACQBG.js → action-LT7BRFLK.js} +10 -9
  3. package/{addContentAction-AQXEYRBE.js → addContentAction-PL3KKBDH.js} +9 -8
  4. package/{addDialogAgentAction-EJHHJZWW.js → addDialogAgentAction-FCMSKYAF.js} +8 -7
  5. package/{agentDeleteCommand-QW5PUMDQ.js → agentDeleteCommand-L3357EFL.js} +31 -28
  6. package/{agentEmailCommands-4ORVLGVQ.js → agentEmailCommands-N65AVLEI.js} +61 -55
  7. package/{agentListCommands-YWBYRTYC.js → agentListCommands-CH27FTI2.js} +30 -27
  8. package/{agentMachineCommands-JSQW4FOA.js → agentMachineCommands-PPK5HJZB.js} +29 -26
  9. package/{agentPullCommand-6HWUT3SW.js → agentPullCommand-ZZGU5KOY.js} +4 -4
  10. package/{agentRecordCommands-AASIWOBT.js → agentRecordCommands-HTVXD4TT.js} +56 -50
  11. package/{agentRunCommand-TB5BHXUH.js → agentRunCommand-MGLVJUA5.js} +62 -53
  12. package/{agentRunControl-6ADXVYMR.js → agentRunControl-P75VPTGS.js} +24 -1
  13. package/{agentRuntimeLocal-QNPNJRVH.js → agentRuntimeLocal-QUTBSY3I.js} +24 -21
  14. package/{agentSlice-RUNXC62Y.js → agentSlice-DOGRCMWK.js} +9 -8
  15. package/appDeleteCommands-FEEVXUBG.js +127 -0
  16. package/appDeployCommands-C4HCGC4B.js +166 -0
  17. package/appDeployStatusCommands-IR5ZUZBQ.js +147 -0
  18. package/appGetCommands-6RJGZ66Z.js +122 -0
  19. package/appListCommands-VMTF5YZF.js +125 -0
  20. package/{authCommand-YFTR3347.js → authCommand-WJZPOLSS.js} +16 -9
  21. package/{authCommands-YXGOXNBZ.js → authCommands-XTBV7OFZ.js} +6 -5
  22. package/{chunk-XPC5C7BK.js → chunk-3ND52WIL.js} +2 -2
  23. package/{chunk-SOTZ6RDN.js → chunk-3Q7WHGCB.js} +1 -1
  24. package/{chunk-M43KDE25.js → chunk-45BY7RLP.js} +2 -8
  25. package/{chunk-KKY4B2Q2.js → chunk-4PWB7JRR.js} +4 -1
  26. package/{chunk-6N4KODMN.js → chunk-4T5F7YZQ.js} +1 -1
  27. package/chunk-7BUYEZ6U.js +671 -0
  28. package/{chunk-AS3ZQ3O2.js → chunk-7OBMZCRD.js} +1 -1
  29. package/{chunk-AVVZUXXC.js → chunk-AAODAAUQ.js} +34 -13
  30. package/{chunk-QLUFR47U.js → chunk-AL2V7U3E.js} +1 -1
  31. package/{chunk-MTU75CZ2.js → chunk-B5TOXZAK.js} +1 -1
  32. package/{chunk-AUURUT6L.js → chunk-BT6K76S7.js} +238 -424
  33. package/chunk-CEFXYF66.js +107 -0
  34. package/{chunk-RLCXU7A5.js → chunk-D3HVJJIA.js} +1 -1
  35. package/{chunk-JTMNCCWF.js → chunk-DKZFOK24.js} +16 -87
  36. package/chunk-DL6EPNIK.js +50 -0
  37. package/{chunk-4L2OJPCU.js → chunk-EGPCU42M.js} +58 -8
  38. package/{chunk-IWLUTMYX.js → chunk-ELT65PZW.js} +2 -2
  39. package/chunk-FKXFCYVO.js +221 -0
  40. package/{chunk-4FX6NVDW.js → chunk-FPKLD4KB.js} +3 -136
  41. package/{chunk-PCTUYVUM.js → chunk-FVIPEIVX.js} +10 -3
  42. package/chunk-GFUIQ4RY.js +136 -0
  43. package/{chunk-66X4VSRC.js → chunk-HQPG2PIV.js} +41 -1
  44. package/{chunk-IGXREZW2.js → chunk-HV2A3B4W.js} +1 -1
  45. package/{chunk-LPEUV5RE.js → chunk-IOOMJJ4Z.js} +2 -2
  46. package/{setDialogExtraReferencesAction-LR6MSIXO.js → chunk-JLA4FXYC.js} +2 -17
  47. package/{chunk-3OIRVWXA.js → chunk-JP7REMYP.js} +10 -1
  48. package/chunk-KFEVY3ST.js +255 -0
  49. package/{chunk-P3RIAYGG.js → chunk-L2MLZQXU.js} +3 -3
  50. package/{chunk-55NSNCFM.js → chunk-L6NVTGI7.js} +1 -1
  51. package/{chunk-3WGLLTK4.js → chunk-LSFAWXKC.js} +100 -3
  52. package/{chunk-S2LXHNHG.js → chunk-MD3V54DA.js} +6 -6
  53. package/{chunk-6EVITP2G.js → chunk-MUCU6ATG.js} +2 -251
  54. package/{chunk-KFHN5NGJ.js → chunk-MVQ4TBSD.js} +1 -1
  55. package/{chunk-ZQBL7LIC.js → chunk-NEKFSXOP.js} +310 -211
  56. package/{chunk-NSCHQQPU.js → chunk-NVB267BZ.js} +397 -324
  57. package/{chunk-Z5JQNBNY.js → chunk-NYUXSXLY.js} +33 -14
  58. package/{chunk-FRV6A633.js → chunk-PZCBZO4J.js} +2 -2
  59. package/{chunk-GSINCD4P.js → chunk-QCJITMYO.js} +21 -11
  60. package/{chunk-OOSFSFMA.js → chunk-R5V5G73M.js} +2 -0
  61. package/{chunk-4IJYA27C.js → chunk-RG2U2MTJ.js} +1 -1
  62. package/{chunk-BEBNFWDU.js → chunk-RRGVDPH3.js} +3 -3
  63. package/{chunk-EABWT43X.js → chunk-RVOUXDFU.js} +5 -5
  64. package/{chunk-JTINRTBT.js → chunk-SKDNBYZK.js} +2 -2
  65. package/{chunk-3663CXZN.js → chunk-SNZV4QCE.js} +65 -22
  66. package/{chunk-KMQPSTMJ.js → chunk-TRT4I4UD.js} +2 -2
  67. package/{chunk-MYMMNKYL.js → chunk-TSIYZBTH.js} +156 -6
  68. package/{chunk-EHLHSX7R.js → chunk-UB4RYYNQ.js} +9 -2
  69. package/{chunk-YJKXGHJ6.js → chunk-UGUW3FHG.js} +4 -4
  70. package/{chunk-DPAB4FQ7.js → chunk-UZY4BEBR.js} +1579 -212
  71. package/chunk-V5R4NZP2.js +78 -0
  72. package/{chunk-MR6ISAGB.js → chunk-VDNQF5VI.js} +6 -6
  73. package/{chunk-33BJUVK4.js → chunk-VGMJ6PDJ.js} +5 -5
  74. package/{chunk-W4NVOSFF.js → chunk-WFHXMLHZ.js} +1 -1
  75. package/{chunk-H33743XH.js → chunk-WJRJDX2W.js} +1 -1
  76. package/chunk-X4Q4UZEY.js +26 -0
  77. package/{chunk-RPDGJO4D.js → chunk-XHG22OEX.js} +4 -4
  78. package/{chunk-DVRHHFEA.js → chunk-XMLRJUU5.js} +1 -1
  79. package/{chunk-3S2VOMIF.js → chunk-XRZJGPFI.js} +7 -7
  80. package/{chunk-7UKFVQ5W.js → chunk-YLRTBX4Y.js} +105 -36
  81. package/{chunk-DGEYDWEZ.js → chunk-YXTRNO5W.js} +3 -3
  82. package/{chunk-FY233ZFU.js → chunk-ZJZCMKOR.js} +107 -177
  83. package/{chunk-NVEWUJVX.js → chunk-ZVOZH2HW.js} +1 -1
  84. package/chunk-ZZ2MH7LE.js +84 -0
  85. package/{cliExecutor-K3F7DMRO.js → cliExecutor-DNE7TCC4.js} +2 -2
  86. package/codingSkills-36KN5NQT.js +48 -0
  87. package/{createAgentAutomationAction-FNHPSKKO.js → createAgentAutomationAction-PMOLEPGJ.js} +19 -18
  88. package/{createDialogAction-TZCVQ3NU.js → createDialogAction-DPRTYNAK.js} +21 -20
  89. package/{createPageAction-EIGZ3BKT.js → createPageAction-JGZK3WAM.js} +25 -24
  90. package/{dbSlice-7KQH6GOU.js → dbSlice-CGSRFJN3.js} +8 -7
  91. package/{deleteFile-WPWVZE4B.js → deleteFile-WDZ3VM7B.js} +3 -3
  92. package/{dialogCommands-FO77J5DQ.js → dialogCommands-XED6DKLV.js} +29 -26
  93. package/{dialogSlice-MM5U4KE2.js → dialogSlice-KO4NRNKC.js} +19 -18
  94. package/{docCreateCommands-I3BS3AZI.js → docCreateCommands-P6DYWHH3.js} +32 -27
  95. package/{docDeleteCommands-Q2OPV52P.js → docDeleteCommands-KUWXAMSN.js} +31 -26
  96. package/{docReadCommands-YOOFACYZ.js → docReadCommands-ECW55TKB.js} +30 -25
  97. package/{docStore-NGYQ2JTR.js → docStore-6KMERNUY.js} +20 -19
  98. package/{docUpdateCommands-2B32ITHN.js → docUpdateCommands-5J4BTJQN.js} +31 -26
  99. package/{fetchMessages-KTNM7QAR.js → fetchMessages-BMGVZVSE.js} +4 -3
  100. package/{getPricing-P4XRJRZB.js → getPricing-RYY6OBA4.js} +2 -2
  101. package/{handleSendMessageAction-JRZWWBKP.js → handleSendMessageAction-R3ZHTVU4.js} +20 -19
  102. package/index.js +95 -64
  103. package/{localDialogRead-2VRI24F4.js → localDialogRead-HQZPVIE3.js} +1 -1
  104. package/{localRuntimeDb-LGDF6FQP.js → localRuntimeDb-THJZGAOJ.js} +1 -1
  105. package/{machineCommands-WRWF2ICZ.js → machineCommands-JF2YL34J.js} +62 -56
  106. package/{machineWsRunDispatch-ZX7Q3TWZ.js → machineWsRunDispatch-ON4AEOJL.js} +54 -48
  107. package/{models-WQ5N4OJM.js → models-5K5G2CZI.js} +1 -1
  108. package/package.json +1 -1
  109. package/queryRunOverlay-O4LOMMPO.js +161 -0
  110. package/{read-CN3TNXIP.js → read-3FMPZPER.js} +3 -3
  111. package/{readDocTool-WF3675ED.js → readDocTool-VSYHKK3V.js} +1 -1
  112. package/{readlineWorkspace-ZTGRGW46.js → readlineWorkspace-SUCINTL7.js} +354 -185
  113. package/{removeDialogAgentAction-YDHBFEGI.js → removeDialogAgentAction-OAGA2G3U.js} +10 -9
  114. package/{runAgentClientLoop-JZCOP7LG.js → runAgentClientLoop-OBD2AVEL.js} +43 -37
  115. package/runOverlayPresentation-ZO4VCWEU.js +11 -0
  116. package/{runtimeDoctorCommands-THIHX2SY.js → runtimeDoctorCommands-E2OUORHK.js} +6 -6
  117. package/setDialogExtraReferencesAction-JZEXA5SL.js +27 -0
  118. package/{setPrimaryDialogAgentAction-IIVDCY5C.js → setPrimaryDialogAgentAction-4ZUQQKDG.js} +26 -17
  119. package/{settingSlice-O23YDK2O.js → settingSlice-7MNKHZ6R.js} +9 -8
  120. package/{skillDiscovery-6M2BZUFN.js → skillDiscovery-KJWT7JBU.js} +3 -3
  121. package/{spaceCommands-VV4GTPQK.js → spaceCommands-32NTNLHS.js} +30 -27
  122. package/{spaceSlice-DRWWZJP7.js → spaceSlice-P7VOXLY6.js} +19 -18
  123. package/{streamAgentChatTurn-Y6WGATQR.js → streamAgentChatTurn-UHEMNI3X.js} +97 -56
  124. package/{tableCommands-3P7MJ3PF.js → tableCommands-BEQAGE4I.js} +1 -1
  125. package/{tools-PUNBY3AH.js → tools-BMXIXHMB.js} +32 -27
  126. package/{tuiSummaryLlmCaller-F64WLSAF.js → tuiSummaryLlmCaller-VUNVBRX3.js} +5 -4
  127. package/types-ZSTJ7MPR.js +7 -0
  128. package/{updateDialogTitleAction-YSR4TCMB.js → updateDialogTitleAction-LJBDYZLH.js} +22 -21
  129. package/{chunk-O4BU24WZ.js → chunk-6Y7A3OQQ.js} +3 -3
  130. package/{chunk-XBS2WYJ2.js → chunk-RK5NYQEL.js} +0 -0
  131. package/{chunk-CMKUBIGW.js → chunk-X7W4TNB4.js} +3 -3
  132. package/{localRuntimeAuthority-TEGCOWX4.js → localRuntimeAuthority-4IXJCHZ7.js} +3 -3
@@ -1,3 +1,6 @@
1
+ import {
2
+ isAgentRunTerminalStatus
3
+ } from "./chunk-FKXFCYVO.js";
1
4
  import {
2
5
  isCompiledBinary,
3
6
  resolveCliEntrypointPath
@@ -7,7 +10,17 @@ import {
7
10
  import { homedir as nodeHomedir } from "node:os";
8
11
  import { isAbsolute, join, resolve } from "node:path";
9
12
  import * as nodeFs from "node:fs";
10
- import { spawn as nodeSpawn } from "node:child_process";
13
+ import { execFileSync as nodeExecFileSync, spawn as nodeSpawn } from "node:child_process";
14
+ var RUN_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
15
+ "done",
16
+ "failed",
17
+ "timeout",
18
+ "killed",
19
+ "orphaned"
20
+ ]);
21
+ function isRunTerminalStatus(status) {
22
+ return isAgentRunTerminalStatus(status);
23
+ }
11
24
  function resolveNoloHome(env, homedir = nodeHomedir) {
12
25
  const fromEnv = env?.NOLO_HOME;
13
26
  if (typeof fromEnv === "string" && fromEnv.length > 0) return fromEnv;
@@ -27,6 +40,11 @@ function defaultGenerateRunId() {
27
40
  const random = Math.random().toString(36).slice(2, 8);
28
41
  return `run-${timestamp}-${random}`;
29
42
  }
43
+ function defaultGenerateBatchId() {
44
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
45
+ const random = Math.random().toString(36).slice(2, 8);
46
+ return `batch-${timestamp}-${random}`;
47
+ }
30
48
  function writeRunRecord(record, deps = {}) {
31
49
  const fs = deps.fs ?? nodeFs;
32
50
  const path = resolveRunRecordPath(record.runId, deps.env, deps.homedir);
@@ -149,6 +167,89 @@ function findRunRecord(target, deps = {}) {
149
167
  }
150
168
  return readRunRecord(target, deps) ?? void 0;
151
169
  }
170
+ var DEFAULT_LIST_LIMIT = 20;
171
+ var MAX_LIST_LIMIT = 200;
172
+ function parseStatusFilter(status) {
173
+ if (typeof status !== "string" || status.trim() === "" || status === "all") {
174
+ return void 0;
175
+ }
176
+ const parts = status.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
177
+ return parts.length > 0 ? new Set(parts) : void 0;
178
+ }
179
+ function clampLimit(limit) {
180
+ if (typeof limit !== "number" || !Number.isFinite(limit) || limit <= 0) {
181
+ return DEFAULT_LIST_LIMIT;
182
+ }
183
+ const floored = Math.floor(limit);
184
+ if (floored > MAX_LIST_LIMIT) return MAX_LIST_LIMIT;
185
+ if (floored < 1) return 1;
186
+ return floored;
187
+ }
188
+ function queryRunRecords(query, deps = {}) {
189
+ let records = listRunRecords(deps);
190
+ records = records.map(
191
+ (record) => record.status === "running" ? checkStaleRun(record.runId, deps) ?? record : record
192
+ );
193
+ const statusSet = parseStatusFilter(query.status);
194
+ const batchId = typeof query.batchId === "string" && query.batchId.trim() !== "" ? query.batchId.trim() : void 0;
195
+ const parentDialogId = typeof query.parentDialogId === "string" && query.parentDialogId.trim() !== "" ? query.parentDialogId.trim() : void 0;
196
+ let filtered = records.filter((record) => {
197
+ if (batchId && record.batchId !== batchId) return false;
198
+ if (parentDialogId && record.parentDialogId !== parentDialogId) return false;
199
+ if (statusSet && !statusSet.has(record.status)) return false;
200
+ return true;
201
+ });
202
+ const total = filtered.length;
203
+ const limit = clampLimit(query.limit);
204
+ const offset = typeof query.offset === "number" && Number.isFinite(query.offset) && query.offset > 0 ? Math.floor(query.offset) : 0;
205
+ const sliced = filtered.slice(offset, offset + limit);
206
+ const hasMore = offset + sliced.length < total;
207
+ return { runs: sliced, total, hasMore };
208
+ }
209
+ var DEFAULT_GC_RETENTION_MS = 7 * 24 * 60 * 60 * 1e3;
210
+ function tryUnlinkFile(fs, path) {
211
+ if (typeof path !== "string" || path.length === 0) return true;
212
+ try {
213
+ if (fs.existsSync(path)) {
214
+ fs.unlinkSync(path);
215
+ }
216
+ return true;
217
+ } catch (error) {
218
+ const code = error.code;
219
+ return code === "ENOENT";
220
+ }
221
+ }
222
+ function gcRunRecords(deps = {}, options = {}) {
223
+ const fs = deps.fs ?? nodeFs;
224
+ const now = (deps.now ?? (() => /* @__PURE__ */ new Date()))();
225
+ const nowMs = now instanceof Date ? now.getTime() : Date.parse(String(now));
226
+ const retentionMs = typeof options.retentionMs === "number" && options.retentionMs >= 0 ? options.retentionMs : DEFAULT_GC_RETENTION_MS;
227
+ const records = listRunRecords(deps);
228
+ const sweptIds = [];
229
+ const failedIds = [];
230
+ for (const record of records) {
231
+ if (!isRunTerminalStatus(record.status)) continue;
232
+ const ts = record.reconciledAt ?? record.endedAt ?? record.startedAt;
233
+ const ageMs = nowMs - new Date(ts).getTime();
234
+ if (!Number.isFinite(ageMs) || ageMs < retentionMs) continue;
235
+ const jsonPath = resolveRunRecordPath(record.runId, deps.env, deps.homedir);
236
+ const logPath = resolveRunLogPath(record.runId, deps.env, deps.homedir);
237
+ const msgPath = record.msgFile ?? join(resolveRunsDir(deps.env, deps.homedir), `${record.runId}.msg.md`);
238
+ const logOk = tryUnlinkFile(fs, logPath);
239
+ const msgOk = tryUnlinkFile(fs, msgPath);
240
+ if (!logOk || !msgOk) {
241
+ failedIds.push(record.runId);
242
+ continue;
243
+ }
244
+ const jsonOk = tryUnlinkFile(fs, jsonPath);
245
+ if (jsonOk) {
246
+ sweptIds.push(record.runId);
247
+ } else {
248
+ failedIds.push(record.runId);
249
+ }
250
+ }
251
+ return { swept: sweptIds.length, sweptIds, failedIds };
252
+ }
152
253
  function stripBackgroundFlag(args) {
153
254
  const result = [];
154
255
  for (const arg of args) {
@@ -219,6 +320,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
219
320
  const generateRunId = deps.generateRunId ?? defaultGenerateRunId;
220
321
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
221
322
  const runId = generateRunId();
323
+ const batchId = input.batchId ?? (deps.generateBatchId ?? defaultGenerateBatchId)();
222
324
  const logPath = resolveRunLogPath(runId, env, homedir);
223
325
  const recordPath = resolveRunRecordPath(runId, env, homedir);
224
326
  const runsDir = resolveRunsDir(env, homedir);
@@ -237,7 +339,9 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
237
339
  startedAt: now().toISOString(),
238
340
  ...typeof input.timeoutMs === "number" ? { timeoutMs: input.timeoutMs } : {},
239
341
  status: "running",
240
- logPath
342
+ logPath,
343
+ batchId,
344
+ ...typeof input.parentDialogId === "string" && input.parentDialogId.trim() ? { parentDialogId: input.parentDialogId.trim() } : {}
241
345
  };
242
346
  fs.writeFileSync(recordPath, JSON.stringify(record, null, 2));
243
347
  const { execPath, childArgs } = buildAgentRunChildCommand({
@@ -261,9 +365,11 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
261
365
  proc.unref();
262
366
  if (typeof proc.pid === "number") {
263
367
  record.pid = proc.pid;
368
+ const processStartedAt = (deps.getProcessStartTime ?? defaultGetProcessStartTime)(proc.pid);
369
+ if (processStartedAt) record.processStartedAt = processStartedAt.toISOString();
264
370
  fs.writeFileSync(recordPath, JSON.stringify(record, null, 2));
265
371
  }
266
- return { runId, pid: proc.pid, logPath };
372
+ return { runId, pid: proc.pid, logPath, batchId };
267
373
  }
268
374
  function finalizeRunRecord(runId, update, deps = {}) {
269
375
  const record = readRunRecord(runId, deps);
@@ -285,16 +391,49 @@ function isPidGone(pid, deps = {}) {
285
391
  return code === "ESRCH";
286
392
  }
287
393
  }
394
+ function defaultGetProcessStartTime(pid) {
395
+ try {
396
+ const output = nodeExecFileSync("ps", ["-o", "lstart=", "-p", String(pid)], {
397
+ encoding: "utf8",
398
+ stdio: ["ignore", "pipe", "ignore"],
399
+ timeout: 1e3
400
+ }).trim();
401
+ if (!output) return null;
402
+ const d = new Date(output);
403
+ return isNaN(d.getTime()) ? null : d;
404
+ } catch {
405
+ return null;
406
+ }
407
+ }
408
+ var MAX_PROCESS_START_TIME_DIFF_MS = 3e4;
409
+ var MAX_PERSISTED_PROCESS_START_TIME_DIFF_MS = 1e3;
410
+ function isPidReused(pid, expectedStartedAt, deps = {}, maxDiffMs = MAX_PROCESS_START_TIME_DIFF_MS) {
411
+ const getStartTime = deps.getProcessStartTime ?? defaultGetProcessStartTime;
412
+ const procStartTime = getStartTime(pid);
413
+ if (!procStartTime) {
414
+ return false;
415
+ }
416
+ const recordTime = new Date(expectedStartedAt).getTime();
417
+ if (isNaN(recordTime)) return false;
418
+ const diffMs = Math.abs(procStartTime.getTime() - recordTime);
419
+ return diffMs > maxDiffMs;
420
+ }
288
421
  function checkStaleRun(runId, deps = {}) {
289
422
  const record = readRunRecord(runId, deps);
290
423
  if (!record) return null;
291
424
  if (record.status !== "running") return record;
292
425
  if (typeof record.pid !== "number") return record;
293
- if (!isPidGone(record.pid, deps)) return record;
426
+ const pidGone = isPidGone(record.pid, deps);
427
+ const expectedStartedAt = record.processStartedAt ?? record.startedAt;
428
+ const maxStartTimeDiffMs = record.processStartedAt ? MAX_PERSISTED_PROCESS_START_TIME_DIFF_MS : MAX_PROCESS_START_TIME_DIFF_MS;
429
+ const pidReused = !pidGone && isPidReused(record.pid, expectedStartedAt, deps, maxStartTimeDiffMs);
430
+ if (!pidGone && !pidReused) return record;
294
431
  const now = deps.now ?? (() => /* @__PURE__ */ new Date());
295
- record.status = "failed";
296
- record.note = "process gone: pid no longer exists";
432
+ record.status = "orphaned";
433
+ record.note = pidReused ? "orphaned: process gone (pid reused by another process)" : "orphaned: process gone without writing terminal status";
297
434
  record.endedAt = now().toISOString();
435
+ record.reconciledAt = now().toISOString();
436
+ record.pid = void 0;
298
437
  writeRunRecord(record, deps);
299
438
  return record;
300
439
  }
@@ -650,23 +789,34 @@ async function runAgentKillCommand(args, deps) {
650
789
  }
651
790
 
652
791
  export {
792
+ RUN_TERMINAL_STATUSES,
793
+ isRunTerminalStatus,
653
794
  resolveNoloHome,
654
795
  resolveRunsDir,
655
796
  resolveRunRecordPath,
656
797
  resolveRunLogPath,
657
798
  defaultGenerateRunId,
799
+ defaultGenerateBatchId,
658
800
  writeRunRecord,
659
801
  createRunActivityTracker,
660
802
  readRunRecord,
661
803
  listRunRecords,
662
804
  findRunRecordByPid,
663
805
  findRunRecord,
806
+ DEFAULT_LIST_LIMIT,
807
+ MAX_LIST_LIMIT,
808
+ queryRunRecords,
809
+ DEFAULT_GC_RETENTION_MS,
810
+ gcRunRecords,
664
811
  stripBackgroundFlag,
665
812
  absolutizeSkillArgs,
666
813
  rewriteMsgFileArg,
667
814
  spawnLocalBackgroundRun,
668
815
  finalizeRunRecord,
669
816
  isPidGone,
817
+ defaultGetProcessStartTime,
818
+ MAX_PROCESS_START_TIME_DIFF_MS,
819
+ isPidReused,
670
820
  checkStaleRun,
671
821
  runAgentPsCommand,
672
822
  runAgentStatusCommand,
@@ -1,3 +1,6 @@
1
+ import {
2
+ getAntigravityUserAgent
3
+ } from "./chunk-L6NVTGI7.js";
1
4
  import {
2
5
  writeOAuthCredential
3
6
  } from "./chunk-JZPBVBIY.js";
@@ -167,7 +170,7 @@ var SCOPES = [
167
170
  var AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
168
171
  var TOKEN_URL = "https://oauth2.googleapis.com/token";
169
172
  var USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json";
170
- var CLOUD_CODE_ENDPOINT = "https://cloudcode-pa.googleapis.com";
173
+ var CLOUD_CODE_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
171
174
  var TIER_LEGACY = "legacy-tier";
172
175
  var PROJECT_ONBOARD_MAX_ATTEMPTS = 5;
173
176
  var PROJECT_ONBOARD_INTERVAL_MS = 2e3;
@@ -241,7 +244,11 @@ async function onboardProjectWithRetries(fetchImpl, endpoint, headers, onboardBo
241
244
  async function discoverProject(fetchImpl, accessToken, onProgress) {
242
245
  const headers = {
243
246
  Authorization: `Bearer ${accessToken}`,
244
- "Content-Type": "application/json"
247
+ "Content-Type": "application/json",
248
+ // Google's Cloud Code Assist API validates the Antigravity client
249
+ // User-Agent; requests without it are rejected even with a valid token.
250
+ // (Matches oh-my-pi's google-antigravity.ts discoverProject.)
251
+ "User-Agent": getAntigravityUserAgent()
245
252
  };
246
253
  onProgress?.("Checking for existing project...");
247
254
  const endpoint = CLOUD_CODE_ENDPOINT;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-EABWT43X.js";
4
+ } from "./chunk-RVOUXDFU.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -10,16 +10,16 @@ import {
10
10
  sanitizeShareData,
11
11
  shareKey,
12
12
  toNonEmptyString
13
- } from "./chunk-O4BU24WZ.js";
13
+ } from "./chunk-6Y7A3OQQ.js";
14
14
  import {
15
15
  noloDeleteRequest,
16
16
  noloWriteRequest,
17
17
  selectIdentityUser,
18
18
  selectIdentityUserId
19
- } from "./chunk-DVRHHFEA.js";
19
+ } from "./chunk-XMLRJUU5.js";
20
20
  import {
21
21
  normalizeTimeFields
22
- } from "./chunk-OOSFSFMA.js";
22
+ } from "./chunk-R5V5G73M.js";
23
23
 
24
24
  // packages/share/action.ts
25
25
  var generateToken = () => {