pico-engine 1.9.0 → 1.9.1
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.
- package/README.md +2 -2
- package/krl/io.picolabs.pico-engine-ui.krl +2 -0
- package/krl/io.picolabs.wrangler.krl +7 -1
- package/krl/io.picolabs.xmlui.krl +13 -3
- package/mcp/devResources.js +17 -7
- package/mcp/docs/CLAUDE.md +85 -0
- package/{public → mcp}/docs/pico-engine.md +8 -8
- package/package.json +5 -4
- package/public/pico-engine-ui.js +2 -2
- package/public/.DS_Store +0 -0
- package/public/docs/README.md +0 -9
- package/public/docs/_media/logo.png +0 -0
- package/public/docs/_sidebar.md +0 -7
- package/public/docs/contributing.md +0 -64
- package/public/docs/favicon.ico +0 -0
- package/public/docs/index.html +0 -29
- package/public/docs/krl/README.md +0 -3
- package/public/docs/krl/_sidebar.md +0 -10
- package/public/docs/krl/discovery.md +0 -144
- package/public/docs/krl/modules/ctx.md +0 -151
- package/public/docs/krl/modules/event.md +0 -70
- package/public/docs/krl/modules/http.md +0 -42
- package/public/docs/krl/modules/math.md +0 -5
- package/public/docs/krl/modules/schedule.md +0 -5
- package/public/docs/krl/modules.md +0 -11
- package/public/docs/krl/rulesets.md +0 -81
- package/public/docs/krl/stdlib.md +0 -3
- package/public/docs/llms-full.txt +0 -630
- package/public/docs/llms.txt +0 -38
- package/public/docs/openapi.yaml +0 -78
- package/public/docs/pico-views-xmlui.md +0 -5
- package/public/docs/pico-views.md +0 -140
- package/public/docs/pico.md +0 -5
- package/public/docs/rulesets/README.md +0 -26
- package/public/docs/rulesets/io.picolabs.oauth.md +0 -71
- package/public/docs/rulesets/io.picolabs.pds.md +0 -327
- package/public/docs/rulesets/io.picolabs.pico-engine-ui.md +0 -65
- package/public/docs/rulesets/io.picolabs.portable_subtree.md +0 -94
- package/public/docs/rulesets/io.picolabs.subscription.md +0 -398
- package/public/docs/rulesets/io.picolabs.wrangler.md +0 -471
- /package/{public → mcp}/docs/pico-overview.md +0 -0
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
# io.picolabs.pds
|
|
2
|
-
|
|
3
|
-
Pico Data Services (PDS), a common data base structure for all rulesets to use.
|
|
4
|
-
|
|
5
|
-
*Version draft. Generated from the ruleset's annotations by `krl-schema --format markdown`; edit the `/** */` comments in the source, not this page. Only annotated rules and shared functions appear.*
|
|
6
|
-
|
|
7
|
-
**Operations:** [pds:new_data_available](#pdsnew_data_available) · [pds:updated_data_available](#pdsupdated_data_available) · [pds:remove_old_data](#pdsremove_old_data) · [pds:remove_namespace](#pdsremove_namespace) · [pds:map_item](#pdsmap_item) · [pds:updated_profile](#pdsupdated_profile) · [pds:add_settings](#pdsadd_settings)
|
|
8
|
-
**Queries:** [items](#itemsnamespace-key--map) · [get_keys](#get_keysnamespace--array) · [profile](#profilekey--map) · [settings](#settingsrid-key-detail--map) · [get_config_value](#get_config_valuesetkey--any) · [get_setting_data_value](#get_setting_data_valuesetrid-setkey--any) · [config_value](#config_valuesetkey--any) · [settings_names](#settings_names--array) · [getChannelEci](#getchanneleci--string)
|
|
9
|
-
|
|
10
|
-
## Operations
|
|
11
|
-
|
|
12
|
-
Events you can send to a pico with this ruleset installed. Whether an operation acts, and what it emits, depends on its condition and the pico's state when the event arrives.
|
|
13
|
-
|
|
14
|
-
### `pds:new_data_available`
|
|
15
|
-
|
|
16
|
-
Store one value in the general data under namespace and key, replacing any existing value. Raises pds:data_added.
|
|
17
|
-
|
|
18
|
-
**Send:** `pds:new_data_available`
|
|
19
|
-
**Rule:** `add_item`
|
|
20
|
-
|
|
21
|
-
| Attribute | Type | Required | Description |
|
|
22
|
-
|-----------|------|----------|-------------|
|
|
23
|
-
| `namespace` | String | yes | namespace, e.g. your app's name |
|
|
24
|
-
| `key` | String | yes | |
|
|
25
|
-
| `value` | Any | yes | value to store |
|
|
26
|
-
|
|
27
|
-
**Examples:**
|
|
28
|
-
|
|
29
|
-
- **store a value:** `{"namespace":"<app>","key":"<key>","value":"<value>"}`
|
|
30
|
-
|
|
31
|
-
**Acts when:** always, once selected
|
|
32
|
-
|
|
33
|
-
**May emit** (possible, not guaranteed):
|
|
34
|
-
|
|
35
|
-
- raises `pds:data_added` on this pico — always
|
|
36
|
-
|
|
37
|
-
<details><summary>Select expression</summary>
|
|
38
|
-
|
|
39
|
-
```krl
|
|
40
|
-
select when pds new_data_available
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
</details>
|
|
44
|
-
|
|
45
|
-
### `pds:updated_data_available`
|
|
46
|
-
|
|
47
|
-
Merge fields into a stored map: each entry of value is written under namespace / key / field, leaving other fields alone. Raises pds:data_updated once per field.
|
|
48
|
-
|
|
49
|
-
**Send:** `pds:updated_data_available`
|
|
50
|
-
**Rule:** `update_item`
|
|
51
|
-
|
|
52
|
-
| Attribute | Type | Required | Description |
|
|
53
|
-
|-----------|------|----------|-------------|
|
|
54
|
-
| `namespace` | String | yes | |
|
|
55
|
-
| `key` | String | yes | |
|
|
56
|
-
| `value` | Map | yes | fields to set on the stored map |
|
|
57
|
-
|
|
58
|
-
**Examples:**
|
|
59
|
-
|
|
60
|
-
- **set fields:** `{"namespace":"<app>","key":"<key>","value":{"<field>":"<value>"}}`
|
|
61
|
-
|
|
62
|
-
**Acts when:** always, once selected
|
|
63
|
-
|
|
64
|
-
**May emit** (possible, not guaranteed):
|
|
65
|
-
|
|
66
|
-
- raises `pds:data_updated` on this pico — always
|
|
67
|
-
|
|
68
|
-
<details><summary>Select expression</summary>
|
|
69
|
-
|
|
70
|
-
```krl
|
|
71
|
-
select when pds updated_data_available
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
</details>
|
|
75
|
-
|
|
76
|
-
### `pds:remove_old_data`
|
|
77
|
-
|
|
78
|
-
Delete one key from a namespace of the general data. Raises pds:data_deleted.
|
|
79
|
-
|
|
80
|
-
**Send:** `pds:remove_old_data`
|
|
81
|
-
**Rule:** `remove_item`
|
|
82
|
-
|
|
83
|
-
| Attribute | Type | Required | Description |
|
|
84
|
-
|-----------|------|----------|-------------|
|
|
85
|
-
| `namespace` | String | yes | |
|
|
86
|
-
| `key` | String | yes | |
|
|
87
|
-
|
|
88
|
-
**Acts when:** always, once selected
|
|
89
|
-
|
|
90
|
-
**May emit** (possible, not guaranteed):
|
|
91
|
-
|
|
92
|
-
- raises `pds:data_deleted` on this pico — always
|
|
93
|
-
|
|
94
|
-
<details><summary>Select expression</summary>
|
|
95
|
-
|
|
96
|
-
```krl
|
|
97
|
-
select when pds remove_old_data
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
</details>
|
|
101
|
-
|
|
102
|
-
### `pds:remove_namespace`
|
|
103
|
-
|
|
104
|
-
Delete a whole namespace of the general data. Raises pds:namespace_deleted.
|
|
105
|
-
|
|
106
|
-
**Send:** `pds:remove_namespace`
|
|
107
|
-
**Rule:** `remove_namespace`
|
|
108
|
-
|
|
109
|
-
| Attribute | Type | Required | Description |
|
|
110
|
-
|-----------|------|----------|-------------|
|
|
111
|
-
| `namespace` | String | yes | |
|
|
112
|
-
|
|
113
|
-
**Acts when:** always, once selected
|
|
114
|
-
|
|
115
|
-
**May emit** (possible, not guaranteed):
|
|
116
|
-
|
|
117
|
-
- raises `pds:namespace_deleted` on this pico — always
|
|
118
|
-
|
|
119
|
-
<details><summary>Select expression</summary>
|
|
120
|
-
|
|
121
|
-
```krl
|
|
122
|
-
select when pds remove_namespace
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
</details>
|
|
126
|
-
|
|
127
|
-
### `pds:map_item`
|
|
128
|
-
|
|
129
|
-
Replace an entire namespace of the general data with a map. Raises pds:new_map_added.
|
|
130
|
-
|
|
131
|
-
**Send:** `pds:map_item`
|
|
132
|
-
**Rule:** `itemed_mapped`
|
|
133
|
-
|
|
134
|
-
| Attribute | Type | Required | Description |
|
|
135
|
-
|-----------|------|----------|-------------|
|
|
136
|
-
| `namespace` | String | yes | |
|
|
137
|
-
| `mapvalues` | String | yes | the new namespace contents, as a JSON-encoded map |
|
|
138
|
-
|
|
139
|
-
**Examples:**
|
|
140
|
-
|
|
141
|
-
- **replace namespace:** `{"namespace":"<app>","mapvalues":"{\"<key>\": \"<value>\"}"}`
|
|
142
|
-
|
|
143
|
-
**Acts when:** always, once selected
|
|
144
|
-
|
|
145
|
-
**May emit** (possible, not guaranteed):
|
|
146
|
-
|
|
147
|
-
- raises `pds:new_map_added` on this pico — always
|
|
148
|
-
|
|
149
|
-
<details><summary>Select expression</summary>
|
|
150
|
-
|
|
151
|
-
```krl
|
|
152
|
-
select when pds map_item
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
</details>
|
|
156
|
-
|
|
157
|
-
### `pds:updated_profile`
|
|
158
|
-
|
|
159
|
-
Update this pico's profile. Send only the fields to change; fields not sent keep their current values. _created is set on the first update and _modified on every update. Raises pds:profile_updated with _status "success", or "failure" when no fields were sent.
|
|
160
|
-
|
|
161
|
-
**Send:** `pds:updated_profile`
|
|
162
|
-
**Rule:** `update_profile`
|
|
163
|
-
|
|
164
|
-
| Attribute | Type | Required | Description |
|
|
165
|
-
|-----------|------|----------|-------------|
|
|
166
|
-
| `name` | String | no | display name |
|
|
167
|
-
| `description` | String | no | |
|
|
168
|
-
| `photo` | String | no | image URL or data: URI |
|
|
169
|
-
| `email` | String | no | |
|
|
170
|
-
| `phone` | String | no | |
|
|
171
|
-
|
|
172
|
-
**Examples:**
|
|
173
|
-
|
|
174
|
-
- **rename:** `{"name":"<name>"}`
|
|
175
|
-
- **contact info:** `{"email":"<email>","phone":"<phone>"}`
|
|
176
|
-
|
|
177
|
-
**Acts when:** `newly_constructed_profile != "nothing to update"`
|
|
178
|
-
|
|
179
|
-
**May emit** (possible, not guaranteed):
|
|
180
|
-
|
|
181
|
-
- raises `pds:profile_updated` on this pico — when it acts
|
|
182
|
-
- raises `pds:profile_updated` on this pico — when it doesn't act
|
|
183
|
-
|
|
184
|
-
<details><summary>Select expression</summary>
|
|
185
|
-
|
|
186
|
-
```krl
|
|
187
|
-
select when pds updated_profile
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
</details>
|
|
191
|
-
|
|
192
|
-
### `pds:add_settings`
|
|
193
|
-
|
|
194
|
-
Create or update a ruleset's settings record, and optionally set one data value in it. Raises pds:settings_added.
|
|
195
|
-
|
|
196
|
-
**Send:** `pds:add_settings`
|
|
197
|
-
**Rule:** `settings_added`
|
|
198
|
-
|
|
199
|
-
| Attribute | Type | Required | Description |
|
|
200
|
-
|-----------|------|----------|-------------|
|
|
201
|
-
| `keyed_rid` | String | yes | ruleset id the settings belong to |
|
|
202
|
-
| `name` | String | yes | display name for the settings |
|
|
203
|
-
| `schema` | Array | no | settings schema, stored as given |
|
|
204
|
-
| `data_key` | String | no | data key to set |
|
|
205
|
-
| `value` | Any | no | value for data_key |
|
|
206
|
-
|
|
207
|
-
**Examples:**
|
|
208
|
-
|
|
209
|
-
- **register settings:** `{"keyed_rid":"<rid>","name":"<display name>"}`
|
|
210
|
-
- **set one value:** `{"keyed_rid":"<rid>","name":"<display name>","data_key":"<key>","value":"<value>"}`
|
|
211
|
-
|
|
212
|
-
**Acts when:** always, once selected
|
|
213
|
-
|
|
214
|
-
**May emit** (possible, not guaranteed):
|
|
215
|
-
|
|
216
|
-
- raises `pds:settings_added` on this pico — always
|
|
217
|
-
|
|
218
|
-
<details><summary>Select expression</summary>
|
|
219
|
-
|
|
220
|
-
```krl
|
|
221
|
-
select when pds add_settings
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
</details>
|
|
225
|
-
|
|
226
|
-
## Queries
|
|
227
|
-
|
|
228
|
-
### `items(namespace?, key?)` → Map
|
|
229
|
-
|
|
230
|
-
Read general (namespaced) data. With no namespace, returns all of it; with a namespace, that namespace's map; with both, one value. status is "failed" when no namespace is given (the data is still returned).
|
|
231
|
-
|
|
232
|
-
| Parameter | Type | Required | Default | Description |
|
|
233
|
-
|-----------|------|----------|---------|-------------|
|
|
234
|
-
| `namespace` | String | no | | namespace to read; omit for everything |
|
|
235
|
-
| `key` | String | no | | key within the namespace; omit for the whole namespace |
|
|
236
|
-
|
|
237
|
-
**Examples:**
|
|
238
|
-
|
|
239
|
-
- **one namespace:** `{"namespace":"<app>"}`
|
|
240
|
-
- **one value:** `{"namespace":"<app>","key":"<key>"}`
|
|
241
|
-
|
|
242
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/items?namespace=…&key=…`, or `<alias>:items(namespace?, key?)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
243
|
-
|
|
244
|
-
### `get_keys(namespace)` → Array
|
|
245
|
-
|
|
246
|
-
Keys stored in one namespace of the general data.
|
|
247
|
-
|
|
248
|
-
| Parameter | Type | Required | Default | Description |
|
|
249
|
-
|-----------|------|----------|---------|-------------|
|
|
250
|
-
| `namespace` | String | yes | | |
|
|
251
|
-
|
|
252
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/get_keys?namespace=…`, or `<alias>:get_keys(namespace)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
253
|
-
|
|
254
|
-
### `profile(key?)` → Map
|
|
255
|
-
|
|
256
|
-
This pico's profile: name, description, photo, email, phone, and the _created / _modified timestamps. With a key, just that field.
|
|
257
|
-
|
|
258
|
-
| Parameter | Type | Required | Default | Description |
|
|
259
|
-
|-----------|------|----------|---------|-------------|
|
|
260
|
-
| `key` | String | no | | profile field to read; omit for the whole profile |
|
|
261
|
-
|
|
262
|
-
**Examples:**
|
|
263
|
-
|
|
264
|
-
- **whole profile:** `{}`
|
|
265
|
-
- **name only:** `{"key":"name"}`
|
|
266
|
-
|
|
267
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/profile?key=…`, or `<alias>:profile(key?)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
268
|
-
|
|
269
|
-
### `settings(Rid?, Key?, detail?)` → Map
|
|
270
|
-
|
|
271
|
-
Read per-ruleset settings. No arguments: all settings. Rid: that ruleset's settings record ({ name, rid, data, schema }). Rid and Key: one field of the record. Rid, Key, and detail: the value of data key `detail` (Key is ignored).
|
|
272
|
-
|
|
273
|
-
| Parameter | Type | Required | Default | Description |
|
|
274
|
-
|-----------|------|----------|---------|-------------|
|
|
275
|
-
| `Rid` | String | no | | ruleset id whose settings to read |
|
|
276
|
-
| `Key` | String | no | | field of the settings record (name, rid, data, schema) |
|
|
277
|
-
| `detail` | String | no | | key within the record's data map |
|
|
278
|
-
|
|
279
|
-
**Examples:**
|
|
280
|
-
|
|
281
|
-
- **one ruleset:** `{"Rid":"<rid>"}`
|
|
282
|
-
- **one data value:** `{"Rid":"<rid>","Key":"data","detail":"<key>"}`
|
|
283
|
-
|
|
284
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/settings?Rid=…&Key=…&detail=…`, or `<alias>:settings(Rid?, Key?, detail?)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
285
|
-
|
|
286
|
-
### `get_config_value(setKey)` → Any
|
|
287
|
-
|
|
288
|
-
Same as config_value: a value from the calling ruleset's own settings data, for use as a module function.
|
|
289
|
-
|
|
290
|
-
| Parameter | Type | Required | Default | Description |
|
|
291
|
-
|-----------|------|----------|---------|-------------|
|
|
292
|
-
| `setKey` | String | yes | | data key |
|
|
293
|
-
|
|
294
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/get_config_value?setKey=…`, or `<alias>:get_config_value(setKey)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
295
|
-
|
|
296
|
-
### `get_setting_data_value(setRID, setKey)` → Any
|
|
297
|
-
|
|
298
|
-
One configuration value from a ruleset's settings data.
|
|
299
|
-
|
|
300
|
-
| Parameter | Type | Required | Default | Description |
|
|
301
|
-
|-----------|------|----------|---------|-------------|
|
|
302
|
-
| `setRID` | String | yes | | ruleset id |
|
|
303
|
-
| `setKey` | String | yes | | data key |
|
|
304
|
-
|
|
305
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/get_setting_data_value?setRID=…&setKey=…`, or `<alias>:get_setting_data_value(setRID, setKey)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
306
|
-
|
|
307
|
-
### `config_value(setKey)` → Any
|
|
308
|
-
|
|
309
|
-
One configuration value from the calling ruleset's own settings data. Meant to be used as a module function (use module io.picolabs.pds): the ruleset is the caller's, from meta:callingRID().
|
|
310
|
-
|
|
311
|
-
| Parameter | Type | Required | Default | Description |
|
|
312
|
-
|-----------|------|----------|---------|-------------|
|
|
313
|
-
| `setKey` | String | yes | | data key |
|
|
314
|
-
|
|
315
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/config_value?setKey=…`, or `<alias>:config_value(setKey)` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
316
|
-
|
|
317
|
-
### `settings_names()` → Array
|
|
318
|
-
|
|
319
|
-
Rulesets that have stored settings here, with their display names.
|
|
320
|
-
|
|
321
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/settings_names`, or `<alias>:settings_names()` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
322
|
-
|
|
323
|
-
### `getChannelEci()` → String
|
|
324
|
-
|
|
325
|
-
The ECI of this pico's pds channel, which allows all pds events and queries. Created when this ruleset is installed.
|
|
326
|
-
|
|
327
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pds/getChannelEci`, or `<alias>:getChannelEci()` from KRL with `use module io.picolabs.pds alias <alias>`
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# io.picolabs.pico-engine-ui
|
|
2
|
-
|
|
3
|
-
This is the only ruleset the pico-engine-ui.js needs to operate
|
|
4
|
-
|
|
5
|
-
*Version 0.0.0. Generated from the ruleset's annotations by `krl-schema --format markdown`; edit the `/** */` comments in the source, not this page. Only annotated rules and shared functions appear.*
|
|
6
|
-
|
|
7
|
-
**Queries:** [box](#box--map) · [uiECI](#uieci--string) · [pico](#pico--map) · [logs](#logs--array) · [testingECI](#testingeci--string) · [testingHistory](#testinghistoryrid--map) · [testingSaved](#testingsavedrid--map) · [name](#name--string)
|
|
8
|
-
|
|
9
|
-
## Queries
|
|
10
|
-
|
|
11
|
-
### `box()` → Map
|
|
12
|
-
|
|
13
|
-
How the developer UI draws this pico: name, color, position, size, and the UI channels of its parent and children.
|
|
14
|
-
|
|
15
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/box`, or `<alias>:box()` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
16
|
-
|
|
17
|
-
### `uiECI()` → String
|
|
18
|
-
|
|
19
|
-
The ECI of this pico's UI channel (tagged engine,ui), used by the developer UI to send engine_ui events and queries to this pico.
|
|
20
|
-
|
|
21
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/uiECI`, or `<alias>:uiECI()` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
22
|
-
|
|
23
|
-
### `pico()` → Map
|
|
24
|
-
|
|
25
|
-
This pico's channels (with their policies) and installed rulesets, plus the UI channels of its parent and children. A quick way to see what a pico is.
|
|
26
|
-
|
|
27
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/pico`, or `<alias>:pico()` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
28
|
-
|
|
29
|
-
### `logs()` → Array
|
|
30
|
-
|
|
31
|
-
Recent activity on this pico, grouped by transaction, newest first: each incoming event or query with the rules it selected, klog output, and errors. The developer UI's own queries are left out.
|
|
32
|
-
|
|
33
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/logs`, or `<alias>:logs()` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
34
|
-
|
|
35
|
-
### `testingECI()` → String
|
|
36
|
-
|
|
37
|
-
The channel the developer UI's Testing tab last selected for sending events and queries to this pico, or null.
|
|
38
|
-
|
|
39
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/testingECI`, or `<alias>:testingECI()` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
40
|
-
|
|
41
|
-
### `testingHistory(rid?)` → Map
|
|
42
|
-
|
|
43
|
-
Recent Testing-tab sends for this pico, keyed by ruleset rid (newest first).
|
|
44
|
-
|
|
45
|
-
| Parameter | Type | Required | Default | Description |
|
|
46
|
-
|-----------|------|----------|---------|-------------|
|
|
47
|
-
| `rid` | String | no | | optional ruleset id; omit for the full map rid → entries |
|
|
48
|
-
|
|
49
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/testingHistory?rid=…`, or `<alias>:testingHistory(rid?)` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
50
|
-
|
|
51
|
-
### `testingSaved(rid?)` → Map
|
|
52
|
-
|
|
53
|
-
Named Testing-tab requests kept on this pico, keyed by ruleset rid.
|
|
54
|
-
|
|
55
|
-
| Parameter | Type | Required | Default | Description |
|
|
56
|
-
|-----------|------|----------|---------|-------------|
|
|
57
|
-
| `rid` | String | no | | optional ruleset id; omit for the full map rid → entries |
|
|
58
|
-
|
|
59
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/testingSaved?rid=…`, or `<alias>:testingSaved(rid?)` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
60
|
-
|
|
61
|
-
### `name()` → String
|
|
62
|
-
|
|
63
|
-
This pico's display name in the developer UI ("Pico" if never set).
|
|
64
|
-
|
|
65
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.pico-engine-ui/name`, or `<alias>:name()` from KRL with `use module io.picolabs.pico-engine-ui alias <alias>`
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# io.picolabs.portable_subtree
|
|
2
|
-
|
|
3
|
-
Optional wrangler utility for copying a pico subtree (rulesets, entity state,
|
|
4
|
-
channels, schedules, and Layer 2 identity) to another parent — on the same
|
|
5
|
-
engine or a different one. Not installed by default.
|
|
6
|
-
|
|
7
|
-
Export (install on an ancestor of the subtree to copy):
|
|
8
|
-
portable_subtree:exportSubtree(subtreeRootPicoId, secret)
|
|
9
|
-
→ encrypted blob (transfer manually to the destination engine)
|
|
10
|
-
|
|
11
|
-
Inspect a blob before import (same secret):
|
|
12
|
-
portable_subtree:summarizeExportBlob(blob, secret)
|
|
13
|
-
|
|
14
|
-
Import (install on the adopting parent):
|
|
15
|
-
raise portable_subtree event "import"
|
|
16
|
-
attributes { "blob": "...", "secret": "..." }
|
|
17
|
-
→ portable_subtree:imported event; read result with portable_subtree:lastImport()
|
|
18
|
-
|
|
19
|
-
The importer must ensure the recipient mesh provides any platform services
|
|
20
|
-
the subtree relied on from ancestors in the donor mesh (e.g. import a
|
|
21
|
-
Manifold app pico under a Manifold parent, not a bare wrangler root).
|
|
22
|
-
|
|
23
|
-
After import, delete the source subtree manually if you no longer need it.
|
|
24
|
-
|
|
25
|
-
*Version draft. Generated from the ruleset's annotations by `krl-schema --format markdown`; edit the `/** */` comments in the source, not this page. Only annotated rules and shared functions appear.*
|
|
26
|
-
|
|
27
|
-
**Operations:** [portable_subtree:import](#portable_subtreeimport)
|
|
28
|
-
**Queries:** [exportSubtree](#exportsubtreesubtreerootpicoid-secret--string) · [lastImport](#lastimport--map) · [summarizeExportBlob](#summarizeexportblobblob-secret--map)
|
|
29
|
-
|
|
30
|
-
## Operations
|
|
31
|
-
|
|
32
|
-
Events you can send to a pico with this ruleset installed. Whether an operation acts, and what it emits, depends on its condition and the pico's state when the event arrives.
|
|
33
|
-
|
|
34
|
-
### `portable_subtree:import`
|
|
35
|
-
|
|
36
|
-
Import an exported subtree as a child of this pico. Rulesets, entity state, channels, schedules, and identity are restored, and Layer 2 relationships are relocated so they survive the move. The result is stored for lastImport() and raised as portable_subtree:imported. This pico must provide any platform services the subtree relied on in its old mesh (e.g. import a Manifold app pico under a Manifold parent). The source subtree is not deleted.
|
|
37
|
-
|
|
38
|
-
**Send:** `portable_subtree:import`
|
|
39
|
-
**Rule:** `import_subtree`
|
|
40
|
-
|
|
41
|
-
| Attribute | Type | Required | Description |
|
|
42
|
-
|-----------|------|----------|-------------|
|
|
43
|
-
| `blob` | String | yes | export blob from exportSubtree |
|
|
44
|
-
| `secret` | String | yes | the secret used to export it |
|
|
45
|
-
| `renewIngress` | Boolean | no | mint a fresh DIDComm ingress channel when relocating each pico's did:webvh (default true) |
|
|
46
|
-
| `bootstrapDisplayName` | String | no | display name for the imported root |
|
|
47
|
-
|
|
48
|
-
**Examples:**
|
|
49
|
-
|
|
50
|
-
- **import:** `{"blob":"<blob from exportSubtree>","secret":"<secret>"}`
|
|
51
|
-
|
|
52
|
-
**Acts when:** always, once selected
|
|
53
|
-
|
|
54
|
-
**May emit** (possible, not guaranteed):
|
|
55
|
-
|
|
56
|
-
- raises `portable_subtree:imported` on this pico — when it acts
|
|
57
|
-
|
|
58
|
-
<details><summary>Select expression</summary>
|
|
59
|
-
|
|
60
|
-
```krl
|
|
61
|
-
select when portable_subtree import
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
</details>
|
|
65
|
-
|
|
66
|
-
## Queries
|
|
67
|
-
|
|
68
|
-
### `exportSubtree(subtreeRootPicoId, secret)` → String
|
|
69
|
-
|
|
70
|
-
Export a descendant subtree (or this pico itself) as an encrypted blob: rulesets, entity state, channels, schedules, and Layer 2 identity. Read-only; the source subtree is untouched. Transfer the blob to the adopting parent and send it portable_subtree:import there with the same secret.
|
|
71
|
-
|
|
72
|
-
| Parameter | Type | Required | Default | Description |
|
|
73
|
-
|-----------|------|----------|---------|-------------|
|
|
74
|
-
| `subtreeRootPicoId` | String | yes | | pico id of the subtree root; this pico's own id exports this pico |
|
|
75
|
-
| `secret` | String | yes | | encryption secret; the importer needs the same one |
|
|
76
|
-
|
|
77
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.portable_subtree/exportSubtree?subtreeRootPicoId=…&secret=…`, or `<alias>:exportSubtree(subtreeRootPicoId, secret)` from KRL with `use module io.picolabs.portable_subtree alias <alias>`
|
|
78
|
-
|
|
79
|
-
### `lastImport()` → Map
|
|
80
|
-
|
|
81
|
-
Result of the most recent portable_subtree:import on this pico (the same attrs as the portable_subtree:imported event), or null if none.
|
|
82
|
-
|
|
83
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.portable_subtree/lastImport`, or `<alias>:lastImport()` from KRL with `use module io.picolabs.portable_subtree alias <alias>`
|
|
84
|
-
|
|
85
|
-
### `summarizeExportBlob(blob, secret)` → Map
|
|
86
|
-
|
|
87
|
-
Inspect an export blob before importing it: subtree root name, relationship count, rulesets with entity state, and similar. Read-only.
|
|
88
|
-
|
|
89
|
-
| Parameter | Type | Required | Default | Description |
|
|
90
|
-
|-----------|------|----------|---------|-------------|
|
|
91
|
-
| `blob` | String | yes | | export blob from exportSubtree |
|
|
92
|
-
| `secret` | String | yes | | the secret used to export it |
|
|
93
|
-
|
|
94
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.portable_subtree/summarizeExportBlob?blob=…&secret=…`, or `<alias>:summarizeExportBlob(blob, secret)` from KRL with `use module io.picolabs.portable_subtree alias <alias>`
|