Images (WASM) API reference
Exports of @gramforge/images-wasm. Back to the module
Functions
buildChartTree
functionbuildChartTree(input: ChartCardInput): Promise<CardNode>
buildCompletionTree
functionbuildCompletionTree(input: CompletionCardInput): CardNode
buildFailureTree
functionbuildFailureTree(input: FailureCardInput): CardNode
buildFleetOverviewTree
functionbuildFleetOverviewTree(input: FleetOverviewCardInput): Promise<CardNode>
buildNeedsInputTree
functionbuildNeedsInputTree(input: Omit<NeedsInputCardInput, "options"> & { readonly options: readonly NeedsInputOption[]; }): CardNodebuildStatusTree
functionbuildStatusTree(input: StatusCardInput): CardNode
chartToSvg
functionRender a validated `ChartSpec` to an SVG string (pure, no rasterization).
chartToSvg(spec: ChartSpec, dimensions: ChartDimensions): string
col
functionA vertical flex container (`flexDirection: column`).
col(style: CardStyle, children: readonly CardNode[]): BoxNode
computeContentHash
functionSHA-256 of `bytes`, returned as a branded lowercase-hex `ContentHash`.
computeContentHash(bytes: Uint8Array): Promise<ContentHash>
containsColorEmoji
functionTrue when `input` contains at least one codepoint in a color-emoji presentation range (emoticons, symbols/pictographs, transport, supplemental, regional indicators, and the common Misc-Symbols/Dingbats emoji subset).
containsColorEmoji(input: string): boolean
createInMemoryFileIdCacheStore
functionA process-lifetime `Map`-backed store for development/testing.
createInMemoryFileIdCacheStore(): FileIdCacheStore
createTakumiWasmBackend
functionCreate the wasm backend. Instantiation of the wasm module and font registration happen lazily on the first `renderPng` call so this factory is synchronous and side-effect-free until a render is actually requested.
createTakumiWasmBackend(inputs: TakumiWasmInputs): ImageBackend
div
functionA generic flex container.
div(style: CardStyle, children: readonly CardNode[]): BoxNode
emojiCodepoints
functionCollect the distinct emoji codepoints (as `U+XXXX` strings) in `input`.
emojiCodepoints(input: string): string[]
img
functionAn image leaf carrying raw bytes (e.g. a rendered chart PNG).
img(input: { readonly src: Uint8Array; readonly width: number; readonly height: number; readonly style?: CardStyle; }): ImageNoderasterizeSvgResvgWasm
functionRasterize an SVG string to PNG via `@resvg/resvg-wasm` (portable). The resvg wasm binary is injected and initialized once per process.
rasterizeSvgResvgWasm(svg: string, wasm: InitInput): Promise<RasterizeResult>
recordUpload
functionRecord a newly-uploaded `file_id` into the store. The single place a caller writes a `file_id` back — this package itself never performs the upload.
recordUpload(store: FileIdCacheStore, hash: ContentHash, botId: BotId, fileId: TelegramFileId): Promise<void>
renderCardWasm
functionRender a card node tree to PNG bytes via the Takumi WASM backend — a single node-free call for the common case. Reuse a backend across renders by calling {@link createTakumiWasmBackend} directly if you render many cards.
renderCardWasm(node: CardNode, options: RenderPngOptions, inputs: TakumiWasmInputs): Promise<Uint8Array>
resetDiagnostics
functionTest-only: clear the dedup set between tests.
resetDiagnostics(): void
row
functionA horizontal flex container (`flexDirection: row`).
row(style: CardStyle, children: readonly CardNode[]): BoxNode
setDiagnosticHook
functionsetDiagnosticHook(fn: ((e: DiagnosticEvent) => void) | null): void
text
functionA text leaf.
text(value: string, style?: CardStyle): TextNode
toTakumiNode
functiontoTakumiNode(node: CardNode): Node
warnDegraded
functionwarnDegraded(context: string, detail: string): void
warnNotImplemented
functionwarnNotImplemented(category: string, detail: string): void
warnUnexpected
functionwarnUnexpected(context: string, detail: string, data?: Record<string, unknown>): void
Types
BackendKind
typetype BackendKind = "takumi-native" | "takumi-wasm"
BotId
typetype BotId = string & z.BRAND<"BotId">
BoxNode
typetype BoxNode = {
readonly kind: "box";
readonly style: CardStyle;
readonly children: readonly CardNode[];
}CachedFileHit
typetype CachedFileHit = { contentHash: string & z.BRAND<"ContentHash">; hit: true; fileId: string & z.BRAND<"TelegramFileId">; }CardInput
typetype CardInput = { template: "status"; agentName: string; level: "ok" | "warn" | "error"; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; } | { title: string; template: "fleet-overview"; timestampIso: string; agents: { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }[]; chart: { kind: "none"; } | { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }; } | { options: { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }[]; template: "needs-input"; agentName: string; timestampIso: string; question: string; } | { template: "completion"; agentName: string; headline: string; timestampIso: string; summary: { kind: "none"; } | { kind: "text"; value: string; }; durationMs: number; } | { template: "failure"; agentName: string; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; } | { template: "chart"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; caption: { kind: "none"; } | { kind: "text"; value: string; }; }CardNode
typetype CardNode = BoxNode | TextNode | ImageNode
ChartCardInput
typetype ChartCardInput = { template: "chart"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; caption: { kind: "none"; } | { kind: "text"; value: string; }; }ChartKind
typetype ChartKind = "bar" | "line"
ChartSeries
typetype ChartSeries = { values: number[]; name: string; }ChartSpec
typetype ChartSpec = { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }CompletionCardInput
typetype CompletionCardInput = { template: "completion"; agentName: string; headline: string; timestampIso: string; summary: { kind: "none"; } | { kind: "text"; value: string; }; durationMs: number; }ContentHash
typetype ContentHash = string & z.BRAND<"ContentHash">
DiagnosticKind
typeRuntime diagnostics — the house alternative to deferred-work comments. Three functions: `warnNotImplemented`, `warnDegraded`, `warnUnexpected`. Each fires once per stable key (except `warnUnexpected`, which always fires), is greppable, and can be piped into a UI panel via {@link setDiagnosticHook}. Usage: warnDegraded("MyModule.fallback", "linear interp — cubic deferred, spec:120-140"); warnNotImplemented("MyModule.featureX", "spec §4 not yet lowered"); warnUnexpected("MyModule.parse", "expected number, got string", { value });
type DiagnosticKind = "not-implemented" | "degraded" | "unexpected"
FailureCardInput
typetype FailureCardInput = { template: "failure"; agentName: string; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }FleetAgent
typetype FleetAgent = { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }FleetOverviewCardInput
typetype FleetOverviewCardInput = { title: string; template: "fleet-overview"; timestampIso: string; agents: { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }[]; chart: { kind: "none"; } | { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }; }FlexAlign
typetype FlexAlign = "flex-start" | "center" | "flex-end" | "stretch" | "baseline"
FlexDirection
typeThe single flexbox-safe authoring format for both backends. Card templates build a neutral `CardNode` tree via `div`/`row`/`col`/`text`/ `img`. The backends convert it to their native shape (Takumi's `{ type: "container" | "text" | "image" }` nodes, or a satori element tree). `CardStyle` deliberately exposes only flexbox-compatible props — there is no CSS Grid and no free-form `style: string` escape hatch, so a template that type-checks renders consistently on Takumi and satori alike.
type FlexDirection = "row" | "column"
FlexJustify
typetype FlexJustify = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly"
FlexWrap
typetype FlexWrap = "nowrap" | "wrap"
ImageNode
typetype ImageNode = {
readonly kind: "image";
readonly style: CardStyle;
readonly src: Uint8Array;
readonly width: number;
readonly height: number;
}NeedsInputCardInput
typetype NeedsInputCardInput = { options: { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }[]; template: "needs-input"; agentName: string; timestampIso: string; question: string; }NeedsInputOption
typetype NeedsInputOption = { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }NetworkUsage
typetype NetworkUsage = { kind: "offline"; } | { kind: "emoji-font-fetch"; codepoints: string[]; }ObjectFit
typetype ObjectFit = "fill" | "contain" | "cover"
RasterizeResult
typetype RasterizeResult = {
readonly ok: true;
readonly bytes: Uint8Array;
readonly width: number;
readonly height: number;
} | {
readonly ok: false;
readonly message: string;
}RenderErr
typetype RenderErr = {
readonly ok: false;
readonly error: RenderFailure;
}RenderFailure
typetype RenderFailure = { kind: "invalid-template-input"; issues: string[]; } | { kind: "renderer-unavailable"; attempted: ({ kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; })[]; } | { kind: "rasterize-failed"; message: string; } | { kind: "chart-spec-invalid"; issues: string[]; }RenderMeta
typetype RenderMeta = { backend: { kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }; contentHash: string & z.BRAND<"ContentHash">; network: { kind: "offline"; } | { kind: "emoji-font-fetch"; codepoints: string[]; }; renderMs: number; widthPx: number; heightPx: number; }RenderOk
typetype RenderOk = {
readonly ok: true;
readonly bytes: Uint8Array;
readonly meta: RenderMeta;
}RenderResult
typetype RenderResult = RenderOk | RenderErr
RendererBackend
typetype RendererBackend = { kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }RendererFallbackReason
typetype RendererFallbackReason = { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }StatusCardInput
typetype StatusCardInput = { template: "status"; agentName: string; level: "ok" | "warn" | "error"; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }StatusLevel
typetype StatusLevel = "ok" | "warn" | "error"
TelegramFileId
typetype TelegramFileId = string & z.BRAND<"TelegramFileId">
TextAlign
typetype TextAlign = "left" | "center" | "right"
TextNode
typetype TextNode = {
readonly kind: "text";
readonly style: CardStyle;
readonly text: string;
}Interfaces
CardStyle
interfaceThe flexbox-only style subset. Every property is optional at the type level, but there is no `[k: string]: unknown` index signature and no raw string escape hatch, so unsupported CSS (grid, position tricks) cannot be expressed.
interface CardStyle
flexDirection
propertyflexDirection: FlexDirection
alignItems
propertyalignItems: FlexAlign
justifyContent
propertyjustifyContent: FlexJustify
flexWrap
propertyflexWrap: FlexWrap
flexGrow
propertyflexGrow: number
flexShrink
propertyflexShrink: number
flexBasis
propertyflexBasis: string | number
gap
propertygap: number
padding
propertypadding: string | number
margin
propertymargin: string | number
width
propertywidth: string | number
height
propertyheight: string | number
minWidth
propertyminWidth: string | number
maxWidth
propertymaxWidth: string | number
minHeight
propertyminHeight: string | number
maxHeight
propertymaxHeight: string | number
backgroundColor
propertybackgroundColor: string
color
propertycolor: string
fontSize
propertyfontSize: number
fontWeight
propertyfontWeight: number
fontFamily
propertyfontFamily: string
lineHeight
propertylineHeight: number
letterSpacing
propertyletterSpacing: number
textAlign
propertytextAlign: TextAlign
borderRadius
propertyborderRadius: number
borderWidth
propertyborderWidth: number
borderColor
propertyborderColor: string
borderStyle
propertyborderStyle: "solid"
objectFit
propertyobjectFit: ObjectFit
opacity
propertyopacity: number
ChartDimensions
interfaceinterface ChartDimensions
width
propertywidth: number
height
propertyheight: number
DiagnosticEvent
interfaceinterface DiagnosticEvent
kind
propertykind: DiagnosticKind
category
propertycategory: string
detail
propertydetail: string
stack
propertystack: string
data
propertydata: Record<string, unknown>
timestamp
propertytimestamp: number
FileIdCacheStore
interfacePluggable storage port. The in-memory default ships here; callers substitute a persistent (SQLite/Redis) implementation without any change to `renderCard`.
interface FileIdCacheStore
get
methodget(hash: ContentHash, botId: BotId): Promise<TelegramFileId | null>
set
methodset(hash: ContentHash, botId: BotId, fileId: TelegramFileId): Promise<void>
ImageBackend
interfaceinterface ImageBackend
kind
propertykind: BackendKind
renderPng
methodrenderPng(node: CardNode, opts: RenderPngOptions): Promise<Uint8Array>
RenderPngOptions
interfaceinterface RenderPngOptions
width
propertywidth: number
height
propertyheight: number
TakumiWasmInputs
interfaceinterface TakumiWasmInputs
wasm
propertyThe `takumi_wasm_bg.wasm` bytes or a precompiled module.
wasm: SyncInitInput
fonts
propertyFont buffers to register (e.g. a Latin/monospace font).
fonts: readonly Uint8Array<ArrayBufferLike>[]
Constants
BotIdSchema
constconst BotIdSchema: z.ZodBranded<z.ZodString, "BotId">
CHART_DIMENSIONS
constconst CHART_DIMENSIONS: RenderPngOptions
COMPLETION_DIMENSIONS
constconst COMPLETION_DIMENSIONS: RenderPngOptions
CachedFileHitSchema
constconst CachedFileHitSchema: z.ZodObject<{ hit: z.ZodLiteral<true>; fileId: z.ZodBranded<z.ZodString, "TelegramFileId">; contentHash: z.ZodBranded<z.ZodString, "ContentHash">; }, "strip", z.ZodTypeAny, { contentHash: string & z.BRAND<"ContentHash">; hit: true; fileId: string & z.BRAND<"TelegramFileId">; }, { contentHash: string; hit: true; fileId: string; }>CardInputSchema
constconst CardInputSchema: z.ZodDiscriminatedUnion<"template", [z.ZodObject<{ template: z.ZodLiteral<"status">; agentName: z.ZodString; level: z.ZodEnum<["ok", "warn", "error"]>; headline: z.ZodString; detail: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { template: "status"; agentName: string; level: "ok" | "warn" | "error"; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }, { template: "status"; agentName: string; level: "ok" | "warn" | "error"; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }>, z.ZodObject<{ template: z.ZodLiteral<"fleet-overview">; title: z.ZodString; agents: z.ZodArray<z.ZodObject<{ name: z.ZodString; level: z.ZodEnum<["ok", "warn", "error"]>; note: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }, { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }>, "many">; chart: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"spec">; spec: z.ZodObject<{ kind: z.ZodEnum<["bar", "line"]>; title: z.ZodString; categories: z.ZodArray<z.ZodString, "many">; series: z.ZodArray<z.ZodObject<{ name: z.ZodString; values: z.ZodArray<z.ZodNumber, "many">; }, "strip", z.ZodTypeAny, { values: number[]; name: string; }, { values: number[]; name: string; }>, "many">; }, "strip", z.ZodTypeAny, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }>; }, "strip", z.ZodTypeAny, { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }, { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }>]>; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { title: string; template: "fleet-overview"; timestampIso: string; agents: { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }[]; chart: { kind: "none"; } | { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }; }, { title: string; template: "fleet-overview"; timestampIso: string; agents: { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }[]; chart: { kind: "none"; } | { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }; }>, z.ZodObject<{ template: z.ZodLiteral<"needs-input">; agentName: z.ZodString; question: z.ZodString; options: z.ZodArray<z.ZodObject<{ label: z.ZodString; hint: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }, { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }>, "many">; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { options: { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }[]; template: "needs-input"; agentName: string; timestampIso: string; question: string; }, { options: { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }[]; template: "needs-input"; agentName: string; timestampIso: string; question: string; }>, z.ZodObject<{ template: z.ZodLiteral<"completion">; agentName: z.ZodString; headline: z.ZodString; summary: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; durationMs: z.ZodNumber; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { template: "completion"; agentName: string; headline: string; timestampIso: string; summary: { kind: "none"; } | { kind: "text"; value: string; }; durationMs: number; }, { template: "completion"; agentName: string; headline: string; timestampIso: string; summary: { kind: "none"; } | { kind: "text"; value: string; }; durationMs: number; }>, z.ZodObject<{ template: z.ZodLiteral<"failure">; agentName: z.ZodString; headline: z.ZodString; detail: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { template: "failure"; agentName: string; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }, { template: "failure"; agentName: string; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }>, z.ZodObject<{ template: z.ZodLiteral<"chart">; spec: z.ZodObject<{ kind: z.ZodEnum<["bar", "line"]>; title: z.ZodString; categories: z.ZodArray<z.ZodString, "many">; series: z.ZodArray<z.ZodObject<{ name: z.ZodString; values: z.ZodArray<z.ZodNumber, "many">; }, "strip", z.ZodTypeAny, { values: number[]; name: string; }, { values: number[]; name: string; }>, "many">; }, "strip", z.ZodTypeAny, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }>; caption: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { template: "chart"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; caption: { kind: "none"; } | { kind: "text"; value: string; }; }, { template: "chart"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; caption: { kind: "none"; } | { kind: "text"; value: string; }; }>]>ChartCardInputSchema
constconst ChartCardInputSchema: z.ZodObject<{ template: z.ZodLiteral<"chart">; spec: z.ZodObject<{ kind: z.ZodEnum<["bar", "line"]>; title: z.ZodString; categories: z.ZodArray<z.ZodString, "many">; series: z.ZodArray<z.ZodObject<{ name: z.ZodString; values: z.ZodArray<z.ZodNumber, "many">; }, "strip", z.ZodTypeAny, { values: number[]; name: string; }, { values: number[]; name: string; }>, "many">; }, "strip", z.ZodTypeAny, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }>; caption: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { template: "chart"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; caption: { kind: "none"; } | { kind: "text"; value: string; }; }, { template: "chart"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; caption: { kind: "none"; } | { kind: "text"; value: string; }; }>ChartKindSchema
constconst ChartKindSchema: z.ZodEnum<["bar", "line"]>
ChartSeriesSchema
constconst ChartSeriesSchema: z.ZodObject<{ name: z.ZodString; values: z.ZodArray<z.ZodNumber, "many">; }, "strip", z.ZodTypeAny, { values: number[]; name: string; }, { values: number[]; name: string; }>ChartSpecSchema
constconst ChartSpecSchema: z.ZodObject<{ kind: z.ZodEnum<["bar", "line"]>; title: z.ZodString; categories: z.ZodArray<z.ZodString, "many">; series: z.ZodArray<z.ZodObject<{ name: z.ZodString; values: z.ZodArray<z.ZodNumber, "many">; }, "strip", z.ZodTypeAny, { values: number[]; name: string; }, { values: number[]; name: string; }>, "many">; }, "strip", z.ZodTypeAny, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }>CompletionCardInputSchema
constconst CompletionCardInputSchema: z.ZodObject<{ template: z.ZodLiteral<"completion">; agentName: z.ZodString; headline: z.ZodString; summary: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; durationMs: z.ZodNumber; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { template: "completion"; agentName: string; headline: string; timestampIso: string; summary: { kind: "none"; } | { kind: "text"; value: string; }; durationMs: number; }, { template: "completion"; agentName: string; headline: string; timestampIso: string; summary: { kind: "none"; } | { kind: "text"; value: string; }; durationMs: number; }>ContentHashSchema
constconst ContentHashSchema: z.ZodBranded<z.ZodString, "ContentHash">
DEFAULT_CHART_HEIGHT
constconst DEFAULT_CHART_HEIGHT: 480
DEFAULT_CHART_WIDTH
constconst DEFAULT_CHART_WIDTH: 800
FAILURE_DIMENSIONS
constconst FAILURE_DIMENSIONS: RenderPngOptions
FLEET_OVERVIEW_DIMENSIONS
constconst FLEET_OVERVIEW_DIMENSIONS: RenderPngOptions
FailureCardInputSchema
constconst FailureCardInputSchema: z.ZodObject<{ template: z.ZodLiteral<"failure">; agentName: z.ZodString; headline: z.ZodString; detail: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { template: "failure"; agentName: string; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }, { template: "failure"; agentName: string; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }>FleetAgentSchema
constconst FleetAgentSchema: z.ZodObject<{ name: z.ZodString; level: z.ZodEnum<["ok", "warn", "error"]>; note: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }, { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }>FleetOverviewCardInputSchema
constconst FleetOverviewCardInputSchema: z.ZodObject<{ template: z.ZodLiteral<"fleet-overview">; title: z.ZodString; agents: z.ZodArray<z.ZodObject<{ name: z.ZodString; level: z.ZodEnum<["ok", "warn", "error"]>; note: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }, { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }>, "many">; chart: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"spec">; spec: z.ZodObject<{ kind: z.ZodEnum<["bar", "line"]>; title: z.ZodString; categories: z.ZodArray<z.ZodString, "many">; series: z.ZodArray<z.ZodObject<{ name: z.ZodString; values: z.ZodArray<z.ZodNumber, "many">; }, "strip", z.ZodTypeAny, { values: number[]; name: string; }, { values: number[]; name: string; }>, "many">; }, "strip", z.ZodTypeAny, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }, { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }>; }, "strip", z.ZodTypeAny, { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }, { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }>]>; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { title: string; template: "fleet-overview"; timestampIso: string; agents: { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }[]; chart: { kind: "none"; } | { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }; }, { title: string; template: "fleet-overview"; timestampIso: string; agents: { name: string; level: "ok" | "warn" | "error"; note: { kind: "none"; } | { kind: "text"; value: string; }; }[]; chart: { kind: "none"; } | { kind: "spec"; spec: { kind: "bar" | "line"; title: string; categories: string[]; series: { values: number[]; name: string; }[]; }; }; }>NEEDS_INPUT_DIMENSIONS
constconst NEEDS_INPUT_DIMENSIONS: RenderPngOptions
NeedsInputCardInputSchema
constconst NeedsInputCardInputSchema: z.ZodObject<{ template: z.ZodLiteral<"needs-input">; agentName: z.ZodString; question: z.ZodString; options: z.ZodArray<z.ZodObject<{ label: z.ZodString; hint: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }, { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }>, "many">; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { options: { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }[]; template: "needs-input"; agentName: string; timestampIso: string; question: string; }, { options: { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }[]; template: "needs-input"; agentName: string; timestampIso: string; question: string; }>NeedsInputOptionSchema
constconst NeedsInputOptionSchema: z.ZodObject<{ label: z.ZodString; hint: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; }, "strip", z.ZodTypeAny, { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }, { label: string; hint: { kind: "none"; } | { kind: "text"; value: string; }; }>NetworkUsageSchema
constconst NetworkUsageSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"offline">; }, "strip", z.ZodTypeAny, { kind: "offline"; }, { kind: "offline"; }>, z.ZodObject<{ kind: z.ZodLiteral<"emoji-font-fetch">; codepoints: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind: "emoji-font-fetch"; codepoints: string[]; }, { kind: "emoji-font-fetch"; codepoints: string[]; }>]>RenderFailureSchema
constconst RenderFailureSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"invalid-template-input">; issues: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind: "invalid-template-input"; issues: string[]; }, { kind: "invalid-template-input"; issues: string[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"renderer-unavailable">; attempted: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"takumi">; }, "strip", z.ZodTypeAny, { kind: "takumi"; }, { kind: "takumi"; }>, z.ZodObject<{ kind: z.ZodLiteral<"satori-sharp">; reason: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"native-module-load-failed">; platform: z.ZodString; arch: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "native-module-load-failed"; platform: string; arch: string; }, { kind: "native-module-load-failed"; platform: string; arch: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"forced-fallback">; }, "strip", z.ZodTypeAny, { kind: "forced-fallback"; }, { kind: "forced-fallback"; }>]>; }, "strip", z.ZodTypeAny, { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }, { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }>]>, "many">; }, "strip", z.ZodTypeAny, { kind: "renderer-unavailable"; attempted: ({ kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; })[]; }, { kind: "renderer-unavailable"; attempted: ({ kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; })[]; }>, z.ZodObject<{ kind: z.ZodLiteral<"rasterize-failed">; message: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "rasterize-failed"; message: string; }, { kind: "rasterize-failed"; message: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"chart-spec-invalid">; issues: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind: "chart-spec-invalid"; issues: string[]; }, { kind: "chart-spec-invalid"; issues: string[]; }>]>RenderMetaSchema
constconst RenderMetaSchema: z.ZodObject<{ backend: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"takumi">; }, "strip", z.ZodTypeAny, { kind: "takumi"; }, { kind: "takumi"; }>, z.ZodObject<{ kind: z.ZodLiteral<"satori-sharp">; reason: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"native-module-load-failed">; platform: z.ZodString; arch: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "native-module-load-failed"; platform: string; arch: string; }, { kind: "native-module-load-failed"; platform: string; arch: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"forced-fallback">; }, "strip", z.ZodTypeAny, { kind: "forced-fallback"; }, { kind: "forced-fallback"; }>]>; }, "strip", z.ZodTypeAny, { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }, { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }>]>; contentHash: z.ZodBranded<z.ZodString, "ContentHash">; network: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"offline">; }, "strip", z.ZodTypeAny, { kind: "offline"; }, { kind: "offline"; }>, z.ZodObject<{ kind: z.ZodLiteral<"emoji-font-fetch">; codepoints: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { kind: "emoji-font-fetch"; codepoints: string[]; }, { kind: "emoji-font-fetch"; codepoints: string[]; }>]>; renderMs: z.ZodNumber; widthPx: z.ZodNumber; heightPx: z.ZodNumber; }, "strip", z.ZodTypeAny, { backend: { kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }; contentHash: string & z.BRAND<"ContentHash">; network: { kind: "offline"; } | { kind: "emoji-font-fetch"; codepoints: string[]; }; renderMs: number; widthPx: number; heightPx: number; }, { backend: { kind: "takumi"; } | { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }; contentHash: string; network: { kind: "offline"; } | { kind: "emoji-font-fetch"; codepoints: string[]; }; renderMs: number; widthPx: number; heightPx: number; }>RendererBackendSchema
constconst RendererBackendSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"takumi">; }, "strip", z.ZodTypeAny, { kind: "takumi"; }, { kind: "takumi"; }>, z.ZodObject<{ kind: z.ZodLiteral<"satori-sharp">; reason: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"native-module-load-failed">; platform: z.ZodString; arch: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "native-module-load-failed"; platform: string; arch: string; }, { kind: "native-module-load-failed"; platform: string; arch: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"forced-fallback">; }, "strip", z.ZodTypeAny, { kind: "forced-fallback"; }, { kind: "forced-fallback"; }>]>; }, "strip", z.ZodTypeAny, { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }, { kind: "satori-sharp"; reason: { kind: "native-module-load-failed"; platform: string; arch: string; } | { kind: "forced-fallback"; }; }>]>RendererFallbackReasonSchema
constconst RendererFallbackReasonSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"native-module-load-failed">; platform: z.ZodString; arch: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "native-module-load-failed"; platform: string; arch: string; }, { kind: "native-module-load-failed"; platform: string; arch: string; }>, z.ZodObject<{ kind: z.ZodLiteral<"forced-fallback">; }, "strip", z.ZodTypeAny, { kind: "forced-fallback"; }, { kind: "forced-fallback"; }>]>STATUS_DIMENSIONS
constconst STATUS_DIMENSIONS: RenderPngOptions
StatusCardInputSchema
constconst StatusCardInputSchema: z.ZodObject<{ template: z.ZodLiteral<"status">; agentName: z.ZodString; level: z.ZodEnum<["ok", "warn", "error"]>; headline: z.ZodString; detail: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"none">; }, "strip", z.ZodTypeAny, { kind: "none"; }, { kind: "none"; }>, z.ZodObject<{ kind: z.ZodLiteral<"text">; value: z.ZodString; }, "strip", z.ZodTypeAny, { kind: "text"; value: string; }, { kind: "text"; value: string; }>]>; timestampIso: z.ZodString; }, "strip", z.ZodTypeAny, { template: "status"; agentName: string; level: "ok" | "warn" | "error"; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }, { template: "status"; agentName: string; level: "ok" | "warn" | "error"; headline: string; detail: { kind: "none"; } | { kind: "text"; value: string; }; timestampIso: string; }>StatusLevelSchema
constconst StatusLevelSchema: z.ZodEnum<["ok", "warn", "error"]>
TelegramFileIdSchema
constconst TelegramFileIdSchema: z.ZodBranded<z.ZodString, "TelegramFileId">