Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/server/src/pageSource

Pages Editor source view: the full text of one page file plus live diagnostics for it, and buffer-scoped linting + quick fixes for an unsaved edit in the code drill-down.

Cockpit server, next. Source: ui/server/src/pageSource.mjs.

Functions#

lintPageBuffer()#

lintPageBuffer(root, feature, file, source): object

Defined in: ui/server/src/pageSource.mjs:24

Diagnostics for an unsaved buffer (source), never written to disk on the caller's behalf — the file itself is only ever touched (written, then reverted) inside lintBuffer itself, for the duration of one call.

Parameters#

root

any

feature

any

file

any

source

any

Returns#

object

diagnostics

diagnostics: any


quickFixPageBuffer()#

quickFixPageBuffer(root, feature, file, source, rule, mode, llmProvider): Promise<{ attribution?: undefined; fixedSource: string; } | { attribution: { provider: any; rule: any; }; fixedSource: string; }>

Defined in: ui/server/src/pageSource.mjs:34

One quick fix, "Mechanical" (the rule's own deterministic transform) or "AI" (a model call scoped to just this violation) — returns the fixed buffer text for the caller to diff and review, never writes to disk. Records the Mechanical | AI choice as a decision-trace: the two closed options as offered for rule, and the mode picked.

Parameters#

root

any

feature

any

file

any

source

any

rule

any

mode

any

llmProvider

any

Returns#

Promise<{ attribution?: undefined; fixedSource: string; } | { attribution: { provider: any; rule: any; }; fixedSource: string; }>


readPageSource()#

readPageSource(root, feature, file): object

Defined in: ui/server/src/pageSource.mjs:15

Parameters#

root

any

feature

any

file

any

Returns#

object

contentHash

contentHash: string

diagnostics

diagnostics: any

source

source: any