lody 0.107.1 → 0.107.2

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.
@@ -1,4 +1,4 @@
1
- import { s as startProcessLegacy, b as runPromise, c as raceAll, p as promise, d as sleep, t as terminateChildTreeLegacy, e as provide, f as runCommand, g as processLayer } from "./chunks/process-BtjcB84l.js";
1
+ import { s as startProcessLegacy, b as runPromise, c as raceAll, p as promise, d as sleep, t as terminateChildTreeLegacy, e as provide, f as runCommand, g as processLayer } from "./chunks/process-CoLmXmOP.js";
2
2
  import { createServer } from "node:net";
3
3
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
4
4
  import { mkdtemp, writeFile, rm } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { h as tracerLogger$1, i as effect, w as withFiber, j as fnUntraced, k as isEffect, C as CurrentLoggers$1, l as loggerMake, m as getAugmentedNamespace, n as commonjsGlobal, o as getDefaultExportFromCjs, q as merge, u as CurrentLogAnnotations, v as succeed, M as MinimumLogLevel, g as processLayer, x as nodeProcessLive, s as startProcessLegacy } from "./process-BtjcB84l.js";
1
+ import { h as tracerLogger$1, i as effect, w as withFiber, j as fnUntraced, k as isEffect, C as CurrentLoggers$1, l as loggerMake, m as getAugmentedNamespace, n as commonjsGlobal, o as getDefaultExportFromCjs, q as merge, u as CurrentLogAnnotations, v as succeed, M as MinimumLogLevel, g as processLayer, x as nodeProcessLive, s as startProcessLegacy } from "./process-CoLmXmOP.js";
2
2
  import { EventEmitter } from "node:events";
3
3
  import require$$0$1 from "util";
4
4
  import os__default$1 from "os";
@@ -17044,4 +17044,4 @@ export {
17044
17044
  readLatestLogTail as y,
17045
17045
  createFileLogger as z
17046
17046
  };
17047
- //# sourceMappingURL=cloudflared-native-Dd9HKiet.js.map
17047
+ //# sourceMappingURL=cloudflared-native-2AOPFkF0.js.map
@@ -3,8 +3,8 @@ import "path";
3
3
  import "node:fs";
4
4
  import "node:readline";
5
5
  import "node:async_hooks";
6
- import "./cloudflared-native-Dd9HKiet.js";
7
- import "./process-BtjcB84l.js";
6
+ import "./cloudflared-native-2AOPFkF0.js";
7
+ import "./process-CoLmXmOP.js";
8
8
  import "node:child_process";
9
9
  import "node:path";
10
10
  import "node:url";
@@ -55,8 +55,8 @@ import "node:crypto";
55
55
  import "fs/promises";
56
56
  import "./workspace-watch-path-policy-BRzhvEkG.js";
57
57
  import "node:string_decoder";
58
- import "./directory-handle-DBVMV7up.js";
59
- import "./diff-line-counts-kikJDhtF.js";
58
+ import "./directory-handle-C242tYw5.js";
59
+ import "./diff-line-counts-G7qDgMXg.js";
60
60
  import "perf_hooks";
61
61
  import "better-sqlite3";
62
62
  import "module";
@@ -68,7 +68,7 @@ import "dgram";
68
68
  import "timers/promises";
69
69
  import "node:timers/promises";
70
70
  import "@loro-dev/roost-node";
71
- import "./diff-worker-task-CDFiUIIJ.js";
71
+ import "./diff-worker-task-B1Ju3wjo.js";
72
72
  import "node:module";
73
73
  import "node:v8";
74
74
  import "http2";
