@skillcdn/console 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +12 -20
- package/dist/components/home.js.map +1 -1
- package/dist/home-tiles.d.ts +19 -37
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +52 -328
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +2 -2
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -2
- package/dist/i18n/en.js.map +1 -1
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +3 -2
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/runner/desk.js +1 -1
- package/docs/specs/plugins.md +3 -3
- package/package.json +1 -1
- package/skills/building-a-plugin/SKILL.md +2 -2
- package/skills/running-an-agent/SKILL.md +2 -2
- package/src/components/home.tsx +13 -34
- package/src/home-tiles.ts +57 -376
- package/src/i18n/en.ts +2 -2
- package/src/plugin/manifest.ts +3 -2
- package/src/runner/desk.ts +1 -1
package/docs/specs/plugins.md
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
| `settingGroups` | Group[] | up to 10, each `{ key, name, description? }`, in the order the form shows them; the settings without a `group` come above them |
|
|
63
63
|
| `menu` | `{ group, order?, name? }` | the tab the plugin is under: a group of the console's (`people`, `customers`, `money`, `operations`, `marketing`, `engineering`, `reports`), or one the plugin declares with a `name` per language; `order` within the row, default 100 |
|
|
64
64
|
| `pages` | Page[] | up to 12, each `{ key, name, level, roles?, wide? }`; `level` is `workspace` or `project`; page keys as `key`, and not `frame`, `web` or `x` |
|
|
65
|
-
| `widgets` | Widget[] | up to 4, each `{ key, name, place, sizes, defaultSize?, roles? }`; `place` is `home:top` or `home:bottom`; `sizes` the sizes the widget comes in, each once, among `small` (2×2 cells of the front page's grid), `medium` (4×2), `large` (4×4), `wide` (8×2) and `full` (8×4), at least one of them `small`, `medium` or `large`, since a phone's grid is four cells across ([ADR-0062](../adr/0062-a-widget-comes-in-a-size-a-phone-can-hold.md)), and `defaultSize` the one it starts at, the first of them when left out ([ADR-0061](../adr/0061-the-front-page-is-one-grid-of-tiles-a-person-arranges-by-hand.md)); the one `size` of before, `third`, `half` or `full`, still reads, as `small`, `medium` or `wide` |
|
|
65
|
+
| `widgets` | Widget[] | up to 4, each `{ key, name, place, sizes, defaultSize?, roles? }`; `place` is `home:top` or `home:bottom`; `sizes` the sizes the widget comes in, each once, among `small` (2×2 cells of the front page's grid), `medium` (4×2), `large` (4×4), `wide` (8×2) and `full` (8×4), at least one of them `small`, `medium` or `large`, since a phone's grid is four cells across ([ADR-0062](../adr/0062-a-widget-comes-in-a-size-a-phone-can-hold.md)), and `defaultSize` the one it starts at, on the page of someone who has arranged nothing too (ADR-0147), the first of them when left out ([ADR-0061](../adr/0061-the-front-page-is-one-grid-of-tiles-a-person-arranges-by-hand.md)); the one `size` of before, `third`, `half` or `full`, still reads, as `small`, `medium` or `wide` |
|
|
66
66
|
| `dataVersion` | integer | the version of the plugin's record shapes, from 1; raised with an entry in `upgrades` |
|
|
67
67
|
| `store` | object | `homepage`, `repository`, `keywords`, `icon`; the license is `package.json`'s |
|
|
68
68
|
|
|
@@ -281,7 +281,7 @@ What the deployment must allow: the console's database user holds `CREATEROLE`,
|
|
|
281
281
|
- New kinds of the console's events: `plugin.enabled`, `plugin.disabled`, `plugin.configured`, `plugin.granted`, `plugin.revoked`, `plugin.upgraded`, `plugin.command`, `plugin.failed`, `plugin.purged`. `events.plugin` names the plugin on every event a plugin caused, its own kinds and the board's. `plugin.configured` names the fields that changed and, for a secret, its `source`: `administrator`, or the host of the answer the console sealed it from. `plugin.granted` and `plugin.revoked` name a `grantee` where the role went to a plugin. An event a plugin caused for a person names the person as its actor and that plugin as `via`, beside `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)). `plugin.command` records the plugin, the command, the arguments (the secret ones as `[hidden]`), the outcome (`ok`, `refused` with its code, `waiting`, `failed`), the duration and the caller's run. They are in the board project's feed where there is one, and always at `GET /api/v1/plugins/<key>/events`, for whoever may read them there ("REST").
|
|
282
282
|
- A plugin's own events (`ctx.events.emit`, the kind named as a `key`, the data JSON up to 16 KiB) go to `plugin_events` (plugin, kind, data, at; 100,000 kept, for ninety days, the janitor sweeping the rest), reach the frames of that plugin that subscribed, read at `GET .../plugin-events?after=&limit=` by its role holders, and the hooks of plugins with `events:plugins` on `plugin:<key>:<kind>`. They are not the board's feed.
|
|
283
283
|
- Hooks run in the `worker` role's host. A dispatcher reads the console's events and `plugin_events` from a cursor per plugin (`plugin_cursors`, begun at the end of both streams when the plugin is enabled, so that it is not told of everything that ever happened), each plugin under an advisory lock of its own, so that one process dispatches to a plugin at a time and two processes to two plugins at once. The lock is held by a transaction the server lets idle for as long as a pass may take on the plugin, its time, the hook begun last and a minute more, in place of the thirty seconds an idle transaction has otherwise, and it is taken with two keys, which no job's lock of one key can be. A process delivers to a few plugins side by side, a quarter as many as it has database connections, at least one and four at most (one at a time in the `worker` role, whose pool has four), since each holds a connection for its lock and takes more for its queries and its hook's calls on `ctx`: a plugin whose hook waits on a slow service, or waits out its backoff, holds up no plugin delivered to beside it, and the pool keeps room for the rest, the API's requests where the `api` role carries the worker. A plugin that has had twenty seconds of a pass leaves the rest of its events to the next. It delivers each event to the handler that named its kind; a console event is delivered for the plugin's board project, the projects it is on, the items it made and what it caused, and, for a plugin with `people:read:all`, the workspace's people events (`person.*`), teams' events (`team.*`) and agent accounts' events (`agent.*`: how one stands now, `agent.state_changed`, [ADR-0085](../adr/0085-a-runner-on-the-agents-machine-is-told-by-signals-and-runs-one-session-at-a-time.md)), with the kind, the ids and the time, and the content and the actor with `board:read`, or with `people:read:all` for a people event, since the directory is its to read. Delivery is at least once and in order: a handler that fails is retried five times with doubling backoff, then the event is skipped with a `plugin.failed` event; a handler has thirty seconds. A try in which the console itself could not make the event ready, or could not call the hook, counts as a try the hook failed, so that an event it can never deliver is skipped the same way and does not hold the plugin at it. Each stream is read no further than its settled end, the highest number below which no change is still under way ([ADR-0125](../adr/0125-a-feed-is-read-no-further-than-its-settled-end-which-its-writers-hold-a-lock-for.md)), and a cursor begins there: an event numbered before another and committed after it is delivered once it is there, in the order of the numbers, and never passed over. Every delivery carries the event's `id` and the `attempt`, 1 the first time, so that a hook keeps from acting twice by the id alone, where before it had to make a key of the kind, the record and the time. A hook told to come back later by the service it called, a rate limit or an outage, says so with `retryAfterMs` in the data of its refusal (`throw new PluginError("rate_limited", message, { retryAfterMs })`), and the next try waits that long, within an hour, in place of the backoff; the try still counts.
|
|
284
|
-
- Jobs run in the `worker` role's host, with the `jobs` capability, each under an advisory lock, never two at once, the lock held by a transaction the server lets idle for the job's five minutes and a minute more, in place of the thirty seconds an idle transaction has otherwise; `plugin_jobs` keeps the last run, its outcome and the next time, the first run one period after the scheduler first sees the job, `at` read in the workspace's time zone; a failed job is a `plugin.failed` event, at most one an hour per job, and a line in the log every time. A job has five minutes. The jobs are seen ([ADR-0128](../adr/0128-a-plugins-jobs-are-seen-and-one-that-keeps-failing-is-a-problem-of-its-plugin.md)): `plugin_jobs` keeps since when a job has failed, run after run, its first failure after it went well, cleared when it goes well again; `GET /api/v1/plugins/<key>` answers each job the module declares with how often it runs, its last run and outcome, its next time and that moment (`jobs`), and a job that failed twice running is a problem of its plugin, `the job <name> has failed since <moment>`, among `problems` on both routes until its next run goes well, for whoever lists the plugins and on the settings pages. The problem says where the reason is, the `plugin.failed` event among the plugin's events, and never the reason itself, which is what the plugin's code said about a project's work; that event is written in the plugin's board project where it has one, so a reader the project is closed to is told that the reason is in that project and that a member of it or an administrator reads it, in place of being sent to an event they may not read. One failure is not said there: a host away for a moment fails a run and the next goes well. A job the code no longer declares, and a plugin that is not enabled with `jobs`, have no such problem, and no next time.
|
|
284
|
+
- Jobs run in the `worker` role's host, with the `jobs` capability, each under an advisory lock, never two at once nor twice for one time it was due, its row read again under the lock, the lock held by a transaction the server lets idle for the job's five minutes and a minute more, in place of the thirty seconds an idle transaction has otherwise; `plugin_jobs` keeps the last run, its outcome and the next time, the first run one period after the scheduler first sees the job, a job without `at` due next a period after the time it was due, however long its run took, and the periods the console was away for skipped, not run one after another, `at` read in the workspace's time zone; a failed job is a `plugin.failed` event, at most one an hour per job, and a line in the log every time. A job has five minutes. The jobs are seen ([ADR-0128](../adr/0128-a-plugins-jobs-are-seen-and-one-that-keeps-failing-is-a-problem-of-its-plugin.md)): `plugin_jobs` keeps since when a job has failed, run after run, its first failure after it went well, cleared when it goes well again; `GET /api/v1/plugins/<key>` answers each job the module declares with how often it runs, its last run and outcome, its next time and that moment (`jobs`), and a job that failed twice running is a problem of its plugin, `the job <name> has failed since <moment>`, among `problems` on both routes until its next run goes well, for whoever lists the plugins and on the settings pages. The problem says where the reason is, the `plugin.failed` event among the plugin's events, and never the reason itself, which is what the plugin's code said about a project's work; that event is written in the plugin's board project where it has one, so a reader the project is closed to is told that the reason is in that project and that a member of it or an administrator reads it, in place of being sent to an event they may not read. One failure is not said there: a host away for a moment fails a run and the next goes well. A job the code no longer declares, and a plugin that is not enabled with `jobs`, have no such problem, and no next time.
|
|
285
285
|
- `WORKER_IN_PROCESS` puts hooks and jobs in the `api` role's host.
|
|
286
286
|
|
|
287
287
|
## Between plugins
|
|
@@ -426,7 +426,7 @@ The page performs every `call` with the person's session under `/api/v1/plugins/
|
|
|
426
426
|
|
|
427
427
|
The front page (`/`) is one grid of square cells on which the projects and the widgets stand as tiles ([ADR-0061](../adr/0061-the-front-page-is-one-grid-of-tiles-a-person-arranges-by-hand.md)): the widgets the person holds a role for, of the plugins that are enabled. The grid has 12 columns where the page is at least 1520 pixels wide, 8 from 900, 6 from 560 and 4 below, and a cell is as wide as that leaves it. A project is an `icon` of 1×1 cells or `small` of 2×2, or a glance at its board at `medium` 4×2, `large` 4×4 or `wide` 8×2, never `full` ([ADR-0105](../adr/0105-a-project-at-a-larger-size-is-a-glance-at-its-board.md)). A widget is at its size, `small` 2×2, `medium` 4×2, `large` 4×4, `wide` 8×2, `full` 8×4, filling the cells it has; the height it says is not read. A grid offers a tile the sizes that fit it, and one kept or started at a size too wide takes the largest it comes in that fits, each width being arranged for itself; every widget has a size at most four cells across, so that a phone has one to show ([ADR-0062](../adr/0062-a-widget-comes-in-a-size-a-phone-can-hold.md)). Each widget is a frame with the same document and bridge, `widget=<key>` in place of `page`, its name above it; `init` carries `size`, the size the widget has on this grid, and a `size` message follows when the person changes it or the page narrows past it, so that the bundle lays itself out for the cells (`frame.context.size`, `frame.onSize`).
|
|
428
428
|
|
|
429
|
-
There is no default layout. On a width the person arranged, what they have not seen yet takes the first room reading from the top, at the size it starts at: a project made since, the widgets of a plugin as soon as it is enabled. For someone who has arranged nothing,
|
|
429
|
+
There is no default layout. On a width the person arranged, what they have not seen yet takes the first room reading from the top, at the size it starts at: a project made since, the widgets of a plugin as soon as it is enabled. For someone who has arranged nothing, every tile they may see stands in the page's order, the widgets placed `home:top`, the projects, the widgets placed `home:bottom`, each at the size it starts at, at the first room reading from the top ([ADR-0147](../adr/0147-the-page-nobody-arranged-stands-as-arranging-shows-it-and-no-size-is-chosen-for-a-person.md)): a widget at its `defaultSize` where the grid fits it, else at the largest of its `sizes` that fits, a project an icon on one cell. The page is the same looked at and being arranged, and no size is chosen for the person: no widget is drawn larger or smaller than that to lead the page or to close a row, and a frame is told the size of the cells it has. While arranging, a button closes the page up where it has gaps, each tile in the order they are read moved to the first room from the top that the others leave it, each at the size it has, until none moves, so that no tile goes further down and the page grows no longer, and another puts the page back as nobody arranged it, every width unarranged and every tile taken off back on it, which Done keeps as `{ hidden: [], layouts: {} }` and Cancel lets go ([ADR-0109](../adr/0109-arranging-can-put-the-page-back-as-composed.md)). `GET /api/v1/me` answers `home`, `{ hidden: [<tile>, ...], layouts: { "12"?, "8"?, "6"?, "4"?: [{ tile, x, y, size }, ...] } }`, or `null` while they have arranged nothing: the tiles they took off, which stay off, and what they arranged at each width, a tile being `project:<id>` or `widget:<plugin>:<widget>`; `PATCH /api/v1/me` with `home` keeps it. A width nobody arranged, when another was, reads the same order packed from the top, each tile at the size kept at the other width where this grid has it, else at the size it starts at.
|
|
430
430
|
|
|
431
431
|
Edit layout opens nothing on the page. A tile is taken in hand with the mouse, or with a finger that rests on it a moment first, and put down on any cell; empty cells stay empty. Where it would land shows the tile, faint, and those in the way slide aside as it comes, the nearest first. On a tile of its own shape, the tiles of that shape between the two places each move one place towards the one it left; a smaller tile gives way to the nearest room, and a larger one stays, the tile landing beside it. The arrow keys move the tile with the focus a cell, and Delete takes it off. Each tile carries the way off the page and the sizes it comes in, what was taken off is listed to add back, Done keeps it all and Cancel lets it go. A tile the person may no longer see, for a role gone or a plugin disabled, is out of sight and comes back where it stood.
|
|
432
432
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillcdn/console",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "What a custom SkillCDN console is built from: the API client and schemas, the components, the composition of the default console, and the console command agents work the board with.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/skillcdn/console#readme",
|
|
@@ -5,7 +5,7 @@ license: MIT
|
|
|
5
5
|
compatibility: A shell with Node.js 24 or newer, npm and git, and an agent that reads and writes files. For running the plugin on a local console, Docker for the database and a checkout of the console's repository, where signing in needs a GitHub OAuth app of the person's own, as the console's README says. The console command is optional, for running the plugin's commands as an agent would. No key of the agent's own is needed, and it never sees a token.
|
|
6
6
|
metadata:
|
|
7
7
|
author: skillcdn
|
|
8
|
-
version: "1.
|
|
8
|
+
version: "1.11"
|
|
9
9
|
skillcdn:
|
|
10
10
|
translations:
|
|
11
11
|
ko:
|
|
@@ -79,7 +79,7 @@ Produces the **design**: one table, a row per thing the feature does, saying who
|
|
|
79
79
|
| An outside service calls in | An **endpoint** (`endpoints`): a `person` endpoint for whoever holds a role, a `webhook` for nobody, verified with `ctx.secrets.verify` against a secret setting. |
|
|
80
80
|
| The plugin must call out | `ctx.fetch` to a host the manifest names (`outbound:<host>`), with `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS`, the secrets put in by the console from `secret` settings (`secret` or `secrets`, each `as` a header, `bearer`, a query parameter, `basic` or `body:<field>`), never read by the plugin, nor in an answer that sends them back; what an answer gives back that is secret, the tokens of an exchange, sealed by the console into `secret` settings with `seal` before the plugin reads the answer, with their expiry, the answer's `sealed` saying what became of each (a token endpoint is asked for JSON, since the body of an answer that is no JSON is withheld), and sealed again by a job that reads `ctx.secrets.status(name)`; a token per installation of a service, one for each workspace an app is installed in, a `secret` setting declared `keyed: { max }`, sealed under the key the same answer names (`seal: { <setting>: { path, key: "$.team.id" } }`), put in by its key (`secret: { name, key, as }`), listed with `ctx.secrets.keys(name)`, forgotten with `forget(name, key)` when the installation is gone, and an upgrade's `move(name, key)` keeping the one value of before under a key ([ADR-0111](/docs/adr/0111-a-secret-setting-may-keep-one-value-per-key.md)); a callback the service is to call is `ctx.endpoints.url(name)`, the full address of one of the plugin's endpoints, and a link back to the console starts from `ctx.console.workspace().url`. |
|
|
81
81
|
| It acts for a person who did something elsewhere, or reads another plugin as itself | `people:act`, then `ctx.plugins.get(key).for(personId)` for the other plugin's api as the person, or `ctx.console.decisions.answer(id, answer, { for })` for a decision the person answered elsewhere, one on their own plate (addressed to them, or a plugin's addressed to someone they manage): the person's standing as a member decides, never their administration, and the record is theirs through the plugin. A role of another plugin, asked in the manifest's `grants` with why, is held as itself from a job or a hook, with `ctx.plugin.grants` saying what was granted ([ADR-0072](/docs/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)). |
|
|
82
|
-
| People look at it, or fill a form (a calendar starts its week on `frame.context.workspace.firstDay`, the day the workspace's setting says, and reads `timeZone` beside it; faces come from `frame.people.picture(id)`, since a frame loads no image from elsewhere) | A **page** (level `workspace` or `project`) or a **widget** on the front page, which declares the `sizes` it comes in, at least one of them no wider than four cells, which is all a phone has (`small` 2×2, `medium` 4×2, `large` 4×4, `wide` 8×2, `full` 8×4, square cells of the page's grid) and lays itself out for the one it has (`frame.context.size`, `frame.onSize`), since the person arranges the page ([ADR-0061](/docs/adr/0061-the-front-page-is-one-grid-of-tiles-a-person-arranges-by-hand.md)): it shows records and calls commands and queries through the bridge; the logic stays in the server module, so that the command line and the pages do the same thing. |
|
|
82
|
+
| People look at it, or fill a form (a calendar starts its week on `frame.context.workspace.firstDay`, the day the workspace's setting says, and reads `timeZone` beside it; faces come from `frame.people.picture(id)`, since a frame loads no image from elsewhere) | A **page** (level `workspace` or `project`) or a **widget** on the front page, which declares the `sizes` it comes in, at least one of them no wider than four cells, which is all a phone has (`small` 2×2, `medium` 4×2, `large` 4×4, `wide` 8×2, `full` 8×4, square cells of the page's grid), is first seen at its `defaultSize`, which the console never enlarges ([ADR-0147](/docs/adr/0147-the-page-nobody-arranged-stands-as-arranging-shows-it-and-no-size-is-chosen-for-a-person.md)), and lays itself out for the one it has (`frame.context.size`, `frame.onSize`), since the person arranges the page ([ADR-0061](/docs/adr/0061-the-front-page-is-one-grid-of-tiles-a-person-arranges-by-hand.md)): it shows records and calls commands and queries through the bridge; the logic stays in the server module, so that the command line and the pages do the same thing. |
|
|
83
83
|
| An agent must know how | A **skill** in the package, one per kind of work, naming the commands as `console plugin <key> <command>`, with the rules of that work; `SKILLCDN.md` at the root. The agent note of the manifest is the one line that sends an agent to them. |
|
|
84
84
|
|
|
85
85
|
Then the data. Records, unless the feature needs what records do not give: joins across many collections, more rows than a plugin's records may hold, or figures beyond counting, summing, the least and the most; then `storage:sql`, a schema and a role of the plugin's own with migrations under `migrations/`, which needs the deployment's database user to hold `CREATEROLE` and to own the database, closes the console's schemas to every other role not granted them by name, and is said in the hand-over. The role reaches its own schema alone: a statement that names a table of the console's is refused. Records are the default: the console keeps them with versions, files, links, search and aggregates, exports and purges them, and shows them to people by role; a schema is the plugin's to keep.
|
|
@@ -5,7 +5,7 @@ license: MIT
|
|
|
5
5
|
compatibility: Needs the console command (npm install -g @skillcdn/console, Node.js 24 or newer). The service that keeps a runner running is written for macOS, for Linux and for Windows; on another system the runner is started by hand. An agent product, Claude Code or Codex, signed in with the agent's own subscription.
|
|
6
6
|
metadata:
|
|
7
7
|
author: skillcdn
|
|
8
|
-
version: "1.
|
|
8
|
+
version: "1.21"
|
|
9
9
|
skillcdn:
|
|
10
10
|
translations:
|
|
11
11
|
ko:
|
|
@@ -61,7 +61,7 @@ Your first wake is your onboarding task, "Set up @<handle>". Take it and work it
|
|
|
61
61
|
- **Sign in at pages in the machine's own browser,** with a browser tool of your product that attaches to it: a sign-in stays there from one session to the next. For Claude Code that is Google Chrome with the Claude in Chrome extension, turned on by `"browser": "chrome"` in `runner.json`. Where a sign-in wants a person, a code sent to a phone or a picture to solve, ask for a person to sign in inside your session, as a decision or at the messenger, and say which service and which account.
|
|
62
62
|
- **A secret goes from where it is made into your store, and nowhere else.** `console secret <name> --set` reads it from a pipe: generate a password in the shell, or copy a token with a key press in the page, and pipe the clipboard in (`pbpaste | console secret <name> --set` on a Mac), then empty the clipboard. Never print one, and never read it off the screen. A page's own "Copy" button may not reach the clipboard: select the field and copy with the keys. The command says when a value does not look like what its name holds; a token whose value was lost is regenerated where it was made, not deleted. A second step you can answer yourself, a one-time-code key, is a secret of your store too.
|
|
63
63
|
- **Your desk is a repository at your git host.** Keep the token that reads and writes it as `git.token`, make the repository, private, and push. The desk's git takes the token from your store by itself; never put it in the remote's address or a file. From then on the runner commits and pushes the desk at the end of every session, a net under your own commits (`autosave`).
|
|
64
|
-
- **Your profiles carry your name and your role,** as any member's do, and your picture (`console agent <handle> --avatar <file>` writes it)
|
|
64
|
+
- **Your profiles carry your name and your role,** as any member's do, and your picture (`console agent <handle> --avatar <file>` writes it) ([ADR-0143](/docs/adr/0143-an-agent-accounts-profiles-say-its-name-and-its-role.md)).
|
|
65
65
|
- **Be woken by the messenger.** Add its own MCP server to your product, for reading and writing there. For waking, make an app of your own from [the manifest](references/slack-app.md), keep its app-level token as `slack.app_token`, and add `"slack"` to `wake` in `runner.json`. The runner takes the change once your turn is over; `console agent <handle>` then says the source is connected. A direct message and a mention of you reach you as wakes; answer a direct message in the conversation, and in its thread only where it was written in one.
|
|
66
66
|
- **Record the accounts you hold elsewhere,** what you are called there and never a secret: `console agent <handle> --account <service>=<name>`.
|
|
67
67
|
|
package/src/components/home.tsx
CHANGED
|
@@ -14,11 +14,7 @@ import { daysBetween, today } from "../dates.js";
|
|
|
14
14
|
import {
|
|
15
15
|
added,
|
|
16
16
|
arranged,
|
|
17
|
-
COMPOSED_HOME,
|
|
18
|
-
type ComposedTile,
|
|
19
17
|
columnsFor,
|
|
20
|
-
composed,
|
|
21
|
-
composedRows,
|
|
22
18
|
footprintOf,
|
|
23
19
|
GLANCE_REM,
|
|
24
20
|
GLANCE_ROOM_GUESS,
|
|
@@ -33,14 +29,14 @@ import {
|
|
|
33
29
|
homeWith,
|
|
34
30
|
isGlanceSize,
|
|
35
31
|
moved,
|
|
36
|
-
nobodyArranged,
|
|
37
32
|
type PlacedTile,
|
|
38
33
|
resized,
|
|
39
34
|
rowsOf,
|
|
40
35
|
sameArrangement,
|
|
41
36
|
sizesAt,
|
|
42
|
-
|
|
37
|
+
standsUnarranged,
|
|
43
38
|
tidied,
|
|
39
|
+
UNARRANGED_HOME,
|
|
44
40
|
waitToGiveWay,
|
|
45
41
|
} from "../home-tiles.js";
|
|
46
42
|
import { useWords } from "../i18n/index.js";
|
|
@@ -67,7 +63,6 @@ import { Badge, Button, Callout, cx, Day, DueBadge, ProgressBar, Workers } from
|
|
|
67
63
|
const SPARE_ROWS = 2;
|
|
68
64
|
|
|
69
65
|
const NONE: readonly string[] = [];
|
|
70
|
-
const NOT_PLACED: readonly PlacedTile[] = [];
|
|
71
66
|
|
|
72
67
|
/**
|
|
73
68
|
* What a project's tile at a glance reads of its board (ADR-0105): the one answer of
|
|
@@ -533,13 +528,10 @@ export function HomeGrid(props: HomeGridProps) {
|
|
|
533
528
|
const [draft, setDraft] = useState<RestHome | null>(null);
|
|
534
529
|
const working = draft ?? home;
|
|
535
530
|
const hidden = working?.hidden ?? NONE;
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
const placed = useMemo(
|
|
540
|
-
() => (!editing && nobodyArranged(working) ? NOT_PLACED : arranged(tiles, working, columns)),
|
|
541
|
-
[editing, tiles, working, columns],
|
|
542
|
-
);
|
|
531
|
+
// The page stands on the same cells whether it is looked at or arranged (ADR-0147), so that
|
|
532
|
+
// arranging starts from what the person saw and Done keeps what they see: worked out once a
|
|
533
|
+
// render, not once a pointer's move.
|
|
534
|
+
const placed = useMemo(() => arranged(tiles, working, columns), [tiles, working, columns]);
|
|
543
535
|
const [drag, setDrag] = useState<Drag | null>(null);
|
|
544
536
|
const { busy, error, act } = useAction();
|
|
545
537
|
/** The tile in hand, once it has come loose; nothing while one is merely pressed. */
|
|
@@ -756,10 +748,10 @@ export function HomeGrid(props: HomeGridProps) {
|
|
|
756
748
|
setDraft(null);
|
|
757
749
|
props.onDone();
|
|
758
750
|
};
|
|
759
|
-
/** The page as
|
|
760
|
-
const reset = () => setDraft(
|
|
761
|
-
// The page closed up (ADR-
|
|
762
|
-
//
|
|
751
|
+
/** The page as nobody arranged it, every tile back on it: kept by Done like any change, let go by Cancel. */
|
|
752
|
+
const reset = () => setDraft(UNARRANGED_HOME);
|
|
753
|
+
// The page closed up (ADR-0147), worked out while it is arranged alone: the tiles moved up into
|
|
754
|
+
// the gaps at the sizes they have, the way to it offered only where it would move something.
|
|
763
755
|
const closed = useMemo(
|
|
764
756
|
() => (editing ? tidied(placed, columns) : placed),
|
|
765
757
|
[editing, placed, columns],
|
|
@@ -770,16 +762,7 @@ export function HomeGrid(props: HomeGridProps) {
|
|
|
770
762
|
tile.kind === "project" ? tile.project.name : nameOf(tile.widget.name);
|
|
771
763
|
// Moved in the page, a frame would load again: the tiles keep the order they came in for as
|
|
772
764
|
// long as the page is open, and each stands where its style says.
|
|
773
|
-
|
|
774
|
-
// it puts the same tiles on the grid's cells, closed up, where they move from (ADR-0139).
|
|
775
|
-
const composing = !editing && nobodyArranged(working);
|
|
776
|
-
const boxes: readonly ComposedTile[] = useMemo(
|
|
777
|
-
() =>
|
|
778
|
-
composing
|
|
779
|
-
? composed(tiles, working, columns)
|
|
780
|
-
: shown.map((tile) => ({ ...tile, ...footprintOf(tile.size, columns) })),
|
|
781
|
-
[composing, tiles, working, columns, shown],
|
|
782
|
-
);
|
|
765
|
+
const boxes = shown.map((tile) => ({ ...tile, ...footprintOf(tile.size, columns) }));
|
|
783
766
|
const order = useRef<readonly string[]>(NONE);
|
|
784
767
|
const inOrder = [...boxes].sort((a, b) => a.y - b.y || a.x - b.x).map((tile) => tile.tile.id);
|
|
785
768
|
order.current = [
|
|
@@ -793,9 +776,7 @@ export function HomeGrid(props: HomeGridProps) {
|
|
|
793
776
|
? tiles.filter((tile) => !shown.some((candidate) => candidate.tile.id === tile.id))
|
|
794
777
|
: [];
|
|
795
778
|
const slot = dragging === null ? undefined : shown.find((tile) => tile.tile.id === dragging.id);
|
|
796
|
-
const rows =
|
|
797
|
-
? composedRows(boxes)
|
|
798
|
-
: rowsOf(shown, columns) + (editing ? SPARE_ROWS : 0);
|
|
779
|
+
const rows = rowsOf(shown, columns) + (editing ? SPARE_ROWS : 0);
|
|
799
780
|
// The boards of the projects at a glance are read by whoever composes the page, once for each
|
|
800
781
|
// set of them: the ids in order say when it changed.
|
|
801
782
|
const glancing = glanceProjects(boxes);
|
|
@@ -821,7 +802,7 @@ export function HomeGrid(props: HomeGridProps) {
|
|
|
821
802
|
<Button
|
|
822
803
|
size="sm"
|
|
823
804
|
variant="ghost"
|
|
824
|
-
disabled={busy ||
|
|
805
|
+
disabled={busy || standsUnarranged(working)}
|
|
825
806
|
onClick={reset}
|
|
826
807
|
>
|
|
827
808
|
{words.reset}
|
|
@@ -864,8 +845,6 @@ export function HomeGrid(props: HomeGridProps) {
|
|
|
864
845
|
))}
|
|
865
846
|
</div>
|
|
866
847
|
)}
|
|
867
|
-
{/* What stands on the page, composed or arranged: the tiles drawn, not the arranged ones,
|
|
868
|
-
which are not worked out while the page stands composed. */}
|
|
869
848
|
{boxes.length === 0 && !editing && (props.empty ?? null)}
|
|
870
849
|
<ul
|
|
871
850
|
ref={grid}
|