@skillcdn/console 0.4.5 → 0.4.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/plugin/web.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,gGAAgG;AAChG,gGAAgG;AAChG,iGAAiG;AACjG,OAAO;AACP,OAAO,EACL,cAAc,EASd,YAAY,EACZ,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AAMrB,gFAAgF;AAChF,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,IAAI,CAAS;IACb,IAAI,CAAU;IAEvB,YAAY,KAAkB;QAC5B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AA+GD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,mGAAmG;AACnG,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC;IAC9C,kBAAkB;IAClB,iBAAiB;IACjB,qBAAqB;CACtB,CAAC,CAAC;AAEH,SAAS,YAAY;IACnB,MAAM,SAAS,GAAI,UAAuC,CAAC,MAAM,CAAC;IAClE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,IAAI,iBAAiB,CAAC;YAC1B,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE,qDAAqD;SAC/D,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,cAAc;IACrB,MAAM,SAAS,GAAI,UAA2C,CAAC,QAAQ,CAAC;IACxE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;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ACT;oBACE,OAAO;YACX,CAAC;QACH,CAAC,CAAC;QACF,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,CAAC,EAAE,qBAAqB,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
package/docs/specs/cli.md CHANGED
@@ -76,9 +76,9 @@ The board is a project's ([ADR-0008](../adr/0008-a-workspace-holds-projects-and-
76
76
  | `report <markdown> [--run <id>]`, `report --file <path> [--run <id>]`, `report - [--run <id>]` | `POST .../runs/<id>/reports` | how many reports the run carries |
77
77
  | `hand-in <https url \| file path> [--label <words>] [--run <id>]` | `POST .../runs/<id>/artifacts` for a link; `POST .../runs/<id>/files` for a file, sent as a form with its name and its media type by extension | how many artifacts; a picture handed in is shown on the task, and where a report names it as `![words](its name)` |
78
78
  | `comment <number\|id> "<markdown>" [--attach <path>]...`, `comment <number\|id> --file <path>`, `comment <number\|id> -` | `GET .../tasks/<ref>`, then `POST .../tasks/<id>/comments`: as JSON, or as one form with the part `body` and a part `file` per file attached, its media type by extension | the comment as written, with its files and the command that reads each; a word to the task's people, which needs no run ([ADR-0024](../adr/0024-a-task-carries-a-discussion-of-comments-with-their-files-read-as-one-thread-with-the-runs-and-the-decisions.md)) |
79
- | `file <id> [--out <path>]` | `GET .../files/<id>` | that the file is saved, where, with its size and type: under its own name in the working directory, at the path, or into the directory named; a file a run handed in, one put in a comment, or one attached to a page, so that an agent looks at a picture a person put on the board |
79
+ | `file <id> [--decision <id>] [--out <path>]` | `GET .../files/<id>`; with `--decision`, `GET /api/v1/decisions/<decision id>/files/<id>`, needing no project ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)) | that the file is saved, where, with its size and type: under its own name in the working directory, at the path, or into the directory named; a file a run handed in, one put in a comment or on a decision, or one attached to a page, so that an agent looks at a picture a person put on the board; with `--decision`, a file of that decision wherever it is, as `decision` names it for one reached outside the project; `file.not_found` for a file not the decision's, or a decision out of reach |
80
80
  | `ask "<question>" --option "<label>" ... [--body <markdown>\|--file <path>] [--attach <path>]... [--to <login\|me>]... [--wait <seconds>] [--run <id>]` | `POST .../decisions` with `runId` and, for `--to`, `deciderId`, and `deciderIds` beside it where `--to` was given more than once ([ADR-0057](../adr/0057-a-decision-may-be-addressed-to-several-people-and-the-first-answer-ends-it.md)); with `--attach`, as one form with the part `decision` and a part `file` per file, its media type by extension ([ADR-0055](../adr/0055-a-decision-carries-the-files-put-on-it-when-it-is-raised.md)); then `GET .../decisions/<id>?wait=` | the decision raised, its id on a line of its own, how many files came, whom it waits for, its options; then the answer, or that it still waits. It is for the person the agent works for unless `--to` names another of the project ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)), or several, any of whom may answer, the first answer ending it |
81
- | `decision <id> [--wait <seconds>]` | `GET .../decisions/<id>`, with `?wait=` while waiting; where the project the command works in does not have it, or none is named, `GET /api/v1/decisions/<id>`, the decision wherever it is ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)) | the decision; with a wait, the answer or that it still waits; `decision.not_found` for one out of reach, on a console from before the route too |
81
+ | `decision <id> [--wait <seconds>]` | `GET .../decisions/<id>`, with `?wait=` while waiting; where the project the command works in does not have it, or none is named, `GET /api/v1/decisions/<id>`, the decision wherever it is ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)) | the decision, each of its files with the command that reads it: `console file <id>` in the project, `console file <id> --decision <decision id>` for a decision reached outside it; with a wait, the answer or that it still waits; `decision.not_found` for one out of reach, on a console from before the route too |
82
82
  | `answer <id> --option <n>\|--own "<answer>" [--note <markdown>\|--file <path>]` | `POST .../decisions/<id>/answer`; where the project does not have it, or none is named, `POST /api/v1/decisions/<id>/answer` ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)) | the decision with its answer: a person's answer written in their name through the agent, as they gave it in chat or in passing, with where and when in the note, so that the record is whole and a run that waited goes on ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)) |
83
83
  | `decisions [--open] [--limit <n>] [--offset <n>]`, `decisions --mine\|--raised [--open] [--limit <n>] [--offset <n>]` | `GET .../decisions`; `GET /api/v1/decisions` for `--mine`, with `raised=true` for `--raised`, neither needing a project | one line per decision, the waiting first; with `--mine`, the decisions addressed to the person across the projects they may see, with `--raised` those they asked of someone else, each with its project's key; a page at a time |
84
84
  | `finish [--summary <markdown>\|--file <path>] [--run <id>]`, `fail [...]` | `POST .../runs/<id>/end` | how the run ended |
@@ -170,7 +170,7 @@ Everything a plugin does to the console is a call on `ctx`, which is a message t
170
170
  | Member | What it is | Needs |
171
171
  |---|---|---|
172
172
  | `ctx.plugin` | `{ key, version, dataVersion, settings, board, projects, grants }`: the settings without the secrets; `board` the board project's `{ id, key }` or `null`; `projects` `"all"` or the keys of the projects the plugin is on; `grants` the roles of other plugins granted to this one, each `{ plugin, role }` ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md)) | nothing |
173
- | `ctx.caller` | `{ kind: "person" \| "console" \| "plugin", person?, agent?, plugin?, for?, roles, run?, project? }`: in a command, a query or a person's endpoint, the person (`id`, `login`, `name`, `language`, `admin`), the agent's name where a token acts, their roles in this plugin, their open run in the board project if any, and the project the call is on; in a job, a hook, an upgrade or a webhook, `console`, with every role; in an `api` call another plugin made from its own job, hook or webhook, `plugin`, with that plugin's key and the roles granted to it here, and, where it acts for a person, `for` the person (`id`, `login`, `name`, `language`, `admin: false`) and the roles the plugin and the person both hold ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md)); a plugin that knows only the first two kinds refuses the third, which fails safe | nothing |
173
+ | `ctx.caller` | `{ kind: "person" \| "console" \| "plugin", person?, agent?, plugin?, for?, roles, run?, project? }`: in a command, a query or a person's endpoint, the person (`id`, `login`, `name`, `language`, `admin`), the agent's name where a token acts, their roles in this plugin, their open run in the board project if any, and the project the call is on, one the plugin acts in only where it is placed on it ([ADR-0080](../adr/0080-a-plugin-reaches-the-projects-it-is-placed-on-and-whoever-may-use-it-is-a-requester-in-its-board-project.md)); in a job, a hook, an upgrade or a webhook, `console`, with every role; in an `api` call another plugin made from its own job, hook or webhook, `plugin`, with that plugin's key and the roles granted to it here, and, where it acts for a person, `for` the person (`id`, `login`, `name`, `language`, `admin: false`) and the roles the plugin and the person both hold ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md)); a plugin that knows only the first two kinds refuses the third, which fails safe | nothing |
174
174
  | `ctx.records(collection)` | the records of a collection, by its definition (typed from the schema) or by name: `create(data, { project?, owner? })`, `get(id)` (`null` when there is none), `update(id, patch, { baseVersion? })`, `archive(id)`, `restore(id)`, `list({ where?, order?, limit?, after?, project?, archived? })`, `search(words, { where?, limit?, project? })`, `aggregate({ where?, groupBy?, count?, sum?, min?, max? })`, `versions(id)`, `link(id, target)`, `unlink(id, target)`, `links(id)`, and `files(id)` with `attach(handle, { name?, type? })`, `list()` and `remove(fileId)`; `order` is `{ field, descending? }`; a refusal is thrown as a `PluginRefusal` with the console's code | nothing; `files` for the files |
