pico-engine 1.6.0 → 1.6.2
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/dist/uiChannelPolicies.js +5 -0
- package/krl/io.picolabs.pico-engine-ui.krl +5 -0
- package/krl/io.picolabs.subscription.krl +23 -0
- package/package.json +3 -2
- package/public/docs/krl/discovery.md +1 -1
- package/public/docs/krl/modules/event.md +6 -4
- package/public/pico-engine-ui.css +1 -1
- package/public/pico-engine-ui.js +12 -12
- package/src/uiChannelPolicies.ts +5 -0
|
@@ -17,10 +17,15 @@ exports.UI_CHANNEL_EVENT_POLICY = {
|
|
|
17
17
|
{ domain: "engine_ui", name: "testing_eci" },
|
|
18
18
|
{ domain: "engine", name: "started" },
|
|
19
19
|
{ domain: "wrangler", name: "subscription" },
|
|
20
|
+
{ domain: "wrangler", name: "relationship" },
|
|
20
21
|
{ domain: "wrangler", name: "pending_subscription_approval" },
|
|
22
|
+
{ domain: "wrangler", name: "pending_relationship_approval" },
|
|
21
23
|
{ domain: "wrangler", name: "inbound_rejection" },
|
|
24
|
+
{ domain: "wrangler", name: "inbound_relationship_rejection" },
|
|
22
25
|
{ domain: "wrangler", name: "outbound_cancellation" },
|
|
26
|
+
{ domain: "wrangler", name: "outbound_relationship_cancellation" },
|
|
23
27
|
{ domain: "wrangler", name: "subscription_cancellation" },
|
|
28
|
+
{ domain: "wrangler", name: "relationship_cancellation" },
|
|
24
29
|
{ domain: "wrangler", name: "set_public_intro" },
|
|
25
30
|
{ domain: "wrangler", name: "send_event_on_subs" },
|
|
26
31
|
],
|
|
@@ -143,10 +143,15 @@ ruleset io.picolabs.pico-engine-ui {
|
|
|
143
143
|
{ "domain": "engine_ui", "name": "testing_eci" },
|
|
144
144
|
{ "domain": "engine", "name": "started" },
|
|
145
145
|
{ "domain": "wrangler", "name": "subscription" },
|
|
146
|
+
{ "domain": "wrangler", "name": "relationship" },
|
|
146
147
|
{ "domain": "wrangler", "name": "pending_subscription_approval" },
|
|
148
|
+
{ "domain": "wrangler", "name": "pending_relationship_approval" },
|
|
147
149
|
{ "domain": "wrangler", "name": "inbound_rejection" },
|
|
150
|
+
{ "domain": "wrangler", "name": "inbound_relationship_rejection" },
|
|
148
151
|
{ "domain": "wrangler", "name": "outbound_cancellation" },
|
|
152
|
+
{ "domain": "wrangler", "name": "outbound_relationship_cancellation" },
|
|
149
153
|
{ "domain": "wrangler", "name": "subscription_cancellation" },
|
|
154
|
+
{ "domain": "wrangler", "name": "relationship_cancellation" },
|
|
150
155
|
{ "domain": "wrangler", "name": "set_public_intro" },
|
|
151
156
|
{ "domain": "wrangler", "name": "send_event_on_subs" }
|
|
152
157
|
],
|
|
@@ -25,14 +25,24 @@ ruleset io.picolabs.subscription {
|
|
|
25
25
|
"attrs": [ "wellKnown_Tx","password"] },
|
|
26
26
|
{ "domain": "wrangler", "name": "subscription",
|
|
27
27
|
"attrs": [ "wellKnown_Tx"] },
|
|
28
|
+
{ "domain": "wrangler", "name": "relationship",
|
|
29
|
+
"attrs": [ "wellKnown_Tx","Rx_role","Tx_role","name","channel_type","Tx_host","password","layer2","target_did"] },
|
|
28
30
|
{ "domain": "wrangler", "name": "pending_subscription_approval",
|
|
29
31
|
"attrs": [ "Id" ] },
|
|
32
|
+
{ "domain": "wrangler", "name": "pending_relationship_approval",
|
|
33
|
+
"attrs": [ "Id" ] },
|
|
30
34
|
{ "domain": "wrangler", "name": "subscription_cancellation",
|
|
31
35
|
"attrs": [ "Id" ] },
|
|
36
|
+
{ "domain": "wrangler", "name": "relationship_cancellation",
|
|
37
|
+
"attrs": [ "Id" ] },
|
|
32
38
|
{ "domain": "wrangler", "name": "inbound_rejection",
|
|
33
39
|
"attrs": [ "Id" ] },
|
|
40
|
+
{ "domain": "wrangler", "name": "inbound_relationship_rejection",
|
|
41
|
+
"attrs": [ "Id" ] },
|
|
34
42
|
{ "domain": "wrangler", "name": "outbound_cancellation",
|
|
35
43
|
"attrs": [ "Id" ] },
|
|
44
|
+
{ "domain": "wrangler", "name": "outbound_relationship_cancellation",
|
|
45
|
+
"attrs": [ "Id" ] },
|
|
36
46
|
{ "domain": "wrangler", "name": "autoAcceptConfigUpdate",
|
|
37
47
|
"attrs": [ "configName", "password", "regexMap","delete" ] },
|
|
38
48
|
{ "domain": "wrangler", "name": "intent_to_delete",
|
|
@@ -79,6 +89,7 @@ ent:established [
|
|
|
79
89
|
wellKnown_eventPolicy = { // we need to restrict what attributes are allowed on this channel, specifically Id.
|
|
80
90
|
"allow": [
|
|
81
91
|
{"domain": "wrangler", "name": "subscription"},
|
|
92
|
+
{"domain": "wrangler", "name": "relationship"},
|
|
82
93
|
{"domain": "wrangler", "name": "new_subscription_request"},
|
|
83
94
|
{"domain": "wrangler", "name": "inbound_removal"}
|
|
84
95
|
],
|
|
@@ -310,6 +321,7 @@ ent:established [
|
|
|
310
321
|
|
|
311
322
|
rule createRxBus {
|
|
312
323
|
select when wrangler subscription
|
|
324
|
+
or wrangler relationship
|
|
313
325
|
pre {
|
|
314
326
|
layer2 = event:attr("layer2") == true
|
|
315
327
|
channel_name = event:attr("name").defaultsTo(random:word())
|
|
@@ -335,6 +347,7 @@ ent:established [
|
|
|
335
347
|
|
|
336
348
|
rule createRxBusLegacyFailure {
|
|
337
349
|
select when wrangler subscription
|
|
350
|
+
or wrangler relationship
|
|
338
351
|
pre {
|
|
339
352
|
layer2 = event:attr("layer2") == true
|
|
340
353
|
hasWellKnown = event:attr("wellKnown_Tx")
|
|
@@ -347,6 +360,7 @@ ent:established [
|
|
|
347
360
|
|
|
348
361
|
rule createRxBusLayer2 {
|
|
349
362
|
select when wrangler subscription
|
|
363
|
+
or wrangler relationship
|
|
350
364
|
pre {
|
|
351
365
|
layer2 = event:attr("layer2") == true
|
|
352
366
|
target_did = event:attr("target_did")
|
|
@@ -373,6 +387,7 @@ ent:established [
|
|
|
373
387
|
|
|
374
388
|
rule createRxBusLayer2Failure {
|
|
375
389
|
select when wrangler subscription
|
|
390
|
+
or wrangler relationship
|
|
376
391
|
pre {
|
|
377
392
|
layer2 = event:attr("layer2") == true
|
|
378
393
|
target_did = event:attr("target_did")
|
|
@@ -466,6 +481,7 @@ ent:established [
|
|
|
466
481
|
|
|
467
482
|
rule approveInboundPendingSubscriptionLayer2 {
|
|
468
483
|
select when wrangler pending_subscription_approval
|
|
484
|
+
or wrangler pending_relationship_approval
|
|
469
485
|
pre {
|
|
470
486
|
bus = findBus(inbound())
|
|
471
487
|
response = bus{"layer2"} == true => dido:sendSkyIntroResponse(bus{"Id"}, bus{"Tx_did"}, {"status": "accepted"}) | null
|
|
@@ -478,6 +494,7 @@ ent:established [
|
|
|
478
494
|
|
|
479
495
|
rule approveInboundPendingSubscription {
|
|
480
496
|
select when wrangler pending_subscription_approval
|
|
497
|
+
or wrangler pending_relationship_approval
|
|
481
498
|
pre {
|
|
482
499
|
bus = findBus(inbound())
|
|
483
500
|
}
|
|
@@ -569,6 +586,7 @@ ent:established [
|
|
|
569
586
|
|
|
570
587
|
rule cancelEstablishedLayer2 {
|
|
571
588
|
select when wrangler subscription_cancellation
|
|
589
|
+
or wrangler relationship_cancellation
|
|
572
590
|
pre {
|
|
573
591
|
bus = findBus(established())
|
|
574
592
|
sent = bus{"layer2"} == true => dido:crossPicoEvent(bus{"Id"}, {
|
|
@@ -585,6 +603,7 @@ ent:established [
|
|
|
585
603
|
|
|
586
604
|
rule cancelEstablished {
|
|
587
605
|
select when wrangler subscription_cancellation
|
|
606
|
+
or wrangler relationship_cancellation
|
|
588
607
|
pre{
|
|
589
608
|
bus = findBus(established())
|
|
590
609
|
Tx_host = bus{"Tx_host"}
|
|
@@ -622,6 +641,7 @@ ent:established [
|
|
|
622
641
|
|
|
623
642
|
rule cancelInboundLayer2 {
|
|
624
643
|
select when wrangler inbound_rejection
|
|
644
|
+
or wrangler inbound_relationship_rejection
|
|
625
645
|
pre {
|
|
626
646
|
bus = findBus(inbound())
|
|
627
647
|
sent = bus{"layer2"} == true => dido:crossPicoEvent(bus{"Id"}, {
|
|
@@ -638,6 +658,7 @@ ent:established [
|
|
|
638
658
|
|
|
639
659
|
rule cancelInbound {
|
|
640
660
|
select when wrangler inbound_rejection
|
|
661
|
+
or wrangler inbound_relationship_rejection
|
|
641
662
|
pre{
|
|
642
663
|
bus = findBus(inbound())
|
|
643
664
|
Tx_host = bus{"Tx_host"}
|
|
@@ -673,6 +694,7 @@ ent:established [
|
|
|
673
694
|
|
|
674
695
|
rule cancelOutboundLayer2 {
|
|
675
696
|
select when wrangler outbound_cancellation
|
|
697
|
+
or wrangler outbound_relationship_cancellation
|
|
676
698
|
pre {
|
|
677
699
|
bus = findBus(outbound())
|
|
678
700
|
sent = bus{"layer2"} == true => dido:crossPicoEvent(bus{"Id"}, {
|
|
@@ -689,6 +711,7 @@ ent:established [
|
|
|
689
711
|
|
|
690
712
|
rule cancelOutbound {
|
|
691
713
|
select when wrangler outbound_cancellation
|
|
714
|
+
or wrangler outbound_relationship_cancellation
|
|
692
715
|
pre{
|
|
693
716
|
bus = findBus(outbound())
|
|
694
717
|
Tx_host = bus{"Tx_host"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pico-engine",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "An implementation of the pico-engine targeting node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"test:layer2-wrangler": "ava reset-cache && ava --serial ./test/layer2Wrangler.ts --timeout=2m",
|
|
55
55
|
"test:layer2-policy": "ava reset-cache && ava --serial ./test/layer2ChannelPolicy.ts --timeout=2m",
|
|
56
56
|
"test:cross-engine": "ava reset-cache && ava --serial ./test/crossEngineSubscription.ts --timeout=3m",
|
|
57
|
+
"test:relationship-alias": "ava reset-cache && ava --serial ./test/relationshipAlias.ts --timeout=2m",
|
|
57
58
|
"test:epic9": "ava reset-cache && ava --serial ./test/epic9Matrix.ts --timeout=3m"
|
|
58
59
|
},
|
|
59
60
|
"dependencies": {
|
|
@@ -112,5 +113,5 @@
|
|
|
112
113
|
"!test/helpers/**/*"
|
|
113
114
|
]
|
|
114
115
|
},
|
|
115
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "e5cafec5fad5e22df1ddd30eb227ad41d55e67b3"
|
|
116
117
|
}
|
|
@@ -17,7 +17,7 @@ Find the channel with `wrangler:discoveryChannel()` or `wrangler:channels(["disc
|
|
|
17
17
|
|
|
18
18
|
## Integrator flow
|
|
19
19
|
|
|
20
|
-
1. Obtain the target pico's discovery channel ECI (via
|
|
20
|
+
1. Obtain the target pico's discovery channel ECI (via relationship metadata, parent query, etc.).
|
|
21
21
|
2. Send `discovery capabilities` on that channel.
|
|
22
22
|
3. Optionally include an **`eci`** attribute — the channel the integrator will use for subsequent queries and events on this pico.
|
|
23
23
|
4. Collect **`discovery capability`** directives from the event response.
|
|
@@ -39,7 +39,7 @@ event:send({
|
|
|
39
39
|
}, host) // optional host for remote ECI
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
**
|
|
42
|
+
**DID-based (1.6+) — send by DID** (requires an established DID-based relationship):
|
|
43
43
|
|
|
44
44
|
```krl
|
|
45
45
|
event:send({
|
|
@@ -50,18 +50,20 @@ event:send({
|
|
|
50
50
|
})
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
**
|
|
53
|
+
**DID-based — send via established relationship map** (from `relationship:established()` etc.; legacy module name `subscription:established()`):
|
|
54
54
|
|
|
55
55
|
```krl
|
|
56
|
+
use module io.picolabs.subscription alias relationship
|
|
57
|
+
|
|
56
58
|
event:send({
|
|
57
|
-
"sub": bus, // established
|
|
59
|
+
"sub": bus, // established relationship (bus) map
|
|
58
60
|
"domain": "wrangler",
|
|
59
61
|
"type": "ping",
|
|
60
62
|
"attrs": {}
|
|
61
63
|
})
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
When `bus.layer2` is true, routing uses `Tx_did` and DIDComm (or verified local dispatch on the same engine).
|
|
66
|
+
When `bus.layer2` is true (DID-based relationship), routing uses `Tx_did` and DIDComm (or verified local dispatch on the same engine). ECI-based relationships use `bus.Tx` and optional `bus.Tx_host` as before.
|
|
65
67
|
|
|
66
68
|
## event:attr
|
|
67
69
|
|