Files
plugins/packages/company-guard/package.json
T
cyanask 001a1f9fbf company-guard 0.4.3: reversible company-name masking middleware (#903)
New middleware package @magpie-community/middleware-company-guard 0.4.3 (ported by @cyanask from cyanask/magpie-company-guard): masks company names in requests with stable per-session aliases, restores them in replies (Responses, Chat Completions, Anthropic Messages, Gemini; streaming and tool arguments), keeps local receipts, and lets a Codex session be approved explicitly. macOS only ("os": ["darwin"]). The receipt page listens on 127.0.0.1:3469 only; nothing goes to an outside host.

Review fixes since 07587b9: default port 3478 (atomcode's) -> 3469, unused in the repo; the three local keys are generated on first run into <config>/magpie/company-guard/keys.json (0600, O_NOFOLLOW, owner-checked) and written into this plugin's own plugins.json entry, so install works with no setup; 27 tests.

Run at 7a147166 on mica: node --test 27 pass, bun test 27 pass; esbuild 0.25.12 rebuild of dist/company-guard.middleware.js is byte-identical (sha256 b2faf535...); merged with origin/main, scripts/check.mjs ok, bun test scripts 24 pass. Broken by hand: onEvent returning the event unrestored -> the four split-chunk tests red; initializeOptions without publishKeys -> five install tests red.
Not tried: a real magpie install end to end. The package is not on npm yet, so it is served from the dist branch until its first npm publish.
2026-11-14 11:18:13 +08:00

72 lines
1.7 KiB
JSON

{
"name": "@magpie-community/middleware-company-guard",
"version": "0.4.3",
"type": "module",
"license": "MIT",
"description": "Local company-name masking, reversible replies and session approvals for Magpie",
"files": [
"dist",
"src",
"vendor",
"company-guard.hooks.mjs",
"README.md",
"LICENSE",
"THIRD_PARTY_NOTICES.md",
"receipt-report.mjs",
"page",
"receipt-page.mjs"
],
"magpie": {
"middleware": "./dist/company-guard.middleware.js",
"hooks": "./company-guard.hooks.mjs",
"options": {
"companies": [],
"gatewayTimeoutMs": 4000
},
"page": {
"title": "Company name protection",
"titles": {
"zh": "公司名称保护",
"zh-TW": "公司名稱保護"
},
"file": "page/index-0.3.3.html",
"service": {
"port": 3469,
"option": "receiptPort"
}
}
},
"main": "./receipt-page.mjs",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/company-guard"
},
"homepage": "https://github.com/cyanask/magpie-company-guard#readme",
"bugs": {
"url": "https://github.com/cyanask/magpie-company-guard/issues"
},
"keywords": [
"magpie-plugin",
"magpie",
"middleware",
"privacy",
"data-masking",
"codex"
],
"scripts": {
"build": "esbuild src/company-guard.js --bundle --format=esm --target=es2020 --outfile=dist/company-guard.middleware.js",
"test": "node --test test/*.test.mjs"
},
"devDependencies": {
"esbuild": "0.25.12"
},
"os": [
"darwin"
],
"engines": {
"node": ">=20",
"magpie": ">=0.1.3841"
}
}