175
175
  | `ctx.sql` | `query(text, params)` and `transaction(async (tx) => ...)`, on the plugin's own role | `storage:sql` |
176
176
  | `ctx.console.workspace()` | the workspace's name, languages, time zone (`timeZone`, `UTC` where none is set, and `timeZoneSet`, whether an administrator set one, so that a plugin that reads a time of day says so instead of taking UTC for a choice), the day its week begins on (`weekStart`: `auto`, `monday` or `sunday`), categories, and `url`, the console's public origin (`PUBLIC_URL`) for a link to the console in what the plugin writes elsewhere, `null` where the deployment names none | nothing |
@@ -182,7 +182,7 @@ Everything a plugin does to the console is a call on `ctx`, which is a message t
182
182
  | `ctx.console.documents` | `list(project, folder)`, `read(project, path)`, `write(project, path, { title, body })` under `plugins/<key>/` | `board:read`; `board:documents` |
183
183
  | `ctx.console.runs` | `list(project)`, `get(id)` | `board:read` |
184
184
  | `ctx.events.emit(kind, data)` | an event of the plugin's own, for its frames and for other plugins' hooks; `kind` as `key`, `data` JSON up to 16 KiB | nothing |
185
- | `ctx.fetch(url, init)` | an outbound request, its `method` `GET` (the default), `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS` and no other (`TRACE`, which has a server send the request back, is `plugin.invalid_args`), answered `{ status, headers, bytes, sealed?, text(), json() }`, a redirect as it came, never followed; `init` may carry `secret: { name, as }` or `secrets: [...]`, five at most, `as` one of `header:<name>`, `bearer` (`Authorization: Bearer`), `query:<name>`, `basic` (`user:password`) and `body:<field>` (a field of a JSON object or a form body), and the console puts each secret there, within the `hosts` its setting names and before its expiry, and takes it out of the answer's headers and body in every form it knows (as placed, escaped as JSON, URL-encoded, and for `basic` the base64 of the pair and the password alone), `"[withheld]"` in its place, so that a server that echoes the request, or a redirect that carries its URL, hands the plugin none; and `seal: { <setting>: "$.path" \| { path, expiresIn } }`, five at most, values of the answer's JSON the console seals as the plugin's secret settings before the plugin reads the answer, which says `"[sealed]"` in their place, `expiresIn` the seconds they last or a path to them, a setting with `hosts` sealed from their answers alone (`plugin.forbidden` before the request goes out otherwise). Sealing fails closed, and `sealed` says what became of each value named, by its setting: `sealed`; `absent`, nothing at the path (no such key, `null` or an empty string), nothing taken out, so that a service's error stays readable; `not_a_string`, `too_long` (over 4,096 characters) or `echoed` (holding a secret the request carried from another setting), never sealed, `"[withheld]"` in its place; `not_json`, an answer that is no JSON object or array, whose body is withheld whole, the plugin reading its status and headers alone (a token endpoint that answers a form unless asked otherwise is asked with `accept: application/json`). A value sealed or withheld is taken out of the rest of the answer too ([ADR-0070](../adr/0070-a-secret-is-sealed-by-the-console-from-an-answer-and-goes-where-its-setting-says.md)) | `outbound:<host>` for the URL's host |
185
+ | `ctx.fetch(url, init)` | an outbound request, its `method` `GET` (the default), `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS` and no other (`TRACE`, which has a server send the request back, is `plugin.invalid_args`), answered `{ status, headers, bytes, sealed?, text(), json() }`, a redirect as it came, never followed; `init` may carry `secret: { name, as }` or `secrets: [...]`, five at most, `as` one of `header:<name>`, `bearer` (`Authorization: Bearer`), `query:<name>`, `basic` (`user:password`) and `body:<field>` (a field of a JSON object or a form body), and the console puts each secret there, within the `hosts` its setting names and before its expiry, and takes it out of the answer's headers and body in every form it knows (as placed, escaped as JSON, URL-encoded with the hex digits big or small, each with its slashes escaped or not, and in base64, a header's alphabet or a URL's, whole or inside a longer run of it, of the value and of what the request carried for it, a query's, a form's or a JSON body's spelling, for a value of 8 bytes or more; for `basic`, the base64 of the pair and the password alone too, [ADR-0079](../adr/0079-a-secret-is-taken-out-of-an-answer-in-the-encodings-a-service-sends-it-back-in.md)), `"[withheld]"` in its place, so that a server that echoes the request, or a redirect that carries its URL, hands the plugin none; and `seal: { <setting>: "$.path" \| { path, expiresIn } }`, five at most, values of the answer's JSON the console seals as the plugin's secret settings before the plugin reads the answer, which says `"[sealed]"` in their place, `expiresIn` the seconds they last or a path to them, a setting with `hosts` sealed from their answers alone (`plugin.forbidden` before the request goes out otherwise). Sealing fails closed, and `sealed` says what became of each value named, by its setting: `sealed`; `absent`, nothing at the path (no such key, `null` or an empty string), nothing taken out, so that a service's error stays readable; `not_a_string`, `too_long` (over 4,096 characters) or `echoed` (holding a secret the request carried from another setting), never sealed, `"[withheld]"` in its place; `not_json`, an answer that is no JSON object or array, whose body is withheld whole, the plugin reading its status and headers alone (a token endpoint that answers a form unless asked otherwise is asked with `accept: application/json`). A value sealed or withheld is taken out of the rest of the answer too ([ADR-0070](../adr/0070-a-secret-is-sealed-by-the-console-from-an-answer-and-goes-where-its-setting-says.md)) | `outbound:<host>` for the URL's host |
186
186
  | `ctx.secrets` | `has(name)`, whether it is set and not past its expiry; `status(name)`, `{ set, setAt, expiresAt, source }`, `source` being `administrator` or the host of the answer it was sealed from; `sign(name, payload, algorithm)` and `verify(name, payload, signature, algorithm)` with `hmac-sha256`; a secret declared `use: "verify"` signs nothing and goes into no request; never the value | nothing |
187
187
  | `ctx.plugins.get(key)` | `{ version, api: { [name]: (input) => Promise<unknown> }, for(personId) }` of another plugin, never of itself (`plugin.forbidden`): a person's call passed through as the person; the console's own call as this plugin, with the roles granted to it there; `for(personId)` the same api for a person who did something elsewhere, with the roles both hold, in their language ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md)) | `plugins:<key>`; `people:act` for `for` |
188
188
  | `ctx.endpoints.url(name)` | the full address of an endpoint the plugin defines, under the console's public origin (`<PUBLIC_URL>/api/v1/plugins/<key>/x/<name>`), to register a callback or a webhook with a service elsewhere; `plugin.not_found` for a name it does not define, `plugin.unavailable` where the console has no public address | nothing |
@@ -204,10 +204,10 @@ Declared in the manifest, consented to by an administrator when enabling, enforc
204
204
  | `people:read` | the people the caller may see, as the person, and among them who was granted a role of the plugin (`ctx.console.people.granted(role)`, an administrator listed only where granted it) and, for a frame, their pictures | the names, logins and pictures its role holders may see anyway |
205
205
  | `people:read:all` | everyone, for `console` callers too; and the workspace's people events (`person.joined`, `person.deactivated`, `person.reactivated`, `person.role_changed`, `person.manager_changed`, `person.email_changed`, `person.listed`, `person.unlisted`, and the teams' `team.created`, `team.renamed`, `team.removed`, `team.member_added`, `team.member_removed`) to its hooks, with their content | the directory, and when people come and go |
206
206
  | `people:read:email` | the work email of the people it may read (`email` on `ctx.console.people.list` and `get`, `null` until known; left out without it): the address a person signs in with at Google, else what an administrator wrote, by which the plugin matches them to an account elsewhere; `person.email_changed` says that one changed, never what it is | the addresses of the people its role holders may see |
