@almadar/std 16.242.0 → 16.244.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 (144) hide show
  1. package/behaviors/behaviors-registry.json +4470 -513
  2. package/behaviors/lolo/agent/atoms/std-agent-context.lolo +24 -4
  3. package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +20 -5
  4. package/behaviors/lolo/agent/atoms/std-agent-proposal.lolo +550 -0
  5. package/behaviors/lolo/agent/atoms/std-agent-session.lolo +284 -25
  6. package/behaviors/lolo/agent/atoms/std-agent-suggestions.lolo +841 -0
  7. package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +58 -8
  8. package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +1 -0
  9. package/behaviors/lolo/infra/atoms/std-page-search.lolo +3 -1
  10. package/behaviors/lolo/infra/atoms/std-page-treat.lolo +28 -1
  11. package/behaviors/lolo/infra/atoms/std-page-watch.lolo +3 -1
  12. package/behaviors/lolo/ui/avl/atoms/ui-avl-state-machine.lolo +22 -0
  13. package/behaviors/lolo/ui/avl/atoms/ui-avl-transition-explainer.lolo +175 -0
  14. package/behaviors/lolo/ui/avl/atoms/ui-module-card.lolo +22 -0
  15. package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +23 -4
  16. package/behaviors/lolo/ui/core/atoms/std-hero.lolo +72 -33
  17. package/behaviors/lolo/ui/core/molecules/ui-agent-chat-feed.lolo +1 -1
  18. package/behaviors/lolo/ui/core/molecules/ui-markdown-content.lolo +54 -0
  19. package/behaviors/lolo/ui/core/molecules/ui-upload-drop-zone.lolo +5 -0
  20. package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +127 -3
  21. package/behaviors/lolo/ui/core/organisms/ui-state-machine-view.lolo +22 -0
  22. package/behaviors/lolo/ui/core/templates/ui-dashboard-layout.lolo +2 -2
  23. package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +87 -17
  24. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +172 -37
  25. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +183 -70
  26. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +78 -13
  27. package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +58 -2
  28. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +107 -12
  29. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +83 -10
  30. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +130 -9
  31. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +143 -59
  32. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +96 -22
  33. package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +66 -5
  34. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +84 -6
  35. package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +80 -14
  36. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +99 -5
  37. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +81 -7
  38. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +83 -7
  39. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +224 -99
  40. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +63 -2
  41. package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +99 -38
  42. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +7 -7
  43. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +69 -4
  44. package/behaviors/lolo-behavior-contracts.json +1 -1
  45. package/behaviors/registry/agent/atoms/std-agent-context.orb +205 -6
  46. package/behaviors/registry/agent/atoms/std-agent-memory.orb +146 -4
  47. package/behaviors/registry/agent/atoms/std-agent-proposal.orb +1972 -0
  48. package/behaviors/registry/agent/atoms/std-agent-session.orb +2021 -597
  49. package/behaviors/registry/agent/atoms/std-agent-suggestions.orb +5079 -0
  50. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +287 -5
  51. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +7 -0
  52. package/behaviors/registry/factory-signatures.json +1 -1
  53. package/behaviors/registry/infra/atoms/std-page-search.orb +19 -1
  54. package/behaviors/registry/infra/atoms/std-page-treat.orb +327 -2
  55. package/behaviors/registry/infra/atoms/std-page-watch.orb +19 -1
  56. package/behaviors/registry/ui/avl/atoms/ui-avl-state-machine.orb +134 -0
  57. package/behaviors/registry/ui/avl/atoms/ui-avl-transition-explainer.orb +678 -0
  58. package/behaviors/registry/ui/avl/atoms/ui-module-card.orb +122 -0
  59. package/behaviors/registry/ui/core/atoms/std-app-layout.orb +73 -4
  60. package/behaviors/registry/ui/core/atoms/std-hero.orb +174 -97
  61. package/behaviors/registry/ui/core/molecules/ui-markdown-content.orb +204 -1
  62. package/behaviors/registry/ui/core/molecules/ui-upload-drop-zone.orb +12 -0
  63. package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +683 -30
  64. package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +748 -21
  65. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1429 -41
  66. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +1031 -185
  67. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +807 -132
  68. package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +553 -6
  69. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +987 -21
  70. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +582 -16
  71. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +954 -13
  72. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +828 -88
  73. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +730 -28
  74. package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +479 -9
  75. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +797 -46
  76. package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +757 -58
  77. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1176 -164
  78. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +599 -12
  79. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +832 -150
  80. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +1561 -127
  81. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +655 -6
  82. package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +634 -43
  83. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +85 -31
  84. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +425 -9
  85. package/canonical-operators.json +45 -2
  86. package/dist/behaviors/exports-reader.js +16667 -7868
  87. package/dist/behaviors/functions/index.d.ts +711 -32
  88. package/dist/behaviors/functions/index.js +16651 -7869
  89. package/dist/behaviors/index.d.ts +1 -1
  90. package/dist/behaviors/index.js +16668 -7869
  91. package/dist/behaviors/query.js +16667 -7868
  92. package/dist/behaviors-embeddings.hash.json +3 -3
  93. package/dist/behaviors-embeddings.json +77 -53
  94. package/dist/behaviors-registry.json +4470 -513
  95. package/dist/index.d.ts +3 -3
  96. package/dist/index.js +16101 -7275
  97. package/dist/knob-embeddings.hash.json +3 -3
  98. package/dist/knob-embeddings.json +1309 -685
  99. package/dist/modules/anim.d.ts +1 -1
  100. package/dist/modules/array.d.ts +1 -1
  101. package/dist/modules/async.d.ts +1 -1
  102. package/dist/modules/behavior.d.ts +1 -1
  103. package/dist/modules/browser.d.ts +1 -1
  104. package/dist/modules/composition.d.ts +1 -1
  105. package/dist/modules/contract.d.ts +1 -1
  106. package/dist/modules/core.d.ts +1 -1
  107. package/dist/modules/core.js +29 -2
  108. package/dist/modules/data.d.ts +1 -1
  109. package/dist/modules/ease.d.ts +1 -1
  110. package/dist/modules/format.d.ts +1 -1
  111. package/dist/modules/geo.d.ts +1 -1
  112. package/dist/modules/graph.d.ts +1 -1
  113. package/dist/modules/grid.d.ts +1 -1
  114. package/dist/modules/i18n.d.ts +1 -1
  115. package/dist/modules/index.d.ts +1 -1
  116. package/dist/modules/index.js +29 -2
  117. package/dist/modules/integration.d.ts +1 -1
  118. package/dist/modules/json.d.ts +1 -1
  119. package/dist/modules/llm.d.ts +1 -1
  120. package/dist/modules/math.d.ts +1 -1
  121. package/dist/modules/memory.d.ts +1 -1
  122. package/dist/modules/nn.d.ts +1 -1
  123. package/dist/modules/noise.d.ts +1 -1
  124. package/dist/modules/object.d.ts +1 -1
  125. package/dist/modules/os.d.ts +1 -1
  126. package/dist/modules/path.d.ts +1 -1
  127. package/dist/modules/prob.d.ts +1 -1
  128. package/dist/modules/session.d.ts +1 -1
  129. package/dist/modules/str.d.ts +1 -1
  130. package/dist/modules/tensor.d.ts +1 -1
  131. package/dist/modules/time.d.ts +1 -1
  132. package/dist/modules/trace.d.ts +1 -1
  133. package/dist/modules/train.d.ts +1 -1
  134. package/dist/modules/validate.d.ts +1 -1
  135. package/dist/modules/vector.d.ts +1 -1
  136. package/dist/modules/workspace.d.ts +1 -1
  137. package/dist/registry/factory-signatures.json +1 -1
  138. package/dist/registry.d.ts +2 -2
  139. package/dist/registry.js +29 -2
  140. package/dist/{types-Cdb321uM.d.ts → types-Y-yYWEOX.d.ts} +1 -1
  141. package/i18n/ar.json +3 -1
  142. package/i18n/en.json +2 -0
  143. package/i18n/sl.json +3 -1
  144. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  app std-agent-tool-loop "2.0.0"
