@agent-workshop/adoc-plugin-note 0.0.0-stage → 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,63 @@
1
+ import { anchor, definePlugin, frontmatter, html, markdown, ref, slug, source } from "@agent-workshop/adoc-plugin-kit";
2
+ function parse(doc) {
3
+ const { data, body, bodyLine } = frontmatter(doc.text);
4
+ const sections = [];
5
+ let intro = "";
6
+ body.split("\n").forEach((l, i) => {
7
+ const m = /^## (.+)$/.exec(l);
8
+ if (m) sections.push({ heading: m[1].trim(), anchor: slug(m[1]), line: bodyLine + i, body: "", bodyLine: bodyLine + i + 1 });
9
+ else if (sections.length) sections[sections.length - 1].body += l + "\n";
10
+ else intro += l + "\n";
11
+ });
12
+ const status = String(data.status ?? "OPEN");
13
+ const movedTo = data.moved_to ? String(data.moved_to) : void 0;
14
+ return { title: String(data.title ?? doc.key), status, movedTo, intro, bodyLine, sections };
15
+ }
16
+ function count(section) {
17
+ return section ? section.body.split("\n").filter((l) => /^\s*[-*] /.test(l)).length : 0;
18
+ }
19
+ function renderNote(doc, previous) {
20
+ const note = parse(doc);
21
+ const before = previous ? parse(previous) : void 0;
22
+ const old = new Map(before?.sections.map((s) => [s.anchor, s]));
23
+ const removed = before ? before.sections.filter((s) => !note.sections.some((n) => n.anchor === s.anchor)) : [];
24
+ return html`
25
+ <div class="adoc-toolbar">
26
+ ${note.movedTo ? html`<span class="adoc-muted">moved to ${ref(note.movedTo)}</span>` : ""}
27
+ ${before && before.status !== note.status ? html`<span class="adoc-changed">status: ${before.status} → ${note.status}</span>` : ""}
28
+ </div>
29
+ ${note.intro.trim() ? markdown(note.intro, { file: doc.file, line: note.bodyLine }) : ""}
30
+ ${note.sections.map((s) => {
31
+ const prior = old.get(s.anchor);
32
+ const mark = !before ? "" : !prior ? "adoc-added" : prior.body.trim() !== s.body.trim() ? "adoc-changed" : "";
33
+ return html`
34
+ <section class="adoc-section ${mark}" ${anchor(s.anchor)}>
35
+ <h2 ${source(doc.file, s.line)}>${s.heading}${mark ? html` <span class="adoc-chip">${mark === "adoc-added" ? "new" : "changed"}</span>` : ""}</h2>
36
+ ${markdown(s.body, { file: doc.file, line: s.bodyLine })}
37
+ </section>`;
38
+ })}
39
+ ${removed.map(
40
+ (s) => html`
41
+ <section class="adoc-section adoc-removed">
42
+ <h2>${s.heading} <span class="adoc-chip">removed</span></h2>
43
+ ${markdown(s.body)}
44
+ </section>`
45
+ )}`;
46
+ }
47
+ var index_default = definePlugin({
48
+ description: "A free-form shared note: ideas from a conversation, open questions, decisions, or anything the two of you want to keep.",
49
+ layout: { kind: "file", extension: ".md" },
50
+ summarize(doc) {
51
+ const note = parse(doc);
52
+ const questions = count(note.sections.find((s) => s.anchor === "open-questions"));
53
+ const decisions = count(note.sections.find((s) => s.anchor === "decisions"));
54
+ const fields = { "open questions": questions, decisions };
55
+ if (note.movedTo) fields["moved to"] = note.movedTo;
56
+ return { title: note.title, status: note.status === "OPEN" ? `OPEN \xB7 ${questions} open questions` : note.status, fields };
57
+ },
58
+ render: (doc) => renderNote(doc),
59
+ renderChanges: (doc, previous) => renderNote(doc, previous)
60
+ });
61
+ export {
62
+ index_default as default
63
+ };
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@agent-workshop/adoc-plugin-note",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "license": "0BSD",
5
+ "type": "module",
6
+ "description": "The NOTE plugin of adoc: free-form shared notes for ideas, open questions and decisions.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/dirty49374/adoc.git",
10
+ "directory": "plugins/note"
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
+ }
6
39
  }