207
- | `people:act` | acting for a person who did something elsewhere ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md)): `ctx.plugins.get(key).for(personId)` and `ctx.console.decisions.answer(id, answer, { for })`, within what the person may do as a member, whatever they administer, and what the plugin was granted, both; a decision only where it is on their plate; recorded as the person's through the plugin | what its role holders may do as members, done in their name from elsewhere; the decisions on their plates answered |
207
+ | `people:act` | acting for a person who did something elsewhere ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md)): `ctx.plugins.get(key).for(personId)` and `ctx.console.decisions.answer(id, answer, { for })`, within what the person may do as a member, whatever they administer, and what the plugin was granted, both; a decision only where it is on their plate, a person's own only while they are in its project ([ADR-0077](../adr/0077-a-persons-own-decision-is-its-projects-and-reaches-nobody-out-of-it.md)); recorded as the person's through the plugin | what its role holders may do as members, done in their name from elsewhere; the decisions on their plates answered |
208
208
  | `projects:read` | the projects and members the caller may see | what the person sees |
209
209
  | `projects:read:all` | every project and its members | the projects and who is in them |
210
- | `board:read` | the tasks, decisions, runs, documents and events of its board projects, and of the project a call is on | the content of those boards, to its role holders |
210
+ | `board:read` | the tasks, decisions, runs, documents and events of its board project and the projects it is placed on, for a person those among them the person may see | the content of those boards, to its role holders |
211
211
  | `board:tasks` | tasks created in its projects; its own changed, closed, commented | tasks that mislead; each marked as the plugin's, put away by anyone |
212
212
  | `board:decisions` | decisions raised in its projects; the answers to its own read | questions that mislead; never an answer of its own (an answer for a person is `people:act`) |
213
213
  | `board:documents` | pages written under `plugins/<key>/` in its projects | pages that mislead, in its folder |
@@ -252,11 +252,12 @@ With `storage:sql` consented to, enabling creates the schema `plugin_<key>` and
252
252
  ## The board
253
253
 
254
254
  - `board.needs` says whether the plugin puts things on a board. Enabling one with `required` or `optional`, the administrator makes a project from `board.defaults` (the key, name and description in the workspace's languages, edited as they like; private; they are its owner) or chooses one that exists; several plugins may bind to one project. The install keeps the project's id, and the project's settings page shows the plugins bound to it.
255
- - A plugin with `level: project` pages, or with `project: optional` or `required` collections, is on the projects the administrator names: all, or a list. A plugin on no project has no project pages. Owners do not enable plugins in their projects.
256
- - What a plugin makes on a board carries its name: the console writes the link (`plugin_links`: plugin, kind, id) when `ctx.console.tasks.create`, `decisions.ask` or `documents.write` runs, the event carries `plugin = <key>` beside `actor` and `agent`, and the pages and the feed say "through <plugin>" (`plugin` on a task, a decision and a document as the API answers them). A person's call acts as the person; a call a plugin makes for a person acts as the person, a member whatever they administer, and the event names the plugin that acted for them as `via`; a `console` caller, a job or a hook, and a plugin another calls as itself act as the administrator who enabled the plugin, who owns what it makes, within the plugin's projects alone, through no one. A plugin changes, closes, comments or reads the answer of its own items only; it reads every item of its board projects with `board:read`. Its documents go under `plugins/<key>/`; a write elsewhere is `plugin.forbidden`.
255
+ - A plugin with `level: project` pages, or with `project: optional` or `required` collections, is on the projects the administrator names: all, or a list. A plugin on no project has no project pages. Owners do not enable plugins in their projects. The projects it is on, with its board project, are the projects it reaches, as itself and for anyone, and no other ([ADR-0080](../adr/0080-a-plugin-reaches-the-projects-it-is-placed-on-and-whoever-may-use-it-is-a-requester-in-its-board-project.md)): a person's call takes it nowhere it is not placed.
256
+ - What a plugin makes on a board carries its name: the console writes the link (`plugin_links`: plugin, kind, id) when `ctx.console.tasks.create`, `decisions.ask` or `documents.write` runs, the event carries `plugin = <key>` beside `actor` and `agent`, and the pages and the feed say "through <plugin>" (`plugin` on a task, a decision and a document as the API answers them). A person's call acts as the person, in the projects of the plugin's the person may see; a call a plugin makes for a person acts as the person, a member whatever they administer, and the event names the plugin that acted for them as `via`; a `console` caller, a job or a hook, and a plugin another calls as itself act as the administrator who enabled the plugin, who owns what it makes, within the plugin's projects alone, through no one. A plugin changes, closes, comments or reads the answer of its own items only; it reads every item of its board projects with `board:read`, and by id, for a person, only what the person may see, as a listing shows them. Its documents go under `plugins/<key>/`; a write elsewhere is `plugin.forbidden`.
257
257
  - A decision a plugin raises is a decision as any ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)): addressed to the person named in `deciderId`, or to the several named in `deciderIds`, any of whom may answer and the first answer ending it ([ADR-0057](../adr/0057-a-decision-may-be-addressed-to-several-people-and-the-first-answer-ends-it.md)), each an active person of the workspace, in the board project or not ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)), else to the administrator who enabled the plugin; answered by anyone of the project, by those it is addressed to wherever they are, and by whoever manages one of them, up the reporting line; shown among each person's decisions and in `console work`, read and answered at `/decisions/<id>` and `GET /api/v1/decisions/<id>` by a person who may not see the project, which is where a plugin's page sends them (`frame.navigate("/decisions/<id>")`). The command that raised it returns `waiting` and exits with `3`, and the agent waits as it does for `ask`. The plugin learns of the answer through `on["console:decision.answered"]`, which `about` lets it map to its record, and whose `data` names the chosen option by its label (`option`) and by the key the plugin gave it (`optionKey`), for its own decisions with `board:decisions` alone, so that it reads the answer without comparing labels or asking again; the person's own answer has no key. A plugin never answers of itself; with `people:act` it answers for a person a decision on their plate (`ctx.console.decisions.answer`).
258
258
  - What a plugin writes for people, a decision's question, body and labels, a task's title and body, a comment's body, is one text, in the language of whoever it is for ([ADR-0065](../adr/0065-a-plugin-writes-one-text-and-a-persons-language-is-kept-from-the-first-time-the-pages-see-them.md)). `ctx.console.people.get(id)` says a person's `language`: the one they chose, else the one the pages first saw them in, `null` until then, where the plugin decides, the first of `ctx.console.workspace().languages` by default. Where several may answer, it chooses one of them. Whoever else reads the text reads it as written, as with what a person writes.
259
- - Where a record is linked to a project and the caller may work there, `ask` and `tasks.create` may name that project instead of the board project.
259
+ - Whoever may use the plugin is a requester in its board project ([ADR-0080](../adr/0080-a-plugin-reaches-the-projects-it-is-placed-on-and-whoever-may-use-it-is-a-requester-in-its-board-project.md)): a person's call, or a call a plugin makes for a person, raises a decision there with `ask` whether the person may see the project or not, and the decision reaches them as its raiser, at its own address and among the decisions they raised; nothing else of the project opens to them, and `tasks.create` and `documents.write` there are refused as for any project the person may not see (`plugin.not_found`).
260
+ - Where a record is linked to a project the plugin is placed on and the caller may work there, `ask` and `tasks.create` may name that project instead of the board project.
260
261
  - Two plugins on one project do not collide: each edits its own, reads all, writes in its own folder; one refers to another's work by reading, or through the other's `api`.
261
262
 
262
263
  ## Events, hooks and jobs
@@ -364,7 +365,7 @@ The rules an agent reads carry the plugins: `GET /api/v1/rules` and `GET /api/v1
364
365
  </html>
365
366
  ```
366
367
 
