lody 0.64.1 → 0.66.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-ftjiViPL.js → diff-line-counts-BLxwWP6r.js} +2 -2
- package/dist/chunks/{directory-handle-GsTHlZO7.js → directory-handle-CaB_XCLI.js} +50 -101
- package/dist/chunks/{review-viewer-3Tw5RDkz.js → review-viewer-DzrxfC5z.js} +3 -3
- package/dist/diff-worker.js +1 -1
- package/dist/file-index-scan-worker.js +2 -2
- package/dist/index.js +107165 -94132
- package/package.json +11 -12
|
@@ -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__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(
|
|
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-
|
|
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([
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
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) => [
|
|
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
|
-
|
|
5748
|
-
|
|
5699
|
+
deriveCodeCollabV2ContentKeyId as A,
|
|
5700
|
+
deriveCodeCollabV2ContentKeyBytes as B,
|
|
5749
5701
|
CodeCollabV2OpenTextRequestSchema as C,
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
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
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
$
|
|
5765
|
-
|
|
5766
|
-
$
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
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
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
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
|
-
|
|
5739
|
+
CodeCollabV2OpenTurnDiffRequestSchema as h,
|
|
5791
5740
|
intersection as i,
|
|
5792
|
-
|
|
5793
|
-
|
|
5741
|
+
CodeCollabV2InitDirectoryRequestSchema as j,
|
|
5742
|
+
CodeCollabV2OpenTextOkSchema as k,
|
|
5794
5743
|
literal as l,
|
|
5795
|
-
|
|
5744
|
+
CodeCollabV2RefreshTextResponseSchema as m,
|
|
5796
5745
|
number as n,
|
|
5797
5746
|
object as o,
|
|
5798
5747
|
preprocess as p,
|
|
5799
|
-
|
|
5748
|
+
CodeCollabV2SaveTextResponseSchema as q,
|
|
5800
5749
|
record as r,
|
|
5801
5750
|
string as s,
|
|
5802
|
-
|
|
5751
|
+
CodeCollabV2OpenCurrentDiffResponseSchema as t,
|
|
5803
5752
|
union as u,
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
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
|
|
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.
|
|
6
|
+
const reviewViewerVersion = "0.66.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__default.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 { 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-
|
|
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([
|