@almadar/std 16.241.0 → 16.242.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 +134 -0
  8. package/behaviors/lolo/infra/atoms/std-page-treat.lolo +59 -0
  9. package/behaviors/lolo/infra/atoms/std-page-watch.lolo +86 -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 +867 -0
  55. package/behaviors/registry/infra/atoms/std-page-treat.orb +494 -0
  56. package/behaviors/registry/infra/atoms/std-page-watch.orb +554 -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,867 @@
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) and `resolve` (the attribute is a URL: return it absolute)",
167
+ "items": {
168
+ "properties": {
169
+ "attr": {
170
+ "name": "attr",
171
+ "required": false,
172
+ "type": "string"
173
+ },
174
+ "resolve": {
175
+ "name": "resolve",
176
+ "required": false,
177
+ "type": "boolean"
178
+ },
179
+ "selector": {
180
+ "name": "selector",
181
+ "required": false,
182
+ "type": "string"
183
+ }
184
+ },
185
+ "type": "object"
186
+ },
187
+ "label": "Fields",
188
+ "synonyms": "columns, properties, extract",
189
+ "tier": "domain",
190
+ "type": "Map<string,PageField>"
191
+ },
192
+ "maxResults": {
193
+ "default": 10.0,
194
+ "description": "Most results read from one search",
195
+ "label": "Results per search",
196
+ "synonyms": "limit, count, how many",
197
+ "tier": "policy",
198
+ "type": "number"
199
+ },
200
+ "queryParam": {
201
+ "default": "q",
202
+ "description": "Name of the URL parameter that carries the search terms",
203
+ "label": "Query parameter",
204
+ "synonyms": "query key, search parameter",
205
+ "tier": "domain",
206
+ "type": "string"
207
+ },
208
+ "resultSelector": {
209
+ "default": ".result",
210
+ "description": "CSS selector of one result on the results page",
211
+ "label": "Result selector",
212
+ "synonyms": "result, item, card, tile",
213
+ "tier": "domain",
214
+ "type": "string"
215
+ },
216
+ "resultsMatch": {
217
+ "default": "https://example.com/search*",
218
+ "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",
219
+ "label": "Results pages",
220
+ "synonyms": "site, url pattern, results url",
221
+ "tier": "domain",
222
+ "type": "string"
223
+ },
224
+ "searchUrl": {
225
+ "default": "https://example.com/search",
226
+ "description": "URL of the site's search results page, without the query",
227
+ "label": "Search page",
228
+ "synonyms": "search url, results page, endpoint",
229
+ "tier": "domain",
230
+ "type": "string"
231
+ },
232
+ "statusSlot": {
233
+ "default": "main",
234
+ "description": "Where the atom shows its one-line status; an organism running it in the background sends it to `system`",
235
+ "label": "Status slot",
236
+ "synonyms": "status area, slot",
237
+ "tier": "presentation",
238
+ "type": "slot"
239
+ },
240
+ "waitMs": {
241
+ "default": 8000.0,
242
+ "description": "How long to wait for the results page to load and its first result to appear",
243
+ "label": "Wait for results (ms)",
244
+ "synonyms": "timeout, wait, patience",
245
+ "tier": "infra",
246
+ "type": "number"
247
+ }
248
+ },
249
+ "effectRow": [
250
+ {
251
+ "kind": "call-service",
252
+ "resource": "page.closeTab"
253
+ },
254
+ {
255
+ "kind": "call-service",
256
+ "resource": "page.openTab"
257
+ },
258
+ {
259
+ "kind": "call-service",
260
+ "resource": "page.query"
261
+ },
262
+ {
263
+ "kind": "emit",
264
+ "resource": "RESULTS"
265
+ },
266
+ {
267
+ "kind": "emit",
268
+ "resource": "SEARCH_FAILED"
269
+ },
270
+ {
271
+ "kind": "render-ui",
272
+ "resolved": false,
273
+ "resource": "@config.statusSlot"
274
+ },
275
+ {
276
+ "kind": "set",
277
+ "resource": "@entity.errorMessage"
278
+ },
279
+ {
280
+ "kind": "set",
281
+ "resource": "@entity.query"
282
+ },
283
+ {
284
+ "kind": "set",
285
+ "resource": "@entity.status"
286
+ },
287
+ {
288
+ "kind": "set",
289
+ "resource": "@entity.tab"
290
+ }
291
+ ],
292
+ "emits": [
293
+ {
294
+ "description": "The background tab for the search is open",
295
+ "event": "TAB_OPENED",
296
+ "eventId": "evt_01M431PMYF0GMPGSCESN3GPAVD",
297
+ "payloadSchema": [
298
+ {
299
+ "name": "tab",
300
+ "required": true,
301
+ "type": "number"
302
+ }
303
+ ],
304
+ "tier": "secondary"
305
+ },
306
+ {
307
+ "description": "The results were read from the search page",
308
+ "event": "RESULTS_READ",
309
+ "eventId": "evt_01M431PMYF3XJS2JVHD73VS0NB",
310
+ "payloadSchema": [
311
+ {
312
+ "name": "tab",
313
+ "required": true,
314
+ "type": "number"
315
+ },
316
+ {
317
+ "entity": "PageResult",
318
+ "name": "elements",
319
+ "properties": [
320
+ {
321
+ "name": "elementId",
322
+ "required": true,
323
+ "type": "string"
324
+ },
325
+ {
326
+ "name": "fields",
327
+ "type": "Map<string,string>"
328
+ }
329
+ ],
330
+ "required": true,
331
+ "type": "[object]"
332
+ }
333
+ ],
334
+ "tier": "secondary"
335
+ },
336
+ {
337
+ "description": "Opening the search page or reading it failed",
338
+ "event": "SEARCH_CALL_FAILED",
339
+ "eventId": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
340
+ "payloadSchema": [
341
+ {
342
+ "name": "error",
343
+ "required": true,
344
+ "type": "string"
345
+ }
346
+ ],
347
+ "tier": "secondary"
348
+ },
349
+ {
350
+ "description": "What one search found: each result's element id and the fields read from it",
351
+ "event": "RESULTS",
352
+ "eventId": "evt_01M431PMYFGR7XGF0Q8JMF1QK9",
353
+ "payloadSchema": [
354
+ {
355
+ "name": "query",
356
+ "required": true,
357
+ "type": "string"
358
+ },
359
+ {
360
+ "entity": "PageResult",
361
+ "name": "results",
362
+ "properties": [
363
+ {
364
+ "name": "elementId",
365
+ "required": true,
366
+ "type": "string"
367
+ },
368
+ {
369
+ "name": "fields",
370
+ "type": "Map<string,string>"
371
+ }
372
+ ],
373
+ "required": true,
374
+ "type": "[object]"
375
+ }
376
+ ],
377
+ "scope": "external",
378
+ "synonyms": "search results, found, hits",
379
+ "tier": "primary"
380
+ },
381
+ {
382
+ "description": "The search could not be run or read",
383
+ "event": "SEARCH_FAILED",
384
+ "eventId": "evt_01M431PMYF7T08MQPSJ2EHXT1V",
385
+ "payloadSchema": [
386
+ {
387
+ "name": "query",
388
+ "required": true,
389
+ "type": "string"
390
+ },
391
+ {
392
+ "name": "error",
393
+ "required": true,
394
+ "type": "string"
395
+ }
396
+ ],
397
+ "scope": "external",
398
+ "tier": "primary"
399
+ }
400
+ ],
401
+ "entityRefIds": {
402
+ "PageSearchRecord": "ent_01M431PMYFFV3AXQCTDF8PDBSK"
403
+ },
404
+ "id": "trt_01M431PMYFCQ3KGNQ8M6PR63XH",
405
+ "linkedEntity": "PageSearchRecord",
406
+ "linkedEntityId": "ent_01M431PMYFFV3AXQCTDF8PDBSK",
407
+ "name": "PageSearch",
408
+ "scope": "instance",
409
+ "stateMachine": {
410
+ "events": [
411
+ {
412
+ "id": "evt_01M431PMYFM6PAHXRH26X3ABMC",
413
+ "key": "INIT",
414
+ "name": "Initialize"
415
+ },
416
+ {
417
+ "description": "Search the site for `query`",
418
+ "external": true,
419
+ "id": "evt_01M431PMYF43RSRVDHQVS7T6ZS",
420
+ "key": "SEARCH",
421
+ "name": "Search",
422
+ "payloadSchema": [
423
+ {
424
+ "name": "query",
425
+ "required": true,
426
+ "type": "string"
427
+ }
428
+ ]
429
+ },
430
+ {
431
+ "description": "The background tab for the search is open",
432
+ "id": "evt_01M431PMYF0GMPGSCESN3GPAVD",
433
+ "key": "TAB_OPENED",
434
+ "name": "Tab Opened",
435
+ "payloadSchema": [
436
+ {
437
+ "name": "tab",
438
+ "required": true,
439
+ "type": "number"
440
+ }
441
+ ],
442
+ "tier": "secondary"
443
+ },
444
+ {
445
+ "description": "The results were read from the search page",
446
+ "id": "evt_01M431PMYF3XJS2JVHD73VS0NB",
447
+ "key": "RESULTS_READ",
448
+ "name": "Results Read",
449
+ "payloadSchema": [
450
+ {
451
+ "name": "tab",
452
+ "required": true,
453
+ "type": "number"
454
+ },
455
+ {
456
+ "entity": "PageResult",
457
+ "name": "elements",
458
+ "properties": [
459
+ {
460
+ "name": "elementId",
461
+ "required": true,
462
+ "type": "string"
463
+ },
464
+ {
465
+ "name": "fields",
466
+ "type": "Map<string,string>"
467
+ }
468
+ ],
469
+ "required": true,
470
+ "type": "[object]"
471
+ }
472
+ ],
473
+ "tier": "secondary"
474
+ },
475
+ {
476
+ "description": "Opening the search page or reading it failed",
477
+ "id": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
478
+ "key": "SEARCH_CALL_FAILED",
479
+ "name": "Search Call Failed",
480
+ "payloadSchema": [
481
+ {
482
+ "name": "error",
483
+ "required": true,
484
+ "type": "string"
485
+ }
486
+ ],
487
+ "tier": "secondary"
488
+ },
489
+ {
490
+ "description": "What one search found: each result's element id and the fields read from it",
491
+ "id": "evt_01M431PMYFGR7XGF0Q8JMF1QK9",
492
+ "key": "RESULTS",
493
+ "name": "Results",
494
+ "payloadSchema": [
495
+ {
496
+ "name": "query",
497
+ "required": true,
498
+ "type": "string"
499
+ },
500
+ {
501
+ "entity": "PageResult",
502
+ "name": "results",
503
+ "properties": [
504
+ {
505
+ "name": "elementId",
506
+ "required": true,
507
+ "type": "string"
508
+ },
509
+ {
510
+ "name": "fields",
511
+ "type": "Map<string,string>"
512
+ }
513
+ ],
514
+ "required": true,
515
+ "type": "[object]"
516
+ }
517
+ ],
518
+ "synonyms": "search results, found, hits",
519
+ "tier": "primary"
520
+ },
521
+ {
522
+ "description": "The search could not be run or read",
523
+ "id": "evt_01M431PMYF7T08MQPSJ2EHXT1V",
524
+ "key": "SEARCH_FAILED",
525
+ "name": "Search Failed",
526
+ "payloadSchema": [
527
+ {
528
+ "name": "query",
529
+ "required": true,
530
+ "type": "string"
531
+ },
532
+ {
533
+ "name": "error",
534
+ "required": true,
535
+ "type": "string"
536
+ }
537
+ ],
538
+ "tier": "primary"
539
+ }
540
+ ],
541
+ "states": [
542
+ {
543
+ "isInitial": true,
544
+ "name": "idle"
545
+ },
546
+ {
547
+ "name": "searching"
548
+ }
549
+ ],
550
+ "transitions": [
551
+ {
552
+ "effects": [
553
+ [
554
+ "render-ui",
555
+ "@config.statusSlot",
556
+ {
557
+ "content": "Ready to search",
558
+ "role": "status",
559
+ "type": "typography",
560
+ "variant": "body"
561
+ }
562
+ ]
563
+ ],
564
+ "event": "INIT",
565
+ "eventId": "evt_01M431PMYFM6PAHXRH26X3ABMC",
566
+ "from": "idle",
567
+ "to": "idle"
568
+ },
569
+ {
570
+ "effects": [
571
+ [
572
+ "set",
573
+ "@entity.query",
574
+ "@payload.query"
575
+ ],
576
+ [
577
+ "set",
578
+ "@entity.tab",
579
+ 0.0
580
+ ],
581
+ [
582
+ "set",
583
+ "@entity.status",
584
+ "searching"
585
+ ],
586
+ [
587
+ "call-service",
588
+ "page",
589
+ "openTab",
590
+ {
591
+ "active": false,
592
+ "match": "@config.resultsMatch",
593
+ "params": [
594
+ "object/set",
595
+ {},
596
+ "@config.queryParam",
597
+ "@payload.query"
598
+ ],
599
+ "url": "@config.searchUrl"
600
+ },
601
+ {
602
+ "emit": {
603
+ "failure": "SEARCH_CALL_FAILED",
604
+ "success": "TAB_OPENED"
605
+ }
606
+ }
607
+ ],
608
+ [
609
+ "render-ui",
610
+ "@config.statusSlot",
611
+ {
612
+ "content": [
613
+ "str/concat",
614
+ "Searching for ",
615
+ "@payload.query"
616
+ ],
617
+ "role": "status",
618
+ "type": "typography",
619
+ "variant": "body"
620
+ }
621
+ ]
622
+ ],
623
+ "event": "SEARCH",
624
+ "eventId": "evt_01M431PMYF43RSRVDHQVS7T6ZS",
625
+ "from": "idle",
626
+ "to": "searching"
627
+ },
628
+ {
629
+ "effects": [
630
+ [
631
+ "render-ui",
632
+ "@config.statusSlot",
633
+ {
634
+ "content": [
635
+ "str/concat",
636
+ "Searching for ",
637
+ "@entity.query"
638
+ ],
639
+ "role": "status",
640
+ "type": "typography",
641
+ "variant": "body"
642
+ }
643
+ ]
644
+ ],
645
+ "event": "INIT",
646
+ "eventId": "evt_01M431PMYFM6PAHXRH26X3ABMC",
647
+ "from": "searching",
648
+ "to": "searching"
649
+ },
650
+ {
651
+ "effects": [
652
+ [
653
+ "set",
654
+ "@entity.tab",
655
+ "@payload.tab"
656
+ ],
657
+ [
658
+ "call-service",
659
+ "page",
660
+ "query",
661
+ {
662
+ "fields": "@config.fields",
663
+ "limit": "@config.maxResults",
664
+ "selector": "@config.resultSelector",
665
+ "tab": "@payload.tab",
666
+ "waitMs": "@config.waitMs"
667
+ },
668
+ {
669
+ "emit": {
670
+ "failure": "SEARCH_CALL_FAILED",
671
+ "success": "RESULTS_READ"
672
+ }
673
+ }
674
+ ]
675
+ ],
676
+ "event": "TAB_OPENED",
677
+ "eventId": "evt_01M431PMYF0GMPGSCESN3GPAVD",
678
+ "from": "searching",
679
+ "to": "searching"
680
+ },
681
+ {
682
+ "effects": [
683
+ [
684
+ "call-service",
685
+ "page",
686
+ "closeTab",
687
+ {
688
+ "tab": "@payload.tab"
689
+ }
690
+ ],
691
+ [
692
+ "set",
693
+ "@entity.tab",
694
+ 0.0
695
+ ],
696
+ [
697
+ "set",
698
+ "@entity.status",
699
+ "idle"
700
+ ],
701
+ [
702
+ "emit",
703
+ "RESULTS",
704
+ {
705
+ "query": "@entity.query",
706
+ "results": "@payload.elements"
707
+ }
708
+ ],
709
+ [
710
+ "render-ui",
711
+ "@config.statusSlot",
712
+ {
713
+ "content": [
714
+ "str/concat",
715
+ "Searched for ",
716
+ "@entity.query"
717
+ ],
718
+ "role": "status",
719
+ "type": "typography",
720
+ "variant": "body"
721
+ }
722
+ ]
723
+ ],
724
+ "event": "RESULTS_READ",
725
+ "eventId": "evt_01M431PMYF3XJS2JVHD73VS0NB",
726
+ "from": "searching",
727
+ "to": "idle"
728
+ },
729
+ {
730
+ "effects": [
731
+ [
732
+ "call-service",
733
+ "page",
734
+ "closeTab",
735
+ {
736
+ "tab": "@entity.tab"
737
+ }
738
+ ],
739
+ [
740
+ "set",
741
+ "@entity.tab",
742
+ 0.0
743
+ ],
744
+ [
745
+ "set",
746
+ "@entity.errorMessage",
747
+ "@payload.error"
748
+ ],
749
+ [
750
+ "set",
751
+ "@entity.status",
752
+ "idle"
753
+ ],
754
+ [
755
+ "emit",
756
+ "SEARCH_FAILED",
757
+ {
758
+ "error": "@payload.error",
759
+ "query": "@entity.query"
760
+ }
761
+ ],
762
+ [
763
+ "render-ui",
764
+ "@config.statusSlot",
765
+ {
766
+ "content": [
767
+ "str/concat",
768
+ "Couldn't search: ",
769
+ "@payload.error"
770
+ ],
771
+ "role": "status",
772
+ "type": "typography",
773
+ "variant": "body"
774
+ }
775
+ ]
776
+ ],
777
+ "event": "SEARCH_CALL_FAILED",
778
+ "eventId": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
779
+ "from": "searching",
780
+ "guard": [
781
+ ">",
782
+ "@entity.tab",
783
+ 0.0
784
+ ],
785
+ "to": "idle"
786
+ },
787
+ {
788
+ "effects": [
789
+ [
790
+ "set",
791
+ "@entity.errorMessage",
792
+ "@payload.error"
793
+ ],
794
+ [
795
+ "set",
796
+ "@entity.status",
797
+ "idle"
798
+ ],
799
+ [
800
+ "emit",
801
+ "SEARCH_FAILED",
802
+ {
803
+ "error": "@payload.error",
804
+ "query": "@entity.query"
805
+ }
806
+ ],
807
+ [
808
+ "render-ui",
809
+ "@config.statusSlot",
810
+ {
811
+ "content": [
812
+ "str/concat",
813
+ "Couldn't search: ",
814
+ "@payload.error"
815
+ ],
816
+ "role": "status",
817
+ "type": "typography",
818
+ "variant": "body"
819
+ }
820
+ ]
821
+ ],
822
+ "event": "SEARCH_CALL_FAILED",
823
+ "eventId": "evt_01M431PMYFFDAVS6XHWBM6PMK7",
824
+ "from": "searching",
825
+ "guard": [
826
+ "==",
827
+ "@entity.tab",
828
+ 0.0
829
+ ],
830
+ "to": "idle"
831
+ }
832
+ ]
833
+ }
834
+ }
835
+ ],
836
+ "types": {
837
+ "PageField": [
838
+ {
839
+ "name": "selector",
840
+ "type": "string"
841
+ },
842
+ {
843
+ "name": "attr",
844
+ "type": "string"
845
+ },
846
+ {
847
+ "name": "resolve",
848
+ "type": "boolean"
849
+ }
850
+ ],
851
+ "PageResult": [
852
+ {
853
+ "name": "elementId",
854
+ "required": true,
855
+ "type": "string"
856
+ },
857
+ {
858
+ "name": "fields",
859
+ "type": "Map<string,string>"
860
+ }
861
+ ]
862
+ }
863
+ }
864
+ ],
865
+ "schemaVersion": 1,
866
+ "version": "1.0.0"
867
+ }