tensaku 0.1.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7840bdd39302cb0d136b8c8741e03c5252c7bdb872c45945f7b05dea6718ed61
4
- data.tar.gz: 5150d45d8880f37081dc8fc2026319ad542e379dfccf178db1ecaec414a09e46
3
+ metadata.gz: 3761f4231fcdd3c8acdce7c0b5e5fc4e01569810dfed939bca788b7a1b637eb5
4
+ data.tar.gz: 9e1729c3bd825771d79ca2b98e0c2a67291a0ed422c05dec28e0c3b83e02c833
5
5
  SHA512:
6
- metadata.gz: 4b838531e2b6154e96c5c493782f047364e3ba05255e436f7b9c1df40b683a77030a7c0b2f209045fd3a7a9b3d4aa466dde30da1740033e1c5c0bd310e54f584
7
- data.tar.gz: eeab9c2146c35d03e2165e11d115929439128ea6eaefc1ca833f7792aca256173c806a30458e8878a398e6c54f7ba822818fef2960e928d9e4f190d4ad4b43c3
6
+ metadata.gz: 42a1fef9a4af7e5b7032b2fde8fa932cd55478b3bb10afe29894baa787506f2707dfd5e44966d9cc3f5c9f80efd93a5a982cec68f44d0a3da50791e5d927787e
7
+ data.tar.gz: a380900ea2ccc450fc91b3365b98ae111506a17df4f3335c2b6fc312f5658836201b9ffa817ecb0bcf24905fedd7def4c1bdde960e799a3b85a81c9cc7379aa1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,164 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 (2026-11-14)
4
+
5
+ ### Agents
6
+
7
+ - An agent takes fewer turns per note. Claude Code loads the tools of the work loop (`list_notes`,
8
+ `start_note`, `resolve_note`, `decline_note`, `ask_question`, `watch_notes`, `channel_ready`) up front
9
+ instead of behind its tool search. Notes from the MCP tools and `tensaku notes` give absolute file
10
+ paths. `resolve_note`, `decline_note` and `ask_question` end with how many open notes are left. With
11
+ Claude Haiku, one note went from 7 or 8 tool calls to 5, and from about 8.5 to 4.5 seconds.
12
+ - A note handed to an agent session, by `watch_notes`, the Claude Code channel or with another tool's
13
+ answer, is started for it at once: the pin shows the agent on it, and the agent doesn't call
14
+ `start_note`. A note an agent finds with `list_notes` still needs `start_note`, so two sessions can't
15
+ both work on it.
16
+ - While an agent works on a note, the page reloads itself whenever the app's files change, so each edit
17
+ shows as it lands instead of when the agent resolves the note. The dev server looks at the files
18
+ under `app/` and `config/locales/` four times a second, only while a note is being worked on.
19
+
20
+ ## 0.2.0 (2026-11-14)
21
+
22
+ Upgrading from 0.1.0: rerun `bin/rails generate tensaku:install` to replace the `.mcp.json` entry with
23
+ `bundle exec tensaku mcp`. Notes from 0.1.0 aren't carried over. `config.notes_path`, `config.shortcut`
24
+ and `config.prune_after` are gone; `config.archive_after` replaces `prune_after`.
25
+
26
+ ### Editing
27
+
28
+ - Undo and redo: every text save in the tab can be undone, newest first or from the edit history, and
29
+ redone, with Cmd/Ctrl+Z and Cmd/Ctrl+Shift+Z (Ctrl+Y) or from the toasts. The history survives a
30
+ reload. A new save clears what can be redone. A translation saved in several locales at once is undone
31
+ in all of them.
32
+ - The editor shows child elements as they look on the page instead of as code. `<br>` breaks the line,
33
+ an element's text keeps its style, dimmed, and opens that element's editor on a click, and an element
34
+ without text is a small mark. Whitespace between elements is no longer an editable field.
35
+ - Escape closes one thing at a time, the innermost first: it leaves a field in Tensaku's panels, then
36
+ closes the popover, the element menu, the note opened from a pin, the settings or notes panel, turns
37
+ select or edit mode off, and last folds the toolbar away. A focused field of the page keeps its own
38
+ Escape.
39
+ - Locked chips have a fixed size, so they stay small in a heading, and long ones are cut off with an
40
+ ellipsis.
41
+
42
+ ### Agents
43
+
44
+ - The MCP server is `bundle exec tensaku mcp`, which the agent starts over stdin and stdout, in place
45
+ of the HTTP endpoint at `/__tensaku/mcp`. It doesn't load the app, so the dev server doesn't have to
46
+ be running and no port is configured. It serves the app that contains the agent's directory, or the
47
+ apps below it that list tensaku in `Gemfile.lock`, or those given with `--app`. Rerun the generator
48
+ to replace the old `.mcp.json` entry.
49
+ - The Agents popover shows each agent's mark when its client is known (Claude Code, Cursor, Gemini CLI,
50
+ OpenCode, GitHub Copilot, Windsurf, Zed, Cline), from Simple Icons. Codex and other clients show a
51
+ paper plane.
52
+ - `bundle exec tensaku notes` does what the MCP tools do, from a shell, for agents without MCP.
53
+ - Notes are kept in a SQLite database, `tensaku.sqlite3` in your user data folder (`TENSAKU_HOME` to
54
+ change it), for every app and checkout on the machine, instead of JSON files in `tmp/tensaku/notes`.
55
+ Notes from 0.1.0 aren't carried over. The `sqlite3` gem is a new dependency, loaded in development
56
+ only. `config.notes_path` is gone.
57
+ - Notes have a `sent_at`, set when you save, edit, answer or reopen them from the page, and record the
58
+ commit checked out when they were written. `watch_notes` returns notes sent after `since`, and a card
59
+ says when it delivered one (`delivered_at`, `delivered_to`). A cancelled `watch_notes` stops waiting.
60
+ - Nothing polls. The page gets change events from the dev server (`GET /__tensaku/events`), and a
61
+ process waiting for notes is woken over a Unix socket when a change is saved. The page polls only
62
+ while its event stream is down.
63
+ - A note belongs to one `tensaku mcp` session: the one you assign it to with the note form's
64
+ **Assign to** menu, the one `watch_notes` hands it to, or the one that starts it. Unassigned notes go
65
+ to the first session that checks. Other sessions leave a note alone while its session's process
66
+ runs, and a request for changes goes back to it. A card can assign an open note to another session,
67
+ or take a note in progress back from a session that was stopped mid-work. A note whose session
68
+ ended mid-work says so on the page and in `list_notes`. A session busy with a note leaves new ones to an idle listening session.
69
+ `list_notes` marks each note as the session's own or nobody's yet, and `resolve_note` refuses a note
70
+ that wasn't started. A session counts as running while its process holds a lock in the data folder,
71
+ so a crashed agent's notes are free at once.
72
+ - Once an agent has listened, any Tensaku tool answer includes and claims the notes sent since it last
73
+ looked, so a busy agent gets them at its next call. Other agents get the ids.
74
+ - Each session has a two-word handle, such as amber-fox, unique among the app's connected sessions,
75
+ shown with the agent's name on the page and given to the agent to tell you.
76
+ - An Agents button in the toolbar replaces the green light: its popover lists each agent's folder,
77
+ start time, the note it works on or its last call, listening sessions first, and what to ask an agent
78
+ so it listens.
79
+ - Notes carry a screenshot of what they point at, taken by the page when the note form opens, without
80
+ a browser permission. Agents get it with `get_screenshot` or `tensaku notes screenshot ID`.
81
+ **Screenshot** in the form turns it off. The overlay bundles modern-screenshot 4.7.0 for this.
82
+ - `decline_note` closes a note without a change, with the reason in its thread. Declined notes have a
83
+ grey pin.
84
+ - Resolved and declined notes move to an archive after `config.archive_after` (was
85
+ `config.prune_after`, which deleted them) or with **Archive done**. `list_notes` takes
86
+ `status: archived`, and a reopened note comes back.
87
+ - Long threads show the agent's latest message and what came after it, on the cards and in `list_notes`
88
+ and `watch_notes`. `get_note` has the whole thread.
89
+ - Each browser tab keeps its own selection; `current_selection` returns the newest.
90
+ - The page says to restart the dev server when Tensaku's code changed since it started, and the Agents
91
+ popover marks an agent that runs older Tensaku code.
92
+ - The notes panel has an **Archive** tab.
93
+ - Changes made on a note card show at once and go back if the server refuses them. An open card
94
+ follows the agent's changes to its note.
95
+ - When an agent resolves a note, the page fetches itself again and morphs the change in, with changed
96
+ stylesheets.
97
+ - Claude Code channel: in a session started with
98
+ `claude --dangerously-load-development-channels server:tensaku`, each note you save is pushed into
99
+ the chat and Claude starts on it without being asked. The new `channel_ready` tool confirms the
100
+ channel works; the Agents popover shows the session as **Live**.
101
+ - `tensaku mcp` logs each tool call to `tmp/tensaku/mcp.log`: tool, duration, answer size and the
102
+ notes handed over.
103
+ - Note links in the MCP answers and copied Markdown use the address the page was opened at.
104
+ - Note targets carry the element's `classes`, and the Markdown lists them.
105
+ - The generator sets up more agents, and no longer takes `--port`: the skill also goes in
106
+ `.agents/skills/tensaku/` (Codex, Cursor, Gemini CLI, OpenCode and Copilot read it), `--agents`
107
+ writes `.codex/config.toml`, `.cursor/mcp.json`, `.gemini/settings.json` and `opencode.json`, and by
108
+ default it writes them for the agents already configured in the project.
109
+ - MCP tool answers are text only: `structuredContent` is gone, the tools that change a note answer
110
+ with one line, and `watch_notes` ends its text with a `checked_at` line.
111
+ - The skill, the MCP instructions and the tool descriptions tell the agent to start a note before
112
+ changing anything and to resolve it as soon as its change is made, before starting the next.
113
+ - `GET /notes.md` no longer takes `id`. The overlay's copy button was its only user.
114
+ - Notes no longer have a `reply` field, and `PATCH /notes/:id` no longer takes one. What the agent
115
+ says is in `thread`. `resolve_note` still takes its text as `reply`.
116
+
117
+ ### Install
118
+
119
+ - The generator is optional and only connects a coding agent. It no longer writes
120
+ `config/initializers/reactionview.rb`: Tensaku turns off Herb's debug mode itself, and an app's
121
+ initializer can still turn it on.
122
+
123
+ ### Rendering
124
+
125
+ - Tensaku no longer turns on Herb's `action_view_helpers` option. With it on, Herb 0.11.2 dropped
126
+ attributes passed as `tag.div(**attrs)` in development. Helpers such as `link_to` now render as they
127
+ do in production and have no source stamp of their own, so a note on one points at the nearest
128
+ stamped ancestor. The safety page shows how to turn the option back on.
129
+
130
+ ### Overlay
131
+
132
+ - Note cards are simpler. The message box is gone (edit the note instead, and a question still takes an answer), and so is the copy button. The actions are unoutlined icons at the top of the card with tooltips. Source lines are grouped by file under the note, and the agent's replies sit under a ruled line.
133
+ - Notes can no longer be moved to another element, and `PATCH /notes/:id` no longer takes `targets`. A card whose element is gone says so; delete it and write a new note.
134
+ - A note card's buttons are **Mark as done** (or **Reopen**), **Edit** and **Delete**, in that order.
135
+ - The bottom of the notes panel says which agent your notes go to. With none, **Connect one** lists the commands that start one, each with a copy button. **Copy page notes** and **Copy all open** are now **Copy page** and **Copy all**.
136
+ - The toolbar's buttons are in three groups: select and edit, notes, then pause, history and settings. The settings button has a sliders icon.
137
+ - Settings open in a side panel in place of the notes panel. Every toolbar button can have a keyboard shortcut, changed or removed in the panel for this browser: Select is Alt+Shift+T, Edit is Alt+Shift+E and Notes is Alt+Shift+N. Escape closes the panel.
138
+ - `config.shortcut` is gone. Set the shortcuts in the settings panel.
139
+ - The Compact button setting is gone.
140
+ - On a phone the toolbar's buttons are smaller, and on a screen too narrow for all of them they scroll sideways.
141
+ - The toolbar pauses the page's CSS animations and transitions, Web Animations and playing media, so you can note an element mid-animation. JavaScript timers and `requestAnimationFrame` loops keep running.
142
+ - Agent toasts appear one at a time, at most three at once. More than three waiting become one toast that counts the changes, with a button that opens the notes panel. Browser notifications follow the same rule.
143
+ - The notes panel lists resolved and declined notes in a **Done** section with an **Archive done** button. Its copy buttons are in a bar at the bottom right that stays in view while the notes scroll, and the bar is hidden when there is nothing open to copy.
144
+ - Post-its have a folded corner that joins the paper.
145
+ - Alt+Shift-click (Option+Shift-click) opens the note form on an element, in any mode.
146
+ - A note's pin sits where you clicked to write it, kept as a `point` on the target, and follows the
147
+ element when the layout changes. Area notes, notes on several elements and notes written from the
148
+ keyboard keep the pin at the top right.
149
+ - The corner button shows a pointer cursor, and a grabbing cursor only once a drag starts.
150
+ - The corner button and the toolbar are one pill. The button stays where it is, the logo spins and the tools unroll to its left. Clicking the button closes the toolbar, the notes panel and the current mode, so there is no separate close button. Notes moved next to the page actions, and the selected tool's circle stays centered in the bar.
151
+ - Alt-click (Option-click) opens the actions menu on any element, in any mode, instead of going straight to the editor. Edit text comes first in the menu, so Alt-click then E or Enter edits. A click outside the menu closes it and doesn't reach the page.
152
+ - Alt-drag (Option-drag) draws an area for a note, in any mode.
153
+ - Holding Alt (Option) shows the select cursor and highlights the element under the pointer until the key is released. It does nothing while you type in a field.
154
+ - A note's pin finds its element by tag and text when the file's lines have moved. Before, it showed on
155
+ whatever was now at the old line, or on nothing.
156
+ - The corner button shows the new logo, a hanamaru, instead of the character 添.
157
+ - The message after a save shows the file, the line, and the old and new text of the lines that changed.
158
+ Save replies carry these lines as `diff`.
159
+ - Shortcut labels follow the platform: `⌥⇧T` on Apple platforms and `Alt+Shift+T` elsewhere, and the
160
+ note form says `⌘↵ saves` or `Ctrl+Enter saves`.
161
+
3
162
  ## 0.1.0 (2026-11-08)
