@almadar/std 16.241.0 → 16.243.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 (109) hide show
  1. package/behaviors/behaviors-registry.json +4650 -535
  2. package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +38 -1
  3. package/behaviors/lolo/agent/atoms/std-agent-session.lolo +1074 -47
  4. package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +8 -7
  5. package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +56 -37
  6. package/behaviors/lolo/infra/atoms/std-page-open.lolo +59 -0
  7. package/behaviors/lolo/infra/atoms/std-page-search.lolo +136 -0
  8. package/behaviors/lolo/infra/atoms/std-page-treat.lolo +59 -0
  9. package/behaviors/lolo/infra/atoms/std-page-watch.lolo +88 -0
  10. package/behaviors/lolo/ui/core/atoms/std-book-reader.lolo +25 -1
  11. package/behaviors/lolo/ui/core/atoms/std-card-grid.lolo +9 -0
  12. package/behaviors/lolo/ui/core/atoms/std-doc-page.lolo +153 -0
  13. package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +124 -92
  14. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +114 -55
  15. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +40 -14
  16. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +363 -123
  17. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +93 -48
  18. package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +60 -28
  19. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +193 -96
  20. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +75 -32
  21. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +142 -86
  22. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +266 -98
  23. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +103 -65
  24. package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +223 -109
  25. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +232 -64
  26. package/behaviors/lolo/ui/learning/atoms/std-learn-param-explorer.lolo +69 -29
  27. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +363 -123
  28. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +73 -41
  29. package/behaviors/lolo/ui/learning/atoms/std-learn-sample-accumulator.lolo +96 -38
  30. package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +65 -45
  31. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +243 -117
  32. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +76 -28
  33. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +228 -109
  34. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +95 -44
  35. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +199 -125
  36. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +92 -48
  37. package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +239 -78
  38. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +147 -38
  39. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +123 -58
  40. package/behaviors/lolo/ui/learning/atoms/ui-algo-graph-canvas.lolo +22 -0
  41. package/behaviors/lolo/ui/learning/atoms/ui-algorithm-canvas.lolo +26 -0
  42. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +26 -0
  43. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +27 -1
  44. package/behaviors/lolo/ui/learning/atoms/ui-learning-canvas.lolo +27 -1
  45. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +29 -9
  46. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +26 -0
  47. package/behaviors/lolo-behavior-contracts.json +1 -1
  48. package/behaviors/registry/agent/atoms/std-agent-memory.orb +372 -2
  49. package/behaviors/registry/agent/atoms/std-agent-session.orb +4752 -348
  50. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +54 -42
  51. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +356 -122
  52. package/behaviors/registry/factory-signatures.json +1 -1
  53. package/behaviors/registry/infra/atoms/std-page-open.orb +435 -0
  54. package/behaviors/registry/infra/atoms/std-page-search.orb +885 -0
  55. package/behaviors/registry/infra/atoms/std-page-treat.orb +494 -0
  56. package/behaviors/registry/infra/atoms/std-page-watch.orb +572 -0
  57. package/behaviors/registry/ui/core/atoms/std-book-reader.orb +119 -0
  58. package/behaviors/registry/ui/core/atoms/std-card-grid.orb +61 -0
  59. package/behaviors/registry/ui/core/atoms/std-doc-page.orb +594 -0
  60. package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +903 -369
  61. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1002 -232
  62. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +253 -74
  63. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3624 -921
  64. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +685 -144
  65. package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +404 -52
  66. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +1787 -210
  67. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +699 -71
  68. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +1102 -578
  69. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +2760 -872
  70. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +689 -152
  71. package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +1431 -633
  72. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +2485 -512
  73. package/behaviors/registry/ui/learning/atoms/std-learn-param-explorer.orb +501 -197
  74. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +3642 -928
  75. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +705 -125
  76. package/behaviors/registry/ui/learning/atoms/std-learn-sample-accumulator.orb +624 -114
  77. package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +405 -153
  78. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1911 -611
  79. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +436 -128
  80. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +2482 -485
  81. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +896 -192
  82. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +2001 -759
  83. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +734 -228
  84. package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +2501 -764
  85. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +1591 -173
  86. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +883 -122
  87. package/behaviors/registry/ui/learning/atoms/ui-algo-graph-canvas.orb +176 -0
  88. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +211 -0
  89. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +211 -0
  90. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +212 -1
  91. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +212 -1
  92. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +203 -9
  93. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +211 -0
  94. package/behaviors/signatures.lolo +325 -655
  95. package/dist/behaviors/exports-reader.js +16092 -9747
  96. package/dist/behaviors/functions/index.d.ts +1052 -136
  97. package/dist/behaviors/functions/index.js +16063 -9745
  98. package/dist/behaviors/index.d.ts +1 -1
  99. package/dist/behaviors/index.js +16093 -9748
  100. package/dist/behaviors/query.js +16092 -9747
  101. package/dist/behaviors-embeddings.hash.json +3 -3
  102. package/dist/behaviors-embeddings.json +45 -25
  103. package/dist/behaviors-registry.json +4650 -535
  104. package/dist/index.d.ts +1 -1
  105. package/dist/index.js +16093 -9748
  106. package/dist/knob-embeddings.hash.json +3 -3
  107. package/dist/knob-embeddings.json +607 -263
  108. package/dist/registry/factory-signatures.json +1 -1
  109. package/package.json +3 -3