367
- with the headers `content-security-policy: default-src 'none'; script-src <origin>/api/v1/plugins/<key>/web/<version>/; style-src <origin>/api/v1/plugins/<key>/web/ <origin>/api/v1/plugin-runtime/; img-src <origin>/api/v1/plugins/<key>/web/ data: blob:; font-src <origin>/api/v1/plugins/<key>/web/ <origin>/api/v1/plugin-runtime/; connect-src 'none'; frame-ancestors <origin>; base-uri 'none'; form-action 'none'; sandbox allow-scripts allow-forms`, `referrer-policy: no-referrer`, `x-content-type-options: nosniff` and `cache-control: no-store`. `<origin>` is the origin of the page that embeds the frame, read from the request's `referer`: `PUBLIC_URL`'s, or the loopback a person's own console is served on by `console serve` ([ADR-0014](../adr/0014-a-persons-own-console-is-served-from-their-machine-by-the-command.md)); any other, or none, is not found. A plugin that is not enabled, or a page or a widget it does not declare, is answered 404 with a blank document under `default-src 'none'; script-src 'sha256-<its one script>'; frame-ancestors <origin>; base-uri 'none'; form-action 'none'; sandbox allow-scripts`, whose one script tells the page `unavailable`, so that a frame never shows an answer meant for a program. The console's page embeds the frame as `<iframe sandbox="allow-scripts allow-forms" referrerpolicy="origin" src=...>`. The document's origin is opaque: no cookie travels, the API is out of reach, and its scripts are the bundle's alone. `allow-forms` is there so that a page's form fires its `submit` event, which a browser drops with the submission otherwise; `form-action 'none'` keeps a submission from going anywhere, so a page handles the event itself and speaks over the bridge. The headers are proven by an integration test, and a browser is seen to enforce them by `pnpm test:browser`, a real Chromium against the console listening on this machine, apart from `pnpm check` (`apps/console/src/http/plugin-frame.browser.test.ts`). The files of the bundle, `GET .../web/<version>/<path>`, are served from the package's `web` directory with `cache-control: public, max-age=31536000, immutable` (`no-store` on the preview console of `pnpm dev:plugins`, where a plugin is rebuilt under one version and a browser that kept a build would run it against a server that answers something else), `cross-origin-resource-policy: cross-origin` and `access-control-allow-origin: *`, since the frame's origin is not the console's and a module script, as a font, is fetched with CORS; the console's stylesheet for frames carries the same two. The document links `fonts.css` before the stylesheet: the `@font-face` rules of the console's own build, their files served at `GET /api/v1/plugin-runtime/assets/<file>`, fonts alone, so that a frame reads in the console's faces; empty where the server has no build. In a frame document the stylesheet paints no background and lets the document be as tall as its content (`html[data-console]`), so that the box the console draws shows through and the frame shrinks as well as grows. A bundle holds no secret, since anyone may fetch it. The console's own pages gain `frame-src 'self'` in their policy and nothing else.
368
+ with the headers `content-security-policy: default-src 'none'; script-src <origin>/api/v1/plugins/<key>/web/<version>/; style-src <origin>/api/v1/plugins/<key>/web/ <origin>/api/v1/plugin-runtime/; img-src <origin>/api/v1/plugins/<key>/web/ data: blob:; font-src <origin>/api/v1/plugins/<key>/web/ <origin>/api/v1/plugin-runtime/; connect-src 'none'; frame-ancestors <origin>; base-uri 'none'; form-action 'none'; sandbox allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox`, `referrer-policy: no-referrer`, `x-content-type-options: nosniff` and `cache-control: no-store`. `<origin>` is the origin of the page that embeds the frame, read from the request's `referer`: `PUBLIC_URL`'s, or the loopback a person's own console is served on by `console serve` ([ADR-0014](../adr/0014-a-persons-own-console-is-served-from-their-machine-by-the-command.md)); any other, or none, is not found. A plugin that is not enabled, or a page or a widget it does not declare, is answered 404 with a blank document under `default-src 'none'; script-src 'sha256-<its one script>'; frame-ancestors <origin>; base-uri 'none'; form-action 'none'; sandbox allow-scripts`, whose one script tells the page `unavailable`, so that a frame never shows an answer meant for a program. The console's page embeds the frame as `<iframe sandbox="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox" referrerpolicy="origin" src=...>`. The document's origin is opaque: no cookie travels, the API is out of reach, and its scripts are the bundle's alone. `allow-forms` is there so that a page's form fires its `submit` event, which a browser drops with the submission otherwise; `form-action 'none'` keeps a submission from going anywhere, so a page handles the event itself and speaks over the bridge. `allow-popups` and `allow-popups-to-escape-sandbox` are there so that a link a person presses opens in a new tab: the browser lets the frame open a window for a press in it alone, one a press, and the window is a page as any, out of the sandbox, with no opener and no referrer as `frame.open` opens it ([ADR-0078](../adr/0078-a-frame-opens-its-links-itself-and-the-browser-holds-it-to-a-press-in-it.md)); the console's page admits no frame but its own under `frame-src 'self'`, so a window a plugin opened with an opener could send the frame nowhere. The headers are proven by an integration test, and a browser is seen to enforce them by `pnpm test:browser`, a real Chromium against the console listening on this machine, apart from `pnpm check` (`apps/console/src/http/plugin-frame.browser.test.ts`). The files of the bundle, `GET .../web/<version>/<path>`, are served from the package's `web` directory with `cache-control: public, max-age=31536000, immutable` (`no-store` on the preview console of `pnpm dev:plugins`, where a plugin is rebuilt under one version and a browser that kept a build would run it against a server that answers something else), `cross-origin-resource-policy: cross-origin` and `access-control-allow-origin: *`, since the frame's origin is not the console's and a module script, as a font, is fetched with CORS; the console's stylesheet for frames carries the same two. The document links `fonts.css` before the stylesheet: the `@font-face` rules of the console's own build, their files served at `GET /api/v1/plugin-runtime/assets/<file>`, fonts alone, so that a frame reads in the console's faces; empty where the server has no build. In a frame document the stylesheet paints no background and lets the document be as tall as its content (`html[data-console]`), so that the box the console draws shows through and the frame shrinks as well as grows. A bundle holds no secret, since anyone may fetch it. The console's own pages gain `frame-src 'self'` in their policy and nothing else.
368
369
 
369
370
  ### The bridge
370
371
 
@@ -385,12 +386,12 @@ The console's page and the frame speak over `postMessage`, every message `{ v: 1
385
386
  | the frame | `resize` | `height`, which the page gives a page's frame; a widget fills the cells its size gives it, and its height is not read |
386
387
  | the frame | `title` | `text`, for the document's title |
387
388
  | the frame | `download` | `id` of a file, which the page downloads |
388
- | the frame | `open` | `url`, a web or a mail address (`https:`, `http:`, `mailto:`) a person pressed, which the page opens in a new tab with no opener and no referrer, only right after a press ([ADR-0067](../adr/0067-a-link-a-person-presses-in-a-frame-opens-in-a-new-tab-through-the-bridge.md)); anything else is dropped unread, an address of the console's own origin among it, since a path of the console's is `navigate`'s |
389
+ | the frame | `open` | `url`, a web or a mail address (`https:`, `http:`, `mailto:`) a person pressed, from a bundle built before 0.4.6, whose sandbox opened no window: the page opens it in a new tab with no opener and no referrer, as far as it can tell of a press in that frame, while a press is recent and the frame holds the page's focus, one tab a press, the page taking the focus back as it opens one ([ADR-0067](../adr/0067-a-link-a-person-presses-in-a-frame-opens-in-a-new-tab-through-the-bridge.md), [ADR-0078](../adr/0078-a-frame-opens-its-links-itself-and-the-browser-holds-it-to-a-press-in-it.md)); a frame since opens its links itself, and the message goes at the next line; anything else is dropped unread, an address of the console's own origin among it, since a path of the console's is `navigate`'s |
389
390
  | the frame | `subscribe` | `kinds`, to receive `event` |
390
391
 
391
392
  The page performs every `call` with the person's session under `/api/v1/plugins/<key>/` only; a method or a path outside it is refused before any request, as `plugin.forbidden`. A page thus holds exactly the authority of its plugin's server module, as the person using it.
392
393
 
393
- `@skillcdn/console/plugin/web` is the frame's side: `connect()` says `ready`, waits for `init`, and resolves to `{ context, call, command, query, records, files, people, navigate, open, download, setTitle, onEvent, onTheme, onPath, close }`, applies the tokens to `:root` and the language to the document, and watches the body's height; it depends on nothing, and a refusal arrives as a `PluginBridgeError` with the console's code. `@skillcdn/console/plugin/web/react` adds `usePlugin()` for a plugin that chooses React. `people.picture(id)` answers a `blob:` address for an image, or `null` for a person with no picture to show. A page renders nothing a person wrote as HTML, as the console's own pages do not.
394
+ `@skillcdn/console/plugin/web` is the frame's side: `connect()` says `ready`, waits for `init`, and resolves to `{ context, call, command, query, records, files, people, navigate, open, download, setTitle, onEvent, onTheme, onPath, close }`, applies the tokens to `:root` and the language to the document, and watches the body's height; it depends on nothing, and a refusal arrives as a `PluginBridgeError` with the console's code. `open(url)` opens a web or a mail address in a new tab from the frame itself, with no opener and no referrer, for a link a person pressed: the browser holds the frame to a press in it, as it holds any page that opens a window, so that no window opens on the frame's own time or for a press elsewhere on the page, and the call is refused with no recent press where the browser can say so ([ADR-0078](../adr/0078-a-frame-opens-its-links-itself-and-the-browser-holds-it-to-a-press-in-it.md)); it needs a console from 0.4.6, which a plugin that calls it says in its manifest's `console`. `@skillcdn/console/plugin/web/react` adds `usePlugin()` for a plugin that chooses React. `people.picture(id)` answers a `blob:` address for an image, or `null` for a person with no picture to show. A page renders nothing a person wrote as HTML, as the console's own pages do not.
394
395
 
