Streaming ANSI/ECMA-48 terminal log sanitizer and security auditor for MoonBit
moon add DWS-ai-nb/termproofimport {
"DWS-ai-nb/termproof" @termproof
}fn main {
let log = "ok\u{1b}[32mPASS\u{1b}[0m\n" +
"copy\u{1b}]52;c;SGVsbG8=\u{7}\n"
let result = @termproof.audit(log, policy=@termproof.Policy::strict())
println(@termproof.summary_line(result))
println(result.plain_text)
}moon run cmd/termproof -- demomoon run cmd/termproof -- audit "trusted output" --policy strictmoon run cmd/termproof -- audit "trusted output" --format markdownmoon run cmd/termproof -- clean "trusted output" --policy plainmoon run cmd/termproof -- events "trusted output"| Policy | Intended use | Keeps SGR colors | Keeps OSC 8 links | Marks dangerous data | Fails at |
|---|---|---|---|---|---|
| strict | review and artifact publishing | no | no | yes | dangerous |
| ci | CI logs that may keep colors | yes | no | no | critical |
| plain | irreversible text export | no | no | no | critical |
| permissive | diagnostics and migration | yes | yes, except high-risk schemes | no | critical |
moon check --deny-warn
moon fmt --check
moon build
moon test --deny-warn
moon run examples/audit
moon run cmd/termproof -- audit "trusted output" --policy strict
moon info
moon package --listmoon login
moon package --list
moon publish --frozenpub(all) struct Parser {
mode : ParserMode
text : Array[Char]
sequence : Array[Char]
payload : Array[Char]
sequence_start : Int
offset : Int
}fn github_property_escape(input : String) -> Stringfn starts_with_ascii_case_insensitive(input : String, prefix : String) -> Boolfn visible(input : String) -> StringStreaming ANSI/ECMA-48 terminal log sanitizer and security auditor for MoonBit