mirror of
https://github.com/PR0M3TH3AN/bitgate.git
synced 2026-10-27 16:41:03 +00:00
BitGate read standard events but published a private vocabulary, making it an
island. NIP-32 (kind 1985) is the shared moderation vocabulary; BitGate now
reads and writes it. See ADR 0007.
The design keeps flexibility central, since the goal is a reusable building
block. A label is (namespace, value, target) and carries no built-in meaning —
"deny", "nsfw", and "MIT" are the same kind of object. What a label means is a
policy decision an application supplies via labelMapping { namespace,
denyValues, allowValues }. The codec itself is vocabulary-free; decodeLabels
returns every label regardless of namespace for generic use.
A matching label becomes a contribution authored by the labeller, gated
identically: it denies someone only if the labeller holds the capability in the
roster, exactly like a community source. An untrusted labeller's deny does
nothing, and labels fail closed without verification like any administrative
event.
- consume: ingestEvent maps kind 1985; loadLabels(labellers) fetches them
- emit: commands.publishLabel(target, value), gated by the same capability as
denying, so the shared form is no weaker than the private one
- the widget bundle re-exports the label API for the drop-in path
Validated against 40 real kind:1985 events from public relays (ISO-639-1
language labels among them): all decoded with targets and namespaces, zero
throws. 897 tests; cold gates green; audit clean.
29 lines
538 B
JSON
29 lines
538 B
JSON
{
|
|
"name": "@bitgate/widget",
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"main": "src/index.js",
|
|
"types": "dist/types/index.d.ts",
|
|
"files": [
|
|
"src",
|
|
"dist"
|
|
],
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/types/index.d.ts",
|
|
"import": "./src/index.js"
|
|
},
|
|
"./dist/types/*": "./dist/types/*"
|
|
},
|
|
"scripts": {
|
|
"test": "vitest run",
|
|
"build": "node build.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@bitgate/core": "*",
|
|
"@bitgate/runtime": "*",
|
|
"@bitgate/verify": "*",
|
|
"@bitgate/nostr": "*"
|
|
}
|
|
}
|