2
- "std-agent-tool-loop — answers a conversation by operating the running app as the caller, through `call-service llm call-tools`. Its `tools` are `{ scope: declared }` (every declared external input plus a read over every persisted entity), or named declared inputs (addressed like a listens source: `Trait.EVENT`, `Orbital.Trait.EVENT`) and entities to read; each input fires as the signed-in user through the ordinary dispatch (guards and entity policies apply) and each read returns only the rows the caller may read. Headless: the conversation UI (std-agent-session) shows the reply; a failure shows as a toast. CONVERSE carries the conversation (and optionally what std-agent-memory recalled); ASSISTANT_STEP carries each step live while it works (a model call, a tool it used, what the app answered) to the asking tab; ASSISTANT_REPLIED carries the reply, every step and the token usage; ASSISTANT_REPLY_FAILED carries the error. These names are the assistant contract std-agent-session's conversation hears from any orbital. Compose with std-agent-session (the conversation) and std-agent-trace (the step record)."
2
+ "std-agent-tool-loop — answers a conversation by operating the running app as the caller, through `call-service llm call-tools`. Its `tools` are `{ scope: declared }` (every declared external input plus a read over every persisted entity), or named declared inputs (addressed like a listens source: `Trait.EVENT`, `Orbital.Trait.EVENT`) and entities to read; each input fires as the signed-in user through the ordinary dispatch (guards and entity policies apply) and each read returns only the rows the caller may read. Headless: the conversation UI (std-agent-session) shows the reply; a failure shows as a toast, unless `quiet` is on (a background run nobody is watching: no live steps and no toast). CONVERSE carries the conversation (and optionally what std-agent-memory recalled); ASSISTANT_STEP carries each step live while it works (a model call, a tool it used, what the app answered) to the asking tab; ASSISTANT_REPLIED carries the reply, every step and the token usage; ASSISTANT_REPLY_FAILED carries the error. These names are the assistant contract std-agent-session's conversation hears from any orbital. Compose with std-agent-session (the conversation) and std-agent-trace (the step record)."
3
3
 