395
396
  ### Tabs, sub-tabs and addresses
396
397
 
@@ -437,6 +438,17 @@ The install path is the first line (a release of the deployment, from a lockfile
437
438
 
438
439
  **The reach, by capability,** is the last column of the catalogue above. In sum: a plugin reaches what its role holders may see through it and what its consented capabilities open; sending anything out needs an `outbound` capability the administrator consented to; what it does on a board is marked and reversible.
439
440
 
441
+ **Who may do what on the board** is one model ([ADR-0080](../adr/0080-a-plugin-reaches-the-projects-it-is-placed-on-and-whoever-may-use-it-is-a-requester-in-its-board-project.md)), each rule the shape of one in wide use, and a new rule is weighed against them:
442
+
443
+ | Rule | On the board |
444
+ |---|---|
445
+ | A principal's own permission is what was granted to it | a person: their standing in the workspace and in each project; a plugin: the capabilities an administrator consented to, the roles granted to it, its board project and the projects it is placed on, read on every call |
446
+ | A plugin reaches its board project and the projects it is placed on, and no other | as itself and for anyone; a person's call takes it nowhere else |
447
+ | Acting for a person is the intersection, recorded with the actor | what the plugin may do and what the person may do as a member, both, never the person's administration; the event names the person, the plugin whose code acted and the plugin that acted for them, `via` ([ADR-0072](../adr/0072-a-plugin-is-a-principal-it-holds-roles-granted-to-it-calls-as-itself-and-acts-for-a-person-within-what-both-may-do.md), [ADR-0076](../adr/0076-a-plugin-acting-for-a-person-stands-as-a-member-and-answers-only-what-is-on-their-plate.md)) |
448
+ | A decision reaches its parties | whoever may work in its project; whom it is addressed to and who raised it; the managers above a decider, for a plugin's; a person's own within its project alone ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md), [ADR-0077](../adr/0077-a-persons-own-decision-is-its-projects-and-reaches-nobody-out-of-it.md)) |
449
+ | Whoever may use a plugin is a requester in its board project | they raise a decision there through the plugin, themselves or through a plugin acting for them, and read it as its raiser; nothing else of the project opens to them |
450
+ | A plugin's own acts are the console's, through no one | recorded as the administrator who enabled it, with the plugin's key beside; an identity of the plugin's own on the board is an open question ([architecture.md](../architecture.md)) |
451
+
440
452
  **What is checked, not enforced.** The hardening of a thread is defence in depth: a sandbox of its own would be a host container without egress, left to later. `console-plugin check` scans a plugin for what the host refuses, so that an author learns before an administrator does.
441
453
 
442
454
  **The pages.** A frame's code runs in an opaque origin and reaches the console through the bridge alone, which performs its plugin's own routes and nothing else; it holds the person's authority within its plugin, exactly as the plugin's server does. A file of its bundle, which a frame may go to, carries a policy of its own and runs nothing as a document. A frame holds no WebRTC either, which `connect-src` does not govern and no policy a browser honours closes: every script of a bundle is served beginning with a line that takes it out of wherever the script runs, the frame or a frame made inside it ([ADR-0064](../adr/0064-a-frame-holds-no-webrtc-every-script-of-a-bundle-begins-by-taking-it-out.md)). A plugin that holds `outbound:webrtc` is served its scripts without that line; no host opens it, and it opens no host. One that lists it as optional is served its scripts uncached, so that it is gone from the next time a frame loads once it is withdrawn; a consent a new version no longer asks opens nothing, and a frame runs its own version's scripts alone ([ADR-0066](../adr/0066-webrtc-is-a-way-out-a-plugin-asks-for-and-how-a-frame-is-held-stays-in-one-place.md)). Nothing a plugin writes is rendered as HTML by the console's pages: a tab, a sub-tab and a widget's name are text.
@@ -160,15 +160,15 @@ The rules of the board ([ADR-0023](../adr/0023-the-rules-of-a-board-are-pages-th
160
160
 
161
161
  ### `GET /api/v1/work`
162
162
 
163
- `{ "tasks": [{ "project": { "key", "name", "color", "symbol", "icon" }, "task" }, ...], "closed": [{ "project", "task" }, ...], "decisions": [{ "project", "decision" }, ...] }`: what is on the asker's plate across the projects they may see ([ADR-0019](../adr/0019-a-task-is-planned-in-days-the-board-keeps-its-moments-and-goals-and-categories-give-the-work-its-shape.md)): the open tasks they are at work on, the sooner due first and those with no day last; `closed`, the tasks they are at work on that are done or dropped and not yet put away, the last closed first, so that the week on the plate's page shows them on their days as a project's calendar does; and the decisions that wait for the asker's answer ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)), the longest waiting first; each with the project it belongs to, so that a page says and links it. A task put away is in neither list ([ADR-0030](../adr/0030-a-task-is-put-away-from-any-state.md)). At most `LIST_LIMIT` of each.
163
+ `{ "tasks": [{ "project": { "key", "name", "color", "symbol", "icon" }, "task" }, ...], "closed": [{ "project", "task" }, ...], "decisions": [{ "project", "decision" }, ...] }`: what is on the asker's plate across the projects they may see ([ADR-0019](../adr/0019-a-task-is-planned-in-days-the-board-keeps-its-moments-and-goals-and-categories-give-the-work-its-shape.md)): the open tasks they are at work on, the sooner due first and those with no day last; `closed`, the tasks they are at work on that are done or dropped and not yet put away, the last closed first, so that the week on the plate's page shows them on their days as a project's calendar does; and the decisions that wait for the asker's answer ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)), a plugin's wherever it is and a person's own while the asker is in its project ([ADR-0077](../adr/0077-a-persons-own-decision-is-its-projects-and-reaches-nobody-out-of-it.md)), the longest waiting first; each with the project it belongs to, so that a page says and links it. A task put away is in neither list ([ADR-0030](../adr/0030-a-task-is-put-away-from-any-state.md)). At most `LIST_LIMIT` of each.
164
164
 
165
165
  ### `GET /api/v1/decisions?open=&raised=&limit=&offset=`
166
166
 
167
- `{ "items": [{ "project": { "key", "name", "color", "symbol", "icon" }, "decision" }, ...], "more": boolean }`: the decisions addressed to the asker ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)), alone or among others ([ADR-0057](../adr/0057-a-decision-may-be-addressed-to-several-people-and-the-first-answer-ends-it.md)), wherever they are, in a project the asker may see or not ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md); the project's key, name and mark come with one from elsewhere, and nothing else of it), a page at a time as the tasks are (`limit`, `offset`, `more`): the ones that wait first, the longest waiting first among them, then the answered, newest first, as the record; `open=true` keeps only those that wait, and `raised=true` answers instead the decisions the asker raised, through their agent or themselves, for someone else. Each decision comes with the project it belongs to, as the plate's things do, so that a page says and links it. What a person's own page of decisions reads, in both kinds, and `console decisions --mine` and `--raised`.
167
+ `{ "items": [{ "project": { "key", "name", "color", "symbol", "icon" }, "decision" }, ...], "more": boolean }`: the decisions addressed to the asker ([ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md)), alone or among others ([ADR-0057](../adr/0057-a-decision-may-be-addressed-to-several-people-and-the-first-answer-ends-it.md)), a plugin's wherever it is, in a project the asker may see or not ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md); the project's key, name and mark come with one from elsewhere, and nothing else of it), and a person's own while the asker is in its project ([ADR-0077](../adr/0077-a-persons-own-decision-is-its-projects-and-reaches-nobody-out-of-it.md)), a page at a time as the tasks are (`limit`, `offset`, `more`): the ones that wait first, the longest waiting first among them, then the answered, newest first, as the record; `open=true` keeps only those that wait, and `raised=true` answers instead the decisions the asker raised, through their agent or themselves, for someone else, held to the same. Each decision comes with the project it belongs to, as the plate's things do, so that a page says and links it. What a person's own page of decisions reads, in both kinds, and `console decisions --mine` and `--raised`.
168
168
 
