@bigmistqke/workpad 0.18.1 → 0.20.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 (109) hide show
  1. package/README.md +18 -9
  2. package/bin/workpad.ts +412 -58
  3. package/dist/bin/workpad.js +336 -46
  4. package/dist/client/runtime.js +141 -18
  5. package/dist/plugins/badge/README.md +59 -10
  6. package/dist/plugins/badge/index.js +130 -8
  7. package/dist/plugins/badge/public/style.css +132 -12
  8. package/dist/plugins/chat/README.md +7 -3
  9. package/dist/plugins/chat/index.js +8 -1
  10. package/dist/plugins/chat/public/client.js +2 -2
  11. package/dist/plugins/chat/public/style.css +10 -0
  12. package/dist/plugins/claude/README.md +13 -5
  13. package/dist/plugins/claude/channel.js +47 -6
  14. package/dist/plugins/claude/doctor.js +43 -47
  15. package/dist/plugins/claude/index.js +24 -8
  16. package/dist/plugins/claude/session.js +46 -1
  17. package/dist/plugins/comments/README.md +2 -1
  18. package/dist/plugins/comments/index.js +2 -0
  19. package/dist/plugins/comments/public/client.js +6 -5
  20. package/dist/plugins/comments/public/style.css +9 -0
  21. package/dist/plugins/form/README.md +1 -1
  22. package/dist/plugins/index.js +3 -1
  23. package/dist/plugins/opencode/channel.js +43 -7
  24. package/dist/plugins/opencode/index.js +2 -0
  25. package/dist/plugins/progress/README.md +41 -0
  26. package/dist/plugins/progress/index.js +117 -0
  27. package/dist/plugins/progress/public/client.js +1 -0
  28. package/dist/plugins/progress/public/style.css +85 -0
  29. package/dist/plugins/progress/state.js +210 -0
  30. package/dist/solid/index.js +3 -1
  31. package/dist/src/agents.js +13 -4
  32. package/dist/src/anchors.js +25 -1
  33. package/dist/src/build.js +1 -1
  34. package/dist/src/client/page/base.css +48 -2
  35. package/dist/src/client/page/main.js +58 -30
  36. package/dist/src/document.js +6 -4
  37. package/dist/src/events.js +22 -11
  38. package/dist/src/help.js +59 -12
  39. package/dist/src/hub.js +69 -3
  40. package/dist/src/listen.js +36 -4
  41. package/dist/src/listeners.js +14 -4
  42. package/dist/src/loader.js +7 -2
  43. package/dist/src/migrate.js +1 -1
  44. package/dist/src/pages/board.js +9 -4
  45. package/dist/src/pages/index.js +2 -4
  46. package/dist/src/pages/markdown.js +50 -19
  47. package/dist/src/pages/render.js +17 -1
  48. package/dist/src/server.js +94 -18
  49. package/dist/src/set.js +99 -0
  50. package/dist/src/state.js +2 -1
  51. package/dist/src/status.js +57 -9
  52. package/dist/src/turns.js +41 -0
  53. package/package.json +11 -1
  54. package/plugins/README.md +3 -1
  55. package/plugins/badge/README.md +59 -10
  56. package/plugins/badge/index.ts +141 -8
  57. package/plugins/badge/public/style.css +132 -12
  58. package/plugins/chat/README.md +7 -3
  59. package/plugins/chat/client.tsx +20 -3
  60. package/plugins/chat/index.ts +10 -1
  61. package/plugins/chat/public/style.css +10 -0
  62. package/plugins/claude/README.md +13 -5
  63. package/plugins/claude/channel.ts +45 -7
  64. package/plugins/claude/doctor.ts +58 -39
  65. package/plugins/claude/index.ts +30 -8
  66. package/plugins/claude/session.ts +32 -0
  67. package/plugins/comments/README.md +2 -1
  68. package/plugins/comments/client.ts +19 -0
  69. package/plugins/comments/index.ts +7 -1
  70. package/plugins/comments/public/style.css +9 -0
  71. package/plugins/form/README.md +1 -1
  72. package/plugins/index.ts +2 -0
  73. package/plugins/opencode/channel.ts +44 -8
  74. package/plugins/opencode/index.ts +4 -0
  75. package/plugins/progress/README.md +41 -0
  76. package/plugins/progress/client.ts +172 -0
  77. package/plugins/progress/index.ts +166 -0
  78. package/plugins/progress/public/style.css +85 -0
  79. package/plugins/progress/state.ts +278 -0
  80. package/skills/workpad/SKILL.md +149 -18
  81. package/solid/index.tsx +6 -2
  82. package/src/agents.ts +24 -2
  83. package/src/anchors.ts +32 -0
  84. package/src/build.ts +1 -1
  85. package/src/client/delivery.ts +49 -0
  86. package/src/client/forms.ts +18 -11
  87. package/src/client/page/base.css +48 -2
  88. package/src/client/page/waiting.ts +45 -25
  89. package/src/client/read.ts +9 -5
  90. package/src/client/runtime.ts +7 -3
  91. package/src/client/toast.ts +27 -3
  92. package/src/define.ts +120 -9
  93. package/src/document.ts +19 -5
  94. package/src/events.ts +47 -6
  95. package/src/help.ts +58 -11
  96. package/src/hub.ts +80 -2
  97. package/src/listen.ts +47 -4
  98. package/src/listeners.ts +22 -1
  99. package/src/loader.ts +14 -4
  100. package/src/migrate.ts +1 -1
  101. package/src/pages/board.ts +12 -3
  102. package/src/pages/index.ts +8 -10
  103. package/src/pages/markdown.ts +59 -12
  104. package/src/pages/render.ts +20 -2
  105. package/src/server.ts +127 -19
  106. package/src/set.ts +118 -0
  107. package/src/state.ts +3 -0
  108. package/src/status.ts +115 -14
  109. package/src/turns.ts +56 -0
