- Runtime: Bun (≥1.x)
- Language: TypeScript strict mode
- Module: ESM only (
"type": "module") - Source:
src/four-opencode-anonymizer.ts(NOTsrc/index.ts) - npm name:
@four-bytes/four-opencode-anonymizer
- No
anyunless absolutely necessary - Prefer
constoverlet - Use
async/await— no raw promises - Error handling: typed catch blocks, meaningful messages
- Output: compact, no unnecessary verbosity
Every tool in this plugin exists to save tokens:
- Tools should return only what the agent needs — not full command output
- Parsed, structured output preferred over raw text
- Error messages should be specific and actionable
- No redundant tool functionality — one tool, one clear purpose
- EVERY code change ends with: version bump in
package.json+mise run build - No merge without current
dist/ dist/is gitignored, freshly built beforenpm publish
- LF line endings
- UTF-8 encoding
.local.mdfiles are gitignored — use for personal dev config- No personal paths in committed code
src/
├── four-opencode-anonymizer.ts # Plugin entry — registers all tools
├── tools/
│ ├── detect-pii.ts # PII detection engine
│ ├── anonymize.ts # Anonymization / de-anonymization
│ └── vault-store.ts # SQLite + AES vault operations
└── lib/
├── regex-patterns.ts # PII regex pattern library
├── ner-client.ts # NER service client
└── crypto-utils.ts # AES encryption helpers
All new source files must include:
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2025-2026 Four Bytes