pico-engine 1.8.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 +5 -3
- package/dist/RulesetRegistryLoaderFs.js +46 -4
- package/dist/cli.js +3 -1
- package/dist/engineConfig.js +11 -0
- package/dist/index.js +2 -5
- package/dist/logging.js +148 -4
- package/dist/server.js +206 -1
- package/dist/stageKrl.js +26 -0
- package/dist/xmluiRuntime.js +68 -0
- package/krl/io.picolabs.pico-engine-ui.krl +14 -77
- package/krl/io.picolabs.wrangler.krl +28 -5
- package/krl/io.picolabs.xmlui.krl +305 -0
- package/mcp/devResources.js +17 -7
- package/mcp/docs/CLAUDE.md +85 -0
- package/{public → mcp}/docs/pico-engine.md +15 -11
- package/package.json +11 -7
- package/public/pico-engine-ui.css +1 -1
- package/public/pico-engine-ui.js +27 -25
- package/public/xmlui/0.12.7.js +419 -0
- package/public/xmlui/pico-view-boot.js +153 -0
- package/src/RulesetRegistryLoaderFs.ts +48 -4
- package/src/cli.ts +3 -1
- package/src/engineConfig.ts +18 -0
- package/src/index.ts +4 -6
- package/src/logging.ts +165 -4
- package/src/server.ts +250 -2
- package/src/stageKrl.ts +26 -0
- package/src/xmluiRuntime.ts +66 -0
- package/public/docs/README.md +0 -9
- package/public/docs/_media/logo.png +0 -0
- package/public/docs/_sidebar.md +0 -6
- 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 -479
- package/public/docs/llms.txt +0 -37
- package/public/docs/openapi.yaml +0 -78
- package/public/docs/pico.md +0 -5
- package/public/docs/rulesets/README.md +0 -25
- 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,398 +0,0 @@
|
|
|
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>`
|