makepad/libs/asset/client/examples/place_dump.rs
Admin 69385ed1be libs/asset: batch publish in one transaction and its route with the hostile cases, hardware sha256 proved against the oracle, classic worlds stop being mirror images, sounds and sprites publish a picture, an interrupted model install can never load broken, ActorDef::scaled, and the asset-ai chat tells the truth
Squashed from work; the fine-grained history is under tag archive/work-2026-08-26:
- vj: the thumbnail pipeline becomes one honest machine, and effects go livecodable
- repo: context_ladder scratch bin stays local, not shipped
- vj: thumbnails become mp4 — hardware-coded sheets at measured-4K cells, and the bake stops racing the GPU
- store: the ceremony dies — batch publish, one transaction, and the engine stops re-reading its own log
- vj: the console grows real transports, and the deck stops lying about reverse
- models: an interrupted install can never load broken
- importer: the classic worlds stop being mirror images
- asset-ai: the chat tells the truth while it works
- sqlite: derived tables get their real names, their predicates, and all their arms
- llm: the step cost model is chosen per device — the RTX PRO 6000's measured verify curve (13.7 + 3.17·B ms) beside the 5090's; the bench warms every tail shape and times two windows
- importer: a sound and a single-tile sprite publish a picture like everything else
- asset: hardware sha256 kernels, proved against the software oracle before they run
- sim: a declared map facing becomes a body's heading through one rule
- asset: the batch publish route, with the hostile cases it has to refuse
- asset: an example that asks a live store which assets carry a thumbnail
- asset+sim: the two modules their own commits already declared
- asset: ActorDef::scaled — every linear quantity follows the map's person height — plus the place-dump and retire-stale store examples, and the game chat context stops reporting work it did not do
2026-08-26 08:49:46 +02:00

38 lines
1.7 KiB
Rust

//! Dump an asset's manifest file roles, and the text of any text-ish blob —
//! for reading a world's `.place` sidecar out of a live store.
//!
//! cargo run --release -p makepad-asset-client --example place_dump -- \
//! <control> <data> <token> <alias>
use makepad_asset_client::{ApiEndpoints, AssetClient, ClientConfig};
fn main() {
let mut a = std::env::args().skip(1);
let control: std::net::SocketAddr = a.next().unwrap().parse().unwrap();
let data: std::net::SocketAddr = a.next().unwrap().parse().unwrap();
let token = a.next().unwrap();
let alias = a.next().unwrap();
let mut cfg = ClientConfig::new(std::env::temp_dir().join("place-dump-cache"));
cfg.token = Some(token);
let mut c = AssetClient::connect(cfg, ApiEndpoints { control, data }, None).expect("connect");
let parsed: makepad_asset_data::AssetAlias = alias.parse().expect("alias");
let id = c.resolve_alias(&parsed).expect("resolve").asset_id;
let detail = c.asset_detail(&id).expect("detail");
let head = detail.latest_published().expect("published");
let m = c.fetch_asset_manifest(&head.revision).expect("manifest");
println!("{}{} file(s)", alias, m.files.len());
for f in &m.files {
println!(" role={:?} media={:?} bytes={}", f.role, f.media, f.byte_len);
if matches!(f.media, makepad_asset_data::MediaType::Text) {
match c.blob_path(&f.blob, Some(f.byte_len)) {
Ok(p) => match std::fs::read_to_string(&p) {
Ok(t) => println!("---- text ----\n{t}\n---- end ----"),
Err(e) => println!(" read failed: {e}"),
},
Err(e) => println!(" blob failed: {e}"),
}
}
}
}