@moldea.ai/cli 14.0.1 → 15.0.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/README.md +4 -4
- package/dist/chunks/{composition-D1OYuZ5d.js → composition-B4GH4Nqy.js} +1 -1
- package/dist/chunks/{composition-_3bygS_a.js → composition-DymbbpSr.js} +73 -109
- package/dist/chunks/composition-DymbbpSr.js.map +1 -0
- package/dist/chunks/{core-composition-BKcJ--NX.js → core-composition-DhjRyNO7.js} +79 -8
- package/dist/chunks/core-composition-DhjRyNO7.js.map +1 -0
- package/dist/moldea.js +51 -43
- package/dist/moldea.js.map +1 -1
- package/dist/portable/SHA256SUMS +7 -7
- package/dist/portable/analysis-worker.mjs +1 -1
- package/dist/portable/{chunk-43b8574a.mjs → chunk-ad32cb41.mjs} +389 -420
- package/dist/portable/{chunk-d9e49acd.mjs → chunk-afb0cf51.mjs} +132 -93
- package/dist/portable/chunk-b1f86976.mjs +2 -0
- package/dist/portable/{chunk-517c6bfb.mjs → chunk-cb0442cc.mjs} +1 -1
- package/dist/portable/{chunk-9e42770a.mjs → chunk-d372f5e0.mjs} +637 -631
- package/dist/portable/moldea.mjs +211 -210
- package/package.json +2 -2
- package/dist/chunks/composition-_3bygS_a.js.map +0 -1
- package/dist/chunks/core-composition-BKcJ--NX.js.map +0 -1
- package/dist/portable/chunk-1306b995.mjs +0 -2
package/dist/portable/moldea.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as e, d as t, f as n, l as r, m as i, n as a, t as o, u as s } from "./chunk-2cc3bf5c.mjs";
|
|
2
|
-
import { A as c, B as l, C as u, D as d, E as f, F as p, H as m, I as h, L as g, M as _, N as v, O as ee, P as y, R as b, S as te, T as ne, U as x, V as S, _ as re, a as ie, b as ae, c as oe, d as se, f as ce, g as le, h as ue, j as de, k as fe, l as pe, m as me, o as he, p as ge, s as _e, u as C, v as ve, w as ye, x as be, y as xe, z as Se } from "./chunk-
|
|
2
|
+
import { A as c, B as l, C as u, D as d, E as f, F as p, H as m, I as h, L as g, M as _, N as v, O as ee, P as y, R as b, S as te, T as ne, U as x, V as S, _ as re, a as ie, b as ae, c as oe, d as se, f as ce, g as le, h as ue, j as de, k as fe, l as pe, m as me, o as he, p as ge, s as _e, u as C, v as ve, w as ye, x as be, y as xe, z as Se } from "./chunk-ad32cb41.mjs";
|
|
3
3
|
import { g as Ce } from "./chunk-8f198616.mjs";
|
|
4
|
-
import { n as we } from "./chunk-
|
|
4
|
+
import { n as we } from "./chunk-d372f5e0.mjs";
|
|
5
5
|
import { a as Te, c as Ee, i as w, l as T, n as E, o as De, r as Oe } from "./chunk-98d84174.mjs";
|
|
6
6
|
import D from "node:path";
|
|
7
7
|
import O from "node:process";
|
|
@@ -286,7 +286,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
286
286
|
kind: "failed"
|
|
287
287
|
});
|
|
288
288
|
}, pt = ((e = He) => async (t) => {
|
|
289
|
-
if (!D.isAbsolute(t.invocationDirectory) || t.invocationDirectory.includes("\0") || !t.invocationDirectory.isWellFormed() || t.repositoryDirectory !== null && !
|
|
289
|
+
if (!D.isAbsolute(t.invocationDirectory) || t.invocationDirectory.includes("\0") || !t.invocationDirectory.isWellFormed() || t.repositoryDirectory !== null && !y(t.repositoryDirectory)) return Object.freeze({
|
|
290
290
|
errorCode: "GIT_REPOSITORY_NOT_FOUND",
|
|
291
291
|
kind: "failed"
|
|
292
292
|
});
|
|
@@ -589,40 +589,51 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
589
589
|
manifestContent: new TextDecoder("utf-8").decode(n),
|
|
590
590
|
scope: r
|
|
591
591
|
});
|
|
592
|
-
})(),
|
|
593
|
-
|
|
594
|
-
e.
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
592
|
+
})(), F = (e, t) => e < t ? -1 : +(e > t), Ut = ({ kind: e, id: t, agentId: n }) => e === "context" || e === "decision" ? t : `/moldea/agents/${n ?? t}/instruction.md`, Wt = (e) => {
|
|
593
|
+
let { scope: t } = e, n = new Map();
|
|
594
|
+
for (let { owner: e, field: r, declaration: i } of t.matches) {
|
|
595
|
+
let t = JSON.stringify([
|
|
596
|
+
e.kind,
|
|
597
|
+
e.agentId,
|
|
598
|
+
e.id
|
|
599
|
+
]), a = n.get(t);
|
|
600
|
+
a === void 0 && (a = {
|
|
601
|
+
owner: e,
|
|
602
|
+
path: Ut(e),
|
|
603
|
+
relationships: new Map()
|
|
604
|
+
}, n.set(t, a));
|
|
605
|
+
let o = i.kind === "exact" ? i.path : i.pattern, s = JSON.stringify([r, o]);
|
|
606
|
+
a.relationships.has(s) || a.relationships.set(s, {
|
|
607
|
+
field: r,
|
|
608
|
+
path: o
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
let r = t.diagnostics.map(le), i = [...n.values()].sort((e, t) => F(e.path, t.path) || F(e.owner.kind, t.owner.kind) || F(e.owner.id, t.owner.id)).map(({ owner: e, path: t, relationships: n }, i) => ({
|
|
612
|
+
key: h(r.length + i),
|
|
604
613
|
kind: "match",
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
614
|
+
path: t,
|
|
615
|
+
ownerKind: e.kind,
|
|
616
|
+
...e.kind === "tool" || e.kind === "skill" ? { capabilityId: e.id } : {},
|
|
617
|
+
relationships: [...n.values()].sort((e, t) => F(e.field, t.field) || F(e.path, t.path))
|
|
618
|
+
})), a = Object.freeze([...r, ...i]), o = g({
|
|
619
|
+
inputDigest: t.inputDigest,
|
|
620
|
+
manifestDigest: t.manifestDigest,
|
|
621
|
+
records: a,
|
|
622
|
+
valid: t.valid
|
|
611
623
|
});
|
|
612
624
|
return Object.freeze({
|
|
613
625
|
canonicalBodies: Object.freeze([e.manifestContent]),
|
|
614
626
|
counts: Object.freeze({
|
|
615
|
-
...
|
|
616
|
-
diagnostics:
|
|
627
|
+
...t.counts,
|
|
628
|
+
diagnostics: t.diagnostics.length
|
|
617
629
|
}),
|
|
618
|
-
inputDigest:
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
valid: e.scope.valid
|
|
630
|
+
inputDigest: t.inputDigest,
|
|
631
|
+
records: a,
|
|
632
|
+
relevant: t.relevant,
|
|
633
|
+
snapshotDigest: o,
|
|
634
|
+
valid: t.valid
|
|
624
635
|
});
|
|
625
|
-
},
|
|
636
|
+
}, Gt = class extends w {
|
|
626
637
|
constructor(e) {
|
|
627
638
|
super({
|
|
628
639
|
code: "SOURCE_UNAVAILABLE",
|
|
@@ -631,7 +642,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
631
642
|
retryable: !1
|
|
632
643
|
}), this.name = "GitContentTransformUnsupportedException";
|
|
633
644
|
}
|
|
634
|
-
},
|
|
645
|
+
}, Kt = (e, t) => {
|
|
635
646
|
if (e?.aborted) throw new w({
|
|
636
647
|
cause: e.reason,
|
|
637
648
|
code: "ABORTED",
|
|
@@ -639,12 +650,12 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
639
650
|
path: t,
|
|
640
651
|
retryable: !1
|
|
641
652
|
});
|
|
642
|
-
},
|
|
653
|
+
}, qt = (e) => new w({
|
|
643
654
|
code: "INVALID_SOURCE_DATA",
|
|
644
655
|
operation: "read-file-page",
|
|
645
656
|
path: e,
|
|
646
657
|
retryable: !1
|
|
647
|
-
}),
|
|
658
|
+
}), Jt = class {
|
|
648
659
|
snapshot;
|
|
649
660
|
#e;
|
|
650
661
|
#t;
|
|
@@ -660,11 +671,11 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
660
671
|
async readFilePage(e, t) {
|
|
661
672
|
let n = T(e);
|
|
662
673
|
if (!this.#e.has(n)) return this.#t.readFilePage(n, t);
|
|
663
|
-
|
|
674
|
+
Kt(t?.signal, n);
|
|
664
675
|
let r = await this.#t.getEntry(n, t);
|
|
665
|
-
if (
|
|
676
|
+
if (Kt(t?.signal, n), r !== null && (r.path !== n || r.type !== "file" && r.type !== "directory" && r.type !== "symlink")) throw qt(n);
|
|
666
677
|
if (r?.type !== "file") return this.#t.readFilePage(n, t);
|
|
667
|
-
throw new
|
|
678
|
+
throw new Gt(n);
|
|
668
679
|
}
|
|
669
680
|
readLinkText(e, t) {
|
|
670
681
|
return this.#t.readLinkText(e, t);
|
|
@@ -672,7 +683,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
672
683
|
listEntriesPage(e) {
|
|
673
684
|
return this.#t.listEntriesPage(e);
|
|
674
685
|
}
|
|
675
|
-
},
|
|
686
|
+
}, Yt = (e, t) => {
|
|
676
687
|
let n = new Set();
|
|
677
688
|
for (let e of t) {
|
|
678
689
|
let t = T(e);
|
|
@@ -684,8 +695,8 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
684
695
|
});
|
|
685
696
|
n.add(t);
|
|
686
697
|
}
|
|
687
|
-
return Object.freeze(new
|
|
688
|
-
},
|
|
698
|
+
return Object.freeze(new Jt(e, n));
|
|
699
|
+
}, Xt = Object.freeze({
|
|
689
700
|
ABORTED: "The repository operation was aborted.",
|
|
690
701
|
ACCESS_DENIED: "Access to the repository source was denied.",
|
|
691
702
|
ENTRY_NOT_DIRECTORY: "The requested repository entry is not a directory.",
|
|
@@ -698,7 +709,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
698
709
|
RESOURCE_LIMIT_EXCEEDED: "A repository reading resource limit was exceeded.",
|
|
699
710
|
SNAPSHOT_CHANGED: "The repository snapshot changed during the operation.",
|
|
700
711
|
SOURCE_UNAVAILABLE: "The repository source is unavailable."
|
|
701
|
-
}),
|
|
712
|
+
}), Zt = Object.freeze({ INVALID_RESOURCE_LIMIT: "A Core resource limit is invalid." }), Qt = Object.freeze({
|
|
702
713
|
ABORTED: "The Core operation was aborted.",
|
|
703
714
|
CONTENT_INVALID: "The requested canonical content is invalid.",
|
|
704
715
|
INVALID_ARGUMENT: "The Core operation received an invalid argument.",
|
|
@@ -706,34 +717,34 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
706
717
|
INSPECTION_TIMEOUT: "The isolated project inspection timed out.",
|
|
707
718
|
INSPECTION_PROCESS_FAILED: "The isolated project inspection failed.",
|
|
708
719
|
RESOURCE_LIMIT_EXCEEDED: "A Core resource limit was exceeded."
|
|
709
|
-
}),
|
|
720
|
+
}), $t = Object.freeze({}), en = (e) => {
|
|
710
721
|
let t = { operation: e.operation };
|
|
711
722
|
return e instanceof a && (e.limit !== null && (t.limit = e.limit), e.limitMaximum !== null && (t.limitMaximum = e.limitMaximum), e.nextAction !== null && (t.nextAction = e.nextAction), (e.observedUsage !== null || e.nextAction === "review-inspection-capacity") && (t.observedUsage = e.observedUsage)), Object.freeze(t);
|
|
712
|
-
},
|
|
723
|
+
}, tn = (e) => e instanceof he || e instanceof S || e instanceof kt || e instanceof zt ? _(e.code) : e instanceof Gt ? Object.freeze({
|
|
713
724
|
..._("GIT_CONTENT_TRANSFORM_UNSUPPORTED"),
|
|
714
725
|
path: Ee(e.path) ? e.path : null
|
|
715
726
|
}) : e instanceof w ? Object.freeze({
|
|
716
727
|
code: e.code,
|
|
717
|
-
details:
|
|
718
|
-
message:
|
|
728
|
+
details: $t,
|
|
729
|
+
message: Xt[e.code],
|
|
719
730
|
path: e.path !== null && Ee(e.path) ? e.path : null,
|
|
720
731
|
retryable: e.retryable,
|
|
721
732
|
source: "repository"
|
|
722
733
|
}) : e instanceof o ? Object.freeze({
|
|
723
734
|
code: e.code,
|
|
724
|
-
details:
|
|
725
|
-
message:
|
|
735
|
+
details: en(e),
|
|
736
|
+
message: Zt[e.code],
|
|
726
737
|
path: null,
|
|
727
738
|
retryable: !1,
|
|
728
739
|
source: "core"
|
|
729
740
|
}) : e instanceof a ? Object.freeze({
|
|
730
741
|
code: e.code,
|
|
731
|
-
details:
|
|
732
|
-
message:
|
|
742
|
+
details: en(e),
|
|
743
|
+
message: Qt[e.code],
|
|
733
744
|
path: null,
|
|
734
745
|
retryable: e.retryable,
|
|
735
746
|
source: "core"
|
|
736
|
-
}) : _("INTERNAL_ERROR"),
|
|
747
|
+
}) : _("INTERNAL_ERROR"), nn = [
|
|
737
748
|
"ls-files",
|
|
738
749
|
"--others",
|
|
739
750
|
"--ignored",
|
|
@@ -742,30 +753,30 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
742
753
|
"--no-recurse-submodules",
|
|
743
754
|
"-z",
|
|
744
755
|
"--"
|
|
745
|
-
],
|
|
756
|
+
], rn = "ls-files", an = Object.freeze([
|
|
746
757
|
"/AGENTS.md",
|
|
747
758
|
"/CLAUDE.md",
|
|
748
759
|
"/.claude/CLAUDE.md",
|
|
749
760
|
"/CLAUDE.local.md"
|
|
750
|
-
].map((e) => T(e))),
|
|
761
|
+
].map((e) => T(e))), on = [
|
|
751
762
|
"100644",
|
|
752
763
|
"100755",
|
|
753
764
|
"120000",
|
|
754
765
|
"160000"
|
|
755
|
-
],
|
|
766
|
+
], sn = [
|
|
756
767
|
"filter",
|
|
757
768
|
"working-tree-encoding",
|
|
758
769
|
"ident"
|
|
759
|
-
],
|
|
770
|
+
], cn = [
|
|
760
771
|
"check-attr",
|
|
761
772
|
"--stdin",
|
|
762
773
|
"-z",
|
|
763
|
-
...
|
|
764
|
-
],
|
|
774
|
+
...sn
|
|
775
|
+
], ln = (e, t) => {
|
|
765
776
|
let n = new Uint8Array(t), r = 0;
|
|
766
777
|
for (let t of e) n.set(t, r), r += t.byteLength;
|
|
767
778
|
return n;
|
|
768
|
-
},
|
|
779
|
+
}, un = (e) => {
|
|
769
780
|
try {
|
|
770
781
|
return new TextDecoder("utf-8", {
|
|
771
782
|
fatal: !0,
|
|
@@ -774,10 +785,10 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
774
785
|
} catch {
|
|
775
786
|
return null;
|
|
776
787
|
}
|
|
777
|
-
},
|
|
788
|
+
}, dn = (e) => sn.find((t) => t === e) ?? null, fn = (e, t, n) => {
|
|
778
789
|
let r = t === "working-tree-encoding" ? "workingTreeEncoding" : t;
|
|
779
790
|
return !Object.hasOwn(e, r) && (e[r] = n, !0);
|
|
780
|
-
},
|
|
791
|
+
}, pn = (e) => Object.hasOwn(e, "filter") && Object.hasOwn(e, "ident") && Object.hasOwn(e, "workingTreeEncoding"), mn = (e) => {
|
|
781
792
|
let t = [...e.paths], n = new Map(), r = [], i = !1, a = 0, o = [];
|
|
782
793
|
for (let e of t) {
|
|
783
794
|
if (e.length === 0 || e.includes("\0") || n.has(e)) {
|
|
@@ -788,15 +799,15 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
788
799
|
}
|
|
789
800
|
let s = () => {
|
|
790
801
|
if (i || r.length !== 3) return;
|
|
791
|
-
let e =
|
|
802
|
+
let e = un(r[0] ?? new Uint8Array()), t = un(r[1] ?? new Uint8Array()), a = un(r[2] ?? new Uint8Array());
|
|
792
803
|
if (r = [], e === null || t === null || a === null) {
|
|
793
804
|
i = !0;
|
|
794
805
|
return;
|
|
795
806
|
}
|
|
796
|
-
let o =
|
|
797
|
-
(o === null || s === void 0 || !
|
|
807
|
+
let o = dn(t), s = n.get(e);
|
|
808
|
+
(o === null || s === void 0 || !fn(s, o, a)) && (i = !0);
|
|
798
809
|
}, c = () => {
|
|
799
|
-
i || (r.push(
|
|
810
|
+
i || (r.push(ln(o, a)), a = 0, o = [], r.length === 3 && s());
|
|
800
811
|
};
|
|
801
812
|
return {
|
|
802
813
|
consume: (e) => {
|
|
@@ -816,7 +827,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
816
827
|
let e = [];
|
|
817
828
|
for (let r of t) {
|
|
818
829
|
let t = n.get(r);
|
|
819
|
-
if (t === void 0 || !
|
|
830
|
+
if (t === void 0 || !pn(t)) return Object.freeze({ kind: "failed" });
|
|
820
831
|
e.push(Object.freeze({
|
|
821
832
|
filter: t.filter,
|
|
822
833
|
ident: t.ident,
|
|
@@ -830,11 +841,11 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
830
841
|
});
|
|
831
842
|
}
|
|
832
843
|
};
|
|
833
|
-
},
|
|
844
|
+
}, I = (e, t) => Object.freeze({
|
|
834
845
|
errorCode: e,
|
|
835
846
|
kind: "failed",
|
|
836
847
|
...t === void 0 ? {} : { subcommand: t }
|
|
837
|
-
}),
|
|
848
|
+
}), hn = (e) => {
|
|
838
849
|
switch (e) {
|
|
839
850
|
case "aborted": return "GIT_OPERATION_ABORTED";
|
|
840
851
|
case "not-found": return "GIT_NOT_FOUND";
|
|
@@ -844,7 +855,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
844
855
|
case "output-invalid": return "GIT_OUTPUT_INVALID";
|
|
845
856
|
case "command-failed": return "GIT_COMMAND_FAILED";
|
|
846
857
|
}
|
|
847
|
-
},
|
|
858
|
+
}, gn = (e) => e !== "unset" && e !== "unspecified", _n = (e) => {
|
|
848
859
|
let t = new TextEncoder(), n = [], r = 0;
|
|
849
860
|
for (let i of e) {
|
|
850
861
|
if (i.length === 0 || i.includes("\0")) return null;
|
|
@@ -855,64 +866,64 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
855
866
|
let i = new Uint8Array(r), a = 0;
|
|
856
867
|
for (let e of n) i.set(e, a), a += e.byteLength + 1;
|
|
857
868
|
return i;
|
|
858
|
-
},
|
|
869
|
+
}, vn = (e, t, n) => Object.freeze({
|
|
859
870
|
filter: e,
|
|
860
871
|
ident: t,
|
|
861
|
-
isGuarded:
|
|
872
|
+
isGuarded: gn(e) || gn(t) || gn(n),
|
|
862
873
|
workingTreeEncoding: n
|
|
863
|
-
}),
|
|
864
|
-
if (t.signal?.aborted) return
|
|
865
|
-
if (!Number.isSafeInteger(t.maxMetadataBytes) || t.maxMetadataBytes < 0) return
|
|
874
|
+
}), yn = (e = mt) => async (t) => {
|
|
875
|
+
if (t.signal?.aborted) return I("GIT_OPERATION_ABORTED");
|
|
876
|
+
if (!Number.isSafeInteger(t.maxMetadataBytes) || t.maxMetadataBytes < 0) return I("RESOURCE_LIMIT_EXCEEDED");
|
|
866
877
|
if (t.entries.length === 0) return Object.freeze({
|
|
867
878
|
entries: Object.freeze([]),
|
|
868
879
|
gitMetadataBytes: 0,
|
|
869
880
|
kind: "classified"
|
|
870
881
|
});
|
|
871
|
-
let n = t.entries.map((e) => e.path), r =
|
|
872
|
-
if (r === null) return
|
|
873
|
-
let i = await e(
|
|
882
|
+
let n = t.entries.map((e) => e.path), r = _n(n);
|
|
883
|
+
if (r === null) return I("GIT_OUTPUT_INVALID");
|
|
884
|
+
let i = await e(cn, {
|
|
874
885
|
cwd: t.repositoryRoot,
|
|
875
886
|
input: r,
|
|
876
887
|
maxOutputBytes: Math.max(t.maxMetadataBytes, 1),
|
|
877
888
|
...t.signal === void 0 ? {} : { signal: t.signal }
|
|
878
889
|
});
|
|
879
|
-
if (i.kind === "failed") return
|
|
880
|
-
if (i.value.byteLength > t.maxMetadataBytes) return
|
|
881
|
-
let a =
|
|
890
|
+
if (i.kind === "failed") return I(hn(i.reason), i.subcommand);
|
|
891
|
+
if (i.value.byteLength > t.maxMetadataBytes) return I("RESOURCE_LIMIT_EXCEEDED");
|
|
892
|
+
let a = mn({ paths: n });
|
|
882
893
|
a.consume(i.value);
|
|
883
894
|
let o = a.finish();
|
|
884
|
-
if (o.kind === "failed" || o.attributes.length !== t.entries.length) return
|
|
895
|
+
if (o.kind === "failed" || o.attributes.length !== t.entries.length) return I("GIT_OUTPUT_INVALID");
|
|
885
896
|
let s = t.entries.map((e, t) => {
|
|
886
897
|
let n = o.attributes[t];
|
|
887
898
|
return n === void 0 || n.path !== e.path ? null : Object.freeze({
|
|
888
899
|
...e,
|
|
889
|
-
contentTransformation:
|
|
900
|
+
contentTransformation: vn(n.filter, n.ident, n.workingTreeEncoding)
|
|
890
901
|
});
|
|
891
902
|
});
|
|
892
|
-
return s.some((e) => e === null) ?
|
|
903
|
+
return s.some((e) => e === null) ? I("GIT_OUTPUT_INVALID") : Object.freeze({
|
|
893
904
|
entries: Object.freeze(s.filter((e) => e !== null)),
|
|
894
905
|
gitMetadataBytes: i.value.byteLength,
|
|
895
906
|
kind: "classified"
|
|
896
907
|
});
|
|
897
|
-
},
|
|
908
|
+
}, L = () => Object.freeze({ kind: "failed" }), bn = (e) => {
|
|
898
909
|
let t = new Map();
|
|
899
910
|
for (let n of e) {
|
|
900
911
|
let e = t.get(n.path);
|
|
901
912
|
if (n.kind === "untracked") {
|
|
902
|
-
if (e !== void 0) return
|
|
913
|
+
if (e !== void 0) return L();
|
|
903
914
|
t.set(n.path, {
|
|
904
915
|
kind: "untracked",
|
|
905
916
|
path: n.path
|
|
906
917
|
});
|
|
907
918
|
continue;
|
|
908
919
|
}
|
|
909
|
-
if (n.mode === "160000" || e?.kind === "untracked") return
|
|
920
|
+
if (n.mode === "160000" || e?.kind === "untracked") return L();
|
|
910
921
|
let r = e ?? {
|
|
911
922
|
indexEntriesByStage: new Map(),
|
|
912
923
|
kind: "tracked",
|
|
913
924
|
path: n.path
|
|
914
925
|
};
|
|
915
|
-
if (r.indexEntriesByStage.has(n.stage)) return
|
|
926
|
+
if (r.indexEntriesByStage.has(n.stage)) return L();
|
|
916
927
|
r.indexEntriesByStage.set(n.stage, Object.freeze({
|
|
917
928
|
mode: n.mode,
|
|
918
929
|
stage: n.stage
|
|
@@ -924,9 +935,9 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
924
935
|
n.push(Object.freeze(e));
|
|
925
936
|
continue;
|
|
926
937
|
}
|
|
927
|
-
if (e.indexEntriesByStage.has(0) && e.indexEntriesByStage.size !== 1) return
|
|
938
|
+
if (e.indexEntriesByStage.has(0) && e.indexEntriesByStage.size !== 1) return L();
|
|
928
939
|
let t = [...e.indexEntriesByStage.values()].sort((e, t) => e.stage - t.stage);
|
|
929
|
-
if (t.length === 0) return
|
|
940
|
+
if (t.length === 0) return L();
|
|
930
941
|
n.push(Object.freeze({
|
|
931
942
|
indexEntries: Object.freeze(t),
|
|
932
943
|
kind: "tracked",
|
|
@@ -937,18 +948,18 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
937
948
|
candidates: Object.freeze(n),
|
|
938
949
|
kind: "collapsed"
|
|
939
950
|
});
|
|
940
|
-
},
|
|
951
|
+
}, xn = (e) => Object.freeze({
|
|
941
952
|
errorCode: e,
|
|
942
953
|
kind: "failed"
|
|
943
|
-
}),
|
|
954
|
+
}), Sn = (e) => {
|
|
944
955
|
let t = e?.code?.toUpperCase();
|
|
945
|
-
return t === "ENOENT" || t === "ENOTDIR" ? null :
|
|
946
|
-
},
|
|
956
|
+
return t === "ENOENT" || t === "ENOTDIR" ? null : xn(t === "EACCES" || t === "EPERM" ? "GIT_ACCESS_DENIED" : t === "ELOOP" ? "GIT_OUTPUT_INVALID" : "GIT_COMMAND_FAILED");
|
|
957
|
+
}, Cn = async (e) => k(e), wn = ((e = Cn) => async (t, n) => {
|
|
947
958
|
let r;
|
|
948
959
|
try {
|
|
949
960
|
r = await e(D.join(t, n));
|
|
950
961
|
} catch (e) {
|
|
951
|
-
return
|
|
962
|
+
return Sn(e) ?? Object.freeze({ kind: "missing" });
|
|
952
963
|
}
|
|
953
964
|
return r.isSymbolicLink() ? Object.freeze({
|
|
954
965
|
entryType: "symlink",
|
|
@@ -960,11 +971,11 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
960
971
|
entryType: "unsupported",
|
|
961
972
|
kind: "inspected"
|
|
962
973
|
});
|
|
963
|
-
})(),
|
|
974
|
+
})(), Tn = "config", En = (e, t) => Object.freeze({
|
|
964
975
|
errorCode: e,
|
|
965
976
|
kind: "failed",
|
|
966
977
|
...t === void 0 ? {} : { subcommand: t }
|
|
967
|
-
}),
|
|
978
|
+
}), Dn = (e) => {
|
|
968
979
|
switch (e) {
|
|
969
980
|
case "aborted": return "GIT_OPERATION_ABORTED";
|
|
970
981
|
case "not-found": return "GIT_NOT_FOUND";
|
|
@@ -974,37 +985,37 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
974
985
|
case "output-invalid": return "GIT_OUTPUT_INVALID";
|
|
975
986
|
case "command-failed": return "GIT_COMMAND_FAILED";
|
|
976
987
|
}
|
|
977
|
-
},
|
|
978
|
-
if (t.signal?.aborted) return
|
|
979
|
-
if (!Number.isSafeInteger(t.maxMetadataBytes) || t.maxMetadataBytes < 0) return
|
|
988
|
+
}, On = (e = ce) => async (t) => {
|
|
989
|
+
if (t.signal?.aborted) return En("GIT_OPERATION_ABORTED");
|
|
990
|
+
if (!Number.isSafeInteger(t.maxMetadataBytes) || t.maxMetadataBytes < 0) return En("RESOURCE_LIMIT_EXCEEDED");
|
|
980
991
|
let n = await C(() => e(t.repositoryRoot, "core.symlinks", !0, {
|
|
981
992
|
maxOutputBytes: Math.max(t.maxMetadataBytes, 1),
|
|
982
993
|
timeoutSeconds: 300,
|
|
983
994
|
...t.signal === void 0 ? {} : { signal: t.signal }
|
|
984
|
-
}), t.signal,
|
|
985
|
-
if (n.kind === "failed") return Dn(
|
|
995
|
+
}), t.signal, Tn);
|
|
996
|
+
if (n.kind === "failed") return En(Dn(n.reason), n.subcommand);
|
|
986
997
|
let r = n.value ? 5 : 6;
|
|
987
|
-
return r > t.maxMetadataBytes ?
|
|
998
|
+
return r > t.maxMetadataBytes ? En("RESOURCE_LIMIT_EXCEEDED") : Object.freeze({
|
|
988
999
|
gitMetadataBytes: r,
|
|
989
1000
|
isEnabled: n.value,
|
|
990
1001
|
kind: "resolved"
|
|
991
1002
|
});
|
|
992
|
-
},
|
|
1003
|
+
}, kn = On(), R = (e) => Object.freeze({
|
|
993
1004
|
errorCode: e,
|
|
994
1005
|
kind: "failed"
|
|
995
|
-
}),
|
|
996
|
-
if (n.signal?.aborted) return
|
|
997
|
-
if (!Number.isSafeInteger(n.maxMetadataBytes) || n.maxMetadataBytes < 0) return
|
|
998
|
-
let r =
|
|
999
|
-
if (r.kind === "failed") return
|
|
1006
|
+
}), An = (e) => e.indexEntries.some(({ mode: e }) => e === "120000"), jn = (e) => e.indexEntries.some(({ mode: e }) => e === "100644" || e === "100755"), Mn = (e = wn, t = kn) => async (n) => {
|
|
1007
|
+
if (n.signal?.aborted) return R("GIT_OPERATION_ABORTED");
|
|
1008
|
+
if (!Number.isSafeInteger(n.maxMetadataBytes) || n.maxMetadataBytes < 0) return R("RESOURCE_LIMIT_EXCEEDED");
|
|
1009
|
+
let r = bn(n.candidates);
|
|
1010
|
+
if (r.kind === "failed") return R("GIT_OUTPUT_INVALID");
|
|
1000
1011
|
let i = [], a = null;
|
|
1001
1012
|
for (let o of r.candidates) {
|
|
1002
|
-
if (n.signal?.aborted) return
|
|
1013
|
+
if (n.signal?.aborted) return R("GIT_OPERATION_ABORTED");
|
|
1003
1014
|
let r = await e(n.repositoryRoot, o.path);
|
|
1004
|
-
if (n.signal?.aborted) return
|
|
1015
|
+
if (n.signal?.aborted) return R("GIT_OPERATION_ABORTED");
|
|
1005
1016
|
if (r.kind === "failed") return r;
|
|
1006
1017
|
if (r.kind === "missing") continue;
|
|
1007
|
-
if (r.entryType === "unsupported") return
|
|
1018
|
+
if (r.entryType === "unsupported") return R("GIT_OUTPUT_INVALID");
|
|
1008
1019
|
if (o.kind === "untracked") {
|
|
1009
1020
|
i.push(Object.freeze({
|
|
1010
1021
|
entryType: r.entryType,
|
|
@@ -1014,7 +1025,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1014
1025
|
}));
|
|
1015
1026
|
continue;
|
|
1016
1027
|
}
|
|
1017
|
-
if (r.entryType === "symlink" || !
|
|
1028
|
+
if (r.entryType === "symlink" || !An(o)) {
|
|
1018
1029
|
i.push(Object.freeze({
|
|
1019
1030
|
entryType: r.entryType,
|
|
1020
1031
|
indexEntries: o.indexEntries,
|
|
@@ -1029,7 +1040,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1029
1040
|
repositoryRoot: n.repositoryRoot,
|
|
1030
1041
|
...n.signal === void 0 ? {} : { signal: n.signal }
|
|
1031
1042
|
}), a.kind === "failed") return a;
|
|
1032
|
-
if (!Number.isSafeInteger(a.gitMetadataBytes) || a.gitMetadataBytes < 0 || a.gitMetadataBytes > n.maxMetadataBytes || !a.isEnabled &&
|
|
1043
|
+
if (!Number.isSafeInteger(a.gitMetadataBytes) || a.gitMetadataBytes < 0 || a.gitMetadataBytes > n.maxMetadataBytes || !a.isEnabled && jn(o)) return R("GIT_OUTPUT_INVALID");
|
|
1033
1044
|
let s = !a.isEnabled;
|
|
1034
1045
|
i.push(Object.freeze({
|
|
1035
1046
|
entryType: s ? "symlink" : "file",
|
|
@@ -1044,19 +1055,19 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1044
1055
|
gitMetadataBytes: a?.kind === "resolved" ? a.gitMetadataBytes : 0,
|
|
1045
1056
|
kind: "normalized"
|
|
1046
1057
|
});
|
|
1047
|
-
},
|
|
1058
|
+
}, Nn = () => Object.freeze({
|
|
1048
1059
|
errorCode: "GIT_OPERATION_ABORTED",
|
|
1049
1060
|
kind: "failed"
|
|
1050
|
-
}),
|
|
1061
|
+
}), Pn = (e) => {
|
|
1051
1062
|
let t = e.replace(/\/$/u, "").split("/");
|
|
1052
1063
|
return t.slice(0, -1).map((e, n) => t.slice(0, n + 1).join("/"));
|
|
1053
|
-
},
|
|
1054
|
-
if (t.signal?.aborted) return
|
|
1055
|
-
let n = [...new Set(t.candidates.flatMap(({ path: e }) =>
|
|
1064
|
+
}, Fn = (e, t) => Pn(e).some((e) => t.has(e)), In = ((e = wn) => async (t) => {
|
|
1065
|
+
if (t.signal?.aborted) return Nn();
|
|
1066
|
+
let n = [...new Set(t.candidates.flatMap(({ path: e }) => Pn(e)))].sort((e, t) => e.split("/").length - t.split("/").length), r = new Set();
|
|
1056
1067
|
for (let i of n) {
|
|
1057
|
-
if (
|
|
1068
|
+
if (Fn(i, r)) continue;
|
|
1058
1069
|
let n = await e(t.repositoryRoot, i);
|
|
1059
|
-
if (t.signal?.aborted) return
|
|
1070
|
+
if (t.signal?.aborted) return Nn();
|
|
1060
1071
|
if (n.kind === "failed") return n;
|
|
1061
1072
|
n.kind === "inspected" && n.entryType === "symlink" && r.add(i);
|
|
1062
1073
|
}
|
|
@@ -1064,7 +1075,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1064
1075
|
candidates: t.candidates,
|
|
1065
1076
|
kind: "shadowed"
|
|
1066
1077
|
});
|
|
1067
|
-
let i = t.candidates.filter(({ path: e }) => !
|
|
1078
|
+
let i = t.candidates.filter(({ path: e }) => !Fn(e, r)), a = new Set(i.map(({ path: e }) => e)), o = [...r].filter((e) => !a.has(e)).map((e) => Object.freeze({
|
|
1068
1079
|
kind: "untracked",
|
|
1069
1080
|
path: e
|
|
1070
1081
|
}));
|
|
@@ -1072,13 +1083,13 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1072
1083
|
candidates: Object.freeze([...i, ...o]),
|
|
1073
1084
|
kind: "shadowed"
|
|
1074
1085
|
});
|
|
1075
|
-
})(),
|
|
1086
|
+
})(), Ln = () => Object.freeze({
|
|
1076
1087
|
errorCode: "GIT_OUTPUT_INVALID",
|
|
1077
1088
|
kind: "failed"
|
|
1078
|
-
}),
|
|
1089
|
+
}), Rn = (e) => {
|
|
1079
1090
|
let t = `/${e}`;
|
|
1080
1091
|
return t !== "/" && Ee(t) ? t : null;
|
|
1081
|
-
},
|
|
1092
|
+
}, zn = (e) => Rn(e.kind === "untracked" && e.path.endsWith("/") ? e.path.slice(0, -1) : e.path), Bn = (e, t) => {
|
|
1082
1093
|
let n = e[Symbol.iterator](), r = t[Symbol.iterator]();
|
|
1083
1094
|
for (;;) {
|
|
1084
1095
|
let e = n.next(), t = r.next();
|
|
@@ -1087,11 +1098,11 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1087
1098
|
let i = e.value.codePointAt(0) ?? 0, a = t.value.codePointAt(0) ?? 0;
|
|
1088
1099
|
if (i !== a) return i < a ? -1 : 1;
|
|
1089
1100
|
}
|
|
1090
|
-
},
|
|
1101
|
+
}, Vn = (e) => {
|
|
1091
1102
|
let t = [];
|
|
1092
1103
|
for (let n of e.candidates) {
|
|
1093
|
-
if (
|
|
1094
|
-
if (n.path === "moldea" || n.path.startsWith("moldea/")) return
|
|
1104
|
+
if (zn(n) === null) {
|
|
1105
|
+
if (n.path === "moldea" || n.path.startsWith("moldea/")) return Ln();
|
|
1095
1106
|
continue;
|
|
1096
1107
|
}
|
|
1097
1108
|
t.push(n);
|
|
@@ -1100,21 +1111,21 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1100
1111
|
candidates: Object.freeze(t),
|
|
1101
1112
|
kind: "filtered"
|
|
1102
1113
|
});
|
|
1103
|
-
},
|
|
1114
|
+
}, Hn = (e) => {
|
|
1104
1115
|
let t = [], n = new Set();
|
|
1105
1116
|
for (let r of e.entries) {
|
|
1106
|
-
let e =
|
|
1107
|
-
if (e === null || n.has(e)) return
|
|
1117
|
+
let e = Rn(r.path);
|
|
1118
|
+
if (e === null || n.has(e)) return Ln();
|
|
1108
1119
|
n.add(e), t.push(Object.freeze({
|
|
1109
1120
|
...r,
|
|
1110
1121
|
path: e
|
|
1111
1122
|
}));
|
|
1112
1123
|
}
|
|
1113
|
-
return t.sort((e, t) =>
|
|
1124
|
+
return t.sort((e, t) => Bn(e.path, t.path)), Object.freeze({
|
|
1114
1125
|
entries: Object.freeze(t),
|
|
1115
1126
|
kind: "normalized"
|
|
1116
1127
|
});
|
|
1117
|
-
},
|
|
1128
|
+
}, Un = (e) => {
|
|
1118
1129
|
if (e.byteLength === 0) return null;
|
|
1119
1130
|
try {
|
|
1120
1131
|
return new TextDecoder("utf-8", {
|
|
@@ -1124,24 +1135,24 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1124
1135
|
} catch {
|
|
1125
1136
|
return null;
|
|
1126
1137
|
}
|
|
1127
|
-
},
|
|
1138
|
+
}, Wn = (e, t) => {
|
|
1128
1139
|
let n = new Uint8Array(t), r = 0;
|
|
1129
1140
|
for (let t of e) n.set(t, r), r += t.byteLength;
|
|
1130
1141
|
return n;
|
|
1131
|
-
},
|
|
1132
|
-
let t =
|
|
1142
|
+
}, Gn = (e) => {
|
|
1143
|
+
let t = Un(e);
|
|
1133
1144
|
return t === null || !t.isWellFormed() ? null : Object.freeze({
|
|
1134
1145
|
kind: "untracked",
|
|
1135
1146
|
path: t
|
|
1136
1147
|
});
|
|
1137
|
-
},
|
|
1148
|
+
}, Kn = (e, t) => {
|
|
1138
1149
|
let n = [], r = null, i = 0, a = [], o = () => {
|
|
1139
1150
|
if (r !== null) return;
|
|
1140
1151
|
if (n.length >= e) {
|
|
1141
1152
|
r = "entry-limit-exceeded", i = 0, a = [];
|
|
1142
1153
|
return;
|
|
1143
1154
|
}
|
|
1144
|
-
let o = t(
|
|
1155
|
+
let o = t(Wn(a, i));
|
|
1145
1156
|
if (i = 0, a = [], o === null) {
|
|
1146
1157
|
r = "invalid";
|
|
1147
1158
|
return;
|
|
@@ -1169,13 +1180,13 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1169
1180
|
reason: r
|
|
1170
1181
|
}))
|
|
1171
1182
|
};
|
|
1172
|
-
},
|
|
1183
|
+
}, qn = (e) => Kn(e, Gn), Jn = ".git", Yn = 6, Xn = (e) => "kind" in e, z = (e) => Object.freeze({
|
|
1173
1184
|
errorCode: e,
|
|
1174
1185
|
kind: "failed"
|
|
1175
|
-
}),
|
|
1186
|
+
}), Zn = (e) => {
|
|
1176
1187
|
let t = e?.code?.toUpperCase();
|
|
1177
1188
|
return t === "EACCES" || t === "EPERM" ? "GIT_ACCESS_DENIED" : t === "ENOENT" || t === "ENOTDIR" || t === "ELOOP" ? "GIT_OUTPUT_INVALID" : "GIT_COMMAND_FAILED";
|
|
1178
|
-
},
|
|
1189
|
+
}, Qn = (e) => {
|
|
1179
1190
|
switch (e) {
|
|
1180
1191
|
case "aborted": return "GIT_OPERATION_ABORTED";
|
|
1181
1192
|
case "not-found": return "GIT_NOT_FOUND";
|
|
@@ -1185,7 +1196,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1185
1196
|
case "output-invalid": return "GIT_OUTPUT_INVALID";
|
|
1186
1197
|
case "command-failed": return "GIT_COMMAND_FAILED";
|
|
1187
1198
|
}
|
|
1188
|
-
},
|
|
1199
|
+
}, $n = async (e, t) => {
|
|
1189
1200
|
try {
|
|
1190
1201
|
let n = await t(e);
|
|
1191
1202
|
return Object.freeze({
|
|
@@ -1193,30 +1204,30 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1193
1204
|
kind: "read"
|
|
1194
1205
|
});
|
|
1195
1206
|
} catch (e) {
|
|
1196
|
-
return
|
|
1207
|
+
return z(Zn(e));
|
|
1197
1208
|
}
|
|
1198
|
-
},
|
|
1209
|
+
}, er = async (e, t) => {
|
|
1199
1210
|
try {
|
|
1200
1211
|
return Object.freeze({
|
|
1201
1212
|
kind: "inspected",
|
|
1202
1213
|
statistics: await t(e)
|
|
1203
1214
|
});
|
|
1204
1215
|
} catch (e) {
|
|
1205
|
-
return
|
|
1216
|
+
return z(Zn(e));
|
|
1206
1217
|
}
|
|
1207
1218
|
}, tr = (e, t) => e.has(Ue.from(t, "utf8").toString("hex")), nr = (e, t) => e.isDirectory() && !e.isSymbolicLink() && t.isDirectory() && !t.isSymbolicLink() && e.dev === t.dev && e.ino === t.ino, rr = async (e, t, n, r, i, a, o) => {
|
|
1208
|
-
if (o?.aborted) return
|
|
1209
|
-
if (!Number.isSafeInteger(r) || r < 0) return
|
|
1219
|
+
if (o?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1220
|
+
if (!Number.isSafeInteger(r) || r < 0) return z("RESOURCE_LIMIT_EXCEEDED");
|
|
1210
1221
|
let s = await C(() => i(e, {
|
|
1211
1222
|
maxOutputBytes: Math.max(r, 1),
|
|
1212
1223
|
timeoutSeconds: 300,
|
|
1213
1224
|
...o === void 0 ? {} : { signal: o }
|
|
1214
1225
|
}), o);
|
|
1215
|
-
if (s.kind === "failed") return
|
|
1216
|
-
if (s.value === null) return
|
|
1217
|
-
let c = s.value, l =
|
|
1218
|
-
if (l > r) return
|
|
1219
|
-
if (!D.isAbsolute(c)) return
|
|
1226
|
+
if (s.kind === "failed") return z(Qn(s.reason));
|
|
1227
|
+
if (s.value === null) return z("GIT_COMMAND_FAILED");
|
|
1228
|
+
let c = s.value, l = Yn + Ce(c);
|
|
1229
|
+
if (l > r) return z("RESOURCE_LIMIT_EXCEEDED");
|
|
1230
|
+
if (!D.isAbsolute(c)) return z("GIT_OUTPUT_INVALID");
|
|
1220
1231
|
if (vt(c, e)) return Object.freeze({
|
|
1221
1232
|
gitMetadataBytes: l,
|
|
1222
1233
|
kind: "validated",
|
|
@@ -1227,33 +1238,33 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1227
1238
|
kind: "validated",
|
|
1228
1239
|
ownership: "selected-repository"
|
|
1229
1240
|
});
|
|
1230
|
-
let u = await
|
|
1231
|
-
if (o?.aborted) return
|
|
1241
|
+
let u = await er(c, a);
|
|
1242
|
+
if (o?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1232
1243
|
if (u.kind === "failed") return u;
|
|
1233
|
-
if (!u.statistics.isDirectory() || u.statistics.isSymbolicLink()) return
|
|
1244
|
+
if (!u.statistics.isDirectory() || u.statistics.isSymbolicLink()) return z("GIT_OUTPUT_INVALID");
|
|
1234
1245
|
if (yt(u.statistics, n)) return Object.freeze({
|
|
1235
1246
|
gitMetadataBytes: l,
|
|
1236
1247
|
kind: "validated",
|
|
1237
1248
|
ownership: "nested-repository"
|
|
1238
1249
|
});
|
|
1239
|
-
let d = await
|
|
1240
|
-
return o?.aborted ?
|
|
1250
|
+
let d = await er(t, a);
|
|
1251
|
+
return o?.aborted ? z("GIT_OPERATION_ABORTED") : d.kind === "failed" ? d : d.statistics.isDirectory() && !d.statistics.isSymbolicLink() && yt(u.statistics, d.statistics) ? Object.freeze({
|
|
1241
1252
|
gitMetadataBytes: l,
|
|
1242
1253
|
kind: "validated",
|
|
1243
1254
|
ownership: "selected-repository"
|
|
1244
|
-
}) :
|
|
1255
|
+
}) : z("GIT_OUTPUT_INVALID");
|
|
1245
1256
|
}, ir = async (e) => k(e, { bigint: !0 }), ar = async (e) => ze(e, { encoding: "buffer" }), or = (e = me, t = ir, n = ar) => async (r) => {
|
|
1246
|
-
if (r.signal?.aborted) return
|
|
1257
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1247
1258
|
let i = new Map(), a = [], o = 0, s = null, c = async () => {
|
|
1248
|
-
if (r.signal?.aborted) return
|
|
1259
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1249
1260
|
if (s !== null) return Object.freeze({
|
|
1250
1261
|
encodedNameKeys: s,
|
|
1251
1262
|
kind: "read"
|
|
1252
1263
|
});
|
|
1253
|
-
let e = await
|
|
1254
|
-
return r.signal?.aborted ?
|
|
1264
|
+
let e = await $n(r.repositoryRoot, n);
|
|
1265
|
+
return r.signal?.aborted ? z("GIT_OPERATION_ABORTED") : (e.kind === "read" && (s = e.encodedNameKeys), e);
|
|
1255
1266
|
}, l = async (a, s, l) => {
|
|
1256
|
-
if (r.signal?.aborted) return
|
|
1267
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1257
1268
|
let u = s.length === 0 ? l : `${s}/${l}`, d = i.get(u);
|
|
1258
1269
|
if (d !== void 0) return d;
|
|
1259
1270
|
let f = a === null ? await c() : Object.freeze({
|
|
@@ -1261,32 +1272,32 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1261
1272
|
kind: "read"
|
|
1262
1273
|
});
|
|
1263
1274
|
if (f.kind === "failed") return f;
|
|
1264
|
-
if (!tr(f.encodedNameKeys, l)) return
|
|
1265
|
-
let p = a?.hostPath ?? r.repositoryRoot, m = D.join(p, l), h = await
|
|
1266
|
-
if (r.signal?.aborted) return
|
|
1275
|
+
if (!tr(f.encodedNameKeys, l)) return z("GIT_OUTPUT_INVALID");
|
|
1276
|
+
let p = a?.hostPath ?? r.repositoryRoot, m = D.join(p, l), h = await er(m, t);
|
|
1277
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1267
1278
|
if (h.kind === "failed") return h;
|
|
1268
|
-
if (!h.statistics.isDirectory() || h.statistics.isSymbolicLink()) return
|
|
1269
|
-
let g = await
|
|
1270
|
-
if (r.signal?.aborted) return
|
|
1279
|
+
if (!h.statistics.isDirectory() || h.statistics.isSymbolicLink()) return z("GIT_OUTPUT_INVALID");
|
|
1280
|
+
let g = await $n(m, n);
|
|
1281
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1271
1282
|
if (g.kind === "failed") return g;
|
|
1272
|
-
let _ = await
|
|
1273
|
-
if (r.signal?.aborted) return
|
|
1283
|
+
let _ = await er(m, t);
|
|
1284
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1274
1285
|
if (_.kind === "failed") return _;
|
|
1275
|
-
if (!nr(h.statistics, _.statistics)) return
|
|
1276
|
-
let v = D.join(m,
|
|
1286
|
+
if (!nr(h.statistics, _.statistics)) return z("GIT_OUTPUT_INVALID");
|
|
1287
|
+
let v = D.join(m, Jn), ee = tr(g.encodedNameKeys, Jn), y = "selected-repository";
|
|
1277
1288
|
if (ee) {
|
|
1278
|
-
let n = await
|
|
1279
|
-
if (r.signal?.aborted) return
|
|
1289
|
+
let n = await er(v, t);
|
|
1290
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1280
1291
|
if (n.kind === "failed") return n;
|
|
1281
|
-
if (n.statistics.isSymbolicLink() || !n.statistics.isDirectory() && !n.statistics.isFile()) return
|
|
1292
|
+
if (n.statistics.isSymbolicLink() || !n.statistics.isDirectory() && !n.statistics.isFile()) return z("GIT_OUTPUT_INVALID");
|
|
1282
1293
|
let i = await rr(m, r.repositoryRoot, _.statistics, r.maxMetadataBytes - o, e, t, r.signal);
|
|
1283
1294
|
if (i.kind === "failed") return i;
|
|
1284
1295
|
o += i.gitMetadataBytes, y = i.ownership;
|
|
1285
1296
|
} else try {
|
|
1286
|
-
return await t(v), r.signal?.aborted ?
|
|
1297
|
+
return await t(v), r.signal?.aborted ? z("GIT_OPERATION_ABORTED") : z("GIT_OUTPUT_INVALID");
|
|
1287
1298
|
} catch (e) {
|
|
1288
1299
|
let t = e?.code?.toUpperCase();
|
|
1289
|
-
if (t !== "ENOENT" && t !== "ENOTDIR") return
|
|
1300
|
+
if (t !== "ENOENT" && t !== "ENOTDIR") return z(Zn(e));
|
|
1290
1301
|
}
|
|
1291
1302
|
let b = Object.freeze({
|
|
1292
1303
|
encodedNameKeys: g.encodedNameKeys,
|
|
@@ -1296,18 +1307,18 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1296
1307
|
return i.set(u, b), b;
|
|
1297
1308
|
};
|
|
1298
1309
|
for (let e of r.plans) {
|
|
1299
|
-
if (r.signal?.aborted) return
|
|
1310
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1300
1311
|
let t = "selected-repository", n = null, i = "";
|
|
1301
1312
|
for (let a of e.directorySegments) {
|
|
1302
|
-
if (r.signal?.aborted) return
|
|
1313
|
+
if (r.signal?.aborted) return z("GIT_OPERATION_ABORTED");
|
|
1303
1314
|
let e = await l(n, i, a);
|
|
1304
|
-
if (
|
|
1315
|
+
if (Xn(e)) return e;
|
|
1305
1316
|
if (n = e, i = i.length === 0 ? a : `${i}/${a}`, e.ownership === "nested-repository") {
|
|
1306
1317
|
t = "nested-repository";
|
|
1307
1318
|
break;
|
|
1308
1319
|
}
|
|
1309
1320
|
}
|
|
1310
|
-
if (e.isDirectoryRecord && t !== "nested-repository") return
|
|
1321
|
+
if (e.isDirectoryRecord && t !== "nested-repository") return z("GIT_OUTPUT_INVALID");
|
|
1311
1322
|
a.push(t);
|
|
1312
1323
|
}
|
|
1313
1324
|
return Object.freeze({
|
|
@@ -1417,7 +1428,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1417
1428
|
case "output-limit-exceeded": return "RESOURCE_LIMIT_EXCEEDED";
|
|
1418
1429
|
case "command-failed": return "GIT_COMMAND_FAILED";
|
|
1419
1430
|
}
|
|
1420
|
-
}, hr = (e) =>
|
|
1431
|
+
}, hr = (e) => on.includes(e), gr = (e) => {
|
|
1421
1432
|
let t = [];
|
|
1422
1433
|
for (let { mode: n, path: r, stage: i } of e) {
|
|
1423
1434
|
if (!hr(n)) return null;
|
|
@@ -1433,19 +1444,19 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1433
1444
|
errorCode: e,
|
|
1434
1445
|
kind: "failed",
|
|
1435
1446
|
...t === void 0 ? {} : { subcommand: t }
|
|
1436
|
-
}), yr = (e) => e.kind === "completed" ? e.candidates : B(e.reason === "entry-limit-exceeded" ? "RESOURCE_LIMIT_EXCEEDED" : "GIT_OUTPUT_INVALID"), br = (e) => !Array.isArray(e), xr = ((e = pr, t = fr(or()), n =
|
|
1447
|
+
}), yr = (e) => e.kind === "completed" ? e.candidates : B(e.reason === "entry-limit-exceeded" ? "RESOURCE_LIMIT_EXCEEDED" : "GIT_OUTPUT_INVALID"), br = (e) => !Array.isArray(e), xr = ((e = pr, t = fr(or()), n = Mn(wn, On()), r = yn(), i = Hn, a = In) => async (o) => {
|
|
1437
1448
|
if (o.signal?.aborted) return B("GIT_OPERATION_ABORTED");
|
|
1438
1449
|
let s = (o.selectionPaths ?? []).map((e) => e.slice(1)), c = o.maxMetadataBytes, l = () => ({
|
|
1439
1450
|
maxOutputBytes: Math.max(c, 1),
|
|
1440
1451
|
timeoutSeconds: 300,
|
|
1441
1452
|
...s.length === 0 ? {} : { paths: s },
|
|
1442
1453
|
...o.signal === void 0 ? {} : { signal: o.signal }
|
|
1443
|
-
}), u = await C(() => e.readIndexEntries(o.repositoryRoot, l()), o.signal,
|
|
1454
|
+
}), u = await C(() => e.readIndexEntries(o.repositoryRoot, l()), o.signal, rn);
|
|
1444
1455
|
if (u.kind === "failed") return B(mr(u.reason), u.subcommand);
|
|
1445
1456
|
if (c -= _r(u.value), u.value.length > o.maxEntries || c < 0) return B("RESOURCE_LIMIT_EXCEEDED");
|
|
1446
1457
|
let d = gr(u.value);
|
|
1447
1458
|
if (d === null) return B("GIT_OUTPUT_INVALID");
|
|
1448
|
-
let f = await C(() => e.listUntrackedFiles(o.repositoryRoot, l()), o.signal,
|
|
1459
|
+
let f = await C(() => e.listUntrackedFiles(o.repositoryRoot, l()), o.signal, rn);
|
|
1449
1460
|
if (f.kind === "failed") return B(mr(f.reason), f.subcommand);
|
|
1450
1461
|
if (c -= vr(f.value), d.length + f.value.length > o.maxEntries || c < 0) return B("RESOURCE_LIMIT_EXCEEDED");
|
|
1451
1462
|
if (f.value.some((e) => e.length === 0)) return B("GIT_OUTPUT_INVALID");
|
|
@@ -1454,21 +1465,21 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
1454
1465
|
path: e
|
|
1455
1466
|
}))), m = [];
|
|
1456
1467
|
if (o.includeIgnored === !0 && s.length > 0) {
|
|
1457
|
-
let t = await e.runGit([...
|
|
1468
|
+
let t = await e.runGit([...nn, ...s], {
|
|
1458
1469
|
cwd: o.repositoryRoot,
|
|
1459
1470
|
maxOutputBytes: Math.max(c, 1),
|
|
1460
1471
|
...o.signal === void 0 ? {} : { signal: o.signal }
|
|
1461
1472
|
});
|
|
1462
1473
|
if (t.kind === "failed") return B(mr(t.reason), t.subcommand);
|
|
1463
1474
|
if (c -= t.value.byteLength, c < 0) return B("RESOURCE_LIMIT_EXCEEDED");
|
|
1464
|
-
let n =
|
|
1475
|
+
let n = qn(o.maxEntries - d.length - p.length);
|
|
1465
1476
|
n.consume(t.value);
|
|
1466
1477
|
let r = yr(n.finish());
|
|
1467
1478
|
if (br(r)) return r;
|
|
1468
1479
|
let i = new Set(p.map((e) => e.path));
|
|
1469
1480
|
m = r.filter((e) => !i.has(e.path));
|
|
1470
1481
|
}
|
|
1471
|
-
let h =
|
|
1482
|
+
let h = Vn({ candidates: Object.freeze([
|
|
1472
1483
|
...d,
|
|
1473
1484
|
...p,
|
|
1474
1485
|
...m
|
|
@@ -2275,7 +2286,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2275
2286
|
}),
|
|
2276
2287
|
...e.signal === void 0 ? {} : { signal: e.signal }
|
|
2277
2288
|
}), a), o);
|
|
2278
|
-
}, fi = ((e = ii, t = ui, n =
|
|
2289
|
+
}, fi = ((e = ii, t = ui, n = Yt) => (r) => di(r, e, t, n))(), pi = ((e = ii, t = ui, n = Yt) => (r) => di(r, e, t, n))(), X = (e, t) => Object.freeze({
|
|
2279
2290
|
errorCode: e,
|
|
2280
2291
|
kind: "failed",
|
|
2281
2292
|
...t === void 0 ? {} : { subcommand: t }
|
|
@@ -2304,7 +2315,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2304
2315
|
maxEntries: s.maxEntries,
|
|
2305
2316
|
maxMetadataBytes: s.maxTotalBytes,
|
|
2306
2317
|
repositoryRoot: o,
|
|
2307
|
-
selectionPaths:
|
|
2318
|
+
selectionPaths: an,
|
|
2308
2319
|
...a.signal === void 0 ? {} : { signal: a.signal }
|
|
2309
2320
|
});
|
|
2310
2321
|
return e.kind === "failed" ? X(e.errorCode, e.subcommand) : e;
|
|
@@ -2392,12 +2403,10 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2392
2403
|
errorCount: a.errorCount,
|
|
2393
2404
|
formatVersion: a.formatVersion,
|
|
2394
2405
|
page: e,
|
|
2395
|
-
snapshotDigest: a.snapshotDigest,
|
|
2396
|
-
source: a.source,
|
|
2397
2406
|
coverageCounts: a.coverageCounts,
|
|
2398
2407
|
valid: a.valid,
|
|
2399
2408
|
warningCount: a.warningCount
|
|
2400
|
-
}), s =
|
|
2409
|
+
}), s = p({
|
|
2401
2410
|
command: "validate",
|
|
2402
2411
|
cursor: r,
|
|
2403
2412
|
filters: {},
|
|
@@ -2416,13 +2425,9 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2416
2425
|
counts: a.counts,
|
|
2417
2426
|
formatVersion: a.formatVersion,
|
|
2418
2427
|
page: e,
|
|
2419
|
-
project: a.project,
|
|
2420
|
-
snapshotDigest: a.snapshotDigest,
|
|
2421
|
-
source: a.source,
|
|
2422
2428
|
coverageCounts: a.coverageCounts,
|
|
2423
|
-
valid: a.valid
|
|
2424
|
-
|
|
2425
|
-
}), s = h({
|
|
2429
|
+
valid: a.valid
|
|
2430
|
+
}), s = p({
|
|
2426
2431
|
command: "inspect",
|
|
2427
2432
|
cursor: r,
|
|
2428
2433
|
filters: {},
|
|
@@ -2438,16 +2443,12 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2438
2443
|
stdout: n ? fe(c, t) : u(c)
|
|
2439
2444
|
});
|
|
2440
2445
|
}, Ci = (e, t, n, r, i) => {
|
|
2441
|
-
let a =
|
|
2446
|
+
let a = Wt(e), o = (e) => ({
|
|
2442
2447
|
counts: a.counts,
|
|
2443
|
-
inputDigest: a.inputDigest,
|
|
2444
|
-
manifestDigest: a.manifestDigest,
|
|
2445
2448
|
page: e,
|
|
2446
2449
|
relevant: a.relevant,
|
|
2447
|
-
snapshotDigest: a.snapshotDigest,
|
|
2448
|
-
source: v,
|
|
2449
2450
|
valid: a.valid
|
|
2450
|
-
}), s =
|
|
2451
|
+
}), s = p({
|
|
2451
2452
|
command: "scope",
|
|
2452
2453
|
cursor: r,
|
|
2453
2454
|
filters: { inputDigest: a.inputDigest },
|
|
@@ -2474,10 +2475,10 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2474
2475
|
stdout: n ? d(a, t) : be(a)
|
|
2475
2476
|
});
|
|
2476
2477
|
}, Ti = async (e) => {
|
|
2477
|
-
let { executeMoldeaCliCoreInspection: t } = await import("./chunk-
|
|
2478
|
+
let { executeMoldeaCliCoreInspection: t } = await import("./chunk-afb0cf51.mjs");
|
|
2478
2479
|
return t(e);
|
|
2479
2480
|
}, Ei = async (e) => {
|
|
2480
|
-
let { resolveInstalledMoldeaCliComposition: t } = await import("./chunk-
|
|
2481
|
+
let { resolveInstalledMoldeaCliComposition: t } = await import("./chunk-cb0442cc.mjs");
|
|
2481
2482
|
return t(e);
|
|
2482
2483
|
}, Q = (e, t, n) => Z(_(e, n), t.invocation.command, t.packageMetadata.version, t.invocation.options.isJson, A.OperationalError), Di = ((e = _t, t = _i, n = Ti, r = Ei, i = Ht, a = Ft) => async (o) => {
|
|
2483
2484
|
let s = o.invocation.command, c = o.invocation.options;
|
|
@@ -2494,7 +2495,7 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2494
2495
|
command: "inspect",
|
|
2495
2496
|
cursor: c.cursor,
|
|
2496
2497
|
filters: {}
|
|
2497
|
-
})
|
|
2498
|
+
}) : null;
|
|
2498
2499
|
if (s === m.Scope) {
|
|
2499
2500
|
if (c.pathsInput === "path" && c.path !== null) l = Object.freeze([c.path]);
|
|
2500
2501
|
else if (c.pathsInput === "stdin" && o.stdin !== void 0) {
|
|
@@ -2550,10 +2551,10 @@ var We = (e) => new Uint8Array(e), Ge = ({ maxBytes: r, maxEntries: i }) => {
|
|
|
2550
2551
|
});
|
|
2551
2552
|
return g.kind === "failed" ? Q(g.errorCode, o, g.subcommand === void 0 ? void 0 : { subcommand: g.subcommand }) : s === m.Validate ? xi(g.result, o.packageMetadata.version, c.isJson, c.cursor, c.maxOutputBytes) : s === m.Inspect ? Si(g.result, o.packageMetadata.version, c.isJson, c.cursor, c.maxOutputBytes) : s === m.Scope ? Ci(g.result, o.packageMetadata.version, c.isJson, c.cursor, c.maxOutputBytes) : wi(g.result, o.packageMetadata.version, c.isJson, c.cursor, c.maxOutputBytes);
|
|
2552
2553
|
} catch (e) {
|
|
2553
|
-
return Z(
|
|
2554
|
+
return Z(tn(e), s, o.packageMetadata.version, c.isJson, A.OperationalError);
|
|
2554
2555
|
}
|
|
2555
2556
|
})(), Oi = async (e) => {
|
|
2556
|
-
let t =
|
|
2557
|
+
let t = v(e.commandLineArguments);
|
|
2557
2558
|
if (t.kind === "help") return {
|
|
2558
2559
|
exitCode: A.Success,
|
|
2559
2560
|
stderr: "",
|
|
@@ -2624,7 +2625,7 @@ try {
|
|
|
2624
2625
|
invocationDirectory: e,
|
|
2625
2626
|
packageMetadata: {
|
|
2626
2627
|
dependencies: {
|
|
2627
|
-
"@moldea.ai/core": "workspace:^10.0.
|
|
2628
|
+
"@moldea.ai/core": "workspace:^10.0.1",
|
|
2628
2629
|
"@moldea.ai/repository": "workspace:^4.0.0",
|
|
2629
2630
|
"@moldea.ai/repository-fs": "workspace:^4.0.0",
|
|
2630
2631
|
"jg-crypto": "0.3.0",
|
|
@@ -2635,12 +2636,12 @@ try {
|
|
|
2635
2636
|
semver: "7.8.5"
|
|
2636
2637
|
},
|
|
2637
2638
|
installedPackageVersions: {
|
|
2638
|
-
"@moldea.ai/core": "10.0.
|
|
2639
|
+
"@moldea.ai/core": "10.0.1",
|
|
2639
2640
|
"@moldea.ai/repository": "4.0.1",
|
|
2640
2641
|
"@moldea.ai/repository-fs": "4.0.1"
|
|
2641
2642
|
},
|
|
2642
2643
|
supportedNodeRange: ">=22.17.0",
|
|
2643
|
-
version: "
|
|
2644
|
+
version: "15.0.0"
|
|
2644
2645
|
},
|
|
2645
2646
|
readStdin: Ai,
|
|
2646
2647
|
signal: $.signal
|