pi-kanban 0.3.1 → 2.0.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.
Files changed (129) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +61 -21
  3. package/cli.js +1586 -0
  4. package/extensions/kanban.ts +330 -367
  5. package/extensions/package.json +1 -0
  6. package/extensions/tools/ask.ts +85 -0
  7. package/extensions/tools/board-api.ts +142 -0
  8. package/extensions/tools/cli-path.ts +34 -0
  9. package/extensions/tools/dispatch.ts +56 -0
  10. package/extensions/tools/inbox.ts +86 -0
  11. package/extensions/tools/kanban-command.ts +27 -0
  12. package/extensions/tools/scratchpad.ts +70 -0
  13. package/extensions/tsconfig.json +16 -0
  14. package/lib/agent-dir.js +20 -0
  15. package/lib/agent-log.js +64 -0
  16. package/lib/ask.js +252 -0
  17. package/lib/atomic-write.js +30 -0
  18. package/lib/board-dir.js +63 -0
  19. package/lib/claude-settings.js +21 -0
  20. package/lib/companion-host.js +142 -0
  21. package/lib/companions.js +136 -0
  22. package/lib/contain.js +78 -0
  23. package/lib/dispatch-reports.js +86 -0
  24. package/lib/file-url.js +38 -0
  25. package/lib/folder-dialog.js +91 -0
  26. package/lib/frame-policy.js +79 -0
  27. package/lib/git-branch.js +37 -102
  28. package/lib/http-error.js +7 -0
  29. package/lib/inline-assets.js +238 -0
  30. package/lib/linked-docs.js +56 -0
  31. package/lib/live-sessions.js +86 -0
  32. package/lib/model-windows.js +48 -0
  33. package/lib/net-guard.js +277 -0
  34. package/lib/one-line.js +6 -0
  35. package/lib/open-editor.js +173 -0
  36. package/lib/panes.js +213 -0
  37. package/lib/parsers.js +1434 -0
  38. package/lib/pi-agents.js +178 -0
  39. package/lib/pi-git-branch.js +112 -0
  40. package/lib/pi-models.js +34 -0
  41. package/lib/pi-sessions.js +240 -0
  42. package/lib/pi-transcript.js +354 -0
  43. package/lib/preview-action.js +55 -0
  44. package/lib/priority.js +45 -0
  45. package/lib/proc-stats.js +82 -0
  46. package/lib/retention.js +191 -0
  47. package/lib/scratch-files.js +47 -0
  48. package/lib/scratchpad-dir.js +95 -0
  49. package/lib/session-cache.js +32 -0
  50. package/lib/session-events.js +275 -0
  51. package/lib/session-pins.js +99 -0
  52. package/lib/show.js +279 -0
  53. package/lib/stamped-json-file.js +49 -0
  54. package/lib/task-counts.js +90 -0
  55. package/lib/task-dir.js +26 -0
  56. package/lib/task-store.js +44 -47
  57. package/lib/terminal-client.js +248 -0
  58. package/lib/terminal-host.js +113 -0
  59. package/lib/terminal.js +1116 -0
  60. package/lib/user-groups.js +384 -0
  61. package/lib/worktrees.js +132 -0
  62. package/package.json +39 -15
  63. package/public/app.js +14349 -3448
  64. package/public/fonts/OFL-IBM-Plex.txt +93 -0
  65. package/public/fonts/OFL-Playfair-Display.txt +93 -0
  66. package/public/fonts/fonts.css +244 -0
  67. package/public/fonts/ibm-plex-mono-cyrillic-400.woff2 +0 -0
  68. package/public/fonts/ibm-plex-mono-cyrillic-500.woff2 +0 -0
  69. package/public/fonts/ibm-plex-mono-cyrillic-600.woff2 +0 -0
  70. package/public/fonts/ibm-plex-mono-cyrillic-ext-400.woff2 +0 -0
  71. package/public/fonts/ibm-plex-mono-cyrillic-ext-500.woff2 +0 -0
  72. package/public/fonts/ibm-plex-mono-cyrillic-ext-600.woff2 +0 -0
  73. package/public/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  74. package/public/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  75. package/public/fonts/ibm-plex-mono-latin-600.woff2 +0 -0
  76. package/public/fonts/ibm-plex-mono-latin-ext-400.woff2 +0 -0
  77. package/public/fonts/ibm-plex-mono-latin-ext-500.woff2 +0 -0
  78. package/public/fonts/ibm-plex-mono-latin-ext-600.woff2 +0 -0
  79. package/public/fonts/ibm-plex-mono-vietnamese-400.woff2 +0 -0
  80. package/public/fonts/ibm-plex-mono-vietnamese-500.woff2 +0 -0
  81. package/public/fonts/ibm-plex-mono-vietnamese-600.woff2 +0 -0
  82. package/public/fonts/playfair-display-cyrillic-400.woff2 +0 -0
  83. package/public/fonts/playfair-display-latin-400.woff2 +0 -0
  84. package/public/fonts/playfair-display-latin-ext-400.woff2 +0 -0
  85. package/public/fonts/playfair-display-vietnamese-400.woff2 +0 -0
  86. package/public/group-tree.js +21 -0
  87. package/public/icons/icon-192.png +0 -0
  88. package/public/icons/icon-512.png +0 -0
  89. package/public/icons/icon-svg.svg +7 -5
  90. package/public/index.html +493 -328
  91. package/public/link-url.js +18 -0
  92. package/public/manifest.json +7 -7
  93. package/public/project-match.js +34 -0
  94. package/public/style.css +8301 -2251
  95. package/public/sw.js +4 -3
  96. package/public/terminal-frame.js +437 -0
  97. package/public/terminal.html +26 -0
  98. package/public/themes.css +876 -0
  99. package/public/tree-highlight.js +196 -0
  100. package/server.js +3368 -467
  101. package/skills/ask/SKILL.md +29 -0
  102. package/skills/ask/references/playground.md +25 -0
  103. package/skills/dispatch/SKILL.md +51 -0
  104. package/skills/dispatch/references/orchestration-patterns.md +50 -0
  105. package/skills/kanban/SKILL.md +46 -0
  106. package/skills/show/SKILL.md +41 -0
  107. package/skills/show/references/NOTICE.md +27 -0
  108. package/skills/show/references/chart.md +58 -0
  109. package/skills/show/references/diagram/architecture.md +18 -0
  110. package/skills/show/references/diagram/er.md +10 -0
  111. package/skills/show/references/diagram/flow.md +13 -0
  112. package/skills/show/references/diagram/layers.md +10 -0
  113. package/skills/show/references/diagram/sequence.md +19 -0
  114. package/skills/show/references/diagram/state.md +12 -0
  115. package/skills/show/references/diagram/swimlane.md +10 -0
  116. package/skills/show/references/diagram/timeline.md +9 -0
  117. package/skills/show/references/diagram/tree.md +10 -0
  118. package/skills/show/references/diagram.md +87 -0
  119. package/skills/show/references/explain.md +100 -0
  120. package/skills/show/references/html-contract.md +18 -0
  121. package/skills/show/references/mockup.md +30 -0
  122. package/skills/visualize/SKILL.md +73 -0
  123. package/skills/visualize/blocks.html +68 -0
  124. package/skills/visualize/template.html +179 -0
  125. package/lib/pi-parsers.js +0 -1000
  126. package/themes/kanban-dark-default.json +0 -21
  127. package/themes/kanban-default.json +0 -21
  128. package/themes/pi-dark.json +0 -21
  129. package/themes/pi-light.json +0 -21
