@almadar/std 16.233.0 → 16.235.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/behaviors/behaviors-registry.json +1378 -130
  2. package/behaviors/lolo/ui/avl/atoms/ui-avl-glyph.lolo +54 -0
  3. package/behaviors/lolo/ui/avl/atoms/ui-avl-state-machine.lolo +132 -0
  4. package/behaviors/lolo/ui/avl/atoms/ui-behavior-view.lolo +5 -6
  5. package/behaviors/lolo/ui/avl/atoms/ui-module-card.lolo +7 -8
  6. package/behaviors/lolo/ui/core/molecules/ui-code-block.lolo +74 -0
  7. package/behaviors/lolo/ui/core/molecules/ui-file-tree.lolo +16 -0
  8. package/behaviors/lolo/ui/core/organisms/ui-state-machine-view.lolo +104 -2
  9. package/behaviors/lolo/ui/game/atoms/ui-draw-skinned-mesh.lolo +1 -1
  10. package/behaviors/lolo-behavior-contracts.json +1 -1
  11. package/behaviors/registry/factory-signatures.json +1 -1
  12. package/behaviors/registry/ui/avl/atoms/ui-avl-glyph.orb +211 -0
  13. package/behaviors/registry/ui/avl/atoms/ui-avl-state-machine.orb +761 -0
  14. package/behaviors/registry/ui/avl/atoms/ui-behavior-view.orb +157 -66
  15. package/behaviors/registry/ui/avl/atoms/ui-module-card.orb +158 -67
  16. package/behaviors/registry/ui/core/molecules/ui-code-block.orb +185 -0
  17. package/behaviors/registry/ui/core/molecules/ui-file-tree.orb +68 -0
  18. package/behaviors/registry/ui/core/organisms/ui-state-machine-view.orb +487 -2
  19. package/behaviors/registry/ui/game/atoms/ui-draw-skinned-mesh.orb +1 -2
  20. package/dist/behaviors/exports-reader.js +1863 -1472
  21. package/dist/behaviors/functions/index.d.ts +241 -7
  22. package/dist/behaviors/functions/index.js +1858 -1473
  23. package/dist/behaviors/index.d.ts +1 -1
  24. package/dist/behaviors/index.js +1864 -1473
  25. package/dist/behaviors/query.js +1863 -1472
  26. package/dist/behaviors-embeddings.hash.json +3 -3
  27. package/dist/behaviors-embeddings.json +19 -11
  28. package/dist/behaviors-registry.json +1378 -130
  29. package/dist/index.d.ts +3 -3
  30. package/dist/index.js +1881 -1473
  31. package/dist/knob-embeddings.hash.json +3 -3
  32. package/dist/knob-embeddings.json +159 -7
  33. package/dist/modules/anim.d.ts +1 -1
  34. package/dist/modules/array.d.ts +1 -1
  35. package/dist/modules/async.d.ts +1 -1
  36. package/dist/modules/async.js +9 -0
  37. package/dist/modules/behavior.d.ts +1 -1
  38. package/dist/modules/browser.d.ts +1 -1
  39. package/dist/modules/composition.d.ts +1 -1
  40. package/dist/modules/contract.d.ts +1 -1
  41. package/dist/modules/core.d.ts +1 -1
  42. package/dist/modules/core.js +8 -0
  43. package/dist/modules/data.d.ts +1 -1
  44. package/dist/modules/ease.d.ts +1 -1
  45. package/dist/modules/format.d.ts +1 -1
  46. package/dist/modules/geo.d.ts +1 -1
  47. package/dist/modules/graph.d.ts +1 -1
  48. package/dist/modules/grid.d.ts +1 -1
  49. package/dist/modules/index.d.ts +1 -1
  50. package/dist/modules/index.js +17 -0
  51. package/dist/modules/integration.d.ts +1 -1
  52. package/dist/modules/json.d.ts +1 -1
  53. package/dist/modules/llm.d.ts +1 -1
  54. package/dist/modules/math.d.ts +1 -1
  55. package/dist/modules/memory.d.ts +1 -1
  56. package/dist/modules/nn.d.ts +1 -1
  57. package/dist/modules/noise.d.ts +1 -1
  58. package/dist/modules/object.d.ts +1 -1
  59. package/dist/modules/os.d.ts +1 -1
  60. package/dist/modules/path.d.ts +1 -1
  61. package/dist/modules/prob.d.ts +1 -1
  62. package/dist/modules/session.d.ts +1 -1
  63. package/dist/modules/str.d.ts +1 -1
  64. package/dist/modules/tensor.d.ts +1 -1
  65. package/dist/modules/time.d.ts +1 -1
  66. package/dist/modules/trace.d.ts +1 -1
  67. package/dist/modules/train.d.ts +1 -1
  68. package/dist/modules/validate.d.ts +1 -1
  69. package/dist/modules/vector.d.ts +1 -1
  70. package/dist/modules/workspace.d.ts +1 -1
  71. package/dist/registry/factory-signatures.json +1 -1
  72. package/dist/registry.d.ts +5 -2
  73. package/dist/registry.js +38 -1
  74. package/dist/{types-DwAW4Nni.d.ts → types-Ggla7OK7.d.ts} +8 -1
  75. package/package.json +2 -2
