@skillcdn/console 0.1.9 → 0.1.11
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 +6 -6
- package/dist/api.d.ts +6 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +5 -4
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +303 -18
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +11 -1
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +87 -6
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +70 -14
- package/dist/cli/help.js.map +1 -1
- package/dist/client.d.ts +44 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +32 -4
- package/dist/client.js.map +1 -1
- package/dist/components/board.d.ts +24 -1
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +66 -5
- package/dist/components/board.js.map +1 -1
- package/dist/components/calendar.d.ts +54 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +156 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/categories.d.ts +13 -0
- package/dist/components/categories.d.ts.map +1 -0
- package/dist/components/categories.js +52 -0
- package/dist/components/categories.js.map +1 -0
- package/dist/components/decision-list.d.ts +10 -0
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +16 -1
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +23 -7
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts +35 -0
- package/dist/components/goals.d.ts.map +1 -0
- package/dist/components/goals.js +45 -0
- package/dist/components/goals.js.map +1 -0
- package/dist/components/paged.d.ts +14 -0
- package/dist/components/paged.d.ts.map +1 -0
- package/dist/components/paged.js +28 -0
- package/dist/components/paged.js.map +1 -0
- package/dist/components/projects.d.ts +22 -2
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +35 -7
- package/dist/components/projects.js.map +1 -1
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +2 -2
- package/dist/components/runs.js.map +1 -1
- package/dist/components/shell.d.ts +2 -1
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +1 -1
- package/dist/components/shell.js.map +1 -1
- package/dist/components/task-form.d.ts +5 -1
- package/dist/components/task-form.d.ts.map +1 -1
- package/dist/components/task-form.js +13 -1
- package/dist/components/task-form.js.map +1 -1
- package/dist/components/task-list.d.ts +16 -0
- package/dist/components/task-list.d.ts.map +1 -0
- package/dist/components/task-list.js +16 -0
- package/dist/components/task-list.js.map +1 -0
- package/dist/components/task-view.d.ts +9 -1
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +10 -4
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/ui.d.ts +30 -1
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +60 -0
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.d.ts +10 -0
- package/dist/components/work.d.ts.map +1 -0
- package/dist/components/work.js +33 -0
- package/dist/components/work.js.map +1 -0
- package/dist/console.css +658 -0
- package/dist/console.d.ts +8 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +145 -13
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +19 -3
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +51 -4
- package/dist/data.js.map +1 -1
- package/dist/dates.d.ts +39 -0
- package/dist/dates.d.ts.map +1 -0
- package/dist/dates.js +120 -0
- package/dist/dates.js.map +1 -0
- package/dist/i18n/en.d.ts +172 -5
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +183 -6
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +178 -6
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +11 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +11 -0
- package/dist/limits.js.map +1 -1
- package/dist/marks.d.ts +12 -0
- package/dist/marks.d.ts.map +1 -0
- package/dist/marks.js +31 -0
- package/dist/marks.js.map +1 -0
- package/dist/router.d.ts +51 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +80 -1
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +14 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +17 -0
- package/dist/routes.js.map +1 -1
- package/dist/schemas.d.ts +489 -3
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +150 -9
- 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 +31 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +17 -8
- package/docs/specs/rest.md +48 -17
- package/package.json +1 -1
- package/skills/working-the-board/SKILL.md +7 -6
- package/src/api.ts +42 -0
- package/src/cli/cli.ts +362 -18
- package/src/cli/format.ts +96 -6
- package/src/cli/help.ts +77 -15
- package/src/client.ts +98 -7
- package/src/components/board.tsx +173 -13
- package/src/components/calendar.tsx +367 -0
- package/src/components/categories.tsx +209 -0
- package/src/components/decision-list.tsx +67 -5
- package/src/components/event-feed.tsx +46 -27
- package/src/components/goals.tsx +264 -0
- package/src/components/paged.tsx +39 -0
- package/src/components/projects.tsx +128 -10
- package/src/components/runs.tsx +7 -1
- package/src/components/shell.tsx +5 -2
- package/src/components/task-form.tsx +78 -1
- package/src/components/task-list.tsx +64 -0
- package/src/components/task-view.tsx +75 -4
- package/src/components/ui.tsx +116 -1
- package/src/components/work.tsx +93 -0
- package/src/console.tsx +376 -9
- package/src/data.ts +83 -12
- package/src/dates.ts +143 -0
- package/src/i18n/en.ts +193 -6
- package/src/i18n/ko.ts +184 -6
- package/src/index.ts +62 -1
- package/src/limits.ts +11 -0
- package/src/marks.ts +40 -0
- package/src/router.ts +131 -6
- package/src/routes.ts +19 -0
- package/src/schemas.ts +187 -7
- package/src/styles/console.css +658 -0
- package/src/vocabulary.ts +43 -0
package/README.md
CHANGED
|
@@ -29,11 +29,11 @@ const client = createClient({ baseUrl: "https://console.example" }); // the page
|
|
|
29
29
|
const { items } = await client.tasks({ state: "ready" });
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
- **The vocabulary:** `TASK_STATES
|
|
32
|
+
- **The vocabulary:** `TASK_STATES` (and `OPEN_TASK_STATES`), `TASK_PRIORITIES`, `GOAL_STATES`, `COLOR_NAMES` (the colours the pages paint; `CATEGORY_COLORS` is the same list), `PROJECT_ICON_TYPES` (the kinds of image a project's mark may be), `RUN_STATUSES`, `EVENT_KINDS`, `LINK_SOURCES`, with their types. One source for the database's constraints, the schemas and the board. With them, the rule of a document's path and of the links a text makes: `isDocumentPath`, `documentPathsIn`, `folderOf`, `nameOf`, `foldersAbove`, which the server records links by and the pages render them by. And a project's mark where it chose none: `projectColorOf` (a colour from its key, never gray) and `projectSymbolOf` (the first letter of its name).
|
|
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
|
-
- **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, `restPath`, `loginPath`, `signInPath`). The API itself is described in [docs/specs/rest.md](https://github.com/skillcdn/console/blob/main/docs/specs/rest.md).
|
|
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. 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, runs, files, events, skills, documents, settings and
|
|
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. 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.
|
|
37
37
|
|
|
38
38
|
### The command line
|
|
39
39
|
|
|
@@ -67,12 +67,12 @@ import "@skillcdn/console/console.css";
|
|
|
67
67
|
|
|
68
68
|
createConsole({
|
|
69
69
|
title: "Acme", // until the server says what the board is called
|
|
70
|
-
components: { SignIn: MySignIn }, // any of Shell, Board, TaskView, DecisionList, EventFeed, SignIn, TokenList, PeopleList, SkillList, ProjectList, MemberList
|
|
70
|
+
components: { SignIn: MySignIn }, // any of Shell, Board, TaskView, DecisionList, EventFeed, SignIn, TokenList, PeopleList, SkillList, ProjectList, MemberList, Calendar, GoalList, WorkList, CategoryList
|
|
71
71
|
}).mount(document.getElementById("root"));
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
- **The components** take their data as props and nothing from the network: `Board` (one column per state), `TaskCard`, `TaskView` (one task with its decisions and its parts), `TaskForm`, `DecisionList` and `DecisionCard` (the waiting
|
|
75
|
-
- **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, no new project, no settings, no changes to members or roles, no sign-out; it keeps the choice of language in the browser. The pages route in the browser and every form has an address (ADR-0010): the projects at `/`, a project's pages under `/projects/<key
|
|
74
|
+
- **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 way for an administrator to change it), `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), `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`, `Badge`, `Avatar`, `PersonChip`, `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.
|
|
75
|
+
- **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, no new project, no settings, no changes to members or roles, no sign-out; it keeps the choice of language in the browser. 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 categories at `/categories`, a project's pages under `/projects/<key>` (its roadmap and calendar 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 and the calendar's month among it (`matchRoute(pathname, search)`, `PATHS`, `projectHref`, `boardHref`, `taskHref`, `goalHref`, `calendarHref`, `decisionHref`, `docHref`, `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).
|
|
76
76
|
- **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.
|
|
77
77
|
- **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. 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.
|
|
78
78
|
- React 19 is a peer dependency; `react-markdown` and `remark-gfm` are the package's own.
|
package/dist/api.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { ApiError, type ClientOptions, type ConsoleClient, createClient, type DocumentFilter, type EventFilter, type FetchLike, type FileUpload, type ProjectClient, } from "./client.js";
|
|
1
|
+
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
2
|
export { CONNECT_CODE_ALPHABET, CONNECT_CODE_LENGTH, isConnectCode, normalizeConnectCode, } from "./connect.js";
|
|
3
3
|
export { DOCUMENT_PATH, documentPathsIn, folderOf, foldersAbove, isDocumentPath, isFolderPath, nameOf, } from "./documents.js";
|
|
4
|
-
export { DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_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_KEY_LENGTH, MAX_PROJECT_NAME_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 {
|
|
6
|
-
export {
|
|
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 { 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 { 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 RestMe, type RestMember, type RestMemberInput, type RestMemberPatch, type RestMembers, type RestMePatch, type RestPeople, type RestPerson, type RestPersonPatch, type RestProject, type RestProjectIcon, type RestProjectInput, type RestProjectPatch, type RestProjects, type RestProvider, type RestReport, type RestReportInput, 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, restMemberInputSchema, restMemberPatchSchema, restMemberSchema, restMembersSchema, restMePatchSchema, restMeSchema, restPeopleSchema, restPersonPatchSchema, restPersonSchema, restProjectIconSchema, restProjectInputSchema, restProjectPatchSchema, restProjectSchema, restProjectsSchema, restProviderSchema, restReportInputSchema, restReportSchema, restRunEndInputSchema, restRunInputSchema, restRunSchema, restRunsSchema, restSkillSchema, restSkillsSchema, restTaskCountsSchema, restTaskInputSchema, restTaskLinkSchema, restTaskPatchSchema, restTaskSchema, restTasksSchema, restTokenCreatedSchema, restTokenInputSchema, restTokenSchema, restTokensSchema, restVersionSchema, restVersionSummarySchema, restVersionsSchema, restWorkSchema, } from "./schemas.js";
|
|
7
8
|
export { hasForbiddenCodePoint } from "./text.js";
|
|
8
|
-
export { ARTIFACT_KINDS, type ArtifactKind, EVENT_KINDS, type EventKind, isProviderKey, LINK_SOURCES, type LinkSource, PERSON_ROLES, type PersonRole, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, 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";
|
|
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";
|
|
9
10
|
//# 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,aAAa,
|
|
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,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,EACnB,K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Ac,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"}
|
package/dist/api.js
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
export { ApiError, createClient, } from "./client.js";
|
|
6
6
|
export { CONNECT_CODE_ALPHABET, CONNECT_CODE_LENGTH, isConnectCode, normalizeConnectCode, } from "./connect.js";
|
|
7
7
|
export { DOCUMENT_PATH, documentPathsIn, folderOf, foldersAbove, isDocumentPath, isFolderPath, nameOf, } from "./documents.js";
|
|
8
|
-
export { DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_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_KEY_LENGTH, MAX_PROJECT_NAME_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 {
|
|
10
|
-
export {
|
|
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 { 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 { 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, restMemberInputSchema, restMemberPatchSchema, restMemberSchema, restMembersSchema, restMePatchSchema, restMeSchema, restPeopleSchema, restPersonPatchSchema, restPersonSchema, restProjectIconSchema, restProjectInputSchema, restProjectPatchSchema, restProjectSchema, restProjectsSchema, restProviderSchema, restReportInputSchema, restReportSchema, restRunEndInputSchema, restRunInputSchema, restRunSchema, restRunsSchema, restSkillSchema, restSkillsSchema, restTaskCountsSchema, restTaskInputSchema, restTaskLinkSchema, restTaskPatchSchema, restTaskSchema, restTasksSchema, restTokenCreatedSchema, restTokenInputSchema, restTokenSchema, restTokensSchema, restVersionSchema, restVersionSummarySchema, restVersionsSchema, restWorkSchema, } from "./schemas.js";
|
|
11
12
|
export { hasForbiddenCodePoint } from "./text.js";
|
|
12
|
-
export { ARTIFACT_KINDS, EVENT_KINDS, isProviderKey, LINK_SOURCES, PERSON_ROLES, PROJECT_ROLES, PROJECT_VISIBILITIES, PROVIDER_KEYS, RUN_ENDINGS, RUN_STATUSES, SKILLS_STATUSES, TASK_PRIORITIES, TASK_STATES, } from "./vocabulary.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";
|
|
13
14
|
//# 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,
|
|
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,sBA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AqB,EACrB,gBAAgB,EAChB,qBAAqB,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,EAEd,eAAe,EAEf,WAAW,EAEX,WAAW,EAEX,WAAW,EAEX,aAAa,EACb,YAAY,EAEZ,gBAAgB,EAChB,YAAY,EAEZ,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,aAAa,EAKb,WAAW,EACX,YAAY,EAGZ,eAAe,EAEf,eAAe,EACf,WAAW,GAGZ,MAAM,iBAAiB,CAAC"}
|
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;AAatB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAuBrD,OAAO,EAA0C,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAQjF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C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAozCD,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
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { basename, extname } from "node:path";
|
|
2
2
|
import { parseArgs } from "node:util";
|
|
3
3
|
import { ApiError, createClient, } from "../client.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { addDays, dayOf as dayOfDate, isDay } from "../dates.js";
|
|
5
|
+
import { DEFAULT_PAGE_LIMIT, LIST_LIMIT, MAX_OPTIONS, MIN_OPTIONS } from "../limits.js";
|
|
6
|
+
import { GOAL_STATES, TASK_PRIORITIES, TASK_STATES, } from "../vocabulary.js";
|
|
6
7
|
import { loadWebRoot, WebRootError } from "../web.js";
|
|
7
|
-
import { formatAnswer, formatDecision, formatDecisionLine, formatDocument, formatDocuments, formatOptions, formatProjectLine, formatRun, formatRunLine, formatSkills, formatTask, formatTaskLine, formatVersion, formatVersionLine, } from "./format.js";
|
|
8
|
+
import { formatAnswer, formatCategoryLine, formatDecision, formatDecisionLine, formatDocument, formatDocuments, formatGoal, formatGoalLine, formatMore, formatOptions, formatProjectLine, formatRun, formatRunLine, formatSkills, formatTask, formatTaskLine, formatVersion, formatVersionLine, formatWork, } from "./format.js";
|
|
8
9
|
import { COMMAND_HELP, helpFor, usage } from "./help.js";
|
|
9
10
|
import { createServeHandler, DEFAULT_SERVE_PORT } from "./serve.js";
|
|
10
11
|
// The `console` command (docs/specs/cli.md): the agent's side of the console. A thin client of
|
|
@@ -156,6 +157,68 @@ function priorityOf(value) {
|
|
|
156
157
|
}
|
|
157
158
|
return found;
|
|
158
159
|
}
|
|
160
|
+
function goalStateOf(value) {
|
|
161
|
+
if (value === undefined) {
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
const found = GOAL_STATES.find((state) => state === value);
|
|
165
|
+
if (found === undefined) {
|
|
166
|
+
throw misuse(`Not a state of a goal: ${value}. One of ${GOAL_STATES.join(", ")}`);
|
|
167
|
+
}
|
|
168
|
+
return found;
|
|
169
|
+
}
|
|
170
|
+
/** Today by this machine's clock, as a day. */
|
|
171
|
+
const todayOf = (io) => dayOfDate(new Date(io.now()));
|
|
172
|
+
/**
|
|
173
|
+
* A day as a flag takes one: `2026-10-24`, `today`, `tomorrow`, or `+<n>` days from today; and
|
|
174
|
+
* `none` where a field may be cleared, which is `null` on the wire.
|
|
175
|
+
*/
|
|
176
|
+
function dayOf(io, value, clearable = false) {
|
|
177
|
+
if (value === undefined) {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
if (clearable && value === "none") {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
if (value === "today") {
|
|
184
|
+
return todayOf(io);
|
|
185
|
+
}
|
|
186
|
+
if (value === "tomorrow") {
|
|
187
|
+
return addDays(todayOf(io), 1);
|
|
188
|
+
}
|
|
189
|
+
const ahead = /^\+(\d{1,3})$/.exec(value);
|
|
190
|
+
if (ahead !== null) {
|
|
191
|
+
return addDays(todayOf(io), Number(ahead[1]));
|
|
192
|
+
}
|
|
193
|
+
if (!isDay(value)) {
|
|
194
|
+
throw misuse(`Not a day: ${value}. Say it as 2026-10-24, today, tomorrow, or +7`);
|
|
195
|
+
}
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
/** A value a field is set to, or `none` to clear it, which is `null` on the wire. */
|
|
199
|
+
const orNone = (value) => value === "none" ? null : value;
|
|
200
|
+
/** The id of the person a flag names: `me`, or a login of the workspace. */
|
|
201
|
+
async function personIdOf(session, value) {
|
|
202
|
+
if (value === undefined) {
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
if (value === "none") {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
if (value === "me") {
|
|
209
|
+
const me = await session.client.me();
|
|
210
|
+
if (me.person === null) {
|
|
211
|
+
throw failed("The console does not know this token. Sign in again: console login");
|
|
212
|
+
}
|
|
213
|
+
return me.person.id;
|
|
214
|
+
}
|
|
215
|
+
const { items } = await session.client.people();
|
|
216
|
+
const found = items.find((person) => person.login.toLowerCase() === value.toLowerCase());
|
|
217
|
+
if (found === undefined) {
|
|
218
|
+
throw misuse(`Nobody of the workspace is called ${value}. console people is not a command; the logins are as people sign in.`);
|
|
219
|
+
}
|
|
220
|
+
return found.id;
|
|
221
|
+
}
|
|
159
222
|
function secondsOf(value, fallback) {
|
|
160
223
|
if (value === undefined) {
|
|
161
224
|
return fallback;
|
|
@@ -166,6 +229,24 @@ function secondsOf(value, fallback) {
|
|
|
166
229
|
}
|
|
167
230
|
return seconds;
|
|
168
231
|
}
|
|
232
|
+
/** The flags of a page of a listing: how many, from which one on. */
|
|
233
|
+
const PAGE_OPTIONS = { limit: { type: "string" }, offset: { type: "string" } };
|
|
234
|
+
/** The page the flags ask for: `DEFAULT_PAGE_LIMIT` items from the first when nothing is said. */
|
|
235
|
+
function pageOf(values) {
|
|
236
|
+
const limit = text(values, "limit");
|
|
237
|
+
const offset = text(values, "offset");
|
|
238
|
+
const page = {
|
|
239
|
+
limit: limit === undefined ? DEFAULT_PAGE_LIMIT : Number(limit),
|
|
240
|
+
offset: offset === undefined ? 0 : Number(offset),
|
|
241
|
+
};
|
|
242
|
+
if (!Number.isInteger(page.limit) || page.limit < 1 || page.limit > LIST_LIMIT) {
|
|
243
|
+
throw misuse(`Not a number of items, 1 to ${LIST_LIMIT}: ${limit}`);
|
|
244
|
+
}
|
|
245
|
+
if (!Number.isInteger(page.offset) || page.offset < 0) {
|
|
246
|
+
throw misuse(`Not a number of items to skip: ${offset}`);
|
|
247
|
+
}
|
|
248
|
+
return page;
|
|
249
|
+
}
|
|
169
250
|
/** One positional, and nothing else. */
|
|
170
251
|
function theOne(positionals, ask) {
|
|
171
252
|
const [first] = positionals;
|
|
@@ -299,12 +380,59 @@ const use = async (args, io) => {
|
|
|
299
380
|
return EXIT.ok;
|
|
300
381
|
};
|
|
301
382
|
const tasks = async (args, io) => {
|
|
302
|
-
const { values } = parse(args, {
|
|
383
|
+
const { values } = parse(args, {
|
|
384
|
+
state: { type: "string" },
|
|
385
|
+
open: { type: "boolean" },
|
|
386
|
+
mine: { type: "boolean" },
|
|
387
|
+
category: { type: "string" },
|
|
388
|
+
goal: { type: "string" },
|
|
389
|
+
due: { type: "string" },
|
|
390
|
+
...PAGE_OPTIONS,
|
|
391
|
+
}, false);
|
|
303
392
|
const state = stateOf(text(values, "state"));
|
|
393
|
+
const page = pageOf(values);
|
|
304
394
|
const session = await open(io, values);
|
|
305
395
|
const project = await session.project();
|
|
306
|
-
|
|
307
|
-
|
|
396
|
+
// What is due: a day, or the words for the usual windows; overdue keeps only the open ones.
|
|
397
|
+
const due = text(values, "due");
|
|
398
|
+
const today = todayOf(io);
|
|
399
|
+
const dueBy = due === undefined
|
|
400
|
+
? undefined
|
|
401
|
+
: due === "overdue"
|
|
402
|
+
? addDays(today, -1)
|
|
403
|
+
: due === "week"
|
|
404
|
+
? addDays(today, 6)
|
|
405
|
+
: (dayOf(io, due) ?? undefined);
|
|
406
|
+
const assignee = on(values, "mine")
|
|
407
|
+
? ((await personIdOf(session, "me")) ?? undefined)
|
|
408
|
+
: undefined;
|
|
409
|
+
const found = await project.tasks({
|
|
410
|
+
...(state === undefined ? {} : { state }),
|
|
411
|
+
...(on(values, "open") || due === "overdue" ? { open: true } : {}),
|
|
412
|
+
...(assignee === undefined ? {} : { assignee }),
|
|
413
|
+
...(text(values, "category") === undefined ? {} : { category: text(values, "category") }),
|
|
414
|
+
...(text(values, "goal") === undefined ? {} : { goal: text(values, "goal") }),
|
|
415
|
+
...(dueBy === undefined ? {} : { dueBy }),
|
|
416
|
+
...page,
|
|
417
|
+
});
|
|
418
|
+
answer(io, session, found, () => found.items.length === 0
|
|
419
|
+
? "No tasks."
|
|
420
|
+
: found.items.map(formatTaskLine).join("\n") +
|
|
421
|
+
formatMore(found.more, page.limit, page.offset));
|
|
422
|
+
return EXIT.ok;
|
|
423
|
+
};
|
|
424
|
+
const work = async (args, io) => {
|
|
425
|
+
const { values } = parse(args, {}, false);
|
|
426
|
+
const session = await open(io, values);
|
|
427
|
+
const found = await session.client.work();
|
|
428
|
+
answer(io, session, found, () => formatWork(found));
|
|
429
|
+
return EXIT.ok;
|
|
430
|
+
};
|
|
431
|
+
const categories = async (args, io) => {
|
|
432
|
+
const { values } = parse(args, {}, false);
|
|
433
|
+
const session = await open(io, values);
|
|
434
|
+
const found = await session.client.categories();
|
|
435
|
+
answer(io, session, found, () => found.items.length === 0 ? "No categories." : found.items.map(formatCategoryLine).join("\n"));
|
|
308
436
|
return EXIT.ok;
|
|
309
437
|
};
|
|
310
438
|
const skills = async (args, io) => {
|
|
@@ -315,32 +443,90 @@ const skills = async (args, io) => {
|
|
|
315
443
|
answer(io, session, found, () => formatSkills(found));
|
|
316
444
|
return EXIT.ok;
|
|
317
445
|
};
|
|
446
|
+
/** The flags that set a task's fields, shared by writing one and changing one. */
|
|
447
|
+
const TASK_FIELDS = {
|
|
448
|
+
state: { type: "string" },
|
|
449
|
+
priority: { type: "string" },
|
|
450
|
+
category: { type: "string" },
|
|
451
|
+
goal: { type: "string" },
|
|
452
|
+
starts: { type: "string" },
|
|
453
|
+
due: { type: "string" },
|
|
454
|
+
assignee: { type: "string" },
|
|
455
|
+
parent: { type: "string" },
|
|
456
|
+
};
|
|
457
|
+
/** What the flags say of a task's fields, as the API takes them; `none` clears a field. */
|
|
458
|
+
async function taskFieldsOf(io, session, project, values) {
|
|
459
|
+
const state = stateOf(text(values, "state"));
|
|
460
|
+
const priority = priorityOf(text(values, "priority"));
|
|
461
|
+
const category = orNone(text(values, "category"));
|
|
462
|
+
const goalId = orNone(text(values, "goal"));
|
|
463
|
+
const startsOn = dayOf(io, text(values, "starts"), true);
|
|
464
|
+
const dueOn = dayOf(io, text(values, "due"), true);
|
|
465
|
+
const assigneeId = await personIdOf(session, text(values, "assignee"));
|
|
466
|
+
const parent = text(values, "parent");
|
|
467
|
+
const parentId = parent === undefined ? undefined : parent === "none" ? null : (await project.task(parent)).id;
|
|
468
|
+
return {
|
|
469
|
+
...(state === undefined ? {} : { state }),
|
|
470
|
+
...(priority === undefined ? {} : { priority }),
|
|
471
|
+
...(category === undefined ? {} : { category }),
|
|
472
|
+
...(goalId === undefined ? {} : { goalId }),
|
|
473
|
+
...(startsOn === undefined ? {} : { startsOn }),
|
|
474
|
+
...(dueOn === undefined ? {} : { dueOn }),
|
|
475
|
+
...(assigneeId === undefined ? {} : { assigneeId }),
|
|
476
|
+
...(parentId === undefined ? {} : { parentId }),
|
|
477
|
+
};
|
|
478
|
+
}
|
|
318
479
|
const newTask = async (args, io) => {
|
|
319
480
|
const { values, positionals } = parse(args, {
|
|
481
|
+
...TASK_FIELDS,
|
|
320
482
|
body: { type: "string" },
|
|
321
483
|
file: { type: "string" },
|
|
322
|
-
state: { type: "string" },
|
|
323
|
-
priority: { type: "string" },
|
|
324
484
|
});
|
|
325
485
|
const title = theOne(positionals, 'Say the title: console task new "<title>"');
|
|
326
|
-
const state = stateOf(text(values, "state"));
|
|
327
|
-
const priority = priorityOf(text(values, "priority"));
|
|
328
486
|
const body = await bodyOf(io, values, text(values, "body"));
|
|
329
487
|
const session = await open(io, values);
|
|
330
488
|
const project = await session.project();
|
|
489
|
+
const fields = await taskFieldsOf(io, session, project, values);
|
|
331
490
|
const made = await project.createTask({
|
|
332
491
|
title,
|
|
333
492
|
...(body === undefined ? {} : { body }),
|
|
334
|
-
...
|
|
335
|
-
...(priority === undefined ? {} : { priority }),
|
|
493
|
+
...fields,
|
|
336
494
|
});
|
|
337
495
|
answer(io, session, made, () => `Task #${made.number} written: ${made.title}\nid: ${made.id}`);
|
|
338
496
|
return EXIT.ok;
|
|
339
497
|
};
|
|
498
|
+
const editTask = async (args, io) => {
|
|
499
|
+
const { values, positionals } = parse(args, {
|
|
500
|
+
...TASK_FIELDS,
|
|
501
|
+
title: { type: "string" },
|
|
502
|
+
body: { type: "string" },
|
|
503
|
+
file: { type: "string" },
|
|
504
|
+
});
|
|
505
|
+
const ref = theOne(positionals, "Say which task: console task edit <number|id> --due <day> [--category <key>] ...");
|
|
506
|
+
const body = await bodyOf(io, values, text(values, "body"));
|
|
507
|
+
const session = await open(io, values);
|
|
508
|
+
const project = await session.project();
|
|
509
|
+
const title = text(values, "title");
|
|
510
|
+
const patch = {
|
|
511
|
+
...(title === undefined ? {} : { title }),
|
|
512
|
+
...(body === undefined ? {} : { body }),
|
|
513
|
+
...(await taskFieldsOf(io, session, project, values)),
|
|
514
|
+
};
|
|
515
|
+
if (Object.keys(patch).length === 0) {
|
|
516
|
+
throw misuse("Say what to change: --title, --body, --state, --priority, --category, --goal, --starts, --due, --assignee or --parent; none clears a field.");
|
|
517
|
+
}
|
|
518
|
+
const found = await project.task(ref);
|
|
519
|
+
const changed = await project.updateTask(found.id, patch);
|
|
520
|
+
answer(io, session, changed, () => formatTask(changed));
|
|
521
|
+
return EXIT.ok;
|
|
522
|
+
};
|
|
340
523
|
const task = async (args, io) => {
|
|
341
524
|
if (args[0] === "new") {
|
|
342
525
|
return newTask(args.slice(1), io);
|
|
343
526
|
}
|
|
527
|
+
if (args[0] === "edit") {
|
|
528
|
+
return editTask(args.slice(1), io);
|
|
529
|
+
}
|
|
344
530
|
const { values, positionals } = parse(args, {});
|
|
345
531
|
const ref = theOne(positionals, "Say which task: console task <number|id>");
|
|
346
532
|
const session = await open(io, values);
|
|
@@ -365,7 +551,7 @@ const take = async (args, io) => {
|
|
|
365
551
|
...(agent === undefined ? {} : { agent }),
|
|
366
552
|
});
|
|
367
553
|
answer(io, session, { run, task: found }, () => [
|
|
368
|
-
`Run ${run.id} began on #${found.number} ${found.title}, as "${run.agent}" for ${run.person.login}. The task is in progress and theirs.`,
|
|
554
|
+
`Run ${run.id} began on #${found.number} ${found.title}, as "${run.agent}" for ${run.person.login}. The task is in progress and theirs. A run that was open on it is over now: the board cannot know whether its agent still ran, so taking it was deciding.`,
|
|
369
555
|
"",
|
|
370
556
|
formatTask(found),
|
|
371
557
|
"",
|
|
@@ -636,12 +822,90 @@ const restore = async (args, io) => {
|
|
|
636
822
|
answer(io, session, back, () => `Restored ${back.path} (${back.title}).`);
|
|
637
823
|
return EXIT.ok;
|
|
638
824
|
};
|
|
825
|
+
const goals = async (args, io) => {
|
|
826
|
+
const { values } = parse(args, {}, false);
|
|
827
|
+
const session = await open(io, values);
|
|
828
|
+
const project = await session.project();
|
|
829
|
+
const found = await project.goals();
|
|
830
|
+
answer(io, session, found, () => found.items.length === 0
|
|
831
|
+
? "No goals. An owner sets one: console goal new <title> --due <day>"
|
|
832
|
+
: found.items.map(formatGoalLine).join("\n"));
|
|
833
|
+
return EXIT.ok;
|
|
834
|
+
};
|
|
835
|
+
const GOAL_FIELDS = {
|
|
836
|
+
state: { type: "string" },
|
|
837
|
+
due: { type: "string" },
|
|
838
|
+
body: { type: "string" },
|
|
839
|
+
file: { type: "string" },
|
|
840
|
+
};
|
|
841
|
+
const newGoal = async (args, io) => {
|
|
842
|
+
const { values, positionals } = parse(args, GOAL_FIELDS);
|
|
843
|
+
const title = theOne(positionals, 'Say the title: console goal new "<title>" [--due <day>]');
|
|
844
|
+
const state = goalStateOf(text(values, "state"));
|
|
845
|
+
const dueOn = dayOf(io, text(values, "due"));
|
|
846
|
+
const body = await bodyOf(io, values, text(values, "body"));
|
|
847
|
+
const session = await open(io, values);
|
|
848
|
+
const project = await session.project();
|
|
849
|
+
const made = await project.createGoal({
|
|
850
|
+
title,
|
|
851
|
+
...(body === undefined ? {} : { body }),
|
|
852
|
+
...(state === undefined ? {} : { state }),
|
|
853
|
+
...(dueOn === undefined ? {} : { dueOn }),
|
|
854
|
+
});
|
|
855
|
+
answer(io, session, made, () => `Goal set: ${made.title}\nid: ${made.id}`);
|
|
856
|
+
return EXIT.ok;
|
|
857
|
+
};
|
|
858
|
+
const editGoal = async (args, io) => {
|
|
859
|
+
const { values, positionals } = parse(args, { ...GOAL_FIELDS, title: { type: "string" } });
|
|
860
|
+
const id = theOne(positionals, "Say which goal: console goal edit <id> --state <state> ...");
|
|
861
|
+
const title = text(values, "title");
|
|
862
|
+
const state = goalStateOf(text(values, "state"));
|
|
863
|
+
const dueOn = dayOf(io, text(values, "due"), true);
|
|
864
|
+
const body = await bodyOf(io, values, text(values, "body"));
|
|
865
|
+
const patch = {
|
|
866
|
+
...(title === undefined ? {} : { title }),
|
|
867
|
+
...(body === undefined ? {} : { body }),
|
|
868
|
+
...(state === undefined ? {} : { state }),
|
|
869
|
+
...(dueOn === undefined ? {} : { dueOn }),
|
|
870
|
+
};
|
|
871
|
+
if (Object.keys(patch).length === 0) {
|
|
872
|
+
throw misuse("Say what to change: --title, --body, --state or --due; --due none clears the day.");
|
|
873
|
+
}
|
|
874
|
+
const session = await open(io, values);
|
|
875
|
+
const project = await session.project();
|
|
876
|
+
const changed = await project.updateGoal(id, patch);
|
|
877
|
+
answer(io, session, changed, () => formatGoal(changed));
|
|
878
|
+
return EXIT.ok;
|
|
879
|
+
};
|
|
880
|
+
const goal = async (args, io) => {
|
|
881
|
+
if (args[0] === "new") {
|
|
882
|
+
return newGoal(args.slice(1), io);
|
|
883
|
+
}
|
|
884
|
+
if (args[0] === "edit") {
|
|
885
|
+
return editGoal(args.slice(1), io);
|
|
886
|
+
}
|
|
887
|
+
const { values, positionals } = parse(args, {});
|
|
888
|
+
const id = theOne(positionals, "Say which goal: console goal <id>");
|
|
889
|
+
const session = await open(io, values);
|
|
890
|
+
const project = await session.project();
|
|
891
|
+
const found = await project.goal(id);
|
|
892
|
+
const towards = await project.tasks({ goal: found.id });
|
|
893
|
+
answer(io, session, { goal: found, tasks: towards.items }, () => formatGoal(found, towards.items));
|
|
894
|
+
return EXIT.ok;
|
|
895
|
+
};
|
|
639
896
|
const decisions = async (args, io) => {
|
|
640
|
-
const { values } = parse(args, { open: { type: "boolean" } }, false);
|
|
897
|
+
const { values } = parse(args, { open: { type: "boolean" }, ...PAGE_OPTIONS }, false);
|
|
898
|
+
const page = pageOf(values);
|
|
641
899
|
const session = await open(io, values);
|
|
642
900
|
const project = await session.project();
|
|
643
|
-
const found = await project.decisions(
|
|
644
|
-
|
|
901
|
+
const found = await project.decisions({
|
|
902
|
+
...(on(values, "open") ? { open: true } : {}),
|
|
903
|
+
...page,
|
|
904
|
+
});
|
|
905
|
+
answer(io, session, found, () => found.items.length === 0
|
|
906
|
+
? "No decisions."
|
|
907
|
+
: found.items.map(formatDecisionLine).join("\n") +
|
|
908
|
+
formatMore(found.more, page.limit, page.offset));
|
|
645
909
|
return EXIT.ok;
|
|
646
910
|
};
|
|
647
911
|
const ending = (status) => async (args, io) => {
|
|
@@ -680,7 +944,13 @@ const abandon = async (args, io) => {
|
|
|
680
944
|
return EXIT.ok;
|
|
681
945
|
};
|
|
682
946
|
const runs = async (args, io) => {
|
|
683
|
-
const { values } = parse(args, {
|
|
947
|
+
const { values } = parse(args, {
|
|
948
|
+
task: { type: "string" },
|
|
949
|
+
open: { type: "boolean" },
|
|
950
|
+
mine: { type: "boolean" },
|
|
951
|
+
...PAGE_OPTIONS,
|
|
952
|
+
}, false);
|
|
953
|
+
const page = pageOf(values);
|
|
684
954
|
const session = await open(io, values);
|
|
685
955
|
const project = await session.project();
|
|
686
956
|
const ref = text(values, "task");
|
|
@@ -689,8 +959,11 @@ const runs = async (args, io) => {
|
|
|
689
959
|
...(taskId === undefined ? {} : { task: taskId }),
|
|
690
960
|
...(on(values, "open") ? { open: true } : {}),
|
|
691
961
|
...(on(values, "mine") ? { mine: true } : {}),
|
|
962
|
+
...page,
|
|
692
963
|
});
|
|
693
|
-
answer(io, session, found, () => found.items.length === 0
|
|
964
|
+
answer(io, session, found, () => found.items.length === 0
|
|
965
|
+
? "No runs."
|
|
966
|
+
: found.items.map(formatRunLine).join("\n") + formatMore(found.more, page.limit, page.offset));
|
|
694
967
|
return EXIT.ok;
|
|
695
968
|
};
|
|
696
969
|
const run = async (args, io) => {
|
|
@@ -766,8 +1039,12 @@ const COMMANDS = {
|
|
|
766
1039
|
serve,
|
|
767
1040
|
projects,
|
|
768
1041
|
use,
|
|
1042
|
+
work,
|
|
769
1043
|
tasks,
|
|
770
1044
|
task,
|
|
1045
|
+
goals,
|
|
1046
|
+
goal,
|
|
1047
|
+
categories,
|
|
771
1048
|
skills,
|
|
772
1049
|
take,
|
|
773
1050
|
report,
|
|
@@ -812,6 +1089,14 @@ function hintFor(error) {
|
|
|
812
1089
|
return "The page has moved on since the version you started from. Read it again, and write from there.\n";
|
|
813
1090
|
case "document.archived":
|
|
814
1091
|
return "The page is archived. console restore <path> brings it back first.\n";
|
|
1092
|
+
case "task.invalid_category":
|
|
1093
|
+
return "No category has that key. console categories lists them.\n";
|
|
1094
|
+
case "task.invalid_goal":
|
|
1095
|
+
return "No goal of this project has that id. console goals lists them.\n";
|
|
1096
|
+
case "task.invalid_dates":
|
|
1097
|
+
return "The due day is before the start. Say a due day on or after it.\n";
|
|
1098
|
+
case "goal.not_found":
|
|
1099
|
+
return "No goal of this project has that id. console goals lists them.\n";
|
|
815
1100
|
case "connect.too_many":
|
|
816
1101
|
return "The console holds as many connections as it may at once. Try again in a few minutes.\n";
|
|
817
1102
|
case "network":
|