package/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ ## 2.0.0
4
+
5
+ pi-kanban is now an agent development environment for pi. The board runs pi sessions in a browser terminal, next to their todos, subagents, and docs.
6
+
7
+ ### Breaking changes
8
+
9
+ - The pi extension no longer starts the board. Install it with `npm install -g pi-kanban` and run `pi-kanban` in a shell.
10
+ - `/kanban start`, `stop`, `restart`, `status`, and `open web|app` are gone. `/kanban` and `/kanban open` open the board with its access token.
11
+ - The JSON themes are gone. The board has color themes in a palette menu, and `T` switches light and dark.
12
+ - The board no longer opens files or folders in your editor. A file the preview cannot show gets a card with a Copy path button.
13
+
14
+ ### Features
15
+
16
+ - **Board terminal.** Runs pi next to each session's board, on by default. `--no-terminal` turns it off. The terminal keeps running when the browser tab closes.
17
+ - **New session dialog.** Pick a folder or project, and set the name, first prompt, model, and thinking level. `Ctrl+Alt+R` resumes an older session.
18
+ - **Skills.** `kanban`, `show`, `ask`, `visualize`, and `dispatch` teach pi the `pi-kanban` command, so the board adds skill descriptions to the system prompt in place of tool schemas. pi adds panes, links and previews docs, posts `show` cards, and opens pi-cost or pi-inspect through the command.
19
+ - **`ask` tool.** Shows an HTML question in a modal and waits for the answer. pi asks in its own prompt when the board is down.
20
+ - **Dispatch.** `pi-kanban dispatch start` hands a task to a new pi session in the board terminal. The worker calls the `dispatch_report` tool, and the board keeps the report until the parent gets it with `pi-kanban dispatch wait`.
21
+ - **Panes and preview.** Tabs next to the terminal hold files, URLs, pi-cost, and pi-inspect. The preview shows linked docs and scratchpad files in the board's colors.
22
+ - **Board messages to pi.** Review comments, card answers, and task moves reach pi as user messages.
23
+ - **Scratchpad.** A folder per session, given to pi in the system prompt and `$PI_SCRATCHPAD_DIR`, deleted 7 days after the session ends.
24
+ - **Command line.** `pi-kanban doc|pane|show|session|group|task|project|dispatch|terminal|skills` talks to a running board.
25
+ - Sessions get their title from the first prompt.
26
+
27
+ ### Security
28
+
29
+ - The terminal and dispatch need a random token, which the board keeps in the URL fragment.
30
+ - The board refuses requests with a non-local `Host` header and cross-site requests that change data.
package/README.md CHANGED
@@ -2,50 +2,90 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/pi-kanban.svg)](https://www.npmjs.com/package/pi-kanban)
4
4
 
5
- Web dashboard for the [pi coding agent](https://pi.dev/packages/pi-kanban?name=kanban) — sessions, todos, subagents, observability.
5
+ Agent PI - Agent Development Environment (ADE) for the [pi coding agent](https://pi.dev/packages/pi-kanban?name=kanban).
6
6
 
7
- ![pi-kanban dashboard](https://raw.githubusercontent.com/NikiforovAll/pi-kanban/main/assets/pi-kanban-poster.png)
7
+ ![pi in the board terminal, with the session sidebar and a show card](https://raw.githubusercontent.com/NikiforovAll/pi-kanban/main/website/public/shots/nord/pi-terminal-light.webp)
8
8
 
9
- ## Documentation
9
+ ## What it is
10
10
 
11
- **[→ See the documentation](https://nikiforovall.github.io/pi-kanban/docs/)**
11
+ pi-kanban runs pi sessions in a browser terminal and shows each session next to its work: todos as kanban columns, subagents, linked docs, and the full session log. Its skills and its `ask` tool let the agent show you cards, ask you questions, open files and pages as tabs, and hand tasks to new pi sessions.
12
12
 
13
- ## Try it now
13
+ - **Documentation:** https://nikiforovall.blog/pi-kanban/
14
+ - **Live demo:** https://nikiforovall.blog/pi-kanban/demo/ (sample sessions, runs in your browser, no install)
14
15
 
15
- **[→ Open the live demo](https://nikiforovall.blog/pi-kanban/)**
16
+ ## Install
16
17
 
17
- Click around a fully interactive dashboard with synthesized sessions, tasks, and subagents — no install. Toggle the theme, browse projects, expand a subagent's review, open the storage manager. Everything works in-browser.
18
-
19
- When you're ready to run it on your own pi sessions, install below.
20
-
21
- ## Installation
18
+ You need Node.js 20 or later and pi.
22
19
 
23
20
  ```sh
24
21
  pi install npm:pi-kanban
22
+ npm install -g pi-kanban
25
23
  ```
26
24
 
27
- Then use `/kanban start | stop | restart | status | open | web | app | pin | sticky-pin | unpin | preview | link` from inside pi.
25
+ The first command gives pi the `/kanban` command, the `ask` tool, and the skills that drive the board. The second installs the `pi-kanban` command, which runs the board.
28
26
 
29
- Or run standalone:
27
+ ## Start the board
30
28
 
31
29
  ```sh
32
- npx pi-kanban
30
+ pi-kanban
33
31
  ```
34
32
 
35
- ### Companion pi extensions
33
+ The board listens on `127.0.0.1:3460` and prints its URL with the access token. Open that URL and click **+ New** to start pi in the board terminal. Start the board with `--no-terminal` to only watch sessions.
34
+
35
+ When pi runs in another terminal, run `/kanban open` in pi to open the board with its token. `/kanban session open | pin | sticky-pin | unpin | view-doc | link-doc` act on the current session, and `/kanban cost` and `/kanban inspect` open pi-cost and pi-inspect for it.
36
+
37
+ ## The board
38
+
39
+ - **Sidebar.** Sessions in groups and projects, with progress, pins, linked docs, and icons for a terminal, a dispatched session, or a question that waits for you.
40
+ - **Terminal.** pi runs next to its board. The terminal keeps running when you close the browser tab.
41
+ - **Board.** Pending, In Progress, and Completed columns for the selected session. Tabs next to it hold panes and show cards.
42
+ - **New session.** Pick a folder or project, and set a name, a first prompt, the model, and the thinking level.
43
+ - **Agents and session logs.** Subagents with model, status, and run time, and every prompt, reply, and tool call.
44
+ - **Review.** Send review comments or card answers from the board. pi gets them as a user message.
45
+
46
+ Press `?` on the board for the keyboard shortcuts.
47
+
48
+ ## What pi gets
36
49
 
37
- pi-kanban surfaces data produced by two other pi extensions. Install them alongside for the full experience:
50
+ pi works the board through the `pi-kanban` command. The package's skills tell pi which command to run, so only the skill names and descriptions sit in the system prompt until pi needs one.
51
+
52
+ | Skill | What pi does with it |
53
+ | --- | --- |
54
+ | `kanban` | Add a URL or a file as a tab next to the board (`pane add`, `pane list`, `pane rm`), link a file or URL to the session (`doc link`, `doc unlink`), preview a file now (`doc preview`), and open pi-cost or pi-inspect for the session (`session cost`, `session inspect`) |
55
+ | `show` | Write a markdown or HTML card and post it with `pi-kanban show <file>`. It shows over the board terminal, or as a tab when pi runs in another terminal. |
56
+ | `ask` | Write an HTML question for the `ask` tool |
57
+ | `visualize` | Write a full HTML explainer page and add it as a tab |
58
+ | `dispatch` | Hand a task to a new pi session in the board terminal (`dispatch start`) and get its report back (`dispatch wait`, `dispatch list`, `dispatch end`) |
59
+
60
+ | Tool | What it does |
61
+ | --- | --- |
62
+ | `ask` | Show an HTML question in a modal and wait for the answer. pi asks in its own prompt when the board is down. |
63
+ | `dispatch_report` | The worker's report, kept by the board until the parent reads it. Only a dispatched session has it. |
64
+
65
+ Each session also gets a scratchpad folder, given to pi in the system prompt and in `$PI_SCRATCHPAD_DIR`. Run `pi-kanban help` for every command.
66
+
67
+ ## Companion pi packages
68
+
69
+ pi-kanban shows data that other pi packages write:
38
70
 
39
71
  ```sh
40
72
  pi install npm:pi-subagents
41
73
  pi install npm:@juicesharp/rpiv-todo
42
74
  ```
43
75
 
44
- - [`pi-subagents`](https://www.npmjs.com/package/pi-subagents) — spawns named subagent sessions; pi-kanban renders them under each parent session.
45
- - [`@juicesharp/rpiv-todo`](https://www.npmjs.com/package/@juicesharp/rpiv-todo) — task tracking that pi-kanban displays as kanban columns.
46
- - [`@juicesharp/rpiv-ask-user-question`](https://www.npmjs.com/package/@juicesharp/rpiv-ask-user-question) — pi-kanban surfaces these as interactive Q&A cards.
76
+ - [`pi-subagents`](https://www.npmjs.com/package/pi-subagents) starts named subagent sessions. The board shows them under each parent session.
77
+ - [`@juicesharp/rpiv-todo`](https://www.npmjs.com/package/@juicesharp/rpiv-todo) tracks todos. The board shows them as columns.
78
+ - [`@juicesharp/rpiv-ask-user-question`](https://www.npmjs.com/package/@juicesharp/rpiv-ask-user-question) asks you questions in the pi terminal. The board marks the session as waiting until you answer.
79
+
80
+ ## Security
81
+
82
+ The board terminal runs commands as you, so the board is locked to your machine:
47
83
 
48
- ## Demo
84
+ - It listens on loopback (`127.0.0.1`) by default. `--host` changes this. Do not expose the board to a network you do not trust.
85
+ - It refuses requests whose `Host` header is not local (`--allowed-hosts` adds names), and cross-site requests that change data.
86
+ - Only the terminal and dispatch need the token. Anyone who can reach the board can read your pi session history, which is one more reason to keep it on loopback.
87
+ - The terminal needs a random token. The board keeps it in the URL fragment (`#t=...`), which the browser never sends to a server. The browser keeps it in local storage, and the server keeps it across restarts in `<agent dir>/kanban/terminal-secret.json`, readable only by you. Do not share the board URL. If you did, start the board with `--new-token`.
49
88
 
89
+ ## License
50
90
 
51
- ![pi-kanban demo](https://raw.githubusercontent.com/NikiforovAll/pi-kanban/main/assets/pi-kanban-demo.gif)
91
+ MIT