@@ -100,4 +100,4 @@ async function executeDaemonSessionTool(context, name, args) {
100
100
  export {
101
101
  executeDaemonSessionTool
102
102
  };
103
- //# sourceMappingURL=daemon-session-tools-DD2ORwOB.js.map
103
+ //# sourceMappingURL=daemon-session-tools-C-Yrq3QD.js.map
@@ -1,7 +1,7 @@
1
1
  import { mkdtempSync, writeFileSync, rmSync } from "node:fs";
2
2
  import os__default from "node:os";
3
3
  import path__default from "node:path";
4
- import { a as runCommandTextSyncLegacy } from "./process-BtjcB84l.js";
4
+ import { a as runCommandTextSyncLegacy } from "./process-CoLmXmOP.js";
5
5
  function Diff() {
6
6
  }
7
7
  Diff.prototype = {
@@ -682,4 +682,4 @@ export {
682
682
  countTextLines as a,
683
683
  computeLineCounts as c
684
684
  };
685
- //# sourceMappingURL=diff-line-counts-kikJDhtF.js.map
685
+ //# sourceMappingURL=diff-line-counts-G7qDgMXg.js.map
@@ -1,6 +1,6 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { open, stat } from "node:fs/promises";
3
- import { c as computeLineCounts } from "./diff-line-counts-kikJDhtF.js";
3
+ import { c as computeLineCounts } from "./diff-line-counts-G7qDgMXg.js";
4
4
  async function runDiffWorkerTask(input) {
5
5
  const lineCounts = computeLineCounts(input.oldText, input.newText);
6
6
  if (input.kind === "line-count") return { kind: input.kind, lineCounts };
@@ -58,4 +58,4 @@ function nodeErrorCode(error) {
58
58
  export {
59
59
  runDiffWorkerTask as r
60
60
  };
61
- //# sourceMappingURL=diff-worker-task-CDFiUIIJ.js.map
61
+ //# sourceMappingURL=diff-worker-task-B1Ju3wjo.js.map
@@ -1,8 +1,8 @@
1
1
  import { o as object, s as string, l as literal, b as boolean, _ as _enum, u as union, n as number, d as discriminatedUnion, a as array, r as record, t as tuple, c as unknown } from "./schemas-Bue2bhN8.js";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import path__default from "node:path";
4
- import { r as runCommandTextLegacy } from "./process-BtjcB84l.js";
5
- import { a as countTextLines } from "./diff-line-counts-kikJDhtF.js";
4
+ import { r as runCommandTextLegacy } from "./process-CoLmXmOP.js";
5
+ import { a as countTextLines } from "./diff-line-counts-G7qDgMXg.js";
6
6
  _enum(["host", "write", "read"]);
7
7
  _enum([
8
8
  "not-started",
@@ -1178,4 +1178,4 @@ export {
1178
1178
  CodeCollabV2RpcContentEnvelopeSchema as y,
1179
1179
  deriveCodeCollabV2ContentKeyId as z
1180
1180
  };
1181
- //# sourceMappingURL=directory-handle-DBVMV7up.js.map
1181
+ //# sourceMappingURL=directory-handle-C242tYw5.js.map
@@ -1,6 +1,6 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import path__default from "node:path";
3
- import { r as runCommandTextLegacy } from "./process-BtjcB84l.js";
3
+ import { r as runCommandTextLegacy } from "./process-CoLmXmOP.js";
4
4
  import { d as parseReviewMarkdown, v as validateParsedReviewDocument, f as validateResolvedBlock, a as countLines, b as createSparseTextForRanges } from "./sparse-text-DcovXrdo.js";
5
5
  import "node:child_process";
6
6
  import "node:fs";
@@ -315,4 +315,4 @@ function formatGitError(error) {
315
315
  export {
316
316
  resolveReviewBundle
317
317
  };
318
- //# sourceMappingURL=index-0CiLBEDN.js.map
318
+ //# sourceMappingURL=index-BPsHGk5B.js.map
@@ -4,8 +4,8 @@ import "path";
4
4
  import "node:fs";
5
5
  import "node:readline";
6
6
  import "node:async_hooks";
7
- import "./cloudflared-native-Dd9HKiet.js";
8
- import "./process-BtjcB84l.js";
7
+ import "./cloudflared-native-2AOPFkF0.js";
8
+ import "./process-CoLmXmOP.js";
9
9
  import "node:child_process";
10
10
  import "node:path";
11
11
  import "node:url";
@@ -56,8 +56,8 @@ import "node:crypto";
56
56
  import "fs/promises";
57
57
  import "./workspace-watch-path-policy-BRzhvEkG.js";
58
58
  import "node:string_decoder";
59
- import "./directory-handle-DBVMV7up.js";
60
- import "./diff-line-counts-kikJDhtF.js";
59
+ import "./directory-handle-C242tYw5.js";
60
+ import "./diff-line-counts-G7qDgMXg.js";
61
61
  import "perf_hooks";
62
62
  import "better-sqlite3";
63
63
  import "module";
@@ -69,7 +69,7 @@ import "dgram";
69
69
  import "timers/promises";
70
70
  import "node:timers/promises";
71
71
  import "@loro-dev/roost-node";
72
- import "./diff-worker-task-CDFiUIIJ.js";
72
+ import "./diff-worker-task-B1Ju3wjo.js";
73
73
  import "node:module";
74
74
  import "node:v8";
75
75
  import "http2";
@@ -128,4 +128,4 @@ export {
128
128
  Z as setFieldTo,
129
129
  _ as storedBaselineHashes
130
130
  };
131
- //# sourceMappingURL=index-xWWhl-Q7.js.map
131
+ //# sourceMappingURL=index-DuduZto9.js.map
@@ -6390,7 +6390,7 @@ const takeN = (self2, n) => {
6390
6390
  clear(self2);
6391
6391
  return array2;
6392
6392
  };
6393
- const take$2 = (self2) => {
6393
+ const take$3 = (self2) => {
6394
6394
  if (!self2.head) return Empty;
6395
6395
  const message = self2.head.array[self2.head.offset];
6396
6396
  if (self2.head.mutable) self2.head.array[self2.head.offset] = void 0;
@@ -6456,7 +6456,7 @@ const offerUnsafe = (self2, message) => {
6456
6456
  return false;
6457
6457
  } else if (self2.messages.length >= self2.capacity) {
6458
6458
  if (self2.strategy === "sliding") {
6459
- take$2(self2.messages);
6459
+ take$3(self2.messages);
6460
6460
  append(self2.messages, message);
6461
6461
  return true;
6462
6462
  } else if (self2.capacity <= 0 && self2.state.takers.size > 0) {
@@ -6509,13 +6509,13 @@ const takeBetween = /* @__PURE__ */ dual(3, (self2, min2, max) => {
6509
6509
  max = normalize(max);
6510
6510
  return suspendTake(() => takeBetweenUnsafe(self2, min2, max) ?? andThen$1(awaitTake(self2, () => canTake(self2, min2)), takeBetween(self2, min2, max)));
6511
6511
  });
6512
- const take$1 = (self2) => suspendTake(() => takeUnsafe(self2) ?? andThen$1(awaitTake(self2, () => canTake(self2, 1)), take$1(self2)));
6512
+ const take$2 = (self2) => suspendTake(() => takeUnsafe(self2) ?? andThen$1(awaitTake(self2, () => canTake(self2, 1)), take$2(self2)));
6513
6513
  const takeUnsafe = (self2) => {
6514
6514
  if (self2.state._tag === "Done") {
6515
6515
  return self2.state.exit;
6516
6516
  }
6517
6517
  if (self2.messages.length > 0) {
6518
- const message = take$2(self2.messages);
6518
+ const message = take$3(self2.messages);
6519
6519
  releaseCapacity(self2);
6520
6520
  return exitSucceed(message);
6521
6521
  } else if (self2.capacity <= 0 && self2.state.offers.size > 0) {
@@ -6767,7 +6767,7 @@ const withPermits = (self2, permits, effect2) => {
6767
6767
  const withPermits2 = self2.withPermits(permits);
6768
6768
  return effect2 ? withPermits2(effect2) : withPermits2;
6769
6769
  };
6770
- const take = /* @__PURE__ */ dual(2, (self2, permits) => self2.take(permits));
6770
+ const take$1 = /* @__PURE__ */ dual(2, (self2, permits) => self2.take(permits));
6771
6771
  const release = /* @__PURE__ */ dual(2, (self2, permits) => self2.release(permits));
6772
6772
  const TypeId$6 = "~effect/Channel";
6773
6773
  const isChannel = (u) => hasProperty(u, TypeId$6);
@@ -6878,7 +6878,7 @@ const mapEffectConcurrent = (self2, f, options) => fromTransformBracket(fnUntrac
6878
6878
  } else {
6879
6879
  const effects = yield* bounded(concurrencyN - 2);
6880
6880
  yield* addFinalizer$1(forkedScope, shutdown(effects));
6881
- yield* take$1(effects).pipe(flatten, flatMap((value) => offer(queue, value)), forever({
6881
+ yield* take$2(effects).pipe(flatten, flatMap((value) => offer(queue, value)), forever({
6882
6882
  disableYield: true
6883
6883
  }), catchCause((cause) => failCause(queue, cause)), forkIn(forkedScope));
6884
6884
  let errorCause;
@@ -6898,7 +6898,7 @@ const mapEffectConcurrent = (self2, f, options) => fromTransformBracket(fnUntrac
6898
6898
  disableYield: true
6899
6899
  }), catchCause((cause) => offer(effects, failCause$2(cause)).pipe(andThen(failCause(effects, cause)))), forkIn(forkedScope));
6900
6900
  }
6901
- return take$1(queue);
6901
+ return take$2(queue);
6902
6902
  }));
6903
6903
  const flattenArray = (self2) => transformPull$1(self2, (pull) => {
6904
6904
  let array2;
@@ -6965,7 +6965,7 @@ const merge$1 = /* @__PURE__ */ dual((args2) => isChannel(args2[0]) && isChannel
6965
6965
  }))), forkIn(forkedScope));
6966
6966
  yield* runSide("left", left, forkUnsafe(forkedScope));
6967
6967
  yield* runSide("right", right, forkUnsafe(forkedScope));
6968
- return take$1(queue);
6968
+ return take$2(queue);
6969
6969
  })));
6970
6970
  const splitLines$1 = () => fromTransform$1((upstream, _scope) => sync(() => {
6971
6971
  let stringBuilder = "";
@@ -7057,6 +7057,9 @@ const runWith = (self2, f, onHalt) => suspend$2(() => {
7057
7057
  const makePull = toTransform(self2)(done$1(), scope2);
7058
7058
  return catchDone(flatMap(makePull, f), onHalt ? onHalt : succeed$1).pipe(onExit$1((exit2) => close(scope2, exit2)));
7059
7059
  });
7060
+ const runDrain$1 = (self2) => runWith(self2, (pull) => forever(pull, {
7061
+ disableYield: true
7062
+ }));
7060
7063
  const runForEach$1 = /* @__PURE__ */ dual(2, (self2, f) => runWith(self2, (pull) => forever(flatMap(pull, f), {
7061
7064
  disableYield: true
7062
7065
  })));
@@ -7209,6 +7212,24 @@ const mapEffect = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self2, f,
7209
7212
  const tap = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self2, f, options) => mapEffect(self2, (a) => as(f(a), a), options));
7210
7213
  const merge = /* @__PURE__ */ dual((args2) => isStream(args2[0]) && isStream(args2[1]), (self2, that, options) => fromChannel(merge$1(toChannel(self2), toChannel(that), options)));
7211
7214
  const filter = /* @__PURE__ */ dual(2, (self2, predicate) => fromChannel(filterArray(toChannel(self2), predicate)));
7215
+ const take = /* @__PURE__ */ dual(2, (self2, n) => {
7216
+ const count = normalize(n);
7217
+ return count === 0 ? empty : takeUntil(self2, (_, i) => i === count - 1);
7218
+ });
7219
+ const takeUntil = /* @__PURE__ */ dual((args2) => isStream(args2[0]), (self2, predicate, options) => transformPull(self2, (pull, _scope) => sync(() => {
7220
+ let i = 0;
7221
+ let done2 = false;
7222
+ const pump = flatMap(suspend$2(() => done2 ? done$1() : pull), (chunk) => {
7223
+ const index = chunk.findIndex((a) => predicate(a, i++));
7224
+ if (index >= 0) {
7225
+ done2 = true;
7226
+ const arr = chunk.slice(0, options?.excludeLast ? index : index + 1);
7227
+ return isReadonlyArrayNonEmpty(arr) ? succeed$1(arr) : done$1();
7228
+ }
7229
+ return succeed$1(chunk);
7230
+ });
7231
+ return pump;
7232
+ })));
7212
7233
  const transduce = /* @__PURE__ */ dual(2, (self2, sink) => transformPull(self2, (upstream, scope2) => sync(() => {
7213
7234
  let done2;
7214
7235
  let leftover;
@@ -7253,6 +7274,7 @@ const runForEach = /* @__PURE__ */ dual(2, (self2, f) => runForEach$1(self2.chan
7253
7274
  step: constVoid
7254
7275
  });
7255
7276
  }));
7277
+ const runDrain = (self2) => runDrain$1(self2.channel);
7256
7278
  const mkString = (self2) => runFold(self2.channel, () => "", (acc, chunk) => acc + chunk.join(""));
7257
7279
  const TypeId$1 = "~effect/Ref";
7258
7280
  const RefProto = {
@@ -9173,15 +9195,15 @@ export {
9173
9195
  die$1 as c7,
9174
9196
  done as c8,
9175
9197
  isDoneUnsafe as c9,
9176
- CommandTimedOut as cA,
9177
- runCommandOk as cB,
9178
- READ_ONLY_ABANDON_POLICY as cC,
9179
- provideService as cD,
9180
- findErrorOption as cE,
9181
- isSome as cF,
9182
- CommandFailed as cG,
9183
- SpawnFailed as cH,
9184
- errnoCode as cI,
9198
+ runCommandOk as cA,
9199
+ READ_ONLY_ABANDON_POLICY as cB,
9200
+ provideService as cC,
9201
+ findErrorOption as cD,
9202
+ isSome as cE,
9203
+ CommandFailed as cF,
9204
+ SpawnFailed as cG,
9205
+ errnoCode as cH,
9206
+ squash as cI,
9185
9207
  squashProcessFailure as cJ,
9186
9208
  try_$2 as cK,
9187
9209
  fromNullishOr$2 as cL,
@@ -9220,14 +9242,14 @@ export {
9220
9242
  get as cr,
9221
9243
  make$9 as cs,
9222
9244
  ProcessReleaseFailed as ct,
9223
- squash as cu,
9224
- timeoutOrElse as cv,
9225
- asVoid as cw,
9226
- provideMerge as cx,
9227
- ChildProcessSpawner as cy,
9228
- toMillis as cz,
9245
+ timeoutOrElse as cu,
9246
+ asVoid as cv,
9247
+ provideMerge as cw,
9248
+ ChildProcessSpawner as cx,
9249
+ toMillis as cy,
9250
+ CommandTimedOut as cz,
9229
9251
  sleep as d,
9230
- runHead as d$,
9252
+ result as d$,
9231
9253
  onInterrupt as d0,
9232
9254
  suspend as d1,
9233
9255
  ensuring as d2,
@@ -9252,19 +9274,19 @@ export {
9252
9274
  modifyDelay as dL,
9253
9275
  getAndUpdate as dM,
9254
9276
  match as dN,
9255
- make$5 as dO,
9256
- shutdown as dP,
9257
- makeDieReason as dQ,
9258
- makeUnsafe$5 as dR,
9259
- result as dS,
9260
- isPidAliveSyncLegacy as dT,
9261
- scoped as dU,
9262
- ProcessCleanupFailed as dV,
9263
- runPromiseSquashedLegacy as dW,
9264
- fn as dX,
9265
- tap as dY,
9266
- map as dZ,
9267
- filter as d_,
9277
+ scoped as dO,
9278
+ retry as dP,
9279
+ min as dQ,
9280
+ exponential as dR,
9281
+ spaced as dS,
9282
+ mapEffect as dT,
9283
+ filter as dU,
9284
+ take as dV,
9285
+ runDrain as dW,
9286
+ make$5 as dX,
9287
+ shutdown as dY,
9288
+ makeDieReason as dZ,
9289
+ makeUnsafe$5 as d_,
9268
9290
  all as da,
9269
9291
  onExit$1 as db,
9270
9292
  acquireUseRelease as dc,
@@ -9282,7 +9304,7 @@ export {
9282
9304
  forkDetach as dp,
9283
9305
  unbounded as dq,
9284
9306
  offerUnsafe as dr,
9285
- take$1 as ds,
9307
+ take$2 as ds,
9286
9308
  fromReasons as dt,
9287
9309
  systemError as du,
9288
9310
  serviceOption as dv,
@@ -9291,39 +9313,42 @@ export {
9291
9313
  effectify as dy,
9292
9314
  callback as dz,
9293
9315
  provide as e,
9294
- getOrThrow as e0,
9295
- spawn as e1,
9296
- terminateTree as e2,
9297
- exists as e3,
9298
- logWarning as e4,
9299
- spawnProcess as e5,
9300
- TerminationFailed as e6,
9301
- makeProcessRunnerLegacy as e7,
9302
- unwrapSpawnFailure as e8,
9303
- repeat as e9,
9304
- spaced as ea,
9305
- orElseSucceed as eb,
9306
- min as ec,
9307
- exponential as ed,
9308
- minutes as ee,
9309
- jittered as ef,
9310
- while_ as eg,
9311
- retry as eh,
9312
- takeBetween as ei,
9313
- forkScoped as ej,
9314
- unwrap$3 as ek,
9315
- dropping as el,
9316
- makeUnsafe$1 as em,
9317
- CommandOutputTooLarge as en,
9318
- take as eo,
9319
- release as ep,
9320
- withPermits as eq,
9321
- posixGroupTree as er,
9322
- waitUntilGone as es,
9323
- Effect as et,
9324
- childProcessTree as eu,
9325
- hasExited as ev,
9326
- isDone as ew,
9316
+ isPidAliveSyncLegacy as e0,
9317
+ ProcessCleanupFailed as e1,
9318
+ runPromiseSquashedLegacy as e2,
9319
+ fn as e3,
9320
+ tap as e4,
9321
+ map as e5,
9322
+ runHead as e6,
9323
+ getOrThrow as e7,
9324
+ spawn as e8,
9325
+ terminateTree as e9,
9326
+ exists as ea,
9327
+ logWarning as eb,
9328
+ spawnProcess as ec,
9329
+ TerminationFailed as ed,
9330
+ makeProcessRunnerLegacy as ee,
9331
+ unwrapSpawnFailure as ef,
9332
+ repeat as eg,
9333
+ orElseSucceed as eh,
9334
+ minutes as ei,
9335
+ jittered as ej,
9336
+ while_ as ek,
9337
+ takeBetween as el,
9338
+ forkScoped as em,
9339
+ unwrap$3 as en,
9340
+ dropping as eo,
9341
+ makeUnsafe$1 as ep,
9342
+ CommandOutputTooLarge as eq,
9343
+ take$1 as er,
9344
+ release as es,
9345
+ withPermits as et,
9346
+ posixGroupTree as eu,
9347
+ waitUntilGone as ev,
9348
+ Effect as ew,
9349
+ childProcessTree as ex,
9350
+ hasExited as ey,
9351
+ isDone as ez,
9327
9352
  runCommand as f,
9328
9353
  processLayer as g,
9329
9354
  tracerLogger as h,
@@ -9346,4 +9371,4 @@ export {
9346
9371
  dual as y,
9347
9372
  assignProperty as z
9348
9373
  };
9349
- //# sourceMappingURL=process-BtjcB84l.js.map
9374
+ //# sourceMappingURL=process-CoLmXmOP.js.map
@@ -2,8 +2,8 @@ import { createHash } from "node:crypto";
2
2
  import { readFile, mkdir, writeFile, rename } from "node:fs/promises";
3
3
  import path__default from "node:path";
4
4
  import process from "node:process";
5
- import { g as getLodyDataDir } from "./cloudflared-native-Dd9HKiet.js";
6
- import "./process-BtjcB84l.js";
5
+ import { g as getLodyDataDir } from "./cloudflared-native-2AOPFkF0.js";
6
+ import "./process-CoLmXmOP.js";
7
7
  import "node:child_process";
8
8
  import "node:fs";
9
9
  import "node:url";
@@ -27,7 +27,7 @@ import "node:util";
27
27
  import "node:os";
28
28
  import "node:zlib";
29
29
  import "./schemas-Bue2bhN8.js";
30
- const reviewViewerVersion = "0.107.1";
30
+ const reviewViewerVersion = "0.107.2";
31
31
  const reviewViewerSha256 = "d1ba5702aa0bd441b40492bd916d6412f8b970e92683f7073878a36efbdb0649";
32
32
  const reviewViewerFileName = "standalone.html";
33
33
  const DEFAULT_CDN_BASES = ["https://cdn.jsdelivr.net/npm", "https://unpkg.com"];
@@ -102,4 +102,4 @@ async function resolveReviewViewerTemplate() {
102
102
  export {
103
103
  resolveReviewViewerTemplate
104
104
  };
105
- //# sourceMappingURL=review-viewer-D-w4J0sc.js.map
105
+ //# sourceMappingURL=review-viewer-DWax4Zej.js.map
@@ -1,6 +1,6 @@
1
- import { s as startCloudflaredNative, C as CloudflaredError } from "./chunks/cloudflared-native-Dd9HKiet.js";
1
+ import { s as startCloudflaredNative, C as CloudflaredError } from "./chunks/cloudflared-native-2AOPFkF0.js";
2
2
  import { t as tuple, s as string, o as object, l as literal } from "./chunks/schemas-Bue2bhN8.js";
3
- import "./chunks/process-BtjcB84l.js";
3
+ import "./chunks/process-CoLmXmOP.js";
4
4
  import "node:child_process";
5
5
  import "node:fs";
6
6
  import "node:path";
@@ -1,11 +1,11 @@
1
- import { r as runDiffWorkerTask } from "./chunks/diff-worker-task-CDFiUIIJ.js";
1
+ import { r as runDiffWorkerTask } from "./chunks/diff-worker-task-B1Ju3wjo.js";
2
2
  import "node:crypto";
3
3
  import "node:fs/promises";
4
- import "./chunks/diff-line-counts-kikJDhtF.js";
4
+ import "./chunks/diff-line-counts-G7qDgMXg.js";
5
5
  import "node:fs";
6
6
  import "node:os";
7
7
  import "node:path";
8
- import "./chunks/process-BtjcB84l.js";
8
+ import "./chunks/process-CoLmXmOP.js";
9
9
  import "node:child_process";
10
10
  import "node:url";
11
11
  import "child_process";
@@ -1,8 +1,8 @@
1
1
  import { opendir } from "node:fs/promises";
2
2
  import path__default from "node:path";
3
- import { b as buildCodeCollabFileIndexState, s as scanGitDirectoryEntries, j as joinWorkspacePath, i as isInsideGitWorktree, c as computeAllChanges, p as pathSegmentComparisonKey, a as closeDirectoryQuietly } from "./chunks/directory-handle-DBVMV7up.js";
3
+ import { b as buildCodeCollabFileIndexState, s as scanGitDirectoryEntries, j as joinWorkspacePath, i as isInsideGitWorktree, c as computeAllChanges, p as pathSegmentComparisonKey, a as closeDirectoryQuietly } from "./chunks/directory-handle-C242tYw5.js";
4
4
  import "./chunks/schemas-Bue2bhN8.js";
5
- import "./chunks/process-BtjcB84l.js";
5
+ import "./chunks/process-CoLmXmOP.js";
6
6
  import "node:child_process";
7
7
  import "node:fs";
8
8
  import "node:url";
@@ -10,7 +10,7 @@ import "child_process";
10
10
  import "path";
11
11
  import "fs";
12
12
  import "node:stream";
13
- import "./chunks/diff-line-counts-kikJDhtF.js";
13
+ import "./chunks/diff-line-counts-G7qDgMXg.js";
14
14
  import "node:os";
15
15
  const DEFAULT_IGNORED_DIRECTORY_NAMES = /* @__PURE__ */ new Set([
16
16
  ".git",
package/dist/index.js CHANGED
@@ -6,13 +6,13 @@ import fs__default$1, { createReadStream, existsSync, readlinkSync, readFileSync
6
6
  import * as readline$1 from "node:readline";
7
7
  import readline__default, { createInterface } from "node:readline";
8
8
  import require$$5$3, { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
9
- import { g as getLodyDataDir, r as resolvePlatformKind, a as requireMs, b as getLogger, f as formatSafeLogFields, L as LODY_LOG_DIR, c as rootLogger, t as toShared, d as LOCAL_USER_ID_PREFIX, e as LOCAL_WORKSPACE_ID_PREFIX, h as formatErrorMessage, i as getInstallationProfile, j as registerLoroSyncErrorFormatter, l as listDailyLogFiles, k as readDailyLogFile, m as formatErrorWithCauses, n as truncateLogText, w as withSpawn, p as platformLayer, o as LodyDataDirUnavailableError, q as ensureLodyDataDir, C as CloudflaredError, u as formatReportedError, v as routeLoggerToStderr, x as createHybridLogger, y as readLatestLogTail, z as createFileLogger } from "./chunks/cloudflared-native-Dd9HKiet.js";
9
+ import { g as getLodyDataDir, r as resolvePlatformKind, a as requireMs, b as getLogger, f as formatSafeLogFields, L as LODY_LOG_DIR, c as rootLogger, t as toShared, d as LOCAL_USER_ID_PREFIX, e as LOCAL_WORKSPACE_ID_PREFIX, h as formatErrorMessage, i as getInstallationProfile, j as registerLoroSyncErrorFormatter, l as listDailyLogFiles, k as readDailyLogFile, m as formatErrorWithCauses, n as truncateLogText, w as withSpawn, p as platformLayer, o as LodyDataDirUnavailableError, q as ensureLodyDataDir, C as CloudflaredError, u as formatReportedError, v as routeLoggerToStderr, x as createHybridLogger, y as readLatestLogTail, z as createFileLogger } from "./chunks/cloudflared-native-2AOPFkF0.js";
10
10
  import * as fs from "fs";
11
11
  import fs__default, { promises, readFileSync as readFileSync$1, writeFileSync, mkdirSync as mkdirSync$1, lstatSync as lstatSync$1, unlinkSync, realpathSync as realpathSync$1, statSync as statSync$1, accessSync as accessSync$1, constants as constants$8, existsSync as existsSync$1 } from "fs";
12
12
  import * as crypto$4 from "crypto";
13
13
  import crypto__default, { randomUUID as randomUUID$1, createHash as createHash$1, randomBytes as randomBytes$4, webcrypto, createHmac, createSign, createCipheriv, createDecipheriv, timingSafeEqual as timingSafeEqual$1 } from "crypto";
14
14
  import { j as _coercedNumber, Z as ZodNumber, o as object$1, s as string$4, l as literal, d as discriminatedUnion, _ as _enum, a as array$1, n as number$3, b as boolean$1, r as record$7, c as unknown$1, p as preprocess$1, u as union$1, g as _null, k as custom, m as ZodObject, q as ZodLiteral, v as json$1, w as ZodError, x as safeParse, y as ZodOptional, z as ZodNullable, A as ZodPipe, B as ZodUnion, C as ZodArray, D as ZodNever, E as ZodDiscriminatedUnion, F as _instanceof, G as uuid, N as NEVER, H as lazy, h as looseObject, e as intersection, I as optional$2, J as datetime, f as url, K as any, L as toJSONSchema, M as date, O as email, t as tuple, P as xor, Q as never$2 } from "./chunks/schemas-Bue2bhN8.js";
15
- import { T as Tuple, y as dual, z as assignProperty, A as withFiber, B as succeed$1, R as Random$1, D as none, E as some, F as identity$2, G as hash$1, H as symbol, I as pipe$2, J as isNone, K as equals, L as symbol$1, N as optimize, O as NodeInspectSymbol, P as toJson, Q as format$2, S as pipeArguments, U as hasProperty, V as string$5, W as backEdges, X as combine$1, Y as BaseProto, Z as seconds, _ as PipeInspectableProto, $ as isString$1, a0 as structure, a1 as redact$1, a2 as symbolRedactable, a3 as get$2, a4 as Reference, a5 as strictEqual, a6 as fromIterable$1, a7 as array$2, a8 as make$d, a9 as makeEquivalence$2, aa as memoize, ab as succeed$2, ac as isReadonlyArrayNonEmpty, ad as map$3, ae as formatPath, af as isFailReason, ag as Prototype, ah as Class, ai as resolveConcurrency, aj as fail, ak as effectIsExit, al as die$1, am as iterateConcurrent, an as fnUntracedEager, ao as flatMap$1, ap as exit$1, aq as flatMapEager, ar as void_, as as args$1, at as fail$1, au as append, av as iterateEager, aw as failCause, ax as map$4, ay as memoizeIdempotent, az as isFunction$2, aA as isPropertyKey, aB as isNotNullish, aC as empty$7, aD as isArrayNonEmpty, aE as formatPropertyKey, aF as suspend, aG as isObjectKeyword, aH as catchCause, aI as isUnknown, aJ as isNumber$1, aK as isBoolean, aL as mapEager, aM as failCauseSync, aN as isSuccess, aO as runSyncExit, aP as die$2, aQ as succeed$3, aR as fail$2, aS as mapError, aT as TaggedError, aU as setStackTraceLimit, aV as getStackTraceLimit, aW as Service, aX as try_, aY as badArgument, aZ as unwrap$1, a_ as map$5, a$ as forEach, b0 as fnUntraced, b1 as unwrap$2, b2 as fromPull, b3 as done, b4 as match$1, b5 as of$1, b6 as catchTag, b7 as as, b8 as acquireRelease, b9 as isEffect, ba as sync, bb as forkUnsafe, bc as isFailure, bd as hasInterruptsOnly, be as doneUnsafe, bf as runFork, bg as interrupt, bh as toPredicate, bi as void_$1, bj as interruptAll, bk as into, bl as compose, bm as filterInterruptors, bn as has$2, bo as empty$8, bp as makeUnsafe$1, bq as forkUnsafe$1, br as runIn, bs as makeUnsafe$2, b as runPromise, bt as runPromiseWith, bu as runPromiseExit, bv as runPromiseExitWith, bw as runSync$1, bx as runSyncWith, by as runSyncExitWith, bz as runCallback, bA as runCallbackWith, bB as runForkWith, bC as scopeRemoveFinalizerUnsafe, bD as close, bE as tap$1, bF as buildWithMemoMap, bG as flatten, bH as await_, bI as makeMemoMapUnsafe, bJ as provideContext, bK as succeed$4, bL as ensuring, bM as interrupt$1, bN as _await, bO as tryPromise, bP as catch_, bQ as delay$4, bR as forever, bS as gen, bT as forEach$1, bU as failCause$1, bV as combine$2, bW as callback, bX as fail$3, bY as raceFirst, bZ as interruptible, d as sleep$4, b_ as andThen, b$ as make$e, c0 as make$f, c1 as hasDies, c2 as uninterruptibleMask, c3 as forkIn, c4 as join, c5 as timeout$1, c6 as uninterruptible, c7 as die$3, c8 as done$1, c9 as isDoneUnsafe, ca as addFinalizer, cb as tapCause, i as effect, cc as isInterruptReason, cd as isDieReason, ce as isCause, cf as isTimeoutError, cg as provide$1, ch as pretty, ci as currentTimeMillis, cj as sync$1, o as getDefaultExportFromCjs, ck as makeUnsafe$3, cl as modify$1, cm as set$4, cn as getUnsafe, co as fork, cp as scope, cq as make$g, cr as get$3, cs as make$h, ct as ProcessReleaseFailed, cu as squash, cv as timeoutOrElse, cw as asVoid, cx as provideMerge, q as merge$3, g as processLayer, cy as ChildProcessSpawner, cz as toMillis, cA as CommandTimedOut, cB as runCommandOk, cC as READ_ONLY_ABANDON_POLICY, cD as provideService, cE as findErrorOption, cF as isSome, cG as CommandFailed, cH as SpawnFailed, cI as errnoCode, v as succeed$5, cJ as squashProcessFailure, cK as try_$1, cL as fromNullishOr, cM as getOrUndefined, cN as isSuccess$1, cO as Class$1, cP as fromReadableStream, cQ as fail$4, cR as cached, cS as constFalse, cT as isFailure$1, cU as DisablePropagation, cV as matchCauseEffect, cW as hasInterrupts, cX as useSpan, cY as withParentSpan, cZ as TracerTimingEnabled, c_ as Clock, c$ as constTrue, d0 as onInterrupt, d1 as suspend$1, d2 as ensuring$1, d3 as addFinalizer$1, d4 as provide$2, d5 as empty$9, d6 as isPromise$2, d7 as catchIf, p as promise, d8 as orDie, d9 as mapError$1, da as all$1, db as onExit$1, dc as acquireUseRelease, dd as annotateCurrentSpan, de as withSpan, df as fail$5, dg as never$1, dh as yieldNow, di as logDebug, e as provide$3, dj as Scope, dk as context, dl as ignoreCause, dm as timeoutOption, dn as TimeoutError$2, dp as forkDetach, dq as unbounded, dr as offerUnsafe, ds as take$1, n as commonjsGlobal, m as getAugmentedNamespace, dt as fromReasons, s as startProcessLegacy, du as systemError, dv as serviceOption, dw as flatMap$2, dx as getOrElse, dy as effectify, dz as callback$1, dA as matchEffect, dB as offer, dC as failCauseUnsafe, dD as endUnsafe, dE as mergeAll$1, dF as NodeProcess, x as nodeProcessLive, dG as probePid, dH as update, dI as tapError, dJ as toStepWithMetadata, dK as forever$1, dL as modifyDelay, dM as getAndUpdate, dN as match$2, dO as make$i, dP as shutdown, dQ as makeDieReason, dR as makeUnsafe$4, r as runCommandTextLegacy, f as runCommand$1, dS as result, dT as isPidAliveSyncLegacy, t as terminateChildTreeLegacy, dU as scoped, dV as ProcessCleanupFailed, dW as runPromiseSquashedLegacy, dX as fn, dY as tap$2, dZ as map$6, d_ as filter$1, d$ as runHead, e0 as getOrThrow, e1 as spawn, e2 as terminateTree, e3 as exists$1, e4 as logWarning, e5 as spawnProcess, e6 as TerminationFailed, e7 as makeProcessRunnerLegacy, e8 as unwrapSpawnFailure, a as runCommandTextSyncLegacy, e9 as repeat$1, ea as spaced, eb as orElseSucceed, ec as min$1, ed as exponential, ee as minutes, ef as jittered, eg as while_, eh as retry$2, ei as takeBetween, ej as forkScoped, ek as unwrap$3, el as dropping, em as makeUnsafe$5, en as CommandOutputTooLarge, eo as take$2, ep as release$1, eq as withPermits, er as posixGroupTree, es as waitUntilGone, et as Effect, eu as childProcessTree, ev as hasExited, ew as isDone } from "./chunks/process-BtjcB84l.js";
15
+ import { T as Tuple, y as dual, z as assignProperty, A as withFiber, B as succeed$1, R as Random$1, D as none, E as some, F as identity$2, G as hash$1, H as symbol, I as pipe$2, J as isNone, K as equals, L as symbol$1, N as optimize, O as NodeInspectSymbol, P as toJson, Q as format$2, S as pipeArguments, U as hasProperty, V as string$5, W as backEdges, X as combine$1, Y as BaseProto, Z as seconds, _ as PipeInspectableProto, $ as isString$1, a0 as structure, a1 as redact$1, a2 as symbolRedactable, a3 as get$2, a4 as Reference, a5 as strictEqual, a6 as fromIterable$1, a7 as array$2, a8 as make$d, a9 as makeEquivalence$2, aa as memoize, ab as succeed$2, ac as isReadonlyArrayNonEmpty, ad as map$3, ae as formatPath, af as isFailReason, ag as Prototype, ah as Class, ai as resolveConcurrency, aj as fail, ak as effectIsExit, al as die$1, am as iterateConcurrent, an as fnUntracedEager, ao as flatMap$1, ap as exit$1, aq as flatMapEager, ar as void_, as as args$1, at as fail$1, au as append, av as iterateEager, aw as failCause, ax as map$4, ay as memoizeIdempotent, az as isFunction$2, aA as isPropertyKey, aB as isNotNullish, aC as empty$7, aD as isArrayNonEmpty, aE as formatPropertyKey, aF as suspend, aG as isObjectKeyword, aH as catchCause, aI as isUnknown, aJ as isNumber$1, aK as isBoolean, aL as mapEager, aM as failCauseSync, aN as isSuccess, aO as runSyncExit, aP as die$2, aQ as succeed$3, aR as fail$2, aS as mapError, aT as TaggedError, aU as setStackTraceLimit, aV as getStackTraceLimit, aW as Service, aX as try_, aY as badArgument, aZ as unwrap$1, a_ as map$5, a$ as forEach, b0 as fnUntraced, b1 as unwrap$2, b2 as fromPull, b3 as done, b4 as match$1, b5 as of$1, b6 as catchTag, b7 as as, b8 as acquireRelease, b9 as isEffect, ba as sync, bb as forkUnsafe, bc as isFailure, bd as hasInterruptsOnly, be as doneUnsafe, bf as runFork, bg as interrupt, bh as toPredicate, bi as void_$1, bj as interruptAll, bk as into, bl as compose, bm as filterInterruptors, bn as has$2, bo as empty$8, bp as makeUnsafe$1, bq as forkUnsafe$1, br as runIn, bs as makeUnsafe$2, b as runPromise, bt as runPromiseWith, bu as runPromiseExit, bv as runPromiseExitWith, bw as runSync$1, bx as runSyncWith, by as runSyncExitWith, bz as runCallback, bA as runCallbackWith, bB as runForkWith, bC as scopeRemoveFinalizerUnsafe, bD as close, bE as tap$1, bF as buildWithMemoMap, bG as flatten, bH as await_, bI as makeMemoMapUnsafe, bJ as provideContext, bK as succeed$4, bL as ensuring, bM as interrupt$1, bN as _await, bO as tryPromise, bP as catch_, bQ as delay$4, bR as forever, bS as gen, bT as forEach$1, bU as failCause$1, bV as combine$2, bW as callback, bX as fail$3, bY as raceFirst, bZ as interruptible, d as sleep$4, b_ as andThen, b$ as make$e, c0 as make$f, c1 as hasDies, c2 as uninterruptibleMask, c3 as forkIn, c4 as join, c5 as timeout$1, c6 as uninterruptible, c7 as die$3, c8 as done$1, c9 as isDoneUnsafe, ca as addFinalizer, cb as tapCause, i as effect, cc as isInterruptReason, cd as isDieReason, ce as isCause, cf as isTimeoutError, cg as provide$1, ch as pretty, ci as currentTimeMillis, cj as sync$1, o as getDefaultExportFromCjs, ck as makeUnsafe$3, cl as modify$1, cm as set$4, cn as getUnsafe, co as fork, cp as scope, cq as make$g, cr as get$3, cs as make$h, ct as ProcessReleaseFailed, cu as timeoutOrElse, cv as asVoid, cw as provideMerge, q as merge$3, g as processLayer, cx as ChildProcessSpawner, cy as toMillis, cz as CommandTimedOut, cA as runCommandOk, cB as READ_ONLY_ABANDON_POLICY, cC as provideService, cD as findErrorOption, cE as isSome, cF as CommandFailed, cG as SpawnFailed, cH as errnoCode, v as succeed$5, cI as squash, cJ as squashProcessFailure, cK as try_$1, cL as fromNullishOr, cM as getOrUndefined, cN as isSuccess$1, cO as Class$1, cP as fromReadableStream, cQ as fail$4, cR as cached, cS as constFalse, cT as isFailure$1, cU as DisablePropagation, cV as matchCauseEffect, cW as hasInterrupts, cX as useSpan, cY as withParentSpan, cZ as TracerTimingEnabled, c_ as Clock, c$ as constTrue, d0 as onInterrupt, d1 as suspend$1, d2 as ensuring$1, d3 as addFinalizer$1, d4 as provide$2, d5 as empty$9, d6 as isPromise$2, d7 as catchIf, p as promise, d8 as orDie, d9 as mapError$1, da as all$1, db as onExit$1, dc as acquireUseRelease, dd as annotateCurrentSpan, de as withSpan, df as fail$5, dg as never$1, dh as yieldNow, di as logDebug, e as provide$3, dj as Scope, dk as context, dl as ignoreCause, dm as timeoutOption, dn as TimeoutError$2, dp as forkDetach, dq as unbounded, dr as offerUnsafe, ds as take$1, n as commonjsGlobal, m as getAugmentedNamespace, dt as fromReasons, s as startProcessLegacy, du as systemError, dv as serviceOption, dw as flatMap$2, dx as getOrElse, dy as effectify, dz as callback$1, dA as matchEffect, dB as offer, dC as failCauseUnsafe, dD as endUnsafe, dE as mergeAll$1, dF as NodeProcess, x as nodeProcessLive, dG as probePid, dH as update, dI as tapError, dJ as toStepWithMetadata, dK as forever$1, dL as modifyDelay, dM as getAndUpdate, dN as match$2, dO as scoped, dP as retry$2, dQ as min$1, dR as exponential, dS as spaced, dT as mapEffect, dU as filter$1, dV as take$2, dW as runDrain, dX as make$i, dY as shutdown, dZ as makeDieReason, d_ as makeUnsafe$4, r as runCommandTextLegacy, f as runCommand$1, d$ as result, e0 as isPidAliveSyncLegacy, t as terminateChildTreeLegacy, e1 as ProcessCleanupFailed, e2 as runPromiseSquashedLegacy, e3 as fn, e4 as tap$2, e5 as map$6, e6 as runHead, e7 as getOrThrow, e8 as spawn, e9 as terminateTree, ea as exists$1, eb as logWarning, ec as spawnProcess, ed as TerminationFailed, ee as makeProcessRunnerLegacy, ef as unwrapSpawnFailure, a as runCommandTextSyncLegacy, eg as repeat$1, eh as orElseSucceed, ei as minutes, ej as jittered, ek as while_, el as takeBetween, em as forkScoped, en as unwrap$3, eo as dropping, ep as makeUnsafe$5, eq as CommandOutputTooLarge, er as take$3, es as release$1, et as withPermits, eu as posixGroupTree, ev as waitUntilGone, ew as Effect, ex as childProcessTree, ey as hasExited, ez as isDone } from "./chunks/process-CoLmXmOP.js";
16
16
  import require$$0$3, { once, EventEmitter as EventEmitter$1 } from "node:events";
17
17
  import NodeChildProcess, { execFile, execFileSync } from "node:child_process";
18
18
  import * as path from "node:path";
@@ -63,7 +63,7 @@ import * as fs$3 from "node:fs/promises";
63
63
  import fs__default$3, { realpath, mkdir as mkdir$1, writeFile as writeFile$1, rename as rename$1, rm, symlink as symlink$1, mkdtemp, chmod as chmod$1, readFile as readFile$1, readdir, stat as stat$2, lstat, unlink, open as open$1, opendir, link as link$1 } from "node:fs/promises";
64
64
  import { a as parseWorkspaceWatchChildMessage, C as CODE_COLLAB_IGNORED_DIRECTORY_NAMES } from "./chunks/workspace-watch-path-policy-BRzhvEkG.js";
65
65
  import { StringDecoder } from "node:string_decoder";
66
- import { C as CodeCollabV2FileIndexRequestSchema, d as CodeCollabV2OpenTextRequestSchema, e as CodeCollabV2RefreshTextRequestSchema, f as CodeCollabV2SaveTextRequestSchema, g as CodeCollabV2OpenCurrentDiffRequestSchema, h as CodeCollabV2OpenAllChangesDiffRequestSchema, k as CodeCollabV2OpenTurnDiffRequestSchema, l as CodeCollabV2InitDirectoryRequestSchema, m as CodeCollabV2FileIndexSnapshotSchema, n as CodeCollabV2OpenTextOkSchema, o as CodeCollabV2RefreshTextResponseSchema, q as CodeCollabV2SaveTextResponseSchema, r as CodeCollabV2OpenCurrentDiffResponseSchema, t as CodeCollabV2OpenAllChangesDiffResponseSchema, u as CodeCollabV2OpenTurnDiffResponseSchema, v as CodeCollabV2InitDirectoryOkSchema, w as CodeCollabV2LspUnsupportedSchema, x as CodeCollabV2ErrorSchema, y as CodeCollabV2RpcContentEnvelopeSchema, z as deriveCodeCollabV2ContentKeyId, A as CodeCollabV2ErrorCodeSchema, B as CodeCollabV2RpcResponseSchema, D as deriveCodeCollabV2ContentKeyBytes, E as readCodeCollabFileIndexSignalFromFlock, F as writeCodeCollabFileIndexSignalToFlock, G as writeCodeCollabFileIndexToFlock, H as gitDiffBaseRefCandidates, b as buildCodeCollabFileIndexState, I as CODE_COLLAB_V2_TEXT_LIMITS, J as CODE_COLLAB_V2_ALL_CHANGES_DIFF_LIMITS, K as resolveAllChangesDiffBase, c as computeAllChanges, L as codeCollabFileIndexStatesEqual, s as scanGitDirectoryEntries, a as closeDirectoryQuietly } from "./chunks/directory-handle-DBVMV7up.js";
66
+ import { C as CodeCollabV2FileIndexRequestSchema, d as CodeCollabV2OpenTextRequestSchema, e as CodeCollabV2RefreshTextRequestSchema, f as CodeCollabV2SaveTextRequestSchema, g as CodeCollabV2OpenCurrentDiffRequestSchema, h as CodeCollabV2OpenAllChangesDiffRequestSchema, k as CodeCollabV2OpenTurnDiffRequestSchema, l as CodeCollabV2InitDirectoryRequestSchema, m as CodeCollabV2FileIndexSnapshotSchema, n as CodeCollabV2OpenTextOkSchema, o as CodeCollabV2RefreshTextResponseSchema, q as CodeCollabV2SaveTextResponseSchema, r as CodeCollabV2OpenCurrentDiffResponseSchema, t as CodeCollabV2OpenAllChangesDiffResponseSchema, u as CodeCollabV2OpenTurnDiffResponseSchema, v as CodeCollabV2InitDirectoryOkSchema, w as CodeCollabV2LspUnsupportedSchema, x as CodeCollabV2ErrorSchema, y as CodeCollabV2RpcContentEnvelopeSchema, z as deriveCodeCollabV2ContentKeyId, A as CodeCollabV2ErrorCodeSchema, B as CodeCollabV2RpcResponseSchema, D as deriveCodeCollabV2ContentKeyBytes, E as readCodeCollabFileIndexSignalFromFlock, F as writeCodeCollabFileIndexSignalToFlock, G as writeCodeCollabFileIndexToFlock, H as gitDiffBaseRefCandidates, b as buildCodeCollabFileIndexState, I as CODE_COLLAB_V2_TEXT_LIMITS, J as CODE_COLLAB_V2_ALL_CHANGES_DIFF_LIMITS, K as resolveAllChangesDiffBase, c as computeAllChanges, L as codeCollabFileIndexStatesEqual, s as scanGitDirectoryEntries, a as closeDirectoryQuietly } from "./chunks/directory-handle-C242tYw5.js";
67
67
  import { performance as performance$1 } from "perf_hooks";
68
68
  import require$$0$e, { EventEmitter as EventEmitter$2 } from "events";
69
69
  import require$$0$d, { Transform as Transform$1, Readable as Readable$1 } from "stream";
@@ -81,8 +81,8 @@ import { setTimeout as setTimeout$1 } from "timers/promises";
81
81
  import * as timers$2 from "node:timers/promises";
82
82
  import { setTimeout as setTimeout$2 } from "node:timers/promises";
83
83
  import { RoostHostError, RoostNativeClient } from "@loro-dev/roost-node";
84
- import { c as computeLineCounts, a as countTextLines } from "./chunks/diff-line-counts-kikJDhtF.js";
85
- import { r as runDiffWorkerTask } from "./chunks/diff-worker-task-CDFiUIIJ.js";
84
+ import { c as computeLineCounts, a as countTextLines } from "./chunks/diff-line-counts-G7qDgMXg.js";
85
+ import { r as runDiffWorkerTask } from "./chunks/diff-worker-task-B1Ju3wjo.js";
86
86
  import { createRequire as createRequire$1 } from "node:module";
87
87
  import v8 from "node:v8";
88
88
  import require$$0$f from "child_process";
@@ -4315,7 +4315,7 @@ class PostHog extends PostHogBackendClient {
4315
4315
  }
4316
4316
  const name$3 = "lody";
4317
4317
  const name$2 = "@lody/cli-cloud";
4318
- const version$g = "0.107.1";
4318
+ const version$g = "0.107.2";
4319
4319
  const type = "module";
4320
4320
  const scripts = { "dev": "node dev.mjs", "dev:staging": "LODY_ENV=staging NODE_ENV=production node dev.mjs", "build": "node build.mjs", "prepare:publish": "node prepare-publish.js", "test": "node --test pnpm-runner.test.mjs vite-config.test.mjs nightly-npm.test.mjs" };
4321
4321
  const devDependencies = { "dotenv": "^16.6.1", "vite": "^7.0.0", "vite-plugin-wasm": "catalog:" };
@@ -24715,14 +24715,17 @@ const deriveLocationsFromRawInput = (rawInput) => {
24715
24715
  if (unique.size === 0) return void 0;
24716
24716
  return Array.from(unique).map((path2) => ({ path: path2 }));
24717
24717
  };
24718
- const stripToolCallPayloadsForHistory = (content2) => content2.filter((block) => {
24719
- if (block.type !== "content") return true;
24720
- if (block.content.type === "image") return false;
24721
- if (block.content.type !== "resource") return true;
24722
- const resource = block.content.resource;
24723
- if (!("blob" in resource)) return true;
24724
- return !(typeof resource.mimeType === "string" && resource.mimeType.trim().toLowerCase().startsWith("image/") || typeof resource.uri === "string" && resource.uri.trim().toLowerCase().startsWith("data:image/"));
24725
- }).map((block) => {
24718
+ const isToolImagePayload = (value2) => {
24719
+ if (!value2 || typeof value2 !== "object") return false;
24720
+ const { type: type2, resource } = value2;
24721
+ if (type2 === "image") return true;
24722
+ if (type2 !== "resource" || !resource || typeof resource !== "object") return false;
24723
+ if (!("blob" in resource)) return false;
24724
+ const { mimeType, uri } = resource;
24725
+ return typeof mimeType === "string" && mimeType.trim().toLowerCase().startsWith("image/") || typeof uri === "string" && uri.trim().toLowerCase().startsWith("data:image/");
24726
+ };
24727
+ const stripRawOutputImagesForHistory = (output) => output.filter((item) => !isToolImagePayload(item));
24728
+ const stripToolCallPayloadsForHistory = (content2) => content2.filter((block) => block.type !== "content" || !isToolImagePayload(block.content)).map((block) => {
24726
24729
  if (block.type !== "content") return block;
24727
24730
  const value2 = block.content;
24728
24731
  if (value2.type === "resource") {
@@ -25895,8 +25898,11 @@ class NotificationOnHistoryApplier {
25895
25898
  toolName: resolveAcpToolName(update2._meta) ?? tool?.toolName,
25896
25899
  _meta: update2._meta ?? tool?._meta
25897
25900
  };
25898
- const value2 = update2.rawOutput;
25899
- if (value2 != null && !asRecordOrUndefined(value2)) {
25901
+ const raw2 = update2.rawOutput;
25902
+ const readable2 = Array.isArray(raw2) ? stripRawOutputImagesForHistory(raw2) : void 0;
25903
+ const imageOnly = readable2?.length === 0 && raw2.length > 0;
25904
+ const value2 = readable2 ?? raw2;
25905
+ if (value2 != null && !imageOnly && !asRecordOrUndefined(value2)) {
25900
25906
  const text2 = typeof value2 === "string" ? value2 : JSON.stringify(value2);
25901
25907
  const blocks = content2.content ?? [];
25902
25908
  if (!blocks.some(
@@ -81874,6 +81880,185 @@ function createSessionAgentWrites(writer) {
81874
81880
  }
81875
81881
  };
81876
81882
  }
81883
+ const STREAMS_TRANSPORT_ID = "streams";
81884
+ const isRecoverableStreamsRoomStatus = (status) => status === "disconnected" || status === "error";
81885
+ function streamsRoomBinding(sub) {
81886
+ const binding2 = sub.subscription(STREAMS_TRANSPORT_ID);
81887
+ return {
81888
+ get status() {
81889
+ return binding2.status;
81890
+ },
81891
+ onStatusChange: (listener) => binding2.onStatusChange(listener),
81892
+ get firstSyncedWithRemote() {
81893
+ return binding2.firstSyncedWithRemote;
81894
+ },
81895
+ waitUntilSynced: () => binding2.waitUntilSynced()
81896
+ };
81897
+ }
81898
+ const reportFailure = (logger2, workspaceId) => {
81899
+ try {
81900
+ logger2.debug(`[${workspaceId}] Catalog reader acquisition/baseline/cleanup failed`);
81901
+ } catch {
81902
+ }
81903
+ };
81904
+ const acquireCatalogRoom = fnUntraced(function* (repo, id2, workspaceId, logger2) {
81905
+ const pending2 = yield* acquireRelease(
81906
+ sync(() => {
81907
+ let closed = false;
81908
+ let replica;
81909
+ let room;
81910
+ const release2 = async () => {
81911
+ const releasingRoom = room;
81912
+ const releasingReplica = replica;
81913
+ room = void 0;
81914
+ replica = void 0;
81915
+ const results = await Promise.allSettled([
81916
+ Promise.resolve().then(() => releasingRoom?.unsubscribe()),
81917
+ Promise.resolve().then(() => releasingReplica?.release())
81918
+ ]);
81919
+ const errors2 = results.flatMap(
81920
+ (result2) => result2.status === "rejected" ? [result2.reason] : []
81921
+ );
81922
+ if (errors2.length) throw new AggregateError(errors2, "Catalog reader release failed");
81923
+ };
81924
+ const promise2 = (async () => {
81925
+ if (id2 !== void 0) {
81926
+ replica = await repo.acquireFlockDoc(id2);
81927
+ if (closed) {
81928
+ await release2();
81929
+ return void 0;
81930
+ }
81931
+ }
81932
+ room = await (id2 === void 0 ? repo.joinMetaRoom() : repo.joinFlockDocRoom(id2));
81933
+ if (closed) {
81934
+ await release2();
81935
+ return void 0;
81936
+ }
81937
+ return room;
81938
+ })().catch((error2) => {
81939
+ if (closed) reportFailure(logger2, workspaceId);
81940
+ throw error2;
81941
+ });
81942
+ return {
81943
+ promise: promise2,
81944
+ close: () => {
81945
+ closed = true;
81946
+ return release2();
81947
+ }
81948
+ };
81949
+ }),
81950
+ (resource) => promise(resource.close)
81951
+ );
81952
+ return yield* tryPromise({ try: () => pending2.promise, catch: (cause) => cause });
81953
+ });
81954
+ const firstBaseline = (room, workspaceId, logger2) => {
81955
+ const binding2 = room.subscription(STREAMS_TRANSPORT_ID);
81956
+ return callback$1(
81957
+ fnUntraced(function* (queue2) {
81958
+ yield* acquireRelease(
81959
+ sync(() => binding2.onStatusChange(() => offerUnsafe(queue2, void 0))),
81960
+ (unsubscribe) => sync(unsubscribe)
81961
+ );
81962
+ yield* offer(queue2, void 0);
81963
+ }),
81964
+ { bufferSize: 1, strategy: "sliding" }
81965
+ ).pipe(
81966
+ mapEffect(
81967
+ () => promise((signal) => binding2.waitFor({ phase: "caught-up", signal })).pipe(
81968
+ // A failed hydration/persistence barrier is a tagged result, not a rejection.
81969
+ // Retry only the barrier on this stable binding, retaining both reader leases.
81970
+ flatMap$1(
81971
+ (result2) => result2.status === "error" ? fail(result2.error) : succeed$1(result2)
81972
+ ),
81973
+ tapError(() => sync(() => reportFailure(logger2, workspaceId))),
81974
+ retry$2({
81975
+ schedule: min$1([exponential("1 second"), spaced("30 seconds")])
81976
+ })
81977
+ )
81978
+ ),
81979
+ filter$1((result2) => result2.status === "complete"),
81980
+ take$2(1),
81981
+ runDrain
81982
+ );
81983
+ };
81984
+ const makeWorkspaceCatalogSync = fnUntraced(function* (repo, workspaceId, logger2, requireRemoteBaseline = true) {
81985
+ const scope$1 = yield* scope;
81986
+ const held = /* @__PURE__ */ new Map();
81987
+ yield* addFinalizer(
81988
+ () => gen(function* () {
81989
+ const exits = yield* forEach$1(
81990
+ held.values(),
81991
+ (entry) => entry.fiber ? await_(entry.fiber) : succeed$1(void_)
81992
+ );
81993
+ const reasons = exits.flatMap(
81994
+ (exit2) => isFailure(exit2) ? exit2.cause.reasons.filter((reason) => reason._tag !== "Interrupt") : []
81995
+ );
81996
+ for (const entry of held.values()) yield* succeed$4(entry.ready, false);
81997
+ if (reasons.length)
81998
+ yield* die$1(
81999
+ new Error("Catalog reader cleanup failed", {
82000
+ cause: fromReasons(reasons)
82001
+ })
82002
+ );
82003
+ })
82004
+ );
82005
+ const ensure = fnUntraced(function* (id2) {
82006
+ const prior = held.get(id2);
82007
+ if (prior) return prior;
82008
+ const entry = { baseline: false, ready: makeUnsafe$1() };
82009
+ held.set(id2, entry);
82010
+ const reader = scoped(
82011
+ gen(function* () {
82012
+ const room = yield* acquireCatalogRoom(repo, id2, workspaceId, logger2);
82013
+ if (!room) return;
82014
+ if (requireRemoteBaseline) yield* firstBaseline(room, workspaceId, logger2);
82015
+ entry.baseline = true;
82016
+ yield* succeed$4(entry.ready, true);
82017
+ yield* never$1;
82018
+ })
82019
+ ).pipe(
82020
+ tapError(() => sync(() => reportFailure(logger2, workspaceId))),
82021
+ // A rejected Promise join has released its room reference in Repo 0.23.2.
82022
+ // Release defects remain defects and never start a replacement reader.
82023
+ retry$2({
82024
+ schedule: min$1([exponential("1 second"), spaced("30 seconds")])
82025
+ })
82026
+ );
82027
+ entry.fiber = yield* forkIn(reader, scope$1);
82028
+ return entry;
82029
+ });
82030
+ const hold = (id2) => ensure(id2).pipe(asVoid);
82031
+ const ready = fnUntraced(function* (id2, timeoutMs) {
82032
+ const entry = yield* ensure(id2);
82033
+ if (entry.baseline) return true;
82034
+ if (timeoutMs <= 0) return false;
82035
+ return yield* _await(entry.ready).pipe(
82036
+ timeoutOrElse({ duration: timeoutMs, orElse: () => succeed$1(false) })
82037
+ );
82038
+ });
82039
+ yield* ensure(void 0);
82040
+ yield* hold(getWorkspaceFlockDocId(workspaceId));
82041
+ return { hold, ready };
82042
+ });
82043
+ class WorkspaceCatalogSyncLegacy {
82044
+ scope = runSync$1(make$e());
82045
+ catalog;
82046
+ closing;
82047
+ constructor(repo, workspaceId, logger2, remote) {
82048
+ this.catalog = runSync$1(
82049
+ provide$2(makeWorkspaceCatalogSync(repo, workspaceId, logger2, remote), this.scope)
82050
+ );
82051
+ }
82052
+ hold(id2) {
82053
+ return this.closing ? Promise.resolve() : runPromise(this.catalog.hold(id2));
82054
+ }
82055
+ ready(id2, timeoutMs) {
82056
+ return this.closing ? Promise.resolve(false) : runPromise(this.catalog.ready(id2, timeoutMs));
82057
+ }
82058
+ close() {
82059
+ return this.closing ??= runPromise(close(this.scope, void_));
82060
+ }
82061
+ }
81877
82062
  class RoostSessionBackend {
81878
82063
  constructor(sessionDoc, services, fallbackMeta) {
81879
82064
  this.sessionDoc = sessionDoc;
@@ -95447,21 +95632,6 @@ function attachSessionModelSummary(source2, publish2, onError) {
95447
95632
  }
95448
95633
  };
95449
95634
  }
95450
- const STREAMS_TRANSPORT_ID = "streams";
95451
- const isRecoverableStreamsRoomStatus = (status) => status === "disconnected" || status === "error";
95452
- function streamsRoomBinding(sub) {
95453
- const binding2 = sub.subscription(STREAMS_TRANSPORT_ID);
95454
- return {
95455
- get status() {
95456
- return binding2.status;
95457
- },
95458
- onStatusChange: (listener) => binding2.onStatusChange(listener),
95459
- get firstSyncedWithRemote() {
95460
- return binding2.firstSyncedWithRemote;
95461
- },
95462
- waitUntilSynced: () => binding2.waitUntilSynced()
95463
- };
95464
- }
95465
95635
  const DEFAULT_RECONNECT_BASE_DELAY_MS = 1e3;
95466
95636
  const DEFAULT_RECONNECT_MAX_DELAY_MS = 3e4;
95467
95637
  const RECONNECT_JITTER_FRACTION = 0.2;
@@ -100313,6 +100483,14 @@ class LoroDocumentManager {
100313
100483
  cloudBilling;
100314
100484
  sessionHistoryFactory;
100315
100485
  ownerHistoryRouter;
100486
+ catalogSync;
100487
+ /** Reader interest belongs to the daemon, never to a discovery request. */
100488
+ async holdCatalogFlockDoc(flockDocId) {
100489
+ await this.catalogSync?.hold(flockDocId);
100490
+ }
100491
+ async catalogBaselineReady(flockDocId, timeoutMs) {
100492
+ return this.catalogSync ? this.catalogSync.ready(flockDocId, timeoutMs) : true;
100493
+ }
100316
100494
  static async create(workspaceId, userId, logger2, options2 = {}) {
100317
100495
  installCliHttpGlobalDispatcher({ logger: logger2 });
100318
100496
  const cliSqliteRepoStore = await traceAsync(
@@ -100392,6 +100570,14 @@ class LoroDocumentManager {
100392
100570
  sessionHistoryFactory: options2.sessionHistoryFactory,
100393
100571
  ownerHistoryRouter: options2.ownerHistoryRouter
100394
100572
  });
100573
+ if (options2.keepWorkspaceCatalogJoined) {
100574
+ manager.catalogSync = new WorkspaceCatalogSyncLegacy(
100575
+ createdRepo,
100576
+ workspaceId,
100577
+ logger2,
100578
+ options2.streamsTokens != null
100579
+ );
100580
+ }
100395
100581
  } catch (error2) {
100396
100582
  const failures = [error2];
100397
100583
  try {
@@ -100789,7 +100975,25 @@ class LoroDocumentManager {
100789
100975
  const timeoutMs = options2.timeoutMs ?? readTimeoutEnv("LODY_LORO_SYNC_META_TIMEOUT_MS", 2e4);
100790
100976
  const timeoutMessage = `Timeout waiting for workspace metadata sync (workspace=${this.workspaceId})`;
100791
100977
  try {
100792
- await withTimeout$2(this.repo.sync({ scope: "meta" }), timeoutMs, timeoutMessage);
100978
+ const generation = this.remoteStreamsGeneration;
100979
+ const report = await withTimeout$2(
100980
+ this.repo.sync({ scope: "meta" }),
100981
+ timeoutMs,
100982
+ timeoutMessage
100983
+ );
100984
+ if (options2.requireRemoteConfirmation) {
100985
+ if (!report.ok) throw new RepoSyncError(report);
100986
+ if (this.streamsTokens !== null || this.remoteStreamsGeneration > 0) {
100987
+ if (!report.transports.some(
100988
+ (transport) => transport.transportId === "streams" && transport.ok
100989
+ )) {
100990
+ throw new Error("No remote Streams route confirmed metadata synchronization");
100991
+ }
100992
+ if (!this.remoteStreamsAttached || generation !== this.remoteStreamsGeneration) {
100993
+ throw new Error("Remote Streams transport changed during metadata synchronization");
100994
+ }
100995
+ }
100996
+ }
100793
100997
  this.initialMetaSyncCompleted = true;
100794
100998
  } catch (error2) {
100795
100999
  throw new Error(`Workspace metadata sync failed (${reason}): ${formatErrorMessage(error2)}`, {
@@ -101361,6 +101565,11 @@ class LoroDocumentManager {
101361
101565
  async cleanUp(options2 = {}) {
101362
101566
  this.cleaningUp = true;
101363
101567
  let presenceCleanupFailure;
101568
+ try {
101569
+ await this.catalogSync?.close();
101570
+ } catch (error2) {
101571
+ presenceCleanupFailure = error2;
101572
+ }
101364
101573
  this.localDocRoomBridgeGeneration += 1;
101365
101574
  for (const docId of [...this.localDocRoomBridges.keys()]) {
101366
101575
  this.cancelLocalDocRoomBridge(docId);
@@ -101382,7 +101591,7 @@ class LoroDocumentManager {
101382
101591
  try {
101383
101592
  await this.detachRemoteStreamsTransport();
101384
101593
  } catch (error2) {
101385
- presenceCleanupFailure = error2;
101594
+ presenceCleanupFailure = presenceCleanupFailure ? new AggregateError([presenceCleanupFailure, error2], "Workspace cleanup failed") : error2;
101386
101595
  }
101387
101596
  }
101388
101597
  try {
@@ -245362,6 +245571,16 @@ async function deleteWorkspaceMcpCatalogEntry(repo, workspaceId, mcpServerId, op
245362
245571
  (flock) => deleteWorkspaceMcpServerFromFlock(flock, mcpServerId)
245363
245572
  );
245364
245573
  }
245574
+ class CatalogSyncingError extends Error {
245575
+ constructor() {
245576
+ super(
245577
+ "CATALOG_SYNCING: catalog has not completed its first synchronization; retry the request."
245578
+ );
245579
+ }
245580
+ toLodyError() {
245581
+ return { code: "CATALOG_SYNCING", message: this.message, retryable: true };
245582
+ }
245583
+ }
245365
245584
  function summarizeDiscoveryAgent(config2, capability) {
245366
245585
  return {
245367
245586
  id: config2.id,
@@ -245403,6 +245622,14 @@ class ResourceDiscovery {
245403
245622
  if (!match2) throw new Error("Machine not found or not readable.");
245404
245623
  return match2.id;
245405
245624
  }
245625
+ catalogSyncing(resource) {
245626
+ const state2 = this.source.catalogReadiness?.();
245627
+ if (!state2) return false;
245628
+ if (resource === "mcp") return !state2.workspace;
245629
+ if (!state2.metadata) return true;
245630
+ if (resource === "machine") return false;
245631
+ return resource === "agent_role" && !state2.workspace || [...state2.machines.values()].some((ready) => !ready);
245632
+ }
245406
245633
  async rows(resource, query, id2) {
245407
245634
  const source2 = this.source;
245408
245635
  if (resource === "mcp")
@@ -245501,6 +245728,8 @@ class ResourceDiscovery {
245501
245728
  else if (config2.machineId !== role.machineId)
245502
245729
  state2 = { state: "unavailable", reason: "agent_config_machine_mismatch" };
245503
245730
  else state2 = availability(role.machineId);
245731
+ const catalogState = source2.catalogReadiness?.();
245732
+ const pending2 = catalogState && (!catalogState.metadata || !catalogState.workspace || catalogState.machines.get(role.machineId) === false);
245504
245733
  const capability = config2 ? capabilityOf(config2) : void 0;
245505
245734
  if (state2.state === "available" && !capability)
245506
245735
  state2 = { state: "unknown", reason: "capabilities_unreported" };
@@ -245517,6 +245746,8 @@ class ResourceDiscovery {
245517
245746
  });
245518
245747
  if (state2.state === "available" && capability && (unavailableMode || unavailablePermission))
245519
245748
  state2 = { state: "unavailable", reason: "mode_unavailable" };
245749
+ if (pending2 && (state2.reason === "agent_config_missing" || state2.reason === "capabilities_unreported" || state2.reason === "model_unavailable" || state2.reason === "mode_unavailable" || state2.reason === "machine_inaccessible_or_missing" && !catalogState.metadata && !machines.some((machine) => machine.id === role.machineId)))
245750
+ state2 = { state: "unknown", reason: "catalog_syncing" };
245520
245751
  return {
245521
245752
  id: role.id,
245522
245753
  name: role.name,
@@ -245550,6 +245781,7 @@ class ResourceDiscovery {
245550
245781
  return {
245551
245782
  ok: true,
245552
245783
  workspaceId: this.source.workspaceId,
245784
+ ...this.catalogSyncing(resource) && !(resource === "project" && query.kind === "github") ? { sync: { state: "syncing", reason: "catalog_syncing", retryable: true } } : {},
245553
245785
  ...discoveryPage(
245554
245786
  rows,
245555
245787
  query,
@@ -245558,25 +245790,72 @@ class ResourceDiscovery {
245558
245790
  )
245559
245791
  };
245560
245792
  }
245561
- async get(resource, id2) {
245562
- const rows = (await this.rows(resource, {}, id2)).filter((candidate) => candidate.id === id2);
245793
+ async get(resource, id2, machineId) {
245794
+ const rows = (await this.rows(resource, machineId ? { machineId } : {}, id2)).filter(
245795
+ (candidate) => candidate.id === id2
245796
+ );
245563
245797
  const [row2] = rows;
245564
- if (!row2) throw new Error("RESOURCE_NOT_FOUND: resource does not exist or is not readable.");
245798
+ if (!row2) {
245799
+ if (this.catalogSyncing(resource)) throw new CatalogSyncingError();
245800
+ throw new Error("RESOURCE_NOT_FOUND: resource does not exist or is not readable.");
245801
+ }
245565
245802
  return {
245566
245803
  ok: true,
245567
245804
  workspaceId: this.source.workspaceId,
245568
245805
  item: row2,
245806
+ ...this.catalogSyncing(resource) ? { sync: { state: "syncing", reason: "catalog_syncing", retryable: true } } : {},
245569
245807
  ...rows.length > 1 ? { targets: rows } : {}
245570
245808
  };
245571
245809
  }
245572
245810
  }
245573
245811
  async function createResourceDiscovery(args2) {
245574
245812
  const { manager, auth: auth2, workspaceId } = args2;
245575
- if (!args2.offline) await syncWorkspaceMetaForRead(manager, "resource.discovery");
245813
+ const isDaemon = getDaemonWorkspace()?.manager === manager;
245814
+ const shouldSync = args2.offline !== true && (!isDaemon || args2.requireFreshCatalogs === true);
245815
+ if (args2.requireFreshCatalogs) {
245816
+ try {
245817
+ await manager.syncMetaOrThrow({
245818
+ reason: "resource.discovery",
245819
+ requireRemoteConfirmation: true
245820
+ });
245821
+ } catch (cause) {
245822
+ throw new WorkspaceSyncUnavailableError({
245823
+ message: "Workspace metadata synchronization is unavailable; retry the request.",
245824
+ cause
245825
+ });
245826
+ }
245827
+ } else if (shouldSync) {
245828
+ await syncWorkspaceMetaForRead(manager, "resource.discovery");
245829
+ }
245576
245830
  const synced = /* @__PURE__ */ new Set();
245831
+ const baselines = /* @__PURE__ */ new Map();
245832
+ const machineBaselines = /* @__PURE__ */ new Map();
245833
+ const deadline = performance.now() + (args2.offline ? 0 : args2.initialCatalogWaitMs ?? 1e3);
245834
+ async function baseline(id2) {
245835
+ if (!isDaemon || shouldSync || baselines.has(id2)) return;
245836
+ baselines.set(
245837
+ id2,
245838
+ await manager.catalogBaselineReady(id2, Math.max(0, deadline - performance.now()))
245839
+ );
245840
+ }
245577
245841
  async function sync2(id2) {
245578
- if (!args2.offline && !synced.has(id2)) {
245579
- await manager.syncFlockDocOrThrow(id2, { reason: "resource.discovery" });
245842
+ if (isDaemon && !shouldSync) {
245843
+ await manager.holdCatalogFlockDoc(id2);
245844
+ await baseline(id2);
245845
+ }
245846
+ if (shouldSync && !synced.has(id2)) {
245847
+ try {
245848
+ await manager.syncFlockDocOrThrow(id2, {
245849
+ reason: "resource.discovery",
245850
+ requireRemoteConfirmation: args2.requireFreshCatalogs === true
245851
+ });
245852
+ } catch (cause) {
245853
+ if (!args2.requireFreshCatalogs) throw cause;
245854
+ throw new WorkspaceSyncUnavailableError({
245855
+ message: "Target catalog synchronization is unavailable; retry the request.",
245856
+ cause
245857
+ });
245858
+ }
245580
245859
  synced.add(id2);
245581
245860
  }
245582
245861
  }
@@ -245584,7 +245863,17 @@ async function createResourceDiscovery(args2) {
245584
245863
  workspaceId,
245585
245864
  userId: args2.delegatedRequester?.userId ?? auth2.userId,
245586
245865
  selectedMcpServerIds: args2.selectedMcpServerIds,
245587
- machines: async () => (await listAliveDocMetas(manager, isMachineDocRoomId)).map((row2) => row2.meta),
245866
+ machines: async () => {
245867
+ await baseline(void 0);
245868
+ return (await listAliveDocMetas(manager, isMachineDocRoomId)).map(
245869
+ (row2) => row2.meta
245870
+ );
245871
+ },
245872
+ catalogReadiness: () => ({
245873
+ metadata: baselines.get(void 0) !== false,
245874
+ workspace: baselines.get(getWorkspaceFlockDocId(workspaceId)) !== false,
245875
+ machines: machineBaselines
245876
+ }),
245588
245877
  onlineMachineIds: async () => getSessionCommandEnvironment() ? /* @__PURE__ */ new Set([auth2.machineId]) : args2.offline ? null : manager.getOnlineMachineIds(),
245589
245878
  canAccess: async (machineId, localProjectId) => (await readSessionMachineAccess({
245590
245879
  auth: auth2,
@@ -245595,16 +245884,25 @@ async function createResourceDiscovery(args2) {
245595
245884
  })).allowed,
245596
245885
  configs: async (machineId) => {
245597
245886
  await sync2(getMachineFlockDocId(workspaceId, machineId));
245887
+ machineBaselines.set(
245888
+ machineId,
245889
+ baselines.get(getMachineFlockDocId(workspaceId, machineId)) !== false
245890
+ );
245598
245891
  return listMergedAgentConfigs(manager.repo, workspaceId, [machineId]);
245599
245892
  },
245600
245893
  capabilities: async (machineId) => {
245601
245894
  const id2 = getMachineFlockDocId(workspaceId, machineId);
245602
245895
  await sync2(id2);
245896
+ machineBaselines.set(machineId, baselines.get(id2) !== false);
245603
245897
  const handle = await manager.repo.openFlockDoc(id2);
245604
245898
  return getMachineFlockAcpCapabilities(readMachineFlockRowsFromFlock(handle.flock));
245605
245899
  },
245606
245900
  projects: async (machineId) => {
245607
245901
  await sync2(getMachineFlockDocId(workspaceId, machineId));
245902
+ machineBaselines.set(
245903
+ machineId,
245904
+ baselines.get(getMachineFlockDocId(workspaceId, machineId)) !== false
245905
+ );
245608
245906
  return Object.values(await readMachineLocalProjects(manager.repo, workspaceId, machineId));
245609
245907
  },
245610
245908
  roles: async () => {
@@ -261577,7 +261875,7 @@ class MessageHandler {
261577
261875
  const { sessionId, name: name2, arguments: args2 } = request2.params;
261578
261876
  if (request2.workspaceId !== this.workspaceId || request2.machineId !== this.machineId || request2.ownerSessionId !== sessionId)
261579
261877
  throw new Error("Session tool scope mismatch");
261580
- const { executeDaemonSessionTool } = await import("./chunks/daemon-session-tools-DD2ORwOB.js");
261878
+ const { executeDaemonSessionTool } = await import("./chunks/daemon-session-tools-C-Yrq3QD.js");
261581
261879
  const sourceWorkdir = this.resolveSessionWorkspaceRoot(sessionId);
261582
261880
  if (!sourceWorkdir && args2 && typeof args2 === "object" && "attachments" in args2)
261583
261881
  throw new Error("Requester Session workspace is unavailable");
@@ -272055,7 +272353,7 @@ const createNodeServicesForLease = async (sessionDoc, lease) => {
272055
272353
  result2.push(
272056
272354
  ...await Promise.all(
272057
272355
  projected.slice(start2, start2 + 8).map(async (entry) => {
272058
- await runPromise(take$2(lease.projectionLanes, 1));
272356
+ await runPromise(take$3(lease.projectionLanes, 1));
272059
272357
  try {
272060
272358
  return await project2(entry);
272061
272359
  } finally {
@@ -272595,7 +272893,7 @@ const createNodeServicesForLease = async (sessionDoc, lease) => {
272595
272893
  };
272596
272894
  }
272597
272895
  };
272598
- const { createRoostSessionData: createRoostSessionData2 } = await import("./chunks/index-xWWhl-Q7.js");
272896
+ const { createRoostSessionData: createRoostSessionData2 } = await import("./chunks/index-DuduZto9.js");
272599
272897
  syncModelSummary = async () => {
272600
272898
  const read2 = latestModelTurnId ? await history.readTurn(latestModelTurnId) : { state: "missing" };
272601
272899
  const turn = read2.state === "ready" ? [read2.turn] : [];
@@ -273670,6 +273968,7 @@ class Lody {
273670
273968
  // The daemon is the only process that resumes LoroDoc rooms from the
273671
273969
  // shared SQLite cursors; one-shot commands keep theirs in memory.
273672
273970
  documentCursorScope: "shared-durable",
273971
+ keepWorkspaceCatalogJoined: true,
273673
273972
  streamsTokens: options2.cloudPort.streamsTokens,
273674
273973
  cloudBilling: options2.cloudPort.billing,
273675
273974
  ownerHistoryRouter
@@ -306898,7 +307197,7 @@ async function runRender(file2, options2) {
306898
307197
  }
306899
307198
  data = parsed;
306900
307199
  } else {
306901
- const { resolveReviewBundle } = await import("./chunks/index-0CiLBEDN.js");
307200
+ const { resolveReviewBundle } = await import("./chunks/index-BPsHGk5B.js");
306902
307201
  const { collectBundleDiagnostics, hasErrorDiagnostics, createReviewBundleSnapshot } = await import("./chunks/index-DG2Ikd5A.js");
306903
307202
  const bundle = await resolveReviewBundle({
306904
307203
  reviewFilePath: inputPath,
@@ -306917,7 +307216,7 @@ async function runRender(file2, options2) {
306917
307216
  data = createReviewBundleSnapshot(bundle);
306918
307217
  }
306919
307218
  const { injectReviewSnapshot } = await import("./chunks/index-BeRTvYK1.js");
306920
- const { resolveReviewViewerTemplate } = await import("./chunks/review-viewer-D-w4J0sc.js");
307219
+ const { resolveReviewViewerTemplate } = await import("./chunks/review-viewer-DWax4Zej.js");
306921
307220
  const template = await resolveReviewViewerTemplate();
306922
307221
  const html = injectReviewSnapshot(template, data);
306923
307222
  const outputPath = options2.output ? path__default$1.resolve(options2.output) : defaultHtmlOutputPath(inputPath);
@@ -309232,11 +309531,12 @@ const daemonRunnerCommand = new Command("daemon-runner").description("(internal)
309232
309531
  await new Promise(() => {
309233
309532
  });
309234
309533
  });
309235
- function registerAgentRoleTools(register2, execute) {
309534
+ function registerAgentRoleTools(register2, execute, errorResult) {
309236
309535
  const call = async (command2) => {
309237
309536
  try {
309238
309537
  return { content: [{ type: "text", text: JSON.stringify(await execute(command2)) }] };
309239
309538
  } catch (error2) {
309539
+ if (errorResult) return errorResult(error2);
309240
309540
  return {
309241
309541
  isError: true,
309242
309542
  content: [
@@ -309305,8 +309605,23 @@ async function proposeAgentRole(args2) {
309305
309605
  const backend = await createSessionBackend(session2);
309306
309606
  const result2 = await publishAgentRoleProposal(backend, command2, userId, async () => {
309307
309607
  const docId = getWorkspaceFlockDocId(workspaceId);
309308
- if (!args2.localOnly)
309309
- await manager.syncFlockDocOrThrow(docId, { reason: "agent-role:proposal" });
309608
+ if (!args2.localOnly) {
309609
+ try {
309610
+ await manager.syncMetaOrThrow({
309611
+ reason: "agent-role:proposal",
309612
+ requireRemoteConfirmation: true
309613
+ });
309614
+ await manager.syncFlockDocOrThrow(docId, {
309615
+ reason: "agent-role:proposal",
309616
+ requireRemoteConfirmation: true
309617
+ });
309618
+ } catch (cause) {
309619
+ throw new WorkspaceSyncUnavailableError({
309620
+ message: "Role catalog synchronization is unavailable; retry the request.",
309621
+ cause
309622
+ });
309623
+ }
309624
+ }
309310
309625
  const handle = await manager.repo.openFlockDoc(docId);
309311
309626
  const roles = listWorkspaceAgentRoles(readWorkspaceFlockRowsFromFlock(handle.flock));
309312
309627
  const existing = command2.action === "update" ? roles.find((role) => role.id === command2.roleId) : void 0;
@@ -324502,6 +324817,16 @@ function registerDiscoveryTools(registerTool, withDiscovery) {
324502
324817
  content: [{ type: "text", text: JSON.stringify(await withDiscovery(read2)) }]
324503
324818
  };
324504
324819
  } catch (error2) {
324820
+ if (error2 instanceof CatalogSyncingError)
324821
+ return {
324822
+ isError: true,
324823
+ content: [
324824
+ {
324825
+ type: "text",
324826
+ text: JSON.stringify({ ok: false, error: error2.toLodyError() })
324827
+ }
324828
+ ]
324829
+ };
324505
324830
  return {
324506
324831
  isError: true,
324507
324832
  content: [
@@ -324517,7 +324842,7 @@ function registerDiscoveryTools(registerTool, withDiscovery) {
324517
324842
  registerTool(
324518
324843
  `lody_${resource}_list`,
324519
324844
  {
324520
- description: `${descriptions[resource]} Returns a bounded page (default 20, maximum 100); follow nextCursor with the same filters to enumerate all entries.`,
324845
+ description: `${descriptions[resource]} Returns a bounded page (default 20, maximum 100); follow nextCursor with the same filters to enumerate all entries. If sync.state is syncing, cached results may be incomplete; retry before treating absence as final.`,
324521
324846
  inputSchema: ResourceListSchemas[resource],
324522
324847
  annotations: { readOnlyHint: true }
324523
324848
  },
@@ -324528,7 +324853,7 @@ function registerDiscoveryTools(registerTool, withDiscovery) {
324528
324853
  registerTool(
324529
324854
  `lody_${resource}_get`,
324530
324855
  {
324531
- description: `Read one ${resource} by stable id from its list tool.`,
324856
+ description: `Read one ${resource} by stable id from its list tool. CATALOG_SYNCING is retryable.`,
324532
324857
  inputSchema: object$1({ id: string$4().trim().min(1) }).strict(),
324533
324858
  annotations: { readOnlyHint: true }
324534
324859
  },
@@ -327164,36 +327489,41 @@ function buildSessionToolServer(handlers3) {
327164
327489
  },
327165
327490
  handlers3
327166
327491
  );
327167
- registerAgentRoleTools(registerSessionTool, async (command2) => {
327168
- const ctx = getSessionContext();
327169
- const source2 = await resolveInvokingTurnSource();
327170
- const auth2 = getAuthContextOrThrow$1("mcp");
327171
- const workspace = await resolveWorkspaceOrThrow$1(auth2, getMcpWorkspaceId(ctx));
327172
- return withWorkspaceManager$1(
327173
- auth2,
327174
- workspace,
327175
- "agent-role-proposal",
327176
- async (manager) => proposeAgentRole({
327177
- manager,
327178
- workspaceId: workspace.id,
327179
- sessionId: ctx.sessionId,
327180
- userId: source2.userId,
327181
- command: command2,
327182
- localOnly: !!getSessionCommandEnvironment(),
327183
- validateTarget: async (machineId, agentConfigId) => {
327184
- const discovery = await createResourceDiscovery({
327185
- manager,
327186
- auth: auth2,
327187
- workspaceId: workspace.id,
327188
- delegatedRequester: { userId: source2.userId }
327189
- });
327190
- const config2 = await discovery.get("agent_config", agentConfigId);
327191
- if (config2.item.machineId !== machineId)
327192
- throw new Error("Agent configuration does not belong to the selected machine");
327193
- }
327194
- })
327195
- );
327196
- });
327492
+ registerAgentRoleTools(
327493
+ registerSessionTool,
327494
+ async (command2) => {
327495
+ const ctx = getSessionContext();
327496
+ const source2 = await resolveInvokingTurnSource();
327497
+ const auth2 = getAuthContextOrThrow$1("mcp");
327498
+ const workspace = await resolveWorkspaceOrThrow$1(auth2, getMcpWorkspaceId(ctx));
327499
+ return withWorkspaceManager$1(
327500
+ auth2,
327501
+ workspace,
327502
+ "agent-role-proposal",
327503
+ async (manager) => proposeAgentRole({
327504
+ manager,
327505
+ workspaceId: workspace.id,
327506
+ sessionId: ctx.sessionId,
327507
+ userId: source2.userId,
327508
+ command: command2,
327509
+ localOnly: !!getSessionCommandEnvironment(),
327510
+ validateTarget: async (machineId, agentConfigId) => {
327511
+ const discovery = await createResourceDiscovery({
327512
+ manager,
327513
+ auth: auth2,
327514
+ workspaceId: workspace.id,
327515
+ delegatedRequester: { userId: source2.userId },
327516
+ requireFreshCatalogs: true
327517
+ });
327518
+ const config2 = await discovery.get("agent_config", agentConfigId, machineId);
327519
+ if (config2.item.machineId !== machineId)
327520
+ throw new Error("Agent configuration does not belong to the selected machine");
327521
+ }
327522
+ })
327523
+ );
327524
+ },
327525
+ mcpErrorResult
327526
+ );
327197
327527
  registerDiscoveryTools(registerSessionTool, async (read2) => {
327198
327528
  const ctx = getSessionContext();
327199
327529
  const source2 = await resolveInvokingTurnSource();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lody",
3
- "version": "0.107.1",
3
+ "version": "0.107.2",
4
4
  "description": "Lody Agent CLI tool for managing remote command execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",