lody 0.64.1 → 0.65.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.
@@ -1,6 +1,6 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import { mkdtempSync, writeFileSync, rmSync } from "node:fs";
3
- import os from "node:os";
3
+ import os__default from "node:os";
4
4
  import path__default from "node:path";
5
5
  function Diff() {
6
6
  }
@@ -617,7 +617,7 @@ function gitNumstatLineCounts(oldText, newText) {
617
617
  }
618
618
  let dir;
619
619
  try {
620
- dir = mkdtempSync(path__default.join(os.tmpdir(), "lody-diff-"));
620
+ dir = mkdtempSync(path__default.join(os__default.tmpdir(), "lody-diff-"));
621
621
  const oldPath = path__default.join(dir, "old");
622
622
  const newPath = path__default.join(dir, "new");
623
623
  writeFileSync(oldPath, oldText);
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
2
2
  import { readFile } from "node:fs/promises";
3
3
  import path__default from "node:path";
4
4
  import { promisify } from "node:util";
5
- import { a as countTextLines } from "./diff-line-counts-ftjiViPL.js";
5
+ import { a as countTextLines } from "./diff-line-counts-BLxwWP6r.js";
6
6
  const NEVER = Object.freeze({
7
7
  status: "aborted"
8
8
  });
@@ -4842,11 +4842,6 @@ const CODE_COLLAB_V2_TEXT_LIMITS = {
4842
4842
  maxCompressedBytes: 1024 * 1024,
4843
4843
  maxRawTextBytes: 10 * 1024 * 1024
4844
4844
  };
4845
- const CODE_COLLAB_V2_ALL_CHANGES_DIFF_LIMITS = {
4846
- perFileMaxCompressedBytes: 256 * 1024,
4847
- responseBudgetCompressedBytes: 2 * 1024 * 1024,
4848
- perFileMaxRawBytes: 1 * 1024 * 1024
4849
- };
4850
4845
  const CodeCollabV2FileDigestSchema = string().regex(/^sha256:[0-9a-f]{64}$/u);
4851
4846
  const CodeCollabV2TextFormatSchema = object({
4852
4847
  encoding: literal("utf8"),
@@ -4973,56 +4968,12 @@ const CodeCollabV2OpenCurrentDiffResponseSchema = discriminatedUnion("status", [
4973
4968
  object({
4974
4969
  status: literal("unavailable"),
4975
4970
  path: string().min(1),
4976
- reason: _enum(["base_unavailable", "not_changed", "transient_io", "unsupported_binary"]),
4977
- message: string().min(1).optional()
4978
- }).strict()
4979
- ]);
4980
- const CodeCollabV2OpenAllChangesDiffRequestSchema = object({
4981
- sessionId: string().trim().min(1),
4982
- // Inline this file first (the file the user clicked) regardless of size ordering.
4983
- focusPath: string().min(1).optional()
4984
- }).strict();
4985
- const CodeCollabV2AllChangesDiffEntrySchema = discriminatedUnion("status", [
4986
- object({
4987
- status: literal("ok"),
4988
- path: string().min(1),
4989
- oldSnapshot: CodeCollabV2DiffSnapshotSchema,
4990
- newSnapshot: CodeCollabV2DiffSnapshotSchema,
4991
- add: number().int().nonnegative().optional(),
4992
- del: number().int().nonnegative().optional()
4993
- }).strict(),
4994
- // Content exists but was not inlined (over per-file cap or total budget) — the client
4995
- // fetches it on demand via `open-current-diff`. Line stats still ship for the list.
4996
- object({
4997
- status: literal("deferred"),
4998
- path: string().min(1),
4999
- add: number().int().nonnegative().optional(),
5000
- del: number().int().nonnegative().optional()
5001
- }).strict(),
5002
- // Terminal: file is in the change list but its base snapshot equals disk (no real diff
5003
- // vs base). Binary / too-large files are NOT unavailable — they ship as `ok` with a
5004
- // `binary` / `too_large` snapshot, matching single-file `open-current-diff`.
5005
- object({
5006
- status: literal("unavailable"),
5007
- path: string().min(1),
5008
- reason: _enum(["not_changed"]),
5009
- add: number().int().nonnegative().optional(),
5010
- del: number().int().nonnegative().optional()
5011
- }).strict()
5012
- ]);
5013
- const CodeCollabV2OpenAllChangesDiffResponseSchema = discriminatedUnion("status", [
5014
- object({
5015
- status: literal("ok"),
5016
- // Resolved diff base for diagnostics/consistency: merge-base sha (git) or a source
5017
- // marker like `diff-store` (non-git).
5018
- base: string().min(1),
5019
- entries: array(CodeCollabV2AllChangesDiffEntrySchema),
5020
- // True when any entry is `deferred` (UI can hint "some files load on demand").
5021
- truncated: boolean()
5022
- }).strict(),
5023
- object({
5024
- status: literal("unavailable"),
5025
- reason: _enum(["base_unavailable", "transient_io"]),
4971
+ reason: _enum([
4972
+ "base_unavailable",
4973
+ "not_changed",
4974
+ "transient_io",
4975
+ "unsupported_binary"
4976
+ ]),
5026
4977
  message: string().min(1).optional()
5027
4978
  }).strict()
5028
4979
  ]);
@@ -5125,7 +5076,9 @@ record(
5125
5076
  string().min(1),
5126
5077
  CodeCollabV2FileIndexValueSchema
5127
5078
  );
5128
- const codeCollabFileIndexKeyForWorkspacePath = (workspacePath) => [workspacePath];
5079
+ const codeCollabFileIndexKeyForWorkspacePath = (workspacePath) => [
5080
+ workspacePath
5081
+ ];
5129
5082
  function readCodeCollabFileIndexFromFlock(flock) {
5130
5083
  const fileIndex = {};
5131
5084
  for (const row of flock.scan()) {
@@ -5254,7 +5207,6 @@ union([
5254
5207
  CodeCollabV2RefreshTextResponseSchema,
5255
5208
  CodeCollabV2SaveTextResponseSchema,
5256
5209
  CodeCollabV2OpenCurrentDiffResponseSchema,
5257
- CodeCollabV2OpenAllChangesDiffResponseSchema,
5258
5210
  CodeCollabV2OpenTurnDiffResponseSchema,
5259
5211
  CodeCollabV2InitDirectoryOkSchema,
5260
5212
  CodeCollabV2LspUnsupportedSchema
@@ -5744,66 +5696,63 @@ async function closeDirectoryQuietly(directory) {
5744
5696
  }
5745
5697
  export {
5746
5698
  $constructor as $,
5747
- CodeCollabV2ErrorSchema as A,
5748
- CodeCollabV2RpcContentEnvelopeSchema as B,
5699
+ deriveCodeCollabV2ContentKeyId as A,
5700
+ deriveCodeCollabV2ContentKeyBytes as B,
5749
5701
  CodeCollabV2OpenTextRequestSchema as C,
5750
- deriveCodeCollabV2ContentKeyId as D,
5751
- deriveCodeCollabV2ContentKeyBytes as E,
5752
- CodeCollabV2ErrorCodeSchema as F,
5753
- _null as G,
5754
- CODE_COLLAB_V2_TEXT_LIMITS as H,
5755
- CODE_COLLAB_V2_ALL_CHANGES_DIFF_LIMITS as I,
5756
- computeAllChanges as J,
5757
- buildCodeCollabFileIndexState as K,
5758
- codeCollabFileIndexStatesEqual as L,
5759
- scanGitDirectoryEntries as M,
5702
+ CodeCollabV2ErrorCodeSchema as D,
5703
+ _null as E,
5704
+ CODE_COLLAB_V2_TEXT_LIMITS as F,
5705
+ computeAllChanges as G,
5706
+ buildCodeCollabFileIndexState as H,
5707
+ codeCollabFileIndexStatesEqual as I,
5708
+ scanGitDirectoryEntries as J,
5709
+ closeDirectoryQuietly as K,
5710
+ writeCodeCollabFileIndexToFlock as L,
5711
+ normalizeParams as M,
5760
5712
  NEVER as N,
5761
- closeDirectoryQuietly as O,
5762
- writeCodeCollabFileIndexToFlock as P,
5763
- normalizeParams as Q,
5764
- $ZodObject as R,
5765
- defineLazy as S,
5766
- $ZodType as T,
5767
- parse$1 as U,
5768
- safeParse$1 as V,
5769
- parseAsync$1 as W,
5770
- safeParseAsync$1 as X,
5771
- clone as Y,
5713
+ $ZodObject as O,
5714
+ defineLazy as P,
5715
+ $ZodType as Q,
5716
+ parse$1 as R,
5717
+ safeParse$1 as S,
5718
+ parseAsync$1 as T,
5719
+ safeParseAsync$1 as U,
5720
+ clone as V,
5721
+ looseObject as W,
5722
+ optional as X,
5723
+ datetime as Y,
5772
5724
  ZodError as Z,
5773
5725
  _enum as _,
5774
5726
  array as a,
5775
- looseObject as a0,
5776
- optional as a1,
5777
- datetime as a2,
5778
- custom as a3,
5779
- toJSONSchema as a4,
5780
- ZodOptional as a5,
5781
- joinWorkspacePath as a6,
5782
- isInsideGitWorktree as a7,
5783
- pathSegmentComparisonKey as a8,
5727
+ custom as a0,
5728
+ toJSONSchema as a1,
5729
+ ZodOptional as a2,
5730
+ joinWorkspacePath as a3,
5731
+ isInsideGitWorktree as a4,
5732
+ pathSegmentComparisonKey as a5,
5784
5733
  boolean as b,
5785
5734
  unknown as c,
5786
5735
  discriminatedUnion as d,
5787
5736
  CodeCollabV2RefreshTextRequestSchema as e,
5788
5737
  CodeCollabV2SaveTextRequestSchema as f,
5789
5738
  CodeCollabV2OpenCurrentDiffRequestSchema as g,
5790
- CodeCollabV2OpenAllChangesDiffRequestSchema as h,
5739
+ CodeCollabV2OpenTurnDiffRequestSchema as h,
5791
5740
  intersection as i,
5792
- CodeCollabV2OpenTurnDiffRequestSchema as j,
5793
- CodeCollabV2InitDirectoryRequestSchema as k,
5741
+ CodeCollabV2InitDirectoryRequestSchema as j,
5742
+ CodeCollabV2OpenTextOkSchema as k,
5794
5743
  literal as l,
5795
- CodeCollabV2OpenTextOkSchema as m,
5744
+ CodeCollabV2RefreshTextResponseSchema as m,
5796
5745
  number as n,
5797
5746
  object as o,
5798
5747
  preprocess as p,
5799
- CodeCollabV2RefreshTextResponseSchema as q,
5748
+ CodeCollabV2SaveTextResponseSchema as q,
5800
5749
  record as r,
5801
5750
  string as s,
5802
- CodeCollabV2SaveTextResponseSchema as t,
5751
+ CodeCollabV2OpenCurrentDiffResponseSchema as t,
5803
5752
  union as u,
5804
- CodeCollabV2OpenCurrentDiffResponseSchema as v,
5805
- CodeCollabV2OpenAllChangesDiffResponseSchema as w,
5806
- CodeCollabV2OpenTurnDiffResponseSchema as x,
5807
- CodeCollabV2InitDirectoryOkSchema as y,
5808
- CodeCollabV2LspUnsupportedSchema as z
5753
+ CodeCollabV2OpenTurnDiffResponseSchema as v,
5754
+ CodeCollabV2InitDirectoryOkSchema as w,
5755
+ CodeCollabV2LspUnsupportedSchema as x,
5756
+ CodeCollabV2ErrorSchema as y,
5757
+ CodeCollabV2RpcContentEnvelopeSchema as z
5809
5758
  };
@@ -1,14 +1,14 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { readFile, mkdir, writeFile, rename } from "node:fs/promises";
3
- import os from "node:os";
3
+ import os__default from "node:os";
4
4
  import path__default from "node:path";
5
5
  import process from "node:process";
6
- const reviewViewerVersion = "0.64.1";
6
+ const reviewViewerVersion = "0.65.0";
7
7
  const reviewViewerSha256 = "50ab599b652bdf4b959b539ea948454dd588703039bd4c5c037c7877ce10696f";
8
8
  const reviewViewerFileName = "standalone.html";
9
9
  const DEFAULT_CDN_BASES = ["https://cdn.jsdelivr.net/npm", "https://unpkg.com"];
10
10
  function cacheDir() {
11
- return path__default.join(os.homedir(), ".lody", "code-review-viewer");
11
+ return path__default.join(os__default.homedir(), ".lody", "code-review-viewer");
12
12
  }
13
13
  function cachePath() {
14
14
  return path__default.join(cacheDir(), `${reviewViewerVersion}.html`);
@@ -1,4 +1,4 @@
1
- import { c as computeLineCounts } from "./chunks/diff-line-counts-ftjiViPL.js";
1
+ import { c as computeLineCounts } from "./chunks/diff-line-counts-BLxwWP6r.js";
2
2
  import "node:child_process";
3
3
  import "node:fs";
4
4
  import "node:os";
@@ -1,9 +1,9 @@
1
1
  import { opendir } from "node:fs/promises";
2
2
  import path__default from "node:path";
3
- import { K as buildCodeCollabFileIndexState, M as scanGitDirectoryEntries, a6 as joinWorkspacePath, a7 as isInsideGitWorktree, J as computeAllChanges, a8 as pathSegmentComparisonKey, O as closeDirectoryQuietly } from "./chunks/directory-handle-GsTHlZO7.js";
3
+ import { H as buildCodeCollabFileIndexState, J as scanGitDirectoryEntries, a3 as joinWorkspacePath, a4 as isInsideGitWorktree, G as computeAllChanges, a5 as pathSegmentComparisonKey, K as closeDirectoryQuietly } from "./chunks/directory-handle-CaB_XCLI.js";
4
4
  import "node:child_process";
5
5
  import "node:util";
6
- import "./chunks/diff-line-counts-ftjiViPL.js";
6
+ import "./chunks/diff-line-counts-BLxwWP6r.js";
7
7
  import "node:fs";
8
8
  import "node:os";
9
9
  const DEFAULT_IGNORED_DIRECTORY_NAMES = /* @__PURE__ */ new Set([