package/skill/SKILL.md ADDED
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: adoc-note
3
+ description: "NOTE documents: free-form shared notes for ideas, open questions and decisions. Use when discussing an idea with the user, explaining something (with Mermaid diagrams), or recording decisions before they become TODO items or TASKs."
4
+ ---
5
+
6
+ # NOTE documents
7
+
8
+ Document keys look like `NOTE-<local id>`. Read the general workflow with `adoc skill view adoc`.
9
+
10
+ ## Purpose
11
+
12
+ A NOTE is the shared space where the user and the agent think together: an idea from a conversation developed with comments, a comparison of options, an explanation, meeting notes, or casual talk. The user refines it with comments instead of re-reading the chat. Not every note has to lead anywhere.
13
+
14
+ ## States and workflow
15
+
16
+ - `OPEN` while the idea is being developed: items move from **Open questions** to **Decisions** as the user answers.
17
+ - When the idea is ready, agree with the user in the conversation on what it becomes: TODO items, a TASK (which lists the note in `notes:`), a spec change, or nothing. When it went into documents, set `status: MOVED` and `moved_to:` the key of the main one, and name the others under **Decisions**. A note that led to nothing stays `OPEN` until it is archived.
18
+ - Finished notes are archived like any document, when the user asks, or with the TASKs that list them in `notes:` (see the TASK skill).
19
+
20
+ ## Instructions
21
+
22
+ - Write the body in the user's language; the section headings stay in English as below, so that their anchors stay stable.
23
+ - When a conversation produced an idea worth keeping, write a note yourself: summarize what was said into the sections, run `adoc check`, commit, and open it for the user with `adoc ui open NOTE-<local id>`.
24
+ - Draw state machines, sequences and structures with Mermaid (```` ```mermaid ````) whenever a picture explains faster than prose.
25
+ - Keep **Open questions** and **Decisions** short and current, one item per bullet (the status counts the bullets of **Open questions**): rewrite instead of appending history (git keeps the history).
26
+ - Ask the user in **Open questions**, not with `> Question:`. When the user answers a question, move it to **Decisions** with the answer; mark a decision you made on their behalf with `(agent's decision)`.
27
+ - Never turn a note into a TASK without the user's agreement; propose it.
28
+
29
+ ## File
30
+
31
+ `NOTE-<local id>.md`: YAML front matter, then Markdown with `##` sections.
32
+
33
+ ```markdown
34
+ ---
35
+ title: NOTE plugin
36
+ status: OPEN # OPEN | MOVED
37
+ moved_to: TASK-261003-note-plugin # only when MOVED
38
+ ---
39
+
40
+ ## Background
41
+
42
+ Why this came up.
43
+
44
+ ## Ideas
45
+
46
+ - …
47
+
48
+ ## Open questions
49
+
50
+ - …
51
+
52
+ ## Decisions
53
+
54
+ - …
55
+ ```
56
+
57
+ - The four sections are the default for developing an idea; use any sections, or none, when the note is about something else.
58
+ - Write `[[KEY]]` to refer to other documents.
59
+ - Recommended local id: today's date (yymmdd) and a title, such as `NOTE-261002-note-plugin`.
60
+
61
+ ## Anchors
62
+
63
+ The anchor of a section is its heading in lowercase, with every run of other characters than letters and digits turned into one hyphen: `## Open questions` is `NOTE-…#open-questions`.
64
+
65
+ ## Actions
66
+
67
+ None of its own beyond the common `archive` and `unarchive` (see the adoc skill).
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.