4
163
 
5
164
  ### Editing
@@ -27,7 +186,7 @@
27
186
  - Notes on elements, text selections and areas, stored in `tmp/tensaku/notes/`, with pins and a notes
28
187
  panel. Agents read them as files, through the MCP endpoint, from the clipboard or with the Claude
29
188
  Code skill.
30
- - Notes can be edited from their card. An edited note goes back to `open` and loses the old reply.
189
+ - Notes can be edited from their card. An edited note goes back to `open` and keeps its thread.
31
190
  - A `working` status and the `start_note` MCP tool show when an agent picks a note up. `GET /notes`
32
191
  returns `agent.connected`, true for 20 seconds after any MCP call, and the toolbar shows it as a
33
192
  green light. The overlay polls the notes every four seconds while the tab is visible.
@@ -38,7 +197,7 @@
38
197
  - MCP `initialize` returns an `Mcp-Session-Id`. The page names connected agents from `clientInfo`.
39
198
  - The notes panel shows every page's notes. `GET /notes.md?format=short` gives one line per note.
40
199
  - A note on selected text keeps the phrase marked on the page.
41
- - Toasts, and optional browser notifications, when an agent starts, answers or resolves a note.
200
+ - Toasts, and optional browser notifications, when an agent answers or resolves a note. A note the agent has started on shows only on its pin.
42
201
 