169
169
  ### `GET /api/v1/decisions/<id>?wait=` and `POST /api/v1/decisions/<id>/answer`
170
170
 
171
- One decision by its id, wherever it is ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)): `{ "project": { "key", "name", "color", "symbol", "icon" }, "decision", "mayAnswer" }`, for whoever it reaches: anyone who may see its project; and, from outside the project, the people it is addressed to, the person who raised it, and, for a decision a plugin raised, whoever manages one of the people it is addressed to, directly or up the reporting line. `wait` holds the request as the project's route does. `mayAnswer` says whether the asker may answer it: anyone who may work in the project, those it is addressed to and the managers above them for a plugin's; the raiser reads alone. `POST .../answer` takes what the project's route takes and writes the answer for whoever `mayAnswer` is true for (`auth.forbidden` otherwise). A decision out of the asker's reach is `decision.not_found`, not told apart from one that is not there; nothing else of a project the asker may not see opens through it.
171
+ One decision by its id, wherever it is ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)): `{ "project": { "key", "name", "color", "symbol", "icon" }, "decision", "mayAnswer" }`, for whoever it reaches: anyone who may see its project; and, for a decision a plugin raised, from outside its project, the people it is addressed to, the person who raised it, a requester who raised it through the plugin's command in a board project they may not see as much as anyone ([ADR-0080](../adr/0080-a-plugin-reaches-the-projects-it-is-placed-on-and-whoever-may-use-it-is-a-requester-in-its-board-project.md)), and whoever manages one of the people it is addressed to, directly or up the reporting line. A person's own decision is its project's: out of the project, those it is addressed to and the person who raised it reach it no more ([ADR-0077](../adr/0077-a-persons-own-decision-is-its-projects-and-reaches-nobody-out-of-it.md)). `wait` holds the request as the project's route does. `mayAnswer` says whether the asker may answer it: anyone who may work in the project, and for a plugin's, those it is addressed to and the managers above them; the raiser reads alone. `POST .../answer` takes what the project's route takes and writes the answer for whoever `mayAnswer` is true for (`auth.forbidden` otherwise). A decision out of the asker's reach is `decision.not_found`, not told apart from one that is not there; nothing else of a project the asker may not see opens through it.
172
172
 
173
173
  ### `GET /api/v1/decisions/<id>/files/<file id>`
174
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillcdn/console",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "What a custom SkillCDN console is built from: the API client and schemas, the components, the composition of the default console, and the console command agents work the board with.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/skillcdn/console#readme",
@@ -71,7 +71,7 @@ Produces the **design**: one table, a row per thing the feature does, saying who
71
71
  |---|---|
72
72
  | An agent does it for a person, and something changes | A **command**: `defineCommand({ about, args, roles, run })`. Its `text` answer is for people, its `data` for agents (`--json`); it does one thing and does it again safely where it can. |
73
73
  | An agent, or a page, looks something up | A **query**: `defineQuery(...)`, which writes nothing; a query may answer a file. |
74
- | A person must approve, choose or confirm | A **decision** the command raises with `ctx.console.decisions.ask`, with options, addressed to the person a setting or the record names (`deciderId`), or to several of them (`deciderIds`, any of whom may answer), anyone active of the workspace, in the board project or not: they find it among their decisions and answer it there, and whoever manages them up the reporting line may answer it too ([ADR-0068](/docs/adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)); a page sends a person to it with `frame.navigate("/decisions/<id>")`, which opens for them though the project does not; `about` the record it is for, its question, body and labels written once, in the language of whoever is to answer: `ctx.console.people.get(id)` says it as `language`, and where that is `null`, a person who has not opened the console yet, the plugin writes in the first of `ctx.console.workspace().languages` ([ADR-0065](/docs/adr/0065-a-plugin-writes-one-text-and-a-persons-language-is-kept-from-the-first-time-the-pages-see-them.md)); the command answers `waiting`, the agent waits as the console's own `ask` is waited for, and the plugin hears the answer in a hook on `console:decision.answered` and goes on. The plugin never answers one, and never computes what a person must choose. |
74
+ | A person must approve, choose or confirm | A **decision** the command raises with `ctx.console.decisions.ask`, with options, addressed to the person a setting or the record names (`deciderId`), or to several of them (`deciderIds`, any of whom may answer), anyone active of the workspace, in the board project or not: they find it among their decisions and answer it there, and whoever manages them up the reporting line may answer it too ([ADR-0068](/docs/adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)); raised in the board project for whoever called the command, in the project or not, who reads it back as its raiser and nothing else of the project, so that a requester needs no place in the project ([ADR-0080](/docs/adr/0080-a-plugin-reaches-the-projects-it-is-placed-on-and-whoever-may-use-it-is-a-requester-in-its-board-project.md)); a page sends a person to it with `frame.navigate("/decisions/<id>")`, which opens for them though the project does not; `about` the record it is for, its question, body and labels written once, in the language of whoever is to answer: `ctx.console.people.get(id)` says it as `language`, and where that is `null`, a person who has not opened the console yet, the plugin writes in the first of `ctx.console.workspace().languages` ([ADR-0065](/docs/adr/0065-a-plugin-writes-one-text-and-a-persons-language-is-kept-from-the-first-time-the-pages-see-them.md)); the command answers `waiting`, the agent waits as the console's own `ask` is waited for, and the plugin hears the answer in a hook on `console:decision.answered` and goes on. The plugin never answers one, and never computes what a person must choose. |
75
75
  | Someone must do something later | A **task** on the board project with `ctx.console.tasks.create`, marked as the plugin's, worked by whoever takes it; its title and body, and a comment on it, one text each, written as a decision's words are, in the language of whoever it is for. |
76
76
  | The console must tell the plugin something happened | A **hook**, `on["console:<kind>"]` (`events:console`): the plugin's board project, the projects it is on and the items it made are what it hears of. Delivery is at least once: a handler reads the record first and does nothing twice, and the event's `id` (one across both streams) with its `attempt` is what it keeps to tell a delivery repeated; a service that says to come back later is told to the console as `retryAfterMs` on the refusal, and the next try waits that long. A collection that grows with every event, deliveries, log lines, gets `retention: { days }` and `history: false`, so that it never reaches the quota. |
77
77
  | Another plugin must tell it | A **hook** on `plugin:<key>:<kind>` (`events:plugins`), or a call on the other's `api` (`plugins:<key>`). |
@@ -119,7 +119,7 @@ The hand-over is a task on the deployment's board, written as [planning-the-boar
119
119
 
120
120
  - People decide: a plugin raises decisions and waits; it never answers one, never acts as a person it is not, and never computes an approval. What it makes on a board carries its name and is reversible by people.
121
121
  - The fewest capabilities: each one in the manifest has a row of the design that needs it, and the sentence an administrator reads for it is true of the code. `check` warns of one no definition uses; it is dropped.
122
- - A secret is a `secret` setting the administrator sets or the console seals from an answer (`seal`), put into a request by the console within the `hosts` the setting names, or verified by it (`use: "verify"` for one that verifies alone); the plugin never reads its value, logs it, keeps it in a record, or puts it in the repository, the tests or the chat.
122
+ - A secret is a `secret` setting the administrator sets or the console seals from an answer (`seal`), put into a request by the console within the `hosts` the setting names, or verified by it (`use: "verify"` for one that verifies alone); the plugin never reads its value, logs it, keeps it in a record, or puts it in the repository, the tests or the chat. Every form of a secret a request carried, base64 included, is taken out of the answer the plugin reads ([ADR-0079](/docs/adr/0079-a-secret-is-taken-out-of-an-answer-in-the-encodings-a-service-sends-it-back-in.md)), so a value a service sends back by design, a client id inside a token it issues, say, is no secret: it is a plain setting.
123
123
  - A plugin acting for a person acts within what that person may do as a member and what the plugin was granted, both, and never answers a decision itself; it never calls its own api (`plugins:<its key>` is refused); a callee reads `ctx.caller.kind === "plugin"` and refuses where its rules need a person at the keyboard.
