pmsec 2026.6.2 → 2026.6.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 CHANGED
@@ -1,11 +1,6 @@
1
1
  # pmsec (Node)
2
2
 
3
- Zero-config install-time supply-chain hardening for npm, pnpm, yarn, bun,
4
- cargo, mise, uv, and bundler. One command flips on every safe-by-default knob each
5
- package manager exposes — install cooldown, signature trust policy, lockfile
6
- re-verification, build-script attestation, and more.
7
-
8
- ## Install
3
+ Node 22+ ESM CLI for the same pmsec contract as the root project.
9
4
 
10
5
  ```bash
11
6
  npx pmsec
@@ -13,40 +8,30 @@ npx pmsec --check
13
8
  npx pmsec --disable
14
9
  ```
15
10
 
16
- ```bash
17
- uvx pmsec
18
- uvx pmsec --check
19
- uvx pmsec --disable
20
- ```
21
-
22
- If your environment already enforces cooldown (or routes through a proxy
23
- registry), bootstrap pmsec by overriding just for that call:
11
+ Bootstrap through registries that already enforce cooldowns:
24
12
 
25
13
  ```bash
26
14
  npx --registry=https://registry.npmjs.org/ --min-release-age=0 pmsec --check
27
15
  uvx --index https://pypi.org/simple --exclude-newer-package pmsec=2099-01-01 pmsec --check
28
16
  ```
29
17
 
30
- Zero runtime dependencies, ESM, requires Node 22+.
31
-
32
18
  ## Usage
33
19
 
34
- | Invocation | Description |
20
+ | Command | Result |
35
21
  | --- | --- |
36
- | `pmsec` | Default action: write the hardening bundle (1-day cooldown + per-tool extras) to every selected tool's user config. |
37
- | `pmsec --check` | Read each tool's config; exit 1 if any row is missing or below the bundled value. |
38
- | `pmsec --disable` | Remove every key the bundle set; other keys in the file are preserved. |
39
- | `pmsec --version` | Print the installed pmsec version. |
22
+ | `pmsec` | Writes the hardening bundle. |
23
+ | `pmsec --check` | Exits 1 when any selected tool is below policy. |
24
+ | `pmsec --disable` | Removes pmsec-managed keys only. |
25
+ | `pmsec --doctor` | Prints read-only path, ownership, and writability diagnostics. |
26
+ | `pmsec --version` | Prints the version. |
40
27
 
41
- Options: `--tool npm,pnpm,yarn,bun,cargo,mise,uv,bundler`, `--days N` (override the 1-day default), `--force` (overwrite stricter existing cooldowns; default is monotonic), `--json`. `--check` and `--disable` are mutually exclusive.
28
+ Options: `--tool npm,pnpm,yarn,bun,cargo,mise,uv,bundler,aube`, `--days N`,
29
+ `--force`, `--json`.
42
30
 
43
- When the target file is owned by another user (typical: `~/.npmrc` left
44
- root-owned by an old `sudo npm config set`), the write fails with `EACCES`
45
- and pmsec prints the exact `chown` command needed to restore ownership —
46
- re-run after applying it. pmsec never escalates privileges itself.
31
+ Write failures include the target path and ownership hint. pmsec never escalates
32
+ privileges.
47
33
 
48
- See the [project README](https://github.com/HikaruEgashira/pmsec) for the
49
- full table of keys, units, paths, and environment overrides.
34
+ See the root README for the full key table.
50
35
 
51
36
  ## License
52
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmsec",
3
- "version": "2026.6.2",
3
+ "version": "2026.6.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/tools/npm.mjs CHANGED
@@ -10,10 +10,10 @@ export const docs = "https://docs.npmjs.com/cli/v11/using-npm/config#min-release
10
10
  export const minBin = [11, 10, 0];
11
11
  export const extras = [
12
12
  { key: "audit-level", expected: "high", line: "audit-level=high" },
13
- { key: "allow-git", expected: "root", line: "allow-git=root" },
14
- { key: "allow-remote", expected: "root", line: "allow-remote=root" },
15
- { key: "allow-file", expected: "root", line: "allow-file=root" },
16
- { key: "allow-directory", expected: "root", line: "allow-directory=root" },
13
+ { key: "allow-git", expected: "root", line: "allow-git=root", safeValues: ["none", "root"] },
14
+ { key: "allow-remote", expected: "root", line: "allow-remote=root", safeValues: ["none", "root"] },
15
+ { key: "allow-file", expected: "root", line: "allow-file=root", safeValues: ["none", "root"] },
16
+ { key: "allow-directory", expected: "root", line: "allow-directory=root", safeValues: ["none", "root"] },
17
17
  ];
18
18
 
19
19
  export function path(ctx) { return npmrcPath(ctx.env, ctx.home); }
@@ -8,7 +8,8 @@ import { readKey, setKey, removeKey } from "./lines.mjs";
8
8
  export function readExtras(raw, extras) {
9
9
  return extras.map(e => {
10
10
  const cur = readKey(raw, e.key, { sep: e.sep, section: e.section });
11
- return { key: e.key, configured: cur, expected: e.expected, ok: cur === e.expected };
11
+ const safeValues = e.safeValues ?? [e.expected];
12
+ return { key: e.key, configured: cur, expected: e.expected, ok: cur !== null && safeValues.includes(cur) };
12
13
  });
13
14
  }
14
15