package/README.md CHANGED
@@ -283,8 +283,9 @@ time it is read. A listen prints everything on its page not handled yet,
283
283
  including what came before it started and what it was handed before (marked
284
284
  `"again": true`), so an answer an agent saw and forgot comes back. So an
285
285
  agent can ask, do other work, and listen later. Any number listen on a
286
- page, and each hears everything there but its own events; the page's green
287
- dot lists who listens.
286
+ page, and each hears everything there but its own events (written under its
287
+ id, or in its session when `WORKPAD_AGENT` names it); another agent's message
288
+ comes to it once, not again; the page's green dot lists who listens.
288
289
 
289
290
  `listen` is built from smaller pieces that are commands too, for a script that
290
291
  wants to use the log its own way:
@@ -434,22 +435,23 @@ commands answer it too.
434
435
  | `workpad new <name>` | create a page under a name no other page has (`name`, else `name-2`, …), print its path |
435
436
  | `workpad show <page\|file> [<anchor>]` | start the project's server if needed (never the shared one), print the page's URL; with an anchor, one that opens the page there |
436
437
  | `workpad url <page\|file> [<anchor>] [--full]` | a link to a page or a place on it, from the server's root (`/rg/jobs/x/decisions#form:logger`), so it works however the board is opened; `--full` for the whole URL; checks the anchor |
437
- | `workpad settle <page\|file> <form>… \| --all` | settle questions answered elsewhere (a chat, the design moving on): no longer unanswered; an answer opens one again |
438
+ | `workpad settle <page\|file> <form>… \| --all` | settle questions answered elsewhere (a chat, the design moving on): no longer unanswered; an answer opens one again. With one form and `--replace-with <file\|->`, the form on the page is replaced with that markdown (what was decided) in the same step |
438
439
  | `workpad hold <page\|file> <form>… "<reason>"` | hold questions that wait on something else ("waits for !2145"): shown held with the reason, not waiting for the reader, not settled; an answer ends the hold |
439
440
  | `workpad release <page\|file> <form>…` | release held questions: they wait for the reader again |
