t3-bridge 0.0.0-stage → 0.1.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 Riza Maulana Ardiyanto
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,146 @@
1
- # Temporary Holding Version
1
+ # T3 Bridge
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
+ Chat with a T3 Code thread from Slack. Each bot is one Slack app talking to one T3 thread. That
4
+ thread acts as an **orchestrator**: it never does the work itself, it hands each task to a
5
+ subagent and reports back. Replies, subagent progress, approvals, and questions show up in
6
+ Slack; your messages, files, and button clicks go back to T3.
7
+
8
+ T3 Bridge runs next to [T3 Code](https://github.com/pingdotgg/t3code) as its own program. It
9
+ talks to T3 Code the same way the T3 mobile app does, so updating T3 Code does not touch it. If
10
+ T3 Code ever changes its protocol, the bridge shows "Update T3 Bridge" instead of half-working; see
11
+ [Keeping up with T3 Code](#keeping-up-with-t3-code).
12
+
13
+ This is an independent project, not made or supported by T3 Tools.
14
+
15
+ Requirements: macOS with T3 Code running, Node.js 22.18 or newer, and optionally
16
+ [Tailscale](https://tailscale.com) to open the control panel from other devices.
17
+
18
+ ## Install
19
+
20
+ On the Mac that runs T3 Code (over SSH works too):
21
+
22
+ ```sh
23
+ npx t3-bridge install
24
+ ```
25
+
26
+ T3 Bridge now runs in the background, starts at login, and pairs with T3 Code by itself. The
27
+ command prints the control panel link, `http://<tailscale-ip>:47821/#token=…`. Open it in any
28
+ browser on your Tailscale network, your phone included, and bookmark it. Everything else,
29
+ adding Slack bots included, happens in that page. The link works like a password.
30
+
31
+ With T3 Code on more than one Mac, run the same command on each Mac whose threads you want in
32
+ Slack, and bookmark each link. On a single Mac without Tailscale, open the `127.0.0.1` link.
33
+
34
+ | Command | |
35
+ |---|---|
36
+ | `npx t3-bridge` | Run in the terminal instead of in the background |
37
+ | `npx t3-bridge install` | Run in the background, starting at login |
38
+ | `npx t3-bridge uninstall` | Stop and remove the background service; bots and settings are kept |
39
+ | `npx t3-bridge link` | Print the control panel link again |
40
+ | `npx t3-bridge status` | Show whether T3 Code and the bots are connected |
41
+
42
+ To update, open the control panel's **Updates** card and choose **Update now**, or run
43
+ `npx t3-bridge@latest install`. Settings live in `~/Library/Application Support/T3 Bridge` and
44
+ logs in `~/Library/Logs/T3 Bridge.log`.
45
+
46
+ **Replace link** in **Open from other devices** issues a new link; every old copy stops working.
47
+
48
+ ## Add a Slack bot
49
+
50
+ In the control panel, choose **Add Slack bot** and follow the steps:
51
+
52
+ 1. Name the bot and copy the generated manifest.
53
+ 2. On api.slack.com/apps, choose **Create New App → From a manifest**, paste it, and install the
54
+ app to your workspace. Copy the **Bot User OAuth Token** (`xoxb-…`).
55
+ 3. Under **Basic Information → App-Level Tokens**, create a token with the `connections:write`
56
+ scope (`xapp-…`).
57
+ 4. Paste both tokens and choose **Test tokens**.
58
+ 5. Choose a thread, or create a new orchestrator thread. A new thread is pinned, runs with full
59
+ access, and starts with the orchestrator instructions.
60
+ 6. Leave **Who may use it** empty to claim the bot by sending it a direct message, or list Slack
61
+ member IDs.
62
+
63
+ Message the bot directly, or invite it to a channel with `/invite @bot`. Both go to the same thread. In
64
+ a channel, mention the bot (`@bot fix the login page`) or reply under one of its messages; other
65
+ channel chatter is ignored.
66
+
67
+ ## Updating an existing bot's Slack app
68
+
69
+ When a new version needs more Slack permissions, the bot's card shows **Update Slack app**. It
70
+ gives you a new manifest to paste under **App Manifest** on api.slack.com, then asks you to
71
+ reinstall the app. The tokens stay the same.
72
+
73
+ ## In Slack
74
+
75
+ The bot is a Slack AI app. Each request is its own thread in the bot's Messages tab (or under
76
+ your mention in a channel): the reply streams in there, along with the request's subagents,
77
+ questions, and the summary the orchestrator posts after they finish. Reply in the thread to
78
+ continue that request; start a new message for a new one.
79
+
80
+ - Your message gets 👀 while the agent works, then ✅, ❌, or ⏹, and Slack shows
81
+ "<bot> is working…" in the thread.
82
+ - Press Slack's **Stop** button while the agent works, add 🛑 (`:octagonal_sign:`) to any message,
83
+ or send `!stop`, to stop the agent.
84
+ - On any message, choose **⋯ → Send to <bot>** to hand it to the agent with a note. The answer
85
+ arrives in your DM with the bot.
86
+ - Long reports (over about 4,000 characters) go into a Slack canvas; chat gets the opening and a
87
+ link. Workspaces without canvases get the whole reply in chat.
88
+ - Approvals and questions arrive with buttons. You can also answer a question by replying in its
89
+ Slack thread.
90
+ - Subagents show as Slack task cards that update while they run. The orchestrator's reply
91
+ summarizes what they found; expand a card to see the start of its raw result.
92
+ - Forwarded messages reach the agent with their text, author and link, plus their images and
93
+ files.
94
+ - Images go both ways: pictures you attach in Slack reach the agent, and screenshots or images
95
+ the agent shows (including ones it saved on the Mac) are uploaded to the thread.
96
+ - HTML pages the agent renders arrive as an `.html` file.
97
+ - Messages typed in T3 itself also show up in Slack, marked _Sent from T3_.
98
+ - Every message reaches T3 tagged with its thread, e.g. `[Slack · Riza · thread "Check Pro PRs"]`,
99
+ so a reply like "yes, merge it" arrives with its subject. Slack's thread list uses the same titles.
100
+ - When one request starts several subagents, they share one plan card in its thread.
101
+ - Send `!new` (or use **New thread** on the bot's card) to start a fresh orchestrator thread with
102
+ the same project, model and instructions when the current one has grown long.
103
+
104
+ Only allowed people can send work. The bot runs code on your Mac, so keep that list short.
105
+
106
+ ## Keeping up with T3 Code
107
+
108
+ The bridge speaks T3 Code's WebSocket protocol using T3 Code's own contract definitions, copied
109
+ into `vendor/t3code` (T3 Code is MIT licensed; `vendor/t3code/SOURCE.md` records the commit).
110
+ When T3 Code changes its protocol, refresh them from a T3 Code checkout and rebuild:
111
+
112
+ ```sh
113
+ pnpm sync-t3code ~/Code/t3code
114
+ pnpm typecheck && pnpm test
115
+ ```
116
+
117
+ Then publish a new version (see Develop).
118
+
119
+ ## Develop
120
+
121
+ ```sh
122
+ pnpm test # unit tests
123
+ pnpm typecheck
124
+ pnpm build # bundles the CLI (tsdown) and the control panel (vite) into dist/
125
+ pnpm start # builds, then runs in the terminal
126
+ node dist/cli.cjs install # runs this build as the background service
127
+ ```
128
+
129
+ To run against an isolated T3 server instead of your own:
130
+
131
+ ```sh
132
+ T3_BRIDGE_DATA=/tmp/bridge T3_BRIDGE_PORT=47899 T3_BRIDGE_T3_URL=http://127.0.0.1:4791 \
133
+ T3_BRIDGE_PAIR_COMMAND='node apps/server/src/bin.ts auth pairing create --base-dir /tmp/t3' \
134
+ node dist/cli.cjs
135
+ ```
136
+
137
+ To release, run `npm version patch` (or `minor`) and `git push --follow-tags`. The Release
138
+ workflow publishes the new version to npm and creates a GitHub release with notes; installed
139
+ copies then offer it under **Updates** in their control panel.
140
+
141
+ Chat platforms plug in through `ChatAdapter` in `src/engine/core/types.ts`; Slack is the first
142
+ adapter.
143
+
144
+ ## License
145
+
146
+ MIT. The files in `vendor/t3code` are from T3 Code, also MIT; see `vendor/t3code/LICENSE`.