pico-engine 1.6.4 → 1.9.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 (108) hide show
  1. package/README.md +16 -9
  2. package/dist/RulesetRegistryLoaderFs.js +60 -6
  3. package/dist/auth/cookies.js +32 -0
  4. package/dist/auth/index.js +6 -1
  5. package/dist/channelIdentityPolicy.js +22 -0
  6. package/dist/cli.js +106 -69
  7. package/dist/engineConfig.js +291 -0
  8. package/dist/identity/IdentityService.js +90 -0
  9. package/dist/identity/crossPico.js +24 -8
  10. package/dist/identity/didoModule.js +80 -18
  11. package/dist/identity/establishSubscription.js +2 -2
  12. package/dist/identity/identityPortable.js +92 -0
  13. package/dist/identity/index.js +10 -1
  14. package/dist/identity/localPeerReconcile.js +65 -0
  15. package/dist/identity/peerDid4.js +175 -0
  16. package/dist/identity/peerDid4Create.js +90 -0
  17. package/dist/identity/portableExportPrepare.js +196 -0
  18. package/dist/identity/portableMove.js +87 -0
  19. package/dist/identity/skyIntro.js +6 -3
  20. package/dist/identity/skyProtocol.js +26 -1
  21. package/dist/identity/skyRotation.js +121 -0
  22. package/dist/identity/store.js +5 -1
  23. package/dist/identity/subscriptionEntSync.js +72 -0
  24. package/dist/identity/veramoDidComm.js +41 -2
  25. package/dist/identity/webvh.js +4 -2
  26. package/dist/identity/webvhRelocation.js +115 -0
  27. package/dist/index.js +84 -27
  28. package/dist/logging.js +156 -16
  29. package/dist/oauth/OAuthService.js +6 -2
  30. package/dist/policyConfigFromJson.js +112 -0
  31. package/dist/runMcp.js +27 -0
  32. package/dist/server.js +261 -24
  33. package/dist/stageKrl.js +26 -0
  34. package/dist/subtreeWrangler.js +180 -0
  35. package/dist/uiChannelPolicies.js +15 -0
  36. package/dist/xmluiRuntime.js +68 -0
  37. package/krl/io.picolabs.oauth.krl +41 -2
  38. package/krl/io.picolabs.pds.krl +131 -10
  39. package/krl/io.picolabs.pico-engine-ui.krl +217 -94
  40. package/krl/io.picolabs.portable_subtree.krl +97 -0
  41. package/krl/io.picolabs.subscription.krl +180 -72
  42. package/krl/io.picolabs.wrangler.krl +313 -57
  43. package/krl/io.picolabs.xmlui.krl +295 -0
  44. package/mcp/devResources.js +118 -0
  45. package/mcp/devTools.js +351 -0
  46. package/mcp/engineClient.js +133 -0
  47. package/mcp/meshHttp.js +137 -0
  48. package/mcp/meshTools.js +189 -0
  49. package/mcp/runStdio.js +34 -0
  50. package/mcp/schemaToZod.js +56 -0
  51. package/package.json +24 -9
  52. package/public/.DS_Store +0 -0
  53. package/public/docs/_sidebar.md +3 -1
  54. package/public/docs/llms-full.txt +630 -0
  55. package/public/docs/llms.txt +38 -0
  56. package/public/docs/openapi.yaml +78 -0
  57. package/public/docs/pico-engine.md +239 -4
  58. package/public/docs/pico-overview.md +117 -0
  59. package/public/docs/pico-views-xmlui.md +5 -0
  60. package/public/docs/pico-views.md +140 -0
  61. package/public/docs/pico.md +3 -1
  62. package/public/docs/rulesets/README.md +26 -0
  63. package/public/docs/rulesets/io.picolabs.oauth.md +71 -0
  64. package/public/docs/rulesets/io.picolabs.pds.md +327 -0
  65. package/public/docs/rulesets/io.picolabs.pico-engine-ui.md +65 -0
  66. package/public/docs/rulesets/io.picolabs.portable_subtree.md +94 -0
  67. package/public/docs/rulesets/io.picolabs.subscription.md +398 -0
  68. package/public/docs/rulesets/io.picolabs.wrangler.md +471 -0
  69. package/public/pico-engine-ui.css +1 -1
  70. package/public/pico-engine-ui.js +27 -23
  71. package/public/xmlui/0.12.7.js +419 -0
  72. package/public/xmlui/pico-view-boot.js +153 -0
  73. package/src/RulesetRegistryLoaderFs.ts +66 -7
  74. package/src/auth/cookies.ts +34 -0
  75. package/src/auth/index.ts +7 -0
  76. package/src/channelIdentityPolicy.ts +29 -0
  77. package/src/cli.ts +70 -37
  78. package/src/engineConfig.ts +363 -0
  79. package/src/identity/IdentityService.ts +189 -1
  80. package/src/identity/crossPico.ts +57 -8
  81. package/src/identity/didoModule.ts +140 -23
  82. package/src/identity/establishSubscription.ts +2 -2
  83. package/src/identity/identityPortable.ts +153 -0
  84. package/src/identity/index.ts +14 -0
  85. package/src/identity/localPeerReconcile.ts +97 -0
  86. package/src/identity/peerDid4.ts +197 -0
  87. package/src/identity/peerDid4Create.ts +121 -0
  88. package/src/identity/portableExportPrepare.ts +302 -0
  89. package/src/identity/portableMove.ts +193 -0
  90. package/src/identity/skyIntro.ts +11 -11
  91. package/src/identity/skyProtocol.ts +46 -0
  92. package/src/identity/skyRotation.ts +211 -0
  93. package/src/identity/store.ts +5 -1
  94. package/src/identity/subscriptionEntSync.ts +97 -0
  95. package/src/identity/veramoDidComm.ts +52 -2
  96. package/src/identity/webvh.ts +4 -4
  97. package/src/identity/webvhRelocation.ts +167 -0
  98. package/src/index.ts +123 -31
  99. package/src/logging.ts +173 -18
  100. package/src/oauth/OAuthService.ts +11 -3
  101. package/src/policyConfigFromJson.ts +131 -0
  102. package/src/runMcp.ts +30 -0
  103. package/src/server.ts +328 -27
  104. package/src/stageKrl.ts +26 -0
  105. package/src/subtreeWrangler.ts +278 -0
  106. package/src/uiChannelPolicies.ts +15 -0
  107. package/src/xmluiRuntime.ts +66 -0
  108. package/krl/io.picolabs.did-o.krl +0 -349
