import * as mod from "https://gitlab.com/soapbox-pub/strfry-policies/-/raw/develop/mod.ts";| antiDuplicationPolicy | Prevent messages with the exact same content from being submitted repeatedly. |
| filterPolicy | Reject all events which don't match the filter. |
| hellthreadPolicy | Reject messages that tag too many participants. |
| keywordPolicy | Reject events containing any of the strings in its content. |
| noopPolicy | Minimal sample policy for demonstration purposes. Allows all events through. |
| openaiPolicy | Passes event content to OpenAI and then rejects flagged events. |
| powPolicy | Reject events which don't meet Proof-of-Work (NIP-13) criteria. |
| pubkeyBanPolicy | Ban individual pubkeys from publishing events to the relay. |
| rateLimitPolicy | Rate-limits users by their IP address. |
| readOnlyPolicy | This policy rejects all messages. |
| regexPolicy | Reject events whose content matches the regex. |
| whitelistPolicy | Allows only the listed pubkeys to post to the relay. All other events are rejected. |
| pipeline | Processes messages through multiple policies. |
| readStdin | Parse strfy messages from stdin. strfry may batch multiple messages at once. |
| writeStdout | Writes the output message to stdout. |
| AntiDuplication | Policy options for |
| Event | Nostr event. |
| Hellthread | Policy options for |
| InputMessage | strfry input message from stdin. |
| OpenAI | Policy options for |
| OutputMessage | strfry output message to be printed as JSONL (minified JSON followed by a newline) to stdout. |
| POW | Policy options for |
| RateLimit | Policy options for |
| Filter | |
| IterablePubkeys | Sync or async iterable of pubkeys, designed for efficiently loading from large files. |
| OpenAIHandler | Callback for fine control over the policy. It contains the event and the OpenAI moderation data.
Implementations should return |
| Policy | A policy function in this library. It accepts an input message, opts, and returns an output message. |
| PolicyTuple | A policy function with opts to run it with. Used by the pipeline. |