pico-engine 1.6.4 → 1.8.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 (98) hide show
  1. package/README.md +13 -8
  2. package/dist/RulesetRegistryLoaderFs.js +14 -2
  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 +104 -69
  7. package/dist/engineConfig.js +280 -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 +82 -22
  28. package/dist/logging.js +8 -12
  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 +56 -24
  33. package/dist/subtreeWrangler.js +180 -0
  34. package/dist/uiChannelPolicies.js +15 -0
  35. package/krl/io.picolabs.oauth.krl +41 -2
  36. package/krl/io.picolabs.pds.krl +131 -10
  37. package/krl/io.picolabs.pico-engine-ui.krl +209 -21
  38. package/krl/io.picolabs.portable_subtree.krl +97 -0
  39. package/krl/io.picolabs.subscription.krl +180 -72
  40. package/krl/io.picolabs.wrangler.krl +296 -57
  41. package/mcp/devResources.js +118 -0
  42. package/mcp/devTools.js +351 -0
  43. package/mcp/engineClient.js +133 -0
  44. package/mcp/meshHttp.js +137 -0
  45. package/mcp/meshTools.js +189 -0
  46. package/mcp/runStdio.js +34 -0
  47. package/mcp/schemaToZod.js +56 -0
  48. package/package.json +20 -8
  49. package/public/docs/_sidebar.md +2 -1
  50. package/public/docs/llms-full.txt +479 -0
  51. package/public/docs/llms.txt +37 -0
  52. package/public/docs/openapi.yaml +78 -0
  53. package/public/docs/pico-engine.md +235 -4
  54. package/public/docs/pico-overview.md +117 -0
  55. package/public/docs/pico.md +3 -1
  56. package/public/docs/rulesets/README.md +25 -0
  57. package/public/docs/rulesets/io.picolabs.oauth.md +71 -0
  58. package/public/docs/rulesets/io.picolabs.pds.md +327 -0
  59. package/public/docs/rulesets/io.picolabs.pico-engine-ui.md +65 -0
  60. package/public/docs/rulesets/io.picolabs.portable_subtree.md +94 -0
  61. package/public/docs/rulesets/io.picolabs.subscription.md +398 -0
  62. package/public/docs/rulesets/io.picolabs.wrangler.md +471 -0
  63. package/public/pico-engine-ui.css +1 -1
  64. package/public/pico-engine-ui.js +28 -26
  65. package/src/RulesetRegistryLoaderFs.ts +18 -3
  66. package/src/auth/cookies.ts +34 -0
  67. package/src/auth/index.ts +7 -0
  68. package/src/channelIdentityPolicy.ts +29 -0
  69. package/src/cli.ts +68 -37
  70. package/src/engineConfig.ts +345 -0
  71. package/src/identity/IdentityService.ts +189 -1
  72. package/src/identity/crossPico.ts +57 -8
  73. package/src/identity/didoModule.ts +140 -23
  74. package/src/identity/establishSubscription.ts +2 -2
  75. package/src/identity/identityPortable.ts +153 -0
  76. package/src/identity/index.ts +14 -0
  77. package/src/identity/localPeerReconcile.ts +97 -0
  78. package/src/identity/peerDid4.ts +197 -0
  79. package/src/identity/peerDid4Create.ts +121 -0
  80. package/src/identity/portableExportPrepare.ts +302 -0
  81. package/src/identity/portableMove.ts +193 -0
  82. package/src/identity/skyIntro.ts +11 -11
  83. package/src/identity/skyProtocol.ts +46 -0
  84. package/src/identity/skyRotation.ts +211 -0
  85. package/src/identity/store.ts +5 -1
  86. package/src/identity/subscriptionEntSync.ts +97 -0
  87. package/src/identity/veramoDidComm.ts +52 -2
  88. package/src/identity/webvh.ts +4 -4
  89. package/src/identity/webvhRelocation.ts +167 -0
  90. package/src/index.ts +119 -25
  91. package/src/logging.ts +8 -14
  92. package/src/oauth/OAuthService.ts +11 -3
  93. package/src/policyConfigFromJson.ts +131 -0
  94. package/src/runMcp.ts +30 -0
  95. package/src/server.ts +79 -26
  96. package/src/subtreeWrangler.ts +278 -0
  97. package/src/uiChannelPolicies.ts +15 -0
  98. package/krl/io.picolabs.did-o.krl +0 -349
