@agent-workshop/adoc-plugin-todo 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ Copyright (C) 2026 adoc contributors
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
4
+
5
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # Third-party notices
2
+
3
+ adoc's original code and documentation use the Zero-Clause BSD License (0BSD). That license does not replace the
4
+ licenses of third-party components, and no third-party component is relicensed by this repository.
5
+
6
+ ## Browser distributions
7
+
8
+ Two packages carry bundled browser code:
9
+
10
+ - `@agent-workshop/adoc-webapp`: the web UI in `dist/`. Its build records the packages actually bundled in
11
+ `dist/licenses/packages.json` and copies their upstream LICENSE, COPYING, COPYRIGHT and NOTICE files beneath
12
+ `dist/licenses/`.
13
+ - `@agent-workshop/adoc-plugin-sketch`: the drawing board in `client/`, with its inventory and license files in
14
+ `client/licenses/`.
15
+
16
+ Keep these files when redistributing the built browser assets.
17
+
18
+ The main browser dependencies are React, React DOM, React Router, Mermaid (with KaTeX), xterm.js and Lucide in the web
19
+ UI, and Excalidraw with React and Radix UI in the drawing board. Most use MIT, ISC, BSD or Apache-2.0.
20
+
21
+ - DOMPurify offers MPL-2.0 OR Apache-2.0; adoc uses the Apache-2.0 option.
22
+ - Some packages are published without a license file although their manifest names one: Excalidraw, the Radix UI
23
+ primitives, react-remove-scroll-bar and fastdom (all MIT). The build includes the upstream texts kept in
24
+ `tooling/licenses/`.
25
+
26
+ ### Eclipse Layout Kernel / elkjs
27
+
28
+ Mermaid bundles elkjs, a separately licensed layout engine, which adoc uses under EPL-2.0 without modifying it. Its
29
+ license is included in the generated license inventory. Corresponding source is available from:
30
+
31
+ - https://github.com/kieler/elkjs (select the release matching the inventory version)
32
+ - https://github.com/eclipse/elk (the underlying Eclipse Layout Kernel)
33
+ - https://www.eclipse.org/legal/epl-2.0/
34
+
35
+ Recipients may obtain, modify and redistribute the EPL-covered source under EPL-2.0. adoc's 0BSD license applies to its
36
+ independent code, not to ELK.
37
+
38
+ ## Fonts
39
+
40
+ - The web UI serves Pretendard, D2Coding (both SIL Open Font License 1.1) and Symbols Nerd Font Mono; their license
41
+ files are next to them in `dist/assets/fonts/`.
42
+ - The drawing board serves the fonts that Excalidraw ships in `client/fonts/` (Excalifont, Virgil, Nunito, Lilita One,
43
+ Comic Shanns, Cascadia Code, Liberation Sans, Assistant and Xiaolai); they are distributed under the terms that
44
+ Excalidraw states for them in https://github.com/excalidraw/excalidraw.
45
+
46
+ ## Installed runtime dependencies
47
+
48
+ The packages that npm installs next to adoc, such as the MCP SDK, ws, yaml, zod, semver, commander, markdown-it and
49
+ highlight.js, are not bundled: each keeps its own license in its own package.
package/dist/index.js ADDED
@@ -0,0 +1,64 @@
1
+ import { action, anchor, definePlugin, html, markdown, raw, source } from "@agent-workshop/adoc-plugin-kit";
2
+ const ITEM = /^(\s*)- \[( |x|X)\] (.*)$/;
3
+ const GROUP = /^## (.+)$/;
4
+ function parse(doc) {
5
+ const lines = doc.text.split("\n");
6
+ const title = lines.find((l) => l.startsWith("# "))?.slice(2).trim();
7
+ const items = [];
8
+ const groups = [{ items: [] }];
9
+ lines.forEach((l, i) => {
10
+ const heading = GROUP.exec(l);
11
+ if (heading) groups.push({ line: i + 1, heading: heading[1].trim(), items: [] });
12
+ const m = ITEM.exec(l);
13
+ if (m) {
14
+ const item = { line: i + 1, done: m[2] !== " ", text: m[3] };
15
+ items.push(item);
16
+ groups[groups.length - 1].items.push(item);
17
+ }
18
+ });
19
+ return { title, items, groups: groups.filter((g) => g.heading !== void 0 || g.items.length > 0), lines };
20
+ }
21
+ var index_default = definePlugin({
22
+ description: "A list of one-line things to do, as a Markdown task list.",
23
+ layout: { kind: "file", extension: ".md" },
24
+ summarize(doc) {
25
+ const { title, items } = parse(doc);
26
+ const done = items.filter((i) => i.done).length;
27
+ return { title: title ?? doc.key, status: `${done}/${items.length} done`, fields: { open: items.length - done, done } };
28
+ },
29
+ render(doc) {
30
+ const { items, groups } = parse(doc);
31
+ const list = (group) => html`
32
+ <ul class="adoc-list">
33
+ ${group.items.map(
34
+ (item) => html`
35
+ <li class="adoc-item ${item.done ? "adoc-done" : ""}" ${anchor(item.line)} ${source(doc.file, item.line)}>
36
+ <input type="checkbox" ${action({ kind: "toggle", name: "toggle", value: item.line, confirm: item.done ? "Ask the agent to reopen this item?" : "Ask the agent to do this item?" })} ${item.done ? raw("checked") : ""} />
37
+ <span>${markdown(item.text, { inline: true })}</span>
38
+ </li>`
39
+ )}
40
+ </ul>`;
41
+ return html`
42
+ ${items.length ? "" : html`<p class="adoc-muted">No items yet.</p>`}
43
+ ${groups.map(
44
+ (group) => group.heading === void 0 ? list(group) : html`
45
+ <section class="adoc-section" ${anchor(group.line)}>
46
+ <h2 ${source(doc.file, group.line)}>${markdown(group.heading, { inline: true })} <span class="adoc-muted">${group.items.filter((i) => i.done).length}/${group.items.length}</span></h2>
47
+ ${list(group)}
48
+ </section>`
49
+ )}`;
50
+ },
51
+ actions: {
52
+ // A click asks the agent: checking an open item asks it to do the item, unchecking a done one to reopen it.
53
+ // The file stays as it is until the agent checks or unchecks the item itself.
54
+ toggle(doc, event) {
55
+ const { lines } = parse(doc);
56
+ const m = ITEM.exec(lines[Number(event.value) - 1] ?? "");
57
+ if (!m) throw new Error(`line ${event.value} is not a task item`);
58
+ return { message: `user request: ${event.checked ? "do" : "reopen"} item ${doc.key}#${event.value}: ${m[3]}` };
59
+ }
60
+ }
61
+ });
62
+ export {
63
+ index_default as default
64
+ };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@agent-workshop/adoc-plugin-todo",
3
+ "version": "0.1.0",
4
+ "license": "0BSD",
5
+ "type": "module",
6
+ "description": "The TODO plugin of adoc: lists of one-line things to do, as Markdown task lists.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/dirty49374/adoc.git",
10
+ "directory": "plugins/todo"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "skill",
15
+ "LICENSE",
16
+ "THIRD_PARTY_NOTICES.md"
17
+ ],
18
+ "engines": {
19
+ "node": ">=24"
20
+ },
21
+ "publishConfig": {
22
+ "registry": "https://registry.npmjs.org",
23
+ "access": "public"
24
+ },
25
+ "exports": {
26
+ ".": "./dist/index.js",
27
+ "./package.json": "./package.json"
28
+ },
29
+ "peerDependencies": {
30
+ "@agent-workshop/adoc-plugin-kit": "^0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "esbuild": "0.28.2",
34
+ "@agent-workshop/adoc-plugin-kit": "0.1.0"
35
+ },
36
+ "scripts": {
37
+ "build": "esbuild index.ts --outfile=dist/index.js --format=esm --platform=node --log-level=warning"
38
+ }
39
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: adoc-todo
3
+ description: "TODO documents: lists of one-line things to do, as Markdown task lists with optional groups. Use when the user wants something remembered or done that fits in one line, or comments on, checks or groups TODO items."
4
+ ---
5
+
6
+ # TODO documents
7
+
8
+ Document keys look like `TODO-<local id>`. Read the general workflow with `adoc skill view adoc`.
9
+
10
+ ## Purpose
11
+
12
+ A TODO list keeps small things to do, each one line, so that nothing small gets lost. Bigger work, which needs a design or several steps, becomes a TASK instead.
13
+
14
+ ## States and workflow
15
+
16
+ - An item is open (`- [ ]`) or done (`- [x]`). Only you check and uncheck items: when you finish one, or when the user asks.
17
+ - In the web UI, checking an open item asks you to do it, and unchecking a done one asks you to reopen it (see Actions); the box stays as it is until you change the file.
18
+ - Group related items under `## Heading` lines when the list has more than about ten items; keep done items in their group so that the group shows its progress.
19
+
20
+ ## Instructions
21
+
22
+ - Keep every item one line. When an item needs more than a line, it is a TASK: propose one in your conversation; once the user agrees, create the TASK and point the item to it: `- [ ] Rework the auth layer: [[TASK-261010-auth]]`.
23
+ - When you finish an item, check it and append `; done: …`, saying what was done and where, such as a commit or a document key.
24
+ - When the user asks to add something "to the TODO", add one item in the right group; create a group when none fits.
25
+ - Never delete or reword an item the user wrote without asking; you only check it, append the `done:` clause, or point it to a TASK the user agreed to.
26
+ - Check an item that points to a TASK when the TASK is DONE, and list the TODO in the TASK's `related:`.
27
+ - Ask the user in your conversation, not in the file: the view shows only items and group headings.
28
+
29
+ ## File
30
+
31
+ `TODO-<local id>.md`, a Markdown task list under an optional `# Title`:
32
+
33
+ ```markdown
34
+ # GUI work
35
+
36
+ - [ ] Refactor PaymentRepo
37
+
38
+ ## Login screen
39
+
40
+ - [x] Dark mode for the login screen; done: [[TASK-260930-dark-mode]]
41
+ - [ ] Remember the last user name
42
+ ```
43
+
44
+ - One item per line: `- [ ] text` (open) or `- [x] text` (done). Write `[[KEY]]` to refer to another document.
45
+ - A `## Heading` line starts a group, until the next heading; items before the first heading have no group. Other lines are ignored by the view.
46
+ - Recommended local id: a topic, such as `TODO-gui` or `TODO-backend`.
47
+
48
+ ## Anchors
49
+
50
+ The anchor of an item, and of a group heading, is its 1-based line number: `TODO-gui#5` is line 5. If the line moved, find the item by the `quote` of the comment, or by the item text in an action message.
51
+
52
+ ## Actions
53
+
54
+ | action | what adoc already did | what you do |
55
+ |---|---|---|
56
+ | `toggle`, message `user request: do item TODO-gui#3: …` | nothing (`applied: false`) | do the item, then check it and append `; done: …` |
57
+ | `toggle`, message `user request: reopen item TODO-gui#3: …` | nothing (`applied: false`) | uncheck the item, remove its `done:` clause, and do what the user asks with it |