Skip to content

PipelineContext

Defined in: src/pipeline/context.ts:8

compiled: CompiledRules

Defined in: src/pipeline/context.ts:12


config: object

Defined in: src/pipeline/context.ts:11

categories: object[]

detection: object = detectionSchema

accountCategory: string

accountDomains: string[]

automatedNamePattern: string

regex source, case-insensitive, matched against the from ADDRESS

brandNamePattern: string

regex source, case-insensitive, matched against address + display name

personalCategory: string

personalDomains: string[]

the user’s own domains — anything sent from them files as personal

personalProviderDomains: string[]

personalProviderPattern: string

regex source, case-insensitive: freemail providers (needs-action heuristic)

personalReplyExclusionPattern: string

regex source, case-insensitive: senders excluded from the needs-reply bonus

relayDomains: string[]

keepList: string[]

exact sender addresses that must never be swept (checked twice)

needsAction: object = needsActionSchema

optional exclusionKeywords?: object[]

when present, REPLACES the language packs entirely

optional highKeywords?: object[]

when present, REPLACES the language packs entirely

label: string

languages: ("en" | "de")[]

built-in keyword packs to enable — English-only by default

personalNeedsReplyBonus: number

threshold: number

unreadBonus: number

windowDays: number

how far back to scan

ops: object = opsSchema

batchDelayMs: number

batchSize: number

optional maxItems?: number

progressEvery: number

stallBackoffMs: number

stallLimit: number

provider: object

optional baseUrl?: string

override endpoints (testing / self-hosted JMAP)

type: "jmap" | "mcp"

rules: ({ address: string; category: string; kind: "sender"; } | { category: string; domain: string; kind: "domain"; } | { category: string; kind: "name"; onlyForDomains?: string[]; pattern: string; })[]

sweep: object = sweepSchema

optional after?: string

targetLabel: string

textHeuristic: string

full-text heuristic identifying bulk mail


confirm: ConfirmFn

Defined in: src/pipeline/context.ts:16


optional confirmThreshold?: number

Defined in: src/pipeline/context.ts:18

planned mutations above this require confirm() (default 100)


dryRun: boolean

Defined in: src/pipeline/context.ts:13


log: (message) => void

Defined in: src/pipeline/context.ts:19

string

void


optional max?: number

Defined in: src/pipeline/context.ts:15

cap on emails scanned per run


provider: MailProvider

Defined in: src/pipeline/context.ts:10

always the RAW provider — pipelines derive the read side via readProvider()


optional sleep?: (ms) => Promise<void>

Defined in: src/pipeline/context.ts:21

threaded into paging/batching so tests never wait on real timers

number

Promise<void>