tencil 0.0.0-stage → 0.3.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pixel Perfect Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,173 @@
1
- # Temporary Holding Version
1
+ # Tencil
2
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.
3
+ **Point at your UI. Prompt your agent.**
4
+
5
+ Tencil is a browser review tool for coding agents. Press <kbd>C</kbd> on your
6
+ running dev site, click any element, and type what should change. Tencil pins
7
+ the comment to that element, starts an agent thread with the element's component,
8
+ source file and markup (plus a screenshot if you add one), and streams the agent's
9
+ progress back onto the pin while your dev server hot-reloads the result.
10
+
11
+ Think Vercel Comments, except the reviewer on the other side is an agent.
12
+
13
+ ```
14
+ your dev site (any origin on localhost) your machine
15
+ ┌────────────────────────────────────┐ ws ┌─────────────────────┐ ws/rpc ┌───────────┐
16
+ │ overlay (Preact, shadow DOM) │ ──────▶ │ tencil daemon │ ─────────▶ │ T3 Code │
17
+ │ • picker, pins, threads, inbox │ ◀────── │ • holds credentials│ ◀───────── │ (threads) │
18
+ │ • React source via owner stacks │ │ • provider adapters│ └───────────┘
19
+ └────────────────────────────────────┘ │ • pin store │
20
+ └─────────────────────┘
21
+ ```
22
+
23
+ T3 Code is the orchestrator: every pin is a real T3 Code thread in the project
24
+ that matches your dev site's folder, so you can continue any conversation there.
25
+
26
+ ## Quick start
27
+
28
+ You need the [T3 Code](https://github.com/pingdotgg/t3code) desktop app running.
29
+
30
+ ```sh
31
+ cd your-app
32
+ npx tencil
33
+ ```
34
+
35
+ The first time, this sets up your machine: it asks whether Tencil should start
36
+ when you log in (yes by default) and pairs with T3 Code. Then it adds Tencil to
37
+ the project in the current folder. In other projects it only does the second part.
38
+ Start your dev server as usual and press <kbd>C</kbd> on the page.
39
+
40
+ The two steps also run on their own: `npx tencil setup` (this machine) and
41
+ `npx tencil init` (this project).
42
+
43
+ ### How it fits together
44
+
45
+ Tencil runs as **one daemon per machine** on `localhost:4747`. Projects only load a
46
+ script from it in development; there's no build plugin or config to maintain. For
47
+ someone without the daemon running, the script doesn't load and nothing appears, so
48
+ committing the integration to a shared repo is safe.
49
+
50
+ When a page connects, the daemon works out which project it belongs to:
51
+
52
+ 1. **the dev server's folder**, found from the port the page is served on;
53
+ 2. if that fails (Docker, remote dev), the overlay asks **"Which project is this
54
+ page?"** with your T3 Code projects and remembers the answer.
55
+
56
+ Each project gets its own T3 Code connection and pins, all served by the one daemon.
57
+
58
+ ### What `init` adds
59
+
60
+ **Next.js** (`app/layout.tsx`, or `pages/_document` for the pages router):
61
+
62
+ ```tsx
63
+ import { Tencil } from "tencil/react";
64
+ <body>{children}<Tencil /></body> {/* renders nothing outside development */}
65
+ ```
66
+
67
+ **Vite** (React, Vue, Svelte, TanStack Start, Astro and others):
68
+
69
+ ```ts
70
+ import tencil from "tencil/vite";
71
+ export default defineConfig({ plugins: [react(), tencil()] });
72
+ ```
73
+
74
+ **Anything else:** load this in development only:
75
+
76
+ ```html
77
+ <script src="http://localhost:4747/tencil.js" async></script>
78
+ ```
79
+
80
+ ### Starting at login
81
+
82
+ `setup` asks whether Tencil should start when you log in (the default). It then
83
+ keeps its own copy in `~/.config/tencil/runtime`, since npx's cache can be cleaned
84
+ up, and registers it with launchd on macOS, systemd on Linux or Task Scheduler on
85
+ Windows. Answer no and run `npx tencil start` after a restart instead.
86
+
87
+ `npx tencil stop` stops it until you next log in; `npx tencil service uninstall`
88
+ removes it. To update, run `npx tencil@latest setup` again.
89
+
90
+ ### Pairing
91
+
92
+ Tencil pairs with the T3 Code on your machine by itself (`init` does it right
93
+ away). Otherwise use the **Pair** button in the overlay, or create a pairing link in
94
+ T3 Code → Settings → Connections and run `npx tencil connect "<link>"`.
95
+
96
+ ### Claude Code instead of T3 Code
97
+
98
+ Setup works out which agent you have: with only T3 Code or only Claude Code it uses
99
+ that one, with both (or neither) it asks once. Each project can switch in the overlay:
100
+ the gear on the toolbar opens its settings, and the choice is remembered for that
101
+ project. Pins you already made keep the agent they started with. To choose without
102
+ being asked, pass `--provider t3code` or `--provider claude-code` to setup. The
103
+ daemon runs Claude Code itself, under your Claude Code login, in the project's
104
+ repository root. Each pin is a Claude Code session you can also pick up in a
105
+ terminal with `claude --resume <id>`. The first time, Tencil installs the Claude
106
+ Agent SDK into its config folder (it brings Claude Code along, about 250 MB).
107
+
108
+ Nobody is at a terminal to approve tool calls, so `--runtime-mode` decides up front:
109
+ `full-access` (the default) lets Claude Code run anything; with the stricter modes,
110
+ tools that would need approval are refused and Claude Code is told why. A turn that
111
+ is running when the daemon stops is lost; the pin turns red and you can follow up.
112
+
113
+ ## Using it
114
+
115
+ | Action | How |
116
+ | --- | --- |
117
+ | Comment mode | <kbd>C</kbd> or the toolbar button |
118
+ | Pin a prompt | Click an element, type, <kbd>Enter</kbd> |
119
+ | Cancel | <kbd>Esc</kbd> |
120
+ | Follow up | Open a pin and reply; the same agent thread continues |
121
+ | Continue an existing thread | In the composer, switch **→ New thread** to any thread in the project; the element becomes its next message |
122
+ | Open any project thread | Inbox → **T3 Code** tab; the thread docks on the right so you can read, reply and stop while using the page |
123
+ | Stop the agent | **Stop** while a pin is working |
124
+ | All pins | Inbox button, filter by page or show resolved |
125
+ | Continue in T3 Code | External-link icon on a pin |
126
+
127
+ Pins show their state: spinning while the agent works, blue when done, amber when
128
+ the agent waits for approval, red on errors, grey once resolved.
129
+
130
+ ## CLI
131
+
132
+ ```
133
+ tencil Set up this machine if needed, then add Tencil to this project
134
+ tencil setup Set up this machine: start Tencil (at login) and pair
135
+ tencil init [options] Load the overlay in this project (Next.js, Vite)
136
+ tencil start Start the daemon in the background
137
+ tencil start --foreground Run the daemon in this terminal
138
+ tencil stop Stop the daemon (until the next login, with the login service)
139
+ tencil status Show the daemon and the projects it serves
140
+ tencil service install Start the daemon automatically when you log in
141
+ tencil service uninstall Remove the login service
142
+ tencil connect [pairing-link] Pair with T3 Code (automatic for a local T3 Code)
143
+
144
+ --port <n> Port (default 4747, env TENCIL_PORT)
145
+ --provider <name> Agent for projects without their own: t3code (default) | claude-code
146
+ --t3-url <url> T3 Code server (default: last paired, then http://127.0.0.1:3773)
147
+ --model <model> T3 Code: instance:model, e.g. claudeAgent:claude-fable-5-1
148
+ Claude Code: a model, e.g. claude-opus-5-5 (default: its default)
149
+ --runtime-mode <mode> approval-required | auto-accept-edits | auto | full-access
150
+ --listen <address> Also listen here, e.g. a Tailscale IP (repeatable)
151
+ --allow-origin <url> Allow a non-localhost page to connect (repeatable)
152
+ --no-create-project Don't register unknown folders as T3 Code projects
153
+
154
+ init: -y/--yes, --dry-run, --skip-install, --from <package spec>
155
+ ```
156
+
157
+ ## Security
158
+
159
+ The bridge can make an agent edit your code, so it is locked down by default:
160
+
161
+ - Pins are stored per project in `~/.config/tencil/projects/`, never inside your repo.
162
+ Remembered page → project choices live in `~/.config/tencil/origins.json`.
163
+ - Credentials live in `~/.config/tencil/credentials.json` (mode `0600`) and never
164
+ reach the page. The token only carries `orchestration:read` and `orchestration:operate`.
165
+ - The bridge listens on `127.0.0.1` and only accepts WebSocket connections from
166
+ loopback origins (`localhost`, `*.localhost`, `127.0.0.1`, `[::1]`) unless you
167
+ pass `--allow-origin`. Requests addressed to any other host name than loopback,
168
+ a `--listen` address or an allowed origin's host are refused, which blocks DNS
169
+ rebinding. Tools that send no Origin are only trusted from this machine.
170
+ - On a shared dev box, `--listen` exposes the bridge to that network: browsers are
171
+ held to `--allow-origin`, but a non-browser client can claim any Origin, so only
172
+ listen on a network you trust (such as your tailnet).
173
+ - Agent replies are rendered as text nodes (no `innerHTML`).
@@ -0,0 +1,16 @@
1
+ # Third-party notices
2
+
3
+ The published `tencil` package bundles code from the projects below. Each is
4
+ used under the license shown; full license texts are available in the linked
5
+ repositories.
6
+
7
+ | Project | License | Used for |
8
+ | --- | --- | --- |
9
+ | [Preact](https://github.com/preactjs/preact) | MIT | Overlay UI |
10
+ | [@preact/signals](https://github.com/preactjs/signals) | MIT | Overlay state |
11
+ | [bippy](https://github.com/aidenybai/bippy) | MIT | React component and source lookup |
12
+ | [modern-screenshot](https://github.com/qq15725/modern-screenshot) | MIT | Element screenshots |
13
+ | [T3 Code](https://github.com/pingdotgg/t3code) | MIT | Agent icons (Codex, Claude, Cursor) shown in the thread list |
14
+ | [ws](https://github.com/websockets/ws) | MIT | Bridge WebSocket server (dependency) |
15
+ | [zod](https://github.com/colinhacks/zod) | MIT | Message validation (dependency) |
16
+ | [picocolors](https://github.com/alexeyraspopov/picocolors) | ISC | CLI colors (dependency) |
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}