Skip to main content

Crate concinnity_dev

Crate concinnity_dev 

Source
Expand description

concinnity-dev: the dev tooling library.

Everything the concinnity binary does, minus the argv it does it from: the world authoring / in-memory build code, the implementations behind each subcommand, the asset-reference generator, bundle packaging, the in-engine editor HUD, the localhost debug server, and the interpreted (cn debug) run loop.

The binary is the clap command tree and nothing else. Everything it dispatches into is here, which is what lets the same entry points serve an out-of-tree host that has no argv at all.

Modules§

command
The implementations behind each cn subcommand, and the only place in this crate that writes to stdout. The implementations behind each cn subcommand: discovery and printing wrappers over this crate’s authoring API and the concinnity-cook compile pipeline.
debug_client
The client half of the runtime debug protocol: a thin localhost WebSocket client the concinnity debug <subcommand> commands drive to talk to a running cn debug server (see super::server for the other end).
docs
The asset reference pages, generated from the engine’s own schema sources.
export
Packaging a built world into a distributable bundle.

Enums§

WatchTarget
A read-only snapshot the watch command can poll. Each maps to the matching server command; label names it in the poll banner. Argv parsing lives in the CLI binary, which maps its own value-enum onto this type.

Functions§

add_to_path
Add an asset to world_path and rebuild. See module docs.
arg_value_to_json
One ArgValue as a serde_json::Value.
build_pipeline_from_str
Run the full build pipeline on an in-memory JSONL string without writing any blobs. Loads, expands, and validates the world (crate::build_only::prepare_world), then compiles it. assets_dir is the asset search root a bare source filename is searched under; artifacts_dir is an optional directory consulted when resolving bare shader filenames not found there, so pass the account’s artifact directory to compile user-written shaders.
build_world_from_path
Read a world.jsonl file from disk and run the full in-memory pipeline on it, returning a ready-to-run World. The interpreted run (in the CLI crate) loads its world through here; it is the file-backed counterpart of prepare
build_world_from_str
Run the full in-memory pipeline on a world.jsonl string, returning a ready-to-run World without touching any blob files on disk. The editor uses this to boot an empty (or otherwise non-renderable) world from a seeded GraphicsConfig so a window still opens.
build_world_to_disk
Compile a world.jsonl file and write the compiled blobs + world-lock.json to the active state dir’s data/, exactly as cn build does. This is cn build as a library call: the editor’s SAVE goes through here to persist edits, reusing the validated compile + blob-write tail rather than patching blobs directly. Same-process recompiles are fast because the payload / expand caches are warm.
check_at_path
Read world_path, run validation, and report results. Returns Ok if every asset passes; otherwise an error whose Display contains a human-readable summary of every failure (one per asset).
check_from_str
Run validation against an in-memory world JSONL string. label is the origin used in messages (typically the source path).
cook_platform
The shader platform cn cooks worlds for: the backend the runtime linked into this same binary consumes, so a world built here plays here.
parse_world_jsonl
Parse a world.jsonl string into a flat list of raw asset objects.
rm_at_path
Remove the asset named name from world_path and rebuild.
run_debug
The cn debug server path: start the localhost debug server on port, then run interpreted with it as the per-frame hook. This is the entry point the CLI binary calls; the hook assembly stays inside this crate.
run_editor
Editor entry point (cn editor). Brings up a renderable world – building the blobs first if they are missing, and falling back to an empty in-memory world when there is nothing to load – injects the editor HUD, and runs the world loop driven by the editor hook (plus the debug server when a port is given).
spec_args
A spec’s args object as a serde_json::Value (what a component deserializes from).
spec_to_value
A spec as a full world-line value: {"name", "type", "args"}, the shape parse_world_jsonl yields and the cook pipeline validates.
validate_asset
Validate a single asset’s type and generator without running the full build pipeline. Called by the server on each world_add so the LLM gets per-asset feedback without waiting for a WebSocket round-trip.
validate_world_jsonl
Validate world JSONL without running compilation. Runs the full front half of the pipeline (load, expand, semantic checks) plus a per-asset type/args resolution, but stops short of compiling payloads: intended for fast server-side pre-deploy checks where shader compilation is not needed. assets_dir is the asset search root the expansion passes resolve their sources and presets against. Every problem found is reported in a single newline-joined error.
world_from_loaded
Compile a prepared world and assemble it into an in-memory World, ready to run without touching any blob files on disk.
world_template_entries
A world template’s assets as world-line entries, in application order.
write_world_jsonl
Serialize a list of asset objects back to world.jsonl format.