concinnity_dev/lib.rs
1//! concinnity-dev: the dev tooling library.
2//!
3//! Everything the `concinnity` binary does, minus the argv it does it from:
4//! the world authoring / in-memory build code, the implementations behind each
5//! subcommand, the asset-reference generator, bundle packaging, the in-engine
6//! editor HUD, the localhost debug server, and the interpreted (`cn debug`) run
7//! loop.
8//!
9//! The binary is the clap command tree and nothing else. Everything it dispatches
10//! into is here, which is what lets the same entry points serve an out-of-tree
11//! host that has no argv at all.
12
13// Bridge: re-export the runtime/core modules the authoring, editor, and debug
14// code names under crate::* so their `crate::<module>` import paths resolve.
15// world.jsonl I/O lives in the compiler (concinnity-cook), not core.
16pub(crate) use concinnity_cook::authoring::world;
17pub(crate) use concinnity_engine::{app, blob, components, ecs, gfx, jobs, resource};
18
19/// The shader platform `cn` cooks worlds for: the backend the runtime linked
20/// into this same binary consumes, so a world built here plays here.
21pub fn cook_platform() -> concinnity_core::platform::Platform {
22 concinnity_engine::platform::current()
23}
24
25// Authoring / in-memory build. Its exports below are the surface the
26// out-of-tree Swift app's FFI crate embeds; the `cn` binary uses only part of
27// it, so some entry points have no in-workspace caller.
28mod authoring;
29
30// The in-engine editor HUD, the localhost debug server, the MCP transport it
31// speaks, the interpreted run loop, and animation clip hot-reload.
32mod anim_reload;
33mod debug;
34mod debug_hook;
35mod editor;
36mod mcp;
37mod run;
38
39/// The implementations behind each `cn` subcommand, and the only place in this
40/// crate that writes to stdout.
41pub mod command;
42/// The asset reference pages, generated from the engine's own schema sources.
43pub mod docs;
44/// Packaging a built world into a distributable bundle.
45pub mod export;
46/// The project a dev session works on: the one state tree its builds, runs, and
47/// editor sessions address, opened by the binary at startup.
48pub mod project;
49
50// Process-global test serialization lock; test builds only.
51#[cfg(test)]
52mod test_support;
53
54// Dev-session entry points, consumed by the `concinnity` binary: the debug
55// server + interpreted run (`cn debug`), the in-engine editor (`cn editor`),
56// and the MCP stdio bridge that forwards an agent's tool calls to a running
57// app (`cn mcp`).
58pub use editor::run_editor;
59pub use mcp::run as run_mcp;
60pub use run::run_debug;
61
62// The authoring API
63pub use authoring::{
64 add_to_path, arg_value_to_json, build_world_from_path, build_world_from_str,
65 build_world_to_disk, check_at_path, check_from_str, rm_at_path, spec_args, spec_to_value,
66 world_from_loaded, world_template_entries,
67};
68pub use concinnity_cook::authoring::world::{parse_world_jsonl, write_world_jsonl};
69pub use concinnity_cook::{build_pipeline_from_str, validate_asset, validate_world_jsonl};