@@ -0,0 +1,54 @@
1
+ app ui-avl-glyph "1.0.0"
2
+ "AvlGlyph — UI factory (1:1 with the @almadar/ui avl-glyph pattern)."
3
+ ;; @pattern "avl-glyph"
4
+ orbital AvlGlyphOrbital {
5
+ entity AvlGlyphItem [runtime] {
6
+ id : string!
7
+ }
8
+
9
+ trait AvlGlyphRender -> @rebindable AvlGlyphItem [interaction, instance] {
10
+ initial: idle
11
+
12
+ state idle {
13
+ INIT -> idle
14
+ (render-ui main {
15
+ kind: @config.kind
16
+ label: @config.label
17
+ effectType: @config.effectType
18
+ size: @config.size
19
+ showCaption: @config.showCaption
20
+ className: @config.className
21
+ type: avl-glyph
22
+ })
23
+ }
24
+
25
+ config {
26
+ kind : "application" | "orbital" | "entity" | "trait" | "page" | "state" | "transition" | "event" | "guard" | "effect" | "field" | "fieldType" | "binding" | "bindingRef" | "persistence" | "operator" | "sexpr" | "literal" = state
27
+ @label "Kind"
28
+ @description "Which notation symbol to draw."
29
+ @tier "presentation"
30
+ label : string
31
+ @label "Label"
32
+ @description "Caption, and the drawn text for operator / literal / bindingRef symbols."
33
+ @tier "presentation"
34
+ effectType : string
35
+ @label "Effect Type"
36
+ @description "Effect symbol variant. @default 'set'"
37
+ @tier "presentation"
38
+ size : "sm" | "md" | "lg" = md
39
+ @label "Size"
40
+ @description "Symbol height. @default 'md'"
41
+ @tier "presentation"
42
+ showCaption : boolean = true
43
+ @label "Show Caption"
44
+ @description "Show the caption under the symbol. @default true"
45
+ @tier "presentation"
46
+ className : string
47
+ @label "Class Name"
48
+ @description "className prop"
49
+ @tier "presentation"
50
+ }
51
+ }
52
+
53
+ page "/avl-glyph" as AvlGlyphPage -> AvlGlyphRender
54
+ }
@@ -0,0 +1,132 @@
1
+ app ui-avl-state-machine "1.0.0"
2
+ "AvlStateMachine — UI factory (1:1 with the @almadar/ui avl-state-machine pattern)."
3
+ ;; @pattern "avl-state-machine"
4
+ orbital AvlStateMachineOrbital {
5
+ type AvlStateMachineTrait = {
6
+ name : string!
7
+ linkedEntity : string!
8
+ states : [AvlStateMachineTraitStatesItem]!
9
+ transitions : [AvlStateMachineTraitTransitionsItem]!
10
+ emittedEvents : [string]!
11
+ listenedEvents : [string]!
12
+ }
13
+ type AvlStateMachineTraitStatesItem = {
14
+ name : string!
15
+ isInitial : boolean
16
+ isTerminal : boolean
17
+ }
18
+ type AvlStateMachineTraitTransitionsItem = {
19
+ from : string!
20
+ to : string!
21
+ event : string!
22
+ guard : SExpr
23
+ effects : [AvlStateMachineTraitTransitionsItemEffectsItem]!
24
+ index : number!
25
+ }
26
+ type AvlStateMachineTraitTransitionsItemEffectsItem = {
27
+ type : string!
28
+ args : [SExpr]!
29
+ }
30
+
31
+ entity AvlStateMachineItem [runtime] {
32
+ id : string!
33
+ }
34
+
35
+ trait AvlStateMachineRender -> @rebindable AvlStateMachineItem [interaction, instance] {
36
+ initial: idle
37
+
38
+ state idle {
39
+ INIT -> idle
40
+ (render-ui main {
41
+ trait: @config.traitProp
42
+ activeState: @config.activeState
43
+ activeTransition: @config.activeTransition
44
+ visitedStates: @config.visitedStates
45
+ stateClickEvent: @config.stateClickEvent
46
+ transitionClickEvent: @config.transitionClickEvent
47
+ selectedState: @config.selectedState
48
+ pendingSourceState: @config.pendingSourceState
49
+ nodeShape: @config.nodeShape
50
+ entityFields: @config.entityFields
51
+ direction: @config.direction
52
+ showHeader: @config.showHeader
53
+ className: @config.className
54
+ type: avl-state-machine
55
+ })
56
+ }
57
+
58
+ emits {
59
+ @config.stateClickEvent -> external {
60
+ stateId : string!
61
+ }
62
+ @description "Emits UI:{stateClickEvent} with { stateId } when a state is clicked."
63
+ @tier "essential"
64
+ @config.transitionClickEvent -> external {
65
+ index : number!
66
+ event : string!
67
+ from : string!
68
+ to : string!
69
+ }
70
+ @description "Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked."
71
+ @tier "essential"
72
+ }
73
+
74
+ config {
75
+ traitProp : AvlStateMachineTrait = { name: "OrderFlow", linkedEntity: "Order", states: [{ name: "browsing", isInitial: true, isTerminal: false }, { name: "editing", isInitial: false, isTerminal: false }, { name: "saving", isInitial: false, isTerminal: false }, { name: "confirmed", isInitial: false, isTerminal: true }, { name: "failed", isInitial: false, isTerminal: false }], transitions: [{ from: "browsing", to: "editing", event: "EDIT", effects: [{ type: "render-ui", args: [] }], index: 0 }, { from: "editing", to: "saving", event: "SAVE", effects: [{ type: "persist", args: [] }, { type: "notify", args: [] }], index: 1 }, { from: "saving", to: "confirmed", event: "SAVED", effects: [{ type: "emit", args: [] }, { type: "render-ui", args: [] }], index: 2 }, { from: "saving", to: "failed", event: "SAVE_FAILED", effects: [{ type: "notify", args: [] }], index: 3 }, { from: "failed", to: "editing", event: "RETRY", effects: [], index: 4 }, { from: "editing", to: "browsing", event: "CANCEL", effects: [{ type: "render-ui", args: [] }], index: 5 }, { from: "confirmed", to: "browsing", event: "DONE", effects: [{ type: "navigate", args: [] }], index: 6 }], emittedEvents: ["ORDER_SAVED"], listenedEvents: ["PAYMENT_OK"] }
76
+ @label "Trait"
77
+ @description "The trait to draw (see `parseTraitLevel`)."
78
+ @synonyms "trait"
79
+ @tier "presentation"
80
+ activeState : string
81
+ @label "Active State"
82
+ @description "State execution is currently in."
83
+ @tier "presentation"
84
+ activeTransition : number
85
+ @label "Active Transition"
86
+ @description "`index` of the transition that just fired."
87
+ @tier "presentation"
88
+ visitedStates : [string] = []
89
+ @label "Visited States"
90
+ @description "States already passed through, in order."
91
+ @tier "presentation"
92
+ stateClickEvent : event = "STATE_CLICK"
93
+ @label "State Click Event"
94
+ @description "Emits UI:{stateClickEvent} with { stateId } when a state is clicked."
95
+ @tier "presentation"
96
+ transitionClickEvent : event = "TRANSITION_CLICK"
97
+ @label "Transition Click Event"
98
+ @description "Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked."
99
+ @tier "presentation"
100
+ selectedState : string
101
+ @label "Selected State"
102
+ @description "State picked in an editor (first click)."
103
+ @tier "presentation"
104
+ pendingSourceState : string
105
+ @label "Pending Source State"
106
+ @description "Source of a transition being drawn — the next state click picks its target."
107
+ @tier "presentation"
108
+ nodeShape : "pill" | "gear" = pill
109
+ @label "Node Shape"
110
+ @description "Node silhouette. @default 'pill'"
111
+ @tier "presentation"
112
+ entityFields : [string] = []
113
+ @label "Entity Fields"
114
+ @description "Entity field names listed in the header."
115
+ @tier "presentation"
116
+ direction : "ltr" | "rtl" = ltr
117
+ @label "Direction"
118
+ @description "Flow direction. @default 'ltr'"
119
+ @tier "presentation"
120
+ showHeader : boolean = true
121
+ @label "Show Header"
122
+ @description "Show the trait header (name, entity, listens/emits). @default true"
123
+ @tier "presentation"
124
+ className : string
125
+ @label "Class Name"
126
+ @description "className prop"
127
+ @tier "presentation"
128
+ }
129
+ }
130
+
131
+ page "/avl-state-machine" as AvlStateMachinePage -> AvlStateMachineRender
132
+ }
@@ -5,7 +5,6 @@ orbital BehaviorViewOrbital {
5
5
  type BehaviorViewData = {
6
6
  orbitalName : string!
7
7
  entityName : string!
8
- persistence : string!
9
8
  fields : [BehaviorViewDataFieldsItem]!
10
9
  traits : [BehaviorViewDataTraitsItem]!
11
10
  pages : [BehaviorViewDataPagesItem]!
@@ -40,14 +39,14 @@ orbital BehaviorViewOrbital {
40
39
  }
41
40
  type BehaviorViewDataTraitDetailsValueStatesItem = {
42
41
  name : string!
43
- isInitial : boolean!
44
- isTerminal : boolean!
42
+ isInitial : boolean
43
+ isTerminal : boolean
45
44
  }
46
45
  type BehaviorViewDataTraitDetailsValueTransitionsItem = {
47
46
  from : string!
48
47
  to : string!
49
48
  event : string!
50
- guard : SExpr!
49
+ guard : SExpr
51
50
  effects : [BehaviorViewDataTraitDetailsValueTransitionsItemEffectsItem]!
52
51
  index : number!
53
52
  }
@@ -78,9 +77,9 @@ orbital BehaviorViewOrbital {
78
77
  }
79
78
 
80
79
  config {
81
- data : BehaviorViewData = { orbitalName: "Orbital Name", entityName: "Entity Name", persistence: "Persistence", fields: [{ name: "Name", type: "Type", required: false, hasDefault: false }, { name: "Name 2", type: "Type 2", required: true, hasDefault: true }], traits: [{ name: "Name", stateCount: 1, eventCount: 1, transitionCount: 1, emits: ["Item", "Item 2"], listens: ["Item", "Item 2"] }, { name: "Name 2", stateCount: 2, eventCount: 2, transitionCount: 2, emits: ["Item", "Item 2"], listens: ["Item", "Item 2"] }], pages: [{ name: "Name", route: "Route" }, { name: "Name 2", route: "Route 2" }], traitDetails: {}, externalLinks: [{ targetOrbital: "Target Orbital", eventName: "Event Name", direction: "Direction", traitName: "Trait Name" }, { targetOrbital: "Target Orbital 2", eventName: "Event Name 2", direction: "Direction 2", traitName: "Trait Name 2" }] }
80
+ data : BehaviorViewData = { orbitalName: "OrderOrbital", entityName: "Order", persistence: "persistent", fields: [{ name: "customer", type: "string", required: true, hasDefault: false }, { name: "qty", type: "number", required: true, hasDefault: true }, { name: "status", type: "string", required: false, hasDefault: true }], traits: [{ name: "OrderFlow", stateCount: 5, eventCount: 7, transitionCount: 7, emits: ["ORDER_SAVED"], listens: ["PAYMENT_OK"] }], pages: [{ name: "Orders", route: "/orders" }], traitDetails: { OrderFlow: { name: "OrderFlow", linkedEntity: "Order", states: [{ name: "browsing", isInitial: true, isTerminal: false }, { name: "editing", isInitial: false, isTerminal: false }, { name: "saving", isInitial: false, isTerminal: false }, { name: "confirmed", isInitial: false, isTerminal: true }, { name: "failed", isInitial: false, isTerminal: false }], transitions: [{ from: "browsing", to: "editing", event: "EDIT", effects: [{ type: "render-ui", args: [] }], index: 0 }, { from: "editing", to: "saving", event: "SAVE", effects: [{ type: "persist", args: [] }, { type: "notify", args: [] }], index: 1 }, { from: "saving", to: "confirmed", event: "SAVED", effects: [{ type: "emit", args: [] }, { type: "render-ui", args: [] }], index: 2 }, { from: "saving", to: "failed", event: "SAVE_FAILED", effects: [{ type: "notify", args: [] }], index: 3 }, { from: "failed", to: "editing", event: "RETRY", effects: [], index: 4 }, { from: "editing", to: "browsing", event: "CANCEL", effects: [{ type: "render-ui", args: [] }], index: 5 }, { from: "confirmed", to: "browsing", event: "DONE", effects: [{ type: "navigate", args: [] }], index: 6 }], emittedEvents: ["ORDER_SAVED"], listenedEvents: ["PAYMENT_OK"] } }, externalLinks: [{ targetOrbital: "PaymentOrbital", eventName: "PAYMENT_OK", direction: "in", traitName: "OrderFlow" }] }
82
81
  @label "Data"
83
- @description "data prop"
82
+ @description "The orbital to summarize."
84
83
  @tier "presentation"
85
84
  }
86
85
  }
@@ -1,12 +1,11 @@
1
1
  app ui-module-card "1.0.0"
2
- "ModuleCard — a card summarizing one course module or lesson with progress and entry point. — UI factory (1:1 with the @almadar/ui module-card pattern)."
3
- ;; @capabilities "course module card, lesson card, curriculum unit card, learning-path step card"
2
+ "ModuleCard — a compact summary card for one orbital module: its entity and fields, a mini state machine per trait, and its pages. — UI factory (1:1 with the @almadar/ui module-card pattern)."
3
+ ;; @capabilities "orbital module summary card, entity and trait overview card, app architecture node card"
4
4
  ;; @pattern "module-card"
5
5
  orbital ModuleCardOrbital {
6
6
  type ModuleCardData = {
7
7
  orbitalName : string!
8
8
  entityName : string!
9
- persistence : string!
10
9
  fields : [ModuleCardDataFieldsItem]!
11
10
  traits : [ModuleCardDataTraitsItem]!
12
11
  pages : [ModuleCardDataPagesItem]!
@@ -41,14 +40,14 @@ orbital ModuleCardOrbital {
41
40
  }
42
41
  type ModuleCardDataTraitDetailsValueStatesItem = {
43
42
  name : string!
44
- isInitial : boolean!
45
- isTerminal : boolean!
43
+ isInitial : boolean
44
+ isTerminal : boolean
46
45
  }
47
46
  type ModuleCardDataTraitDetailsValueTransitionsItem = {
48
47
  from : string!
49
48
  to : string!
50
49
  event : string!
51
- guard : SExpr!
50
+ guard : SExpr
52
51
  effects : [ModuleCardDataTraitDetailsValueTransitionsItemEffectsItem]!
53
52
  index : number!
54
53
  }
@@ -79,9 +78,9 @@ orbital ModuleCardOrbital {
79
78
  }
80
79
 
81
80
  config {
82
- data : ModuleCardData = { orbitalName: "Orbital Name", entityName: "Entity Name", persistence: "Persistence", fields: [{ name: "Name", type: "Type", required: false, hasDefault: false }, { name: "Name 2", type: "Type 2", required: true, hasDefault: true }], traits: [{ name: "Name", stateCount: 1, eventCount: 1, transitionCount: 1, emits: ["Item", "Item 2"], listens: ["Item", "Item 2"] }, { name: "Name 2", stateCount: 2, eventCount: 2, transitionCount: 2, emits: ["Item", "Item 2"], listens: ["Item", "Item 2"] }], pages: [{ name: "Name", route: "Route" }, { name: "Name 2", route: "Route 2" }], traitDetails: {}, externalLinks: [{ targetOrbital: "Target Orbital", eventName: "Event Name", direction: "Direction", traitName: "Trait Name" }, { targetOrbital: "Target Orbital 2", eventName: "Event Name 2", direction: "Direction 2", traitName: "Trait Name 2" }] }
81
+ data : ModuleCardData = { orbitalName: "OrderOrbital", entityName: "Order", persistence: "persistent", fields: [{ name: "customer", type: "string", required: true, hasDefault: false }, { name: "qty", type: "number", required: true, hasDefault: true }, { name: "status", type: "string", required: false, hasDefault: true }], traits: [{ name: "OrderFlow", stateCount: 5, eventCount: 7, transitionCount: 7, emits: ["ORDER_SAVED"], listens: ["PAYMENT_OK"] }], pages: [{ name: "Orders", route: "/orders" }], traitDetails: { OrderFlow: { name: "OrderFlow", linkedEntity: "Order", states: [{ name: "browsing", isInitial: true, isTerminal: false }, { name: "editing", isInitial: false, isTerminal: false }, { name: "saving", isInitial: false, isTerminal: false }, { name: "confirmed", isInitial: false, isTerminal: true }, { name: "failed", isInitial: false, isTerminal: false }], transitions: [{ from: "browsing", to: "editing", event: "EDIT", effects: [{ type: "render-ui", args: [] }], index: 0 }, { from: "editing", to: "saving", event: "SAVE", effects: [{ type: "persist", args: [] }, { type: "notify", args: [] }], index: 1 }, { from: "saving", to: "confirmed", event: "SAVED", effects: [{ type: "emit", args: [] }, { type: "render-ui", args: [] }], index: 2 }, { from: "saving", to: "failed", event: "SAVE_FAILED", effects: [{ type: "notify", args: [] }], index: 3 }, { from: "failed", to: "editing", event: "RETRY", effects: [], index: 4 }, { from: "editing", to: "browsing", event: "CANCEL", effects: [{ type: "render-ui", args: [] }], index: 5 }, { from: "confirmed", to: "browsing", event: "DONE", effects: [{ type: "navigate", args: [] }], index: 6 }], emittedEvents: ["ORDER_SAVED"], listenedEvents: ["PAYMENT_OK"] } }, externalLinks: [{ targetOrbital: "PaymentOrbital", eventName: "PAYMENT_OK", direction: "in", traitName: "OrderFlow" }] }
83
82
  @label "Data"
84
- @description "data prop"
83
+ @description "The orbital to summarize."
85
84
  @tier "presentation"
86
85
  }
87
86
  }
@@ -25,6 +25,15 @@ orbital CodeBlockOrbital {
25
25
  code : string
26
26
  stack : string
27
27
  }
28
+ type CodeBlockDiagnosticsItem = {
29
+ line : number!
30
+ column : number
31
+ endLine : number
32
+ endColumn : number
33
+ severity : "error" | "warning"!
34
+ message : string!
35
+ approximate : boolean
36
+ }
28
37
 
29
38
  entity CodeBlockItem [runtime] {
30
39
  id : string!
@@ -70,6 +79,11 @@ orbital CodeBlockOrbital {
70
79
  onSetMode: @config.onSetMode
71
80
  motions: @config.motions
72
81
  operators: @config.operators
82
+ problems: @config.problems
83
+ diagnostics: @config.diagnostics
84
+ onGoToDefinition: @config.onGoToDefinition
85
+ diagnosticsCode: @config.diagnosticsCode
86
+ lineNumbers: @config.lineNumbers
73
87
  type: code-block
74
88
  })
75
89
  CHANGE -> idle
@@ -105,6 +119,11 @@ orbital CodeBlockOrbital {
105
119
  onSetMode: @config.onSetMode
106
120
  motions: @config.motions
107
121
  operators: @config.operators
122
+ problems: @config.problems
123
+ diagnostics: @config.diagnostics
124
+ onGoToDefinition: @config.onGoToDefinition
125
+ diagnosticsCode: @config.diagnosticsCode
126
+ lineNumbers: @config.lineNumbers
108
127
  type: code-block
109
128
  })
110
129
  EDITOR_FOCUS -> idle
@@ -140,6 +159,11 @@ orbital CodeBlockOrbital {
140
159
  onSetMode: @config.onSetMode
141
160
  motions: @config.motions
142
161
  operators: @config.operators
162
+ problems: @config.problems
163
+ diagnostics: @config.diagnostics
164
+ onGoToDefinition: @config.onGoToDefinition
165
+ diagnosticsCode: @config.diagnosticsCode
166
+ lineNumbers: @config.lineNumbers
143
167
  type: code-block
144
168
  })
