tensaku 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +144 -2
- data/README.md +15 -11
- data/app/assets/tensaku.js +187 -331
- data/exe/tensaku +5 -0
- data/lib/generators/tensaku/install_generator.rb +98 -46
- data/lib/tensaku/agents.rb +143 -0
- data/lib/tensaku/build.rb +32 -0
- data/lib/tensaku/cli.rb +155 -0
- data/lib/tensaku/doorbell.rb +91 -0
- data/lib/tensaku/endpoints.rb +80 -18
- data/lib/tensaku/file_write.rb +14 -3
- data/lib/tensaku/guard.rb +1 -2
- data/lib/tensaku/mcp.rb +112 -127
- data/lib/tensaku/middleware.rb +1 -1
- data/lib/tensaku/notes/markdown.rb +83 -0
- data/lib/tensaku/notes/target.rb +59 -0
- data/lib/tensaku/notes.rb +248 -254
- data/lib/tensaku/presence.rb +60 -0
- data/lib/tensaku/project.rb +98 -0
- data/lib/tensaku/railtie.rb +16 -1
- data/lib/tensaku/repo.rb +57 -0
- data/lib/tensaku/session/tools.rb +164 -0
- data/lib/tensaku/session.rb +267 -0
- data/lib/tensaku/source/locale.rb +1 -1
- data/lib/tensaku/source/markdown.rb +3 -2
- data/lib/tensaku/source/template.rb +3 -2
- data/lib/tensaku/store.rb +196 -0
- data/lib/tensaku/version.rb +1 -1
- data/lib/tensaku.rb +36 -12
- data/skills/tensaku/SKILL.md +56 -15
- metadata +32 -5
|
@@ -57,7 +57,7 @@ module Tensaku
|
|
|
57
57
|
|
|
58
58
|
check!(updated, locale, key, text, entry.file)
|
|
59
59
|
FileWrite.atomic(entry.path, updated)
|
|
60
|
-
{ changed: true, file: entry.file, line: entry.line }
|
|
60
|
+
{ changed: true, file: entry.file, line: entry.line, diff: FileWrite.diff(entry.source, updated) }
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def style_name(style)
|
|
@@ -57,8 +57,9 @@ module Tensaku
|
|
|
57
57
|
return { changed: false, file: relative_path } if replacement == raw
|
|
58
58
|
|
|
59
59
|
start, finish = byte_range
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
updated = FileWrite.splice(@source, [ { start:, end: finish, text: replacement } ])
|
|
61
|
+
FileWrite.atomic(@path, updated)
|
|
62
|
+
{ changed: true, file: relative_path, diff: FileWrite.diff(@source, updated) }
|
|
62
63
|
end
|
|
63
64
|
|
|
64
65
|
private
|
|
@@ -129,8 +129,9 @@ module Tensaku
|
|
|
129
129
|
replacements = replacements.reject { source.byteslice(it[:start]...it[:end]) == it[:text] }
|
|
130
130
|
return { changed: false } if replacements.empty?
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
updated = FileWrite.splice(source, replacements)
|
|
133
|
+
FileWrite.atomic(@path, updated)
|
|
134
|
+
{ changed: true, file: relative_path, diff: FileWrite.diff(source, updated) }
|
|
134
135
|
end
|
|
135
136
|
|
|
136
137
|
# Browsers hand back "\n" line breaks; a file written with "\r\n" keeps them.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
require "sqlite3"
|
|
2
|
+
require "monitor"
|
|
3
|
+
require "set"
|
|
4
|
+
|
|
5
|
+
module Tensaku
|
|
6
|
+
# The SQLite database in Tensaku.home that holds every app's notes, the agents connected to them and
|
|
7
|
+
# the page's selection. The dev server and every `tensaku mcp` open it at once: WAL lets readers run
|
|
8
|
+
# while one process writes, writes take the database's write lock (BEGIN IMMEDIATE), and a process
|
|
9
|
+
# waits up to five seconds for another's write to finish.
|
|
10
|
+
#
|
|
11
|
+
# Project keys every row by app, and logs each write in `changes` for the readers that wait.
|
|
12
|
+
module Store
|
|
13
|
+
FILE = "tensaku.sqlite3"
|
|
14
|
+
BUSY_TIMEOUT = 5000
|
|
15
|
+
|
|
16
|
+
# The tables at schema version BASE. A database below BASE is from before Tensaku's first release:
|
|
17
|
+
# its tables are dropped and made again from this script. Every database then runs the MIGRATIONS
|
|
18
|
+
# after its version.
|
|
19
|
+
BASE = 5
|
|
20
|
+
TABLES = %w[screenshots messages changes selections agents notes projects].freeze
|
|
21
|
+
SCHEMA = <<~SQL
|
|
22
|
+
CREATE TABLE IF NOT EXISTS projects (
|
|
23
|
+
root TEXT PRIMARY KEY,
|
|
24
|
+
remote TEXT,
|
|
25
|
+
base_url TEXT,
|
|
26
|
+
created_at TEXT NOT NULL
|
|
27
|
+
);
|
|
28
|
+
CREATE TABLE IF NOT EXISTS notes (
|
|
29
|
+
id TEXT PRIMARY KEY,
|
|
30
|
+
project TEXT NOT NULL REFERENCES projects(root) ON DELETE CASCADE,
|
|
31
|
+
url TEXT NOT NULL,
|
|
32
|
+
comment TEXT NOT NULL,
|
|
33
|
+
status TEXT NOT NULL,
|
|
34
|
+
targets TEXT NOT NULL DEFAULT '[]',
|
|
35
|
+
rect TEXT,
|
|
36
|
+
viewport TEXT,
|
|
37
|
+
"commit" TEXT,
|
|
38
|
+
session TEXT,
|
|
39
|
+
agent TEXT,
|
|
40
|
+
sent_at TEXT,
|
|
41
|
+
delivered_at TEXT,
|
|
42
|
+
delivered_to TEXT,
|
|
43
|
+
archived_at TEXT,
|
|
44
|
+
created_at TEXT NOT NULL,
|
|
45
|
+
updated_at TEXT NOT NULL
|
|
46
|
+
);
|
|
47
|
+
CREATE INDEX IF NOT EXISTS notes_project ON notes (project, archived_at, status);
|
|
48
|
+
CREATE TABLE IF NOT EXISTS messages (
|
|
49
|
+
id INTEGER PRIMARY KEY,
|
|
50
|
+
note_id TEXT NOT NULL REFERENCES notes(id) ON DELETE CASCADE,
|
|
51
|
+
author TEXT NOT NULL,
|
|
52
|
+
agent TEXT,
|
|
53
|
+
text TEXT NOT NULL,
|
|
54
|
+
at TEXT NOT NULL
|
|
55
|
+
);
|
|
56
|
+
CREATE INDEX IF NOT EXISTS messages_note ON messages (note_id, id);
|
|
57
|
+
CREATE TABLE IF NOT EXISTS agents (
|
|
58
|
+
session TEXT NOT NULL,
|
|
59
|
+
project TEXT NOT NULL REFERENCES projects(root) ON DELETE CASCADE,
|
|
60
|
+
name TEXT NOT NULL,
|
|
61
|
+
handle TEXT NOT NULL,
|
|
62
|
+
listening INTEGER NOT NULL DEFAULT 0,
|
|
63
|
+
channel INTEGER NOT NULL DEFAULT 0,
|
|
64
|
+
cwd TEXT,
|
|
65
|
+
pid INTEGER NOT NULL,
|
|
66
|
+
started_at TEXT,
|
|
67
|
+
last TEXT,
|
|
68
|
+
version TEXT,
|
|
69
|
+
seen_at REAL NOT NULL,
|
|
70
|
+
PRIMARY KEY (session, project)
|
|
71
|
+
);
|
|
72
|
+
CREATE TABLE IF NOT EXISTS selections (
|
|
73
|
+
project TEXT NOT NULL REFERENCES projects(root) ON DELETE CASCADE,
|
|
74
|
+
tab TEXT NOT NULL,
|
|
75
|
+
url TEXT,
|
|
76
|
+
data TEXT NOT NULL,
|
|
77
|
+
at TEXT NOT NULL,
|
|
78
|
+
PRIMARY KEY (project, tab)
|
|
79
|
+
);
|
|
80
|
+
CREATE TABLE IF NOT EXISTS changes (
|
|
81
|
+
seq INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
82
|
+
project TEXT NOT NULL,
|
|
83
|
+
kind TEXT NOT NULL,
|
|
84
|
+
note_id TEXT,
|
|
85
|
+
at REAL NOT NULL
|
|
86
|
+
);
|
|
87
|
+
CREATE INDEX IF NOT EXISTS changes_project ON changes (project, seq);
|
|
88
|
+
CREATE TABLE IF NOT EXISTS screenshots (
|
|
89
|
+
note_id TEXT PRIMARY KEY REFERENCES notes(id) ON DELETE CASCADE,
|
|
90
|
+
png BLOB NOT NULL,
|
|
91
|
+
width INTEGER NOT NULL,
|
|
92
|
+
height INTEGER NOT NULL
|
|
93
|
+
);
|
|
94
|
+
SQL
|
|
95
|
+
|
|
96
|
+
# Each change to the schema after BASE, in order, applied once: MIGRATIONS[0] takes a database from
|
|
97
|
+
# BASE to BASE + 1. Add to the end; never change a step that may have run.
|
|
98
|
+
MIGRATIONS = [].freeze
|
|
99
|
+
VERSION = BASE + MIGRATIONS.size
|
|
100
|
+
|
|
101
|
+
LOCK = Monitor.new
|
|
102
|
+
|
|
103
|
+
module_function
|
|
104
|
+
|
|
105
|
+
def path
|
|
106
|
+
Tensaku.home.join(FILE)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# The process's connection, opened again after a fork (Puma workers) or when TENSAKU_HOME changes
|
|
110
|
+
# (tests). Threads share it one at a time.
|
|
111
|
+
def db
|
|
112
|
+
LOCK.synchronize do
|
|
113
|
+
if @db.nil? || @pid != Process.pid || @path != path
|
|
114
|
+
@db = connect(path)
|
|
115
|
+
@pid = Process.pid
|
|
116
|
+
@path = path
|
|
117
|
+
end
|
|
118
|
+
@db
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# A write. Holds the database's write lock from the start, so what the block read is still true
|
|
123
|
+
# when it writes. Nested calls join the outer transaction.
|
|
124
|
+
# The apps a write changed (ring) are rung on the doorbell once it commits.
|
|
125
|
+
def write
|
|
126
|
+
LOCK.synchronize do
|
|
127
|
+
connection = db
|
|
128
|
+
return yield connection if connection.transaction_active?
|
|
129
|
+
|
|
130
|
+
rings = Thread.current[:tensaku_rings] = Set.new
|
|
131
|
+
begin
|
|
132
|
+
result = connection.transaction(:immediate) { yield connection }
|
|
133
|
+
ensure
|
|
134
|
+
Thread.current[:tensaku_rings] = nil
|
|
135
|
+
end
|
|
136
|
+
rings.each { Doorbell.ring(it) }
|
|
137
|
+
result
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Wakes the readers of the app at root once the current write commits.
|
|
142
|
+
def ring(root)
|
|
143
|
+
Thread.current[:tensaku_rings]&.add(Pathname(root).expand_path.to_s)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def read
|
|
147
|
+
LOCK.synchronize { yield db }
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def connect(file)
|
|
151
|
+
file.dirname.mkpath
|
|
152
|
+
# Notes can quote unreleased work, so only this user can open the folder.
|
|
153
|
+
file.dirname.chmod(0o700) unless Gem.win_platform?
|
|
154
|
+
connection = SQLite3::Database.new(file.to_s, results_as_hash: true)
|
|
155
|
+
connection.busy_timeout = BUSY_TIMEOUT
|
|
156
|
+
connection.execute("PRAGMA journal_mode = WAL")
|
|
157
|
+
connection.execute("PRAGMA foreign_keys = ON")
|
|
158
|
+
connection.execute("PRAGMA synchronous = NORMAL")
|
|
159
|
+
migrate(connection)
|
|
160
|
+
connection
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def migrate(connection)
|
|
164
|
+
connection.transaction(:immediate) do
|
|
165
|
+
current = connection.get_first_value("PRAGMA user_version").to_i
|
|
166
|
+
next if current >= VERSION
|
|
167
|
+
|
|
168
|
+
if current < BASE
|
|
169
|
+
TABLES.each { connection.execute("DROP TABLE IF EXISTS #{it}") }
|
|
170
|
+
connection.execute_batch(SCHEMA)
|
|
171
|
+
end
|
|
172
|
+
MIGRATIONS.drop([ current - BASE, 0 ].max).each { connection.execute_batch(it) }
|
|
173
|
+
connection.execute("PRAGMA user_version = #{VERSION}")
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Rows of agents that stopped without cleaning up, and the change log, are deleted after this long.
|
|
178
|
+
STALE_AFTER = 86_400
|
|
179
|
+
|
|
180
|
+
# Deletes those rows, for every app.
|
|
181
|
+
def prune!(now: Time.now)
|
|
182
|
+
write do |db|
|
|
183
|
+
db.execute("DELETE FROM changes WHERE at < ?", [ now.to_f - STALE_AFTER ])
|
|
184
|
+
db.execute("DELETE FROM agents WHERE seen_at < ?", [ now.to_f - STALE_AFTER ])
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Forgets the connection, for tests that delete the database file.
|
|
189
|
+
def reset!
|
|
190
|
+
LOCK.synchronize do
|
|
191
|
+
@db&.close
|
|
192
|
+
@db = nil
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
data/lib/tensaku/version.rb
CHANGED
data/lib/tensaku.rb
CHANGED
|
@@ -11,6 +11,14 @@ module Tensaku
|
|
|
11
11
|
autoload :Middleware, "tensaku/middleware"
|
|
12
12
|
autoload :Endpoints, "tensaku/endpoints"
|
|
13
13
|
autoload :Notes, "tensaku/notes"
|
|
14
|
+
autoload :Agents, "tensaku/agents"
|
|
15
|
+
autoload :Project, "tensaku/project"
|
|
16
|
+
autoload :Session, "tensaku/session"
|
|
17
|
+
autoload :Store, "tensaku/store"
|
|
18
|
+
autoload :Repo, "tensaku/repo"
|
|
19
|
+
autoload :Doorbell, "tensaku/doorbell"
|
|
20
|
+
autoload :Presence, "tensaku/presence"
|
|
21
|
+
autoload :Build, "tensaku/build"
|
|
14
22
|
autoload :Mcp, "tensaku/mcp"
|
|
15
23
|
autoload :Caches, "tensaku/caches"
|
|
16
24
|
autoload :I18nMarkers, "tensaku/i18n"
|
|
@@ -35,23 +43,15 @@ module Tensaku
|
|
|
35
43
|
# Directories and files, relative to Rails.root, that Tensaku may write to.
|
|
36
44
|
attr_reader :writable_paths
|
|
37
45
|
|
|
38
|
-
#
|
|
39
|
-
attr_accessor :
|
|
40
|
-
|
|
41
|
-
# Resolved notes older than this are deleted.
|
|
42
|
-
attr_accessor :prune_after
|
|
43
|
-
|
|
44
|
-
# Keyboard shortcut that toggles the overlay, as modifier keys and a KeyboardEvent#code.
|
|
45
|
-
attr_accessor :shortcut
|
|
46
|
+
# Resolved and declined notes older than this move to the archive.
|
|
47
|
+
attr_accessor :archive_after
|
|
46
48
|
|
|
47
49
|
# Where the middleware serves the overlay and the endpoints.
|
|
48
50
|
attr_accessor :mount_path
|
|
49
51
|
|
|
50
52
|
def initialize
|
|
51
53
|
@writable_paths = %w[app/views app/components config/locales]
|
|
52
|
-
@
|
|
53
|
-
@prune_after = 3 * 24 * 60 * 60
|
|
54
|
-
@shortcut = "alt+shift+KeyT"
|
|
54
|
+
@archive_after = 3 * 24 * 60 * 60
|
|
55
55
|
@mount_path = "/__tensaku"
|
|
56
56
|
end
|
|
57
57
|
end
|
|
@@ -89,10 +89,34 @@ module Tensaku
|
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
# The app root that relative source paths resolve against. Tests point it at a scratch copy.
|
|
92
|
+
# `tensaku mcp` runs without Rails and sets it per app with with_root.
|
|
92
93
|
attr_writer :root
|
|
93
94
|
|
|
94
95
|
def root
|
|
95
|
-
Pathname(@root || Rails.root)
|
|
96
|
+
Pathname(Thread.current[:tensaku_root] || @root || Rails.root)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# The folder for Tensaku's database, shared by every app and checkout on this machine: TENSAKU_HOME,
|
|
100
|
+
# else the platform's per-user data folder.
|
|
101
|
+
def home
|
|
102
|
+
return Pathname(ENV["TENSAKU_HOME"]) unless ENV["TENSAKU_HOME"].to_s.empty?
|
|
103
|
+
|
|
104
|
+
if Gem.win_platform?
|
|
105
|
+
Pathname(ENV["LOCALAPPDATA"].to_s.empty? ? File.join(Dir.home, "AppData", "Local") : ENV["LOCALAPPDATA"]).join("tensaku")
|
|
106
|
+
elsif RUBY_PLATFORM.include?("darwin")
|
|
107
|
+
Pathname(Dir.home).join("Library", "Application Support", "tensaku")
|
|
108
|
+
else
|
|
109
|
+
Pathname(ENV["XDG_DATA_HOME"].to_s.empty? ? File.join(Dir.home, ".local", "share") : ENV["XDG_DATA_HOME"]).join("tensaku")
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Runs the block with root set to path, in this thread only.
|
|
114
|
+
def with_root(path)
|
|
115
|
+
previous = Thread.current[:tensaku_root]
|
|
116
|
+
Thread.current[:tensaku_root] = Pathname(path)
|
|
117
|
+
yield
|
|
118
|
+
ensure
|
|
119
|
+
Thread.current[:tensaku_root] = previous
|
|
96
120
|
end
|
|
97
121
|
|
|
98
122
|
private
|
data/skills/tensaku/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tensaku
|
|
3
|
-
description: Work through Tensaku notes, the comments a person left on pages of this Rails app in development, each pointing at the exact file and line that rendered the element. Use when the user mentions Tensaku, notes on the page, "my notes",
|
|
3
|
+
description: Work through Tensaku notes, the comments a person left on pages of this Rails app in development, each pointing at the exact file and line that rendered the element. Use when the user mentions Tensaku, notes on the page, "my notes", asks you to go through what they marked up in the browser, or asks you to watch or listen for their notes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Tensaku notes
|
|
@@ -13,10 +13,15 @@ one or more targets with the source position Herb stamped on the element.
|
|
|
13
13
|
|
|
14
14
|
Use whichever is available, in this order:
|
|
15
15
|
|
|
16
|
-
1. **MCP**: the `tensaku` server (
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
1. **MCP**: the `tensaku` server (`bundle exec tensaku mcp`, started from the project's MCP config).
|
|
17
|
+
Tools: `list_notes`, `get_note`, `get_screenshot`, `start_note`, `resolve_note`, `decline_note`, `reply_to_note`,
|
|
18
|
+
`ask_question`, `watch_notes`, `channel_ready`, `current_selection`. It reads Tensaku's database, so the dev server
|
|
19
|
+
doesn't have to be running.
|
|
20
|
+
2. **Command line**: `bundle exec tensaku notes`, when the MCP server isn't configured. It does what the
|
|
21
|
+
tools do and prints the same text: `tensaku notes` lists the open notes, then `tensaku notes start
|
|
22
|
+
ID`, `resolve ID REPLY`, `decline ID REASON`, `ask ID QUESTION`, `reply ID MESSAGE`, `show ID`,
|
|
23
|
+
`screenshot ID` (saves the note's screenshot as a PNG and prints where) and `watch`. Pass `--as NAME`
|
|
24
|
+
with your name, so the page shows who is working.
|
|
20
25
|
|
|
21
26
|
A note looks like this:
|
|
22
27
|
|
|
@@ -27,16 +32,22 @@ A note looks like this:
|
|
|
27
32
|
"comment": "tighten this, and the heading is wrong",
|
|
28
33
|
"targets": [
|
|
29
34
|
{ "kind": "element", "file": "app/views/pages/_hero.html.erb", "range": "4:3-4:40", "tag": "h1", "text": "About me",
|
|
35
|
+
"classes": ["hero__title", "text-4xl"],
|
|
30
36
|
"context": { "partials": ["app/views/pages/_hero.html.erb", "app/views/pages/about.html.erb"], "controller": "hero" } },
|
|
31
37
|
{ "kind": "translation", "key": "pages.about.title", "locale": "en", "file": "config/locales/en.yml", "range": "12" }
|
|
32
38
|
],
|
|
33
39
|
"rect": { "x": 120, "y": 340, "width": 600, "height": 180 },
|
|
34
40
|
"status": "open",
|
|
35
|
-
"
|
|
41
|
+
"sent_at": "2026-11-10T09:12:00.000000Z",
|
|
42
|
+
"thread": []
|
|
36
43
|
}
|
|
37
44
|
```
|
|
38
45
|
|
|
39
|
-
- `
|
|
46
|
+
- `sent_at` is when the person last saved, edited or answered the note.
|
|
47
|
+
- `classes` are the element's own CSS classes, for notes about how something looks.
|
|
48
|
+
|
|
49
|
+
- `range` is `line:column-line:column` in `file` (1-based). For translations it's the line of the key. It's
|
|
50
|
+
from when the note was written: if the file has changed since, look for the target's `text` in it.
|
|
40
51
|
- `kind` is `element`, `text` (the person selected that text), `translation` (the text came from that
|
|
41
52
|
I18n key) or `markdown` (a Markdown source block).
|
|
42
53
|
- `rect` is set for area notes: the person dragged over a region, and `targets` lists the elements in it.
|
|
@@ -45,18 +56,48 @@ A note looks like this:
|
|
|
45
56
|
|
|
46
57
|
## Working through notes
|
|
47
58
|
|
|
48
|
-
1. List the open notes (`list_notes`, or
|
|
49
|
-
|
|
59
|
+
1. List the open notes (`list_notes`, or `tensaku notes`). Each is marked *Yours* or *Nobody's yet*;
|
|
60
|
+
notes other sessions hold aren't listed.
|
|
61
|
+
2. Call `start_note` on the note you take, before you change anything, so the person sees it's being
|
|
62
|
+
worked on and no other session takes it. If it fails, leave that note. `resolve_note` refuses a
|
|
63
|
+
note you didn't start, and a note the person took back from you. A note marked as stopped was
|
|
64
|
+
started by a session that ended: part of its change may already be in the file. Then open the
|
|
65
|
+
target file at the range, read the comment, and make the change. Look at
|
|
50
66
|
`context.partials` when the fix belongs in a parent template, and at the translation target when the
|
|
51
67
|
text comes from a locale file (change every locale that needs it).
|
|
52
68
|
3. Read the note's `thread`: the person's answers to earlier questions are there. Use `reply_to_note`
|
|
53
69
|
to say what you found when that helps the person. If the comment is ambiguous, don't guess: call `ask_question` with a short, specific question. The
|
|
54
70
|
question shows on the page and the note waits for an answer.
|
|
55
|
-
4.
|
|
56
|
-
`Shortened the intro in app/views/pages/_hero.html.erb:6`. The pin on the page
|
|
57
|
-
person can check it.
|
|
71
|
+
4. As soon as the change is made, call `resolve_note` with a one-line reply that says what changed and
|
|
72
|
+
where, for example `Shortened the intro in app/views/pages/_hero.html.erb:6`. The pin on the page
|
|
73
|
+
turns green so the person can check it.
|
|
74
|
+
5. If the change shouldn't be made (it would break something, or belongs somewhere else), call
|
|
75
|
+
`decline_note` with the reason instead of resolving it.
|
|
76
|
+
|
|
77
|
+
If `start_note` says a note belongs to another agent session, leave that note and take the next. When
|
|
78
|
+
you start watching, tell the person the session name the first `watch_notes` answer gives you (such as
|
|
79
|
+
amber-fox): the page shows it next to your name.
|
|
80
|
+
|
|
81
|
+
Take the notes one at a time, and resolve each before you start the next. The person is watching the page,
|
|
82
|
+
so don't make every change first and update the notes at the end. These calls are small: `start_note` and
|
|
83
|
+
`resolve_note` answer with one line. `list_notes` already has each note's text, so don't call
|
|
84
|
+
`get_note` after it, unless a thread says earlier messages were left out and you need them.
|
|
85
|
+
|
|
86
|
+
In Claude Code, Tensaku may arrive as a channel: a `<channel source="tensaku">` message asks you to
|
|
87
|
+
call `channel_ready` with a code, and later ones hold notes the person saved, already yours. Work
|
|
88
|
+
through those like notes from `watch_notes`; there's no need to call `watch_notes` then.
|
|
89
|
+
|
|
90
|
+
Once you have called `watch_notes`, notes the person saves while you work come with the answer of
|
|
91
|
+
your next Tensaku call ("Notes the person saved while you worked"), already yours: work through them
|
|
92
|
+
after the current note. Call `watch_notes` again only when you have nothing else to do. When an answer
|
|
93
|
+
ends with "notes were saved on the page since you last looked", call `watch_notes` or `list_notes`
|
|
94
|
+
after finishing the current note.
|
|
58
95
|
|
|
59
|
-
|
|
60
|
-
`checked_at` as
|
|
96
|
+
When the person asks you to watch or listen for their notes, call `watch_notes` in a loop: work through
|
|
97
|
+
the notes it returns, then call it again, passing the `checked_at` line of the previous answer as
|
|
98
|
+
`since`. When it times out with no notes, call it again. The page shows you as listening while you
|
|
99
|
+
wait, and the notes they save reach you as they write them. Stop when they ask you to.
|
|
61
100
|
|
|
62
|
-
|
|
101
|
+
A note that says "Screenshot:" has a picture of what it points at, as the page looked when the person
|
|
102
|
+
wrote it. Get it with `get_screenshot` (or `tensaku notes screenshot ID`) when the comment is about how
|
|
103
|
+
something looks.
|
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tensaku
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Afonso
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
@@ -77,13 +77,28 @@ dependencies:
|
|
|
77
77
|
- - "~>"
|
|
78
78
|
- !ruby/object:Gem::Version
|
|
79
79
|
version: 0.6.1
|
|
80
|
+
- !ruby/object:Gem::Dependency
|
|
81
|
+
name: sqlite3
|
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '2.0'
|
|
87
|
+
type: :runtime
|
|
88
|
+
prerelease: false
|
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
90
|
+
requirements:
|
|
91
|
+
- - ">="
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '2.0'
|
|
80
94
|
description: Tensaku lets you click text on a Rails page in development and write
|
|
81
95
|
the change back to the ERB template, the locale YAML or the Markdown source, or
|
|
82
96
|
leave notes on elements and areas that a coding agent reads with the exact file
|
|
83
97
|
and line. Built on Herb through ReActionView. Development only.
|
|
84
98
|
email:
|
|
85
99
|
- dav@davafons.com
|
|
86
|
-
executables:
|
|
100
|
+
executables:
|
|
101
|
+
- tensaku
|
|
87
102
|
extensions: []
|
|
88
103
|
extra_rdoc_files: []
|
|
89
104
|
files:
|
|
@@ -91,9 +106,14 @@ files:
|
|
|
91
106
|
- LICENSE
|
|
92
107
|
- README.md
|
|
93
108
|
- app/assets/tensaku.js
|
|
109
|
+
- exe/tensaku
|
|
94
110
|
- lib/generators/tensaku/install_generator.rb
|
|
95
111
|
- lib/tensaku.rb
|
|
112
|
+
- lib/tensaku/agents.rb
|
|
113
|
+
- lib/tensaku/build.rb
|
|
96
114
|
- lib/tensaku/caches.rb
|
|
115
|
+
- lib/tensaku/cli.rb
|
|
116
|
+
- lib/tensaku/doorbell.rb
|
|
97
117
|
- lib/tensaku/endpoints.rb
|
|
98
118
|
- lib/tensaku/file_write.rb
|
|
99
119
|
- lib/tensaku/guard.rb
|
|
@@ -101,11 +121,19 @@ files:
|
|
|
101
121
|
- lib/tensaku/mcp.rb
|
|
102
122
|
- lib/tensaku/middleware.rb
|
|
103
123
|
- lib/tensaku/notes.rb
|
|
124
|
+
- lib/tensaku/notes/markdown.rb
|
|
125
|
+
- lib/tensaku/notes/target.rb
|
|
126
|
+
- lib/tensaku/presence.rb
|
|
127
|
+
- lib/tensaku/project.rb
|
|
104
128
|
- lib/tensaku/railtie.rb
|
|
129
|
+
- lib/tensaku/repo.rb
|
|
130
|
+
- lib/tensaku/session.rb
|
|
131
|
+
- lib/tensaku/session/tools.rb
|
|
105
132
|
- lib/tensaku/source/html_text.rb
|
|
106
133
|
- lib/tensaku/source/locale.rb
|
|
107
134
|
- lib/tensaku/source/markdown.rb
|
|
108
135
|
- lib/tensaku/source/template.rb
|
|
136
|
+
- lib/tensaku/store.rb
|
|
109
137
|
- lib/tensaku/version.rb
|
|
110
138
|
- skills/tensaku/SKILL.md
|
|
111
139
|
homepage: https://tensaku.lostcoords.com
|
|
@@ -133,6 +161,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
133
161
|
requirements: []
|
|
134
162
|
rubygems_version: 4.0.20
|
|
135
163
|
specification_version: 4
|
|
136
|
-
summary:
|
|
137
|
-
in development.
|
|
164
|
+
summary: Fix your Rails app without leaving the browser.
|
|
138
165
|
test_files: []
|