124
124
  - Everything a person wrote is shown as text, in the pages and in a command's answer; the frame renders no HTML from a record, and its classes are prefixed `pl-<key>-`.
125
125
  - The server module imports nothing the host refuses, reaches no network but `ctx.fetch`, no file but its own, and keeps no state between calls but in records; a hook does nothing twice.
package/src/cli/cli.ts CHANGED
@@ -2434,14 +2434,25 @@ async function attachmentsOf(io: CliIo, paths: readonly string[]): Promise<FileU
2434
2434
  /**
2435
2435
  * A file of the project, read from the console and written on this machine: one a run handed
2436
2436
  * in, one put in a comment or on a decision, or one attached to a page, by its id, so that an
2437
- * agent can look at a picture a person put on the board.
2437
+ * agent can look at a picture a person put on the board. With `--decision`, a file of that
2438
+ * decision, read at the decision's own address (ADR-0068): wherever it is, in the project the
2439
+ * command works in or one it does not name.
2438
2440
  */
2439
2441
  const file: Command = async (args, io) => {
2440
- const { values, positionals } = parse(args, { out: { type: "string" } });
2441
- const id = theOne(positionals, "Say which file: console file <id> [--out <path>]");
2442
+ const { values, positionals } = parse(args, {
2443
+ out: { type: "string" },
2444
+ decision: { type: "string" },
2445
+ });
2446
+ const id = theOne(
2447
+ positionals,
2448
+ "Say which file: console file <id> [--decision <id>] [--out <path>]",
2449
+ );
2450
+ const decisionId = text(values, "decision");
2442
2451
  const session = await open(io, values);
2443
- const project = await session.project();
2444
- const read = await project.readFile(id);
2452
+ const read =
2453
+ decisionId === undefined
2454
+ ? await (await session.project()).readFile(id)
2455
+ : await session.client.readDecisionFile(decisionId, id);
2445
2456
  const target = text(values, "out") ?? read.name;
2446
2457
  let saved: string;
2447
2458
  try {
@@ -2712,11 +2723,11 @@ const answering: Command = async (args, io) => {
2712
2723
  }
2713
2724
  const note = await bodyOf(io, values, text(values, "note"));
2714
2725
  const session = await open(io, values);
2715
- const answered = await answerReached(session, id, {
2726
+ const { decision: answered, atItsAddress } = await answerReached(session, id, {
2716
2727
  ...(own === undefined ? { option } : { own }),
2717
2728
  ...(note === undefined ? {} : { note }),
2718
2729
  });
2719
- answer(io, session, answered, () => formatDecision(answered));
2730
+ answer(io, session, answered, () => formatDecision(answered, { atItsAddress }));
2720
2731
  return EXIT.ok;
2721
2732
  };
2722
2733
 
@@ -2735,11 +2746,16 @@ const notInProject = (error: unknown): boolean =>
2735
2746
  async function reachDecision(
2736
2747
  session: Session,
2737
2748
  id: string,
2738
- ): Promise<{ readonly decision: RestDecision; readonly waiter: Waiter }> {
2749
+ ): Promise<{
2750
+ readonly decision: RestDecision;
2751
+ readonly waiter: Waiter;
2752
+ /** Whether it was reached at its own address, outside the project the command works in. */
2753
+ readonly atItsAddress: boolean;
2754
+ }> {
2739
2755
  if ((await session.projectKey()) !== undefined) {
2740
2756
  const project = await session.project();
2741
2757
  try {
2742
- return { decision: await project.decision(id), waiter: project };
2758
+ return { decision: await project.decision(id), waiter: project, atItsAddress: false };
2743
2759
  } catch (error) {
2744
2760
  if (!notInProject(error)) {
2745
2761
  throw error;
@@ -2755,6 +2771,7 @@ async function reachDecision(
2755
2771
  awaitDecision: async (decisionId, seconds) =>
2756
2772
  (await anywhere.awaitDecision(decisionId, seconds)).decision,
2757
2773
  },
2774
+ atItsAddress: true,
2758
2775
  };
2759
2776
  } catch (error) {
2760
2777
  if (error instanceof ApiError && error.status === 404) {
@@ -2769,10 +2786,13 @@ async function answerReached(
2769
2786
  session: Session,
2770
2787
  id: string,
2771
2788
  input: RestAnswerInput,
2772
- ): Promise<RestDecision> {
2789
+ ): Promise<{ readonly decision: RestDecision; readonly atItsAddress: boolean }> {
2773
2790
  if ((await session.projectKey()) !== undefined) {
2774
2791
  try {
2775
- return await (await session.project()).answerDecision(id, input);
2792
+ return {
2793
+ decision: await (await session.project()).answerDecision(id, input),
2794
+ atItsAddress: false,
2795
+ };
2776
2796
  } catch (error) {
2777
2797
  if (!notInProject(error)) {
2778
2798
  throw error;
@@ -2780,7 +2800,7 @@ async function answerReached(
2780
2800
  }
2781
2801
  }
2782
2802
  try {
2783
- return await session.client.answerDecision(id, input);
2803
+ return { decision: await session.client.answerDecision(id, input), atItsAddress: true };
2784
2804
  } catch (error) {
2785
2805
  if (error instanceof ApiError && error.status === 404) {
2786
2806
  throw new ApiError(404, "decision.not_found", "The decision was not found.");
@@ -2809,9 +2829,9 @@ const decision: Command = async (args, io) => {
2809
2829
  answer(io, session, grown, () => formatDecision(grown));
2810
2830
  return EXIT.ok;
2811
2831
  }
2812
- const { decision: found, waiter } = await reachDecision(session, id);
2832
+ const { decision: found, waiter, atItsAddress } = await reachDecision(session, id);
2813
2833
  if (seconds === 0) {
2814
- answer(io, session, found, () => formatDecision(found));
2834
+ answer(io, session, found, () => formatDecision(found, { atItsAddress }));
2815
2835
  return EXIT.ok;
2816
2836
  }
2817
2837
  return settle(io, session, waiter, found, seconds);
package/src/cli/format.ts CHANGED
@@ -489,7 +489,19 @@ export function formatAnswer(decision: RestDecision): string {
489
489
  return lines.join("\n");
490
490
  }
491
491
 
492
- export function formatDecision(decision: RestDecision): string {
492
+ /**
493
+ * One decision in full. A decision reached at its own address (ADR-0068), outside the project the
494
+ * command works in, names its files with the command that reads them there, by the decision too:
495
+ * the project's own address knows nothing of it.
496
+ */
497
+ export function formatDecision(
498
+ decision: RestDecision,
499
+ options: { readonly atItsAddress?: boolean } = {},
500
+ ): string {
501
+ const reads = (fileId: string): string =>
502
+ options.atItsAddress === true
503
+ ? `console file ${fileId} --decision ${decision.id}`
504
+ : `console file ${fileId}`;
493
505
  const lines = [
494
506
  `decision ${decision.id}: ${decision.question}`,
495
507
  `asked by ${asker(decision)}${addressed(decision)}${decision.taskNumber === null ? "" : `, about task #${decision.taskNumber}`}`,
@@ -504,7 +516,7 @@ export function formatDecision(decision: RestDecision): string {
504
516
  "",
505
517
  ...files.map(
506
518
  (attached) =>
507
- `file: ${attached.file.name} (${attached.file.size} bytes, ${attached.file.contentType}): console file ${attached.id}`,
519
+ `file: ${attached.file.name} (${attached.file.size} bytes, ${attached.file.contentType}): ${reads(attached.id)}`,
508
520
  ),
509
521
  );
510
522
  }
package/src/cli/help.ts CHANGED
@@ -589,11 +589,13 @@ export const COMMAND_HELP: Readonly<Record<string, CommandHelp>> = {
589
589
  ],
590
590
  },
591
591
  file: {
592
- usage: "file <id> [--out <path>]",
593
- synopsis: "Reads a file of the project to this machine, by its id.",
592
+ usage: "file <id> [--decision <id>] [--out <path>]",
593
+ synopsis: "Reads a file of the project, or of a decision, to this machine, by its id.",
594
594
  about:
595
- "Reads a file of the project from the console and writes it on this machine: one a run handed in, one put in a comment or on a decision, or one attached to a page, by the id the task, the run, the decision or the page shows. Written under its own name in the working directory, at --out <path>, or into --out <directory>. Then look at it with your own tools.",
596
- refusals: ["file.not_found: no file of this project has that id"],
595
+ "Reads a file of the project from the console and writes it on this machine: one a run handed in, one put in a comment or on a decision, or one attached to a page, by the id the task, the run, the decision or the page shows. With --decision <id>, a file put on that decision, read at the decision's own address (ADR-0068): wherever the decision is, in this project or in one this directory does not name, as console decision reaches it and names the command for each of its files. Written under its own name in the working directory, at --out <path>, or into --out <directory>. Then look at it with your own tools.",
596
+ refusals: [
597
+ "file.not_found: no file of this project has that id, or, with --decision, none of that decision that reaches you",
598
+ ],
597
599
  },
598
600
  docs: {
599
601
  usage: "docs [<folder>] [--search <words>] [--archived]",
@@ -763,7 +765,17 @@ const SECTIONS: readonly { readonly title: string; readonly commands: readonly s
763
765
  {
764
766
  title:
765
767
  "Configuring, as the person: what an administrator or an owner does on the pages, their agent does here, named on it",
766
- commands: ["workspace", "people", "person", "project", "members", "member", "category"],
768
+ commands: [
769
+ "workspace",
770
+ "people",
771
+ "person",
772
+ "teams",
773
+ "team",
774
+ "project",
775
+ "members",
776
+ "member",
777
+ "category",
778
+ ],
767
779
  },
768
780
  ];
769
781
 
package/src/client.ts CHANGED
@@ -665,6 +665,8 @@ export interface ConsoleClient {
665
665
  * see or not (ADR-0068), as the project's `fileUrl` is for whoever may see the project.
666
666
  */
667
667
  decisionFileUrl(decisionId: string, fileId: string): string;
668
+ /** The bytes of a file put on a decision, read at the decision's own address: wherever the decision is, as `decisionFileUrl` names it. */
669
+ readDecisionFile(decisionId: string, fileId: string, signal?: AbortSignal): Promise<FileRead>;
668
670
  /** Another person's plate, within what the asker may see: for an administrator, or an owner of a project they are in. */
669
671
  personWork(personId: string, signal?: AbortSignal): Promise<RestPersonWork>;
670
672
  /** The tokens of whoever asks. */
@@ -1401,6 +1403,8 @@ export function createClient(options: ClientOptions = {}): ConsoleClient {
1401
1403
  answerDecision: (id, input) =>
1402
1404
  request("POST", `${base}${decisionPath(id)}/answer`, input, restDecisionSchema),
1403
1405
  decisionFileUrl: (decisionId, fileId) => `${base}${decisionFilePath(decisionId, fileId)}`,
1406
+ readDecisionFile: (decisionId, fileId, signal) =>
1407
+ read(`${base}${decisionFilePath(decisionId, fileId)}`, fileId, signal),
1404
1408
  personWork: (personId, signal) =>
1405
1409
  request("GET", `${base}${personWorkPath(personId)}`, undefined, restPersonWorkSchema, signal),
1406
1410
  tokens: (signal) =>
@@ -162,12 +162,20 @@ export async function performBridgeCall(
162
162
 
163
163
  /** The console's computed design tokens, as the page's root has them: what a frame is told to look like. */
164
164
  /**
165
- * Whether a person pressed something a moment ago, as the browser keeps it: a link in a frame
166
- * gives the page this too, which is what lets the page open a tab for it; a browser without the
167
- * API is left to decide for itself, as it does for any page.
165
+ * Whether a person pressed something in this frame a moment ago, as far as the page can tell, for
166
+ * a bundle built before 0.4.6, which asks the page to open its links (ADR-0067). The browser
167
+ * keeps a press for the whole page, wherever it was, so the page takes a press for the frame's
168
+ * only while the frame holds the page's focus, which a press in it gives it and a press anywhere
169
+ * else takes away. That is as far as a page sees into a frame: one that takes the focus itself is
170
+ * not told apart, which is why a frame opens its own links since 0.4.6, held by the browser to a
171
+ * press in it (ADR-0078). A browser without the API is left to decide for itself, as it does for
172
+ * any page.
168
173
  */
169
- function recentlyPressed(): boolean {
170
- if (typeof navigator === "undefined") {
174
+ function pressedIn(element: HTMLIFrameElement | null): boolean {
175
+ if (typeof navigator === "undefined" || typeof document === "undefined" || element === null) {
176
+ return false;
177
+ }
178
+ if (document.activeElement !== element) {
171
179
  return false;
172
180
  }
173
181
  const activation = (navigator as Navigator & { userActivation?: { isActive: boolean } })
@@ -337,11 +345,14 @@ export function PluginFrame(props: PluginFrameProps) {
337
345
  return;
338
346
  }
339
347
  case "open":
340
- // A link a person pressed in the frame (ADR-0067): a web or a mail address, opened in a
341
- // new tab with no opener and no referrer, and only while the press is recent, which a
342
- // press in the frame gives this page too.
343
- if (isOpenableFrom(message.url, window.location.origin) && recentlyPressed()) {
348
+ // A link a frame built before 0.4.6 asks the page to open (ADR-0067): a web or a mail
349
+ // address, in a new tab with no opener and no referrer, while a press is recent and the
350
+ // frame holds the focus, which the page takes back as it opens one, so that another tab
351
+ // takes another press. A frame since opens its own links, held to a press in it by the
352
+ // browser (ADR-0078); the page stops hearing this at the next line.
353
+ if (isOpenableFrom(message.url, window.location.origin) && pressedIn(frame.current)) {
344
354
  window.open(message.url, "_blank", "noopener,noreferrer");
355
+ frame.current?.blur();
345
356
  }
346
357
  return;
347
358
  case "subscribe":
@@ -449,9 +460,11 @@ export function PluginFrame(props: PluginFrameProps) {
449
460
  }
450
461
  src={src}
451
462
  title={props.title}
452
- // As the document's own policy says: scripts, and forms firing their submit event, which
453
- // the policy's form-action 'none' keeps from going anywhere.
454
- sandbox="allow-scripts allow-forms"
463
+ // As the document's own policy says: scripts; forms firing their submit event, which the
464
+ // policy's form-action 'none' keeps from going anywhere; and a window for a link a person
465
+ // pressed in the frame, which the browser holds to the press (ADR-0078), opened out of the
466
+ // sandbox so that the page it shows is a page as any.
467
+ sandbox="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox"
455
468
  referrerPolicy="origin"
456
469
  style={isWidget ? undefined : { height: `${height}px` }}
457
470
  />
@@ -161,9 +161,10 @@ export interface BridgeDownload {
161
161
  }
162
162
 
163
163
  /**
164
- * A link a person pressed in the frame, for the console's page to open in a new tab (ADR-0067):
165
- * the frame's sandbox opens no window itself, and the page opens one only for a web or a mail
166
- * address, and only right after a person pressed.
164
+ * A link a person pressed in a frame built before 0.4.6, for the console's page to open in a new
165
+ * tab (ADR-0067): such a frame's sandbox opened no window itself. The page opens one for a web
166
+ * or a mail address alone, and only as far as it can tell of a press in that frame (ADR-0078). A
167
+ * frame since opens its links itself, and the page stops hearing this at the next line.
167
168
  */
168
169
  export interface BridgeOpen {
169
170
  readonly v: 1;
@@ -255,7 +255,7 @@ export interface PersonCaller {
255
255
  readonly roles: readonly string[];
256
256
  /** The caller's open run in the board project, if any. */
257
257
  readonly run: { readonly id: string; readonly taskNumber: number | null } | null;
258
- /** The project the call is on, if any. */
258
+ /** The project the call is on, if any: one the plugin acts in only where it is placed on it (ADR-0080). */
259
259
  readonly project: CallerProject | null;
260
260
  }
261
261
 
@@ -371,6 +371,12 @@ export interface PluginConsole {
371
371
  decisions: {
372
372
  list(project: string): Promise<readonly RestDecision[]>;
373
373
  get(id: string): Promise<RestDecision | null>;
374
+ /**
375
+ * Raises a decision in a project the plugin reaches, its board project or one it is placed on
376
+ * (`board:decisions`); for a person, one they may see, or the board project whether they see
377
+ * it or not, where whoever may use the plugin is a requester (ADR-0080): the decision reaches
378
+ * them as its raiser, and nothing else of the project opens to them.
379
+ */
374
380
  ask(project: string, decision: DecisionAsk): Promise<RestDecision>;
375
381
  /**
376
382
  * Answers a decision for a person who answered elsewhere (ADR-0072), with `people:act`: one on