145
169
  EDITOR_BLUR -> idle
@@ -175,6 +199,11 @@ orbital CodeBlockOrbital {
175
199
  onSetMode: @config.onSetMode
176
200
  motions: @config.motions
177
201
  operators: @config.operators
202
+ problems: @config.problems
203
+ diagnostics: @config.diagnostics
204
+ onGoToDefinition: @config.onGoToDefinition
205
+ diagnosticsCode: @config.diagnosticsCode
206
+ lineNumbers: @config.lineNumbers
178
207
  type: code-block
179
208
  })
180
209
  MOTION -> idle
@@ -210,6 +239,11 @@ orbital CodeBlockOrbital {
210
239
  onSetMode: @config.onSetMode
211
240
  motions: @config.motions
212
241
  operators: @config.operators
242
+ problems: @config.problems
243
+ diagnostics: @config.diagnostics
244
+ onGoToDefinition: @config.onGoToDefinition
245
+ diagnosticsCode: @config.diagnosticsCode
246
+ lineNumbers: @config.lineNumbers
213
247
  type: code-block
214
248
  })
215
249
  OPERATE -> idle
@@ -245,6 +279,11 @@ orbital CodeBlockOrbital {
245
279
  onSetMode: @config.onSetMode
246
280
  motions: @config.motions
247
281
  operators: @config.operators
282
+ problems: @config.problems
283
+ diagnostics: @config.diagnostics
284
+ onGoToDefinition: @config.onGoToDefinition
285
+ diagnosticsCode: @config.diagnosticsCode
286
+ lineNumbers: @config.lineNumbers
248
287
  type: code-block
249
288
  })
