@skillcdn/console 0.1.14 → 0.1.16
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 +5 -4
- package/SKILLCDN.md +2 -0
- package/dist/agent-name.d.ts +3 -0
- package/dist/agent-name.d.ts.map +1 -0
- package/dist/agent-name.js +9 -0
- package/dist/agent-name.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 +225 -24
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +14 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +59 -10
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +28 -12
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +5 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/client.d.ts +20 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +11 -2
- package/dist/client.js.map +1 -1
- package/dist/components/calendar.d.ts +35 -2
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +80 -31
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/connect.d.ts +4 -1
- package/dist/components/connect.d.ts.map +1 -1
- package/dist/components/connect.js +7 -3
- package/dist/components/connect.js.map +1 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +2 -2
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/documents.d.ts +5 -0
- package/dist/components/documents.d.ts.map +1 -1
- package/dist/components/documents.js +3 -2
- package/dist/components/documents.js.map +1 -1
- package/dist/components/event-feed.d.ts +1 -1
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +10 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/people.d.ts +24 -1
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +35 -3
- package/dist/components/people.js.map +1 -1
- package/dist/components/projects.d.ts +10 -1
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +8 -5
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +40 -0
- package/dist/components/rules.d.ts.map +1 -0
- package/dist/components/rules.js +46 -0
- package/dist/components/rules.js.map +1 -0
- package/dist/components/runs.d.ts +1 -1
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +2 -1
- package/dist/components/runs.js.map +1 -1
- package/dist/components/skills.d.ts.map +1 -1
- package/dist/components/skills.js +5 -1
- package/dist/components/skills.js.map +1 -1
- package/dist/components/task-form.d.ts.map +1 -1
- package/dist/components/task-form.js +1 -1
- package/dist/components/task-form.js.map +1 -1
- package/dist/components/tokens.d.ts.map +1 -1
- package/dist/components/tokens.js +2 -9
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +7 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +13 -0
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.d.ts +5 -1
- package/dist/components/work.d.ts.map +1 -1
- package/dist/components/work.js +1 -1
- package/dist/components/work.js.map +1 -1
- package/dist/console.css +263 -17
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +197 -43
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +19 -2
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +27 -1
- package/dist/data.js.map +1 -1
- package/dist/i18n/en.d.ts +84 -9
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +84 -13
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +84 -13
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +4 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +4 -0
- package/dist/limits.js.map +1 -1
- package/dist/router.d.ts +30 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +50 -10
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +14 -4
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +17 -2
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +28 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +102 -0
- package/dist/rules.js.map +1 -0
- package/dist/schemas.d.ts +652 -4
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +96 -6
- package/dist/schemas.js.map +1 -1
- package/dist/vocabulary.d.ts +21 -1
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +21 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +13 -9
- package/docs/specs/rest.md +33 -9
- package/package.json +1 -1
- package/skills/building-a-console/SKILL.md +1 -1
- package/skills/deploying-a-console/SKILL.md +5 -5
- package/skills/deploying-a-console/assets/secrets.example.json +2 -1
- package/skills/deploying-a-console/references/access.md +10 -6
- package/skills/deploying-a-console/references/resources.md +10 -7
- package/skills/working-the-board/SKILL.md +10 -9
- package/skills/working-the-board/references/project-rules.md +36 -0
- package/src/agent-name.ts +9 -0
- package/src/api.ts +37 -0
- package/src/cli/cli.ts +264 -26
- package/src/cli/format.ts +74 -10
- package/src/cli/help.ts +31 -11
- package/src/cli/main.ts +5 -0
- package/src/client.ts +47 -1
- package/src/components/calendar.tsx +252 -51
- package/src/components/connect.tsx +12 -6
- package/src/components/decision-list.tsx +2 -1
- package/src/components/documents.tsx +7 -3
- package/src/components/event-feed.tsx +16 -3
- package/src/components/people.tsx +244 -35
- package/src/components/projects.tsx +37 -14
- package/src/components/rules.tsx +167 -0
- package/src/components/runs.tsx +4 -2
- package/src/components/skills.tsx +22 -10
- package/src/components/task-form.tsx +1 -0
- package/src/components/tokens.tsx +2 -14
- package/src/components/ui.tsx +25 -2
- package/src/components/work.tsx +34 -28
- package/src/console.tsx +524 -45
- package/src/data.ts +52 -2
- package/src/i18n/en.ts +94 -14
- package/src/i18n/ko.ts +90 -14
- package/src/index.ts +16 -1
- package/src/limits.ts +4 -0
- package/src/router.ts +67 -12
- package/src/routes.ts +23 -3
- package/src/rules.ts +109 -0
- package/src/schemas.ts +121 -4
- package/src/styles/console.css +263 -17
- package/src/vocabulary.ts +30 -0
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ const { items } = await client.tasks({ state: "ready" });
|
|
|
33
33
|
- **The bounds** every input is held to (`MAX_TITLE_LENGTH`, `MAX_BODY_LENGTH`, `MAX_OPTIONS`, ...), so that a page can say so before a request is made.
|
|
34
34
|
- **The routes:** `REST_ROUTES` (the workspace's resources), `AUTH_ROUTES`, and the helpers that build a path (`projectPath(key, collection, id)` for everything under a project, `projectIconPath(key, icon)` for a project's image, `restPath`, `loginPath`, `signInPath`). The API itself is described in [docs/specs/rest.md](https://github.com/skillcdn/console/blob/main/docs/specs/rest.md).
|
|
35
35
|
- **The schemas,** in the mini build of zod, which runs in a browser: what the server answers (`restProjectSchema`, `restMemberSchema`, `restTaskSchema`, `restDecisionSchema`, `restEventSchema`, `restMeSchema`, ...) and what it is sent (`restProjectInputSchema`, `restTaskInputSchema`, `restTaskPatchSchema`, `restDecisionInputSchema`, `restAnswerInputSchema`, ...). Absent values are `null` on the wire, never missing keys. The server validates with the input schemas and is tested against the others.
|
|
36
|
-
- **The client:** `createClient({ baseUrl, fetch })` answers typed values parsed with those schemas, and throws an `ApiError` with the server's stable `code` (or `network`, `invalid_response`) for anything else. It takes a `fetch` and reads nothing else. With `token`, a token a person made on their Agents page, every request carries `Authorization: Bearer` and no cookie: how a script or a console of a person's own acts as that person, configuring included (`createProject`, `updatePerson`, a project's `update`, `setIcon`, `addMember`, `updateMember` and `removeMember`, `createCategory`, `updateCategory` and `removeCategory`), within the person's own roles; only the tokens themselves and the approval of a connection are a session's ([ADR-0021](https://github.com/skillcdn/console/blob/main/docs/adr/0021-a-token-configures-as-its-person-does.md)). The board is a project's: `client.projects()` lists those the person may see, and `client.project(key)` is the client of one, with its tasks, decisions, goals, runs, files, events, skills, documents, settings, members and image (`setIcon`, `removeIcon`). `tasks(filter)` narrows the board (`TaskFilter`: a state, the open ones, a category's key, a goal, an assignee, a day tasks are due by) and pages it (`Page`: `limit` and `offset`; the answer carries `more`), as `decisions(filter)` and `runs(filter)` are paged; a task carries its `category`, `goalId`, its plan (`startsOn`, `dueOn`) and its moments (`startedAt`, `doneAt`). The roadmap is `goals()`, `goal(id)`, `createGoal` and `updateGoal`; the workspace's categories are `client.categories()`, `createCategory`, `updateCategory` and `removeCategory`; `client.work()` is what is on the person's plate across their projects ([ADR-0019](https://github.com/skillcdn/console/blob/main/docs/adr/0019-a-task-is-planned-in-days-the-board-keeps-its-moments-and-goals-and-categories-give-the-work-its-shape.md)). The documents go by path: `documents({ folder })` lists a folder, `documents({ q })` finds pages by their words, `document(path)` reads one with its links both ways and its files, `writeDocument(path, { title, body, baseVersion })` writes a version, `archiveDocument`, `restoreDocument`, `documentVersions`, `documentVersion(path, n)`, `attachFile(path, upload)` and `documentFileUrl(path, id)` do the rest; `updateDecision(id, { outcome })` grows a decision's record. `connect`, `connectRequest`, `approveConnection`, `denyConnection` and `claimConnection` are the two sides of an agent connecting with a code a person approves (ADR-0011), and `personTokens` and `revokePersonToken` an administrator's sight of everyone's agents. An `EventSource` cannot carry a header, so a stream read with a token is a `fetch` of `eventStreamUrl(after)`. `handInFile` sends a file as a form, and `fileUrl` says where its bytes are read back. `events(after, { task })` is everything that happened to one task.
|
|
36
|
+
- **The client:** `createClient({ baseUrl, fetch })` answers typed values parsed with those schemas, and throws an `ApiError` with the server's stable `code` (or `network`, `invalid_response`) for anything else. It takes a `fetch` and reads nothing else. With `token`, a token a person made on their Agents page, every request carries `Authorization: Bearer` and no cookie: how a script or a console of a person's own acts as that person, configuring included (`createProject`, `updatePerson`, a project's `update`, `setIcon`, `addMember`, `updateMember` and `removeMember`, `createCategory`, `updateCategory` and `removeCategory`), within the person's own roles; only the tokens themselves and the approval of a connection are a session's, except that a token gives itself up with `giveUpToken` ([ADR-0021](https://github.com/skillcdn/console/blob/main/docs/adr/0021-a-token-configures-as-its-person-does.md)). The board is a project's: `client.projects()` lists those the person may see, and `client.project(key)` is the client of one, with its tasks, decisions, goals, runs, files, events, skills, documents, settings, members and image (`setIcon`, `removeIcon`). `tasks(filter)` narrows the board (`TaskFilter`: a state, the open ones, a category's key, a goal, an assignee, a day tasks are due by) and pages it (`Page`: `limit` and `offset`; the answer carries `more`), as `decisions(filter)` and `runs(filter)` are paged; a task carries its `category`, `goalId`, its plan (`startsOn`, `dueOn`) and its moments (`startedAt`, `doneAt`). The roadmap is `goals()`, `goal(id)`, `createGoal` and `updateGoal`; the workspace's categories are `client.categories()`, `createCategory`, `updateCategory` and `removeCategory`; `client.work()` is what is on the person's plate across their projects ([ADR-0019](https://github.com/skillcdn/console/blob/main/docs/adr/0019-a-task-is-planned-in-days-the-board-keeps-its-moments-and-goals-and-categories-give-the-work-its-shape.md)). The documents go by path: `documents({ folder })` lists a folder, `documents({ q })` finds pages by their words, `document(path)` reads one with its links both ways and its files, `writeDocument(path, { title, body, baseVersion })` writes a version, `archiveDocument`, `restoreDocument`, `documentVersions`, `documentVersion(path, n)`, `attachFile(path, upload)` and `documentFileUrl(path, id)` do the rest; `updateDecision(id, { outcome })` grows a decision's record. The rules of the board ([ADR-0023](https://github.com/skillcdn/console/blob/main/docs/adr/0023-the-rules-of-a-board-are-pages-the-workspace-and-its-projects-keep-read-first-by-every-agent.md)) are `client.rules()`, `writeRules`, `archiveRules` and `rulesVersions`, for the workspace's, and a project's `rules()`, which answers the workspace's with the project's own; a project's are written as the page `rules`. `REFERENCE_RULES` is what holds where an organization wrote none, and `isReferenceRules` tells it from a text; `fillRules` fills `{language}` (`RULES_LANGUAGE_PLACEHOLDER`) with the name of a person's language, which `languageNameOf` gives from its tag. `agentLabel` is an agent's name before where it runs, what the pages show of "Claude Code on a laptop". `connect`, `connectRequest`, `approveConnection`, `denyConnection` and `claimConnection` are the two sides of an agent connecting with a code a person approves (ADR-0011), and `personTokens` and `revokePersonToken` an administrator's sight of everyone's agents. An `EventSource` cannot carry a header, so a stream read with a token is a `fetch` of `eventStreamUrl(after)`. `handInFile` sends a file as a form, and `fileUrl` says where its bytes are read back. `events(after, { task })` is everything that happened to one task.
|
|
37
37
|
|
|
38
38
|
### The command line
|
|
39
39
|
|
|
@@ -46,6 +46,7 @@ console take 7 # a run begins on task #7 of th
|
|
|
46
46
|
console report "Found the cause: the parser trusts its input."
|
|
47
47
|
console hand-in ./report.md --label "the report" # a file the console keeps, or an https link
|
|
48
48
|
console skills # the project's skills, with the URI to load each by
|
|
49
|
+
console rules # what the organization and the project ask of agents; take prints them with the task
|
|
49
50
|
console ask "Keep the old behaviour?" --option "Keep it" --option "Change it"
|
|
50
51
|
console write notes/parser --title "The parser" --file notes.md # a page of the project's documents, by path
|
|
51
52
|
console doc guides/onboarding # a page in full, with what refers to it
|
|
@@ -55,7 +56,7 @@ console serve dist # a console of your own, built
|
|
|
55
56
|
|
|
56
57
|
- **`console`** is the agent's side of the console ([docs/specs/cli.md](https://github.com/skillcdn/console/blob/main/docs/specs/cli.md)): a thin client of the REST API with no logic of its own, no dependencies beyond the package's, and no cost to an agent until it is used. The package states Node.js 24 as its floor and is tested on it; 22 runs the command today, checked by hand on each release. `console help` says everything an agent needs and `console --version` which version this is; `--json` answers with the console's own JSON; the exit code says whether the console did it (`0`), refused or could not be reached (`1`), did not understand (`2`), or a decision still waits (`3`).
|
|
57
58
|
- **A person signs it in once:** `login` checks the token against the console and keeps it, with the console's address, in `$XDG_CONFIG_HOME/skillcdn-console/credentials.json` (`~/.config` when unset). `CONSOLE_URL` and `CONSOLE_TOKEN` in the environment win over the file, for a hook or a job. A token is never taken on the command line.
|
|
58
|
-
- **Configuring, as the person** ([ADR-0021](https://github.com/skillcdn/console/blob/main/docs/adr/0021-a-token-configures-as-its-person-does.md)): `people`, `person role`, `project new`, `project edit`, `project icon`, `members`, `member add`, `member role`, `member remove`, `category new`, `category edit` and `
|
|
59
|
+
- **Configuring, as the person** ([ADR-0021](https://github.com/skillcdn/console/blob/main/docs/adr/0021-a-token-configures-as-its-person-does.md)): `people`, `person role`, `person add`, `person remove`, `person deactivate`, `person reactivate`, `project new`, `project edit`, `project icon`, `members`, `member add`, `member role`, `member remove`, `category new`, `category edit`, `category remove` and `rules write` do what an administrator or an owner does on the pages, with the same refusals (`auth.forbidden` where the person may not), and the event names the agent beside the person. The tokens themselves have no command but `logout`, which gives the command's own up: they are made and removed on the Agents page, signed in.
|
|
59
60
|
- **The project's documents** are the agent's to read and write: `docs`, `doc`, `write`, `attach`, `archive` and `restore`, by path; a link in a body to a page's path refers to the page.
|
|
60
61
|
- **Every command on the board works in one project:** `--project <key>`, else `CONSOLE_PROJECT`, else what `console use <key>` wrote to `.skillcdn-console.json` in the working directory or one above it, a file meant to be committed. `console projects` lists the projects the person may work in.
|
|
61
62
|
- **`console serve [<dir>] [--port <n>]`** is for a person: it serves [a console of your own](#a-console-of-your-own) from your machine, the build in `<dir>` at `http://127.0.0.1:11197/`, and carries everything under `/api/` to the console the command is signed in to, with your token, which the pages never see ([ADR-0014](https://github.com/skillcdn/console/blob/main/docs/adr/0014-a-persons-own-console-is-served-from-their-machine-by-the-command.md)). The loopback only; a request from another site's page is refused. Without a directory only the API is served, for a development server.
|
|
@@ -73,8 +74,8 @@ createConsole({
|
|
|
73
74
|
}).mount(document.getElementById("root"));
|
|
74
75
|
```
|
|
75
76
|
|
|
76
|
-
- **The components** take their data as props and nothing from the network: `Board` (one column per state, the sooner due first), `TaskCard`, `BoardFilters` with `filterTasks` and `byDue` (the board narrowed by category, goal, person and one's own), `TaskList` (tasks as rows, a page at a time), `TaskView` (one task with its plan, its moments, its decisions and its parts), `TaskForm` (with the `categories` and the `goals` to choose from), `Calendar` and `Workload` with `workloadOf` (a month with each task across its planned days, a bar in a lane of its own, or on its due day, with a legend of the colours of the `categories` given, and who has what; `weekSegments` lays the bars; the composition narrows the page with `BoardFilters` as it does the board, the address carrying the filter with the month), `GoalList`, `GoalView` and `GoalForm` (the roadmap, one goal with its tasks by state, and the way to set one), `WorkList` (a person's own work across projects), `CategoryList` (the categories, with the ways an administrator keeps them), `DecisionList` and `DecisionCard` (the waiting ones as cards, each with the way to answer; the answered ones as the record, `DecisionLog`, a row each, a page at a time), `DecisionForm`, `EventFeed` (a sentence per event, newest first, a page at a time; `describeEvent` makes the sentence), `Shell` (the header with the workspace, the project, the tabs of the pages and the person's menu), `SignIn` (one button per provider the deployment offers), `TokenList`, `TokenForm` and `NewToken` (the agents a person connected, as the tokens they hold, the way to make one by hand, and the one just made with its secret shown once), `ConnectCodeForm`, `ConnectApproval` and `ConnectWords` (an agent connecting with a code: where the code is typed, what asks under it with the way to approve or refuse it, and what to tell the agent; `ConnectPage` composes the first two for a code), `PeopleList` (everyone, with what each is, and the
|
|
77
|
-
- **The composition:** `createConsole(config)` returns `{ App, mount }`. `App` is the whole console as one component; `mount(container)` renders it and returns the way to take it down. `config.baseUrl` is the origin of the API (the page's own when left out), `config.components` the pieces to replace (`ConsoleComponents` names them with the props each takes), `config.languages` the packs the pages speak, `config.brand` the addresses of a symbol and a wordmark to show beside the name (ADR-0013; the default console passes those of `@skillcdn/brand`, the main repository's package of its marks), `config.client` a client of your own, for tests. The SkillCDN name and marks are trademarks of KDX Labs under the main repository's trademark policy, not under this package's MIT license; a custom console brings its own marks through the same slot. A console that holds a token rather than a session (one of your own, served by `console serve`) is told so by the API (`me.agent`, the token's name) and offers nothing a token cannot do: no agents page
|
|
77
|
+
- **The components** take their data as props and nothing from the network: `Board` (one column per state, the sooner due first), `TaskCard`, `BoardFilters` with `filterTasks` and `byDue` (the board narrowed by category, goal, person and one's own), `TaskList` (tasks as rows, a page at a time), `TaskView` (one task with its plan, its moments, its decisions and its parts), `TaskForm` (with the `categories` and the `goals` to choose from), `Calendar` and `Workload` with `workloadOf` (a month with each task across its planned days, a bar in a lane of its own, or on its one day, a due day or a start, the person who has each before its title, with a legend of the colours of the `categories` given, and who has what; `weekSegments` lays the bars; `TaskTip` is the task under the pointer in full, with the facts its page lists, within its item and above or below it as `placeTip` says, where there is more room, its goal named from the `goals` given; the composition narrows the page with `BoardFilters` as it does the board, the address carrying the filter with the month), `GoalList`, `GoalView` and `GoalForm` (the roadmap, one goal with its tasks by state, and the way to set one), `WorkList` (a person's own work across projects), `CategoryList` (the categories, with the ways an administrator keeps them), `DecisionList` and `DecisionCard` (the waiting ones as cards, each with the way to answer; the answered ones as the record, `DecisionLog`, a row each, a page at a time), `DecisionForm`, `EventFeed` (a sentence per event, newest first, a page at a time; `describeEvent` makes the sentence), `Shell` (the header with the workspace, the project, the tabs of the pages and the person's menu), `SignIn` (one button per provider the deployment offers), `TokenList`, `TokenForm` and `NewToken` (the agents a person connected, as the tokens they hold, the way to make one by hand, and the one just made with its secret shown once), `ConnectCodeForm`, `ConnectApproval` and `ConnectWords` (an agent connecting with a code: where the code is typed, what asks under it with the way to approve or refuse it, and what to tell the agent; `ConnectPage` composes the first two for a code), `PeopleList` (everyone in, with what each is and what let them in, the logins let in that nobody signed in with yet, and the deactivated, with the ways for an administrator to change a role, take a person out or back in, and take a listing away) and `ListingForm` (where an administrator lets someone in by login), `ProjectMark` (a project's mark: its own image when it has one, else its symbol on its colour, or the ones chosen from its key and its name; `sm`, `md` or `lg`), `ProjectList`, `ProjectForm` and `MemberList` (the projects a person may see with what they are in each, the way to make or change one, its mark included, with an image chosen for it (`onSubmit` gets the file, or `null` to take the image away), and those listed in a project with the way for an owner to add, change and remove them; `ProjectRoleBadge`, `PROJECT_ROLE_LABELS`, `VISIBILITY_LABELS` and `keyOf` with them), `SkillList` (a project's skills as SkillCDN serves them at its address, each with where a person reads it and what an agent loads it by, and how an agent is connected to it), `RulesView` and `RulesForm` (the rules of the board, ADR-0023: what holds and where it comes from, the console's own, a page written or none, with `{language}` filled with the language the pages speak, folded under its facts where asked, and the ways to write them, put them away and go back to the console's own for whoever may; the form starts from what holds and saves nothing that would change nothing), `FolderView`, `DocumentList`, `DocumentSearch`, `DocumentView`, `DocumentForm`, `DocumentFiles` and `DocumentCrumbs` (a project's documents: a folder's folders and pages, the way to find pages by their words, one page with its versions, what it links to, what refers to it and its files, and the forms to write and attach; `DocsPage` composes them for a path), `RunList` and `RunCard` (an agent's run on a task: what it reported, what it handed in, links and files alike, what it waits for, and when an open one was last heard from; `RunStatusBadge` and `RUN_STATUS_LABELS` with them, and `fileHref` for where a file is read), and `Markdown`, which renders what people and agents wrote as elements, never as HTML, with links to the web only and pictures over https only, and, given `docHref`, a link to a page's path as a link to the page. `DecisionCard` reads as a record, with the context, the rationale and what followed, which `onUpdate` lets a person write. The small blocks (`Button`, `CopyButton` (a text put on the clipboard), `Badge`, `Avatar` (`xs` to `lg`), `PersonChip` with `personName` (a person by the name the host gives, the login where there is none), `Callout`, `EmptyState`, `Spinner`, `Time`, `Day`, `CategoryBadge`, `DueBadge`, `GoalStateBadge`, `ProgressBar`, and `ShowMore` with `usePaged` and `PAGE_SIZE`, a long list a page at a time), the words of the vocabulary (`STATE_LABELS`, `PRIORITY_LABELS`, `ROLE_LABELS`, with `RoleBadge`) and the day helpers (`today`, `addDays`, `daysBetween`, `monthGrid`, `formatDay`, `formatMonth` and the rest, days being the strings the API spells them as) are exported too.
|
|
78
|
+
- **The composition:** `createConsole(config)` returns `{ App, mount }`. `App` is the whole console as one component; `mount(container)` renders it and returns the way to take it down. `config.baseUrl` is the origin of the API (the page's own when left out), `config.components` the pieces to replace (`ConsoleComponents` names them with the props each takes), `config.languages` the packs the pages speak, `config.brand` the addresses of a symbol and a wordmark to show beside the name (ADR-0013; the default console passes those of `@skillcdn/brand`, the main repository's package of its marks), `config.client` a client of your own, for tests. The SkillCDN name and marks are trademarks of KDX Labs under the main repository's trademark policy, not under this package's MIT license; a custom console brings its own marks through the same slot. A console that holds a token rather than a session (one of your own, served by `console serve`) is told so by the API (`me.agent`, the token's name) and offers nothing a token cannot do: no agents page and no sign-out, since the tokens themselves are a person's own doing; everything else, configuring included, it does on the token as the person (ADR-0021), and it keeps the choice of language on the person. The pages route in the browser and every form has an address (ADR-0010): the projects at `/`, the person's own work at `/work`, the workspace's settings at `/settings` (its rules, its categories at `/categories`, where its skills come from), a project's pages under `/projects/<key>` (its roadmap, calendar and settings among them), a task by its number, a goal and a decision by their ids, a document by its path, and the query for how a page is shown, the board's filters, the calendar's month, the week of the person's work and the settings' forms among it (`matchRoute(pathname, search)`, `PATHS`, `projectHref`, `boardHref`, `taskHref`, `goalHref`, `calendarHref`, `workHref`, `personWorkHref`, `decisionHref`, `docHref`, `settingsHref`, `projectSettingsHref`, `newTaskHref`, `newGoalHref`, `newDecisionHref`, and `movedFrom` for the addresses of before); every link to one of them is followed in place, with one history entry per step; the workspace is loaded once and the project the page is on whole, kept current by the project's stream (`useConsoleData(client, projectKey)`, for a composition of your own).
|
|
78
79
|
- **Pages of your own:** `config.pages` adds tabs beside the console's. Each is a `CustomPage`: a `key` (what the address says: `/pages/<key>` on the workspace, `/projects/<project>/pages/<key>` on a project), a `label` (one word, or a word by language tag with `en` standing in), a `level` (`workspace`, or `project` for a tab on every project), `wide` for a page that takes the whole window, and `render(context)`, which gets what the default pages get: the `data` of `useConsoleData` with its actions, the `project` the page is on, the `client`, the `navigation`, the `words` and the `language`. `customPageHref` names the address and `customPageLabel` the tab's word. A page that is not among the pages given shows nothing there.
|
|
79
80
|
- **The languages:** every word the pages show is in a pack (`Messages`, keyed as `en` is), English and Korean ship (`ENGLISH`, `KOREAN`, `DEFAULT_LANGUAGES`), and a component takes its words from the language above it (`useWords`, `useLanguage`, `LanguageContext`), English where there is none. The person's choice is kept on them (`client.updateMe({ language })`) and the browser's languages decide before one (`chooseLanguage`, `packFor`). `createConsole({ languages })` replaces the packs the default console speaks, so that a custom console adds a language of its own; a pack is complete by type.
|
|
80
81
|
- **The styles** are one file, `@skillcdn/console/console.css`: the tokens (`--sc-*`), a small reset, and one class per block, all prefixed `sc-`. The look is SkillCDN's own: dark only, one accent, the page a dark field with a light in it (the shell, `sc-shell`, paints it) and the surfaces panes of glass over it (`--sc-glass-*`). Re-skinning starts and mostly ends with the tokens; a custom console that wants a flat page sets the field's colours to one and the glass to none. A stylesheet of your own, loaded after this one, sets them on `:root`: the surfaces (`--sc-color-bg`, `--sc-color-bg-subtle`, `--sc-color-bg-inset`, `--sc-color-bg-raised`, the borders), the text (`--sc-color-text`, `--sc-color-text-muted`, `--sc-color-text-faint`), the accent and the point (`--sc-color-accent*`, `--sc-color-point*`), the tones (`--sc-color-success`, `--sc-color-warning`, `--sc-color-danger`, each with a `-subtle`), the field and its light (`--sc-color-sky`, `--sc-color-far*`, `--sc-color-light-*`, `--sc-color-vignette`), the glass (`--sc-color-glass*`, `--sc-color-sheet*`, `--sc-color-field`), the fonts (`--sc-font-sans`, `--sc-font-mono`) and the radii (`--sc-radius-*`); the categories' colours are `--sc-category-line` and `--sc-category-fill` under `.sc-category-<name>`. Beyond the tokens, every block has its class (`sc-panel`, `sc-card`, `sc-column`, `sc-header`, ...), which a stylesheet of your own may style; the classes are part of the package's surface, and a change to one is in the changelog. The faces are the page's to provide: the stylesheet names Pretendard first for the Korean and falls through to the system's faces, and the default console loads it; a custom console loads what it likes.
|
package/SKILLCDN.md
CHANGED
|
@@ -32,4 +32,6 @@ These hold for an agent working the board, building a console or deploying one a
|
|
|
32
32
|
|
|
33
33
|
**Speak the person's language.** What is written for people, in chat, in a report, a question, a summary or a page, is in the language the person or the task uses; code, identifiers, commit messages and the skills themselves stay in English.
|
|
34
34
|
|
|
35
|
+
**The board's rules come first.** A console's rules, the workspace's and the project's (`console rules`), say what its organization asks of agents, and hold over these skills' defaults where they differ, within what the specifications allow.
|
|
36
|
+
|
|
35
37
|
**The specifications win.** Where a skill and `console help`, the package's README, its types or a specification differ, the latter are right and the skill is behind: say so, and go by them.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-name.d.ts","sourceRoot":"","sources":["../src/agent-name.ts"],"names":[],"mappings":"AAIA,gIAAgI;AAChI,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// What an agent is called: what it said of itself when it connected, which the person approving
|
|
2
|
+
// kept or changed, and what a run was told with `--agent`. The command proposes "<agent> on
|
|
3
|
+
// <machine>", so the pages say the agent and keep the machine for a hover.
|
|
4
|
+
/** The agent's name before where it runs: "Claude Code" of "Claude Code on a laptop"; the whole name when it names no place. */
|
|
5
|
+
export function agentLabel(name) {
|
|
6
|
+
const at = name.indexOf(" on ");
|
|
7
|
+
return at > 0 && at + 4 < name.length ? name.slice(0, at) : name;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=agent-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-name.js","sourceRoot":"","sources":["../src/agent-name.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,4FAA4F;AAC5F,2EAA2E;AAE3E,gIAAgI;AAChI,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACnE,CAAC"}
|
package/dist/api.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
export { agentLabel } from "./agent-name.js";
|
|
1
2
|
export { ApiError, type ClientOptions, type ConsoleClient, createClient, type DocumentFilter, type EventFilter, type FetchLike, type FileUpload, type Page, type ProjectClient, type TaskFilter, } from "./client.js";
|
|
2
3
|
export { CONNECT_CODE_ALPHABET, CONNECT_CODE_LENGTH, isConnectCode, normalizeConnectCode, } from "./connect.js";
|
|
3
4
|
export { DOCUMENT_PATH, documentPathsIn, folderOf, foldersAbove, isDocumentPath, isFolderPath, nameOf, } from "./documents.js";
|
|
4
|
-
export { DEFAULT_PAGE_LIMIT, DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_CATEGORIES, MAX_CATEGORY_KEY_LENGTH, MAX_CATEGORY_NAME_LENGTH, MAX_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_DOCUMENT_SEGMENT_LENGTH, MAX_FILE_BYTES, MAX_FILE_NAME_LENGTH, MAX_FILES_PER_DOCUMENT, MAX_LANGUAGE_TAG_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_PROJECT_DESCRIPTION_LENGTH, MAX_PROJECT_ICON_BYTES, MAX_PROJECT_KEY_LENGTH, MAX_PROJECT_NAME_LENGTH, MAX_PROJECT_SYMBOL_LENGTH, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_SEARCH_LENGTH, MAX_SECRET_LENGTH, MAX_SKILLS_ADDRESS_LENGTH, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_TOKENS_PER_PERSON, MAX_URL_LENGTH, MAX_VERSIONS_PER_DOCUMENT, MIN_OPTIONS, } from "./limits.js";
|
|
5
|
+
export { DEFAULT_PAGE_LIMIT, DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_CATEGORIES, MAX_CATEGORY_KEY_LENGTH, MAX_CATEGORY_NAME_LENGTH, MAX_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_DOCUMENT_SEGMENT_LENGTH, MAX_FILE_BYTES, MAX_FILE_NAME_LENGTH, MAX_FILES_PER_DOCUMENT, MAX_LANGUAGE_TAG_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_LOGIN_LENGTH, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_PROJECT_DESCRIPTION_LENGTH, MAX_PROJECT_ICON_BYTES, MAX_PROJECT_KEY_LENGTH, MAX_PROJECT_NAME_LENGTH, MAX_PROJECT_SYMBOL_LENGTH, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_RULES_LENGTH, MAX_SEARCH_LENGTH, MAX_SECRET_LENGTH, MAX_SKILLS_ADDRESS_LENGTH, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_TOKENS_PER_PERSON, MAX_URL_LENGTH, MAX_VERSIONS_PER_DOCUMENT, MIN_OPTIONS, } from "./limits.js";
|
|
5
6
|
export { projectColorOf, projectSymbolOf } from "./marks.js";
|
|
6
|
-
export { AUTH_ROUTES, CLAIM_PATH, categoryPath, connectPath, isSignInFailure, loginPath, PROJECT_COLLECTIONS, type ProjectCollection, personTokensPath, projectIconPath, projectPath, REST_ROUTES, RETURN_TO_PARAM, restPath, SIGN_IN_FAILURES, SIGN_IN_PARAM, type SignInFailure, signInPath, } from "./routes.js";
|
|
7
|
-
export {
|
|
7
|
+
export { AUTH_ROUTES, CLAIM_PATH, categoryPath, connectPath, isSignInFailure, loginPath, PROJECT_COLLECTIONS, type ProjectCollection, personTokensPath, personWorkPath, projectIconPath, projectPath, REST_ROUTES, RETURN_TO_PARAM, restPath, rulesPath, SIGN_IN_FAILURES, SIGN_IN_PARAM, type SignInFailure, signInPath, } from "./routes.js";
|
|
8
|
+
export { fillRules, isReferenceRules, languageNameOf, PROJECT_RULES_TEMPLATE, REFERENCE_RULES, RULES_LANGUAGE_PLACEHOLDER, RULES_PATH, RULES_TITLE, } from "./rules.js";
|
|
9
|
+
export { hostOfLogin, isLoginAt, type RestAnswerInput, type RestArtifact, type RestArtifactInput, type RestBacklink, type RestCategories, type RestCategory, type RestCategoryInput, type RestCategoryPatch, type RestClaim, type RestClaimInput, type RestConnectInput, type RestConnection, type RestConnectRequest, type RestDecision, type RestDecisionInput, type RestDecisionOption, type RestDecisionPatch, type RestDecisions, type RestDocument, type RestDocumentFile, type RestDocumentInput, type RestDocumentLink, type RestDocumentSummary, type RestDocuments, type RestError, type RestEvent, type RestEventData, type RestEvents, type RestFile, type RestFileInput, type RestGoal, type RestGoalInput, type RestGoalPatch, type RestGoals, type RestListing, type RestListingInput, type RestMe, type RestMember, type RestMemberInput, type RestMemberPatch, type RestMembers, type RestMePatch, type RestOrganization, type RestPeople, type RestPerson, type RestPersonPatch, type RestPersonWork, type RestProject, type RestProjectIcon, type RestProjectInput, type RestProjectPatch, type RestProjectRules, type RestProjects, type RestProvider, type RestReport, type RestReportInput, type RestRules, type RestRulesInput, type RestRun, type RestRunEndInput, type RestRunInput, type RestRuns, type RestSkill, type RestSkills, type RestTask, type RestTaskCounts, type RestTaskInput, type RestTaskLink, type RestTaskPatch, type RestTasks, type RestToken, type RestTokenCreated, type RestTokenInput, type RestTokens, type RestVersion, type RestVersionSummary, type RestVersions, type RestWork, restAnswerInputSchema, restArtifactInputSchema, restArtifactSchema, restBacklinkSchema, restCategoriesSchema, restCategoryInputSchema, restCategoryPatchSchema, restCategorySchema, restClaimInputSchema, restClaimSchema, restConnectInputSchema, restConnectionSchema, restConnectRequestSchema, restDecisionInputSchema, restDecisionOptionSchema, restDecisionPatchSchema, restDecisionSchema, restDecisionsSchema, restDocumentFileSchema, restDocumentInputSchema, restDocumentLinkSchema, restDocumentSchema, restDocumentSummarySchema, restDocumentsSchema, restErrorSchema, restEventDataSchema, restEventSchema, restEventsSchema, restFileInputSchema, restFileSchema, restGoalInputSchema, restGoalPatchSchema, restGoalSchema, restGoalsSchema, restListingInputSchema, restListingSchema, restMemberInputSchema, restMemberPatchSchema, restMemberSchema, restMembersSchema, restMePatchSchema, restMeSchema, restOrganizationSchema, restPeopleSchema, restPersonPatchSchema, restPersonSchema, restPersonWorkSchema, restProjectIconSchema, restProjectInputSchema, restProjectPatchSchema, restProjectRulesSchema, restProjectSchema, restProjectsSchema, restProviderSchema, restReportInputSchema, restReportSchema, restRulesInputSchema, restRulesSchema, restRunEndInputSchema, restRunInputSchema, restRunSchema, restRunsSchema, restSkillSchema, restSkillsSchema, restTaskCountsSchema, restTaskInputSchema, restTaskLinkSchema, restTaskPatchSchema, restTaskSchema, restTasksSchema, restTokenCreatedSchema, restTokenInputSchema, restTokenSchema, restTokensSchema, restVersionSchema, restVersionSummarySchema, restVersionsSchema, restWorkSchema, } from "./schemas.js";
|
|
8
10
|
export { hasForbiddenCodePoint } from "./text.js";
|
|
9
|
-
export { ARTIFACT_KINDS, type ArtifactKind, CATEGORY_COLORS, type CategoryColor, COLOR_NAMES, type ColorName, EVENT_KINDS, type EventKind, GOAL_STATES, type GoalState, isProviderKey, LINK_SOURCES, type LinkSource, OPEN_TASK_STATES, PERSON_ROLES, type PersonRole, PROJECT_ICON_TYPES, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, type ProjectIconType, type ProjectRole, type ProjectVisibility, type ProviderKey, RUN_ENDINGS, RUN_STATUSES, type RunEnding, type RunStatus, SKILLS_STATUSES, type SkillsStatus, TASK_PRIORITIES, TASK_STATES, type TaskPriority, type TaskState, } from "./vocabulary.js";
|
|
11
|
+
export { ARTIFACT_KINDS, type ArtifactKind, CATEGORY_COLORS, type CategoryColor, COLOR_NAMES, type ColorName, EVENT_KINDS, type EventKind, GOAL_STATES, type GoalState, isProviderKey, LINK_SOURCES, type LinkSource, MEMBERSHIP_SOURCES, type MembershipSource, OPEN_TASK_STATES, PERSON_ROLES, PERSON_STATUSES, type PersonRole, type PersonStatus, PROJECT_ICON_TYPES, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, type ProjectIconType, type ProjectRole, type ProjectVisibility, type ProviderKey, RULES_SOURCES, RUN_ENDINGS, RUN_STATUSES, type RulesSource, type RunEnding, type RunStatus, SKILLS_STATUSES, type SkillsStatus, TASK_PRIORITIES, TASK_STATES, type TaskPriority, type TaskState, } from "./vocabulary.js";
|
|
10
12
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,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AAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,SAAS,EACd,WAAW,EACX,KAAK,SAAS,EACd,WAAW,EACX,KAAK,SAAS,EACd,aAAa,EACb,YAAY,EACZ,KAAK,UAAU,EACf,gBAAgB,EAChB,YAAY,EACZ,KAAK,UAAU,EACf,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,WAAW,EACX,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,eAAe,EACf,KAAK,YAAY,EACjB,eAAe,EACf,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KA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ACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,eAAe,EACf,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,SAAS,EACd,WAAW,EACX,KAAK,SAAS,EACd,WAAW,EACX,KAAK,SAAS,EACd,aAAa,EACb,YAAY,EACZ,KAAK,UAAU,EACf,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,eAAe,EACf,KAAK,YAAY,EACjB,eAAe,EACf,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC"}
|
package/dist/api.js
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
// consoles"): the vocabulary, the schemas and the client of the console's REST API, so that a
|
|
3
3
|
// custom UI talks to any console with types, and so that the contract has one source. No React
|
|
4
4
|
// here: the server and the command line import this entry point, and nothing of the pages.
|
|
5
|
+
export { agentLabel } from "./agent-name.js";
|
|
5
6
|
export { ApiError, createClient, } from "./client.js";
|
|
6
7
|
export { CONNECT_CODE_ALPHABET, CONNECT_CODE_LENGTH, isConnectCode, normalizeConnectCode, } from "./connect.js";
|
|
7
8
|
export { DOCUMENT_PATH, documentPathsIn, folderOf, foldersAbove, isDocumentPath, isFolderPath, nameOf, } from "./documents.js";
|
|
8
|
-
export { DEFAULT_PAGE_LIMIT, DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_CATEGORIES, MAX_CATEGORY_KEY_LENGTH, MAX_CATEGORY_NAME_LENGTH, MAX_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_DOCUMENT_SEGMENT_LENGTH, MAX_FILE_BYTES, MAX_FILE_NAME_LENGTH, MAX_FILES_PER_DOCUMENT, MAX_LANGUAGE_TAG_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_PROJECT_DESCRIPTION_LENGTH, MAX_PROJECT_ICON_BYTES, MAX_PROJECT_KEY_LENGTH, MAX_PROJECT_NAME_LENGTH, MAX_PROJECT_SYMBOL_LENGTH, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_SEARCH_LENGTH, MAX_SECRET_LENGTH, MAX_SKILLS_ADDRESS_LENGTH, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_TOKENS_PER_PERSON, MAX_URL_LENGTH, MAX_VERSIONS_PER_DOCUMENT, MIN_OPTIONS, } from "./limits.js";
|
|
9
|
+
export { DEFAULT_PAGE_LIMIT, DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_CATEGORIES, MAX_CATEGORY_KEY_LENGTH, MAX_CATEGORY_NAME_LENGTH, MAX_DOCUMENT_LENGTH, MAX_DOCUMENT_PATH_LENGTH, MAX_DOCUMENT_SEGMENT_LENGTH, MAX_FILE_BYTES, MAX_FILE_NAME_LENGTH, MAX_FILES_PER_DOCUMENT, MAX_LANGUAGE_TAG_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_LOGIN_LENGTH, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_PROJECT_DESCRIPTION_LENGTH, MAX_PROJECT_ICON_BYTES, MAX_PROJECT_KEY_LENGTH, MAX_PROJECT_NAME_LENGTH, MAX_PROJECT_SYMBOL_LENGTH, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_RULES_LENGTH, MAX_SEARCH_LENGTH, MAX_SECRET_LENGTH, MAX_SKILLS_ADDRESS_LENGTH, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_TOKENS_PER_PERSON, MAX_URL_LENGTH, MAX_VERSIONS_PER_DOCUMENT, MIN_OPTIONS, } from "./limits.js";
|
|
9
10
|
export { projectColorOf, projectSymbolOf } from "./marks.js";
|
|
10
|
-
export { AUTH_ROUTES, CLAIM_PATH, categoryPath, connectPath, isSignInFailure, loginPath, PROJECT_COLLECTIONS, personTokensPath, projectIconPath, projectPath, REST_ROUTES, RETURN_TO_PARAM, restPath, SIGN_IN_FAILURES, SIGN_IN_PARAM, signInPath, } from "./routes.js";
|
|
11
|
-
export {
|
|
11
|
+
export { AUTH_ROUTES, CLAIM_PATH, categoryPath, connectPath, isSignInFailure, loginPath, PROJECT_COLLECTIONS, personTokensPath, personWorkPath, projectIconPath, projectPath, REST_ROUTES, RETURN_TO_PARAM, restPath, rulesPath, SIGN_IN_FAILURES, SIGN_IN_PARAM, signInPath, } from "./routes.js";
|
|
12
|
+
export { fillRules, isReferenceRules, languageNameOf, PROJECT_RULES_TEMPLATE, REFERENCE_RULES, RULES_LANGUAGE_PLACEHOLDER, RULES_PATH, RULES_TITLE, } from "./rules.js";
|
|
13
|
+
export { hostOfLogin, isLoginAt, restAnswerInputSchema, restArtifactInputSchema, restArtifactSchema, restBacklinkSchema, restCategoriesSchema, restCategoryInputSchema, restCategoryPatchSchema, restCategorySchema, restClaimInputSchema, restClaimSchema, restConnectInputSchema, restConnectionSchema, restConnectRequestSchema, restDecisionInputSchema, restDecisionOptionSchema, restDecisionPatchSchema, restDecisionSchema, restDecisionsSchema, restDocumentFileSchema, restDocumentInputSchema, restDocumentLinkSchema, restDocumentSchema, restDocumentSummarySchema, restDocumentsSchema, restErrorSchema, restEventDataSchema, restEventSchema, restEventsSchema, restFileInputSchema, restFileSchema, restGoalInputSchema, restGoalPatchSchema, restGoalSchema, restGoalsSchema, restListingInputSchema, restListingSchema, restMemberInputSchema, restMemberPatchSchema, restMemberSchema, restMembersSchema, restMePatchSchema, restMeSchema, restOrganizationSchema, restPeopleSchema, restPersonPatchSchema, restPersonSchema, restPersonWorkSchema, restProjectIconSchema, restProjectInputSchema, restProjectPatchSchema, restProjectRulesSchema, restProjectSchema, restProjectsSchema, restProviderSchema, restReportInputSchema, restReportSchema, restRulesInputSchema, restRulesSchema, restRunEndInputSchema, restRunInputSchema, restRunSchema, restRunsSchema, restSkillSchema, restSkillsSchema, restTaskCountsSchema, restTaskInputSchema, restTaskLinkSchema, restTaskPatchSchema, restTaskSchema, restTasksSchema, restTokenCreatedSchema, restTokenInputSchema, restTokenSchema, restTokensSchema, restVersionSchema, restVersionSummarySchema, restVersionsSchema, restWorkSchema, } from "./schemas.js";
|
|
12
14
|
export { hasForbiddenCodePoint } from "./text.js";
|
|
13
|
-
export { ARTIFACT_KINDS, CATEGORY_COLORS, COLOR_NAMES, EVENT_KINDS, GOAL_STATES, isProviderKey, LINK_SOURCES, OPEN_TASK_STATES, PERSON_ROLES, PROJECT_ICON_TYPES, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, RUN_ENDINGS, RUN_STATUSES, SKILLS_STATUSES, TASK_PRIORITIES, TASK_STATES, } from "./vocabulary.js";
|
|
15
|
+
export { ARTIFACT_KINDS, CATEGORY_COLORS, COLOR_NAMES, EVENT_KINDS, GOAL_STATES, isProviderKey, LINK_SOURCES, MEMBERSHIP_SOURCES, OPEN_TASK_STATES, PERSON_ROLES, PERSON_STATUSES, PROJECT_ICON_TYPES, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, RULES_SOURCES, RUN_ENDINGS, RUN_STATUSES, SKILLS_STATUSES, TASK_PRIORITIES, TASK_STATES, } from "./vocabulary.js";
|
|
14
16
|
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,8FAA8F;AAC9F,+FAA+F;AAC/F,2FAA2F;AAE3F,OAAO,EACL,QAAQ,EAGR,YAAY,GAQb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,yBAAyB,EACzB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,SAAS,EACT,mBAAmB,EAEnB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,aAAa,EAEb,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,8FAA8F;AAC9F,+FAA+F;AAC/F,2FAA2F;AAE3F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,QAAQ,EAGR,YAAY,GAQb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,MAAM,GACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,WAAW,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Ae,EACf,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EAEd,eAAe,EAEf,WAAW,EAEX,WAAW,EAEX,WAAW,EAEX,aAAa,EACb,YAAY,EAEZ,kBAAkB,EAElB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAGf,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,aAAa,EAKb,aAAa,EACb,WAAW,EACX,YAAY,EAIZ,eAAe,EAEf,eAAe,EACf,WAAW,GAGZ,MAAM,iBAAiB,CAAC"}
|
package/dist/cli/cli.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface CliIo {
|
|
|
32
32
|
readonly now: () => number;
|
|
33
33
|
/** The version of the package the command runs from, when the entry point knows it. */
|
|
34
34
|
readonly version?: string | undefined;
|
|
35
|
+
/** Where the console's own skills are on this machine, shipped with the package; nothing when they are not there. */
|
|
36
|
+
readonly skillsDir?: string | undefined;
|
|
35
37
|
/** How `serve` listens on the loopback (ADR-0014); left out, the command cannot serve. */
|
|
36
38
|
readonly listen?: Listen | undefined;
|
|
37
39
|
}
|
package/dist/cli/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AA8BtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA6BrD,OAAO,EAA0C,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAQjF,qFAAqF;AACrF,eAAO,MAAM,IAAI;aACf,EAAE,EAAE,CAAC;IACL,6EAA6E;aAC7E,MAAM,EAAE,CAAC;IACT,sCAAsC;aACtC,KAAK,EAAE,CAAC;IACR,6CAA6C;aAC7C,OAAO,EAAE,CAAC;CACF,CAAC;AAWX,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,kCAAkC;IAClC,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1D,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,qHAAqH;IACrH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAi1DD,yFAAyF;AACzF,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BhF"}
|
package/dist/cli/cli.js
CHANGED
|
@@ -3,9 +3,11 @@ import { parseArgs } from "node:util";
|
|
|
3
3
|
import { ApiError, createClient, } from "../client.js";
|
|
4
4
|
import { addDays, dayOf as dayOfDate, isDay } from "../dates.js";
|
|
5
5
|
import { DEFAULT_PAGE_LIMIT, LIST_LIMIT, MAX_OPTIONS, MIN_OPTIONS } from "../limits.js";
|
|
6
|
-
import {
|
|
6
|
+
import { fillRules, RULES_PATH, RULES_TITLE } from "../rules.js";
|
|
7
|
+
import { hostOfLogin, } from "../schemas.js";
|
|
8
|
+
import { COLOR_NAMES, GOAL_STATES, PERSON_ROLES, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, TASK_PRIORITIES, TASK_STATES, } from "../vocabulary.js";
|
|
7
9
|
import { loadWebRoot, WebRootError } from "../web.js";
|
|
8
|
-
import { formatAnswer, formatCategoryLine, formatDecision, formatDecisionLine, formatDocument, formatDocuments, formatGoal, formatGoalLine, formatMemberLine, formatMore, formatOptions, formatPersonLine, formatProject, formatProjectLine, formatRun, formatRunLine, formatSkills, formatTask, formatTaskLine, formatVersion, formatVersionLine, formatWork, } from "./format.js";
|
|
10
|
+
import { formatAnswer, formatCategoryLine, formatDecision, formatDecisionLine, formatDocument, formatDocuments, formatGoal, formatGoalLine, formatListingLine, formatMemberLine, formatMore, formatOptions, formatPersonLine, formatPersonWork, formatProject, formatProjectLine, formatRules, formatRun, formatRunLine, formatSkills, formatTask, formatTaskLine, formatVersion, formatVersionLine, formatWork, } from "./format.js";
|
|
9
11
|
import { COMMAND_HELP, helpFor, usage } from "./help.js";
|
|
10
12
|
import { createServeHandler, DEFAULT_SERVE_PORT } from "./serve.js";
|
|
11
13
|
// The `console` command (docs/specs/cli.md): the agent's side of the console. A thin client of
|
|
@@ -232,6 +234,7 @@ function wordOf(value, words, what) {
|
|
|
232
234
|
return found;
|
|
233
235
|
}
|
|
234
236
|
const personRoleOf = (value) => wordOf(value, PERSON_ROLES, "a role in the workspace");
|
|
237
|
+
const providerOf = (value) => wordOf(value, PROVIDER_KEYS, "a provider people sign in through");
|
|
235
238
|
const projectRoleOf = (value) => wordOf(value, PROJECT_ROLES, "a role in a project");
|
|
236
239
|
const visibilityOf = (value) => wordOf(value, PROJECT_VISIBILITIES, "a visibility");
|
|
237
240
|
const colorOf = (value) => wordOf(value, COLOR_NAMES, "a colour");
|
|
@@ -347,7 +350,8 @@ const login = async (args, io) => {
|
|
|
347
350
|
// A connection (ADR-0011): a code a person approves on the console's own pages, and the token
|
|
348
351
|
// handed over here once, never shown.
|
|
349
352
|
const client = createClient({ baseUrl: url, fetch: io.fetch });
|
|
350
|
-
|
|
353
|
+
// "<agent> on <machine>": the pages say the agent and keep the machine for a hover.
|
|
354
|
+
const agent = text(values, "agent") ?? agentOf(io.env) ?? "An agent";
|
|
351
355
|
const begun = await client.connect({
|
|
352
356
|
agent: io.hostname === undefined ? agent : `${agent} on ${io.hostname}`,
|
|
353
357
|
});
|
|
@@ -371,10 +375,44 @@ const login = async (args, io) => {
|
|
|
371
375
|
};
|
|
372
376
|
const logout = async (args, io) => {
|
|
373
377
|
parse(args, {}, false);
|
|
378
|
+
const stored = await io.store.load();
|
|
379
|
+
const url = io.env.CONSOLE_URL ?? stored?.url;
|
|
380
|
+
const token = io.env.CONSOLE_TOKEN ?? stored?.token;
|
|
381
|
+
if (url === undefined || token === undefined) {
|
|
382
|
+
io.stdout("Not signed in here: nothing to forget.\n");
|
|
383
|
+
return EXIT.ok;
|
|
384
|
+
}
|
|
385
|
+
// The token is given up at the console first, so that it is good for nothing from now on;
|
|
386
|
+
// one the console no longer knows is gone already. A console out of reach leaves it to the
|
|
387
|
+
// Agents page, and the person is told so.
|
|
388
|
+
let gone = true;
|
|
389
|
+
try {
|
|
390
|
+
await createClient({ baseUrl: url, token, fetch: io.fetch }).giveUpToken();
|
|
391
|
+
}
|
|
392
|
+
catch (error) {
|
|
393
|
+
if (!(error instanceof ApiError && error.code === "auth.required")) {
|
|
394
|
+
gone = false;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
374
397
|
await io.store.clear();
|
|
375
|
-
io.stdout(
|
|
398
|
+
io.stdout(gone
|
|
399
|
+
? "Signed out: the token is given up at the console and forgotten here.\n"
|
|
400
|
+
: `Signed out here, but the console at ${url} could not be reached to give the token up: a person removes it on the Agents page.\n`);
|
|
401
|
+
if (io.env.CONSOLE_TOKEN !== undefined) {
|
|
402
|
+
io.stdout("CONSOLE_TOKEN in the environment still holds it: unset it.\n");
|
|
403
|
+
}
|
|
376
404
|
return EXIT.ok;
|
|
377
405
|
};
|
|
406
|
+
/** The agent the command runs under, where its environment says so: what a connection is named by default. */
|
|
407
|
+
function agentOf(env) {
|
|
408
|
+
if (env.CLAUDECODE !== undefined) {
|
|
409
|
+
return "Claude Code";
|
|
410
|
+
}
|
|
411
|
+
if (Object.keys(env).some((key) => key.startsWith("CODEX_"))) {
|
|
412
|
+
return "Codex";
|
|
413
|
+
}
|
|
414
|
+
return undefined;
|
|
415
|
+
}
|
|
378
416
|
const whoami = async (args, io) => {
|
|
379
417
|
const { values } = parse(args, {}, false);
|
|
380
418
|
const session = await open(io, values);
|
|
@@ -402,7 +440,7 @@ const use = async (args, io) => {
|
|
|
402
440
|
const session = await open(io, values);
|
|
403
441
|
const project = await session.client.project(key).get();
|
|
404
442
|
const kept = await io.directory.save({ project: project.key });
|
|
405
|
-
answer(io, session, project, () => `Working in ${project.name} (${project.key}) from this directory on: kept in ${kept}, which is meant to be committed.`);
|
|
443
|
+
answer(io, session, project, () => `Working in ${project.name} (${project.key}) from this directory on: kept in ${kept}, which is meant to be committed. What its people ask of agents: console rules.`);
|
|
406
444
|
return EXIT.ok;
|
|
407
445
|
};
|
|
408
446
|
const tasks = async (args, io) => {
|
|
@@ -448,10 +486,18 @@ const tasks = async (args, io) => {
|
|
|
448
486
|
return EXIT.ok;
|
|
449
487
|
};
|
|
450
488
|
const work = async (args, io) => {
|
|
451
|
-
const { values } = parse(args, {}, false);
|
|
489
|
+
const { values } = parse(args, { person: { type: "string" } }, false);
|
|
452
490
|
const session = await open(io, values);
|
|
453
|
-
const
|
|
454
|
-
|
|
491
|
+
const login = text(values, "person");
|
|
492
|
+
if (login === undefined) {
|
|
493
|
+
const found = await session.client.work();
|
|
494
|
+
answer(io, session, found, () => formatWork(found));
|
|
495
|
+
return EXIT.ok;
|
|
496
|
+
}
|
|
497
|
+
// Another person's plate: the console decides whether it is the asker's to see.
|
|
498
|
+
const whose = await personOf(session, login);
|
|
499
|
+
const found = await session.client.personWork(whose.id);
|
|
500
|
+
answer(io, session, found, () => formatPersonWork(whose, found));
|
|
455
501
|
return EXIT.ok;
|
|
456
502
|
};
|
|
457
503
|
const categories = async (args, io) => {
|
|
@@ -466,9 +512,102 @@ const skills = async (args, io) => {
|
|
|
466
512
|
const session = await open(io, values);
|
|
467
513
|
const project = await session.project();
|
|
468
514
|
const found = await project.skills();
|
|
469
|
-
answer(io, session, found, () => formatSkills(found));
|
|
515
|
+
answer(io, session, found, () => formatSkills(found, io.skillsDir));
|
|
516
|
+
return EXIT.ok;
|
|
517
|
+
};
|
|
518
|
+
/** A version number given as a flag, or nothing; anything else is not understood. */
|
|
519
|
+
function versionOf(given) {
|
|
520
|
+
if (given === undefined) {
|
|
521
|
+
return undefined;
|
|
522
|
+
}
|
|
523
|
+
const version = Number(given);
|
|
524
|
+
if (!Number.isInteger(version) || version < 1) {
|
|
525
|
+
throw misuse(`Not a version number: ${given}`);
|
|
526
|
+
}
|
|
527
|
+
return version;
|
|
528
|
+
}
|
|
529
|
+
// The rules of the board (ADR-0023): read before a task is taken, written by an owner for the
|
|
530
|
+
// project and by an administrator for the workspace, through the same page the console keeps.
|
|
531
|
+
const rules = async (args, io) => {
|
|
532
|
+
const [verb, ...rest] = args;
|
|
533
|
+
if (verb === "write") {
|
|
534
|
+
const { values, positionals } = parse(rest, {
|
|
535
|
+
body: { type: "string" },
|
|
536
|
+
file: { type: "string" },
|
|
537
|
+
workspace: { type: "boolean" },
|
|
538
|
+
base: { type: "string" },
|
|
539
|
+
});
|
|
540
|
+
if (positionals.length > 1) {
|
|
541
|
+
throw misuse("Say the rules as one argument: console rules write --body <markdown>");
|
|
542
|
+
}
|
|
543
|
+
const given = positionals[0] ?? text(values, "body");
|
|
544
|
+
const none = given === "none";
|
|
545
|
+
const body = none ? undefined : await bodyOf(io, values, given);
|
|
546
|
+
if (!none && body === undefined) {
|
|
547
|
+
throw misuse("Say what the rules are to say: --body <markdown>, --file <path>, - to read standard input, or none to put the written rules away.");
|
|
548
|
+
}
|
|
549
|
+
const baseVersion = versionOf(text(values, "base"));
|
|
550
|
+
const session = await open(io, values);
|
|
551
|
+
if (on(values, "workspace")) {
|
|
552
|
+
if (none) {
|
|
553
|
+
const put = await session.client.archiveRules();
|
|
554
|
+
answer(io, session, put, () => "The organization's rules are put away: the console's own hold.");
|
|
555
|
+
return EXIT.ok;
|
|
556
|
+
}
|
|
557
|
+
const written = await session.client.writeRules({
|
|
558
|
+
body: body ?? "",
|
|
559
|
+
...(baseVersion === undefined ? {} : { baseVersion }),
|
|
560
|
+
});
|
|
561
|
+
answer(io, session, written, () => written.page === null
|
|
562
|
+
? "Nothing written: these are the console's own rules as they stand, and they hold already."
|
|
563
|
+
: `Wrote the workspace's rules, version ${written.page.version}.`);
|
|
564
|
+
return EXIT.ok;
|
|
565
|
+
}
|
|
566
|
+
const project = await session.project();
|
|
567
|
+
if (none) {
|
|
568
|
+
try {
|
|
569
|
+
const put = await project.archiveDocument(RULES_PATH);
|
|
570
|
+
answer(io, session, put, () => "This project's rules are put away: it adds none now.");
|
|
571
|
+
}
|
|
572
|
+
catch (error) {
|
|
573
|
+
if (!(error instanceof ApiError) || error.code !== "document.not_found") {
|
|
574
|
+
throw error;
|
|
575
|
+
}
|
|
576
|
+
answer(io, session, null, () => "This project has no rules of its own to put away.");
|
|
577
|
+
}
|
|
578
|
+
return EXIT.ok;
|
|
579
|
+
}
|
|
580
|
+
const written = await project.writeDocument(RULES_PATH, {
|
|
581
|
+
title: RULES_TITLE,
|
|
582
|
+
body: body ?? "",
|
|
583
|
+
...(baseVersion === undefined ? {} : { baseVersion }),
|
|
584
|
+
});
|
|
585
|
+
answer(io, session, written, () => `Wrote this project's rules, version ${written.version}.`);
|
|
586
|
+
return EXIT.ok;
|
|
587
|
+
}
|
|
588
|
+
const { values } = parse(args, {}, false);
|
|
589
|
+
const session = await open(io, values);
|
|
590
|
+
const key = await session.projectKey();
|
|
591
|
+
const [found, me] = await Promise.all([
|
|
592
|
+
key === undefined ? session.client.rules() : session.client.project(key).rules(),
|
|
593
|
+
session.client.me(),
|
|
594
|
+
]);
|
|
595
|
+
const read = "workspace" in found
|
|
596
|
+
? {
|
|
597
|
+
workspace: forPerson(found.workspace, me.language),
|
|
598
|
+
project: forPerson(found.project, me.language),
|
|
599
|
+
}
|
|
600
|
+
: forPerson(found, me.language);
|
|
601
|
+
answer(io, session, read, () => formatRules(read));
|
|
470
602
|
return EXIT.ok;
|
|
471
603
|
};
|
|
604
|
+
/**
|
|
605
|
+
* The rules as they read for the person whose token the command holds: `{language}` filled
|
|
606
|
+
* with the language they chose for the pages, or with the task's when they chose none.
|
|
607
|
+
*/
|
|
608
|
+
function forPerson(half, language) {
|
|
609
|
+
return half.body === null ? half : { ...half, body: fillRules(half.body, language) };
|
|
610
|
+
}
|
|
472
611
|
/** The flags that set a task's fields, shared by writing one and changing one. */
|
|
473
612
|
const TASK_FIELDS = {
|
|
474
613
|
state: { type: "string" },
|
|
@@ -576,10 +715,27 @@ const take = async (args, io) => {
|
|
|
576
715
|
taskId: found.id,
|
|
577
716
|
...(agent === undefined ? {} : { agent }),
|
|
578
717
|
});
|
|
579
|
-
|
|
580
|
-
|
|
718
|
+
// The rules come with the run, as they read for the person: everything from here acts
|
|
719
|
+
// within them (ADR-0023); the task is read again, as it stands now that it is taken.
|
|
720
|
+
const [ruling, me, taken] = await Promise.all([
|
|
721
|
+
project.rules(),
|
|
722
|
+
session.client.me(),
|
|
723
|
+
project.task(ref),
|
|
724
|
+
]);
|
|
725
|
+
// Taking a task with a run open on it ends that run (ADR-0020): said when it happened.
|
|
726
|
+
const tookOver = found.openRuns > 0
|
|
727
|
+
? " A run that was open on it is over now: the board cannot know whether its agent still ran, so taking it was deciding."
|
|
728
|
+
: "";
|
|
729
|
+
const rules = {
|
|
730
|
+
workspace: forPerson(ruling.workspace, me.language),
|
|
731
|
+
project: forPerson(ruling.project, me.language),
|
|
732
|
+
};
|
|
733
|
+
answer(io, session, { run, task: taken, rules }, () => [
|
|
734
|
+
`Run ${run.id} began on #${found.number} ${found.title}, as "${run.agent}" for ${run.person.login}. The task is in progress and theirs.${tookOver}`,
|
|
735
|
+
"",
|
|
736
|
+
formatTask(taken),
|
|
581
737
|
"",
|
|
582
|
-
|
|
738
|
+
formatRules(rules),
|
|
583
739
|
"",
|
|
584
740
|
'Say how it goes: console report "<what you found or did>". Hand in what you make: console hand-in <https url | file path>.',
|
|
585
741
|
'Ask when a person must decide: console ask "<question>" --option "..." --option "...". End with: console finish --summary "<what was done, what is left>".',
|
|
@@ -1066,21 +1222,57 @@ const people = async (args, io) => {
|
|
|
1066
1222
|
const { values } = parse(args, {}, false);
|
|
1067
1223
|
const session = await open(io, values);
|
|
1068
1224
|
const found = await session.client.people();
|
|
1069
|
-
answer(io, session, found, () => found.items.map(formatPersonLine).join("\n"));
|
|
1225
|
+
answer(io, session, found, () => [...found.items.map(formatPersonLine), ...found.listed.map(formatListingLine)].join("\n"));
|
|
1070
1226
|
return EXIT.ok;
|
|
1071
1227
|
};
|
|
1228
|
+
const PERSON_USAGE = "Say what to do: console person role <login> <admin|member> | person add <login> [--host gh|google] | person remove <login> | person deactivate <login> | person reactivate <login>";
|
|
1072
1229
|
const person = async (args, io) => {
|
|
1073
|
-
|
|
1074
|
-
|
|
1230
|
+
const what = args[0];
|
|
1231
|
+
if (what === "role") {
|
|
1232
|
+
const { values, positionals } = parse(args.slice(1), {});
|
|
1233
|
+
const [login, role] = theTwo(positionals, "Say whom and what: console person role <login> <admin|member>");
|
|
1234
|
+
const wanted = personRoleOf(role);
|
|
1235
|
+
const session = await open(io, values);
|
|
1236
|
+
const found = await personOf(session, login);
|
|
1237
|
+
const changed = await session.client.updatePerson(found.id, { role: wanted });
|
|
1238
|
+
answer(io, session, changed, () => formatPersonLine(changed));
|
|
1239
|
+
return EXIT.ok;
|
|
1075
1240
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1241
|
+
if (what === "add") {
|
|
1242
|
+
const { values, positionals } = parse(args.slice(1), { host: { type: "string" } });
|
|
1243
|
+
const login = theOne(positionals, "Say whom: console person add <login> [--host gh|google]");
|
|
1244
|
+
const chosen = text(values, "host");
|
|
1245
|
+
const host = chosen === undefined ? hostOfLogin(login) : providerOf(chosen);
|
|
1246
|
+
const session = await open(io, values);
|
|
1247
|
+
const made = await session.client.createListing({ host, login });
|
|
1248
|
+
answer(io, session, made, () => formatListingLine(made));
|
|
1249
|
+
return EXIT.ok;
|
|
1250
|
+
}
|
|
1251
|
+
if (what === "remove") {
|
|
1252
|
+
const { values, positionals } = parse(args.slice(1), {});
|
|
1253
|
+
const login = theOne(positionals, "Say whom: console person remove <login>");
|
|
1254
|
+
const session = await open(io, values);
|
|
1255
|
+
const { listed } = await session.client.people();
|
|
1256
|
+
const found = listed.find((listing) => listing.login.toLowerCase() === login.toLowerCase());
|
|
1257
|
+
if (found === undefined) {
|
|
1258
|
+
throw misuse(`Nobody called ${login} is let in and not signed in yet. console people lists them; a person who signed in is taken out with console person deactivate <login>.`);
|
|
1259
|
+
}
|
|
1260
|
+
await session.client.removeListing(found.id);
|
|
1261
|
+
answer(io, session, { removed: found }, () => `${found.login} is no longer let in.`);
|
|
1262
|
+
return EXIT.ok;
|
|
1263
|
+
}
|
|
1264
|
+
if (what === "deactivate" || what === "reactivate") {
|
|
1265
|
+
const { values, positionals } = parse(args.slice(1), {});
|
|
1266
|
+
const login = theOne(positionals, `Say whom: console person ${what} <login>`);
|
|
1267
|
+
const session = await open(io, values);
|
|
1268
|
+
const found = await personOf(session, login);
|
|
1269
|
+
const changed = await session.client.updatePerson(found.id, {
|
|
1270
|
+
status: what === "deactivate" ? "deactivated" : "active",
|
|
1271
|
+
});
|
|
1272
|
+
answer(io, session, changed, () => formatPersonLine(changed));
|
|
1273
|
+
return EXIT.ok;
|
|
1274
|
+
}
|
|
1275
|
+
throw misuse(PERSON_USAGE);
|
|
1084
1276
|
};
|
|
1085
1277
|
/** The flags that set what a project is, shared by making one and changing one. */
|
|
1086
1278
|
const PROJECT_FIELDS = {
|
|
@@ -1274,6 +1466,7 @@ const COMMANDS = {
|
|
|
1274
1466
|
goal,
|
|
1275
1467
|
categories,
|
|
1276
1468
|
skills,
|
|
1469
|
+
rules,
|
|
1277
1470
|
people,
|
|
1278
1471
|
person,
|
|
1279
1472
|
project,
|
|
@@ -1350,7 +1543,15 @@ function hintFor(error) {
|
|
|
1350
1543
|
case "category.in_use":
|
|
1351
1544
|
return "Tasks are sorted into the category. Move them out first: console task edit <number> --category <other|none>\n";
|
|
1352
1545
|
case "person.last_admin":
|
|
1353
|
-
return "The board keeps at least one administrator. Make another one first.\n";
|
|
1546
|
+
return "The board keeps at least one administrator in. Make another one first.\n";
|
|
1547
|
+
case "person.of_organization":
|
|
1548
|
+
return "The organization says who is in: a person it let in comes and goes with it, and is listed by login to stay.\n";
|
|
1549
|
+
case "listing.exists":
|
|
1550
|
+
return "The login is let in already, or is a person's who is in. console people lists both.\n";
|
|
1551
|
+
case "listing.not_found":
|
|
1552
|
+
return "No login let in and not signed in yet has that id. console people lists them.\n";
|
|
1553
|
+
case "listing.unknown_host":
|
|
1554
|
+
return "Nobody signs in through that provider here. console whoami --json names the ways in.\n";
|
|
1354
1555
|
case "connect.too_many":
|
|
1355
1556
|
return "The console holds as many connections as it may at once. Try again in a few minutes.\n";
|
|
1356
1557
|
case "network":
|