Commit Graph
2 Commits
Author SHA1 Message Date
Muyang d34785ae88 privacy-gate 0.3.1: guide prompts name a coarse media class, never the raw media_type (#838)
privacy-gate 0.3.1 (siml1169, #838): guide mode names a fixed coarse media
class (image, pdf, office, audio, video, unknown) instead of copying the
part's media_type into the prompt, so no clipped or fake MIME prefix can
reach the vendor. Parameters are stripped first, a candidate over 256
characters is ignored before it is normalised, and the part's kind is the
fallback. Bytes are still withheld. Fixes #795.

Reviewed at 2b74b6e69ecaf0d20bd9f5fd4580f673da266736 (base = main b8100001;
mote, Bun 1.4.2, temp HOME):
- packages/privacy-gate `bun test`: 67 pass, 0 fail
- `bun scripts/check.mjs privacy-gate` and `bun scripts/check.mjs`: ok
- repo root `bun test`: 6822 pass, 20 skip, 0 fail
- broken by hand: main's middleware 10 red; no 256 guard, no parameter
  strip, no office mapping, no kind fallback each 1 red (its own case);
  echoing the raw candidate 9 red
- CI run 42377224277 green
Not tried: a real guide-mode request through magpie.
2026-11-07 22:06:22 +08:00
Muyang da8b8d71f3 privacy-gate: release 0.3.0 with branded bilingual docs (#798)
privacy-gate 0.3.0: branded bilingual docs, ShyPie icon and README.

Installs with `magpie plugin add @magpie-community/middleware-privacy-gate`
(from this repo's dist index until npm has the package). Names the
built-in "JS gateway plugins" / "JS 网关插件" (id `middleware`). Icons
are a pie, a shield and a gold chevron, with no bird. magpie.icon points
at packages/privacy-gate/assets/shypie-icon.svg. The middleware code
(privacy-gate.middleware.js) is unchanged since e0a4548a.

Reviewed at 85dbd121b833017982d0a97a2f3fab50be98caab. The last round
(67ae63c3b..85dbd121b) changed only docs/operations.md:10 (ends the
sentence) and the aria-label of the two shypie-icon SVGs ("with a gold
chevron").

Run at 85dbd121b on mote (macOS), Bun 1.4.2, HOME=$(mktemp -d):
- bun test packages/privacy-gate: 62 pass, 0 fail.
- bun scripts/check.mjs privacy-gate: ok, exit 0.
- bun scripts/check.mjs (whole repo): exit 0.
- bun test (root): 6449 pass, 20 skip, 0 fail, 472 files.
- npm pack --dry-run: 12 files, version 0.3.0.
- git merge-tree with origin/main ab0d3fe54: clean.

Not tried: installing 0.3.0 into a running magpie (dist has 0.1.0 only
until this merges). No mover or min in yetone/magpie references it.
2026-11-07 05:56:05 +08:00