250
289
  INSERT_TEXT -> idle
@@ -280,6 +319,11 @@ orbital CodeBlockOrbital {
280
319
  onSetMode: @config.onSetMode
281
320
  motions: @config.motions
282
321
  operators: @config.operators
322
+ problems: @config.problems
323
+ diagnostics: @config.diagnostics
324
+ onGoToDefinition: @config.onGoToDefinition
325
+ diagnosticsCode: @config.diagnosticsCode
326
+ lineNumbers: @config.lineNumbers
283
327
  type: code-block
284
328
  })
285
329
  SET_MODE -> idle
@@ -315,6 +359,11 @@ orbital CodeBlockOrbital {
315
359
  onSetMode: @config.onSetMode
316
360
  motions: @config.motions
317
361
  operators: @config.operators
362
+ problems: @config.problems
363
+ diagnostics: @config.diagnostics
364
+ onGoToDefinition: @config.onGoToDefinition
365
+ diagnosticsCode: @config.diagnosticsCode
366
+ lineNumbers: @config.lineNumbers
318
367
  type: code-block
319
368
  })
320
369
  }
@@ -335,6 +384,11 @@ orbital CodeBlockOrbital {
335
384
  }
336
385
  @description "Declarative bus emit fired when this editor loses focus."
337
386
  @tier "essential"
