pico-engine 1.9.0 → 1.9.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/README.md +2 -2
- package/dist/xmluiRuntime.js +1 -1
- package/krl/io.picolabs.pico-engine-ui.krl +2 -0
- package/krl/io.picolabs.wrangler.krl +7 -1
- package/krl/io.picolabs.xmlui.krl +19 -7
- package/mcp/devResources.js +17 -7
- package/mcp/docs/CLAUDE.md +85 -0
- package/{public → mcp}/docs/pico-engine.md +8 -8
- package/package.json +6 -6
- package/public/pico-engine-ui.css +1 -1
- package/public/pico-engine-ui.js +24 -24
- package/public/xmlui/0.14.28.js +171 -0
- package/public/xmlui/pico-view-boot.js +1 -1
- package/src/xmluiRuntime.ts +1 -1
- package/public/.DS_Store +0 -0
- package/public/docs/README.md +0 -9
- package/public/docs/_media/logo.png +0 -0
- package/public/docs/_sidebar.md +0 -7
- 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 -630
- package/public/docs/llms.txt +0 -38
- package/public/docs/openapi.yaml +0 -78
- package/public/docs/pico-views-xmlui.md +0 -5
- package/public/docs/pico-views.md +0 -140
- package/public/docs/pico.md +0 -5
- package/public/docs/rulesets/README.md +0 -26
- 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
package/public/docs/llms.txt
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Pico Engine docs (llms.txt)
|
|
2
|
-
|
|
3
|
-
Machine-readable index for agents working with picos and KRL.
|
|
4
|
-
|
|
5
|
-
## Start here
|
|
6
|
-
|
|
7
|
-
- Local dev: `npm install -g pico-engine` then `pico-engine` (or repo `npm start`)
|
|
8
|
-
- Agent loop: repo `CLAUDE.md` + `pico-engine mcp --stdio` (see packages/pico-engine/README.md)
|
|
9
|
-
- Validate KRL: `krl-check` / `npm run krl-check`
|
|
10
|
-
|
|
11
|
-
## Docs
|
|
12
|
-
|
|
13
|
-
- Pico overview: pico-overview.md
|
|
14
|
-
- Pico engine operator guide: pico-engine.md
|
|
15
|
-
- Pico views: pico-views.md
|
|
16
|
-
- Bundled rulesets: rulesets/README.md
|
|
17
|
-
- KRL manual: krl/README.md
|
|
18
|
-
- Contributing: contributing.md
|
|
19
|
-
|
|
20
|
-
## Bundled ruleset API (generated from KRL)
|
|
21
|
-
|
|
22
|
-
- io.picolabs.wrangler: rulesets/io.picolabs.wrangler.md
|
|
23
|
-
- io.picolabs.pds: rulesets/io.picolabs.pds.md
|
|
24
|
-
- io.picolabs.subscription: rulesets/io.picolabs.subscription.md
|
|
25
|
-
- io.picolabs.pico-engine-ui: rulesets/io.picolabs.pico-engine-ui.md
|
|
26
|
-
- io.picolabs.oauth: rulesets/io.picolabs.oauth.md
|
|
27
|
-
- io.picolabs.portable_subtree: rulesets/io.picolabs.portable_subtree.md
|
|
28
|
-
|
|
29
|
-
## Manifold (mesh framework — separate repo)
|
|
30
|
-
|
|
31
|
-
Application layer on wrangler (owner, thing, community). Not shipped inside pico-engine.
|
|
32
|
-
- Index: https://github.com/Picolab/manifold-api/blob/main/docs/llms.txt
|
|
33
|
-
- Generated ruleset APIs: https://github.com/Picolab/manifold-api/tree/main/docs/rulesets
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## OpenAPI
|
|
37
|
-
|
|
38
|
-
- Sky and channel HTTP: public/docs/openapi.yaml
|
package/public/docs/openapi.yaml
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
openapi: 3.1.0
|
|
2
|
-
info:
|
|
3
|
-
title: Pico Engine HTTP API (subset)
|
|
4
|
-
version: 1.8.0
|
|
5
|
-
description: |
|
|
6
|
-
Subset of the pico-engine surface for integrators and agents.
|
|
7
|
-
Owner UI uses passkey sessions on `/c/*`. External integrators use OAuth bearer on `/sky/*`.
|
|
8
|
-
Mesh MCP uses Streamable HTTP at `/mcp/{eci}` with the same bearer as Sky for that channel.
|
|
9
|
-
servers:
|
|
10
|
-
- url: http://localhost:3000
|
|
11
|
-
description: Local dev
|
|
12
|
-
paths:
|
|
13
|
-
/sky/event/{eci}/{eid}/{domain}/{type}:
|
|
14
|
-
post:
|
|
15
|
-
summary: Send an event (OAuth bearer when required)
|
|
16
|
-
parameters:
|
|
17
|
-
- { name: eci, in: path, required: true, schema: { type: string } }
|
|
18
|
-
- { name: eid, in: path, required: true, schema: { type: string } }
|
|
19
|
-
- { name: domain, in: path, required: true, schema: { type: string } }
|
|
20
|
-
- { name: type, in: path, required: true, schema: { type: string } }
|
|
21
|
-
requestBody:
|
|
22
|
-
content:
|
|
23
|
-
application/json:
|
|
24
|
-
schema: { type: object, additionalProperties: true }
|
|
25
|
-
responses:
|
|
26
|
-
"200":
|
|
27
|
-
description: Event outcome (directives, eid, ruleOutcomes when annotated, events raised in the same transaction)
|
|
28
|
-
/sky/query/{eci}/{rid}/{function}:
|
|
29
|
-
post:
|
|
30
|
-
summary: Run a query (OAuth bearer when required)
|
|
31
|
-
parameters:
|
|
32
|
-
- { name: eci, in: path, required: true, schema: { type: string } }
|
|
33
|
-
- { name: rid, in: path, required: true, schema: { type: string } }
|
|
34
|
-
- { name: function, in: path, required: true, schema: { type: string } }
|
|
35
|
-
requestBody:
|
|
36
|
-
content:
|
|
37
|
-
application/json:
|
|
38
|
-
schema: { type: object, additionalProperties: true }
|
|
39
|
-
responses:
|
|
40
|
-
"200":
|
|
41
|
-
description: Query result JSON
|
|
42
|
-
/c/{eci}/event-wait/{domain}/{name}:
|
|
43
|
-
post:
|
|
44
|
-
summary: Send event and wait for outcome (UI session or localhost)
|
|
45
|
-
parameters:
|
|
46
|
-
- { name: eci, in: path, required: true, schema: { type: string } }
|
|
47
|
-
- { name: domain, in: path, required: true, schema: { type: string } }
|
|
48
|
-
- { name: name, in: path, required: true, schema: { type: string } }
|
|
49
|
-
requestBody:
|
|
50
|
-
content:
|
|
51
|
-
application/json:
|
|
52
|
-
schema: { type: object, additionalProperties: true }
|
|
53
|
-
/c/{eci}/query/{rid}/{name}:
|
|
54
|
-
post:
|
|
55
|
-
summary: Run a query on a channel
|
|
56
|
-
parameters:
|
|
57
|
-
- { name: eci, in: path, required: true, schema: { type: string } }
|
|
58
|
-
- { name: rid, in: path, required: true, schema: { type: string } }
|
|
59
|
-
- { name: name, in: path, required: true, schema: { type: string } }
|
|
60
|
-
requestBody:
|
|
61
|
-
content:
|
|
62
|
-
application/json:
|
|
63
|
-
schema: { type: object, additionalProperties: true }
|
|
64
|
-
/mcp/{eci}:
|
|
65
|
-
get:
|
|
66
|
-
summary: MCP Streamable HTTP (SSE)
|
|
67
|
-
security: [{ bearerAuth: [] }]
|
|
68
|
-
post:
|
|
69
|
-
summary: MCP Streamable HTTP (JSON-RPC)
|
|
70
|
-
security: [{ bearerAuth: [] }]
|
|
71
|
-
/api/dev/local:
|
|
72
|
-
get:
|
|
73
|
-
summary: Localhost-only dev context (root UI ECI)
|
|
74
|
-
components:
|
|
75
|
-
securitySchemes:
|
|
76
|
-
bearerAuth:
|
|
77
|
-
type: http
|
|
78
|
-
scheme: bearer
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
# Pico views
|
|
2
|
-
|
|
3
|
-
A **view** is a shared function that returns [XMLUI](https://xmlui.org) markup. Install the ruleset, open it on a channel that may call that function, and the engine serves the page.
|
|
4
|
-
|
|
5
|
-
The engine ships the XMLUI runtime (`/xmlui/0.12.7.js`) and the optional ruleset `io.picolabs.xmlui`. That ruleset builds the app shell, navigation, and the markup helpers. It is not installed on every pico. Install it from the engine:
|
|
6
|
-
|
|
7
|
-
`/krl/io.picolabs.xmlui.krl`
|
|
8
|
-
|
|
9
|
-
Channel policy applies to views the same way it applies to any other query. A channel that cannot call the function does not get that page. Live data still comes from `/sky/query` and `/sky/event` on that same channel.
|
|
10
|
-
|
|
11
|
-
Examples live in `demos/xmlui/` in the pico-engine repository. The design record is `docs/design/pico-views-xmlui.md`.
|
|
12
|
-
|
|
13
|
-
## Write a view
|
|
14
|
-
|
|
15
|
-
Tag the function with `@view` and return one `<Component>`:
|
|
16
|
-
|
|
17
|
-
```krl
|
|
18
|
-
ruleset com.example.hello {
|
|
19
|
-
meta {
|
|
20
|
-
name "Hello"
|
|
21
|
-
shares hello
|
|
22
|
-
}
|
|
23
|
-
global {
|
|
24
|
-
/**
|
|
25
|
-
* A first view
|
|
26
|
-
* @view "Hello"
|
|
27
|
-
*/
|
|
28
|
-
hello = function() {
|
|
29
|
-
<<<Component name="Hello">
|
|
30
|
-
<H1>Hello</H1>
|
|
31
|
-
<Text>This view is a shared function in #{meta:rid}.</Text>
|
|
32
|
-
</Component>
|
|
33
|
-
>>
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
`@view "Title"` sets the navigation label. The shell turns the function name into the component tag by capitalizing the first letter (`hello` → `<Hello />`). The `<Component name>` in the markup has to be that same name.
|
|
40
|
-
|
|
41
|
-
Give the function a path when you want a specific URL:
|
|
42
|
-
|
|
43
|
-
```krl
|
|
44
|
-
@view "Settings" /settings
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
With one view and no path, the page is `/`. With several views and no path, each page is `/` plus the function name. A path that contains `:` is a detail page (`@view "Contact" /contact/:id`). It is left out of the navigation. The component reads `{$routeParams.id}`. Other views link to it with `<Link to="/contact/{$item.id}">`.
|
|
48
|
-
|
|
49
|
-
Do not name a view after a built-in XMLUI tag (`List`, `Table`, `Form`, `Text`, …). A function named `list` becomes `<List />`, which is the framework list, not your page. Name it `contactsPage` and, if you want the URL to be `/list`, set the path.
|
|
50
|
-
|
|
51
|
-
`#{}` runs in KRL while the page is generated. Use it for constants: `meta:rid`, labels, and the helpers below. Do not put entity variables or query results in `#{}`. Those values belong in a `DataSource`, which XMLUI renders as text. `krl check` warns when a `@view` function interpolates `ent:` and when the heredoc is not well-formed XML.
|
|
52
|
-
|
|
53
|
-
## Open it
|
|
54
|
-
|
|
55
|
-
| URL | What it serves |
|
|
56
|
-
|-----|----------------|
|
|
57
|
-
| `/ui/{eci}` | A list of rulesets on this channel that have a view the channel may call |
|
|
58
|
-
| `/ui/{eci}/{rid}/` | That ruleset's app. Routes are hash URLs under this path |
|
|
59
|
-
|
|
60
|
-
The shell (`index.html`), `Main.xmlui`, and `config.json` come from `io.picolabs.xmlui:file`. `components/<Name>.xmlui` is the view function itself, queried on the channel in the URL.
|
|
61
|
-
|
|
62
|
-
In the developer UI, a ruleset with at least one `@view` function has a **View** button on the Rulesets tab. Pick the channel, then open the app.
|
|
63
|
-
|
|
64
|
-
The channel must allow:
|
|
65
|
-
|
|
66
|
-
- `io.picolabs.xmlui` / `file`, or the shell does not load
|
|
67
|
-
- the view function, or that component is not found
|
|
68
|
-
- every query and event the page calls
|
|
69
|
-
|
|
70
|
-
A policy denial on these routes is HTTP 403. Anything else the route cannot serve is HTTP 404.
|
|
71
|
-
|
|
72
|
-
These `/ui/` files are the ruleset's markup plus the ECI and RID already in the URL. They are served without a bearer token. Pico data is not in them. When the engine requires a bearer on `/sky/*`, the shell signs in and sends that token as `appGlobals.auth` on each `DataSource` and `APICall`.
|
|
73
|
-
|
|
74
|
-
## Read and write
|
|
75
|
-
|
|
76
|
-
`use module io.picolabs.xmlui alias ui`. The helpers return markup, so they go in the heredoc with `#{}`.
|
|
77
|
-
|
|
78
|
-
| Call | Result |
|
|
79
|
-
|------|--------|
|
|
80
|
-
| `ui:query(id, name, opts)` | A `DataSource`. `opts.rid` defaults to this ruleset. `opts.args` is a map of query parameters (values may be XMLUI bindings such as `"{$routeParams.id}"`). `opts.select` sets `resultSelector`. |
|
|
81
|
-
| `ui:event(id, domain, type, opts)` | An `APICall` that posts the form body. `opts.refresh` is a list of `DataSource` ids to refetch. `opts.confirm` sets a confirmation message. |
|
|
82
|
-
| `ui:query_url(name, rid, eci)` | `/sky/query/…` for this channel, ruleset, and query. |
|
|
83
|
-
| `ui:event_url(domain, type, eci)` | `/sky/event/{eci}/xmlui/{domain}/{type}`. |
|
|
84
|
-
| `ui:app_url(tags, app_rid)` | `/ui/{eci}/{rid}/` for the newest channel with those tags, or `null`. |
|
|
85
|
-
| `ui:escape(s)` | Escape `&`, `<`, `>`, and `"` for text placed in markup. |
|
|
86
|
-
|
|
87
|
-
A guestbook view:
|
|
88
|
-
|
|
89
|
-
```krl
|
|
90
|
-
meta {
|
|
91
|
-
name "Guestbook"
|
|
92
|
-
use module io.picolabs.xmlui alias ui
|
|
93
|
-
shares entries, book
|
|
94
|
-
}
|
|
95
|
-
global {
|
|
96
|
-
/** Guestbook entries, newest first. @returns Array */
|
|
97
|
-
entries = function() {
|
|
98
|
-
ent:entries.defaultsTo([]).reverse()
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Sign and read the guestbook
|
|
103
|
-
* @view "Guestbook"
|
|
104
|
-
*/
|
|
105
|
-
book = function() {
|
|
106
|
-
<<<Component name="Book">
|
|
107
|
-
#{ui:query("entries", "entries")}
|
|
108
|
-
#{ui:event("sign", "guestbook", "signed", {"refresh": ["entries"]})}
|
|
109
|
-
<Form onSubmit="(toSave) => sign.execute(toSave)">
|
|
110
|
-
<FormItem bindTo="name" label="Name" />
|
|
111
|
-
<FormItem bindTo="message" label="Message" type="textarea" />
|
|
112
|
-
</Form>
|
|
113
|
-
<Table data="{entries}">
|
|
114
|
-
<Column bindTo="name" header="Name" />
|
|
115
|
-
<Column bindTo="message" header="Message" />
|
|
116
|
-
</Table>
|
|
117
|
-
</Component>
|
|
118
|
-
>>
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
The matching rule selects `guestbook signed`. After it fires, `entries.refetch()` reloads the table. The full ruleset is `demos/xmlui/com.example.guestbook.krl`.
|
|
124
|
-
|
|
125
|
-
## App channel
|
|
126
|
-
|
|
127
|
-
`ui:create_app_channel(tags, domains, queries, app_rid)` creates a channel whose events are limited to `domains` (each name is `*`) and whose queries are `queries` on `app_rid`. When `queries` is `null`, every shared function of `app_rid` is allowed. The query policy always includes `io.picolabs.xmlui` / `file`.
|
|
128
|
-
|
|
129
|
-
```krl
|
|
130
|
-
rule create_app_channel {
|
|
131
|
-
select when wrangler ruleset_installed where event:attr("rids") >< meta:rid
|
|
132
|
-
ui:create_app_channel(["guestbook", "app"], ["guestbook"], null, meta:rid)
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
`ui:rotate_app_channel(tags)` creates a new channel with the same tags and policy as the newest channel that already has those tags.
|
|
137
|
-
|
|
138
|
-
## What a view does not do
|
|
139
|
-
|
|
140
|
-
A view does not subscribe to changes made somewhere else. It loads when the page opens and refetches the `DataSource`s named in `opts.refresh` after its own event. Another pico's data is reached by a query on this pico that calls out, not by pointing a `DataSource` at the other pico. See `demos/xmlui/com.example.temperature_sensors_view.krl`.
|
package/public/docs/pico.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Persistent Compute Objects
|
|
2
|
-
|
|
3
|
-
The philosophy and model doc is **[pico-overview.md](pico-overview.md)** (source: `docs/design/pico-overview.md` in the repo; copied into `public/docs/` by `npm run generate:llms`).
|
|
4
|
-
|
|
5
|
-
Legacy wiki copy: [Persistent Compute Objects on Confluence](https://picolabs.atlassian.net/wiki/spaces/docs/pages/1189992) — prefer the repo overview when they differ.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# Bundled rulesets (generated docs)
|
|
2
|
-
|
|
3
|
-
Markdown here is copied from `tools/krl-schema/samples/` when you run **`npm run generate:llms`** at the repo root. Sources are the annotated KRL under `packages/pico-engine/krl/`. To regenerate samples from KRL: **`npm run check:krl-schema-samples`** (CI) or `node tools/krl-schema/cli.js -f markdown path/to/ruleset.krl`.
|
|
4
|
-
|
|
5
|
-
## OS layer (every pico)
|
|
6
|
-
|
|
7
|
-
Installed on the root pico and on each new child automatically.
|
|
8
|
-
|
|
9
|
-
| Ruleset | Doc |
|
|
10
|
-
|---------|-----|
|
|
11
|
-
| **io.picolabs.wrangler** | [wrangler](io.picolabs.wrangler.md) — **pico OS**; the supported API for mesh lifecycle (not raw `ctx:*`). If an operation is missing here, treat it as out-of-bounds or [file an engine issue](https://github.com/Picolab/pico-engine/issues). |
|
|
12
|
-
| **io.picolabs.pds** | [pds](io.picolabs.pds.md) — profile and shared namespaced data |
|
|
13
|
-
| **io.picolabs.subscription** | [subscription](io.picolabs.subscription.md) — relationships to other picos |
|
|
14
|
-
| **io.picolabs.pico-engine-ui** | [pico-engine-ui](io.picolabs.pico-engine-ui.md) — developer UI channel |
|
|
15
|
-
|
|
16
|
-
## Optional (install when needed)
|
|
17
|
-
|
|
18
|
-
Shipped under `/krl/` on your engine; install from the Rulesets tab or `wrangler:install_ruleset_request` with the ruleset URL.
|
|
19
|
-
|
|
20
|
-
| Ruleset | Doc | Notes |
|
|
21
|
-
|---------|-----|--------|
|
|
22
|
-
| **io.picolabs.oauth** | [oauth](io.picolabs.oauth.md) | **Root pico only** — optional mesh-wide OAuth on `/sky/*` |
|
|
23
|
-
| **io.picolabs.portable_subtree** | [portable_subtree](io.picolabs.portable_subtree.md) | Portable export/import of subtrees (identity-aware move) |
|
|
24
|
-
| **io.picolabs.xmlui** | [Pico views](../pico-views.md) | Optional. A `@view` function is a page at `/ui/{eci}/{rid}/` |
|
|
25
|
-
|
|
26
|
-
Application rulesets (Manifold, your apps) are not bundled; install their KRL URLs like any other ruleset.
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# io.picolabs.oauth
|
|
2
|
-
|
|
3
|
-
Optional mesh-level OAuth. Install on the root pico to require Bearer tokens on external /sky/*
|
|
4
|
-
for this mesh (except channels tagged mesh-oauth-exempt or didcomm+ingress), and to hold
|
|
5
|
-
per-mesh OAuth configuration (apps, consent policy, defaults).
|
|
6
|
-
Webhook Client Credentials (per channel, oauth-webhook tag) and app Authorization Code grants
|
|
7
|
-
coexist here. Not installed by default.
|
|
8
|
-
|
|
9
|
-
use module io.picolabs.oauth alias oauth
|
|
10
|
-
|
|
11
|
-
*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.*
|
|
12
|
-
|
|
13
|
-
**Queries:** [meshEnabled](#meshenabled--boolean) · [meshRequiresOAuth](#meshrequiresoautheci--boolean) · [channelStatus](#channelstatuseci--map) · [createChannelSecret](#createchannelsecreteci--map) · [revokeChannelSecret](#revokechannelsecreteci--map) · [revokeTokens](#revoketokenseci--map)
|
|
14
|
-
|
|
15
|
-
## Queries
|
|
16
|
-
|
|
17
|
-
### `meshEnabled()` → Boolean
|
|
18
|
-
|
|
19
|
-
True when this ruleset is installed on the pico. Its presence is the mesh's opt-in to OAuth.
|
|
20
|
-
|
|
21
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.oauth/meshEnabled`, or `<alias>:meshEnabled()` from KRL with `use module io.picolabs.oauth alias <alias>`
|
|
22
|
-
|
|
23
|
-
### `meshRequiresOAuth(eci)` → Boolean
|
|
24
|
-
|
|
25
|
-
True when external /sky/* requests on this channel need a Bearer token: the mesh root has io.picolabs.oauth installed and the channel is not tagged mesh-oauth-exempt or didcomm+ingress.
|
|
26
|
-
|
|
27
|
-
| Parameter | Type | Required | Default | Description |
|
|
28
|
-
|-----------|------|----------|---------|-------------|
|
|
29
|
-
| `eci` | String | yes | | channel to check |
|
|
30
|
-
|
|
31
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.oauth/meshRequiresOAuth?eci=…`, or `<alias>:meshRequiresOAuth(eci)` from KRL with `use module io.picolabs.oauth alias <alias>`
|
|
32
|
-
|
|
33
|
-
### `channelStatus(eci)` → Map
|
|
34
|
-
|
|
35
|
-
OAuth webhook status of a channel: whether it is eligible (tagged oauth-webhook), whether OAuth is enabled on it, and whether a client secret exists. Includes a reason when the channel is not eligible or not found.
|
|
36
|
-
|
|
37
|
-
| Parameter | Type | Required | Default | Description |
|
|
38
|
-
|-----------|------|----------|---------|-------------|
|
|
39
|
-
| `eci` | String | yes | | channel to inspect |
|
|
40
|
-
|
|
41
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.oauth/channelStatus?eci=…`, or `<alias>:channelStatus(eci)` from KRL with `use module io.picolabs.oauth alias <alias>`
|
|
42
|
-
|
|
43
|
-
### `createChannelSecret(eci)` → Map
|
|
44
|
-
|
|
45
|
-
Create (or replace) the Client Credentials secret for a webhook channel and return it. The secret is returned only here; the engine stores a hash, so save it now. Only works for a channel on this pico or one of its descendants. Changes state despite being a query.
|
|
46
|
-
|
|
47
|
-
| Parameter | Type | Required | Default | Description |
|
|
48
|
-
|-----------|------|----------|---------|-------------|
|
|
49
|
-
| `eci` | String | yes | | webhook channel (tagged oauth-webhook); also the client_id |
|
|
50
|
-
|
|
51
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.oauth/createChannelSecret?eci=…`, or `<alias>:createChannelSecret(eci)` from KRL with `use module io.picolabs.oauth alias <alias>`
|
|
52
|
-
|
|
53
|
-
### `revokeChannelSecret(eci)` → Map
|
|
54
|
-
|
|
55
|
-
Revoke a webhook channel's client secret so it can no longer obtain tokens. Only works for a channel on this pico or one of its descendants. Changes state despite being a query.
|
|
56
|
-
|
|
57
|
-
| Parameter | Type | Required | Default | Description |
|
|
58
|
-
|-----------|------|----------|---------|-------------|
|
|
59
|
-
| `eci` | String | yes | | webhook channel |
|
|
60
|
-
|
|
61
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.oauth/revokeChannelSecret?eci=…`, or `<alias>:revokeChannelSecret(eci)` from KRL with `use module io.picolabs.oauth alias <alias>`
|
|
62
|
-
|
|
63
|
-
### `revokeTokens(eci)` → Map
|
|
64
|
-
|
|
65
|
-
Revoke all access tokens issued for a channel, without removing its secret. Only works for a channel on this pico or one of its descendants. Changes state despite being a query.
|
|
66
|
-
|
|
67
|
-
| Parameter | Type | Required | Default | Description |
|
|
68
|
-
|-----------|------|----------|---------|-------------|
|
|
69
|
-
| `eci` | String | yes | | channel whose tokens to revoke |
|
|
70
|
-
|
|
71
|
-
**Call:** `GET /sky/query/<eci>/io.picolabs.oauth/revokeTokens?eci=…`, or `<alias>:revokeTokens(eci)` from KRL with `use module io.picolabs.oauth alias <alias>`
|