@@ -0,0 +1,471 @@
1
+ # io.picolabs.wrangler
2
+
3
+ Wrangler Core Module,
4
+ use example: "use module io.picolabs.wrangler alias wrangler".
5
+ This Ruleset/Module provides a developer interface to the pico (persistent compute object).
6
+ When a pico is created this ruleset will be installed to provide essential services.
7
+
8
+ *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.*
9
+
10
+ **Operations:** [wrangler:install_ruleset_request (install_ruleset_relatively)](#wranglerinstall_ruleset_request-install_ruleset_relatively) · [wrangler:install_ruleset_request (install_ruleset_absolutely)](#wranglerinstall_ruleset_request-install_ruleset_absolutely) · [wrangler:uninstall_ruleset_request](#wrangleruninstall_ruleset_request) · [wrangler:rulesets_need_flushing](#wranglerrulesets_need_flushing) · [wrangler:new_channel_request](#wranglernew_channel_request) · [wrangler:channel_deletion_request](#wranglerchannel_deletion_request) · [wrangler:channel_update_request](#wranglerchannel_update_request) · [wrangler:new_child_request](#wranglernew_child_request) · [wrangler:name_changed](#wranglername_changed) · [wrangler:child_deletion_request](#wranglerchild_deletion_request) · [wrangler:set_public_intro](#wranglerset_public_intro)
11
+ **Queries:** [picoQuery](#picoqueryeci-mod-func-params-_host-_path-_root_url--any) · [channels](#channelstags--array) · [discoveryChannel](#discoverychannel--map) · [rulesetConfig](#rulesetconfigrid--map) · [rulesetMeta](#rulesetmetarid--map) · [installedRIDs](#installedrids--array) · [picoSchema](#picoschema--map) · [rulesetSchema](#rulesetschemarid--map) · [channelSchema](#channelschemaeci--map) · [children](#children--array) · [parent_eci](#parent_eci--string) · [name](#name--string) · [myself](#myself--map) · [myDid](#mydid--string) · [publicIntro](#publicintro--boolean) · [id](#id--string)
12
+
13
+ ## Operations
14
+
15
+ 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.
16
+
17
+ ### `wrangler:install_ruleset_request` (install_ruleset_relatively)
18
+
19
+ Install a ruleset that lives next to another one: the URL is built by replacing the last part of absoluteURL with <rid>.krl (pass meta:rulesetURI to install a sibling of the calling ruleset). Continues as an install by url.
20
+
21
+ **Send:** `wrangler:install_ruleset_request` with `absoluteURL` matches `re#(.+)#` and `rid` matches `re#(.+)#`
22
+ **Rule:** `install_ruleset_relatively`
23
+
24
+ | Attribute | Type | Required | Description |
25
+ |-----------|------|----------|-------------|
26
+ | `absoluteURL` | String | yes | URL of a ruleset in the same directory |
27
+ | `rid` | String | yes | id of the ruleset to install |
28
+ | `config` | Map | no | configuration for the installed ruleset |
29
+
30
+ **Examples:**
31
+
32
+ - **sibling of this ruleset:** `{"absoluteURL":"<meta:rulesetURI>","rid":"<rid>"}`
33
+
34
+ **Acts when:** always, once selected
35
+
36
+ **May emit** (possible, not guaranteed):
37
+
38
+ - raises `wrangler:install_ruleset_request` on this pico — when it acts
39
+
40
+ <details><summary>Select expression</summary>
41
+
42
+ ```krl
43
+ select when wrangler install_ruleset_request
44
+ absoluteURL re#(.+)#
45
+ rid re#(.+)#
46
+ setting(absoluteURL, rid)
47
+ ```
48
+
49
+ </details>
50
+
51
+ ### `wrangler:install_ruleset_request` (install_ruleset_absolutely)
52
+
53
+ Install (or reinstall) a ruleset from a URL on this pico. The URL is fetched and compiled first, so this also picks up a new version. Raises wrangler:ruleset_installed with the installed rid.
54
+
55
+ **Send:** `wrangler:install_ruleset_request` with `url` matches `re#(.+)#`
56
+ **Rule:** `install_ruleset_absolutely`
57
+
58
+ | Attribute | Type | Required | Description |
59
+ |-----------|------|----------|-------------|
60
+ | `url` | String | yes | URL of the .krl file |
61
+ | `config` | Map | no | configuration for the installed ruleset |
62
+
63
+ **Examples:**
64
+
65
+ - **from a URL:** `{"url":"https://example.com/krl/<rid>.krl"}`
66
+ - **with config:** `{"url":"https://example.com/krl/<rid>.krl","config":{"<key>":"<value>"}}`
67
+
68
+ **Acts when:** always, once selected
69
+
70
+ **May emit** (possible, not guaranteed):
71
+
72
+ - raises `wrangler:ruleset_installed` on this pico — when it acts
73
+
74
+ <details><summary>Select expression</summary>
75
+
76
+ ```krl
77
+ select when wrangler install_ruleset_request url re#(.+)# setting(url)
78
+ ```
79
+
80
+ </details>
81
+
82
+ ### `wrangler:uninstall_ruleset_request`
83
+
84
+ Uninstall a ruleset from this pico. Refused if another installed ruleset uses it as a module. Raises wrangler:ruleset_uninstalled.
85
+
86
+ **Send:** `wrangler:uninstall_ruleset_request` with `rid` matches `re#(.+)#`
87
+ **Rule:** `uninstall_one_ruleset`
88
+
89
+ | Attribute | Type | Required | Description |
90
+ |-----------|------|----------|-------------|
91
+ | `rid` | String | yes | ruleset id |
92
+
93
+ **Examples:**
94
+
95
+ - **by rid:** `{"rid":"<rid>"}`
96
+
97
+ **Acts when:** always, once selected
98
+
99
+ **May emit** (possible, not guaranteed):
100
+
101
+ - raises `wrangler:ruleset_uninstalled` on this pico — when it acts
102
+
103
+ <details><summary>Select expression</summary>
104
+
105
+ ```krl
106
+ select when wrangler uninstall_ruleset_request rid re#(.+)# setting(rid)
107
+ ```
108
+
109
+ </details>
110
+
111
+ ### `wrangler:rulesets_need_flushing`
112
+
113
+ Re-fetch and recompile every ruleset installed on this pico, so each picks up its latest source. Raises wrangler:rulesets_flushed when done.
114
+
115
+ **Send:** `wrangler:rulesets_need_flushing`
116
+ **Rule:** `flush_all_rulesets`
117
+
118
+ No attributes.
119
+
120
+ **Acts when:** always, once selected
121
+
122
+ **May emit** (possible, not guaranteed):
123
+
124
+ - raises `wrangler:rulesets_flushed` on this pico — when it acts, after the last iteration
125
+
126
+ <details><summary>Select expression</summary>
127
+
128
+ ```krl
129
+ select when wrangler rulesets_need_flushing
130
+ ```
131
+
132
+ </details>
133
+
134
+ ### `wrangler:new_channel_request`
135
+
136
+ Create a channel on this pico. Raises wrangler:channel_created with the new channel (including its id).
137
+
138
+ **Send:** `wrangler:new_channel_request`
139
+ **Rule:** `createChannel`
140
+
141
+ | Attribute | Type | Required | Description |
142
+ |-----------|------|----------|-------------|
143
+ | `tags` | Array | yes | tags for the channel, e.g. ["myapp", "webhook"] |
144
+ | `eventPolicy` | Map | yes | { allow: [ { domain, name } ], deny: [ … ] } |
145
+ | `queryPolicy` | Map | yes | { allow: [ { rid, name } ], deny: [ … ] } |
146
+
147
+ **Examples:**
148
+
149
+ - **webhook:** `{"tags":["<app>","webhook"],"eventPolicy":{"allow":[{"domain":"<app>","name":"*"}],"deny":[]},"queryPolicy":{"allow":[],"deny":[]}}`
150
+
151
+ **Acts when:** `tags && eventPolicy && queryPolicy`
152
+
153
+ **May emit** (possible, not guaranteed):
154
+
155
+ - raises `wrangler:channel_created` on this pico — when it acts
156
+
157
+ <details><summary>Select expression</summary>
158
+
159
+ ```krl
160
+ select when wrangler new_channel_request
161
+ ```
162
+
163
+ </details>
164
+
165
+ ### `wrangler:channel_deletion_request`
166
+
167
+ Delete a channel on this pico. Raises wrangler:channel_deleted.
168
+
169
+ **Send:** `wrangler:channel_deletion_request` with `eci` matches `re#^(.+)$#`
170
+ **Rule:** `deleteChannel`
171
+
172
+ | Attribute | Type | Required | Description |
173
+ |-----------|------|----------|-------------|
174
+ | `eci` | String | yes | the channel to delete |
175
+
176
+ **Acts when:** always, once selected
177
+
178
+ **May emit** (possible, not guaranteed):
179
+
180
+ - raises `wrangler:channel_deleted` on this pico — when it acts
181
+
182
+ <details><summary>Select expression</summary>
183
+
184
+ ```krl
185
+ select when wrangler channel_deletion_request eci re#^(.+)$# setting(eci)
186
+ ```
187
+
188
+ </details>
189
+
190
+ ### `wrangler:channel_update_request`
191
+
192
+ Replace a channel's tags and policies. Raises wrangler:channel_updated with the updated channel.
193
+
194
+ **Send:** `wrangler:channel_update_request`
195
+ **Rule:** `updateChannel`
196
+
197
+ | Attribute | Type | Required | Description |
198
+ |-----------|------|----------|-------------|
199
+ | `eci` | String | yes | the channel to update |
200
+ | `tags` | Array | yes | new tags |
201
+ | `eventPolicy` | Map | yes | new event policy |
202
+ | `queryPolicy` | Map | yes | new query policy |
203
+
204
+ **Acts when:** `eci && tags && eventPolicy && queryPolicy`
205
+
206
+ **May emit** (possible, not guaranteed):
207
+
208
+ - raises `wrangler:channel_updated` on this pico — when it acts
209
+
210
+ <details><summary>Select expression</summary>
211
+
212
+ ```krl
213
+ select when wrangler channel_update_request
214
+ ```
215
+
216
+ </details>
217
+
218
+ ### `wrangler:new_child_request`
219
+
220
+ Create a child pico with wrangler, PDS, and relationships installed. Raises wrangler:new_child_created here with the child's family-channel eci and uiEci. Other attrs are passed to the child, and come back to this pico in wrangler:child_initialized once the child is set up (Manifold uses this, e.g. event_name, to tell its creations apart).
221
+
222
+ **Send:** `wrangler:new_child_request` with `name` matches `re#.+#` and `backgroundColor` (if given) matches `re#.*#`
223
+ **Rule:** `createChild`
224
+
225
+ | Attribute | Type | Required | Description |
226
+ |-----------|------|----------|-------------|
227
+ | `name` | String | yes | name for the child |
228
+ | `backgroundColor` | String | no | developer UI color, e.g. #87cefa |
229
+ | `policyCeiling` | Map | no | max channel policy for the child pico; must not exceed parent ceiling |
230
+
231
+ **Examples:**
232
+
233
+ - **named:** `{"name":"<name>"}`
234
+ - **with color:** `{"name":"<name>","backgroundColor":"#ffb347"}`
235
+
236
+ **Acts when:** always, once selected
237
+
238
+ **May emit** (possible, not guaranteed):
239
+
240
+ - raises `wrangler:new_child_created` on this pico — when it acts
241
+
242
+ <details><summary>Select expression</summary>
243
+
244
+ ```krl
245
+ select when wrangler new_child_request
246
+ name re#.+#
247
+ backgroundColor re#.*#
248
+ ```
249
+
250
+ </details>
251
+
252
+ ### `wrangler:name_changed`
253
+
254
+ Change this pico's wrangler name (what name() and myself() return).
255
+
256
+ **Send:** `wrangler:name_changed` with `name` matches `re#(.+)#`
257
+ **Rule:** `take_note_of_name_change`
258
+
259
+ | Attribute | Type | Required | Description |
260
+ |-----------|------|----------|-------------|
261
+ | `name` | String | yes | new name |
262
+
263
+ **Acts when:** always, once selected
264
+
265
+ <details><summary>Select expression</summary>
266
+
267
+ ```krl
268
+ select when wrangler name_changed name re#(.+)# setting(name)
269
+ ```
270
+
271
+ </details>
272
+
273
+ ### `wrangler:child_deletion_request`
274
+
275
+ Delete a child pico and all of its descendants. Raises wrangler:child_deleted.
276
+
277
+ **Send:** `wrangler:child_deletion_request` with `eci` matches `re#^(.+)$#`
278
+ **Rule:** `deleteOneChild`
279
+
280
+ | Attribute | Type | Required | Description |
281
+ |-----------|------|----------|-------------|
282
+ | `eci` | String | yes | the child's family-channel ECI (from children()) |
283
+
284
+ **Examples:**
285
+
286
+ - **by eci:** `{"eci":"<child family eci>"}`
287
+
288
+ **Acts when:** always, once selected
289
+
290
+ **May emit** (possible, not guaranteed):
291
+
292
+ - raises `wrangler:child_deleted` on this pico — when it acts
293
+
294
+ <details><summary>Select expression</summary>
295
+
296
+ ```krl
297
+ select when wrangler child_deletion_request eci re#^(.+)$# setting(eci)
298
+ ```
299
+
300
+ </details>
301
+
302
+ ### `wrangler:set_public_intro`
303
+
304
+ Turn on or off accepting unsolicited introduction messages (Layer 2 relationship requests) on this pico's did:webvh. See publicIntro().
305
+
306
+ **Send:** `wrangler:set_public_intro`
307
+ **Rule:** `wrangler_set_public_intro`
308
+
309
+ | Attribute | Type | Required | Description |
310
+ |-----------|------|----------|-------------|
311
+ | `enabled` | Boolean | yes | true to accept introductions |
312
+
313
+ **Examples:**
314
+
315
+ - **accept:** `{"enabled":true}`
316
+ - **refuse:** `{"enabled":false}`
317
+
318
+ **Acts when:** always, once selected
319
+
320
+ **May emit** (possible, not guaranteed):
321
+
322
+ <details><summary>Select expression</summary>
323
+
324
+ ```krl
325
+ select when wrangler set_public_intro
326
+ ```
327
+
328
+ </details>
329
+
330
+ ## Queries
331
+
332
+ ### `picoQuery(eci, mod, func, params, _host, _path, _root_url)` → Any
333
+
334
+ Query a shared function on another pico. Picos on this engine are queried directly (which also works over parent/child family channels); a DID is queried over DIDComm; picos on another engine (_host) over HTTP. Querying one of this pico's own channels is refused. On failure, returns a map with error, httpStatus, and picoQueryError.
335
+
336
+ | Parameter | Type | Required | Default | Description |
337
+ |-----------|------|----------|---------|-------------|
338
+ | `eci` | String | yes | | channel on the other pico, or its DID |
339
+ | `mod` | String | yes | | ruleset id on the other pico |
340
+ | `func` | String | yes | | shared function to call |
341
+ | `params` | Map | yes | | arguments for the function |
342
+ | `_host` | String | yes | | the other pico's engine URL, if on a different engine |
343
+ | `_path` | String | yes | | path prefix on that engine (default /sky/cloud/) |
344
+ | `_root_url` | String | yes | | full query URL prefix, instead of _host and _path |
345
+
346
+ **Examples:**
347
+
348
+ - **child's name:** `{"eci":"<child family eci>","mod":"io.picolabs.wrangler","func":"name"}`
349
+ - **another engine:** `{"eci":"<eci>","mod":"<rid>","func":"<function>","params":{},"_host":"https://other.example"}`
350
+
351
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/picoQuery?eci=…&mod=…&func=…&params=…&_host=…&_path=…&_root_url=…`, or `<alias>:picoQuery(eci, mod, func, params, _host, _path, _root_url)` from KRL with `use module io.picolabs.wrangler alias <alias>`
352
+
353
+ ### `channels(tags)` → Array
354
+
355
+ This pico's channels, with their tags and event and query policies. With tags, only channels whose tags are exactly those (order and case don't matter).
356
+
357
+ | Parameter | Type | Required | Default | Description |
358
+ |-----------|------|----------|---------|-------------|
359
+ | `tags` | String | yes | | comma-separated tags, or an array of tags |
360
+
361
+ **Examples:**
362
+
363
+ - **all:** `{}`
364
+ - **by tags:** `{"tags":"discovery"}`
365
+
366
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/channels?tags=…`, or `<alias>:channels(tags)` from KRL with `use module io.picolabs.wrangler alias <alias>`
367
+
368
+ ### `discoveryChannel()` → Map
369
+
370
+ This pico's discovery channel, which every pico has: integrators query it to learn what the pico can do.
371
+
372
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/discoveryChannel`, or `<alias>:discoveryChannel()` from KRL with `use module io.picolabs.wrangler alias <alias>`
373
+
374
+ ### `rulesetConfig(rid)` → Map
375
+
376
+ The configuration an installed ruleset was installed with, or null if it isn't installed.
377
+
378
+ | Parameter | Type | Required | Default | Description |
379
+ |-----------|------|----------|---------|-------------|
380
+ | `rid` | String | yes | | ruleset id |
381
+
382
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/rulesetConfig?rid=…`, or `<alias>:rulesetConfig(rid)` from KRL with `use module io.picolabs.wrangler alias <alias>`
383
+
384
+ ### `rulesetMeta(rid)` → Map
385
+
386
+ The meta block of an installed ruleset (name, description, shares, provides, …), or null if it isn't installed.
387
+
388
+ | Parameter | Type | Required | Default | Description |
389
+ |-----------|------|----------|---------|-------------|
390
+ | `rid` | String | yes | | ruleset id |
391
+
392
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/rulesetMeta?rid=…`, or `<alias>:rulesetMeta(rid)` from KRL with `use module io.picolabs.wrangler alias <alias>`
393
+
394
+ ### `installedRIDs()` → Array
395
+
396
+ Ids of the rulesets installed on this pico.
397
+
398
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/installedRIDs`, or `<alias>:installedRIDs()` from KRL with `use module io.picolabs.wrangler alias <alias>`
399
+
400
+ ### `picoSchema()` → Map
401
+
402
+ Everything discoverable on this pico: the annotated operations and queries of all installed rulesets, merged and grouped by event, with any attr type conflicts between rulesets. For discovery and generated tools (MCP).
403
+
404
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/picoSchema`, or `<alias>:picoSchema()` from KRL with `use module io.picolabs.wrangler alias <alias>`
405
+
406
+ ### `rulesetSchema(rid?)` → Map
407
+
408
+ The discovery schema of one installed ruleset: its annotated operations (with their select, condition, prechecks, emits, and the other rules on the same event) and queries. What the Testing tab shows. Null if not installed.
409
+
410
+ | Parameter | Type | Required | Default | Description |
411
+ |-----------|------|----------|---------|-------------|
412
+ | `rid` | String | no | | ruleset id |
413
+
414
+ **Examples:**
415
+
416
+ - **one ruleset:** `{"rid":"io.picolabs.pds"}`
417
+ - **all installed:** `{}`
418
+
419
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/rulesetSchema?rid=…`, or `<alias>:rulesetSchema(rid?)` from KRL with `use module io.picolabs.wrangler alias <alias>`
420
+
421
+ ### `channelSchema(eci)` → Map
422
+
423
+ The part of picoSchema() a channel allows: what a caller holding this ECI can discover and use. Use the caller's own ECI for "what can I do here?", or any channel to check what it would expose.
424
+
425
+ | Parameter | Type | Required | Default | Description |
426
+ |-----------|------|----------|---------|-------------|
427
+ | `eci` | String | yes | | channel on this pico |
428
+
429
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/channelSchema?eci=…`, or `<alias>:channelSchema(eci)` from KRL with `use module io.picolabs.wrangler alias <alias>`
430
+
431
+ ### `children()` → Array
432
+
433
+ This pico's children, each with its family-channel ECI, name, and parent ECI.
434
+
435
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/children`, or `<alias>:children()` from KRL with `use module io.picolabs.wrangler alias <alias>`
436
+
437
+ ### `parent_eci()` → String
438
+
439
+ The family-channel ECI of this pico's parent; null for a root pico.
440
+
441
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/parent_eci`, or `<alias>:parent_eci()` from KRL with `use module io.picolabs.wrangler alias <alias>`
442
+
443
+ ### `name()` → String
444
+
445
+ This pico's wrangler name.
446
+
447
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/name`, or `<alias>:name()` from KRL with `use module io.picolabs.wrangler alias <alias>`
448
+
449
+ ### `myself()` → Map
450
+
451
+ This pico's wrangler name, id, and the ECI it was created with.
452
+
453
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/myself`, or `<alias>:myself()` from KRL with `use module io.picolabs.wrangler alias <alias>`
454
+
455
+ ### `myDid()` → String
456
+
457
+ This pico's portable did:webvh, the identity other picos and meshes use for Layer 2 relationships. It survives moving the pico to another engine.
458
+
459
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/myDid`, or `<alias>:myDid()` from KRL with `use module io.picolabs.wrangler alias <alias>`
460
+
461
+ ### `publicIntro()` → Boolean
462
+
463
+ True when this pico accepts unsolicited introduction messages (Layer 2 relationship requests) on its did:webvh. Change it with wrangler:set_public_intro.
464
+
465
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/publicIntro`, or `<alias>:publicIntro()` from KRL with `use module io.picolabs.wrangler alias <alias>`
466
+
467
+ ### `id()` → String
468
+
469
+ This pico's id.
470
+
471
+ **Call:** `GET /sky/query/<eci>/io.picolabs.wrangler/id`, or `<alias>:id()` from KRL with `use module io.picolabs.wrangler alias <alias>`