387
+ @config.onGoToDefinition -> external {
388
+ identifier : string
389
+ }
390
+ @description "Editable only: Cmd/Ctrl+click, or Cmd/Ctrl+Enter at the caret, on an identifier `definitionAt` accepts."
391
+ @tier "essential"
338
392
  }
339
393
 
340
394
  listens {
@@ -490,6 +544,26 @@ orbital CodeBlockOrbital {
490
544
  @label "Operators"
491
545
  @description "Operator vocabulary this editor accepts. Default: the full `EditorOperator` set."
492
546
  @tier "presentation"
547
+ problems : number
548
+ @label "Problems"
549
+ @description "Editable only: how many problems the host knows the code has (some, like a parse error, have no line to mark). With `assist`, the editor offers to fix them."
550
+ @tier "presentation"
551
+ diagnostics : [CodeBlockDiagnosticsItem] = []
552
+ @label "Diagnostics"
553
+ @description "Editable only: problems located in the code (1-based line/column in characters, `endColumn` just past the last one), each underlined exactly — red wavy for an error, amber for a warning, dotted where the position is approximate. The message of the one under the caret shows below the editor."
554
+ @tier "presentation"
555
+ onGoToDefinition : event = "GO_TO_DEFINITION"
556
+ @label "On Go To Definition"
557
+ @description "Editable only: Cmd/Ctrl+click, or Cmd/Ctrl+Enter at the caret, on an identifier `definitionAt` accepts."
558
+ @tier "presentation"
559
+ diagnosticsCode : string
560
+ @label "Diagnostics Code"
561
+ @description "The code `diagnostics` were computed on. When the editor's text has moved on, each range is carried over the edit; a range the edit touches is dropped until the code is checked again. Absent: they describe the current text."
562
+ @tier "presentation"
563
+ lineNumbers : boolean
564
+ @label "Line Numbers"
565
+ @description "Editable only: number the lines in a gutter (lines with errors in red). Default on."
566
+ @tier "presentation"
493
567
  }
494
568
  }