43
202
  ### Overlay
44
203
 
data/README.md CHANGED
@@ -1,13 +1,16 @@
1
+ <p align="center">
2
+ <img src="docs/app/assets/images/hanamaru.svg" width="96" height="96" alt="">
3
+ </p>
4
+
1
5
  <h1 align="center">Tensaku</h1>
2
6
 
3
7
  <p align="center">
4
- <img src="https://img.shields.io/badge/status-experimental-e8b44f" alt="Status: experimental">
5
8
  <a href="https://rubyonrails.org"><img src="https://img.shields.io/badge/Rails-8.1-b45d3c?logo=rubyonrails&amp;logoColor=white" alt="Rails 8.1"></a>
6
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-57966f" alt="License: MIT"></a>
7
10
  </p>
8
11
 
9
12
  <p align="center">
10
- Fix your Rails app on the page, in development.
13
+ Fix your Rails app without leaving the browser.
11
14
  </p>
12
15
 
13
16
  <p align="center">
@@ -18,7 +21,7 @@
18
21
 
19
22
  Tensaku (添削, correcting a draft) lets you click text on a running Rails page and edit it. It writes the change back to the ERB template, the locale YAML or the Markdown file. For anything that isn't a text edit, leave a note on the page, and your coding agent reads it with the file and line of each element.