@@ -0,0 +1,885 @@
1
+ {
2
+ "description": "std-page-search — runs one search on a site in a background tab: opens `searchUrl` with the query as the `queryParam` parameter, reads up to `maxResults` elements matching `resultSelector` (waiting up to `waitMs` for the results to appear), closes the tab, and reports RESULTS with the fields read from each. One search at a time: SEARCH is accepted again once RESULTS or SEARCH_FAILED is reported. It never clicks anything. Needs a host with the `page` service (a browser extension with access to the search pages).",
3
+ "ledger": {
4
+ "entries": {
5
+ "ent_01M431PMYFFV3AXQCTDF8PDBSK": {
6
+ "bakedName": "PageSearchRecord",
7
+ "curName": "PageSearchRecord",
8
+ "id": "ent_01M431PMYFFV3AXQCTDF8PDBSK",
9
+ "kind": "entity",
10
+ "owner": "workspace",
11
+ "renames": []
12
+ },
13
+ "evt_01M431PMYF0GMPGSCESN3GPAVD": {
14
+ "bakedName": "TAB_OPENED",
15
+ "curName": "TAB_OPENED",
16
+ "id": "evt_01M431PMYF0GMPGSCESN3GPAVD",
17
+ "kind": "event",
18
+ "owner": "workspace",
19
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
20
+ "renames": []
21
+ },
22
+ "evt_01M431PMYF3XJS2JVHD73VS0NB": {
23
+ "bakedName": "RESULTS_READ",
24
+ "curName": "RESULTS_READ",
25
+ "id": "evt_01M431PMYF3XJS2JVHD73VS0NB",
26
+ "kind": "event",
27
+ "owner": "workspace",
28
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
29
+ "renames": []
30
+ },
31
+ "evt_01M431PMYF43RSRVDHQVS7T6ZS": {
32
+ "bakedName": "SEARCH",
33
+ "curName": "SEARCH",
34
+ "id": "evt_01M431PMYF43RSRVDHQVS7T6ZS",
35
+ "kind": "event",
36
+ "owner": "workspace",
37
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
38
+ "renames": []
39
+ },
40
+ "evt_01M431PMYF7T08MQPSJ2EHXT1V": {
41
+ "bakedName": "SEARCH_FAILED",
42
+ "curName": "SEARCH_FAILED",
43
+ "id": "evt_01M431PMYF7T08MQPSJ2EHXT1V",
44
+ "kind": "event",
45
+ "owner": "workspace",
46
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
47
+ "renames": []
48
+ },
49
+ "evt_01M431PMYFFDAVS6XHWBM6PMK7": {
50
+ "bakedName": "SEARCH_CALL_FAILED",
51
+ "curName": "SEARCH_CALL_FAILED",
52
+ "id": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
53
+ "kind": "event",
54
+ "owner": "workspace",
55
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
56
+ "renames": []
57
+ },
58
+ "evt_01M431PMYFGR7XGF0Q8JMF1QK9": {
59
+ "bakedName": "RESULTS",
60
+ "curName": "RESULTS",
61
+ "id": "evt_01M431PMYFGR7XGF0Q8JMF1QK9",
62
+ "kind": "event",
63
+ "owner": "workspace",
64
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
65
+ "renames": []
66
+ },
67
+ "evt_01M431PMYFM6PAHXRH26X3ABMC": {
68
+ "bakedName": "INIT",
69
+ "curName": "INIT",
70
+ "id": "evt_01M431PMYFM6PAHXRH26X3ABMC",
71
+ "kind": "event",
72
+ "owner": "workspace",
73
+ "parent": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
74
+ "renames": []
75
+ },
76
+ "orb_01M431PMYFFWS5D4TGQ03C461C": {
77
+ "bakedName": "PageSearchOrbital",
78
+ "curName": "PageSearchOrbital",
79
+ "id": "orb_01M431PMYFFWS5D4TGQ03C461C",
80
+ "kind": "orbital",
81
+ "owner": "workspace",
82
+ "renames": []
83
+ },
84
+ "pag_01M431PMYFKQD11Q93ASZHEM7A": {
85
+ "bakedName": "PageSearchPage",
86
+ "curName": "PageSearchPage",
87
+ "id": "pag_01M431PMYFKQD11Q93ASZHEM7A",
88
+ "kind": "page",
89
+ "owner": "workspace",
90
+ "renames": []
91
+ },
92
+ "trt_01M431PMYFCQ3KGNQ8M6PR63XH": {
93
+ "bakedName": "PageSearch",
94
+ "curName": "PageSearch",
95
+ "id": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
96
+ "kind": "trait",
97
+ "owner": "workspace",
98
+ "renames": []
99
+ }
100
+ },
101
+ "schemaVersion": 1
102
+ },
103
+ "name": "std-page-search",
104
+ "orbitals": [
105
+ {
106
+ "entity": {
107
+ "fields": [
108
+ {
109
+ "default": "",
110
+ "description": "The search being run",
111
+ "name": "query",
112
+ "synonyms": "search term, terms, topic",
113
+ "type": "string"
114
+ },
115
+ {
116
+ "default": 0.0,
117
+ "description": "The background tab running the search; 0 = none",
118
+ "name": "tab",
119
+ "synonyms": "tab id",
120
+ "type": "number"
121
+ },
122
+ {
123
+ "default": "",
124
+ "description": "Why the last search failed; blank = none",
125
+ "name": "errorMessage",
126
+ "synonyms": "error, failure reason",
127
+ "type": "string"
128
+ },
129
+ {
130
+ "default": "idle",
131
+ "description": "Whether a search is running",
132
+ "name": "status",
133
+ "synonyms": "state, busy",
134
+ "type": "string",
135
+ "values": [
136
+ "idle",
137
+ "searching"
138
+ ]
139
+ }
140
+ ],
141
+ "id": "ent_01M431PMYFFV3AXQCTDF8PDBSK",
142
+ "name": "PageSearchRecord",
143
+ "persistence": "runtime"
144
+ },
145
+ "id": "orb_01M431PMYFFWS5D4TGQ03C461C",
146
+ "name": "PageSearchOrbital",
147
+ "pages": [
148
+ {
149
+ "id": "pag_01M431PMYFKQD11Q93ASZHEM7A",
150
+ "name": "PageSearchPage",
151
+ "path": "/page-search",
152
+ "traits": [
153
+ {
154
+ "ref": "PageSearch",
155
+ "refId": "trt_01M431PMYFCQ3KGNQ8M6PR63XH"
156
+ }
157
+ ]
158
+ }
159
+ ],
160
+ "traits": [
161
+ {
162
+ "category": "interaction",
163
+ "config": {
164
+ "fields": {
165
+ "default": {},
166
+ "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)",
167
+ "items": {
168
+ "properties": {
169
+ "attr": {
170
+ "name": "attr",
171
+ "required": false,
172
+ "type": "string"
173
+ },
174
+ "required": {
175
+ "name": "required",
176
+ "required": false,
177
+ "type": "boolean"
178
+ },
179
+ "resolve": {
180
+ "name": "resolve",
181
+ "required": false,
182
+ "type": "boolean"
183
+ },
184
+ "selector": {
185
+ "name": "selector",
186
+ "required": false,
187
+ "type": "string"
188
+ },
189
+ "template": {
190
+ "name": "template",
191
+ "required": false,
192
+ "type": "string"
193
+ }
194
+ },
195
+ "type": "object"
196
+ },
197
+ "label": "Fields",
198
+ "synonyms": "columns, properties, extract",
199
+ "tier": "domain",
200
+ "type": "Map<string,PageField>"
201
+ },
202
+ "maxResults": {
203
+ "default": 10.0,
204
+ "description": "Most results read from one search",
205
+ "label": "Results per search",
206
+ "synonyms": "limit, count, how many",
207
+ "tier": "policy",
208
+ "type": "number"
209
+ },
210
+ "queryParam": {
211
+ "default": "q",
212
+ "description": "Name of the URL parameter that carries the search terms",
213
+ "label": "Query parameter",
214
+ "synonyms": "query key, search parameter",
215
+ "tier": "domain",
216
+ "type": "string"
217
+ },
218
+ "resultSelector": {
219
+ "default": ".result",
220
+ "description": "CSS selector of one result on the results page",
221
+ "label": "Result selector",
222
+ "synonyms": "result, item, card, tile",
223
+ "tier": "domain",
224
+ "type": "string"
225
+ },
226
+ "resultsMatch": {
227
+ "default": "https://example.com/search*",
228
+ "description": "URL match pattern the results page lies in (Chrome match-pattern syntax); the search page must match it, and the extension asks for access to exactly these pages",
229
+ "label": "Results pages",
230
+ "synonyms": "site, url pattern, results url",
231
+ "tier": "domain",
232
+ "type": "string"
233
+ },
234
+ "searchUrl": {
235
+ "default": "https://example.com/search",
236
+ "description": "URL of the site's search results page, without the query",
237
+ "label": "Search page",
238
+ "synonyms": "search url, results page, endpoint",
239
+ "tier": "domain",
240
+ "type": "string"
241
+ },
242
+ "statusSlot": {
243
+ "default": "main",
244
+ "description": "Where the atom shows its one-line status; an organism running it in the background sends it to `system`",
245
+ "label": "Status slot",
246
+ "synonyms": "status area, slot",
247
+ "tier": "presentation",
248
+ "type": "slot"
249
+ },
250
+ "waitMs": {
251
+ "default": 8000.0,
252
+ "description": "How long to wait for the results page to load and its first result to appear",
253
+ "label": "Wait for results (ms)",
254
+ "synonyms": "timeout, wait, patience",
255
+ "tier": "infra",
256
+ "type": "number"
257
+ }
258
+ },
259
+ "effectRow": [
260
+ {
261
+ "kind": "call-service",
262
+ "resource": "page.closeTab"
263
+ },
264
+ {
265
+ "kind": "call-service",
266
+ "resource": "page.openTab"
267
+ },
268
+ {
269
+ "kind": "call-service",
270
+ "resource": "page.query"
271
+ },
272
+ {
273
+ "kind": "emit",
274
+ "resource": "RESULTS"
275
+ },
276
+ {
277
+ "kind": "emit",
278
+ "resource": "SEARCH_FAILED"
279
+ },
280
+ {
281
+ "kind": "render-ui",
282
+ "resolved": false,
283
+ "resource": "@config.statusSlot"
284
+ },
285
+ {
286
+ "kind": "set",
287
+ "resource": "@entity.errorMessage"
288
+ },
289
+ {
290
+ "kind": "set",
291
+ "resource": "@entity.query"
292
+ },
293
+ {
294
+ "kind": "set",
295
+ "resource": "@entity.status"
296
+ },
297
+ {
298
+ "kind": "set",
299
+ "resource": "@entity.tab"
300
+ }
301
+ ],
302
+ "emits": [
303
+ {
304
+ "description": "The background tab for the search is open",
305
+ "event": "TAB_OPENED",
306
+ "eventId": "evt_01M431PMYF0GMPGSCESN3GPAVD",
307
+ "payloadSchema": [
308
+ {
309
+ "name": "tab",
310
+ "required": true,
311
+ "type": "number"
312
+ }
313
+ ],
314
+ "tier": "secondary"
315
+ },
316
+ {
317
+ "description": "The results were read from the search page",
318
+ "event": "RESULTS_READ",
319
+ "eventId": "evt_01M431PMYF3XJS2JVHD73VS0NB",
320
+ "payloadSchema": [
321
+ {
322
+ "name": "tab",
323
+ "required": true,
324
+ "type": "number"
325
+ },
326
+ {
327
+ "entity": "PageResult",
328
+ "name": "elements",
329
+ "properties": [
330
+ {
331
+ "name": "elementId",
332
+ "required": true,
333
+ "type": "string"
334
+ },
335
+ {
336
+ "name": "fields",
337
+ "type": "Map<string,string>"
338
+ }
339
+ ],
340
+ "required": true,
341
+ "type": "[object]"
342
+ }
343
+ ],
344
+ "tier": "secondary"
345
+ },
346
+ {
347
+ "description": "Opening the search page or reading it failed",
348
+ "event": "SEARCH_CALL_FAILED",
349
+ "eventId": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
350
+ "payloadSchema": [
351
+ {
352
+ "name": "error",
353
+ "required": true,
354
+ "type": "string"
355
+ }
356
+ ],
357
+ "tier": "secondary"
358
+ },
359
+ {
360
+ "description": "What one search found: each result's element id and the fields read from it",
361
+ "event": "RESULTS",
362
+ "eventId": "evt_01M431PMYFGR7XGF0Q8JMF1QK9",
363
+ "payloadSchema": [
364
+ {
365
+ "name": "query",
366
+ "required": true,
367
+ "type": "string"
368
+ },
369
+ {
370
+ "entity": "PageResult",
371
+ "name": "results",
372
+ "properties": [
373
+ {
374
+ "name": "elementId",
375
+ "required": true,
376
+ "type": "string"
377
+ },
378
+ {
379
+ "name": "fields",
380
+ "type": "Map<string,string>"
381
+ }
382
+ ],
383
+ "required": true,
384
+ "type": "[object]"
385
+ }
386
+ ],
387
+ "scope": "external",
388
+ "synonyms": "search results, found, hits",
389
+ "tier": "primary"
390
+ },
391
+ {
392
+ "description": "The search could not be run or read",
393
+ "event": "SEARCH_FAILED",
394
+ "eventId": "evt_01M431PMYF7T08MQPSJ2EHXT1V",
395
+ "payloadSchema": [
396
+ {
397
+ "name": "query",
398
+ "required": true,
399
+ "type": "string"
400
+ },
401
+ {
402
+ "name": "error",
403
+ "required": true,
404
+ "type": "string"
405
+ }
406
+ ],
407
+ "scope": "external",
408
+ "tier": "primary"
409
+ }
410
+ ],
411
+ "entityRefIds": {
412
+ "PageSearchRecord": "ent_01M431PMYFFV3AXQCTDF8PDBSK"
413
+ },
414
+ "id": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
415
+ "linkedEntity": "PageSearchRecord",
416
+ "linkedEntityId": "ent_01M431PMYFFV3AXQCTDF8PDBSK",
417
+ "name": "PageSearch",
418
+ "scope": "instance",
419
+ "stateMachine": {
420
+ "events": [
421
+ {
422
+ "id": "evt_01M431PMYFM6PAHXRH26X3ABMC",
423
+ "key": "INIT",
424
+ "name": "Initialize"
425
+ },
426
+ {
427
+ "description": "Search the site for `query`",
428
+ "external": true,
429
+ "id": "evt_01M431PMYF43RSRVDHQVS7T6ZS",
430
+ "key": "SEARCH",
431
+ "name": "Search",
432
+ "payloadSchema": [
433
+ {
434
+ "name": "query",
435
+ "required": true,
436
+ "type": "string"
437
+ }
438
+ ]
439
+ },
440
+ {
441
+ "description": "The background tab for the search is open",
442
+ "id": "evt_01M431PMYF0GMPGSCESN3GPAVD",
443
+ "key": "TAB_OPENED",
444
+ "name": "Tab Opened",
445
+ "payloadSchema": [
446
+ {
447
+ "name": "tab",
448
+ "required": true,
449
+ "type": "number"
450
+ }
451
+ ],
452
+ "tier": "secondary"
453
+ },
454
+ {
455
+ "description": "The results were read from the search page",
456
+ "id": "evt_01M431PMYF3XJS2JVHD73VS0NB",
457
+ "key": "RESULTS_READ",
458
+ "name": "Results Read",
459
+ "payloadSchema": [
460
+ {
461
+ "name": "tab",
462
+ "required": true,
463
+ "type": "number"
464
+ },
465
+ {
466
+ "entity": "PageResult",
467
+ "name": "elements",
468
+ "properties": [
469
+ {
470
+ "name": "elementId",
471
+ "required": true,
472
+ "type": "string"
473
+ },
474
+ {
475
+ "name": "fields",
476
+ "type": "Map<string,string>"
477
+ }
478
+ ],
479
+ "required": true,
480
+ "type": "[object]"
481
+ }
482
+ ],
483
+ "tier": "secondary"
484
+ },
485
+ {
486
+ "description": "Opening the search page or reading it failed",
487
+ "id": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
488
+ "key": "SEARCH_CALL_FAILED",
489
+ "name": "Search Call Failed",
490
+ "payloadSchema": [
491
+ {
492
+ "name": "error",
493
+ "required": true,
494
+ "type": "string"
495
+ }
496
+ ],
497
+ "tier": "secondary"
498
+ },
499
+ {
500
+ "description": "What one search found: each result's element id and the fields read from it",
501
+ "id": "evt_01M431PMYFGR7XGF0Q8JMF1QK9",
502
+ "key": "RESULTS",
503
+ "name": "Results",
504
+ "payloadSchema": [
505
+ {
506
+ "name": "query",
507
+ "required": true,
508
+ "type": "string"
509
+ },
510
+ {
511
+ "entity": "PageResult",
512
+ "name": "results",
513
+ "properties": [
514
+ {
515
+ "name": "elementId",
516
+ "required": true,
517
+ "type": "string"
518
+ },
519
+ {
520
+ "name": "fields",
521
+ "type": "Map<string,string>"
522
+ }
523
+ ],
524
+ "required": true,
525
+ "type": "[object]"
526
+ }
527
+ ],
528
+ "synonyms": "search results, found, hits",
529
+ "tier": "primary"
530
+ },
531
+ {
532
+ "description": "The search could not be run or read",
533
+ "id": "evt_01M431PMYF7T08MQPSJ2EHXT1V",
534
+ "key": "SEARCH_FAILED",
535
+ "name": "Search Failed",
536
+ "payloadSchema": [
537
+ {
538
+ "name": "query",
539
+ "required": true,
540
+ "type": "string"
541
+ },
542
+ {
543
+ "name": "error",
544
+ "required": true,
545
+ "type": "string"
546
+ }
547
+ ],
548
+ "tier": "primary"
549
+ }
550
+ ],
551
+ "states": [
552
+ {
553
+ "isInitial": true,
554
+ "name": "idle"
555
+ },
556
+ {
557
+ "name": "searching"
558
+ }
559
+ ],
560
+ "transitions": [
561
+ {
562
+ "effects": [
563
+ [
564
+ "render-ui",
565
+ "@config.statusSlot",
566
+ {
567
+ "content": "Ready to search",
568
+ "role": "status",
569
+ "type": "typography",
570
+ "variant": "body"
571
+ }
572
+ ]
573
+ ],
574
+ "event": "INIT",
575
+ "eventId": "evt_01M431PMYFM6PAHXRH26X3ABMC",
576
+ "from": "idle",
577
+ "to": "idle"
578
+ },
579
+ {
580
+ "effects": [
581
+ [
582
+ "set",
583
+ "@entity.query",
584
+ "@payload.query"
585
+ ],
586
+ [
587
+ "set",
588
+ "@entity.tab",
589
+ 0.0
590
+ ],
591
+ [
592
+ "set",
593
+ "@entity.status",
594
+ "searching"
595
+ ],
596
+ [
597
+ "call-service",
598
+ "page",
599
+ "openTab",
600
+ {
601
+ "active": false,
602
+ "match": "@config.resultsMatch",
603
+ "params": [
604
+ "object/set",
605
+ {},
606
+ "@config.queryParam",
607
+ "@payload.query"
608
+ ],
609
+ "url": "@config.searchUrl"
610
+ },
611
+ {
612
+ "emit": {
613
+ "failure": "SEARCH_CALL_FAILED",
614
+ "success": "TAB_OPENED"
615
+ }
616
+ }
617
+ ],
618
+ [
619
+ "render-ui",
620
+ "@config.statusSlot",
621
+ {
622
+ "content": [
623
+ "str/concat",
624
+ "Searching for ",
625
+ "@payload.query"
626
+ ],
627
+ "role": "status",
628
+ "type": "typography",
629
+ "variant": "body"
630
+ }
631
+ ]
632
+ ],
633
+ "event": "SEARCH",
634
+ "eventId": "evt_01M431PMYF43RSRVDHQVS7T6ZS",
635
+ "from": "idle",
636
+ "to": "searching"
637
+ },
638
+ {
639
+ "effects": [
640
+ [
641
+ "render-ui",
642
+ "@config.statusSlot",
643
+ {
644
+ "content": [
645
+ "str/concat",
646
+ "Searching for ",
647
+ "@entity.query"
648
+ ],
649
+ "role": "status",
650
+ "type": "typography",
651
+ "variant": "body"
652
+ }
653
+ ]
654
+ ],
655
+ "event": "INIT",
656
+ "eventId": "evt_01M431PMYFM6PAHXRH26X3ABMC",
657
+ "from": "searching",
658
+ "to": "searching"
659
+ },
660
+ {
661
+ "effects": [
662
+ [
663
+ "set",
664
+ "@entity.tab",
665
+ "@payload.tab"
666
+ ],
667
+ [
668
+ "call-service",
669
+ "page",
670
+ "query",
671
+ {
672
+ "fields": "@config.fields",
673
+ "limit": "@config.maxResults",
674
+ "selector": "@config.resultSelector",
675
+ "tab": "@payload.tab",
676
+ "waitMs": "@config.waitMs"
677
+ },
678
+ {
679
+ "emit": {
680
+ "failure": "SEARCH_CALL_FAILED",
681
+ "success": "RESULTS_READ"
682
+ }
683
+ }
684
+ ]
685
+ ],
686
+ "event": "TAB_OPENED",
687
+ "eventId": "evt_01M431PMYF0GMPGSCESN3GPAVD",
688
+ "from": "searching",
689
+ "to": "searching"
690
+ },
691
+ {
692
+ "effects": [
693
+ [
694
+ "call-service",
695
+ "page",
696
+ "closeTab",
697
+ {
698
+ "tab": "@payload.tab"
699
+ }
700
+ ],
701
+ [
702
+ "set",
703
+ "@entity.tab",
704
+ 0.0
705
+ ],
706
+ [
707
+ "set",
708
+ "@entity.status",
709
+ "idle"
710
+ ],
711
+ [
712
+ "emit",
713
+ "RESULTS",
714
+ {
715
+ "query": "@entity.query",
716
+ "results": "@payload.elements"
717
+ }
718
+ ],
719
+ [
720
+ "render-ui",
721
+ "@config.statusSlot",
722
+ {
723
+ "content": [
724
+ "str/concat",
725
+ "Searched for ",
726
+ "@entity.query"
727
+ ],
728
+ "role": "status",
729
+ "type": "typography",
730
+ "variant": "body"
731
+ }
732
+ ]
733
+ ],
734
+ "event": "RESULTS_READ",
735
+ "eventId": "evt_01M431PMYF3XJS2JVHD73VS0NB",
736
+ "from": "searching",
737
+ "to": "idle"
738
+ },
739
+ {
740
+ "effects": [
741
+ [
742
+ "call-service",
743
+ "page",
744
+ "closeTab",
745
+ {
746
+ "tab": "@entity.tab"
747
+ }
748
+ ],
749
+ [
750
+ "set",
751
+ "@entity.tab",
752
+ 0.0
753
+ ],
754
+ [
755
+ "set",
756
+ "@entity.errorMessage",
757
+ "@payload.error"
758
+ ],
759
+ [
760
+ "set",
761
+ "@entity.status",
762
+ "idle"
763
+ ],
764
+ [
765
+ "emit",
766
+ "SEARCH_FAILED",
767
+ {
768
+ "error": "@payload.error",
769
+ "query": "@entity.query"
770
+ }
771
+ ],
772
+ [
773
+ "render-ui",
774
+ "@config.statusSlot",
775
+ {
776
+ "content": [
777
+ "str/concat",
778
+ "Couldn't search: ",
779
+ "@payload.error"
780
+ ],
781
+ "role": "status",
782
+ "type": "typography",
783
+ "variant": "body"
784
+ }
785
+ ]
786
+ ],
787
+ "event": "SEARCH_CALL_FAILED",
788
+ "eventId": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
789
+ "from": "searching",
790
+ "guard": [
791
+ ">",
792
+ "@entity.tab",
793
+ 0.0
794
+ ],
795
+ "to": "idle"
796
+ },
797
+ {
798
+ "effects": [
799
+ [
800
+ "set",
801
+ "@entity.errorMessage",
802
+ "@payload.error"
803
+ ],
804
+ [
805
+ "set",
806
+ "@entity.status",
807
+ "idle"
808
+ ],
809
+ [
810
+ "emit",
811
+ "SEARCH_FAILED",
812
+ {
813
+ "error": "@payload.error",
814
+ "query": "@entity.query"
815
+ }
816
+ ],
817
+ [
818
+ "render-ui",
819
+ "@config.statusSlot",
820
+ {
821
+ "content": [
822
+ "str/concat",
823
+ "Couldn't search: ",
824
+ "@payload.error"
825
+ ],
826
+ "role": "status",
827
+ "type": "typography",
828
+ "variant": "body"
829
+ }
830
+ ]
831
+ ],
832
+ "event": "SEARCH_CALL_FAILED",
833
+ "eventId": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
834
+ "from": "searching",
835
+ "guard": [
836
+ "==",
837
+ "@entity.tab",
838
+ 0.0
839
+ ],
840
+ "to": "idle"
841
+ }
842
+ ]
843
+ }
844
+ }
845
+ ],
846
+ "types": {
847
+ "PageField": [
848
+ {
849
+ "name": "selector",
850
+ "type": "string"
851
+ },
852
+ {
853
+ "name": "attr",
854
+ "type": "string"
855
+ },
856
+ {
857
+ "name": "resolve",
858
+ "type": "boolean"
859
+ },
860
+ {
861
+ "name": "template",
862
+ "type": "string"
863
+ },
864
+ {
865
+ "name": "required",
866
+ "type": "boolean"
867
+ }
868
+ ],
869
+ "PageResult": [
870
+ {
871
+ "name": "elementId",
872
+ "required": true,
873
+ "type": "string"
874
+ },
875
+ {
876
+ "name": "fields",
877
+ "type": "Map<string,string>"
878
+ }
879
+ ]
880
+ }
881
+ }
882
+ ],
883
+ "schemaVersion": 1,
884
+ "version": "1.0.0"
885
+ }