@skillcdn/console 0.6.2 → 0.6.4
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 +16 -9
- package/SKILLCDN.md +3 -2
- package/dist/agent-page.d.ts +2 -0
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +46 -5
- package/dist/agent-page.js.map +1 -1
- package/dist/agent-state.d.ts +9 -0
- package/dist/agent-state.d.ts.map +1 -0
- package/dist/agent-state.js +28 -0
- package/dist/agent-state.js.map +1 -0
- package/dist/api.d.ts +6 -4
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +6 -4
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +948 -252
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +44 -7
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +168 -13
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +82 -9
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +855 -331
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/pack.d.ts +13 -12
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +33 -45
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +8 -5
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/runner-files.d.ts +16 -0
- package/dist/cli/runner-files.d.ts.map +1 -0
- package/dist/cli/runner-files.js +125 -0
- package/dist/cli/runner-files.js.map +1 -0
- package/dist/cli/runner-host.d.ts +7 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +40 -2
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/skill-path.d.ts +11 -0
- package/dist/cli/skill-path.d.ts.map +1 -0
- package/dist/cli/skill-path.js +44 -0
- package/dist/cli/skill-path.js.map +1 -0
- package/dist/client.d.ts +32 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +15 -1
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +93 -6
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +202 -10
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts +6 -6
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +16 -9
- package/dist/components/agents.js.map +1 -1
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +7 -2
- package/dist/components/people.js.map +1 -1
- package/dist/components/picker.d.ts +16 -0
- package/dist/components/picker.d.ts.map +1 -1
- package/dist/components/picker.js +69 -4
- package/dist/components/picker.js.map +1 -1
- package/dist/console.css +40 -0
- package/dist/console.js +2 -2
- package/dist/console.js.map +1 -1
- package/dist/feed-words.d.ts.map +1 -1
- package/dist/feed-words.js +12 -1
- package/dist/feed-words.js.map +1 -1
- package/dist/i18n/en.d.ts +64 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +59 -10
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +49 -9
- package/dist/i18n/ko.js.map +1 -1
- package/dist/limits.d.ts +26 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +26 -0
- package/dist/limits.js.map +1 -1
- package/dist/onboarding.d.ts +18 -6
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +42 -7
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/args.d.ts +24 -2
- package/dist/plugin/args.d.ts.map +1 -1
- package/dist/plugin/args.js +20 -2
- package/dist/plugin/args.js.map +1 -1
- package/dist/plugin/context.d.ts +39 -7
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/define.d.ts.map +1 -1
- package/dist/plugin/define.js +12 -3
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +2 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +1 -0
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/routes.d.ts +2 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +2 -0
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +4 -1
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +5 -2
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +9 -3
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +53 -1
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +18 -3
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +18 -0
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +77 -1
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +7 -0
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +14 -4
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/message.d.ts +16 -22
- package/dist/runner/message.d.ts.map +1 -1
- package/dist/runner/message.js +72 -120
- package/dist/runner/message.js.map +1 -1
- package/dist/runner/runner.d.ts +41 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +557 -23
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack-status.d.ts +19 -0
- package/dist/runner/slack-status.d.ts.map +1 -0
- package/dist/runner/slack-status.js +332 -0
- package/dist/runner/slack-status.js.map +1 -0
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +258 -59
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/types.d.ts +128 -15
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js.map +1 -1
- package/dist/runner/usage.d.ts +6 -1
- package/dist/runner/usage.d.ts.map +1 -1
- package/dist/runner/usage.js +9 -2
- package/dist/runner/usage.js.map +1 -1
- package/dist/runner.d.ts +2 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +635 -6
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +197 -15
- package/dist/schemas.js.map +1 -1
- package/dist/secret-file.d.ts +21 -0
- package/dist/secret-file.d.ts.map +1 -0
- package/dist/secret-file.js +59 -0
- package/dist/secret-file.js.map +1 -0
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +3 -2
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +2 -2
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +6 -5
- package/dist/setup-guide.js.map +1 -1
- package/dist/vocabulary.d.ts +17 -2
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +15 -2
- package/dist/vocabulary.js.map +1 -1
- package/dist/wake-text.d.ts +43 -0
- package/dist/wake-text.d.ts.map +1 -0
- package/dist/wake-text.js +115 -0
- package/dist/wake-text.js.map +1 -0
- package/docs/specs/cli.md +39 -25
- package/docs/specs/plugins.md +10 -9
- package/docs/specs/rest.md +34 -15
- package/docs/specs/runner.md +108 -25
- package/docs/start.md +28 -6
- package/package.json +3 -3
- package/skills/building-a-plugin/SKILL.md +2 -2
- package/skills/deploying-a-console/SKILL.md +3 -3
- package/skills/deploying-a-console/references/access.md +15 -1
- package/skills/deploying-a-console/references/resources.md +2 -2
- package/skills/deploying-a-console/scripts/github-app.mjs +593 -0
- package/skills/keeping-the-pack/SKILL.md +87 -0
- package/skills/planning-the-board/SKILL.md +6 -6
- package/skills/planning-the-board/references/a-task.md +1 -1
- package/skills/planning-the-board/references/setting-up.md +9 -5
- package/skills/running-an-agent/SKILL.md +21 -17
- package/skills/running-an-agent/references/preparing-the-machine.md +4 -3
- package/skills/running-an-agent/references/several-tasks.md +8 -2
- package/skills/running-an-agent/references/slack-app.md +31 -8
- package/skills/running-an-agent/references/the-account-and-the-invitation.md +1 -1
- package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -1
- package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +4 -4
- package/skills/running-an-agent/references/your-first-task.md +11 -5
- package/skills/trying-a-console/SKILL.md +136 -0
- package/skills/trying-a-console/references/when-it-does-not-go.md +30 -0
- package/skills/working-the-board/SKILL.md +6 -6
- package/skills/working-the-board/references/terms.md +3 -1
- package/skills/working-the-board/references/the-pack.md +14 -7
- package/skills/working-the-board/references/what-they-were-told.md +1 -1
- package/src/agent-page.tsx +111 -4
- package/src/agent-state.ts +33 -0
- package/src/api.ts +43 -0
- package/src/cli/cli.ts +1190 -313
- package/src/cli/format.ts +207 -13
- package/src/cli/help.ts +991 -372
- package/src/cli/pack.ts +55 -62
- package/src/cli/plugin-cli.ts +8 -5
- package/src/cli/runner-files.ts +137 -0
- package/src/cli/runner-host.ts +48 -2
- package/src/cli/skill-path.ts +51 -0
- package/src/client.ts +103 -0
- package/src/components/agent-page.tsx +446 -20
- package/src/components/agents.tsx +27 -28
- package/src/components/people.tsx +7 -3
- package/src/components/picker.tsx +79 -5
- package/src/console.tsx +1 -1
- package/src/feed-words.ts +14 -1
- package/src/i18n/en.ts +64 -11
- package/src/i18n/ko.ts +55 -9
- package/src/limits.ts +26 -0
- package/src/onboarding.ts +60 -21
- package/src/plugin/args.ts +29 -3
- package/src/plugin/context.ts +40 -7
- package/src/plugin/define.ts +18 -3
- package/src/plugin/rest-schemas.ts +3 -0
- package/src/routes.ts +2 -0
- package/src/rules.ts +5 -2
- package/src/runner/acp.ts +9 -3
- package/src/runner/claude.ts +58 -1
- package/src/runner/codex.ts +18 -3
- package/src/runner/config.ts +114 -1
- package/src/runner/desk.ts +15 -4
- package/src/runner/message.ts +88 -126
- package/src/runner/runner.ts +682 -27
- package/src/runner/slack-status.ts +423 -0
- package/src/runner/slack.ts +310 -67
- package/src/runner/types.ts +124 -13
- package/src/runner/usage.ts +16 -3
- package/src/runner.ts +4 -0
- package/src/schemas.ts +245 -13
- package/src/secret-file.ts +76 -0
- package/src/services.ts +3 -2
- package/src/setup-guide.ts +6 -5
- package/src/styles/README.md +1 -1
- package/src/styles/pages/agents.css +40 -0
- package/src/vocabulary.ts +21 -2
- package/src/wake-text.ts +133 -0
- package/dist/cli/command-words.d.ts +0 -20
- package/dist/cli/command-words.d.ts.map +0 -1
- package/dist/cli/command-words.js +0 -51
- package/dist/cli/command-words.js.map +0 -1
- package/src/cli/command-words.ts +0 -56
package/docs/specs/plugins.md
CHANGED
|
@@ -161,7 +161,7 @@ export default definePlugin({
|
|
|
161
161
|
| `api` | `{ [name]: { about, input, run } }` | what other plugins may call with `plugins:<key>`; `input` a zod schema; `run(ctx, input)` with the caller passed through |
|
|
162
162
|
| `onEnable`, `onDisable` | `(ctx) => Promise<void>` | optional; run when an administrator enables or disables |
|
|
163
163
|
|
|
164
|
-
The argument definers: `arg.text({ max?, optional?, secret? })`, `arg.markdown()`, `arg.day()` (`YYYY-MM-DD`, a day the calendar has: February 30 is refused), `arg.number({ min?, max?, integer? })`, `arg.boolean()`, `arg.enum([...])`, `arg.person()` (a login or `me`, resolved by the console to a person the caller may see, handed to `run` as `{ id, login, name }`), `arg.project()` (a key the caller may see, handed as `{ id, key, name }`), `arg.record("<collection>")` (an id of that collection), `arg.list(inner, { max? })` (a flag repeated, or commas between), `arg.file()` (what `--file <path>` or `-` carried; the command uploads it first and hands a handle, and help prints the argument as `--file <path>`, since the flag is the command's and not the argument's name). Every definer takes `about` (one line, shown in help), `optional` and `positional`; a positional argument comes before the flags, in declaration order, and no required one follows an optional one. Each yields a plain description, and `run`'s `args` is typed from them: optional ones may be `undefined`. An argument marked `secret` is hidden in the event the command leaves. An argument is not named `json`, `url`, `account`, `project`, `file` or `run`, the flags the command keeps for itself (`RESERVED_ARG_NAMES`). A plugin refuses in its own words by throwing `PluginError(code, message)`, which the console answers as `plugin.<key>.<code>`; a definition the console cannot hold is refused when the module loads, as a `PluginDefinitionError` naming every problem.
|
|
164
|
+
The argument definers: `arg.text({ max?, optional?, secret? })`, `arg.markdown()`, `arg.day()` (`YYYY-MM-DD`, a day the calendar has: February 30 is refused), `arg.number({ min?, max?, integer? })`, `arg.boolean()`, `arg.enum([...])`, `arg.person({ anyone? })` (a login or `me`, resolved by the console to a person the caller may see, handed to `run` as `{ id, login, name }`, and refused in the same words whether nobody has the login or the caller may not see who has; with `anyone: true`, to anyone of the workspace for a caller who holds a role the command names apart from what every member holds, in a plugin that holds `people:read:all`, as said under "Roles and grants"), `arg.project()` (a key the caller may see, handed as `{ id, key, name }`), `arg.record("<collection>")` (an id of that collection), `arg.list(inner, { max? })` (a flag repeated, or commas between), `arg.file()` (what `--file <path>` or `-` carried; the command uploads it first and hands a handle, and help prints the argument as `--file <path>`, since the flag is the command's and not the argument's name). Every definer takes `about` (one line, shown in help), `optional` and `positional`; a positional argument comes before the flags, in declaration order, and no required one follows an optional one. Each yields a plain description, and `run`'s `args` is typed from them: optional ones may be `undefined`. An argument marked `secret` is hidden in the event the command leaves. An argument is not named `json`, `url`, `account`, `project`, `file` or `run`, the flags the command keeps for itself (`RESERVED_ARG_NAMES`). A plugin refuses in its own words by throwing `PluginError(code, message)`, which the console answers as `plugin.<key>.<code>`; a definition the console cannot hold is refused when the module loads, as a `PluginDefinitionError` naming every problem.
|
|
165
165
|
|
|
166
166
|
## The context
|
|
167
167
|
|
|
@@ -173,11 +173,11 @@ Everything a plugin does to the console is a call on `ctx`, which is a message t
|
|
|
173
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
|
-
| `ctx.console.workspace()` | the workspace's name, its language (`language`, the one an administrator set for whoever has none of their own, else `en`, and `languageSet`, whether one was set, [ADR-0081](../adr/0081-a-workspace-has-a-language-for-whoever-has-none-of-their-own.md)), the languages the console speaks (`languages`, `language` first), 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 |
|
|
177
|
-
| `ctx.console.people` | `list({ q? })` and `get(id)`: the people the caller may see, each with `managerId`, whom they report to in the directory or `null`, for a plugin to take as its default where it needs someone's manager, `language`, what they read in or `null` until the pages have seen them, and `teams`, the keys of the teams they are in ([ADR-0073](../adr/0073-a-team-is-a-name-and-its-members-a-unit-to-call-people-by-and-to-grant-a-plugins-role-to.md), [ADR-0074](../adr/0074-a-team-is-called-by-a-key-that-never-changes-one-name-among-the-projects-keys.md)); everyone for a `console` caller, or with `people:read:all`; their work `email` with `people:read:email` | `people:read` |
|
|
176
|
+
| `ctx.console.workspace()` | the workspace's name, its language (`language`, the one an administrator set for whoever has none of their own, else `en`, and `languageSet`, whether one was set, [ADR-0081](../adr/0081-a-workspace-has-a-language-for-whoever-has-none-of-their-own.md)), the languages the console speaks (`languages`, `language` first), 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`), whether the console shows every member to every member (`peopleVisibility`: `everyone`, or `shared_projects`, where a member sees those of the projects they are in, [ADR-0035](../adr/0035-who-may-see-whom-is-decided-by-one-policy-and-the-workspace-keeps-its-settings.md); from 0.6.3, by which a plugin says to an administrator whom its "everyone" reaches, and decides nothing: whom a caller sees is asked with `seenByCaller`), 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 |
|
|
177
|
+
| `ctx.console.people` | `list({ q? })` and `get(id)`: the people the caller may see, each with `managerId`, whom they report to in the directory or `null`, for a plugin to take as its default where it needs someone's manager, `language`, what they read in or `null` until the pages have seen them, and `teams`, the keys of the teams they are in ([ADR-0073](../adr/0073-a-team-is-a-name-and-its-members-a-unit-to-call-people-by-and-to-grant-a-plugins-role-to.md), [ADR-0074](../adr/0074-a-team-is-called-by-a-key-that-never-changes-one-name-among-the-projects-keys.md)); everyone for a `console` caller, or with `people:read:all`; their work `email` with `people:read:email`. With `seenByCaller: true` among the options (`list({ q?, seenByCaller? })`, `get(id, { seenByCaller? })`, `granted(role, { seenByCaller? })`), the people the caller may see whatever the plugin holds ([ADR-0168](../adr/0168-a-plugin-that-holds-the-whole-directory-reads-the-people-its-caller-may-see-where-it-asks.md)): what a plugin with `people:read:all` shows a member is then whom the console's own page of people shows them, where the console keeps its people apart. The view is a person's, the caller's own, their agent's, an agent account's, or that of the person a plugin acts for, as a member; a hook, a job and a plugin as itself have no caller and are refused (`plugin.forbidden`), never answered everyone; what is neither `true` nor `false` is `plugin.invalid_args`. From 0.6.3: a console of before reads past the option and answers everyone, so a plugin that relies on it names 0.6.3 as the oldest console it runs on | `people:read` |
|
|
178
178
|
| `ctx.console.accounts` | `put({ personId, messenger, workspace, account })`, `remove({ personId, messenger, workspace })` and `list({ messenger, workspace, after?, limit? })`: which account at a messenger is a member's ([ADR-0164](../adr/0164-a-plugin-says-which-account-at-a-messenger-is-a-members-and-a-wake-says-by-it-whether-a-supervisor-wrote.md)), said by a plugin that matched the two by something neither lets its holder set freely, an address say, and never by a name. `messenger` is its name as a wake source is named (`slack`), `workspace` and `account` the messenger's ids for them, each letters, digits, `.`, `_` and `-`, `MAX_MESSENGER_ID_LENGTH` at most (`plugin.invalid_args`). One member for an account and one account of a member in a workspace: what this plugin said before of either gives way, what another plugin said of either stands while that plugin is in the image, enabled, and holds the capability (`plugin.conflict`); the person is active (`plugin.not_found`); a workspace keeps `MAX_MESSENGER_ACCOUNTS` (`plugin.too_many`). `list` answers `{ items, after }`, what this plugin said, each `{ id, personId, messenger, workspace, account, since }`, a page at a time; `remove` whether there was one. Whoever calls, a person's command or a job, the capability is what opens it, and the event of a change a person's call made names the person. Purged, the plugin has said nothing. Left out by a console older than the capability: a plugin that runs on both asks whether it is there | `people:accounts` |
|
|
179
179
|
| `ctx.console.notifications` | `settings()`: what the caller chose to be told of, as `GET /api/v1/notifications/settings` answers it ([ADR-0165](../adr/0165-a-plugin-reads-what-its-caller-chose-to-be-told-of-and-nobody-elses.md)): `kinds`, `defaults`, `projectsOff`, of those the plugin is on, and `ownAgents`. A member's own call alone, a person's, their agent's or an agent account's; `plugin.forbidden` for a hook, a job, a plugin as itself and a call a plugin makes for a person. From 0.6.2; left out by a console of before | `notifications:read` |
|
|
180
|
-
| `ctx.console.teams` | `list()` and `get(key)`: the teams of the workspace ([ADR-0073](../adr/0073-a-team-is-a-name-and-its-members-a-unit-to-call-people-by-and-to-grant-a-plugins-role-to.md)), each `{ id, key, name, memberIds, createdAt }`, the members among the people the caller may see; a team is called by its `key`, which never changes | `people:read` |
|
|
180
|
+
| `ctx.console.teams` | `list()` and `get(key)`: the teams of the workspace ([ADR-0073](../adr/0073-a-team-is-a-name-and-its-members-a-unit-to-call-people-by-and-to-grant-a-plugins-role-to.md)), each `{ id, key, name, memberIds, createdAt }`, the members among the people the caller may see, among everyone with `people:read:all` unless `seenByCaller: true` asks for the caller's own view (`list({ seenByCaller? })`, `get(key, { seenByCaller? })`, as the reads of people take it, [ADR-0168](../adr/0168-a-plugin-that-holds-the-whole-directory-reads-the-people-its-caller-may-see-where-it-asks.md)); a team is called by its `key`, which never changes | `people:read` |
|
|
181
181
|
| `ctx.console.projects` | `list()`, `get(key)`, `members(key)`: the projects the caller may see; all with `projects:read:all`, but in a call for a person, the person's ([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)) | `projects:read` |
|
|
182
182
|
| `ctx.console.tasks` | `list(project, filters)`, `get(project, number)`, `create(project, task)`, `update(project, number, patch)`, `comment(project, number, body)`: reading in the plugin's projects, creating there, changing and commenting its own | `board:read`; `board:tasks` |
|
|
183
183
|
| `ctx.console.decisions` | `list(project)`, `get(id)`, `ask(project, { question, body?, options, deciderId?, deciderIds?, taskId?, about })`: `options` each `{ label, key? }`, the `key` spelled as a plugin's key is and given once, answered back as `optionKey` on `console:decision.answered`; `about` names the record the decision is for; `answer(id, { optionKey \| option, note? }, { for: personId })` answers for a person who answered elsewhere a decision on their own plate, addressed to them or a plugin's addressed to someone they manage, up the reporting line ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)), and none they could answer only as a member of its project or as an administrator, `plugin.forbidden` otherwise; as theirs through the plugin ([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 answers no decision itself | `board:read`; `board:decisions`; `people:act` for `answer` |
|
|
@@ -193,7 +193,7 @@ Everything a plugin does to the console is a call on `ctx`, which is a message t
|
|
|
193
193
|
|
|
194
194
|
What `ctx` never has, whatever the manifest asks: the environment, a connection of the console's to the database, a session or a token, a secret's value, another plugin's records or secrets, a way to answer a decision, to change a person, a role, a membership or a setting of the workspace, or to make a request a person could not make themselves.
|
|
195
195
|
|
|
196
|
-
A read of the console in a person's call is the person's: `people.list` is the people they may see, `projects.list` the projects they may see, a task they may not see is not found. In a call a plugin makes for a person, it is the person's as a member's, whatever they administer: acting for a person never carries their administration, nor the view of the administrator who enabled the plugin ([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 `console` caller (a job, a hook) sees what the plugin's capabilities open: `people:read` alone shows a job nobody, `people:read:all` everyone; so does a plugin another calls as itself. A plugin that wants a person to see more than they may must not; the capability for the whole directory is declared and consented to as such. An id plugin code names that is none, a decision's, a run's, a person's or a goal's, is refused before the database is asked: as nothing found where a call answers `null` or `plugin.not_found` for one missing, else as `plugin.invalid_args`.
|
|
196
|
+
A read of the console in a person's call is the person's: `people.list` is the people they may see, `projects.list` the projects they may see, a task they may not see is not found. In a call a plugin makes for a person, it is the person's as a member's, whatever they administer: acting for a person never carries their administration, nor the view of the administrator who enabled the plugin ([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 `console` caller (a job, a hook) sees what the plugin's capabilities open: `people:read` alone shows a job nobody, `people:read:all` everyone; so does a plugin another calls as itself. A plugin that wants a person to see more than they may must not; the capability for the whole directory is declared and consented to as such. With it, a read of people in a person's call answers everyone as well, which is more than that person sees where the console keeps its people apart (`peopleVisibility` of `ctx.console.workspace()`): what such a plugin shows its caller, a calendar of who is away, a list, a picker, it reads with `seenByCaller: true`, the caller's own view ([ADR-0168](../adr/0168-a-plugin-that-holds-the-whole-directory-reads-the-people-its-caller-may-see-where-it-asks.md)), and keeps the whole directory for what is its own to decide, as whom a request goes to. An id plugin code names that is none, a decision's, a run's, a person's or a goal's, is refused before the database is asked: as nothing found where a call answers `null` or `plugin.not_found` for one missing, else as `plugin.invalid_args`.
|
|
197
197
|
|
|
198
198
|
## Capabilities
|
|
199
199
|
|
|
@@ -204,7 +204,7 @@ Declared in the manifest, consented to by an administrator when enabling, enforc
|
|
|
204
204
|
| (none) | its own records, versions, links and events; its settings; its log | its own data, spoiled; the versions restore it |
|
|
205
205
|
| `files` | files on its records, within `PLUGIN_FILE_BYTES_AT_MOST` | storage filled to the bound |
|
|
206
206
|
| `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 |
|
|
207
|
-
| `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.updated`, `person.listed`, `person.unlisted`, and the teams' `team.created`, `team.renamed`, `team.removed`, `team.member_added`, `team.member_removed`, and the agent accounts' `agent.state_changed`) to its hooks, with their content | the directory, and when people come and go |
|
|
207
|
+
| `people:read:all` | everyone, for `console` callers too, and in a person's call unless the read asks for the caller's own view (`seenByCaller`); and the workspace's people events (`person.joined`, `person.deactivated`, `person.reactivated`, `person.role_changed`, `person.manager_changed`, `person.email_changed`, `person.updated`, `person.listed`, `person.unlisted`, and the teams' `team.created`, `team.renamed`, `team.removed`, `team.member_added`, `team.member_removed`, and the agent accounts' `agent.state_changed`) to its hooks, with their content | the directory, and when people come and go |
|
|
208
208
|
| `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 |
|
|
209
209
|
| `people:accounts` | saying which account at a messenger is which member's (`ctx.console.accounts`, [ADR-0164](../adr/0164-a-plugin-says-which-account-at-a-messenger-is-a-members-and-a-wake-says-by-it-whether-a-supervisor-wrote.md)): an agent account's wake from that messenger says by it who wrote, and whether a supervisor of the account did, whose own word there the account takes as an instruction ([ADR-0160](../adr/0160-an-agent-account-takes-every-supervisors-word-as-its-managers-by-a-tell-or-at-the-messenger.md)). It counts while the plugin is enabled and holds the capability, and every change is an event of the workspace under the plugin's name (`person.updated` with the field `account`, which a plugin that reads everyone hears as it hears any change of a member). It reads nobody and opens nothing else | anyone's account at a messenger said to be a supervisor's, and so that person's word there taken as an instruction by the agent accounts the supervisor supervises; each change on the workspace's feed, under the plugin's name |
|
|
210
210
|
| `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 |
|
|
@@ -231,6 +231,7 @@ Declared in the manifest, consented to by an administrator when enabling, enforc
|
|
|
231
231
|
- A plugin declares roles; what each means is the plugin's to say in its description and to enforce where it reads, since the console knows a role by its name alone.
|
|
232
232
|
- A grant is an administrator's: a role to a person, to the members of a project (a grant that follows the membership), to a team ([ADR-0073](../adr/0073-a-team-is-a-name-and-its-members-a-unit-to-call-people-by-and-to-grant-a-plugins-role-to.md)), whose members hold it as the membership stands, to everyone, or to another plugin, which holds it as itself ([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)). `defaultRole` is everyone's without a grant. A role with `follows: "reports"` is held by whoever someone active reports to, read from the directory on every call, so that it comes and goes with the reporting line ([ADR-0068](../adr/0068-a-decision-reaches-whom-it-is-addressed-to-wherever-it-is-and-a-plugins-reaches-the-managers-above-them.md)); `ctx.console.people.granted(role)` lists them, with whoever was granted the role besides, and the settings page says so. An administrator holds every role of every plugin.
|
|
233
233
|
- A command, query, page, widget or endpoint names the roles that may use it (any of them); without `roles`, every member may. A collection names the roles that read it, and those that read their own records in it.
|
|
234
|
+
- **A person argument that may be anyone** ([ADR-0185](../adr/0185-a-person-a-plugins-command-names-may-be-anyone-of-the-workspace-for-a-role-that-opens-the-directory.md)). `arg.person()` is one the caller may see, which on a console that keeps its people apart is whom they share a project with, themselves, the administrators and their line. A command a role works the whole directory with, an enrolment say, marks its argument `arg.person({ anyone: true })`, and the console then resolves the login among everyone of the workspace where the plugin holds `people:read:all` now, the command or the query names roles, and the caller holds one of them apart from what every member holds: granted to them by name, to a team they are in or to the members of a private project that lists them, held by the reporting line, or as an administrator. Whoever runs it by the default role, by a grant to everyone or to a project open to the workspace, or where it names no roles, names whom they may see, whatever the option says: a refusal then tells no member whether a login they may not see exists, and reads the same for one nobody has (`<argument>: no person <login> you may see`). A console older than 0.6.4 reads past the option and resolves in the caller's view, so a plugin that relies on it names 0.6.4 as the oldest console it runs on. `console-plugin check` says where the option does nothing: a manifest that does not declare `people:read:all`, an operation that names no roles.
|
|
234
235
|
- A token acts with its person's roles; nothing is granted to an agent ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)).
|
|
235
236
|
- A plugin asks roles of other plugins in its manifest (`grants: { <key>: { roles, why } }`, [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)): the enable form offers to grant each whose plugin is enabled, the plugin's page lists them with how they stand, `GET /api/v1/plugins/<key>` answers them as `asks` to an administrator, a role the plugin holds as the callee's `defaultRole` standing as granted, and the plugin reads what it holds as `ctx.plugin.grants`. A plugin holds the roles granted to it by key and the callee's `defaultRole`, as a member does; never an administrator's standing, never a grant to everyone. What it does for a person is the person's act, within what both may do.
|
|
236
237
|
- A person without a role in a plugin sees none of its tabs or widgets, and its pages and commands are `plugin.forbidden`; the plugin itself is listed, so that the person knows what to ask for.
|
|
@@ -344,7 +345,7 @@ Under `/api/v1/plugins`. Who may call: *anyone* signed in or on a token, *roles*
|
|
|
344
345
|
| `PUT .../secrets/<name>`, `DELETE .../secrets/<name>` | admin | `{ value }`; never read |
|
|
345
346
|
| `PUT .../secrets/<name>/keys/<key>`, `DELETE .../secrets/<name>/keys/<key>` | admin | the value of a keyed secret under one key ([ADR-0111](../adr/0111-a-secret-setting-may-keep-one-value-per-key.md)): `{ value }`, never read; a new key past `max` is `plugin.too_many` |
|
|
346
347
|
| `GET .../grants`, `POST .../grants`, `DELETE .../grants/<id>` | admin | `{ role, person?: id, project?: key, plugin?: key, team?: key, everyone?: true }`, one of the five; a grant answers `plugin`, or `team` as `{ key, name }`, where the role went to one |
|
|
347
|
-
| `POST .../invoke` | roles | `{ argv: [...], files?: [handles], project?: key, run?: id }`: the words as typed, the command's or the query's name first, parsed by the console against the definition (`parseArgv`: the positionals in declaration order, `--name value` or `--name=value`, a boolean flag alone, a list as the flag repeated or with commas between, `--` ending the flags; a person by login or `me`, a project by key and a file by its handle resolved to what the caller may see or uploaded); the handles of the files uploaded for its `file` arguments, in declaration order; the project the call is on; the run it is for, one of the caller's open in the board project, where several are. `{ kind: "command" \| "query", text, data, waiting, project }`, `project` the key of the project the decision named in `waiting` waits in, the one it was raised in, its board or another, where the caller reaches the decision and `null` where they do not; with nothing waiting, the key of the plugin's board project, or `null`; a query's file as `data.file` with `name`, `type`, `bytes` and `base64`; or the refusal |
|
|
348
|
+
| `POST .../invoke` | roles | `{ argv: [...], files?: [handles], project?: key, run?: id }`: the words as typed, the command's or the query's name first, parsed by the console against the definition (`parseArgv`: the positionals in declaration order, `--name value` or `--name=value`, a boolean flag alone, a list as the flag repeated or with commas between, `--` ending the flags; a person by login or `me`, a project by key and a file by its handle resolved to what the caller may see or uploaded, a person who may be anyone among everyone where the caller's role opens the directory ([ADR-0185](../adr/0185-a-person-a-plugins-command-names-may-be-anyone-of-the-workspace-for-a-role-that-opens-the-directory.md))); the handles of the files uploaded for its `file` arguments, in declaration order; the project the call is on; the run it is for, one of the caller's open in the board project, where several are. `{ kind: "command" \| "query", text, data, waiting, project }`, `project` the key of the project the decision named in `waiting` waits in, the one it was raised in, its board or another, where the caller reaches the decision and `null` where they do not; with nothing waiting, the key of the plugin's board project, or `null`; a query's file as `data.file` with `name`, `type`, `bytes` and `base64`; or the refusal |
|
|
348
349
|
| `POST .../commands/<name>` | roles | `{ args, project?, run? }`, the arguments as JSON by name, for the pages; the same answer |
|
|
349
350
|
| `GET .../queries/<name>?args=<json>&project=` | roles | the query's JSON, or its file as bytes with `content-disposition` |
|
|
350
351
|
| `GET .../records/<collection>?where=&order=&limit=&after=&q=&project=` | roles | the records the caller may read |
|
|
@@ -373,9 +374,9 @@ Under `/api/v1/plugins`. Who may call: *anyone* signed in or on a token, *roles*
|
|
|
373
374
|
| `plugin <key>` | `GET /api/v1/plugins/<key>` | the description and the agent note; its problems, a job that keeps failing among them; a line per command and query, its usage in brief, the positionals and the required flags, the rest as `[options]`, since an agent reads this whole at every first use; the skills (`console plugin <key> skills`); the board project, or while it has none the one `enable --board new` would make, with the mark the plugin names for it; a line per job, how often it runs, how its last run went and since when it has failed, and when it runs next, where the console names them; the settings an agent should know |
|
|
374
375
|
| `plugin <key> help [<command>]` | the same | one command whole, in the form of `console help <command>`: the forms, every argument, the limits, the refusals; without a command, every one in the brief form |
|
|
375
376
|
| `plugin <key> <command> [args] [--<flag> <value>]... [--file <path> \| -] [--run <id>] [--json]` | `POST .../files` where `--file` or `-`, then `POST .../invoke` with the words as typed, the handle, the project the command works in and the run named | the command's `text`, or its `data` with `--json`; a query's answer as JSON, a file it answers saved under its name; exit `0`; `3` with `waiting`, printing the decision's id, the project it waits in and `console decision <id> --wait`, which reads the decision wherever it is, from a checkout bound to another project or none; `1` on a refusal, in the console's form. `--json`, `--url`, `--account`, `--project`, `--file` and `--run` are the command's own wherever they stand; every other word is the plugin's |
|
|
376
|
-
| `plugin <key> records <collection> [<id>] [--where <field>=<value>]... [--search <words>] [--project <key>] [--order <field>[:desc]] [--limit <n>] [--after <cursor>] [--archived] [--versions]` | `GET .../records/...` | the records, one a line, or one whole, or its versions |
|
|
377
|
+
| `plugin <key> records <collection> [<id>] [--where <field>=<value>]... [--search "<words>"] [--project <key>] [--order <field>[:desc]] [--limit <n>] [--after <cursor>] [--archived] [--versions]` | `GET .../records/...` | the records, one a line, or one whole, or its versions |
|
|
377
378
|
| `plugin <key> events [--kind <kind>] [--limit <n>] [--offset <n>]` | `GET .../events` | the plugin's events the caller may read ("REST": every one for an administrator; for anyone else those of the projects they may see, their own commands, and the console's word of the plugin), newest first, one a line: its number, when, its kind, who did it and through what, and what it says, the problem of a `plugin.failed`, the command and how it ended of a `plugin.command`; `--kind plugin.failed` for the failures alone, which is where a job's failure says why; a page of up to 100, 50 unless said; where the console answers none, `No event of <key> that you may read`, which says nothing of whether the plugin has others |
|
|
378
|
-
| `plugin <key> skills [--search <words>]`, `plugin <key> skill <path>` | `GET .../skills...` | as `console skills` and `console skill` |
|
|
379
|
+
| `plugin <key> skills [--search "<words>"]`, `plugin <key> skill <path>` | `GET .../skills...` | as `console skills` and `console skill` |
|
|
379
380
|
| `plugin <key> enable [--consent <capability>,...] [--board new\|<key>] [--projects all\|<key>,...] [--set <key>=<value>]...`, `plugin <key> disable`, `plugin <key> capabilities [--consent <capability>,...|none]`, `plugin <key> settings [--set ...]`, `plugin <key> secret <name> [--key <key>]` (the value typed unseen at the terminal, or piped in; never an argument; `--key` for a keyed secret, one key at a time), `plugin <key> grant <role> --person <login>\|--project <key>\|--everyone`, `plugin <key> revoke <grant>` | the administrator's routes | what changed; `enable` prints what each capability opens before asking the console, and refuses without `--consent` naming every capability the manifest requires; `capabilities` says what the plugin holds, and with `--consent` which of the optional ones it holds from now on |
|
|
380
381
|
|
|
381
382
|
The rules an agent reads carry the plugins: `GET /api/v1/rules` and `GET /api/v1/projects/<key>/rules` answer `plugins`, each with its `key`, `name`, `agentNote` and `description` by language and the caller's `roles` in it, and `console take` and `console rules` print, after what the project adds to the rules and before the rest, a section `## Plugins` with a line per plugin bound to the project (as its board project, or on it) that the caller holds a role in, `- <key> (<name>): <agentNote> Start with console plugin <key>.`, the note in the caller's language where the manifest has it, the description where it has no note; `console rules` at the workspace lists every plugin the caller may use. Nothing else of a plugin reaches an agent unasked. `console help` names the two commands in a section of their own, and `console skills` ends with where a plugin's skills are. The skill `working-the-board` says: when the rules name a plugin, read `console plugin <key>` and its skills before its first command.
|
package/docs/specs/rest.md
CHANGED
|
@@ -86,7 +86,7 @@ The API is the board as its members see it: the people, the projects, and in eac
|
|
|
86
86
|
| 409 | `workspace.pack_token_unsupported` | The console keeps no secret to seal a SkillCDN token with: nobody signs in here (`AUTH_SECRET`). |
|
|
87
87
|
| 409 | `workspace.pack_connect_unsupported` | The console reaches no deployment it could connect the organization's pack at, or keeps no secret to seal with. |
|
|
88
88
|
| 503 | `skills.unavailable` | The SkillCDN deployment could not be reached to try a pack token against; try again later. |
|
|
89
|
-
| 409 | `person.last_admin` | The change would leave the board without an administrator in. |
|
|
89
|
+
| 409 | `person.last_admin` | The change would leave the board without an administrator in who is a person ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)). |
|
|
90
90
|
| 409 | `person.of_organization` | The organization let the person in, and says whether they are in; an administrator lists their login to keep one who left ([ADR-0022](../adr/0022-who-is-in-is-the-consoles-own-record-and-an-administrator-keeps-it.md)). |
|
|
91
91
|
| 409 | `listing.exists` | The login is let in already, or is one an active person signs in as. |
|
|
92
92
|
| 409 | `run.over`, `run.task_closed` | The run has ended already; the task is done or dropped. A run open on a task is no refusal: a new run takes it over ([ADR-0020](../adr/0020-the-console-does-not-claim-an-agent-is-at-work-a-run-says-when-it-was-last-heard-from-and-a-new-run-takes-over.md)). |
|
|
@@ -98,7 +98,7 @@ The API is the board as its members see it: the people, the projects, and in eac
|
|
|
98
98
|
|
|
99
99
|
### `GET /api/v1/me`
|
|
100
100
|
|
|
101
|
-
`{ "workspace": { "name", "tokenDaysAtMost", "skills": { "source", "address", "packToken" }, "peopleVisibility", "weekStart", "timeZone", "language" }, "person": ... | null, "agent": "..." | null, "session": { "kind", "name" } | null, "language": "..." | null, "signIn": [{ "key", "label", "admits": { "organization", "domains" } }, ...], "console": { "version", "clientRange" }, "decisions": { "waiting" } | null, "notifications": { "unread" } | null }`: what the board is called, the most days a token may be good for here (or `null` where a person chooses), where the organization's skills come from (`source`, the origin of the SkillCDN deployment they are read through, and `address`, the organization's, canonical, which a project without one of its own reads, or `null`; and `packToken`, when the SkillCDN token the organization's pack is read with was set, `{ setAt }`, or `null`), who sees whom on the People page (`peopleVisibility`: `everyone`, or `shared_projects`, where a member sees only the people they share a project with and an administrator everyone; [ADR-0035](../adr/0035-who-may-see-whom-is-decided-by-one-policy-and-the-workspace-keeps-its-settings.md); read as optional, for a console from before the setting), the day the calendars begin a week on and this week is counted by (`weekStart`: `auto`, as the language of the pages has it, or `monday`, `sunday`; [ADR-0039](../adr/0039-this-week-is-the-plans-unit-and-the-week-begins-as-the-workspace-says.md)) and the workspace's time zone (`timeZone`: an IANA name, in which the command prints moments, or `null` for none; `language`: the workspace's language, the tag of one the console speaks, for whoever has none of their own, the pages after the browser's languages and the plugins' calls ([ADR-0081](../adr/0081-a-workspace-has-a-language-for-whoever-has-none-of-their-own.md)), or `null` for none, English then; both optional the same way), who the session cookie or the token says is asking (`id`, `login`, `name` or `null`, `avatar` or `null`, `role`), with what (`agent`: the name of the token when a token asks, as its person called it, so that a console of a person's own knows it holds one and offers nothing a token cannot do; `null` on a session), the language the person reads in (`language`, a tag: the one they chose, else the one the pages first saw them in, [ADR-0065](../adr/0065-a-plugin-writes-one-text-and-a-persons-language-is-kept-from-the-first-time-the-pages-see-them.md); `null` until then), their own arrangement of the front page's widgets (`home`, [ADR-0059](../adr/0059-a-person-arranges-the-front-pages-widgets-from-the-sizes-each-comes-in.md): `[{ plugin, widget, size, place? }]` in order, or `null` for the manifests'; answered from 0.4.4 and read as optional), and the identity providers people sign in through (`gh`, `google`, each with the label of its button and, in `admits`, who gets in through it: the organization at the git host whose members are in, or `null`, and the Workspace domains whose accounts are, which a sign-in page says under the button; answered from 0.4.1 and read as optional), none where nobody can; and the console's own version with the range of command versions it takes (`console`, [ADR-0025](../adr/0025-the-command-names-its-version-on-every-request-and-the-console-holds-it-to-the-range-it-takes.md)), for a console built on the package to compare itself with; and how many decisions wait for the person's answer across the projects they may see (`decisions.waiting`, [ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md); `null` for nobody; answered from 0.4.3 and read as optional), which the pages say beside My decisions and read again when a decision is raised or answered. Nobody is an answer, not an error; the pages ask this once to decide what to show, and the command once, at `login`, to see that the console knows the token. Nobody is told what the sign-in page shows and no more: of the workspace its `name` and its `language`, with `tokenDaysAtMost` as `null` and `skills` as `{ "source": "", "address": null }`, the two keys every answer has, saying nothing; its short name, its domain, its services, who sees whom, the week's first day, the time zone and where the skills are read are its members' to read, and are left out; then the ways in and the console's version. A token the console knows whose person is out is refused here as on every route, `auth.deactivated` or `auth.not_admitted`, so that the agent learns why ([ADR-0044](../adr/0044-a-token-of-a-person-who-is-out-is-kept-and-refused-with-the-reason-until-they-are-back-in.md)).
|
|
101
|
+
`{ "workspace": { "name", "tokenDaysAtMost", "skills": { "source", "address", "packToken", "keeperId", "roundAt" }, "peopleVisibility", "weekStart", "timeZone", "language" }, "person": ... | null, "agent": "..." | null, "session": { "kind", "name" } | null, "language": "..." | null, "signIn": [{ "key", "label", "admits": { "organization", "domains" } }, ...], "console": { "version", "clientRange" }, "decisions": { "waiting" } | null, "notifications": { "unread" } | null }`: what the board is called, the most days a token may be good for here (or `null` where a person chooses), where the organization's skills come from (`source`, the origin of the SkillCDN deployment they are read through, and `address`, the organization's, canonical, which a project without one of its own reads, or `null`; and `packToken`, when the SkillCDN token the organization's pack is read with was set, `{ setAt }`, or `null`; `keeperId`, the id of the member who keeps the organization's skills, or `null` for nobody, left out for a member who may not see them, as the notes name them, and `roundAt`, the hour of their round as `HH:MM`, or `null` for none, [ADR-0178](../adr/0178-a-note-on-a-skill-waits-for-whoever-keeps-the-pack-who-works-the-notes-in-a-round-at-a-quiet-hour.md), both read as optional, for a console from before them), who sees whom on the People page (`peopleVisibility`: `everyone`, or `shared_projects`, where a member sees only the people they share a project with and an administrator everyone; [ADR-0035](../adr/0035-who-may-see-whom-is-decided-by-one-policy-and-the-workspace-keeps-its-settings.md); read as optional, for a console from before the setting), the day the calendars begin a week on and this week is counted by (`weekStart`: `auto`, as the language of the pages has it, or `monday`, `sunday`; [ADR-0039](../adr/0039-this-week-is-the-plans-unit-and-the-week-begins-as-the-workspace-says.md)) and the workspace's time zone (`timeZone`: an IANA name, in which the command prints moments, or `null` for none; `language`: the workspace's language, the tag of one the console speaks, for whoever has none of their own, the pages after the browser's languages and the plugins' calls ([ADR-0081](../adr/0081-a-workspace-has-a-language-for-whoever-has-none-of-their-own.md)), or `null` for none, English then; both optional the same way), who the session cookie or the token says is asking (`id`, `login`, `name` or `null`, `avatar` or `null`, `role`), with what (`agent`: the name of the token when a token asks, as its person called it, so that a console of a person's own knows it holds one and offers nothing a token cannot do; `null` on a session), the language the person reads in (`language`, a tag: the one they chose, else the one the pages first saw them in, [ADR-0065](../adr/0065-a-plugin-writes-one-text-and-a-persons-language-is-kept-from-the-first-time-the-pages-see-them.md); `null` until then), their own arrangement of the front page's widgets (`home`, [ADR-0059](../adr/0059-a-person-arranges-the-front-pages-widgets-from-the-sizes-each-comes-in.md): `[{ plugin, widget, size, place? }]` in order, or `null` for the manifests'; answered from 0.4.4 and read as optional), and the identity providers people sign in through (`gh`, `google`, each with the label of its button and, in `admits`, who gets in through it: the organization at the git host whose members are in, or `null`, and the Workspace domains whose accounts are, which a sign-in page says under the button; answered from 0.4.1 and read as optional), none where nobody can; and the console's own version with the range of command versions it takes (`console`, [ADR-0025](../adr/0025-the-command-names-its-version-on-every-request-and-the-console-holds-it-to-the-range-it-takes.md)), for a console built on the package to compare itself with; and how many decisions wait for the person's answer across the projects they may see (`decisions.waiting`, [ADR-0042](../adr/0042-a-decision-is-addressed-to-a-person-its-raiser-unless-another-is-named.md); `null` for nobody; answered from 0.4.3 and read as optional), which the pages say beside My decisions and read again when a decision is raised or answered. Nobody is an answer, not an error; the pages ask this once to decide what to show, and the command once, at `login`, to see that the console knows the token. Nobody is told what the sign-in page shows and no more: of the workspace its `name` and its `language`, with `tokenDaysAtMost` as `null` and `skills` as `{ "source": "", "address": null }`, the two keys every answer has, saying nothing; its short name, its domain, its services, who sees whom, the week's first day, the time zone and where the skills are read are its members' to read, and are left out; then the ways in and the console's version. A token the console knows whose person is out is refused here as on every route, `auth.deactivated` or `auth.not_admitted`, so that the agent learns why ([ADR-0044](../adr/0044-a-token-of-a-person-who-is-out-is-kept-and-refused-with-the-reason-until-they-are-back-in.md)).
|
|
102
102
|
|
|
103
103
|
### `GET /api/v1/people?login=`
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ The API is the board as its members see it: the people, the projects, and in eac
|
|
|
106
106
|
|
|
107
107
|
### `PATCH /api/v1/people/<id>`
|
|
108
108
|
|
|
109
|
-
Takes `role`, `status`, `managerId`, `email`, `title`, one or more, and answers the person, with their `email`. For an administrator, signed in or through their agent's token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)). `title` says what the member does, in a line up to `MAX_PERSON_TITLE_LENGTH`, or `null` for none ([ADR-0084](../adr/0084-an-agent-account-is-a-member-of-its-own-with-a-manager-above-it.md)): every member's, a person's as an agent account's; a patch that names a title alone is taken from a supervisor of an agent account too, an administrator or whoever is above it in the reporting line, who is answered the person without an `email`. It writes `person.updated` with `login`, `fields: ["title"]`, and the `handle` of an agent account. The board keeps at least one administrator in (`person.last_admin
|
|
109
|
+
Takes `role`, `status`, `managerId`, `email`, `title`, one or more, and answers the person, with their `email`. For an administrator, signed in or through their agent's token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)). `title` says what the member does, in a line up to `MAX_PERSON_TITLE_LENGTH`, or `null` for none ([ADR-0084](../adr/0084-an-agent-account-is-a-member-of-its-own-with-a-manager-above-it.md)): every member's, a person's as an agent account's; a patch that names a title alone is taken from a supervisor of an agent account too, an administrator or whoever is above it in the reporting line, who is answered the person without an `email`. It writes `person.updated` with `login`, `fields: ["title"]`, and the `handle` of an agent account. The board keeps at least one administrator in who is a person, whoever else administers (`person.last_admin`, [ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)): the role of the last active person who administers is not taken away, and they are not taken out; where no person administers any more, the last administrator of any kind stays. A change of role writes `person.role_changed` with `login` and `role`. `managerId` names whom the person reports to: another active person of the workspace who does not report to them, directly or through others, so that the line never loops, or `null` for nobody (`person.invalid_manager` otherwise); it writes `person.manager_changed` with `login` and `manager`, the manager's login or `null`, which reaches the hooks of a plugin that reads the directory as every people event does ([specs/plugins.md](plugins.md#capabilities)). `email` writes the person's work email, lowercase and one per workspace (`person.email_taken`), or `null` for none ([ADR-0069](../adr/0069-the-directory-keeps-a-work-email-read-by-an-administrator-the-person-and-a-plugin-allowed-to.md)); it writes `person.email_changed` with `login` and `set`, whether an address is set now, and never the address, so that the feed tells nobody what only an administrator, the person and a plugin with `people:read:email` read. A person who signs in at Google has theirs from the sign-in, written again at each: the address Google vouches for is theirs over an administrator's word, and whoever else of the workspace held it gives it up, their `email` becoming `null`, whether an administrator wrote it on them or they are the person of an account Google has since made again under another id, so that the sign-in never fails on it. Each address a sign-in changes, the other person's and the signing-in person's own, writes `person.email_changed` the same way, by nobody; a person's first sign-in writes `person.joined` alone. `status: "deactivated"` takes the person out: refused on every request from the next one, their agents' tokens with them, listed nowhere and offered to no picker, kept with everything they did; the listing they came in on goes with it, so that signing in again admits nobody. `status: "active"` takes them back in, and lists them again where a listing let them in. Each writes `person.deactivated` or `person.reactivated` with `login`; what is already so writes nothing. A person the organization let in is neither (`person.of_organization`): the organization says, on the schedule the worker reads it on.
|
|
110
110
|
|
|
111
111
|
### `POST /api/v1/listings` and `DELETE /api/v1/listings/<id>`
|
|
112
112
|
|
|
@@ -143,6 +143,8 @@ The workspace's settings, which an administrator keeps on the Settings page ([AD
|
|
|
143
143
|
|
|
144
144
|
The same route keeps what the workspace's agents work with ([ADR-0089](../adr/0089-a-workspace-names-the-services-its-agents-work-with.md)): `handle`, the organization's short name, spelled as an agent account's handle is (`acme`); `domain`, its mail and web domain in small letters (`acme.example`); `null` takes either away; and `services`, by role, `identity`, `git` and `messenger`, each `{ "kind", ...parameters }` or `null` to take it away, a role left out staying as it is. A kind the package knows takes its own parameters and is named for a role it may have: `github` for `identity` or `git`, with `organization` and `account`; `gitlab` for `git`, with `group` (a group as the host nests them, `acme/platform`), `host` (the domain of one an organization runs itself; `gitlab.com` where it names none), `form` (`user`, a person's account, which is the one where it names none, or `service`, the account the host has for a machine, which signs in at no page and holds a token alone) and `account`; `google-workspace` for `identity`, with `account`; `slack` for `messenger`, with `workspace`. `account` is the template an agent's name there is put together from, of letters, digits, `.`, `_`, `-`, `@` and the places `{workspace}`, `{agent}` and `{domain}`; left out, the kind's own (`{agent}@{domain}` at a service of mailboxes, `{workspace}-{agent}` at a git host). Any other kind is kept as it came, with up to `MAX_SERVICE_PARAMETERS` parameters, each a word and a line of up to `MAX_SERVICE_VALUE_LENGTH`; no secret belongs among them. A service that does not read is `request.invalid`, and the message says which and why (`services.git: takes no org.`), naming a parameter at most. The service named for `identity` is one the deployment signs people in through, since an agent account signs in to the console with it (`workspace.identity_unavailable`). The workspace answers them, `handle` and `domain` `null` for none and `services` with the roles that are named, on `GET /api/v1/me` for every member, and leaves the three out for nobody signed in, who is told the board's name, its language and the ways in and not what its accounts are named from; `workspace.updated` says which changed, a service by its role (`services.git`). The console derives nothing from them by itself: whoever makes an agent account puts its login together from them (`agentLoginOf` in the package), and the console takes it as any login.
|
|
145
145
|
|
|
146
|
+
And who keeps the organization's skills ([ADR-0178](../adr/0178-a-note-on-a-skill-waits-for-whoever-keeps-the-pack-who-works-the-notes-in-a-round-at-a-quiet-hour.md)): `packKeeperId`, the id of a member who is in, a person or an agent account, or `null` for nobody (`workspace.keeper_not_found` for an id that is no such member's); and `packRoundAt`, the hour of the keeper's round as `HH:MM`, in the workspace's time zone, or `null` for no round; `03:00` on a workspace where nobody said. The keeper reads and closes every note on the pack ([below](#the-notes-on-the-pack)), as an administrator does, and holds nothing else by it. The workspace answers them as `skills.keeperId` and `skills.roundAt`, and `workspace.updated` names the field that changed. The hour means something only for a keeper that is an agent account, which the worker wakes for a round ([runner.md](runner.md#the-boards-wakes)).
|
|
147
|
+
|
|
146
148
|
### `PUT /api/v1/workspace/pack-token` and `DELETE .../pack-token`
|
|
147
149
|
|
|
148
150
|
The SkillCDN token the organization's pack is read with ([ADR-0036](../adr/0036-a-private-pack-is-connected-with-a-code-a-person-approves-from-the-projects-settings.md)), for an administrator, signed in from the console's own pages or through their agent's token: every project that names no address of its own and holds no token of its own reads the organization's pack (`SKILLS_ADDRESS`) with it. `PUT` takes `{ "token" }` as the project's route does, tries it against the organization's pack once (`workspace.pack_token_refused` when the pack is not served to it or the console names no address for the organization's skills; `skills.unavailable` when the deployment could not be reached), seals it with the console's secret (`workspace.pack_token_unsupported` where the console has none) and keeps it on the workspace, answering the workspace as `me` carries it, with `skills.packToken: { setAt }`, and writing a `workspace.updated` event naming the field `packToken`. The token is answered nowhere and logged nowhere. `DELETE` takes it away the same way; taking away what is not there writes nothing.
|
|
@@ -155,6 +157,16 @@ The workspace's token connected with a code a person approves ([ADR-0036](../adr
|
|
|
155
157
|
|
|
156
158
|
The organization's pack, read where no project is named ([ADR-0113](../adr/0113-the-organizations-pack-is-read-where-no-project-is-named-by-every-member.md)): the pack at the console's own address (`SKILLS_ADDRESS`), which a project that names no address reads too, by the seven reads of [a project's pack](#get-apiv1projectskeyskills), one for one: the same queries, the same bounds, the same envelope and the same bodies, with the workspace's SkillCDN token where the pack is private ([above](#put-apiv1workspacepack-token-and-delete-pack-token)) and no project's. For every member of the workspace, signed in or through their agent's token, an agent account as a person, whatever projects they are in, as the workspace's rules are read; whoever is out, deactivated or no longer let in, and whoever is not signed in, read none of it. `status` is `none`, with `address: null`, where the console names no address for the organization's skills. An outline names `/api/v1/workspace/skills/rows` and `.../code` for a document's tables and code blocks. Each read is logged with who read which path of which pack, with no project, never with what was read. What the command reads in a directory that names no project: a desk, or a folder a repository is about to be made in. From 0.5.1.
|
|
157
159
|
|
|
160
|
+
### The notes on the pack
|
|
161
|
+
|
|
162
|
+
`POST /api/v1/pack-notes`, `GET /api/v1/pack-notes?state=&mine=&path=&limit=&offset=` and `POST /api/v1/pack-notes/<id>/close` ([ADR-0178](../adr/0178-a-note-on-a-skill-waits-for-whoever-keeps-the-pack-who-works-the-notes-in-a-round-at-a-quiet-hour.md)): what a run showed a skill, or a page of the pack, to lack or to say wrong, and the jobs no skill fit, left by whoever met them for whoever keeps the pack. A note is a record of the console's own, kept beside the pack and never in it: it is no event of any feed, makes no notification and wakes nobody.
|
|
163
|
+
|
|
164
|
+
A note is `{ "id", "pack", "path", "body", "state", "by", "agent", "project", "at", "outcome", "closedBy", "closedAgent", "closedAt" }`: the address of the pack it is on, as the console read it when the note was left, or `null` where it names none; the path of the skill or the page, or `null` for a job no skill fit; what it says; `open`, `done` or `dropped`; who left it and the agent they left it through, `null` when they did it themselves; the key of the project it was left from, `null` where none was named and for an asker who may not see that project, who reads a note on the organization's pack all the same; and, once closed, what became of it, who said so, through which agent and when. A member a note names, whoever left it or closed it, is named to whoever may see them ([ADR-0035](../adr/0035-who-may-see-whom-is-decided-by-one-policy-and-the-workspace-keeps-its-settings.md)): where people see those they share a project with, `by` and `closedBy` are `null` for a member the asker may not see, and the agent they acted through with them.
|
|
165
|
+
|
|
166
|
+
- **`POST`** takes `{ "body", "path"?, "project"? }` and answers `201` with `{ "note", "kept", "keeper" }`: `kept` whether a member who is in keeps the organization's skills, and `keeper` who, `null` for nobody and for a keeper the asker may not see. From any member, on a session from the console's own pages or with a token. `body` is 1 to `MAX_PACK_NOTE_LENGTH` characters once its edges are trimmed, with its line breaks; `path` a path of the pack from its root, of up to `MAX_PACK_NOTE_PATH_LENGTH`, with no slash at either end, no backslash, no control character and no `.` or `..` among its parts, or `.` alone for a pack that is one skill at its root (`request.invalid` otherwise), and left out or `null` for a job no skill fit; `project` the key of a project the asker may see (`project.not_found` otherwise), whose pack the note is then on, the organization's where the project names no address of its own. A member has `MAX_PACK_NOTES_OPEN_BY_ONE` open at the most, and leaves `MAX_PACK_NOTES_PER_HOUR` within an hour at the most, whatever became of them, which is the bound a script that leaves and takes back in a loop meets (`note.too_many`, `409`, for either).
|
|
167
|
+
- **`GET`** answers `{ "items", "open", "everyones", "kept", "keeper", "roundAt" }`: a page of notes, the oldest first, `limit` 1 to `MAX_PACK_NOTES_PAGE_LIMIT` and `PACK_NOTES_PAGE_LIMIT` where none is said, from `offset`; how many of all the notes the asker reads are open; whether those are everyone's; and `kept` and `keeper` as leaving a note answers them. An administrator reads every note. Whoever keeps the skills reads every note on the organization's pack, whichever project it was left from, and a note on a pack a project names for itself only where they may see that project: such a note waits for the administrators and for a keeper who is in the project, and is counted in no round of a keeper who is not. Either reads their own alone with `mine=true`; anyone else is answered their own whatever they ask. `state=all` adds the closed ones; `path` keeps to the notes on that path or under that folder.
|
|
168
|
+
- **`POST .../<id>/close`** takes `{ "state": "done" | "dropped", "outcome" }`, `outcome` 1 to `MAX_PACK_NOTE_OUTCOME_LENGTH` characters, and answers the note. An administrator closes any, and the keeper any they read; an author closes their own, which is then `dropped` whatever was sent, since it takes the note back; a note the asker does not read is `note.not_found` (`404`), as one that is not there. A note is closed once (`note.closed`, `409`).
|
|
169
|
+
|
|
158
170
|
### `GET /api/v1/categories`
|
|
159
171
|
|
|
160
172
|
`{ "items": [category, ...] }`: the kinds of work tasks are sorted into ([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)), by name, for whoever is signed in or presents a token. A category carries its `key` (what the command and the filters say; lowercase letters, digits and hyphens; immutable), `name`, `color` (one of `CATEGORY_COLORS`, a name the pages paint and never a value typed), `createdAt` and `updatedAt`. Every workspace starts with `engineering`, `product`, `design`, `marketing` and `operations`.
|
|
@@ -323,7 +335,7 @@ Takes `taskId` (a task of the project; `run.task_not_found` otherwise), and opti
|
|
|
323
335
|
|
|
324
336
|
### `POST .../runs/<id>/reports` and `POST .../runs/<id>/artifacts`
|
|
325
337
|
|
|
326
|
-
How the work goes, and what was made. A report takes `body` (Markdown, `MAX_BODY_LENGTH`, not blank) and tells the board (`run.reported`, with the first words as `excerpt`); a link takes
|
|
338
|
+
How the work goes, and what was made. A report takes `body` (Markdown, `MAX_BODY_LENGTH`, not blank) and tells the board (`run.reported`, with the first words as `excerpt`); a link takes a `url` and optionally a `label` (`run.handed_in`, with the label or the link's first words). The `url` is over https, or over http where it is an address of the console itself (of `PUBLIC_URL`'s origin), as a console on one machine is served; an address with a backslash in it or a name before an `@`, which a browser reads as the console's and another client as another machine's, is none of its own. No `url`, here or among a task's `links`, holds a control or an invisible character, which a terminal would run and a reader not see. Both answer `201` with the run. Only the run's person adds to it (`run.not_yours`), only while it is open (`run.over`), and only so many (`run.too_many_reports`, `run.too_many_artifacts`, counting links and files together).
|
|
327
339
|
|
|
328
340
|
### `POST .../runs/<id>/files` and `GET /api/v1/projects/<key>/files/<id>`
|
|
329
341
|
|
|
@@ -401,7 +413,7 @@ An event is numbered when it is written and seen when its change is committed, a
|
|
|
401
413
|
|
|
402
414
|
## Agent accounts
|
|
403
415
|
|
|
404
|
-
An agent account is a member of its own ([ADR-0084](../adr/0084-an-agent-account-is-a-member-of-its-own-with-a-manager-above-it.md) to [ADR-0089](../adr/0089-a-workspace-names-the-services-its-agents-work-with.md)): a row of the directory with `kind: "agent"`, under the rules a person is under,
|
|
416
|
+
An agent account is a member of its own ([ADR-0084](../adr/0084-an-agent-account-is-a-member-of-its-own-with-a-manager-above-it.md) to [ADR-0089](../adr/0089-a-workspace-names-the-services-its-agents-work-with.md)): a row of the directory with `kind: "agent"`, under the rules a person is under, an administrator where it is made one ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)). What passes between the command and the console for the whole of that plan moved once, at 0.5.0, before the plan was built ([ADR-0043](../adr/0043-the-rest-contract-is-held-to-a-snapshot-taken-at-the-floors.md)): what stands under "In the contract" is read by every command and console from 0.5.0 on, and every route of the plan is specified below, in the change that built it ([roadmap](../roadmap.md), milestones 41 to 43).
|
|
405
417
|
|
|
406
418
|
### In the contract
|
|
407
419
|
|
|
@@ -414,13 +426,13 @@ An agent account is a member of its own ([ADR-0084](../adr/0084-an-agent-account
|
|
|
414
426
|
|
|
415
427
|
`GET` answers `{ "items": [<agent>, ...] }`, the agent accounts the asker may see, as the people are seen ([ADR-0035](../adr/0035-who-may-see-whom-is-decided-by-one-policy-and-the-workspace-keeps-its-settings.md)), and the ones they supervise, those in first, by handle. An agent is `{ "person", "manager", "supervised", "state", "runner" }`: the account as a member, a person object with `kind: "agent"`, its `handle`, its `title` and its `avatarParts`, and `invited: true` while nobody has signed in with it; `firstSignIn`, while it waits for that sign-in at a git host, what the sign-in is held to ([ADR-0126](../adr/0126-an-agent-account-at-a-git-host-is-bound-to-the-hosts-account-when-it-is-added.md)): `account`, `member` or `login`, as below, left out once it has signed in and under a provider that makes its own addresses, and read as optional; whom it reports to, `null` where the asker may not see them; whether the asker supervises it: an administrator, or above it in the reporting line, its manager or the manager of one above them; and how it stands and what its runner last said of itself, `state` and `runner`, [as below](#the-runner-put-apiv1agentsmerunner-and-the-signals), each read as optional and `null` where there is nothing to say. Supervision is one function of the policy, and what a supervisor may do of an agent account, the routes below that say so, nobody else may: an owner of a project it works in reads its runs and reports as anyone's, and nothing more. An agent account is a member, so `GET /api/v1/people` lists it among the people too, and everything that names a person, a task's worker, a decision's decider, an event's actor, names it the same way.
|
|
416
428
|
|
|
417
|
-
`POST`, for an administrator, signed in or through their agent's token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)), makes one and answers `201` with it. It takes the account the agent will sign in with, as a listing names one, `host` (one the deployment signs people in through; `agent.unknown_host` otherwise) and `login` (as the host spells one); its persona, `handle` (2 to 39 lowercase letters, digits and hyphens, a letter or a digit first and last, none of the words the addresses and the command use, `RESERVED_HANDLES`: `new`, `me`, `proposals`, `setup`, `invite`, `secret`, `secrets`, `signals`, `tell`, `interrupt`, `stop`, `restart`, `reset`, `set`, `wake`; one among the workspace's agent accounts, `agent.handle_taken`; it never changes), `name` (a line up to `MAX_PERSON_NAME_LENGTH`), `title` (optional, a line up to `MAX_PERSON_TITLE_LENGTH`), and its avatar, `avatarParts` with optionally the `avatarSeed` they were rolled from, or neither, and the console rolls the parts, from the seed where one is given; `managerId`, an active member of the workspace, a person or an agent account, whoever makes the account where none is named (`agent.invalid_manager` for anyone else, or for one who reports to the account)
|
|
429
|
+
`POST`, for an administrator, signed in or through their agent's token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)), makes one and answers `201` with it. It takes the account the agent will sign in with, as a listing names one, `host` (one the deployment signs people in through; `agent.unknown_host` otherwise) and `login` (as the host spells one); its persona, `handle` (2 to 39 lowercase letters, digits and hyphens, a letter or a digit first and last, none of the words the addresses and the command use, `RESERVED_HANDLES`: `new`, `me`, `proposals`, `setup`, `invite`, `secret`, `secrets`, `signals`, `tell`, `interrupt`, `stop`, `restart`, `reset`, `set`, `wake`; one among the workspace's agent accounts, `agent.handle_taken`; it never changes), `name` (a line up to `MAX_PERSON_NAME_LENGTH`), `title` (optional, a line up to `MAX_PERSON_TITLE_LENGTH`), and its avatar, `avatarParts` with optionally the `avatarSeed` they were rolled from, or neither, and the console rolls the parts, from the seed where one is given; `managerId`, an active member of the workspace, a person or an agent account, whoever makes the account where none is named (`agent.invalid_manager` for anyone else, or for one who reports to the account). The account is made in no project ([ADR-0181](../adr/0181-an-agent-account-is-made-in-no-project-and-its-onboarding-is-the-consoles-first-message-to-it.md)): it is in every project open to the workspace as every member is, and a private one lists it when an owner adds it. `project`, the key a console before 0.6.4 required and a command of before still sends, is taken and not used: nothing is looked for under it, and what is no key is refused as any body that cannot be read. The member's row is written at once, so that work is assigned to it before anyone signed in with it, and the login is let in as a listing lets one in ([ADR-0022](../adr/0022-who-is-in-is-the-consoles-own-record-and-an-administrator-keeps-it.md)); its first sign-in is the account's `person.joined`. A Workspace makes its own addresses: there the account may be made on the way, and the first sign-in with that address binds the provider's account to the row. At a git host a login goes to whoever registers it, so the account has to be the organization's before it is added here, as the pages, the command and the guide say, and the console holds the first sign-in to more than the name ([ADR-0126](../adr/0126-an-agent-account-at-a-git-host-is-bound-to-the-hosts-account-when-it-is-added.md)). Where the deployment names the organization at the host, the console asks it, as the account is added, which of its members the login is, in one question whose answer says both that the login is a member and which account the membership is of, so that no account that came to carry the name between two questions is read in its place, and binds the row to the host's id of that account: `firstSignIn` is `account`, that account alone is let in as this one, whatever it is called by then, and whoever else comes to carry the name is refused while the account waits. Where the organization has no member called so, or cannot be asked, the account is added all the same, not confirmed: `firstSignIn` is `member`, and its first sign-in binds it only where the organization says, at that sign-in, that the login is a member; anyone else under the login is refused. Where the deployment names no organization, nothing can say which account a login is: `firstSignIn` is `login`, and until the account has signed in the console lets in whoever holds the login, as a listing does. A login that is, by the host's id, an account a member already is, under whatever name the console last saw, is that member (`agent.login_is_member`, or the member made the account where `convert` asks); and where the host said which account the login is, a member bound to another account is not the one named, whatever the console last saw them called: the name was theirs and is another account's now, so they are neither refused for nor made the account, with `convert` or without, and the account is added beside them, let in by the organization where a listing of theirs still spells the name. An account added and not used is deactivated, which takes its listing away. The name and the picture stay the console's: a sign-in writes the login as the provider spells it now, and neither the provider's name nor its picture. It writes `person.listed` with `login` and `handle`.
|
|
418
430
|
|
|
419
|
-
With the account the console makes its onboarding ([ADR-
|
|
431
|
+
With the account the console makes its onboarding ([ADR-0181](../adr/0181-an-agent-account-is-made-in-no-project-and-its-onboarding-is-the-consoles-first-message-to-it.md)): its first message to the account, a `wake` of source `console` under the reference `onboarding` (`ONBOARDING_KEY`), sent by nobody, on the account's record of signals ([runner.md](runner.md#the-boards-wakes)), written in the transaction that makes the account, so that there is an account with its message or neither. It says what the agent does itself and what it cannot, to be asked for as decisions, in the words of the services the workspace names (`onboardingOf` in the package), within `MAX_SIGNAL_LENGTH`, and nothing is asked there of the account it signs in with, which comes before it. Whatever the services are, it says the one rule and how help is asked: the agent does everything it can itself, and asks for help only with what it cannot do ([ADR-0152](../adr/0152-an-agent-does-everything-it-can-itself-and-asks-for-help-only-with-what-it-cannot-do.md)). It names the account's own address where the account signs in with one, the login it was made with, and has it ask which address an invitation goes to where it does not, offering none; and it says that it is a message and no task; that a decision is asked on a task the account writes for its setup in a project it is in (`console task new "Set up @<handle>" --project <key> --take`), whose run stays open while a decision waits, the answer waking the account; that where it is in no project yet it says what it needs in its answer, which its supervisors read on its page; and that when nothing waits on anyone it says to its manager what is set up and what is not. The message waits on the account's record until a runner first connects, which is handed it as any signal not delivered yet, once. No task is made and nobody is listed in a project; the answer carries no `onboarding`, which a console before 0.6.4 answered as `{ "project", "number" }` for the task it made, and which the schema still reads.
|
|
420
432
|
|
|
421
|
-
A login a member already carries is refused, `409` `agent.login_is_member`, unless the input says `convert: true` ([ADR-0104](../adr/0104-a-member-is-made-an-agent-account-only-where-that-is-asked-for.md)): a persona's proposed login may spell a colleague's, and nobody is made an agent account by a name that happens to be theirs. With `convert`, the member is made the account, once: the member's own row becomes the account, with everything it did and the sessions and tokens it holds, and the board is told with `person.updated` (`login`, `handle`, `fields: ["kind"]`).
|
|
433
|
+
A login a member already carries is refused, `409` `agent.login_is_member`, unless the input says `convert: true` ([ADR-0104](../adr/0104-a-member-is-made-an-agent-account-only-where-that-is-asked-for.md)): a persona's proposed login may spell a colleague's, and nobody is made an agent account by a name that happens to be theirs. With `convert`, the member is made the account, once: the member's own row becomes the account, with everything it did and the sessions and tokens it holds, and the board is told with `person.updated` (`login`, `handle`, `fields: ["kind"]`). The member keeps the role they have, an administrator's too ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)), unless they are the last person who administers the workspace (`409` `person.last_admin`); a login that is an agent account already is `agent.exists`, whatever `convert` says; `convert` asks nothing of a login nobody carries. `kind` never goes back.
|
|
422
434
|
|
|
423
|
-
What `PATCH /api/v1/people/<id>` says of a member it says of an agent account, with
|
|
435
|
+
What `PATCH /api/v1/people/<id>` says of a member it says of an agent account, `role: "admin"` among it ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)), with one refusal: `managerId: null` is `person.manager_required`, since its manager is replaced and never taken away. An agent account that administers is an administrator in every route, and a supervisor of every agent account but itself: what a supervisor alone does it is refused of its own account (`403` `auth.forbidden`), a stop its supervisors set among it; and it names no manager of its own (`managerId` on its own id, `403` `auth.forbidden`, and nothing of the patch is written), since its manager supervises it and who supervises it is another's to say.
|
|
424
436
|
|
|
425
437
|
### `GET /api/v1/agents/proposals?count=&lang=`
|
|
426
438
|
|
|
@@ -444,7 +456,7 @@ Where an agent account is signed in, for its supervisors ([ADR-0084](../adr/0084
|
|
|
444
456
|
|
|
445
457
|
### `GET /api/v1/me/manager`
|
|
446
458
|
|
|
447
|
-
`{ "manager": person | null, "administrators": [person, ...] }`: whom whoever asks reports to, a person or an agent account, whatever they are and whether they are still in, or `null` for nobody; and the administrators of the workspace who are in, by login, who stand in where there is nobody or the manager is out. For every member, with a session or a token. A manager is whom a member turns to first, and who is answerable for an agent account; it is no rule of the board, where a decision is addressed to whomever the asker names.
|
|
459
|
+
`{ "manager": person | null, "administrators": [person, ...] }`: whom whoever asks reports to, a person or an agent account, whatever they are and whether they are still in, or `null` for nobody; and the administrators of the workspace who are in, by login, who stand in where there is nobody or the manager is out, without whoever asks, where they are one: nobody stands in for their own manager ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)). For every member, with a session or a token. A manager is whom a member turns to first, and who is answerable for an agent account; it is no rule of the board, where a decision is addressed to whomever the asker names.
|
|
448
460
|
|
|
449
461
|
### The secret store: `/api/v1/agents/me/secrets` and `/api/v1/agents/<handle>/secrets`
|
|
450
462
|
|
|
@@ -452,7 +464,14 @@ An agent account keeps named secrets in the console ([ADR-0087](../adr/0087-an-a
|
|
|
452
464
|
|
|
453
465
|
**The account's own**, under `/api/v1/agents/me/secrets`. For an agent account (`agent.not_found` for a person, who has no store), on a session of its own, a browser's or its command's ([`console login --self`](#connecting-an-agent)), never with a token it made for an agent of its own (`secret.own_session`): what such an agent holds reads none of the account's secrets. `GET` answers `{ "items": [secret, ...] }`, the names, by name. `GET .../<name>` answers the secret with its `value`, and notes the reading; a value this deployment's key does not open, or one sealed for another account or name, is `secret.unreadable`, to be set again. `PUT .../<name>` takes `{ "value", "expiresOn" }`, the day optional and `null` for none, sets the secret, a new one or over the one there was, and answers it, without its value. `DELETE .../<name>` removes it and answers `204`. A change on a browser's session comes from the console's own pages.
|
|
454
466
|
|
|
455
|
-
**A supervisor's part**, under `/api/v1/agents/<handle>/secrets`, with a session or a token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)); `auth.forbidden` for whoever sees the account and does not supervise it. `GET` answers the names as above. `PUT .../<name>` seeds a secret, write-only: the same body, answered without the value, the secret marked `seeded`. `DELETE .../<name>` removes one. No route of a supervisor's answers a value: `GET .../<name>` is nothing.
|
|
467
|
+
**A supervisor's part**, under `/api/v1/agents/<handle>/secrets`, with a session or a token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)); `auth.forbidden` for whoever sees the account and does not supervise it. `GET` answers the names as above. `PUT .../<name>` seeds a secret, write-only: the same body, answered without the value, the secret marked `seeded`. `DELETE .../<name>` removes one. No route of a supervisor's answers a value: `GET .../<name>` is nothing. The account's page sends the same from Settings, `/agents/<handle>/settings` ([ADR-0184](../adr/0184-what-a-person-must-do-has-a-page-which-guidance-names-and-a-secret-is-put-in-there-from-a-file-too.md)): the value typed unseen, or the text of a file the person chose, read in the browser and sent as the value, never as a file, and the day it ends on where one is said. A member who opens that address and supervises the account not is shown the way to offer one, below.
|
|
468
|
+
|
|
469
|
+
**A secret offered to an account** ([ADR-0169](../adr/0169-a-member-offers-an-agent-account-a-secret-and-the-account-takes-it-or-leaves-it.md)), under `/api/v1/agents/<handle>/secret-offers` and `/api/v1/agents/me/secret-offers`. An offer is kept sealed apart from the store, changes nothing the account keeps, and no route answers its value.
|
|
470
|
+
|
|
471
|
+
- `POST /api/v1/agents/<handle>/secret-offers` offers one, for any member who sees the account, with a session or a token; `agent.not_found` for an account the member may not see, and `409 secret.offer_own` for the account itself. The body is `{ "name", "value", "note"?, "expiresOn"? }`: a secret's name, a value of at most 8 KiB (`secret.too_large`), what it is for in one line of at most 200 characters, and the day the value ends on. Answered `201` with the offer: `{ "id", "name", "note", "by", "agent", "expiresOn", "state", "at", "endsAt", "decidedAt", "takenAs" }`, `state` one of `waiting`, `taken`, `left`, `lapsed`, and never the value. Twenty offers wait for one account at a time and five of them are one member's: one more is `409 secret.too_many_offers`. An offer waits seven days, until `endsAt`. The account is sent a wake at once ([runner.md](runner.md)).
|
|
472
|
+
- `GET /api/v1/agents/<handle>/secret-offers` is `{ "items": [...] }`, the newest first: the account's record of its offers whole for a supervisor, the latest two hundred that no longer wait among them, and for any other member who sees the account the offers they made themselves.
|
|
473
|
+
- `GET /api/v1/agents/me/secret-offers` is what waits for the account itself, on a session of its own as its store is read (`secret.own_session` with a token it made, `agent.not_found` for a person).
|
|
474
|
+
- `POST /api/v1/agents/me/secret-offers/<id>/take` takes one into the store, with `{ "as"?, "replace"? }`: under the name offered or the one `as` says, as a secret the account set itself, answered as a secret is, without its value. Where the account keeps a secret of that name already it is `409 secret.exists` and the offer still waits, unless `replace` is `true`. `DELETE /api/v1/agents/me/secret-offers/<id>` leaves one, `204`. An offer that is not the account's, or waits no more, is `404 secret.offer_not_found`; a value the deployment's key no longer opens, `409 secret.unreadable`.
|
|
456
475
|
|
|
457
476
|
`GET /api/v1/agents/<handle>/secret-accesses?before=&limit=` is the account's record of its store, for its supervisors: `{ "items": [{ "id", "name", "action", "by", "agent", "seeded", "at" }, ...], "more" }`, the newest first, `limit` of them (50 where none is said, 200 at most), from before the line `before` on. A line says what was done to which secret (`set`, `read` or `removed`), by whom, through which agent where they acted with a token, and whether it was a supervisor's doing; never a value.
|
|
458
477
|
|
|
@@ -460,16 +479,16 @@ An agent account keeps named secrets in the console ([ADR-0087](../adr/0087-an-a
|
|
|
460
479
|
|
|
461
480
|
What passes between the console and an agent account's runner ([ADR-0085](../adr/0085-a-runner-on-the-agents-machine-is-told-by-signals-and-runs-one-session-at-a-time.md)) is specified in [runner.md](runner.md), the bodies with it; the routes, who asks them and what they refuse are here.
|
|
462
481
|
|
|
463
|
-
**How an agent stands.** An agent object carries `state`, `{ "state", "reason", "since", "heardAt" }`: one of `running`, `stopped`, `refused`, `failed` and `unheard`; why, one of a short list of words (`started`, `resumed`, `reset`, `completed`, `stop`, `model_refused`, `sign_in`, `start`, `crashed`, `usage_limit`, `no_heartbeat`); since when; and when its runner was last heard from. `until` is until when it stands so, where its runner said ([ADR-0150](../adr/0150-a-runner-waits-out-its-products-usage-limit-and-tells-its-agent-before-it.md)): the moment a usage limit resets, `null` where nothing says, and left out by a console of before. It is `null` until a runner has said anything of the account, and answered to whoever sees the account. `usage` is what its product last said of what its subscription allows ([ADR-0156](../adr/0156-an-agent-account-shows-what-its-products-allowance-has-used-and-when-it-resets.md)), a window each, `{ "name", "used", "resetsAt", "near"?, "at" }`: the name its driver gives the window, the share used from 0 to 1 and the moment it resets, `null` each where the product does not say, whether the product calls it near its limit, and when the product said so. It is answered to whoever sees the account, from 0.6.1, and left out where its runner has said none; a window whose reset has passed is of a window that is over, and the pages and the command leave it out, as they do one that names no reset once it was last said more than eight days ago. Which windows there are is the product's to say, and none is expected: a plan that keeps no short window is answered without one. `runner` is what its runner last said of itself and what was chosen for it, `{ "delivered", "latest", "session", "machine", "runner", "product", "offers", "running", "settings" }`, answered to the account's supervisors and to the account, `null` to anyone else. The console says when it last heard and claims nothing more ([ADR-0020](../adr/0020-the-console-does-not-claim-an-agent-is-at-work-a-run-says-when-it-was-last-heard-from-and-a-new-run-takes-over.md)): a runner not heard from for five minutes is noted `unheard` by the worker, and its next heartbeat says how the agent stands again.
|
|
482
|
+
**How an agent stands.** An agent object carries `state`, `{ "state", "reason", "since", "heardAt" }`: one of `running`, `stopped`, `refused`, `failed` and `unheard`; why, one of a short list of words (`started`, `resumed`, `reset`, `completed`, `stop`, `model_refused`, `sign_in`, `start`, `crashed`, `usage_limit`, `no_heartbeat`); since when the state stands; and when its runner was last heard from. `reasonAt` is when the reason was said, which is another moment than `since` where the reason changed under a state that stayed, a new conversation or a turn that completed while the agent ran on: the same moment as `since` where the two came together, `null` where the console keeps none, a row of before, and left out by a console of before; a reason is shown beside this moment or beside none, never beside `since`. `until` is until when it stands so, where its runner said ([ADR-0150](../adr/0150-a-runner-waits-out-its-products-usage-limit-and-tells-its-agent-before-it.md)): the moment a usage limit resets, `null` where nothing says, and left out by a console of before. It is `null` until a runner has said anything of the account, and answered to whoever sees the account. `usage` is what its product last said of what its subscription allows ([ADR-0156](../adr/0156-an-agent-account-shows-what-its-products-allowance-has-used-and-when-it-resets.md)), a window each, `{ "name", "used", "resetsAt", "near"?, "at" }`: the name its driver gives the window, the share used from 0 to 1 and the moment it resets, `null` each where the product does not say, whether the product calls it near its limit, and when the product said so. It is answered to whoever sees the account, from 0.6.1, and left out where its runner has said none; a window whose reset has passed is of a window that is over, and the pages and the command leave it out, as they do one that names no reset once it was last said more than eight days ago. Which windows there are is the product's to say, and none is expected: a plan that keeps no short window is answered without one. `runner` is what its runner last said of itself and what was chosen for it, `{ "delivered", "latest", "session", "machine", "runner", "product", "offers", "running", "settings" }`, answered to the account's supervisors and to the account, `null` to anyone else. The console says when it last heard and claims nothing more ([ADR-0020](../adr/0020-the-console-does-not-claim-an-agent-is-at-work-a-run-says-when-it-was-last-heard-from-and-a-new-run-takes-over.md)): a runner not heard from for five minutes is noted `unheard` by the worker, and its next heartbeat says how the agent stands again.
|
|
464
483
|
|
|
465
484
|
**The runner's own**, for an agent account (`agent.not_found` for a person) on the session of its command signed in as itself ([`console login --self`](#connecting-an-agent)); its browser, or a token it made, is `agent.own_command`, since the command's session is the runner's one credential.
|
|
466
485
|
|
|
467
|
-
- `PUT /api/v1/agents/me/runner` is the heartbeat: how the agent stands and why, as `until`, optional, until when where the runner knows, the moment a usage limit resets ([ADR-0150](../adr/0150-a-runner-waits-out-its-products-usage-limit-and-tells-its-agent-before-it.md)), the last signal delivered, the open session, the machine, the runner's version, the product and what it offers to choose from, what the session runs with, as `usage`, optional, what the product last said of its allowance ([ADR-0156](../adr/0156-an-agent-account-shows-what-its-products-allowance-has-used-and-when-it-resets.md): up to eight windows, a name of forty characters on one line, a share from 0 to 1 or `null`, moments), which the console keeps a window at a time until each resets and answers as `usage` of the account, and as `sources`, optional, how each wake source the runner keeps beside the console's own stands ([ADR-0144](../adr/0144-a-runner-takes-its-runner-json-as-it-changes-and-says-how-its-wake-sources-stand.md): `{ "name", "state", "since", "why"? }`, the state one of `connected`, `waiting` and `failing`, up to ten), which the console keeps as last said and answers as `runner.sources` of the account where a runner said any; every line bounded and read by schema (`request.invalid`), the body up to 64 KiB (`request.too_large`). It answers `{ "latest", "delivered", "settings", "state" }`: the number of the account's newest signal; the most the console was ever told was delivered, where a runner that lost its own count goes on from; the model and the effort chosen for it, `null` each for the product's own, and a choice this heartbeat's `offers` do not list, where they list any, is `null` from then on, since what is chosen is kept among what the product offers; and how the console has the agent, which is `stopped` whatever the runner says while a supervisor's `stop` stands. A state that changed is `agent.state_changed`, by the account.
|
|
486
|
+
- `PUT /api/v1/agents/me/runner` is the heartbeat: how the agent stands and why, as `reasonAt`, optional, when the runner said the reason, which the console keeps under a state that stays, held between the moment the state began and now, and dates itself, at the change of the state or of the reason, where a runner of before says none, as `until`, optional, until when where the runner knows, the moment a usage limit resets ([ADR-0150](../adr/0150-a-runner-waits-out-its-products-usage-limit-and-tells-its-agent-before-it.md)), the last signal delivered, the open session, the machine, the runner's version, the product and what it offers to choose from, what the session runs with, as `usage`, optional, what the product last said of its allowance ([ADR-0156](../adr/0156-an-agent-account-shows-what-its-products-allowance-has-used-and-when-it-resets.md): up to eight windows, a name of forty characters on one line, a share from 0 to 1 or `null`, moments), which the console keeps a window at a time until each resets and answers as `usage` of the account, and as `sources`, optional, how each wake source the runner keeps beside the console's own stands ([ADR-0144](../adr/0144-a-runner-takes-its-runner-json-as-it-changes-and-says-how-its-wake-sources-stand.md): `{ "name", "state", "since", "why"? }`, the state one of `connected`, `waiting` and `failing`, up to ten), which the console keeps as last said and answers as `runner.sources` of the account where a runner said any; every line bounded and read by schema (`request.invalid`), the body up to 64 KiB (`request.too_large`). It answers `{ "latest", "delivered", "settings", "state" }`: the number of the account's newest signal; the most the console was ever told was delivered, where a runner that lost its own count goes on from; the model and the effort chosen for it, `null` each for the product's own, and a choice this heartbeat's `offers` do not list, where they list any, is `null` from then on, since what is chosen is kept among what the product offers; and how the console has the agent, which is `stopped` whatever the runner says while a supervisor's `stop` stands. A state that changed is `agent.state_changed`, by the account.
|
|
468
487
|
- `GET /api/v1/agents/me/signals/stream?after=<number>` is a stream of server-sent events, each `signal` with a signal as its data and its number as its id, from the number after `after` on, in order, with a comment in the silences. `Last-Event-ID` is read in place of `after` where it is further on. The stream ends when the command's session does, and when the process closes. It counts among the streams the account holds (`feed.too_many`).
|
|
469
488
|
|
|
470
489
|
**The record.** `GET /api/v1/agents/<handle>/signals?before=&limit=` answers `{ "items": [signal, ...], "more", "delivered" }`, the newest first, `limit` of them (50 where none is said, 200 at most), from before the number `before` on, to the account's supervisors (`auth.forbidden` for whoever sees the account and does not supervise it). `delivered` is the number of the last signal delivered, every one before it too ([ADR-0131](../adr/0131-a-signal-is-delivered-when-the-product-took-it-and-an-event-says-which-sub-agent-made-it.md)), as the account's runner last said, `0` for none: a signal of the record is delivered where its number is no more than that, and waits otherwise. It follows the runner's heartbeat, so a signal the product has just taken reads as waiting for a moment. A console before 0.5.2 leaves it out. `GET /api/v1/agents/me/signals` answers the same to the account itself, on a session of its own, a browser's or its command's. A signal is no event of the board's feed.
|
|
471
490
|
|
|
472
|
-
**A wake the runner raises itself.** `POST /api/v1/agents/me/signals`, for an agent account on its command's session, as the heartbeat is (`agent.own_command`, `agent.not_found`): `{ "kind": "wake", "source": "messenger", "key", "text" }`, what one of its wake sources heard on the machine ([runner.md](runner.md#wake-sources)). `key` is a line up to `MAX_SIGNAL_KEY_LENGTH` saying what it is about, a thread say; `text`, optional, is someone else's words, bounded as a signal's are. It answers `201` with the signal, recorded under the next number of the account's record, by nobody, and sent on the account's stream in its order. Nothing else is raised this way, any other `kind` or `source` being `request.invalid`: a runner tells its own agent nothing in a supervisor's name, the board's or the console's. A runner raises 600 wakes within an hour at most ([ADR-0132](../adr/0132-what-a-runner-writes-is-bounded-by-the-hour-and-its-log-by-its-size.md)): one more is `signal.too_many` (`429`), with `retry-after`, the seconds until the hour has room, and nothing recorded. What a supervisor, the board and the schedule send is not counted.
|
|
491
|
+
**A wake the runner raises itself.** `POST /api/v1/agents/me/signals`, for an agent account on its command's session, as the heartbeat is (`agent.own_command`, `agent.not_found`): `{ "kind": "wake", "source": "messenger", "key", "text" }`, what one of its wake sources heard on the machine ([runner.md](runner.md#wake-sources)). `key` is a line up to `MAX_SIGNAL_KEY_LENGTH` saying what it is about, a thread say; `text`, optional, is someone else's words, bounded as a signal's are. It answers `201` with the signal, recorded under the next number of the account's record, by nobody, and sent on the account's stream in its order. Nothing else is raised this way, any other `kind` or `source` being `request.invalid`: a runner tells its own agent nothing in a supervisor's name, the board's or the console's. A `kind` of a supervisor's, a tell, an interruption, a stop, a start, a reset or a setting, is `auth.forbidden` (`403`) in words, since the account's own command reaches this route with it too: nobody supervises themselves ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)). A runner raises 600 wakes within an hour at most ([ADR-0132](../adr/0132-what-a-runner-writes-is-bounded-by-the-hour-and-its-log-by-its-size.md)): one more is `signal.too_many` (`429`), with `retry-after`, the seconds until the hour has room, and nothing recorded. What a supervisor, the board and the schedule send is not counted.
|
|
473
492
|
|
|
474
493
|
**Who wrote at a messenger** ([ADR-0164](../adr/0164-a-plugin-says-which-account-at-a-messenger-is-a-members-and-a-wake-says-by-it-whether-a-supervisor-wrote.md)). `POST /api/v1/agents/me/writers`, for an agent account on a session of its own (`agent.not_found` for a person, `agent.own_command` for a token the account made): `{ "messenger", "accounts": [{ "workspace", "account" }, ...] }`, the messenger by its name as a wake source is named (`slack`) and up to `MAX_WRITERS_ASKED` accounts, each by the messenger's ids for its workspace and for itself, letters, digits, `.`, `_` and `-`, 64 at most (`request.invalid` otherwise). It answers `{ "items": [{ "workspace", "account", "told", "member" }, ...] }` in the order asked: `told`, whether the console is told the accounts of that workspace at all, by a plugin that is enabled and holds `people:accounts`; and `member`, `{ "login", "kind", "supervisor", "administrator", "line" }` for the active member whose account it is, `login` being `null` for one the account may not see and has not in its reporting line, `supervisor` being whether they supervise the account that asks, an administrator or above it in the reporting line at any level, `administrator` whether they administer the workspace, and `line` where they stand in the asker's reporting line, `"manager"` whom it reports to, `"above"` anyone further up, `"report"` whoever reports to it, `"below"` anyone further down, `null` nowhere in it, or `null` for an account that is no member's as far as the console is told. It changes nothing. A runner asks it for its wake sources, and `console agent messages` for the lines it prints.
|
|
475
494
|
|
|
@@ -501,7 +520,7 @@ A session is `{ "id", "month", "startedAt", "endedAt", "ended", "product", "mode
|
|
|
501
520
|
- `GET .../<id>/events/<n>/text` answers `{ "n", "text" }`, the whole text of one event; `transcript.event_not_found` for a number the session has not.
|
|
502
521
|
- `GET .../<id>/files/<file id>` answers the bytes of a picture, shown in place under its kind, with `nosniff` and a policy that runs nothing; `file.not_found` for an id that is not that session's.
|
|
503
522
|
|
|
504
|
-
**Sealing.** `POST /api/v1/agents/<handle>/sessions/<id>/events/<n>/seal`, for an administrator, signed in on the console's own pages or through their agent's token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)), takes `{ "reason" }`, a line up to `MAX_SEAL_REASON_LENGTH`, and answers the event as it is from then on: its content replaced by who sealed it, when and why. A supervisor who is no administrator is `auth.forbidden
|
|
523
|
+
**Sealing.** `POST /api/v1/agents/<handle>/sessions/<id>/events/<n>/seal`, for an administrator, signed in on the console's own pages or through their agent's token ([ADR-0021](../adr/0021-a-token-configures-as-its-person-does.md)), takes `{ "reason" }`, a line up to `MAX_SEAL_REASON_LENGTH`, and answers the event as it is from then on: its content replaced by who sealed it, when and why. A supervisor who is no administrator is `auth.forbidden`, and so is an agent account that administers, of its own transcript: what it did stays for its supervisors to read, and another administrator seals it ([ADR-0180](../adr/0180-an-agent-account-administers-where-it-is-made-an-administrator-and-nobody-supervises-themselves.md)). An event sealed already stays as it was sealed. The bytes it held go with the seal: where the store refuses to let them go, nothing is sealed and the answer is `file.store_unavailable` (`503`, with `retry-after`), for the seal to be asked again. The one way anything leaves a transcript, and on the record.
|
|
505
524
|
|
|
506
525
|
A run carries `sessionId`, the session of an agent account's runner it was begun in, or `null`: set by the console for a run the account's command begins while a session of the account is open.
|
|
507
526
|
|