20
23
 
21
- Tensaku is experimental. It needs Ruby 4.0 or later and Rails 8.1. It runs only in development, on [Herb](https://github.com/marcoroth/herb) through [ReActionView](https://github.com/marcoroth/reactionview). Test and production keep rendering with Erubi and never load Tensaku, ReActionView or Herb.
24
+ It needs Ruby 4.0 or later and Rails 8.1. It runs only in development, on [Herb](https://github.com/marcoroth/herb) through [ReActionView](https://github.com/marcoroth/reactionview). Test and production keep rendering with Erubi and never load Tensaku, ReActionView or Herb.
22
25
 
23
26
  ## Install it in a Rails app
24
27
 
@@ -31,32 +34,33 @@ end
31
34
 
32
35
  ```sh
33
36
  bundle install
34
- bin/rails generate tensaku:install
35
37
  ```
36
38
 
37
- The generator writes `config/initializers/reactionview.rb`, installs a Claude Code skill in `.claude/skills/tensaku/` and adds the MCP endpoint to `.mcp.json`. It prints every file it changes. You don't set up any JavaScript. The middleware injects one prebuilt script into HTML pages.
39
+ To connect a coding agent, also run `bin/rails generate tensaku:install`. This optional generator installs the skill, and adds `bundle exec tensaku mcp`, an MCP server the agent starts itself, to `.mcp.json` and to the config of Codex, Cursor, Gemini CLI or OpenCode. It prints every file it changes. You don't set up any JavaScript. The middleware injects one prebuilt script into HTML pages.
38
40
 
39
- Start the server and open a page. A round 添 button sits in the bottom right corner. Press **Alt+Shift+T** to select an element and see the file and line it came from.
41
+ Start the server and open a page. A round button with a red flower sits in the bottom right corner. Press **Alt+Shift+T** to select an element and see the file and line it came from.
40
42
 
41
43
  ## Edit text where you see it
42
44
 
43
- Alt-click (Option-click) any text. The editor shows the source, so in `Hello <%= user.name %>!` you edit `Hello ` and `!` and the Ruby stays a locked chip. Enter saves, Escape cancels, and a toast offers Undo.
45
+ Alt-click (Option-click) any text and press E, or choose **Edit text** in the menu. The editor shows the source, so in `Hello <%= user.name %>!` you edit `Hello ` and `!` and the Ruby stays a locked chip. Enter saves, Escape cancels, and a toast offers Undo.
44
46
 
45
47
  Tensaku edits static template text, attributes such as `alt` and `placeholder`, `t()` translations in every locale, and Markdown blocks. Each save replaces only the bytes of the edited text, and refuses if the file changed since the page rendered. The page then updates in place, with no reload.
46
48
 
47
49
  ## Leave notes for your agent
48
50
 
49
- In select mode, click an element, select some text, or drag over an area, and choose **Add note**. Notes are JSON files in `tmp/tensaku/notes/`, ignored by git. Your agent reads them from the files, from the MCP endpoint at `/__tensaku/mcp`, through the Claude Code skill, or from Markdown you copy from the page.
51
+ Alt+Shift-click (Option+Shift-click) an element, or in select mode click an element, select some text, or drag over an area, and choose **Add note**. Notes are kept in a SQLite database in your user data folder, outside your project. Your agent gets them through `tensaku mcp` and the skill, through the `tensaku notes` command, or from Markdown you copy from the page.
52
+
53
+ Ask your agent to do your Tensaku notes, and it works through the open ones. Ask it to watch your Tensaku notes, and it waits for them: each note you save reaches it as you write it.
50
54
 
51
- The agent marks a note `working`, asks a question back, or resolves it with a reply. Each change shows on the note's pin. A green pin means the change is ready for you to check.
55
+ The agent marks a note `working`, asks a question back, declines it, or resolves it with a reply. Each change shows on the note's pin. A green pin means the change is ready for you to check.
52
56
 
53
57
  ## Documentation
54
58
 
55
59
  The documentation site is [tensaku.lostcoords.com](https://tensaku.lostcoords.com). Its pages are Markdown files in `docs/app/views/pages/`.
56
60
 
57
- - [Install Tensaku](docs/app/views/pages/installation.html.md) and see [what the generator does](docs/app/views/pages/installation.html.md#what-the-generator-does).
61
+ - [Install Tensaku](docs/app/views/pages/installation.html.md) and see [connect a coding agent](docs/app/views/pages/installation.html.md#connect-a-coding-agent).
58
62
  - Read [what can be edited](docs/app/views/pages/editing.html.md) and [how a save works](docs/app/views/pages/editing.html.md#how-a-save-works).
59
- - Leave [notes](docs/app/views/pages/notes.html.md), and give agents the [note format and MCP tools](docs/app/views/pages/agents.html.md).
63
+ - Leave [notes](docs/app/views/pages/notes.html.md), and see [how agents read them](docs/app/views/pages/notes.html.md#how-agents-read-notes).
60
64
  - Look up the [configuration options](docs/app/views/pages/configuration.html.md) and the [attributes the overlay reads](docs/app/views/pages/producers.html.md).
61
65
  - Read [safety and limits](docs/app/views/pages/safety.html.md) before you use it on a real app.
62
66
  - [Contribute](CONTRIBUTING.md) or read the [changelog](CHANGELOG.md).