pico-engine-core
This provides the environment for KRL to run.
This provides the environment for KRL to run.
This provides the environment for KRL to run.
picoQuery
(deprecating skyQuery
)meta:eci
inside a query as well as an eventklog
display in the Logging tab of the developer UImeta:rulesetConfig
wrangler:rulesets_need_flushing
for a picoschedule event ... at
now workingpico-engine-browser
no longer usedklog
operator work in a function contextevent:send
which allows ruleset evaulation to continue even if the ECI is not foundmeta
library to match the one in 0.52.4, with docsctx:picoId
io.picolabs.subscription
ruleset installed in all picos--version
option for pico-engine
commandio.picolabs.wrangler
ruleset in all picosursa
module for cryptographic needs of DIDs, and its dependenciesengine:registerRulesetFromSrc
- see 456engine:doesKRLParse
- see 456io.picolabs.test
for testing KRL rulesets - see 456io.picolabs.ds
and io.picolabs.wrangler.profile
for general purpose datastore and replacement for io.picolabs.pds
- see 456io.picolabs.collection
- see 456ent:map{..}
semantics to match map{..}
- see 458Pico Sovrin Agents are now available!
indy:*
meta:rulesetLogging
to indicate the ruleset logging
setting. Defaults to false
time:now(date)
can be given the number of milliseconds since the UNIX epoch..reduce()
on a single item properly gives all 4 arguments to the reducer function.autosend
to http:*
to send an event when the http response is received.math:*
functions - see 437.
operators i.e. a.b(c)
is syntax sugar for b(a, c)
- see 171ent:v := ent:v.append(..)
- see 425ent:v := ent:v.put(..)
- see 425/api/db-dump
is gone! The UI scales better now - see 424system:online
eventpico:intent_to_orphan
to wrangler:garbage_collection
- see 422data = engine:exportPico(pico_id)
- see 414engine:importPico(parent_id, data) setting(newPicoId)
- see 415engine:setPicoStatus(pico_id, isLeaving, movedToHost)
- see 414status = engine:getPicoStatus(pico_id)
- see 414compileAndLoadRuleset
.math:hmac(algorithm, key, message [, encoding])
- see 413.isEmpty()
- see 310.trimLeading()
.trimTrailing()
.trim()
.startsWith(target)
.endsWith(target)
.contains(target)
- see 405schedule:list
and schedule:remove
- be64ef7e 62b424fcval.as("RegExp")
will now coerce any val to a string - ca1c703fevent:send
with empty attributes - #371last
should only stop evaluating the current ruleset - #366meta:host
rather than defaulting to localhost - #370io.picolabs.pico
to io.picolabs.wrangler
- 4c64693select .. setting() where ..
variable scope - #362, #329, #358, #359ctrl+S
binding - #356schedule:remove(id)
returns true/false instead of throwing an error - #363event:send
now signals the event right away instead of waiting for the rules to complete - #364$PICO_ENGINE_HOME/pico-engine.log
(see #313)Because we changed io.picolabs.pico
to io.picolabs.wrangler
.
io.picolabs.pico
from the Root Pico. (open the root pico -> Rulesets tab -> click del
on io.picolabs.pico
).event:attrs()
in favor of event:attrs
keys:<name>()
in favor of keys:<name>
.
operatorengine:*
function argumentsselect when
matching falsy event attributesent:foo{key}
Wrangler provides a lot of the engine module functionality. It aims for easy, programmatically management of registering, installing, uninstalling, and listing rulesets, creation, deletion and listing of channels, as well as creation, deletion and listing of children picos. Wrangler allows you to write code to do everything that a user would us the UI for.
engine:getAdminECI(pico_id)
engine:newPico(pico_id)
now sets the parent id to pico_id
creates an admin channel for you.engine:getParent(pico_id)
and engine:listChildren(pico_id)
engine:listInstalledRIDs(pico_id)
engine:*
functions that have a pico_id
argument now defaults to meta:picoId
defaction
between rulesets now return the right valuekrl/
) now are loaded by dependency ordering..put()
should create nested maps, even if keys are numeric - see issue #204schedule .. at
- see issue #203schedule .. at
- see issue #203/sky/cloud/..
- see issue #32like
, <=>
, cmp
- see issue #183as("Number")
- see issue #173pre
block - see issues #187keys:<key>
in global - see issues #132random:uuid()
- return a globally unique id (using cuid)random:word()
- return a random english wordrandom:integer(lower = 0, upper = 1)
- return a random integer between lower
and upper
random:number(lower = 0, upper = 1)
- return a random number (float) between lower
and upper
if event.eid == "none" or is not given, it will default to a uuid
event:send(event, host = null)
- now when given a host
string, it will send an async http sky/event request to that engine
better syntax for choose
making the action block syntax consistent.
`
ActionBlock ->
(if <expr> then)? <Actions>
Actions -> <action> ; | every { <action 0> ; <action 1> ; ... } | sample { <action 0> ; <action 1> ; ... } | choose <expr> { <action 0> ; <action 1> ; ... }
### Bug Fixes
* `event:attr(name)` - see issue [#179](https://github.com/Picolab/pico-engine/issues/179)
# 0.12.0 - May 25, 2017
### New Features
* defaction can return values (expose values to `setting(..)`)
```krl
<name> = defaction(<params...>){
<declaration 0>
<declaration 1>
...
<action block (i.e. anything you would put in a rule action)>
returns <expr 0>, <expr 1>, ...
}
NOTE: returns
is optional
For example
global {
foo = defaction(){
send_directive("foobar")
returns 1, 2, 3
}
}
rule bar {
select when ...
foo() setting(a, b, c)
fired {
//a = 1, b = 2, c = 3
}
}
Another example
global {
foo = defaction(){
every {
http:get(...) setting(resp)
}
return resp["content"].decode()["msg"]
}
}
rule bar {
select when ...
foo() setting(message)
}
new action block type: sample
This will randomly select an action to run.
rule bar {
select when ...
//randomly pick one of these 3 actions to run
sample {
send_directive("foo")
send_directive("bar")
send_directive("baz")
}
}
action block syntax. The semi-colons are optional.
ActionBlock ->
<action> ;
| if <expr> then <action> ;
| if <expr> then every { <action 0> ; <action 1> ; ... }
| if <expr> then sample { <action 0> ; <action 1> ; ... }
| every { <action 0> ; <action 1> ; ... }
| sample { <action 0> ; <action 1> ; ... }
| choose <expr> { <action 0> ; <action 1> ; ... }
with
is no longer used for named arguments. Both for functions and actions.
`
krl
//OLD WAY
foo(1, 2) with a = 3 and b = 4//NEW WAY foo(1, 2, a = 3, b = 4)
* `with` is no longer used on `raise`/`schedule`
```krl
//OLD WAY
raise domain event "type" with foo = 1 and bar = 2
//NEW WAY
raise domain event "type" attributes {"foo": 1, "bar": 2}
send_directive
no longer uses with
it's now send_directive(name, options = {})
`
krl
//OLD WAY
send_directive("name") with foo = x and bar = y//NEW WAY send_directive("name", {"foo": x, "bar": y})
* No optional semi-colon after `select when ...`
```krl
//OLD WAY
select when foo bar;
//NEW WAY
select when foo bar
with
<name> = defaction(<params...>){
<declaration 0>
<declaration 1>
...
<action block (i.e. anything you would put in a rule action)>
}
For example
chooser = defaction(val){
baz = "hello"
qux = "bye"
choose val {
asdf =>
foo(val)
fdsa =>
bar(val, "ok", "done")
}
}
configure using
)foo = function(bar = 2, baz = bar + 3){
bar + baz
}
//-or- when it gets too long
foo = function(
bar = 2,
baz = bar + 3,
qux = 4,
quux = blah(qux),
){
...
}
//defaction parameters work the same way as functions
//the following are now actions and cannot be used as a function
engine:newPico
engine:removePico
engine:newChannel
engine:removeChannel
engine:registerRuleset
engine:unregisterRuleset
engine:installRuleset
engine:uninstallRuleset
event:send
schedule:remove