lody 0.63.3 → 0.64.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.
- package/dist/chunks/{diff-line-counts-BLxwWP6r.js → diff-line-counts-ftjiViPL.js} +2 -2
- package/dist/chunks/{directory-handle-CaB_XCLI.js → directory-handle-GsTHlZO7.js} +101 -50
- package/dist/chunks/{review-viewer-CX3JnImY.js → review-viewer-DB_tqQOE.js} +3 -3
- package/dist/diff-worker.js +1 -1
- package/dist/file-index-scan-worker.js +2 -2
- package/dist/index.js +70847 -83457
- package/package.json +9 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { mkdtempSync, writeFileSync, rmSync } from "node:fs";
|
|
3
|
-
import
|
|
3
|
+
import os 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(
|
|
620
|
+
dir = mkdtempSync(path__default.join(os.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-
|
|
5
|
+
import { a as countTextLines } from "./diff-line-counts-ftjiViPL.js";
|
|
6
6
|
const NEVER = Object.freeze({
|
|
7
7
|
status: "aborted"
|
|
8
8
|
});
|
|
@@ -4842,6 +4842,11 @@ 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
|
+
};
|
|
4845
4850
|
const CodeCollabV2FileDigestSchema = string().regex(/^sha256:[0-9a-f]{64}$/u);
|
|
4846
4851
|
const CodeCollabV2TextFormatSchema = object({
|
|
4847
4852
|
encoding: literal("utf8"),
|
|
@@ -4968,12 +4973,56 @@ const CodeCollabV2OpenCurrentDiffResponseSchema = discriminatedUnion("status", [
|
|
|
4968
4973
|
object({
|
|
4969
4974
|
status: literal("unavailable"),
|
|
4970
4975
|
path: string().min(1),
|
|
4971
|
-
reason: _enum([
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
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"]),
|
|
4977
5026
|
message: string().min(1).optional()
|
|
4978
5027
|
}).strict()
|
|
4979
5028
|
]);
|
|
@@ -5076,9 +5125,7 @@ record(
|
|
|
5076
5125
|
string().min(1),
|
|
5077
5126
|
CodeCollabV2FileIndexValueSchema
|
|
5078
5127
|
);
|
|
5079
|
-
const codeCollabFileIndexKeyForWorkspacePath = (workspacePath) => [
|
|
5080
|
-
workspacePath
|
|
5081
|
-
];
|
|
5128
|
+
const codeCollabFileIndexKeyForWorkspacePath = (workspacePath) => [workspacePath];
|
|
5082
5129
|
function readCodeCollabFileIndexFromFlock(flock) {
|
|
5083
5130
|
const fileIndex = {};
|
|
5084
5131
|
for (const row of flock.scan()) {
|
|
@@ -5207,6 +5254,7 @@ union([
|
|
|
5207
5254
|
CodeCollabV2RefreshTextResponseSchema,
|
|
5208
5255
|
CodeCollabV2SaveTextResponseSchema,
|
|
5209
5256
|
CodeCollabV2OpenCurrentDiffResponseSchema,
|
|
5257
|
+
CodeCollabV2OpenAllChangesDiffResponseSchema,
|
|
5210
5258
|
CodeCollabV2OpenTurnDiffResponseSchema,
|
|
5211
5259
|
CodeCollabV2InitDirectoryOkSchema,
|
|
5212
5260
|
CodeCollabV2LspUnsupportedSchema
|
|
@@ -5696,63 +5744,66 @@ async function closeDirectoryQuietly(directory) {
|
|
|
5696
5744
|
}
|
|
5697
5745
|
export {
|
|
5698
5746
|
$constructor as $,
|
|
5699
|
-
|
|
5700
|
-
|
|
5747
|
+
CodeCollabV2ErrorSchema as A,
|
|
5748
|
+
CodeCollabV2RpcContentEnvelopeSchema as B,
|
|
5701
5749
|
CodeCollabV2OpenTextRequestSchema as C,
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
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,
|
|
5712
5760
|
NEVER as N,
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
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,
|
|
5724
5772
|
ZodError as Z,
|
|
5725
5773
|
_enum as _,
|
|
5726
5774
|
array as a,
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
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,
|
|
5733
5784
|
boolean as b,
|
|
5734
5785
|
unknown as c,
|
|
5735
5786
|
discriminatedUnion as d,
|
|
5736
5787
|
CodeCollabV2RefreshTextRequestSchema as e,
|
|
5737
5788
|
CodeCollabV2SaveTextRequestSchema as f,
|
|
5738
5789
|
CodeCollabV2OpenCurrentDiffRequestSchema as g,
|
|
5739
|
-
|
|
5790
|
+
CodeCollabV2OpenAllChangesDiffRequestSchema as h,
|
|
5740
5791
|
intersection as i,
|
|
5741
|
-
|
|
5742
|
-
|
|
5792
|
+
CodeCollabV2OpenTurnDiffRequestSchema as j,
|
|
5793
|
+
CodeCollabV2InitDirectoryRequestSchema as k,
|
|
5743
5794
|
literal as l,
|
|
5744
|
-
|
|
5795
|
+
CodeCollabV2OpenTextOkSchema as m,
|
|
5745
5796
|
number as n,
|
|
5746
5797
|
object as o,
|
|
5747
5798
|
preprocess as p,
|
|
5748
|
-
|
|
5799
|
+
CodeCollabV2RefreshTextResponseSchema as q,
|
|
5749
5800
|
record as r,
|
|
5750
5801
|
string as s,
|
|
5751
|
-
|
|
5802
|
+
CodeCollabV2SaveTextResponseSchema as t,
|
|
5752
5803
|
union as u,
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5804
|
+
CodeCollabV2OpenCurrentDiffResponseSchema as v,
|
|
5805
|
+
CodeCollabV2OpenAllChangesDiffResponseSchema as w,
|
|
5806
|
+
CodeCollabV2OpenTurnDiffResponseSchema as x,
|
|
5807
|
+
CodeCollabV2InitDirectoryOkSchema as y,
|
|
5808
|
+
CodeCollabV2LspUnsupportedSchema as z
|
|
5758
5809
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { readFile, mkdir, writeFile, rename } from "node:fs/promises";
|
|
3
|
-
import
|
|
3
|
+
import os from "node:os";
|
|
4
4
|
import path__default from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
|
-
const reviewViewerVersion = "0.
|
|
6
|
+
const reviewViewerVersion = "0.64.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(
|
|
11
|
+
return path__default.join(os.homedir(), ".lody", "code-review-viewer");
|
|
12
12
|
}
|
|
13
13
|
function cachePath() {
|
|
14
14
|
return path__default.join(cacheDir(), `${reviewViewerVersion}.html`);
|
package/dist/diff-worker.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { opendir } from "node:fs/promises";
|
|
2
2
|
import path__default from "node:path";
|
|
3
|
-
import {
|
|
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";
|
|
4
4
|
import "node:child_process";
|
|
5
5
|
import "node:util";
|
|
6
|
-
import "./chunks/diff-line-counts-
|
|
6
|
+
import "./chunks/diff-line-counts-ftjiViPL.js";
|
|
7
7
|
import "node:fs";
|
|
8
8
|
import "node:os";
|
|
9
9
|
const DEFAULT_IGNORED_DIRECTORY_NAMES = /* @__PURE__ */ new Set([
|