440
- | `workpad check [<page\|file>…]` | what is wrong on pages as they render, a line each; exits 1 when there is any |
441
+ | `workpad check [<page\|file>…]` | what is wrong on pages as they render, a line each, links to an anchor that isn't there included (on the page, or on another page of the project, with the nearest it has); exits 1 when there is any |
441
442
  | `workpad migrate [<folder\|file>…] [--write]` | after updating workpad, pages written in an older syntax in the current one (0.15: items as `:::item`, `steps` → `tabs`, callouts → alerts, `:check` → `:checkbox`, an ansi fence's title window); code is left alone, a second run changes nothing. Before that, a project or machine still under the old name, whiteboard, moves to the new one (see above). A dry run lists each page and what would change, exiting 1 when any would; `--write` rewrites them. Default: `.workpad/pages` |
442
443
  | `workpad anchors <page\|file>` | what a page can be linked to: `#open-questions` (a heading), `#form:logger`, `#chat:notes`, `#tab:intro`, `#details:why` |
444
+ | `workpad set <page\|file> <anchor\|form> --file <file\|->` | replace one block of a page, found by parsing it: a form (`form:logger`), a heading's section (`open-questions`, up to the next heading of its level), a named block (`chat:notes`), with markdown from a file or standard input; the rest of the page stays byte for byte; a name the page lacks exits 1, listing what it has |
443
445
  | `workpad archive <page>` | a page that did its job: it leaves the pages and its events the log, kept in `.workpad/archive/` as markdown with what was answered on it |
444
446
  | `workpad destroy <page>` | a throwaway page: remove its file, and all its events from the log |
445
447
  | `workpad prune <page> [--type <t>] [--id <id>]` | remove a page's events from the log (all, one type, or one), keep the page |
446
- | `workpad edit <event id> --data <json>` | change an agent's own event in place: merged into its data, its id kept |
448
+ | `workpad edit <event id> --data <json> \| --file <file\|-> \| --text-file <file\|->` | change an agent's own event in place: merged into its data, its id kept |
447
449
  | `workpad thread <event id>` | an answer or chat message with its question: the form as written (chosen options marked), its answers and its chat, in order |
448
450
  | `workpad scroll <page\|file> <where>` | scroll the tabs that have the page open to a heading's text, a form's name or any text on it; exits 1 when nothing matches or no tab has it open |
449
451
  | `workpad docs [<block\|plugin> \| --all]` | print how to write pages in this project: a line per block, grouped by what it is for (ask, show, arrange, mark); with a block's or plugin's name, that plugin's docs; with `--all`, every plugin's |
450
452
  | `workpad events [filters] [--follow]` | print recorded events; with `--follow`, then each new one as it comes, marking nothing |
451
453
  | `workpad listen [filters] [--wait \| --channel] [--agent <who>]` | print everything matching you haven't handled (the reader's answers, other agents' messages; one handed out before with `"again": true`), then each as it comes, never exiting; with `--wait`, exit once it printed what there is, or with nothing there the next; with `--channel`, make the pages yours and exit, your session's confirmed channel bringing their answers (without `--page`, every page, also later ones); any number listen on a page; with `--page`, subscribes you to it; without, every page (in a project of the machine config's entries, every page of the entry, each event with its `project` and `url`) |
452
- | `workpad append --page <p> --type <t> [--data <json>]` | add an event to a page's log, such as a reply to a comment |
454
+ | `workpad append --page <p> --type <t> [--data <json> \| --file <file\|->] [--text-file <file\|->]` | add an event to a page's log, such as a reply to a comment: its data as JSON on the command line, or from a file or standard input (`--file`), with markdown from a file or standard input as its `text` (`--text-file`) |
453
455
  | `workpad handled <event id…>` | you handled these answers (a reply in their chat does it too): no listen hands them out again |
454
456
  | `workpad agent [name <n> \| name --clear \| list \| unsubscribe <agent> [--page <p>…] \| ping [<code>]]` | who you are (your id, `--agent`): alone, your id and name; `name` names you (one per agent, shown in the list of who listens and in `status`); `list` everyone on the board, saying who is subscribed and not listening; `unsubscribe` takes an agent (id or name) off the pages named, else off all; `ping` checks that an agent plugin's channel reaches you (it pushes a pong with a code; with the code, confirms it, and the channel then brings the answers on your pages, as received) |
455
457
  | `workpad status [--page <p>]` | per page: who is subscribed, questions without an answer, answers nobody received, answers received and not handled, chats waiting for a reply, who is listening |
@@ -677,13 +679,20 @@ Not started.
677
679
  recorded in the log, so it holds in every browser. An answered form waits
678
680
  for an agent to receive it; once one has it, the form folds into a card:
679
681
  what you chose (several answers each on a line, under the button you
680
- pressed), what you wrote, and "received · change" while the agent is on
682
+ pressed), what you wrote, and "received by <agent> · change" while the agent is on
681
683
  it, "decided · change" once it handled it; a click opens it again. Its chat folds into "💬 n messages", and opens when the agent
682
684
  writes there, or stays open while you are writing in it. The corner's
683
685
  toasts go to the next question ("→ unanswered (n)") and the next
684
686
  unread message ("→ unread (n)", whose ✕ puts it away until another
685
- comes), and the tab title gets a `(!n)` prefix. An answer sent while nobody
686
- listens says so in a toast; it stays in the log for whoever listens next.
687
+ comes), and the tab title gets a `(!n)` prefix.
688
+ - **Where what you sent went.** Beside an answer, a chat message or a
689
+ comment, in a small line: "no one follows this page — it waits until an
690
+ agent listens" (it stays in the log for whoever listens next), "waiting
691
+ for an agent to receive it", "received by <agent>", "handled". One no
692
+ agent received after 10 minutes says "not received after 10 min" in the
693
+ warning colour, and the corner counts them ("→ not received (n)"). A send
694
+ the server doesn't answer is tried again a few times (never appended
695
+ twice); one that never gets through says so, with a button to try again.
687
696
  - **Who listens.** The dot at the end of the header is green while the page
688
697
  is live and someone listens for its answers, grey when nobody does
689
698
  (answers wait in the log), and a ring while the page reconnects. A click