@@ -0,0 +1,398 @@
1
+ # io.picolabs.subscription
2
+
3
+ Pico-to-pico relationships (Tx/Rx). User-facing term: relationship.
4
+ Ruleset RID io.picolabs.subscription is stable; prefer module alias relationship.
5
+
6
+ *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.*
7
+
8
+ **Operations:** [wrangler:cancel_subscriptions](#wranglercancel_subscriptions) · [wrangler:subscription](#wranglersubscription--wranglerrelationship) · [wrangler:pending_subscription_approval](#wranglerpending_subscription_approval--wranglerpending_relationship_approval) · [wrangler:subscription_cancellation](#wranglersubscription_cancellation--wranglerrelationship_cancellation) · [wrangler:inbound_rejection](#wranglerinbound_rejection--wranglerinbound_relationship_rejection) · [wrangler:outbound_cancellation](#wrangleroutbound_cancellation--wrangleroutbound_relationship_cancellation) · [wrangler:send_event_on_subs](#wranglersend_event_on_subs--wranglersend_event_on_relationships) · [wrangler:autoAcceptConfigUpdate](#wranglerautoacceptconfigupdate)
9
+ **Queries:** [established](#establishedkey-value--array) · [outbound](#outboundkey-value--array) · [inbound](#inboundkey-value--array) · [wellKnown_Rx](#wellknown_rx--map) · [autoAcceptConfig](#autoacceptconfig--map) · [queryOnSub](#queryonsubsubid-rid-name-args--any)
10
+
11
+ ## Operations
12
+
13
+ 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.
14
+
15
+ ### `wrangler:cancel_subscriptions`
16
+
17
+ Cancel every relationship this pico has: established ones are cancelled, inbound requests rejected, and outbound requests withdrawn, notifying the other picos. Used before deleting a pico.
18
+
19
+ **Send:** `wrangler:cancel_subscriptions`
20
+ **Rule:** `cancel_all_subscriptions`
21
+
22
+ No attributes.
23
+
24
+ **Acts when:** always, once selected
25
+
26
+ **May emit** (possible, not guaranteed):
27
+
28
+ - raises `wrangler:cancel_relationships` on this pico — always
29
+
30
+ <details><summary>Select expression</summary>
31
+
32
+ ```krl
33
+ select when wrangler cancel_subscriptions
34
+ ```
35
+
36
+ </details>
37
+
38
+ ### `wrangler:subscription` · `wrangler:relationship`
39
+
40
+ Request a relationship with another pico. Legacy (default): give the other pico's well-known channel as wellKnown_Tx. Layer 2: set layer2 true and give the other pico's DID as target_did; the request goes over DIDComm. The request is recorded in outbound() until the other side approves (or auto-accepts), then moves to established() and wrangler:subscription_added is raised. A request to this pico itself, or one missing wellKnown_Tx / target_did, raises self_relationship_failure, wellKnown_Tx_format_failure, or target_did_format_failure instead.
41
+
42
+ **Send:** `wrangler:subscription`, or `wrangler:relationship`
43
+ **Rule:** `createRxBus`
44
+
45
+ | Attribute | Type | Required | Description |
46
+ |-----------|------|----------|-------------|
47
+ | `wellKnown_Tx` | String | no | legacy: the other pico's well-known channel id (its wellKnown_Rx) |
48
+ | `layer2` | Boolean | no | true for a DID-based Layer 2 relationship |
49
+ | `target_did` | String | no | Layer 2: the other pico's DID |
50
+ | `name` | String | no | relationship name (random word if omitted) |
51
+ | `Rx_role` | String | no | this pico's role in the relationship |
52
+ | `Tx_role` | String | no | the other pico's role |
53
+ | `channel_type` | String | no | channel type for the new channel (default Tx_Rx) |
54
+ | `Tx_host` | String | no | legacy: the other pico's engine URL, if on a different engine |
55
+ | `password` | String | no | for the other pico's auto-accept config |
56
+ | `Id` | Any | no | |
57
+ | `picoID` | Any | no | |
58
+
59
+ **Examples:**
60
+
61
+ - **same engine:** `{"wellKnown_Tx":"<eci>"}`
62
+ - **same engine, with roles:** `{"wellKnown_Tx":"<eci>","name":"<name>","Rx_role":"<my role>","Tx_role":"<their role>"}`
63
+ - **another engine:** `{"wellKnown_Tx":"<eci>","Tx_host":"https://other.example"}`
64
+ - **auto-accept password:** `{"wellKnown_Tx":"<eci>","password":"<password>"}`
65
+ - **Layer 2:** `{"layer2":true,"target_did":"<did>"}`
66
+
67
+ **Acts when:** `not layer2 && pending_entry{"wellKnown_Tx"} && (pending_entry{"wellKnown_Tx"} != wellKnown_Rx(){"id"})`
68
+
69
+ **May emit** (possible, not guaranteed):
70
+
71
+ - raises `wrangler:subscription_request_needed` on this pico — when it acts
72
+ - raises `wrangler:outbound_pending_subscription_added` on this pico — when it acts
73
+ - raises `wrangler:outbound_pending_relationship_added` on this pico — when it acts
74
+
75
+ **Other rules on the same event:**
76
+
77
+ - `createRxBusLegacySelfFailure` — selects only `wrangler subscription where (not event:attr("layer2") == true) && (event:attr("wellKnown_Tx") == wellKnown_Rx(){"id"}) or wrangler relationship where (not event:attr("layer2") == true) && (event:attr("wellKnown_Tx") == wellKnown_Rx(){"id"})`
78
+ - `createRxBusLegacyFailure` — acts when `not layer2 && not hasWellKnown`
79
+ - `createRxBusLayer2` — acts when `layer2 && target_did && (target_did != wrangler:myDid())`
80
+ - `createRxBusLayer2SelfFailure` — selects only `wrangler subscription where (event:attr("layer2") == true) && (event:attr("target_did") == wrangler:myDid()) or wrangler relationship where (event:attr("layer2") == true) && (event:attr("target_did") == wrangler:myDid())`
81
+ - `createRxBusLayer2Failure` — acts when `layer2 && not target_did`
82
+
83
+ <details><summary>Select expression</summary>
84
+
85
+ ```krl
86
+ select when wrangler subscription
87
+ or
88
+ wrangler relationship
89
+ ```
90
+
91
+ </details>
92
+
93
+ ### `wrangler:pending_subscription_approval` · `wrangler:pending_relationship_approval`
94
+
95
+ Approve a pending inbound relationship request (one listed in inbound()). The requesting pico is notified, and both sides raise wrangler:subscription_added once it is established. Works for legacy and Layer 2 requests.
96
+
97
+ **Send:** `wrangler:pending_subscription_approval`, or `wrangler:pending_relationship_approval`
98
+ **Rule:** `approveInboundPendingSubscription`
99
+
100
+ | Attribute | Type | Required | Description |
101
+ |-----------|------|----------|-------------|
102
+ | `Id` | String | no | relationship id; or identify it by Rx or Tx instead |
103
+ | `Rx` | String | no | this pico's channel for the relationship |
104
+ | `Tx` | String | no | the other pico's channel for the relationship |
105
+
106
+ **Examples:**
107
+
108
+ - **by id:** `{"Id":"<relationship id>"}`
109
+
110
+ **Acts when:** `(not bus{"layer2"} == true) && bus`
111
+
112
+ **May emit** (possible, not guaranteed):
113
+
114
+ - sends `wrangler:outbound_pending_subscription_approved` to `bus{"Tx"}`
115
+ - raises `wrangler:inbound_pending_subscription_approved` on this pico — when it acts
116
+ - raises `wrangler:inbound_pending_relationship_approved` on this pico — when it acts
117
+
118
+ **Other rules on the same event:**
119
+
120
+ - `approveInboundPendingSubscriptionLayer2` — acts when `bus{"layer2"} == true`
121
+
122
+ <details><summary>Select expression</summary>
123
+
124
+ ```krl
125
+ select when wrangler pending_subscription_approval
126
+ or
127
+ wrangler pending_relationship_approval
128
+ ```
129
+
130
+ </details>
131
+
132
+ ### `wrangler:subscription_cancellation` · `wrangler:relationship_cancellation`
133
+
134
+ End an established relationship. It is removed on both picos, and the other pico is notified (over DIDComm for Layer 2). wrangler:subscription_removed is raised when done.
135
+
136
+ **Send:** `wrangler:subscription_cancellation`, or `wrangler:relationship_cancellation`
137
+ **Rule:** `cancelEstablished`
138
+
139
+ | Attribute | Type | Required | Description |
140
+ |-----------|------|----------|-------------|
141
+ | `Id` | String | no | relationship id; or identify it by Rx or Tx instead |
142
+ | `Rx` | String | no | this pico's channel for the relationship |
143
+ | `Tx` | String | no | the other pico's channel for the relationship |
144
+
145
+ **Examples:**
146
+
147
+ - **by id:** `{"Id":"<relationship id>"}`
148
+ - **by this pico's channel:** `{"Rx":"<eci>"}`
149
+
150
+ **Acts when:** `(not bus{"layer2"} == true) && bus`
151
+
152
+ **May emit** (possible, not guaranteed):
153
+
154
+ - sends `wrangler:established_removal` to `bus{"Tx"}`
155
+ - raises `wrangler:established_removal` on this pico — when it acts
156
+
157
+ **Other rules on the same event:**
158
+
159
+ - `cancelEstablishedLayer2` — acts when `bus{"layer2"} == true`
160
+
161
+ <details><summary>Select expression</summary>
162
+
163
+ ```krl
164
+ select when wrangler subscription_cancellation
165
+ or
166
+ wrangler relationship_cancellation
167
+ ```
168
+
169
+ </details>
170
+
171
+ ### `wrangler:inbound_rejection` · `wrangler:inbound_relationship_rejection`
172
+
173
+ Reject a pending inbound relationship request (one listed in inbound()). The requesting pico is notified and removes it from its outbound().
174
+
175
+ **Send:** `wrangler:inbound_rejection`, or `wrangler:inbound_relationship_rejection`
176
+ **Rule:** `cancelInbound`
177
+
178
+ | Attribute | Type | Required | Description |
179
+ |-----------|------|----------|-------------|
180
+ | `Id` | String | no | relationship id; or identify it by Rx or Tx instead |
181
+ | `Rx` | String | no | this pico's channel for the relationship |
182
+ | `Tx` | String | no | the other pico's channel for the relationship |
183
+
184
+ **Examples:**
185
+
186
+ - **by id:** `{"Id":"<relationship id>"}`
187
+
188
+ **Acts when:** `(not bus{"layer2"} == true) && bus`
189
+
190
+ **May emit** (possible, not guaranteed):
191
+
192
+ - sends `wrangler:outbound_removal` to `bus{"Tx"}`
193
+ - raises `wrangler:inbound_removal` on this pico — always
194
+
195
+ **Other rules on the same event:**
196
+
197
+ - `cancelInboundLayer2` — acts when `bus{"layer2"} == true`
198
+
199
+ <details><summary>Select expression</summary>
200
+
201
+ ```krl
202
+ select when wrangler inbound_rejection
203
+ or
204
+ wrangler inbound_relationship_rejection
205
+ ```
206
+
207
+ </details>
208
+
209
+ ### `wrangler:outbound_cancellation` · `wrangler:outbound_relationship_cancellation`
210
+
211
+ Withdraw a relationship request this pico sent that hasn't been approved yet (one listed in outbound()). The other pico is notified and removes it from its inbound().
212
+
213
+ **Send:** `wrangler:outbound_cancellation`, or `wrangler:outbound_relationship_cancellation`
214
+ **Rule:** `cancelOutbound`
215
+
216
+ | Attribute | Type | Required | Description |
217
+ |-----------|------|----------|-------------|
218
+ | `Id` | String | no | relationship id; or identify it by Rx or Tx instead |
219
+ | `Rx` | String | no | this pico's channel for the relationship |
220
+ | `Tx` | String | no | the other pico's channel for the relationship |
221
+
222
+ **Examples:**
223
+
224
+ - **by id:** `{"Id":"<relationship id>"}`
225
+
226
+ **Acts when:** `(not bus{"layer2"} == true) && bus`
227
+
228
+ **May emit** (possible, not guaranteed):
229
+
230
+ - sends `wrangler:inbound_removal` to `bus{"wellKnown_Tx"}`
231
+ - raises `wrangler:outbound_removal` on this pico — always
232
+
233
+ **Other rules on the same event:**
234
+
235
+ - `cancelOutboundLayer2` — acts when `bus{"layer2"} == true`
236
+
237
+ <details><summary>Select expression</summary>
238
+
239
+ ```krl
240
+ select when wrangler outbound_cancellation
241
+ or
242
+ wrangler outbound_relationship_cancellation
243
+ ```
244
+
245
+ </details>
246
+
247
+ ### `wrangler:send_event_on_subs` · `wrangler:send_event_on_relationships`
248
+
249
+ Send an event to the picos at the other end of established relationships, selected by relationship id and/or by role. Each match receives the event on its channel (over DIDComm for Layer 2). If nothing matches, or domain or type is missing, raises wrangler:failed_to_send_event_to_relationship instead.
250
+
251
+ **Send:** `wrangler:send_event_on_subs`, or `wrangler:send_event_on_relationships`
252
+ **Rule:** `sendEventToSubCheck`
253
+
254
+ | Attribute | Type | Required | Description |
255
+ |-----------|------|----------|-------------|
256
+ | `domain` | String | yes | domain of the event to send |
257
+ | `type` | String | yes | type of the event to send |
258
+ | `attrs` | Map | no | attributes of the event to send |
259
+ | `subID` | String | no | send on this relationship |
260
+ | `Tx_role` | String | no | send on every relationship where the other pico has this role |
261
+ | `Rx_role` | String | no | send on every relationship where this pico has this role |
262
+
263
+ **Examples:**
264
+
265
+ - **one relationship:** `{"subID":"<relationship id>","domain":"<domain>","type":"<type>","attrs":{}}`
266
+ - **everyone with a role:** `{"Tx_role":"<their role>","domain":"<domain>","type":"<type>","attrs":{}}`
267
+
268
+ **Acts when:** `(subs.length() > 0) && event:attr("domain") && event:attr("type")`
269
+
270
+ **May emit** (possible, not guaranteed):
271
+
272
+ - raises `wrangler:send_event_to_subs` on this pico — when it acts
273
+ - raises `wrangler:failed_to_send_event_to_sub` on this pico — when it doesn't act
274
+ - raises `wrangler:failed_to_send_event_to_relationship` on this pico — when it doesn't act
275
+
276
+ <details><summary>Select expression</summary>
277
+
278
+ ```krl
279
+ select when wrangler send_event_on_subs
280
+ or
281
+ wrangler send_event_on_relationships
282
+ ```
283
+
284
+ </details>
285
+
286
+ ### `wrangler:autoAcceptConfigUpdate`
287
+
288
+ Add, replace, or delete an auto-accept config. An incoming relationship request is approved automatically when, for any config, one of its entries matches: an entry maps an attr name to a list of regexes, and matches when the request's attr matches any of them. Give the whole config as config, or its parts as configName, regexMap, and password. Raises wrangler:auto_accept_config_updated, or autoAcceptConfigUpdate_failure when there is no config name.
289
+
290
+ **Send:** `wrangler:autoAcceptConfigUpdate`
291
+ **Rule:** `autoAcceptConfigUpdate`
292
+
293
+ | Attribute | Type | Required | Description |
294
+ |-----------|------|----------|-------------|
295
+ | `configName` | String | no | name of the config to set or delete |
296
+ | `regexMap` | String | no | the entries, JSON-encoded: { <attr>: [regex, …] } |
297
+ | `config` | Map | no | the whole config instead: { configName, password, entries } |
298
+ | `password` | String | no | stored with the config; not currently checked |
299
+ | `delete` | Boolean | no | true to delete the named config |
300
+
301
+ **Examples:**
302
+
303
+ - **accept a role:** `{"config":{"configName":"<name>","entries":{"Tx_role":["^<role>$"]}}}`
304
+ - **delete:** `{"configName":"<name>","delete":true}`
305
+
306
+ **Acts when:** `givenName.klog("configName")`
307
+
308
+ **May emit** (possible, not guaranteed):
309
+
310
+ - raises `wrangler:auto_accept_config_updated` on this pico — when it acts
311
+ - raises `wrangler:autoAcceptConfigUpdate_failure` on this pico — when it doesn't act
312
+
313
+ <details><summary>Select expression</summary>
314
+
315
+ ```krl
316
+ select when wrangler autoAcceptConfigUpdate
317
+ ```
318
+
319
+ </details>
320
+
321
+ ## Queries
322
+
323
+ ### `established(key?, value?)` → Array
324
+
325
+ Established relationships, optionally only those whose field `key` equals `value` (e.g. key "Tx_role", value "manifold_thing"). Each has Id, Rx (this pico's channel), Tx (the other pico's channel), roles, name, and, for Layer 2 relationships, layer2 and the peer DIDs.
326
+
327
+ | Parameter | Type | Required | Default | Description |
328
+ |-----------|------|----------|---------|-------------|
329
+ | `key` | String | no | | field to filter on, e.g. Id, Tx_role, Rx_role |
330
+ | `value` | Any | no | | value the field must equal |
331
+
332
+ **Examples:**
333
+
334
+ - **all:** `{}`
335
+ - **by role:** `{"key":"Tx_role","value":"<their role>"}`
336
+
337
+ **Call:** `GET /sky/query/<eci>/io.picolabs.subscription/established?key=…&value=…`, or `<alias>:established(key?, value?)` from KRL with `use module io.picolabs.subscription alias <alias>`
338
+
339
+ ### `outbound(key?, value?)` → Array
340
+
341
+ Relationship requests this pico has sent that are still waiting for the other side to approve. Optional filter as for established().
342
+
343
+ | Parameter | Type | Required | Default | Description |
344
+ |-----------|------|----------|---------|-------------|
345
+ | `key` | String | no | | field to filter on |
346
+ | `value` | Any | no | | value the field must equal |
347
+
348
+ **Examples:**
349
+
350
+ - **all:** `{}`
351
+ - **by id:** `{"key":"Id","value":"<relationship id>"}`
352
+
353
+ **Call:** `GET /sky/query/<eci>/io.picolabs.subscription/outbound?key=…&value=…`, or `<alias>:outbound(key?, value?)` from KRL with `use module io.picolabs.subscription alias <alias>`
354
+
355
+ ### `inbound(key?, value?)` → Array
356
+
357
+ Relationship requests other picos have sent to this one that are waiting for approval (approve with wrangler:pending_relationship_approval). Optional filter as for established().
358
+
359
+ | Parameter | Type | Required | Default | Description |
360
+ |-----------|------|----------|---------|-------------|
361
+ | `key` | String | no | | field to filter on |
362
+ | `value` | Any | no | | value the field must equal |
363
+
364
+ **Examples:**
365
+
366
+ - **all:** `{}`
367
+ - **by id:** `{"key":"Id","value":"<relationship id>"}`
368
+
369
+ **Call:** `GET /sky/query/<eci>/io.picolabs.subscription/inbound?key=…&value=…`, or `<alias>:inbound(key?, value?)` from KRL with `use module io.picolabs.subscription alias <alias>`
370
+
371
+ ### `wellKnown_Rx()` → Map
372
+
373
+ This pico's well-known channel: the one other picos send relationship requests to (give its id as wellKnown_Tx when requesting a relationship with this pico).
374
+
375
+ **Call:** `GET /sky/query/<eci>/io.picolabs.subscription/wellKnown_Rx`, or `<alias>:wellKnown_Rx()` from KRL with `use module io.picolabs.subscription alias <alias>`
376
+
377
+ ### `autoAcceptConfig()` → Map
378
+
379
+ Auto-accept rules for incoming relationship requests, keyed by config name. A request is accepted automatically when any config's entries match: each entry maps an attr name to a list of regexes tested against that attr.
380
+
381
+ **Call:** `GET /sky/query/<eci>/io.picolabs.subscription/autoAcceptConfig`, or `<alias>:autoAcceptConfig()` from KRL with `use module io.picolabs.subscription alias <alias>`
382
+
383
+ ### `queryOnSub(subId, rid, name, args)` → Any
384
+
385
+ Query a function on the pico at the other end of an established relationship. Layer 2 relationships go over DIDComm (or verified local dispatch); legacy ones query the other pico's Tx channel. Null if no relationship has that id.
386
+
387
+ | Parameter | Type | Required | Default | Description |
388
+ |-----------|------|----------|---------|-------------|
389
+ | `subId` | String | yes | | relationship id |
390
+ | `rid` | String | yes | | ruleset id on the other pico |
391
+ | `name` | String | yes | | shared function to call |
392
+ | `args` | Map | yes | | arguments for the function |
393
+
394
+ **Examples:**
395
+
396
+ - **other pico's name:** `{"subId":"<relationship id>","rid":"io.picolabs.wrangler","name":"name"}`
397
+
398
+ **Call:** `GET /sky/query/<eci>/io.picolabs.subscription/queryOnSub?subId=…&rid=…&name=…&args=…`, or `<alias>:queryOnSub(subId, rid, name, args)` from KRL with `use module io.picolabs.subscription alias <alias>`