asdshuaishuai/moonviz/core does not have a README file
pub(all) enum Action {
NavigateTo(String)
Back
ToggleState(String, String)
SetState(String, String)
SetText(String, String)
SubmitForm(Array[String])
ShowToast(String)
HapticFeedback
PlaySound(String)
}pub(all) struct AgentNote {
artboard : String
note : String
priority : String
}{
"meta": { "version": "...", "created_by": "...", "context": "..." },
"tokens": { ... },
"artboards": { "login": { "decl": "...", "interactions": [...] } },
"flows": [ ... ],
"todo": [ "待办事项" ],
"notes": [ { "artboard": "...", "note": "...", "priority": "..." } ]
}pub(all) struct AlignmentHint {
node_a : String
node_b : String
axis : String
delta : Double
suggestion : String
}pub(all) enum AnimatableProperty {
AnimFill(String)
AnimOpacity(Double)
AnimX(Double)
AnimY(Double)
AnimWidth(Double)
AnimHeight(Double)
AnimRadius(Double)
AnimFontSize(Double)
}fn AnimationClip::add_keyframe(self : AnimationClip, time : Double, props : Array[AnimatableProperty]) -> Unitpub(all) struct ArtboardBenchmark {
artboard : String
node_count : Int
max_depth : Int
avg_children : Double
stack_layout_count : Int
fill_node_count : Int
hug_node_count : Int
text_node_count : Int
total_text_length : Int
svg_output_length : Int
layout_complexity : Int
render_complexity : Int
memory_estimate_bytes : Int
antipatterns : Array[String]
score : Int
}pub(all) struct ArtboardMeta {
id : String
name : String
width : Double
height : Double
doc : Document
}pub(all) struct AutoFixOp {
node_id : String
predicate : String
action : String
before : String
after : String
}pub(all) struct Breakpoint {
name : String
width : Double
height : Double
columns : Int
description : String
}pub(all) struct ColorNote {
node_id : String
field : String
hex : String
token_name : String
}pub(all) struct ComponentDef {
id : String
kind : String
description : String
variants : Map[String, NodePatch]
default_variant : String
default_size : (Double, Double)
default_layout : StackLayout?
category : String
}pub(all) struct ComponentNote {
node_id : String
component : String
variant : String
props : String
}pub(all) struct Conflict {
node_id : String
field : String
ours_desc : String
theirs_desc : String
resolution : String
suggestion : String
}pub(all) struct CritiqueResult {
principle : String
score : Int
verdict : String
observation : String
advice : String
}pub(all) struct DesignHistory {
entries : Array[HistoryEntry]
current_revision : Int
branch_name : String
undo_stack : Array[Int]
redo_stack : Array[Int]
}fn DesignHistory::branch(self : DesignHistory, from_rev : Int, branch_name : String) -> Result[Document, String]fn DesignHistory::commit(self : DesignHistory, agent_id : String, message : String, ops : Array[DesignOp], doc : Document) -> Intfn DesignHistory::diff(self : DesignHistory, from_rev : Int, to_rev : Int) -> Result[String, String]fn DesignHistory::replay(self : DesignHistory, from_rev : Int, to_rev : Int) -> Result[String, String]pub(all) struct DesignLint {
rule : String
severity : String
node_id : String
message : String
suggestion : String
}pub(all) enum DesignOp {
OpInsert(String, String)
OpDelete(String)
OpMove(String, String)
OpSetFill(String, String, String)
OpSetRadius(String, Double, Double)
OpSetFontSize(String, Double, Double)
OpSetText(String, String, String)
OpSetPosition(String, Double, Double, Double, Double)
OpSetSize(String, Double, Double, Double, Double)
OpSetGap(String, Double, Double)
}pub(all) struct DesignSuggestion {
category : String
severity : String
description : String
fix_command : String
}pub(all) struct DocComment {
text : String
anchor : String?
}pub(all) struct Document {
root_id : String
nodes : Map[String, Node]
revision : Int
journal : Array[JournalEntry]
content_seq : Int
}pub(all) enum Easing {
Linear
EaseIn
EaseOut
EaseInOut
Spring(Double)
Bounce
None
}pub(all) struct ExtractedComponent {
inferred_name : String
instance_count : Int
common_fill : String
common_radius : Double
common_height : Double
sample_ids : Array[String]
}pub(all) struct ExtractedDesignSystem {
color_tokens : Array[ExtractedToken]
spacing_tokens : Array[ExtractedSpacing]
font_tokens : Array[ExtractedFontSize]
components : Array[ExtractedComponent]
total_nodes : Int
total_colors : Int
total_sizes : Int
}pub(all) struct ExtractedFontSize {
value : Double
usage_count : Int
suggested_name : String
}pub(all) struct ExtractedSpacing {
value : Double
usage_count : Int
suggested_name : String
}pub(all) struct ExtractedToken {
name : String
value : String
usage_count : Int
confidence : Double
}pub(all) struct FontNote {
node_id : String
size : Double
color : String
token_hint : String
}pub(all) enum Gate {
HumanGate
AgentGate
}pub(all) struct GenIntent {
template_id : String
artboard_name : String
width : Double
height : Double
theme : String
page_hint : String
alternatives : Array[String]
}pub(all) struct InteractionDef {
node_id : String
trigger : Trigger
action : Action
transition : Transition
}pub(all) struct JournalEntry {
revision : Int
source : OpSource
message : String
violation_count : Int
}pub(all) enum LayoutIntent {
CenterNode(String)
VerticalStack
HorizontalRow
EqualWidth
EqualHeight
EqualSpacing
GridAlign(Double)
MoveTop
MoveBottom
MoveCenter
ScaleAll(Double)
SetPadding(Double)
SetGap(Double)
Unknown
}pub(all) struct MoonVizArtifact {
meta_version : String
meta_created_by : String
meta_context : String
artboard_decls : Map[String, String]
artboard_names : Map[String, String]
artboard_sizes : Map[String, (Double, Double)]
flows : Array[(String, String, String)]
todos : Array[String]
notes : Array[AgentNote]
}fn MoonVizArtifact::add_note(self : MoonVizArtifact, artboard : String, note : String, priority : String) -> Unitpub(all) struct MoonVizRT {
project : Project
nav : NavigationState
overlay_toast : String?
input_values : Map[String, String]
listeners : Array[(StateChange) -> Unit]
}pub(all) struct NodePatch {
name : String?
width : SizeSpec?
height : SizeSpec?
x : PosSpec?
y : PosSpec?
text : String?
layout_dir : StackDir?
layout_gap : Double?
layout_justify : Justify?
layout_padding : Padding?
fill : String?
stroke : String?
corner_radius : Double?
font_size : Double?
text_color : String?
}pub(all) struct NodeStyle {
fill : String
stroke : String
stroke_width : Double
corner_radius : Double
opacity : Double
font_size : Double
text_color : String
font_weight : String
shadow : String
rotate : Double
blur : Double
blend : String
line_height : Double
tracking : Double
flip : String
text_align : String
font_style : String
stroke_dash : String
visible : Bool
}pub(all) struct NormsProfile {
radius_base : Double
contrast_min : Double
touch_min : Double
}pub(all) struct OpEntry {
op : String
usage : String
category : String
description : String
}pub(all) enum OpSource {
HumanOp
AgentOp
}pub(all) struct Padding {
top : Double
right : Double
bottom : Double
left : Double
}pub(all) enum PageType {
AuthPage
DashboardPage
ListPage
DetailPage
ProfilePage
SettingsPage
FormPage
NavigationPage
EmptyStatePage
UnknownPage
}pub(all) struct PlaceArgs {
variant : String
x : Double
y : Double
w : Double
h : Double
args : Map[String, String]
error : String
}pub(all) enum PosSpec {
Fixed(Double)
AlignStart(Double)
AlignEnd(Double)
CenterInParent
}pub(all) enum Predicate {
TreeValid
SizeValid
ContainedInParent
NoSiblingOverlap
ConstraintSolvable
}pub(all) struct Project {
artboards : Map[String, ArtboardMeta]
flows : Array[FlowEdge]
tokens : DesignTokens
components : Map[String, ComponentDef]
user_components : Map[String, UserComponentDef]
node_states : Map[String, ComponentStateDef]
revision : Int
token_overrides : Map[String, String]?
active_theme : String
doc_comments : Array[DocComment]
extra_front_matter : Array[String]
design_spec : String
}fn Project::apply_intent(self : Project, intent : LayoutIntent, artboard~ : String, parent_id? : String) -> Result[String, String]fn Project::benchmark_artboard(self : Project, artboard~ : String) -> Result[ArtboardBenchmark, String]fn Project::extract_design_system(self : Project, artboard~ : String) -> Result[ExtractedDesignSystem, String]pub(all) struct ProjectBenchmark {
artboards : Array[ArtboardBenchmark]
total_nodes : Int
total_memory : Int
avg_score : Double
grade : String
}test_rt.tap(160, 422).expect_navigate("home")
test_rt.back().expect_artboard("login")
test_rt.set_input("email", "test@x.com").expect_value("email", "test@x.com")pub(all) struct Rect {
x : Double
y : Double
width : Double
height : Double
}pub(all) enum RenderCommand {
CmdRect(Double, Double, Double, Double, String, Double)
CmdText(Double, Double, String, Double, String)
CmdLine(Double, Double, Double, Double, String)
CmdClipPush(Double, Double, Double, Double)
CmdClipPop
}pub(all) struct RenderPlan {
artboard : String
width : Double
height : Double
commands : Array[RenderCommand]
}pub(all) enum SizeSpec {
Fixed(Double)
Fill
Hug
}pub(all) struct SlotDef {
name : String
description : String
accepts : Array[String]
default_content : String
}<Card>
<CardHeader>Title</CardHeader>
<CardContent>Body</CardContent>
</Card>p.place_component("card", "my_card")
p.fill_slot("my_card", "header", "Title")
p.fill_slot("my_card", "content", "Body text here")pub(all) struct SlottedComponent {
component_id : String
display_name : String
slots : Array[SlotDef]
layout : StackLayout
base_style : NodeStyle
}pub(all) enum SolveFailure {
MissingRoot
MissingNode(String)
NegativeResidual(String, Double)
UnsupportedSpec(String)
}pub(all) struct SpacingNote {
node_id : String
label : String
value : Double
unit : String
}pub(all) enum StateChange {
ArtboardChanged(String)
NodeUpdated(String)
NavigationPushed(String)
NavigationPopped(String)
ToastShown(String)
FormSubmitted(Map[String, String])
}type StyleParsepub(all) struct TemplateInfo {
id : String
name : String
description : String
category : String
tags : Array[String]
device : String
}pub(all) struct ToolArg {
name : String
type_ : String
desc : String
required : Bool
}pub(all) enum Transition {
Push
Pop
ModalPresent
ModalDismiss
SheetPresent
Fade
NoTransition
}pub(all) enum Trigger {
Tap
LongPress(Double)
SwipeLeft
SwipeRight
SwipeUp
SwipeDown
ScrollEnd
KeyboardEnter
Focus
Blur
}pub(all) struct VariantScore {
artboard : String
violations : Int
lint_issues : Int
alignment_hints : Int
node_count : Int
score : Int
}pub(all) enum VizEvent {
TapEvent(Double, Double)
LongPressEvent(Double, Double)
SwipeEvent(String)
KeyEvent(String)
FocusEvent(String)
BlurEvent(String)
}let ENGINE_VERSION : Stringlet MOTION_FAST : Intlet NORM_PURE_DARK_LUMA_MAX : Doublelet NORM_TEXT_CONTRAST_LARGE_MIN : Doublelet SIZE_SANITY_LIMIT : Doublelet TEXT_LINE_HEIGHT_RATIO : Doublefn animation_css(node_id : String, preset : String) -> Stringfn animation_presets_json() -> Stringfn component_norm(id : String) -> String?fn design_spec_draft_json(intent_text : String) -> Stringfn extract_interaction_marker(name : String) -> Stringfn instantiate_component(def : ComponentDef, id : String, variant? : String, tokens? : DesignTokens) -> Nodefn json_escape(s : String) -> Stringfn list_ops_json() -> Stringfn list_tools_json() -> Stringfn lt_box(id~ : String, fill~ : String, w~ : Double, h~ : Double, radius? : Double, shadow? : String, stroke? : String) -> LTfn merge_sessions_from_spec(spec : String) -> Stringfn motion_tokens_css() -> Stringfn norm_is_action_component(component : String) -> Boolfn norm_is_full_bleed_component(component : String) -> Boolfn norm_is_rounded_component(component : String) -> Boolfn norm_issues_v2(doc : Document, layout : SolvedLayout, radius_base? : Double, contrast_min? : Double, touch_min? : Double) -> Array[String]fn norm_readability_issues(doc : Document, layout : SolvedLayout, contrast_min? : Double) -> Array[String]fn parse_interaction_marker(name : String) -> (String, String)?fn place_user_component(target : Document, def : UserComponentDef, instance_id : String, variant? : String, args? : Map[String, String], dx? : Double, dy? : Double) -> Result[String, String]fn qa_is_interactive_component(c : String) -> Boolfn qa_is_placeholder_text(t : String) -> Boolfn strip_all_markers(name : String) -> Stringfn transform_insert_index(our_index : Int, their_index : Int, our_timestamp : Double, their_timestamp : Double) -> Intfn unescape_value(s : String) -> StringInstall
Download zipAgent-Native 原型绘制引擎:.mbt.md 唯一事实源,人类画布与 Agent 声明共同演化,MoonBit 不崩谓词护航