@ai-ecoverse/slicc-spectrum 1.111.2 → 1.111.4
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 +2 -2
- package/dist/slicc-ui.js +135 -63
- package/dist/slicc-ui.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -681,7 +681,7 @@ const name = await prompt({ title: 'New cone', label: 'Name', action: 'Create',
|
|
|
681
681
|
It takes a sudo request's command (without `sudo` and its options) and working folder, and returns `{ certain, maybe, once }`:
|
|
682
682
|
|
|
683
683
|
- `certain` is an absolute path when the command names a file or folder holding SLICC's secret rules (`/etc/fnox`, `/etc/fnox/config.toml`, `/etc/slicc/secrets-policy.toml`), a folder above them it changes as a whole (`/`, `/etc`, `/etc/slicc`), a glob or brace that matches one, or a file named like them (`fnox`, `secrets-policy`) anywhere, as `/tmp/fnox/config.toml`.
|
|
684
|
-
It sees through quotes, backslashes, `$'…'` and `$"…"`, `cd` and `pushd` (also inside `bash -c`), relative paths and `..`, extglobs, `/proc/self/root` and `/proc/self/cwd`, option clusters like `-t/etc/fnox`, and comma lists.
|
|
684
|
+
It sees through quotes, backslashes, `$'…'` and `$"…"`, `cd` and `pushd` where a command starts (also inside `bash -c`, `bash -lc` or `su -c`, and after `if`, `then`, `do`, `{`, `!`, `function NAME` and the like, but not after a `-c` of another program, such as `chown -c cd /etc`), relative paths and `..`, extglobs, `/proc/self/root` and `/proc/self/cwd`, option clusters like `-t/etc/fnox`, and comma lists.
|
|
685
685
|
When every command in it is read-only and nothing in it expands, quoted text is data: a jq or yq program such as `'.a // .b | {x: .y}'` isn't split into paths, and `*`, `?`, `[` and `{` in quotes (and `$` in single quotes) are literal, as the shell treats them. Other commands, such as `sh -c '…'`, are still looked into.
|
|
686
686
|
- `maybe` is the token when the command may reach one of them and the check can't tell where it leads: an expansion (`$X`, `$(…)`, backticks), a `~user/..`, `~+` or `~-` path, a `/proc/<pid>/cwd` or `/dev/fd` path, or a command over 4096 characters (its first 40 followed by `…`).
|
|
687
687
|
It's also set, only when nothing above applies (a separate check that never clears or changes those verdicts), when an explicit write names its target from data the check can't see: `yq -s`, `--split-exp` or `--split-exp-file` (`yq -s`), or `xargs` running a command that can write or run others, such as `xargs rm < list` (`xargs rm`). `xargs` running a read-only command (`xargs cat < list`, `xargs grep x -- < list`, `xargs --replace=X cat X < list`, and `xargs sort`, `xargs find`, `xargs uniq -c` or `xargs yq .` with no write flag in the command; with `--replace` or `--eof` split from its value, both readings must be read-only) is a plain read and stays clean.
|
|
@@ -970,7 +970,7 @@ Later backed by: BIOS.
|
|
|
970
970
|
`list()` returns waiting `Approval`s; emit `approvals` when the list changes.
|
|
971
971
|
A `sudo` approval has `id`, `requester` (`kind` `agent` or `user`, `name`, optional `agentId` and `where`, such as a terminal's title), `command` (without `sudo`; bios joins the kernel's argv shell-quoted), optional `target` (the user to run as; shown as `sudo -u {target}` unless `root`), optional `cwd` and `verdict` (`{ decision: 'allow' | 'deny' | 'unsure', reason }`, the automatic check’s view), `createdAt`, `expiresAt` (epoch ms) and `always` (offer Always allow, which covers the requester's user and this exact command).
|
|
972
972
|
With `decide(id, 'once' | 'always' | 'deny')`, which resolves once the decision is recorded and then drops the request from `list()`, the tab shows a warning alert dialog (`dialog[data-approval][data-kind][data-requester]`): "Allow sudo?", "{name} wants to run this with sudo[ in {where}]:" for an agent or "You ran this with sudo[ in {where}] (as {name}):" for a user, the command, "In {cwd}", a notice when the command changes secret rules, what Always allow does, "Denied automatically in m:ss." and how many more wait, with **Deny** (`data-action="deny"`, focused; Escape also denies), **Always allow** (`always`) and **Allow once** (`once`).
|
|
973
|
-
A command that names `/etc/fnox` (or anything in it) or `/etc/slicc/secrets-policy.toml`, resolved against `cwd`, globs included (with quotes and backslashes removed, operands after `--` included; a path with `[`, `{` or `$` counts when the part before it could lead to them), or that names `/`, `/etc` or `/etc/slicc` in a command other than a read-only one (such as `ls`, `cat`, `stat`, `grep`, `jq`, `cut`, `od`, `sha256sum` or `md5sum
|
|
973
|
+
A command that names `/etc/fnox` (or anything in it) or `/etc/slicc/secrets-policy.toml`, resolved against `cwd`, globs included (with quotes and backslashes removed, operands after `--` included; a path with `[`, `{` or `$` counts when the part before it could lead to them), or that names `/`, `/etc` or `/etc/slicc` in a command other than a read-only one (such as `ls`, `cat`, `stat`, `grep`, `jq`, `cut`, `od`, `sha256sum` or `md5sum`, and coreutils' pure output programs, which take no output file and run nothing: `basename`, `dirname`, `printf`, `seq`, `tr`, `fold`, `paste`, `comm`, `join`, `expand`, `unexpand`, `fmt`, `numfmt`, `pr`, `expr`, `factor`, `sum`, `tsort`, `pathchk`, `base32`, `basenc`, `true`, `false`, `id`, `groups`, `whoami`, `logname`, `printenv`, `uname` and `nproc`, so `ls | xargs -n1 basename` is a read; `find` without `-exec`, `-execdir`, `-ok`, `-okdir`, `-delete` or `-fprint`/`-fls`; `sort` without `-o`, `-T` or `--compress-program`; `yq` without `-i`, `-s` or `--split-exp-file`; `base64` without `-o`; `tree` without `-o` or `-R`; `file` without `-C`; `uniq` and `xxd` with one operand at most, counting everything after `--`; a flag counts inside a short cluster, with a value attached (`-o/x`, `-i.bak`), as `--name=value` and abbreviated, but for getopt-style programs (`sort`, `uniq`, `base64`, `file`, `yq`) a cluster ends at `=` or at an option that takes a value, so `sort -to /etc` and `yq -o=json` don't count as writes; `tree` takes each option's value from the next word and reads on in the cluster, so any `o` or `R` in a `tree` cluster counts (`tree -Ho /tmp/x /etc` writes); `xxd` is read with its own rules (one option per word, values attached or in the next word, options end at the first operand), and an option's value isn't a `uniq` or `xxd` operand (`uniq -f 1 /etc`, `xxd -l 16 /etc`); `xargs` counts as read-only when every command it may run is read-only and has no gated write flags (`find /etc … | xargs grep x`, but not `xargs sort`, whose input could add `-o`); `less` and other pagers aren't, since they run commands), or runs with `cwd` in `/etc/fnox`, or names a relative path with `fnox` or `secrets-policy` in it wherever `cd` may have led, gets "This changes secret rules." with the path (`[data-secret-rules]`, the path in the attribute).
|
|
974
974
|
Read-only commands count only by bare name or from `/bin` and `/usr/bin`.
|
|
975
975
|
In a command made only of read-only commands and with no live expansion, the quoted words count whole: `jq '.a // .b' f` doesn't name `/`, and `jq '{a: .b}' f` in `/etc` isn't a brace that could lead to the rules.
|
|
976
976
|
`/proc/<pid>/root` counts as `/` and `/proc/self/cwd` as `cwd`.
|
package/dist/slicc-ui.js
CHANGED
|
@@ -10334,8 +10334,8 @@ var ranges = [
|
|
|
10334
10334
|
[100, "bg", 8]
|
|
10335
10335
|
];
|
|
10336
10336
|
function simple(code3) {
|
|
10337
|
-
const
|
|
10338
|
-
if (
|
|
10337
|
+
const flag = flags[code3];
|
|
10338
|
+
if (flag) return flag;
|
|
10339
10339
|
const range2 = ranges.find(([start2]) => code3 >= start2 && code3 < start2 + 8);
|
|
10340
10340
|
return range2 ? { [range2[1]]: code3 - range2[0] + range2[2] } : null;
|
|
10341
10341
|
}
|
|
@@ -40283,12 +40283,12 @@ var SliccMonitor = class extends ModelElement {
|
|
|
40283
40283
|
</li>`;
|
|
40284
40284
|
}
|
|
40285
40285
|
#section(section) {
|
|
40286
|
-
const
|
|
40286
|
+
const flag = attention2(section);
|
|
40287
40287
|
const surface2 = surfaces[section.id];
|
|
40288
40288
|
const rows2 = section.rows.length > 0;
|
|
40289
|
-
const open = rows2 && (this.expanded[section.id] ??
|
|
40289
|
+
const open = rows2 && (this.expanded[section.id] ?? flag !== null);
|
|
40290
40290
|
const list6 = `rows-${section.id}`;
|
|
40291
|
-
const badge =
|
|
40291
|
+
const badge = flag ? b`<swc-badge size="s" variant=${flag.variant} subtle>${flag.text}</swc-badge>` : A;
|
|
40292
40292
|
return b`<li class="section" data-id=${section.id} data-open=${open ? "" : A}>
|
|
40293
40293
|
<div class="line">
|
|
40294
40294
|
<span class="caption">${rows2 ? b`<button class="toggle" aria-expanded=${open ? "true" : "false"} aria-controls=${open ? list6 : A} @click=${() => {
|
|
@@ -44099,14 +44099,14 @@ var directions2 = /* @__PURE__ */ new Set(["left", "right", "above", "below", "w
|
|
|
44099
44099
|
function scan(parsed, rest, positional) {
|
|
44100
44100
|
for (let index2 = 0; index2 < rest.length; index2++) {
|
|
44101
44101
|
const arg = rest[index2];
|
|
44102
|
-
const
|
|
44103
|
-
if (
|
|
44104
|
-
else if (
|
|
44102
|
+
const flag = arg.startsWith("--") ? arg.slice(2) : null;
|
|
44103
|
+
if (flag === "json") parsed.json = true;
|
|
44104
|
+
else if (flag === "section" || flag !== null && directions2.has(flag)) {
|
|
44105
44105
|
const value = rest[++index2];
|
|
44106
|
-
if (value === void 0) return `--${
|
|
44107
|
-
if (
|
|
44106
|
+
if (value === void 0) return `--${flag} needs a value`;
|
|
44107
|
+
if (flag === "section") parsed.section = value;
|
|
44108
44108
|
else if (parsed.place) return "give one place";
|
|
44109
|
-
else parsed.place = { direction:
|
|
44109
|
+
else parsed.place = { direction: flag, ref: value };
|
|
44110
44110
|
} else if (arg.startsWith("-")) return `unknown option ${arg}`;
|
|
44111
44111
|
else positional.push(arg);
|
|
44112
44112
|
}
|
|
@@ -48570,7 +48570,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
48570
48570
|
const shown4 = developer ? item2 : { ...item2, npm: null };
|
|
48571
48571
|
const meta = npmMeta(shown4);
|
|
48572
48572
|
const note = npmNote(shown4);
|
|
48573
|
-
const
|
|
48573
|
+
const ahead2 = shown4.npm?.state === "offered" ? shown4.npm.latest ?? null : null;
|
|
48574
48574
|
return b`<swc-divider size="s"></swc-divider>
|
|
48575
48575
|
<article data-id=${item2.id} data-state=${item2.state} data-npm=${item2.npm?.state ?? A} aria-label=${item2.label}>
|
|
48576
48576
|
<div class="head">
|
|
@@ -48591,7 +48591,7 @@ var SliccUpdates = class extends ModelElement {
|
|
|
48591
48591
|
<span>${error}</span>
|
|
48592
48592
|
</div>` : A}
|
|
48593
48593
|
${this.#actions(item2)}
|
|
48594
|
-
${this.#whatsNew(`releases:item:${item2.id}`, item2.label, whatsNew(item2.releases, item2.from,
|
|
48594
|
+
${this.#whatsNew(`releases:item:${item2.id}`, item2.label, whatsNew(item2.releases, item2.from, ahead2 ?? item2.to), 3)}
|
|
48595
48595
|
${item2.log ? b`<details ?open=${this.#logs.has(`item:${item2.id}`)} @toggle=${this.#logs.details(`item:${item2.id}`)}><summary>${chevron}Install log</summary><pre>${item2.log}</pre></details>` : A}
|
|
48596
48596
|
</article>`;
|
|
48597
48597
|
}
|
|
@@ -49777,27 +49777,50 @@ var opaque = /^\/(?:proc\/[^/]+\/(?:task\/[^/]+\/)?(?:cwd|fd|map_files)|dev\/fd)
|
|
|
49777
49777
|
var certain = (rules) => rules.startsWith("/") && !opaque.test(rules) && !rules.endsWith("\u2026");
|
|
49778
49778
|
var readOnly = [
|
|
49779
49779
|
"b2sum",
|
|
49780
|
+
"base32",
|
|
49780
49781
|
"base64",
|
|
49782
|
+
"basename",
|
|
49783
|
+
"basenc",
|
|
49781
49784
|
"cat",
|
|
49782
49785
|
"cd",
|
|
49783
49786
|
"cksum",
|
|
49787
|
+
"comm",
|
|
49784
49788
|
"cut",
|
|
49785
49789
|
"df",
|
|
49786
49790
|
"diff",
|
|
49791
|
+
"dirname",
|
|
49787
49792
|
"du",
|
|
49788
49793
|
"echo",
|
|
49794
|
+
"expand",
|
|
49795
|
+
"expr",
|
|
49796
|
+
"factor",
|
|
49797
|
+
"false",
|
|
49789
49798
|
"file",
|
|
49790
49799
|
"find",
|
|
49800
|
+
"fmt",
|
|
49801
|
+
"fold",
|
|
49791
49802
|
"grep",
|
|
49803
|
+
"groups",
|
|
49792
49804
|
"head",
|
|
49805
|
+
"id",
|
|
49806
|
+
"join",
|
|
49793
49807
|
"jq",
|
|
49808
|
+
"logname",
|
|
49794
49809
|
"ls",
|
|
49795
49810
|
"md5sum",
|
|
49796
49811
|
"nl",
|
|
49812
|
+
"nproc",
|
|
49813
|
+
"numfmt",
|
|
49797
49814
|
"od",
|
|
49815
|
+
"paste",
|
|
49816
|
+
"pathchk",
|
|
49817
|
+
"pr",
|
|
49818
|
+
"printenv",
|
|
49819
|
+
"printf",
|
|
49798
49820
|
"pwd",
|
|
49799
49821
|
"readlink",
|
|
49800
49822
|
"realpath",
|
|
49823
|
+
"seq",
|
|
49801
49824
|
"sha1sum",
|
|
49802
49825
|
"sha224sum",
|
|
49803
49826
|
"sha256sum",
|
|
@@ -49805,34 +49828,21 @@ var readOnly = [
|
|
|
49805
49828
|
"sha512sum",
|
|
49806
49829
|
"sort",
|
|
49807
49830
|
"stat",
|
|
49831
|
+
"sum",
|
|
49808
49832
|
"tac",
|
|
49809
49833
|
"tail",
|
|
49834
|
+
"tr",
|
|
49810
49835
|
"tree",
|
|
49836
|
+
"true",
|
|
49837
|
+
"tsort",
|
|
49838
|
+
"uname",
|
|
49839
|
+
"unexpand",
|
|
49811
49840
|
"uniq",
|
|
49812
49841
|
"wc",
|
|
49842
|
+
"whoami",
|
|
49813
49843
|
"xxd",
|
|
49814
49844
|
"yq"
|
|
49815
49845
|
];
|
|
49816
|
-
var flag = (short2, long) => (args2) => args2.some((arg) => {
|
|
49817
|
-
if (!arg.startsWith("--")) return /^-[^-]/.test(arg) && [...short2].some((c29) => arg.includes(c29));
|
|
49818
|
-
const [name] = arg.slice(2).split("=");
|
|
49819
|
-
return !!name && long.some((option2) => option2.startsWith(name));
|
|
49820
|
-
});
|
|
49821
|
-
var operands = (args2) => {
|
|
49822
|
-
const end = args2.includes("--") ? args2.indexOf("--") : args2.length;
|
|
49823
|
-
const named2 = args2.slice(0, end).filter((arg) => arg === "-" || !arg.startsWith("-"));
|
|
49824
|
-
return named2.length + args2.slice(end + 1).length > 1;
|
|
49825
|
-
};
|
|
49826
|
-
var writes = {
|
|
49827
|
-
base64: flag("o", ["output"]),
|
|
49828
|
-
file: flag("C", ["compile"]),
|
|
49829
|
-
find: (args2) => args2.some((arg) => /^-(?:delete|exec|execdir|ok|okdir|fls|fprint0?|fprintf)$/.test(arg)),
|
|
49830
|
-
sort: flag("oT", ["output", "temporary-directory", "compress-program"]),
|
|
49831
|
-
tree: flag("oR", []),
|
|
49832
|
-
uniq: operands,
|
|
49833
|
-
xxd: operands,
|
|
49834
|
-
yq: flag("is", ["inplace", "in-place", "split-exp", "split-exp-file"])
|
|
49835
|
-
};
|
|
49836
49846
|
function candidates(word2) {
|
|
49837
49847
|
if (word2 === "--") return [];
|
|
49838
49848
|
if (word2.startsWith("--"))
|
|
@@ -49856,10 +49866,6 @@ function protects(path2, whole) {
|
|
|
49856
49866
|
return rulePaths.some((rule) => glob.test(rule)) || top !== path2 && pattern(top).test("/etc/fnox") || whole && ruleParents.some((parent) => glob.test(parent));
|
|
49857
49867
|
}
|
|
49858
49868
|
var command2 = (word2) => word2.split("/").pop() ?? "";
|
|
49859
|
-
var trusted2 = ([word2, ...args2]) => {
|
|
49860
|
-
const name = word2.replace(/^\/(?:usr\/)?bin\/(?=[^/]+$)/, "");
|
|
49861
|
-
return readOnly.includes(name) && !writes[name]?.(args2);
|
|
49862
|
-
};
|
|
49863
49869
|
function letter(arg, short2, takes) {
|
|
49864
49870
|
for (const char of arg.slice(1)) {
|
|
49865
49871
|
if (short2.includes(char)) return true;
|
|
@@ -49874,17 +49880,47 @@ var option = (short2, long, takes = "") => (args2) => args2.find((arg) => {
|
|
|
49874
49880
|
});
|
|
49875
49881
|
var outputs = (valued2) => (args2) => {
|
|
49876
49882
|
const end = args2.includes("--") ? args2.indexOf("--") : args2.length;
|
|
49877
|
-
const named2 = args2.slice(0, end).filter(
|
|
49883
|
+
const named2 = args2.slice(0, end).filter(
|
|
49884
|
+
(arg, index2) => (arg === "-" || !arg.startsWith("-")) && !valued2(args2[index2 - 1] ?? "")
|
|
49885
|
+
);
|
|
49878
49886
|
return named2.length + args2.slice(end + 1).length > 1;
|
|
49879
49887
|
};
|
|
49888
|
+
var uniqValue = (arg) => arg.startsWith("--") ? /^--(?:s|sk|ski|skip|skip-|skip-[fc][\w-]*|c|ch[\w-]*)$/.test(arg) : /^-[^-]/.test(arg) && arg.slice(1).search(/[fsw]/) === arg.length - 2;
|
|
49889
|
+
var xxdValue = {
|
|
49890
|
+
c: "ols",
|
|
49891
|
+
g: "roup",
|
|
49892
|
+
l: "en",
|
|
49893
|
+
n: "ame",
|
|
49894
|
+
o: "ffset"
|
|
49895
|
+
};
|
|
49896
|
+
function valuedXxd(letter2, rest) {
|
|
49897
|
+
if (letter2 === "c" && rest.startsWith("apitalize")) return false;
|
|
49898
|
+
if (letter2 === "R") return !rest;
|
|
49899
|
+
if (letter2 === "s") return !rest || rest.startsWith("kip") || rest.startsWith("eek");
|
|
49900
|
+
return Object.hasOwn(xxdValue, letter2) && (!rest || rest.startsWith(xxdValue[letter2]));
|
|
49901
|
+
}
|
|
49902
|
+
function xxd(args2) {
|
|
49903
|
+
let index2 = 0;
|
|
49904
|
+
for (; index2 < args2.length; index2++) {
|
|
49905
|
+
const arg = args2[index2];
|
|
49906
|
+
if (arg === "--") {
|
|
49907
|
+
index2++;
|
|
49908
|
+
break;
|
|
49909
|
+
}
|
|
49910
|
+
if (!/^-./.test(arg)) break;
|
|
49911
|
+
const pp = arg.startsWith("--") && arg.length > 2 ? arg.slice(1) : arg;
|
|
49912
|
+
if (valuedXxd(pp[1], pp.slice(2))) index2++;
|
|
49913
|
+
}
|
|
49914
|
+
return args2.length - index2 > 1;
|
|
49915
|
+
}
|
|
49880
49916
|
var gates = {
|
|
49881
|
-
base64: option("o", ["output"], "
|
|
49917
|
+
base64: option("o", ["output"], "w"),
|
|
49882
49918
|
file: option("C", ["compile"], "efFmP"),
|
|
49883
|
-
find:
|
|
49919
|
+
find: (args2) => args2.some((arg) => /^-(?:delete|exec|execdir|ok|okdir|fls|fprint0?|fprintf)$/.test(arg)),
|
|
49884
49920
|
sort: option("oT", ["output", "temporary-directory", "compress-program"], "kSt"),
|
|
49885
|
-
tree: option("oR", []
|
|
49886
|
-
uniq: outputs(
|
|
49887
|
-
xxd
|
|
49921
|
+
tree: option("oR", []),
|
|
49922
|
+
uniq: outputs(uniqValue),
|
|
49923
|
+
xxd,
|
|
49888
49924
|
yq: option("is", ["inplace", "in-place", "split-exp", "split-exp-file"], "fIop")
|
|
49889
49925
|
};
|
|
49890
49926
|
var plainly = (word2) => word2.replace(/^\/(?:usr\/)?bin\/(?=[^/]+$)/, "");
|
|
@@ -49941,6 +49977,7 @@ var safe = ([word2, ...args2]) => {
|
|
|
49941
49977
|
const name = plainly(word2);
|
|
49942
49978
|
return readOnly.includes(name) && !gates[name]?.(args2);
|
|
49943
49979
|
};
|
|
49980
|
+
var trusted2 = ([word2, ...args2]) => plainly(word2) === "xargs" ? launched(args2).every((run) => runs(run) && !Object.hasOwn(gates, plainly(run[0] ?? "echo"))) : safe([word2, ...args2]);
|
|
49944
49981
|
var unseen2 = {
|
|
49945
49982
|
xargs: (args2) => {
|
|
49946
49983
|
const run = launched(args2).find((words2) => !runs(words2));
|
|
@@ -49962,10 +49999,18 @@ var wrappers = {
|
|
|
49962
49999
|
timeout: ["ks", ["kill-after", "signal"], 1]
|
|
49963
50000
|
};
|
|
49964
50001
|
var assignment = /^[A-Za-z_]\w*(?:\[[^\]]*\])?\+?=/;
|
|
49965
|
-
var shells = ["sh", "bash", "dash", "zsh", "ksh", "fish"];
|
|
50002
|
+
var shells = ["sh", "bash", "dash", "zsh", "ksh", "fish", "su", "runuser"];
|
|
50003
|
+
var firsts = /* @__PURE__ */ new WeakMap();
|
|
49966
50004
|
function shell(words2, index2) {
|
|
49967
|
-
const
|
|
49968
|
-
|
|
50005
|
+
const flag = words2[index2 - 1] === "--" ? index2 - 2 : index2 - 1;
|
|
50006
|
+
if (!/^-[A-Za-z]*c[A-Za-z]*$/.test(words2[flag] ?? "")) return false;
|
|
50007
|
+
if (!firsts.has(words2))
|
|
50008
|
+
firsts.set(
|
|
50009
|
+
words2,
|
|
50010
|
+
words2.findIndex((word2) => shells.includes(command2(word2)))
|
|
50011
|
+
);
|
|
50012
|
+
const first2 = firsts.get(words2);
|
|
50013
|
+
return first2 >= 0 && first2 < flag;
|
|
49969
50014
|
}
|
|
49970
50015
|
var escaped = /[\\$\ue124]/;
|
|
49971
50016
|
function split(arg, next) {
|
|
@@ -49976,12 +50021,12 @@ function split(arg, next) {
|
|
|
49976
50021
|
return value.length ? value.join("=") : next;
|
|
49977
50022
|
}
|
|
49978
50023
|
function options2(at, start2, name) {
|
|
49979
|
-
if (at.seen.has(`${name} ${start2}`)) return;
|
|
49980
|
-
at.seen.add(`${name} ${start2}`);
|
|
49981
50024
|
const { words: words2 } = at;
|
|
49982
50025
|
const [takes, long, positional] = wrappers[name];
|
|
49983
50026
|
let index2 = start2;
|
|
49984
50027
|
for (; words2[index2]?.startsWith("-") && (words2[index2] !== "-" || name === "env"); index2++) {
|
|
50028
|
+
if (at.seen.has(`${name} ${index2}`)) return;
|
|
50029
|
+
at.seen.add(`${name} ${index2}`);
|
|
49985
50030
|
const arg = words2[index2];
|
|
49986
50031
|
if (arg === "--") {
|
|
49987
50032
|
index2++;
|
|
@@ -50176,11 +50221,38 @@ function tokens(segment2) {
|
|
|
50176
50221
|
function commas(words2) {
|
|
50177
50222
|
return words2.flatMap((word2) => word2.includes(",") ? [word2, ...word2.split(",")] : [word2]).filter(Boolean);
|
|
50178
50223
|
}
|
|
50224
|
+
function ahead(words2, test) {
|
|
50225
|
+
const next = Array(words2.length + 1).fill(words2.length);
|
|
50226
|
+
for (let index2 = words2.length - 1; index2 >= 0; index2--)
|
|
50227
|
+
next[index2] = test(words2[index2]) ? next[index2 + 1] : index2;
|
|
50228
|
+
return next;
|
|
50229
|
+
}
|
|
50230
|
+
function positions2(words2) {
|
|
50231
|
+
const skip = ahead(
|
|
50232
|
+
words2,
|
|
50233
|
+
(word2) => assignment.test(word2) || Object.hasOwn(wrappers, command2(word2)) || /^-|^\d+$/.test(word2)
|
|
50234
|
+
);
|
|
50235
|
+
const dashes = ahead(words2, (word2) => word2.startsWith("-"));
|
|
50236
|
+
const at = [];
|
|
50237
|
+
let [runner, options3] = [-1, -1];
|
|
50238
|
+
for (const index2 of words2.keys()) {
|
|
50239
|
+
const flag = words2[index2 - 1] === "--" ? index2 - 2 : index2 - 1;
|
|
50240
|
+
const start2 = index2 === 0 || words2[index2] !== "--" && (words2[index2 - 1] === "-c" && shell(words2, index2) || flag > runner && runner >= 0 && index2 <= options3 && /^-[A-Za-z]*c[A-Za-z]*$/.test(words2[flag])) || at[index2 - 1] && keyword.test(words2[index2 - 1]) || at[index2 - 2] === true && words2[index2 - 2] === "function";
|
|
50241
|
+
at.push(start2);
|
|
50242
|
+
if (start2) {
|
|
50243
|
+
runner = skip[index2];
|
|
50244
|
+
options3 = dashes[runner + 1] ?? -1;
|
|
50245
|
+
if (!shells.includes(command2(words2[runner] ?? ""))) runner = -1;
|
|
50246
|
+
}
|
|
50247
|
+
}
|
|
50248
|
+
return at;
|
|
50249
|
+
}
|
|
50179
50250
|
function scan2(words2, cwds, whole) {
|
|
50180
50251
|
let cd = false;
|
|
50252
|
+
const at = positions2(words2);
|
|
50181
50253
|
for (const [index2, word2] of words2.entries()) {
|
|
50182
50254
|
let hit = null;
|
|
50183
|
-
if (
|
|
50255
|
+
if (at[index2]) {
|
|
50184
50256
|
cd = ["cd", "pushd"].includes(command2(word2));
|
|
50185
50257
|
hit = touched2(cwds, word2, whole);
|
|
50186
50258
|
} else if (!cd) hit = touched2(cwds, word2, whole);
|
|
@@ -64664,9 +64736,9 @@ var TabReorderController = class extends CompositeDisposable {
|
|
|
64664
64736
|
else this._animState.currentInsertionIndex = null;
|
|
64665
64737
|
}
|
|
64666
64738
|
snapshotTabPositions() {
|
|
64667
|
-
const
|
|
64668
|
-
for (const tab of this._tabs)
|
|
64669
|
-
return
|
|
64739
|
+
const positions3 = /* @__PURE__ */ new Map();
|
|
64740
|
+
for (const tab of this._tabs) positions3.set(tab.value.panel.id, tab.value.element.getBoundingClientRect());
|
|
64741
|
+
return positions3;
|
|
64670
64742
|
}
|
|
64671
64743
|
/** Main-axis extent of a rect for this header's orientation. */
|
|
64672
64744
|
_mainAxisSize(rect) {
|
|
@@ -75780,13 +75852,13 @@ function ensureChildIdByNameId(nodes, index2) {
|
|
|
75780
75852
|
}
|
|
75781
75853
|
function ensureChildPositions(index2) {
|
|
75782
75854
|
if (index2.childPositionById != null) return index2.childPositionById;
|
|
75783
|
-
const
|
|
75855
|
+
const positions3 = /* @__PURE__ */ new Map();
|
|
75784
75856
|
for (let i26 = 0; i26 < index2.childIds.length; i26++) {
|
|
75785
75857
|
const childId = index2.childIds[i26];
|
|
75786
|
-
if (childId != null)
|
|
75858
|
+
if (childId != null) positions3.set(childId, i26);
|
|
75787
75859
|
}
|
|
75788
|
-
index2.childPositionById =
|
|
75789
|
-
return
|
|
75860
|
+
index2.childPositionById = positions3;
|
|
75861
|
+
return positions3;
|
|
75790
75862
|
}
|
|
75791
75863
|
function appendChildReference(index2, childId) {
|
|
75792
75864
|
if (index2.childPositionById != null) index2.childPositionById.set(childId, index2.childIds.length);
|
|
@@ -75925,11 +75997,11 @@ function isDirectoryNode(node2) {
|
|
|
75925
75997
|
function getNodeFlags(node2) {
|
|
75926
75998
|
return node2.depthAndFlags & PATH_STORE_NODE_FLAGS_MASK;
|
|
75927
75999
|
}
|
|
75928
|
-
function hasNodeFlag(node2,
|
|
75929
|
-
return (getNodeFlags(node2) &
|
|
76000
|
+
function hasNodeFlag(node2, flag) {
|
|
76001
|
+
return (getNodeFlags(node2) & flag) !== 0;
|
|
75930
76002
|
}
|
|
75931
|
-
function addNodeFlag(node2,
|
|
75932
|
-
node2.depthAndFlags |=
|
|
76003
|
+
function addNodeFlag(node2, flag) {
|
|
76004
|
+
node2.depthAndFlags |= flag;
|
|
75933
76005
|
}
|
|
75934
76006
|
function setNodeDepth(node2, depth) {
|
|
75935
76007
|
node2.depthAndFlags = createNodeDepthAndFlags(depth, getNodeFlags(node2), getNodeKind(node2));
|
|
@@ -77438,10 +77510,10 @@ function insertChildReference(state2, parentId, childId) {
|
|
|
77438
77510
|
}
|
|
77439
77511
|
function removeChildReference(state2, parentId, childId, childNameId) {
|
|
77440
77512
|
const parentIndex = getDirectoryIndex(state2, parentId);
|
|
77441
|
-
const
|
|
77442
|
-
const childIndex =
|
|
77513
|
+
const positions3 = ensureChildPositions(parentIndex);
|
|
77514
|
+
const childIndex = positions3.get(childId) ?? -1;
|
|
77443
77515
|
ensureChildIdByNameId(state2.snapshot.nodes, parentIndex).delete(childNameId);
|
|
77444
|
-
|
|
77516
|
+
positions3.delete(childId);
|
|
77445
77517
|
const childNode = state2.snapshot.nodes[childId];
|
|
77446
77518
|
if (childNode != null) applyChildAggregateDelta(parentIndex, childId, -childNode.subtreeNodeCount, -childNode.visibleSubtreeCount);
|
|
77447
77519
|
if (childIndex >= 0) {
|