495
569
 
@@ -8,6 +8,7 @@ orbital FileTreeOrbital {
8
8
  type : "file" | "dir"!
9
9
  children : [FileTreeTreeItem]
10
10
  note : string
11
+ expandable : boolean
11
12
  size : number
12
13
  language : string
13
14
  }
@@ -34,6 +35,8 @@ orbital FileTreeOrbital {
34
35
  selectedId: @config.selectedId
35
36
  look: @config.look
36
37
  onFileSelect: @config.onFileSelect
38
+ onNodeExpand: @config.onNodeExpand
39
+ expandedPaths: @config.expandedPaths
37
40
  onNodeSelect: @config.onNodeSelect
38
41
  onNodeAction: @config.onNodeAction
39
42
  nodeActionIcon: @config.nodeActionIcon
@@ -51,6 +54,11 @@ orbital FileTreeOrbital {
51
54
  }
52
55
  @description "Called when a file is clicked"
53
56
  @tier "essential"
57
+ @config.onNodeExpand -> external {
58
+ path : string
59
+ }
60
+ @description "Called the first time a node marked `expandable` is expanded, with its path, so its children can be loaded."
61
+ @tier "essential"
54
62
  }
55
63
 
56
64
  config {
@@ -78,6 +86,14 @@ orbital FileTreeOrbital {
78
86
  @label "On File Select"
79
87
  @description "Called when a file is clicked"
80
88
  @tier "presentation"
89
+ onNodeExpand : event = "NODE_EXPAND"
90
+ @label "On Node Expand"
91
+ @description "Called the first time a node marked `expandable` is expanded, with its path, so its children can be loaded."
92
+ @tier "presentation"
93
+ expandedPaths : [string] = []
94
+ @label "Expanded Paths"
95
+ @description "Paths to show expanded (e.g. to reveal a node): each is expanded when it appears here, loading its children if needed."
96
+ @tier "presentation"
81
97
  onNodeSelect : event = ""
82
98
  @label "On Node Select"
83
99
  @description "Called when a node is clicked, in flat `items` mode; carries the selected node's id. Presence-gated: binding this prop is what turns on the click-to-select affordance, mirroring Badge's `onRemove`."
@@ -2,6 +2,31 @@ app ui-state-machine-view "1.0.0"
2
2
  "StateMachineView — UI factory (1:1 with the @almadar/ui state-machine-view pattern)."
3
3
  ;; @pattern "state-machine-view"
4
4
  orbital StateMachineViewOrbital {
5
+ type StateMachineViewTrait = {
6
+ name : string!
7
+ linkedEntity : string!
8
+ states : [StateMachineViewTraitStatesItem]!
9
+ transitions : [StateMachineViewTraitTransitionsItem]!
10
+ emittedEvents : [string]!
11
+ listenedEvents : [string]!
12
+ }
13
+ type StateMachineViewTraitStatesItem = {
14
+ name : string!
15
+ isInitial : boolean
16
+ isTerminal : boolean
17
+ }
18
+ type StateMachineViewTraitTransitionsItem = {
19
+ from : string!
20
+ to : string!
21
+ event : string!
22
+ guard : SExpr
23
+ effects : [StateMachineViewTraitTransitionsItemEffectsItem]!
24
+ index : number!
25
+ }
26
+ type StateMachineViewTraitTransitionsItemEffectsItem = {
27
+ type : string!
28
+ args : [SExpr]!
29
+ }
5
30
  type StateMachineViewError = {
6
31
  message : string!
7
32
  name : string
@@ -19,19 +44,96 @@ orbital StateMachineViewOrbital {
19
44
  state idle {
20
45
  INIT -> idle
21
46
  (render-ui main {
47
+ activeState: @config.activeState
48
+ activeTransition: @config.activeTransition
49
+ visitedStates: @config.visitedStates
50
+ stateClickEvent: @config.stateClickEvent
51
+ transitionClickEvent: @config.transitionClickEvent
52
+ selectedState: @config.selectedState
53
+ pendingSourceState: @config.pendingSourceState
54
+ nodeShape: @config.nodeShape
55
+ entityFields: @config.entityFields
56
+ direction: @config.direction
57
+ showHeader: @config.showHeader
22
58
  className: @config.className
59
+ trait: @config.traitProp
23
60
  isLoading: @config.isLoading
24
61
  error: @config.error
25
62
  type: state-machine-view
26
63
  })
27
64
  }
28
65
 
66
+ emits {
67
+ @config.stateClickEvent -> external {
68
+ stateId : string!
69
+ }
70
+ @description "Emits UI:{stateClickEvent} with { stateId } when a state is clicked."
71
+ @tier "essential"
72
+ @config.transitionClickEvent -> external {
73
+ index : number!
74
+ event : string!
75
+ from : string!
76
+ to : string!
77
+ }
78
+ @description "Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked."
79
+ @tier "essential"
80
+ }
81
+
29
82
  config {
83
+ activeState : string
84
+ @label "Active State"
85
+ @description "State execution is currently in."
86
+ @tier "presentation"
87
+ activeTransition : number
88
+ @label "Active Transition"
89
+ @description "`index` of the transition that just fired."
90
+ @tier "presentation"
91
+ visitedStates : [string] = []
92
+ @label "Visited States"
93
+ @description "States already passed through, in order."
94
+ @tier "presentation"
95
+ stateClickEvent : event = "STATE_CLICK"
96
+ @label "State Click Event"
97
+ @description "Emits UI:{stateClickEvent} with { stateId } when a state is clicked."
98
+ @tier "presentation"
99
+ transitionClickEvent : event = "TRANSITION_CLICK"
100
+ @label "Transition Click Event"
101
+ @description "Emits UI:{transitionClickEvent} with { index, event, from, to } when a transition label is clicked."
102
+ @tier "presentation"
103
+ selectedState : string
104
+ @label "Selected State"
105
+ @description "State picked in an editor (first click)."
106
+ @tier "presentation"
107
+ pendingSourceState : string
108
+ @label "Pending Source State"
109
+ @description "Source of a transition being drawn — the next state click picks its target."
110
+ @tier "presentation"
111
+ nodeShape : "pill" | "gear" = pill
112
+ @label "Node Shape"
113
+ @description "Node silhouette. @default 'pill'"
114
+ @tier "presentation"
115
+ entityFields : [string] = []
116
+ @label "Entity Fields"
117
+ @description "Entity field names listed in the header."
118
+ @tier "presentation"
119
+ direction : "ltr" | "rtl" = ltr
120
+ @label "Direction"
121
+ @description "Flow direction. @default 'ltr'"
122
+ @tier "presentation"
123
+ showHeader : boolean
124
+ @label "Show Header"
125
+ @description "Show the trait header (name, entity, listens/emits). @default true"
126
+ @tier "presentation"
30
127
  className : string
31
128
  @label "Class Name"
32
- @description "Additional CSS classes"
129
+ @description "className prop"
130
+ @tier "presentation"
131
+ traitProp : StateMachineViewTrait
132
+ @label "Trait"
133
+ @description "The trait to draw (see `parseTraitLevel` / `traitLevelFromTrait`)."
134
+ @synonyms "trait"
33
135
  @tier "presentation"
34
- isLoading : boolean
136
+ isLoading : boolean = false
35
137
  @label "Is Loading"
36
138
  @description "Loading state indicator"
37
139
  @tier "presentation"
@@ -38,7 +38,7 @@ orbital DrawSkinnedMeshOrbital {
38
38
  }
39
39
  type DrawSkinnedMeshBonesItem = {
40
40
  name : string!
41
- parent : string!
41
+ parent : string
42
42
  pivot : [number]!
43
43
  tip : [number]!
44
44
  }