Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/sessions / / CommentarySanitizer

Interface: CommentarySanitizer

Defined in: packages/sessions/src/commentary/sanitizer.ts:72

Stateless, deterministic sanitizer. The methods are async-friendly but synchronous on the inside; the API is structured this way so future revisions can move the regex pass into a worker pool.

Stable

Properties

PropertyModifierTypeDefined in
patternsreadonlyreadonly CommentaryPattern[]packages/sessions/src/commentary/sanitizer.ts:74
policyreadonlyCommentaryPolicypackages/sessions/src/commentary/sanitizer.ts:73

Methods

sanitizeMessage()

ts
sanitizeMessage(message, boundary): {
  decisions: readonly CommentarySanitizationDecision[];
  message: Message;
};

Defined in: packages/sessions/src/commentary/sanitizer.ts:86

Sanitize every MessageContent part on a Message. Returns the (possibly unchanged) message plus per-part decisions in source order. system messages are pass-through (their content is a plain string with no commentary potential).

Parameters

ParameterType
messageMessage
boundaryCommentaryBoundary

Returns

ts
{
  decisions: readonly CommentarySanitizationDecision[];
  message: Message;
}
NameTypeDefined in
decisionsreadonly CommentarySanitizationDecision[]packages/sessions/src/commentary/sanitizer.ts:91
messageMessagepackages/sessions/src/commentary/sanitizer.ts:90

sanitizePart()

ts
sanitizePart(part, boundary): CommentarySanitizationResult;

Defined in: packages/sessions/src/commentary/sanitizer.ts:79

Sanitize a single MessageContent part. Returns the (possibly unchanged) part plus the audit-level decision.

Parameters

ParameterType
partMessageContent
boundaryCommentaryBoundary

Returns

CommentarySanitizationResult