4
4
  type AgentTool = {
5
5
  event : event
@@ -63,6 +63,7 @@ orbital AgentToolLoopOrbital {
63
63
  status : "idle" | "thinking" | "answered" | "failed" @description "Where the current turn is." = idle
64
64
  reply : string @description "The last reply." = ""
65
65
  error : string @description "Why the last turn failed." = ""
66
+ ephemeral : boolean @description "The current turn belongs to an ephemeral conversation." = false
66
67
  }
67
68
 
68
69
  trait AgentToolLoop -> AgentTurn [interaction] {
@@ -81,33 +82,73 @@ orbital AgentToolLoopOrbital {
81
82
  @label "Model round-trips per request"
82
83
  @description "How many model calls one request may take before it fails."
83
84
  @tier "policy"
85
+ quiet : boolean = false
86
+ @label "Run in the background?"
87
+ @description "No live ASSISTANT_STEP stream and no failure toast: the request is reported only through ASSISTANT_REPLIED and ASSISTANT_REPLY_FAILED. For a run nobody is watching, such as one the app starts on its own."
88
+ @synonyms "silent, background, no toast, suppress errors, headless run"
89
+ @tier "policy"
90
+ cancelKey : string = "agent-tool-loop"
91
+ @label "Cancel key"
92
+ @description "The key this instance's model call runs under, so CANCEL aborts it. Give each instance of the loop in one app its own."
93
+ @synonyms "call key, abort key"
94
+ @tier "internal"
84
95
  }
85
96
  initial: idle
86
97
 
87
98
  state idle {
88
99
  INIT -> idle
89
100
  (set @entity.status idle)
90
- CONVERSE -> thinking
101
+ CONVERSE -> thinking when (and (not @config.quiet) (not ?ephemeral))
102
+ (set @entity.status thinking)
103
+ (set @entity.ephemeral false)
104
+ (call-service llm call-tools {
105
+ messages: ?messages
106
+ tools: @config.tools
107
+ instructions: (if ["=", (str/default ?context ""), ""] @config.instructions (str/concat @config.instructions "\n\nWhat you remember that may be relevant:\n" ?context))
108
+ maxSteps: @config.maxSteps
109
+ } {
110
+ key: @config.cancelKey, emit: { failure: ASK_FAILED, success: ANSWERED, onMessage: ASSISTANT_STEP }
111
+ })
112
+ CONVERSE -> thinking when (and @config.quiet (not ?ephemeral))
91
113
  (set @entity.status thinking)
114
+ (set @entity.ephemeral false)
92
115
  (call-service llm call-tools {
93
116
  messages: ?messages
94
117
  tools: @config.tools
95
118
  instructions: (if ["=", (str/default ?context ""), ""] @config.instructions (str/concat @config.instructions "\n\nWhat you remember that may be relevant:\n" ?context))
96
119
  maxSteps: @config.maxSteps
97
120
  } {
98
- emit: { failure: ASK_FAILED, success: ANSWERED, onMessage: ASSISTANT_STEP }
121
+ key: @config.cancelKey, emit: { failure: ASK_FAILED, success: ANSWERED }
122
+ })
123
+ CONVERSE -> thinking when ?ephemeral
124
+ (set @entity.status thinking)
125
+ (set @entity.ephemeral true)
126
+ (call-service llm call-tools {
127
+ messages: ?messages
128
+ tools: (object/get ? tools [])
129
+ instructions: (if ["=", (str/default ?instructions ""), ""] @config.instructions ?instructions)
130
+ maxSteps: @config.maxSteps
131
+ } {
132
+ key: @config.cancelKey, emit: { failure: ASK_FAILED, success: ANSWERED }
99
133
  })
100
134
  }
101
135
 
102
136
  state thinking {
137
+ CANCEL -> idle
138
+ (cancel-call @config.cancelKey)
139
+ (set @entity.status idle)
103
140
  ANSWERED -> idle
104
141
  (set @entity.status answered)
105
142
  (set @entity.reply ?reply)
106
- (emit ASSISTANT_REPLIED { reply: ?reply, steps: ?steps, usage: ?usage })
107
- ASK_FAILED -> idle
143
+ (emit ASSISTANT_REPLIED { reply: ?reply, steps: ?steps, usage: ?usage, ephemeral: @entity.ephemeral })
144
+ ASK_FAILED -> idle when (or @config.quiet @entity.ephemeral)
108
145
  (set @entity.status failed)
109
146
  (set @entity.error ?error)
110
- (emit ASSISTANT_REPLY_FAILED { error: ?error })
147
+ (emit ASSISTANT_REPLY_FAILED { error: ?error, ephemeral: @entity.ephemeral })
148
+ ASK_FAILED -> idle when (and (not @config.quiet) (not @entity.ephemeral))
149
+ (set @entity.status failed)
150
+ (set @entity.error ?error)
151
+ (emit ASSISTANT_REPLY_FAILED { error: ?error, ephemeral: @entity.ephemeral })
111
152
  (render-ui toast {
112
153
  message: ?error
113
154
  type: alert
@@ -126,12 +167,14 @@ orbital AgentToolLoopOrbital {
126
167
  reply : string!
127
168
  steps : [AgentActivity]!
128
169
  usage : AgentUsage!
170
+ ephemeral : boolean
129
171
  }
130
- @description "The assistant answered; carries every tool step it took and the tokens it used."
172
+ @description "The assistant answered; carries every tool step it took and the tokens it used. `ephemeral` echoes the conversation's: an ephemeral reply is not stored or remembered, and only an ephemeral conversation shows it."
131
173
  @synonyms "answered, responded, done"
132
174
  @tier "domain"
133
175
  ASSISTANT_REPLY_FAILED -> external {
134
176
  error : string!
177
+ ephemeral : boolean
135
178
  }
136
179
  @description "The assistant could not answer (model unavailable, or out of steps)."
137
180
  @synonyms "failed, error, gave up"
@@ -149,11 +192,18 @@ orbital AgentToolLoopOrbital {
149
192
  }
150
193
 
151
194
  listens {
195
+ CANCEL {
196
+ }
197
+ @description "Abort the request in flight; nothing is replied and no failure is reported."
198
+ @synonyms "stop, abort, cancel"
152
199
  CONVERSE {
153
200
  messages : [AgentChatMessage]!
154
201
  context : string
202
+ instructions : string
203
+ tools : [AgentTool]
204
+ ephemeral : boolean
155
205
  }
156
- @description "Answer this conversation; the last turn is the request. `context` is what the assistant remembers that may be relevant."
206
+ @description "Answer this conversation; the last turn is the request. `context` is what the assistant remembers that may be relevant. An `ephemeral` conversation runs under its own `instructions` (empty: the configured ones) and exactly its own `tools` (absent or `[]`: none, never the configured ones), streams no live steps and shows no failure toast."
157
207
  @synonyms "ask, chat, request"
158
208
  }
159
209
  }
@@ -110,6 +110,7 @@ orbital AgentAssistantOrbital {
110
110
  }
111
111
  listens {
112
112
  AssistantThread.REQUEST_CONTEXT -> COMPACT
113
+ *.ASSISTANT_EPHEMERAL_SEND -> COMPACT
113
114
  }
114
115
  }
115
116
 
@@ -6,6 +6,8 @@ orbital PageSearchOrbital {
6
6
  selector : string
7
7
  attr : string
8
8
  resolve : boolean
9
+ template : string
10
+ required : boolean
9
11
  }
10
12
 
11
13
  type PageResult = {
@@ -51,7 +53,7 @@ orbital PageSearchOrbital {
51
53
  @tier "domain"
52
54
  fields : Map string PageField = {}
53
55
  @label "Fields"
54
- @description "Field name to how to read it from each result: `selector` (a descendant; absent reads the result itself), `attr` (an attribute; absent reads the text) and `resolve` (the attribute is a URL: return it absolute)"
56
+ @description "Field name to how to read it from each result: `selector` (a descendant; absent reads the result itself), `attr` (an attribute; absent reads the text) , `resolve` (the value is a URL: return it absolute), `template` (compose the value from other fields, `{name}` per field; empty when any is empty) and `required` (leave the result out until this field reads non-empty)"
55
57
  @synonyms "columns, properties, extract"
56
58
  @tier "domain"
57
59
  maxResults : number = 10
@@ -1,7 +1,19 @@
1
1
  app std-page-treat "1.0.0"
2
- "std-page-treat — applies a declared visual treatment to one element of a browser tab (hide, blur, highlight, or label it with text) or restores it, and reports which element it treated. TREAT takes the tab and element id std-page-watch reports. The treatments are a fixed, declared set: no arbitrary styles or scripts. Needs a host with the `page` service (a browser extension)."
2
+ "std-page-treat — applies a declared visual treatment to one element of a browser tab (hide, blur, highlight, or label it with text) or restores it, and reports which element it treated. TREAT takes the tab and element id std-page-watch reports; TREAT_MANY treats a whole list at once and reports which elements were treated and which had already left their page. The treatments are a fixed, declared set: no arbitrary styles or scripts. Needs a host with the `page` service (a browser extension)."
3
3
 
4
4
  orbital PageTreatOrbital {
5
+ type PageTreatment = {
6
+ tab : number!
7
+ elementId : string!
8
+ treatment : "hide" | "blur" | "highlight" | "label" | "restore"
9
+ label : string
10
+ }
11
+
12
+ type PageElementRef = {
13
+ tab : number!
14
+ elementId : string!
15
+ }
16
+
5
17
  entity PageTreatRecord [runtime] {
6
18
  treated : number @description "How many treatments were applied" @synonyms "count, applied" = 0
7
19
  errorMessage : string @description "Why the last treatment failed; blank = none" @synonyms "error, failure reason" = ""
@@ -27,6 +39,12 @@ orbital PageTreatOrbital {
27
39
  APPLIED -> ready
28
40
  (set @entity.treated (+ @entity.treated 1))
29
41
  (emit TREATED { tab: ?tab, elementId: ?elementId, treatment: ?treatment })
42
+ TREAT_MANY -> ready
43
+ (call-service "page" "applyMany" { items: ?items }
44
+ { emit: { success: APPLIED_MANY, failure: APPLY_FAILED } })
45
+ APPLIED_MANY -> ready
46
+ (set @entity.treated (+ @entity.treated (array/len ?applied)))
47
+ (emit TREATED_MANY { applied: ?applied, missing: ?missing })
30
48
  APPLY_FAILED -> ready
31
49
  (set @entity.errorMessage ?error)
32
50
  (emit TREAT_FAILED { error: ?error })
@@ -37,6 +55,9 @@ orbital PageTreatOrbital {
37
55
  APPLIED { applied : boolean!, tab : number!, elementId : string!, treatment : "hide" | "blur" | "highlight" | "label" | "restore" }
38
56
  @description "The page service applied the treatment"
39
57
  @tier "secondary"
58
+ APPLIED_MANY { applied : [PageElementRef], missing : [PageElementRef] }
59
+ @description "The page service applied a list of treatments"
60
+ @tier "secondary"
40
61
  APPLY_FAILED { error : string! }
41
62
  @description "The page service could not apply the treatment"
42
63
  @tier "secondary"
@@ -44,6 +65,10 @@ orbital PageTreatOrbital {
44
65
  @description "The element now shows the treatment (or, for restore, is back as it was)"
45
66
  @synonyms "hidden, blurred, highlighted, labelled, restored"
46
67
  @tier "primary"
68
+ TREATED_MANY -> external { applied : [PageElementRef], missing : [PageElementRef] }
69
+ @description "Each listed element now shows its treatment; `missing` lists those that had left their page (or whose tab closed)"
70
+ @synonyms "hidden, blurred, restored, treated"
71
+ @tier "primary"
47
72
  TREAT_FAILED -> external { error : string! }
48
73
  @description "The treatment could not be applied (the element is gone, or the tab closed)"
49
74
  @tier "primary"
@@ -52,6 +77,8 @@ orbital PageTreatOrbital {
52
77
  listens {
53
78
  TREAT -> external { tab : number!, elementId : string!, treatment : "hide" | "blur" | "highlight" | "label" | "restore", label : string }
54
79
  @description "Treat one page element; `label` is the text shown with it (for example why it was hidden)"
80
+ TREAT_MANY -> external { items : [PageTreatment] }
81
+ @description "Treat a list of page elements in one call, each with its own treatment and label"
55
82
  }
56
83
  }
57
84
 
@@ -6,6 +6,8 @@ orbital PageWatchOrbital {
6
6
  selector : string
7
7
  attr : string
8
8
  resolve : boolean
9
+ template : string
10
+ required : boolean
9
11
  }
10
12
 
11
13
  entity PageWatchRecord [runtime] {
@@ -36,7 +38,7 @@ orbital PageWatchOrbital {
36
38
  @tier "domain"
37
39
  fields : Map string PageField = {}
38
40
  @label "Fields"
39
- @description "Field name to how to read it from each element: `selector` (a descendant; absent reads the element itself), `attr` (an attribute; absent reads the text) and `resolve` (the attribute is a URL: return it absolute)"
41
+ @description "Field name to how to read it from each element: `selector` (a descendant; absent reads the element itself), `attr` (an attribute; absent reads the text) , `resolve` (the value is a URL: return it absolute), `template` (compose the value from other fields, `{name}` per field; empty when any is empty) and `required` (leave the element out until this field reads non-empty — a placeholder is reported once it fills in)"
40
42
  @synonyms "columns, properties, extract, read"
41
43
  @tier "domain"
42
44
  itemEvent : event = "PageWatch.ITEM_FOUND"
@@ -27,6 +27,23 @@ orbital AvlStateMachineOrbital {
27
27
  type : string!
28
28
  args : [SExpr]!
29
29
  }
30
+ type AvlStateMachineAnnotations = {
31
+ states : Map string AvlStateMachineAnnotationsStatesValue
32
+ transitions : Map string AvlStateMachineAnnotationsTransitionsValue
33
+ effects : Map string AvlStateMachineAnnotationsEffectsValue
34
+ }
35
+ type AvlStateMachineAnnotationsStatesValue = {
36
+ title : string
37
+ body : string!
38
+ }
39
+ type AvlStateMachineAnnotationsTransitionsValue = {
40
+ title : string
41
+ body : string!
42
+ }
43
+ type AvlStateMachineAnnotationsEffectsValue = {
44
+ title : string
45
+ body : string!
46
+ }
30
47
  type AvlStateMachineTRANSITIONCLICKTransition = {
31
48
  index : number!
32
49
  event : string!
@@ -57,6 +74,7 @@ orbital AvlStateMachineOrbital {
57
74
  entityFields: @config.entityFields
58
75
  direction: @config.direction
59
76
  showHeader: @config.showHeader
77
+ annotations: @config.annotations
60
78
  className: @config.className
61
79
  enter: @config.enter
62
80
  enterDelay: @config.enterDelay
@@ -150,6 +168,10 @@ orbital AvlStateMachineOrbital {
150
168
  @label "Show Header"
151
169
  @description "Show the trait header (name, entity, listens/emits). @default true"
152
170
  @tier "presentation"
171
+ annotations : AvlStateMachineAnnotations = { states: { pending: { title: "Unpaid", body: "Every order starts here." } }, transitions: { PAY: { body: "Only fires when the amount is positive." } }, effects: { persist: { body: "Saves the order." } } }
172
+ @label "Annotations"
173
+ @description "Author explanations shown in a popover on hover: a note per state name, per transition event and per effect type."
174
+ @tier "presentation"
153
175
  className : string
154
176
  @label "Class Name"
155
177
  @description "className prop"
@@ -0,0 +1,175 @@
1
+ app ui-avl-transition-explainer "1.0.0"
2
+ "One transition explained step by step: from-state, event and to-state, the guard that must hold, and each effect it runs in order. — UI factory (1:1 with the @almadar/ui avl-transition-explainer pattern)."
3
+ ;; @capabilities "transition explainer, event guard effects walkthrough, what happens when an event fires"
4
+ ;; @pattern "avl-transition-explainer"
5
+ orbital AvlTransitionExplainerOrbital {
6
+ type AvlTransitionExplainerTransition = {
7
+ from : string!
8
+ to : string!
9
+ event : string!
10
+ guard : SExpr
11
+ effects : [AvlTransitionExplainerTransitionEffectsItem]!
12
+ index : number!
13
+ }
14
+ type AvlTransitionExplainerTransitionEffectsItem = {
15
+ type : string!
16
+ args : [SExpr]!
17
+ }
18
+ type AvlTransitionExplainerAnnotations = {
19
+ states : Map string AvlTransitionExplainerAnnotationsStatesValue
20
+ transitions : Map string AvlTransitionExplainerAnnotationsTransitionsValue
21
+ effects : Map string AvlTransitionExplainerAnnotationsEffectsValue
22
+ }
23
+ type AvlTransitionExplainerAnnotationsStatesValue = {
24
+ title : string
25
+ body : string!
26
+ }
27
+ type AvlTransitionExplainerAnnotationsTransitionsValue = {
28
+ title : string
29
+ body : string!
30
+ }
31
+ type AvlTransitionExplainerAnnotationsEffectsValue = {
32
+ title : string
33
+ body : string!
34
+ }
35
+
36
+ entity AvlTransitionExplainerItem [runtime] {
37
+ id : string!
38
+ }
39
+
40
+ trait AvlTransitionExplainerRender -> @rebindable AvlTransitionExplainerItem [interaction, instance] {
41
+ initial: idle
42
+
43
+ state idle {
44
+ INIT -> idle
45
+ (render-ui main {
46
+ orbitalName: @config.orbitalName
47
+ traitName: @config.traitName
48
+ transition: @config.transition
49
+ annotations: @config.annotations
50
+ className: @config.className
51
+ enter: @config.enter
52
+ enterDelay: @config.enterDelay
53
+ skeleton: @config.skeleton
54
+ aria-label: @config.ariaLabel
55
+ aria-labelledby: @config.ariaLabelledby
56
+ aria-describedby: @config.ariaDescribedby
57
+ aria-live: @config.ariaLive
58
+ aria-current: @config.ariaCurrent
59
+ aria-pressed: @config.ariaPressed
60
+ aria-expanded: @config.ariaExpanded
61
+ aria-selected: @config.ariaSelected
62
+ aria-hidden: @config.ariaHidden
63
+ aria-busy: @config.ariaBusy
64
+ role: @config.role
65
+ lang: @config.lang
66
+ dir: @config.dir
67
+ tabIndex: @config.tabIndex
68
+ type: avl-transition-explainer
69
+ })
70
+ }
71
+
72
+ config {
73
+ orbitalName : string = ""
74
+ @label "Orbital Name"
75
+ @description "Orbital the transition belongs to."
76
+ @tier "presentation"
77
+ traitName : string = ""
78
+ @label "Trait Name"
79
+ @description "Trait the transition belongs to."
80
+ @tier "presentation"
81
+ transition : AvlTransitionExplainerTransition = { from: "pending", to: "paid", event: "PAY", effects: [{ type: "set", args: [] }, { type: "persist", args: [] }], index: 0 }
82
+ @label "Transition"
83
+ @description "The transition to explain."
84
+ @tier "presentation"
85
+ annotations : AvlTransitionExplainerAnnotations = { transitions: { PAY: { title: "Paying", body: "The customer pays the order total." } }, effects: { persist: { body: "Saves the order." } } }
86
+ @label "Annotations"
87
+ @description "Author explanations shown in a popover on hover: the event's note and per-effect-type notes."
88
+ @tier "presentation"
89
+ className : string
90
+ @label "Class Name"
91
+ @description "className prop"
92
+ @tier "presentation"
93
+ enter : "none" | "fade" | "rise" | "scale" | "slide"
94
+ @label "Enter"
95
+ @description "How this element animates in when it mounts (theme-styled); overrides the theme's default slot entry. `none` opts out."
96
+ @tier "presentation"
97
+ enterDelay : number
98
+ @label "Enter Delay"
99
+ @description "Stagger step for the entry: waits this many `--motion-enter-stagger` steps before animating."
100
+ @tier "presentation"
101
+ skeleton : "header" | "table" | "list" | "grid" | "detail" | "stats" | "form" | "card" | "text" | "none"
102
+ @label "Skeleton"
103
+ @description "Skeleton shown while this element's server render is in flight: a shape (`table`, `list`, …), `{ variant, rows?, columns?, fields? }`, or `none`."
104
+ @tier "presentation"
105
+ ariaLabel : string
106
+ @label "Aria-label"
107
+ @description "Accessible name read by screen readers when the visible text is missing or not descriptive (e.g. an icon-only control)."
108
+ @synonyms "aria-label"
109
+ @tier "presentation"
110
+ ariaLabelledby : string
111
+ @label "Aria-labelledby"
112
+ @description "Id of the element whose text names this one."
113
+ @synonyms "aria-labelledby"
114
+ @tier "presentation"
115
+ ariaDescribedby : string
116
+ @label "Aria-describedby"
117
+ @description "Id of the element whose text describes this one (help text, error)."
118
+ @synonyms "aria-describedby"
119
+ @tier "presentation"
120
+ ariaLive : "off" | "polite" | "assertive"
121
+ @label "Aria-live"
122
+ @description "Announce changes to this region: polite waits for a pause, assertive interrupts."
123
+ @synonyms "aria-live"
124
+ @tier "presentation"
125
+ ariaCurrent : "page" | "step" | "location" | "date" | "time" | "true" | "false"
126
+ @label "Aria-current"
127
+ @description "Marks the current item in a set: the current page, step, location, date or time."
128
+ @synonyms "aria-current"
129
+ @tier "presentation"
130
+ ariaPressed : "true" | "false" | "mixed"
131
+ @label "Aria-pressed"
132
+ @description "Toggle-button state."
133
+ @synonyms "aria-pressed"
134
+ @tier "presentation"
135
+ ariaExpanded : boolean
136
+ @label "Aria-expanded"
137
+ @description "Whether the element it controls is expanded."
138
+ @synonyms "aria-expanded"
139
+ @tier "presentation"
140
+ ariaSelected : boolean
141
+ @label "Aria-selected"
142
+ @description "Whether this item is selected (tabs, options, grid cells)."
143
+ @synonyms "aria-selected"
144
+ @tier "presentation"
145
+ ariaHidden : boolean
146
+ @label "Aria-hidden"
147
+ @description "Hide from assistive technology (decorative content only)."
148
+ @synonyms "aria-hidden"
149
+ @tier "presentation"
150
+ ariaBusy : boolean
151
+ @label "Aria-busy"
152
+ @description "This region is updating; assistive technology waits before announcing it."
153
+ @synonyms "aria-busy"
154
+ @tier "presentation"
155
+ role : "alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "meter" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem"
156
+ @label "Role"
157
+ @description "WAI-ARIA role when the element's native semantics don't describe it."
158
+ @tier "presentation"
159
+ lang : string
160
+ @label "Lang"
161
+ @description "Language of this element's content (BCP 47, e.g. ar, sl, en)."
162
+ @tier "presentation"
163
+ dir : "ltr" | "rtl" | "auto"
164
+ @label "Dir"
165
+ @description "Text direction of this element's content."
166
+ @tier "presentation"
167
+ tabIndex : number
168
+ @label "Tab Index"
169
+ @description "0 puts the element in the Tab order; -1 makes it focusable only programmatically."
170
+ @tier "presentation"
171
+ }
172
+ }
173
+
174
+ page "/avl-transition-explainer" as AvlTransitionExplainerPage -> AvlTransitionExplainerRender
175
+ }
@@ -61,6 +61,23 @@ orbital ModuleCardOrbital {
61
61
  direction : string!
62
62
  traitName : string!
63
63
  }
64
+ type ModuleCardAnnotationsValue = {
65
+ states : Map string ModuleCardAnnotationsValueStatesValue
66
+ transitions : Map string ModuleCardAnnotationsValueTransitionsValue
67
+ effects : Map string ModuleCardAnnotationsValueEffectsValue
68
+ }
69
+ type ModuleCardAnnotationsValueStatesValue = {
70
+ title : string
71
+ body : string!
72
+ }
73
+ type ModuleCardAnnotationsValueTransitionsValue = {
74
+ title : string
75
+ body : string!
76
+ }
77
+ type ModuleCardAnnotationsValueEffectsValue = {
78
+ title : string
79
+ body : string!
80
+ }
64
81
 
65
82
  entity ModuleCardItem [runtime] {
66
83
  id : string!
@@ -73,6 +90,7 @@ orbital ModuleCardOrbital {
73
90
  INIT -> idle
74
91
  (render-ui main {
75
92
  data: @config.data
93
+ annotations: @config.annotations
76
94
  aria-label: @config.ariaLabel
77
95
  aria-labelledby: @config.ariaLabelledby
78
96
  aria-describedby: @config.ariaDescribedby
@@ -96,6 +114,10 @@ orbital ModuleCardOrbital {
96
114
  @label "Data"
97
115
  @description "The orbital to summarize."
98
116
  @tier "presentation"
117
+ annotations : Map string ModuleCardAnnotationsValue = { item: {} }
118
+ @label "Annotations"
119
+ @description "Author explanations per trait name (states, transition events, effect types), shown in a popover on hover."
120
+ @tier "presentation"
99
121
  ariaLabel : string
100
122
  @label "Aria-label"
101
123
  @description "Accessible name read by screen readers when the visible text is missing or not descriptive (e.g. an icon-only control)."
@@ -28,6 +28,7 @@ orbital AppLayoutOrbital {
28
28
  type: box
29
29
  children: [{
30
30
  appName: @config.appName
31
+ logo: (if (== @config.logoSrc "") null { type: image, src: @config.logoSrc, alt: "", fit: contain, className: "h-8 w-8" })
31
32
  children: [{
32
33
  children: [@config.contentTrait]
33
34
  className: @config.contentClassName
@@ -40,7 +41,8 @@ orbital AppLayoutOrbital {
40
41
  navItems: (array/map (array/filter @config.navItems (fn item (or (= (array/len (object/get @item roles [])) 0) (array/includes (object/get @item roles []) @config.viewerRole)))) (fn item (if (object/has @item children) (object/merge @item { children: (array/filter (object/get @item children []) (fn child (or (= (array/len (object/get @child roles [])) 0) (array/includes (object/get @child roles []) @config.viewerRole)))) }) @item)))
41
42
  notificationClickEvent: @config.notificationClickEvent
42
43
  notifications: @config.notifications
43
- searchEvent: @config.searchEvent
44
+ searchEvent: (if @config.showSearch @config.searchEvent null)
45
+ showThemeToggle: @config.showThemeToggle
44
46
  sidebarContent: @config.sidebarTrait
45
47
  topBarActions: (array/filter @config.topBarActions (fn action (or (= (array/len (object/get @action roles [])) 0) (array/includes (object/get @action roles []) @config.viewerRole))))
46
48
  type: @config.layoutPattern
@@ -58,6 +60,7 @@ orbital AppLayoutOrbital {
58
60
  type: box
59
61
  children: [{
60
62
  appName: @config.appName
63
+ logo: (if (== @config.logoSrc "") null { type: image, src: @config.logoSrc, alt: "", fit: contain, className: "h-8 w-8" })
61
64
  children: [{
62
65
  children: [{
63
66
  description: @config.accessDeniedDescription
@@ -75,7 +78,8 @@ orbital AppLayoutOrbital {
75
78
  navItems: (array/map (array/filter @config.navItems (fn item (or (= (array/len (object/get @item roles [])) 0) (array/includes (object/get @item roles []) @config.viewerRole)))) (fn item (if (object/has @item children) (object/merge @item { children: (array/filter (object/get @item children []) (fn child (or (= (array/len (object/get @child roles [])) 0) (array/includes (object/get @child roles []) @config.viewerRole)))) }) @item)))
76
79
  notificationClickEvent: @config.notificationClickEvent
77
80
  notifications: @config.notifications
78
- searchEvent: @config.searchEvent
81
+ searchEvent: (if @config.showSearch @config.searchEvent null)
82
+ showThemeToggle: @config.showThemeToggle
79
83
  sidebarContent: @config.sidebarTrait
80
84
  topBarActions: (array/filter @config.topBarActions (fn action (or (= (array/len (object/get @action roles [])) 0) (array/includes (object/get @action roles []) @config.viewerRole))))
81
85
  type: @config.layoutPattern
@@ -137,6 +141,11 @@ orbital AppLayoutOrbital {
137
141
  @description "Name shown in the top-left of the chrome header."
138
142
  @synonyms "app title, product name, brand name, application name, site name"
139
143
  @tier "presentation"
144
+ logoSrc : string = ""
145
+ @label "Logo image"
146
+ @description "Address of the logo shown beside the app name in the chrome header (an image URL or an inline data: SVG); empty shows the name's first letter."
147
+ @synonyms "logo, brand mark, app icon, logo url"
148
+ @tier "presentation"
140
149
  viewerName : string = ""
141
150
  @label "Who is signed in"
142
151
  @description "Display name of the signed-in viewer, shown in the app bar's account menu — typically @user.name. Blank renders no account menu, so people can see which account (and which persona) they are viewing the app as only when it is actually known."
@@ -159,6 +168,16 @@ orbital AppLayoutOrbital {
159
168
  @label "Search event"
160
169
  @description "Event emitted when the user runs a global search"
161
170
  @tier "internal"
171
+ showSearch : boolean = true
172
+ @label "Show the search box?"
173
+ @description "The top-bar search box; turn off for apps whose pages carry their own search."
174
+ @synonyms "search bar, top search, hide search"
175
+ @tier "presentation"
176
+ showThemeToggle : boolean = true
177
+ @label "Show the light/dark toggle?"
178
+ @description "The theme toggle in the top bar; turn off when the app offers it elsewhere, such as a settings page."
179
+ @synonyms "dark mode button, theme switch, hide theme toggle"
180
+ @tier "presentation"
162
181
  topBarActions : [ItemAction] = []
163
182
  @label "What shortcuts go in the top bar?"
164
183
  @description "Icon buttons shown on the right side of the top bar (e.g. cart, help, profile)."
@@ -177,9 +196,9 @@ orbital AppLayoutOrbital {
177
196
  @label "Layout pattern"
178
197
  @description "UI pattern used to render the application chrome"
179
198
  @tier "internal"
180
- layoutMode : "sidebar" | "topnav" | "bottomnav" | "minimal" = sidebar
199
+ layoutMode : "sidebar" | "topnav" | "bottomnav" | "minimal" | "drawer" = sidebar
181
200
  @label "Where should navigation be placed?"
182
- @description "sidebar = left rail; topnav = top bar; bottomnav = mobile tab bar; minimal = no nav."
201
+ @description "sidebar = left rail; topnav = top bar; bottomnav = mobile tab bar; minimal = no nav; drawer = navigation behind a menu button at every width, content full width."
183
202
  @synonyms "nav position, navigation style, menu placement, layout style"
184
203
  @tier "presentation"
185
204
  currentPath : string = ""