Ordered Valve KeyValues tooling, source editing, streaming and Steam metadata in MoonBit
git clone https://github.com/Charles67676767/MoonValve.git
cd MoonValve
moon version --all
moon check
moon test
moon run examples/demo
moon run examples/advancedimport {
"Charles67676767/moonvalve" @valve,
}let doc = @valve.parse("root { tag one tag two name \"Moon Harbor\" }")
let name = doc.lookup(["root", "name"])
let normalized = @valve.stringify(doc)
let same = @valve.parse(normalized) == docmoon run cmd/main --target js -- help
moon run cmd/main --target js -- parse fixtures/duplicates.vdf
moon run cmd/main --target js -- from-json data.json
moon run cmd/main --target js -- format fixtures/duplicates.vdf
moon run cmd/main --target js -- query fixtures/appmanifest_480.acf AppState name
moon run cmd/main --target js -- app fixtures/appmanifest_480.acf
moon run cmd/main --target js -- libraries fixtures/libraryfolders.vdf{"app_id":"480","name":"Moon Harbor","install_dir":"Moon Harbor","size_on_disk":"1048576","build_id":"20261023"}moon run cmd/main --target js -- inventory "/path/to/Steam/steamapps/libraryfolders.vdf"
moon run cmd/main --target js -- inventory "/path/to/libraryfolders.vdf" --filter portal --sort size --csvmoon build --target js --release
node _build/js/release/build/cmd/main/main.js helpmoon build --target native --release
moon run cmd/main --target native --release -- helpmoon fmt --check
moon check --target js
moon test --target all --deny-warn
moon build --target js --release
node scripts/test-cli.cjs
moon build --target native --release
node scripts/test-cli.cjs --native
python -m pip install vdf==3.4
python scripts/check-reference.py
node scripts/benchmark.cjs --native
moon infomodel.mbt 有序数据模型与查询
parser.mbt KV1 文本解析及诊断
writer.mbt 规范化文本写出
steam.mbt Steam 清单模型
inventory.mbt 筛选、排序、统计、检查与 CSV
edit.mbt 重复键感知的文档编辑
source_edit.mbt 保留原文的局部编辑
json_codec.mbt 有序 JSON 导入
conditions.mbt 平台条件表达式
resolve.mbt 文件引用解析
project.mbt 引用关系与原文来源
stream_writer.mbt 有界事件写出
binary.mbt 标准二进制 KV1
cmd/main/ JS/C 宿主适配与 MoonBit CLI
examples/demo/ 跨后端最小使用示例
examples/advanced/ 编辑、条件、引用与二进制示例
fixtures/ 合成示例数据
scripts/test-cli.cjs CLI 端到端测试
docs/ 兼容性、设计与路线图pub(all) enum BinaryValue {
ObjectValue(Array[BinaryEntry])
StringValue(String)
Int32Value(Int)
Float32Bits(UInt)
Pointer32(UInt)
WideString(String)
Color32(UInt)
UInt64Value(UInt64)
Int64Value(Int64)
} derive(Eq, Debug)type LspFramertype LspServertype Querypub(all) enum QueryEdit {
SetText(String)
ReplacePrefix(String, String)
RenameKey(String)
RemoveMatches
} derive(Debug)pub(all) struct ReferenceEdge {
source : String
target : String
kind : String
location : SourceLocation
} derive(Eq, Debug)pub(all) struct ResolvedOrigin {
path : Array[Selector]
location : SourceLocation
} derive(Eq, Debug)pub(all) struct ResolvedProject {
document : Document
origins : Array[ResolvedOrigin]
references : Array[ReferenceEdge]
} derive(Eq, Debug)type ShortcutFilefn ShortcutFile::add(self : ShortcutFile, name : String, exe : String, start_dir? : String, launch_options? : String, tags? : Array[String]) -> ShortcutFile raise SteamErrorfn ShortcutFile::set(self : ShortcutFile, shortcut : SteamShortcut) -> ShortcutFile raise SteamErrortype SourceDocumentfn SourceDocument::apply_snapshot(self : SourceDocument, changes : Array[Change]) -> SourceDocument raisefn SourceDocument::edit(self : SourceDocument, path : Array[Selector], operation : Edit) -> SourceDocument raisefn SourceDocument::edit_query(self : SourceDocument, expression : String, operation : QueryEdit) -> SourceDocument raisefn SourceDocument::evaluate(self : SourceDocument, symbols : Array[String]) -> Document raise ParseErrorfn SourceDocument::transfer(self : SourceDocument, from : Array[Selector], to : Array[Selector], index : Int, copy? : Bool) -> SourceDocument raisetype SteamCachefn SteamCache::page(self : SteamCache, query? : String, offset? : Int, limit? : Int) -> CachePage raise BinaryErrortype StreamParsertype StreamWritertype Workspacefn check_inventory(libraries : Array[SteamLibrary], records : Array[InventoryRecord]) -> Array[InventoryIssue]fn decode_binary(bytes : Bytes, options? : BinaryOptions, string_table? : Array[String]?) -> Array[BinaryEntry] raise BinaryErrorfn encode_binary(entries : Array[BinaryEntry], options? : BinaryOptions, string_table? : Array[String]?) -> Bytes raise BinaryErrorfn load_project(source : String, loader : (String) -> String raise, options? : ParseOptions, max_files? : Int) -> ResolvedProject raisefn load_resolved(source : String, loader : (String) -> String raise, options? : ParseOptions, max_files? : Int) -> Document raisefn new_stream_parser(visitor : (StreamEvent) -> Bool raise, options? : ParseOptions) -> StreamParser raise ParseErrorfn open_steam_cache(input : Bytes, max_bytes? : Int, max_records? : Int) -> SteamCache raise BinaryErrorfn parse_kv3(input : String, options? : ParseOptions, allow_headerless? : Bool) -> KV3Document raisefn select_inventory(records : Array[InventoryRecord], filter? : String, sort? : String) -> Array[InventoryRecord] raise SteamErrorfn shortcut_app_id(name : String, exe : String) -> UIntfn version() -> StringInstall
Download zipOrdered Valve KeyValues tooling, source editing, streaming and Steam metadata in MoonBit