Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ apps/*/dist
infra/*/dist
.astro
packages/*/dist
*.vsix
.env
.env.local
build/
Expand Down
4 changes: 4 additions & 0 deletions apps/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.vscode/**
.vscodeignore
node_modules/**
scripts/**
src/**
tsconfig.json
vite.config.*
*.test.*
*.vsix
dist/**/*.map
28 changes: 28 additions & 0 deletions apps/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

All notable changes to the T3 Code VS Code extension are documented in this file.

## 0.0.38

- Add **T3 Code: Set Server URL**, which sets the server URL from the Command Palette, prefilled
with the current value and validated before it is saved, and **T3 Code: Open Settings**, which
opens the extension's settings.
- Document the server URL default (`http://127.0.0.1:3773`), when to change it, and every setting
with its default. Expand the settings descriptions shown in the Settings UI.
- Fix the screenshot on the marketplace listing, which did not load in 0.0.37 because the packaged
README's links pointed at a branch that did not yet contain the extension. Packaged README links
are now pinned to the commit each version is built from.

## 0.0.37

Initial marketplace release of the `patroza` fork build.

- Dedicated T3 Code sidebar webview with a worktree-scoped thread picker, synchronized transcript,
context control, and prompt composer.
- Native `@t3` VS Code Chat participant with `/new`, `/threads`, `/history`, `/context`, `/stop`,
and `/status` commands.
- Realtime thread synchronization with the T3 Code web, desktop, and mobile clients.
- Editor context, slash commands, images, approvals, tools, and tasks.
- Connects to a local T3 Desktop runtime when advertised, otherwise falls back to `t3Code.serverUrl`
(default `http://127.0.0.1:3773`). Remote servers authenticate with a bearer token held in VS Code
secret storage.
21 changes: 21 additions & 0 deletions apps/vscode/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 T3 Tools Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
109 changes: 103 additions & 6 deletions apps/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,64 @@

![T3 Code in VS Code](media/screenshot.jpg)

> **Unofficial fork build.** This extension is published as `patroza.t3-code` from
> [patroza/t3code](https://github.com/patroza/t3code), a fork of
> [pingdotgg/t3code](https://github.com/pingdotgg/t3code). It is not published or supported by
> T3 Tools Inc. Report issues against
> [this fork's tracker](https://github.com/patroza/t3code/issues).

This package exposes T3 Code as a dedicated VS Code secondary-sidebar chat tab, alongside the
Claude Code, Chat, and Codex tabs. It connects directly to the same T3 Code server used by the web,
desktop, and mobile clients, so projects, threads, messages, turn state, and assistant streaming
remain synchronized. It also provides an optional native `@t3` participant inside VS Code Chat.

## Requirements

The extension is a client only — it needs a T3 Code backend to talk to. Either run T3 Desktop on the
same machine as the extension host, or point `t3Code.serverUrl` at a reachable T3 Code server.
VS Code 1.95 or newer is required.

## Connecting to a server

**The default is `http://127.0.0.1:3773`**, which is a T3 Code server running on your own machine.
If that describes your setup, there is nothing to configure. Change the URL if your server runs on
another host or a different port.

Run **T3 Code: Set Server URL** from the Command Palette to change it. The prompt is prefilled with
the current value and rejects anything that isn't an `http`/`https` URL, so a typo surfaces
immediately instead of as a failed connection later. The extension reconnects as soon as the
setting changes.

If the server requires authentication, run **T3 Code: Set Server Bearer Token**. The token is kept
in VS Code's secret storage — never in your settings file — and is exchanged for a short-lived
WebSocket ticket.

Two details worth knowing:

- **A local T3 Desktop runtime wins over this setting.** The extension prefers the backend
advertised by the T3 Desktop process beside its extension host, and only falls back to
`t3Code.serverUrl`. This is what makes local, SSH, and other remote windows work independently,
rather than treating a synced `127.0.0.1` setting as the same machine.
- **`t3Code.serverUrl` is machine-scoped.** It is stored per machine in your user settings and
cannot be set per workspace, so a `127.0.0.1` URL never follows you to a different machine.

Connection trouble is usually quickest to diagnose from **T3 Code: Show Diagnostics**, which logs
each endpoint the extension tried and why it was rejected.

## Settings

Run **T3 Code: Open Settings** to open all of these in the Settings UI, or edit `settings.json`
directly.

| Setting | Default | What it does |
| ---------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `t3Code.serverUrl` | `http://127.0.0.1:3773` | Fallback server URL, used when no local T3 Desktop runtime is advertised. WebSocket and environment endpoints are derived from it. |
| `t3Code.defaultRuntimeMode` | `full-access` | Runtime mode for new threads: `approval-required`, `auto-accept-edits`, or `full-access`. |
| `t3Code.desktopClientSettingsPath` | `""` (auto-detect) | Path to T3 Desktop's `client-settings.json`, to share provider and model favorites. Auto-detects `~/.t3/userdata` or `~/.t3/dev` when empty. |

The default runtime mode is `full-access`, meaning new threads apply edits and run commands without
asking. Set `t3Code.defaultRuntimeMode` to `approval-required` if you would rather review each one.

## Development

1. Start T3 Code (`pnpm dev`), which listens at `http://127.0.0.1:3773` by default.
Expand All @@ -16,12 +69,6 @@ remain synchronized. It also provides an optional native `@t3` participant insid
4. Select the **T3 Code** tab in the secondary sidebar. Use **T3 Code: Open Chat** from the Command
Palette if the secondary sidebar is hidden.

The extension first uses the backend advertised by the T3 Desktop runtime beside its extension
host. This works independently in local, SSH, and other remote windows and avoids treating a
synced `127.0.0.1` setting as the same machine. For a fallback backend, set `t3Code.serverUrl`.
Remote servers can use **T3 Code: Set Server Bearer Token**; the token is stored in VS Code secret
storage and exchanged for a short-lived WebSocket ticket.

## Dedicated chat workflow

The T3 Code tab contains a worktree-scoped thread picker, synchronized transcript, context control,
Expand All @@ -45,3 +92,53 @@ column. Explicit Chat references such as `#file` and attached selections are alw
The **T3 Code: Ask About Selection** editor action opens Chat with `@t3` prefilled. Context is sent
as structured-looking provider context using workspace-relative paths and language-aware Markdown
fences. T3 Code clients present that envelope as a context reference rather than authored text.

## Releasing

The extension publishes to the `patroza` namespace on both the VS Code Marketplace and Open VSX.
Extension IDs and versions are shared between the two, so publish the same `.vsix` to each.

Bump `version` in `apps/vscode/package.json`, add a `CHANGELOG.md` entry, then commit and **push** —
packaging pins README links to the current commit and refuses to run if that commit is not on a
remote branch. Then:

```sh
pnpm --filter t3-code package # -> t3-code-<version>.vsix
```

Both `package` and `publish:vsce` go through `scripts/vsce.ts`, which runs the `vscode:prepublish`
build and supplies two sets of flags:

- `--no-dependencies`, because esbuild already bundles `src/`. Nothing from `node_modules` ships,
and vsce never has to resolve the `workspace:*` dependencies it cannot understand.
- `--baseContentUrl` / `--baseImagesUrl` pinned to the current commit, because vsce cannot infer
that this extension lives in a monorepo subdirectory and would otherwise rewrite the README's
relative links to the repository root. Pinning to the commit rather than `main` keeps each
published version's README pointing at the tree it was built from, so the screenshot survives
files moving later and works even when a version is published before its commit reaches `main`.
A published README cannot be corrected without publishing a new version.

Inspect the packaged contents before publishing:

```sh
pnpm --filter t3-code exec vsce ls --no-dependencies
```

Publishing needs a token per registry, neither of which is stored in this repo:

- **Marketplace** — an Azure DevOps PAT for the `patroza` publisher, created with the **Marketplace:
Manage** scope and the organization set to **All accessible organizations** (a PAT scoped to a
single organization fails at publish time with a 401). Pass it as `VSCE_PAT`, or run
`vsce login patroza` once. Note that Azure DevOps retires global PATs on **December 1, 2026**; the
replacement, `vsce publish --azure-credential` backed by Microsoft Entra ID, currently only covers
CI pipelines, so manual publishing still depends on a PAT until then.
- **Open VSX** — an access token for the `patroza` namespace from <https://open-vsx.org/user-settings/tokens>.
Pass it as `OVSX_PAT`. The namespace must be created once with `ovsx create-namespace patroza`.

```sh
VSCE_PAT=... pnpm --filter t3-code publish:vsce
OVSX_PAT=... pnpm --filter t3-code publish:ovsx t3-code-<version>.vsix
```

Tag the release as `vscode-v<version>` so extension tags do not collide with the `v*.*.*` tags that
drive the desktop release workflow.
Binary file added apps/vscode/media/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 49 additions & 8 deletions apps/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
{
"name": "t3-code",
"displayName": "T3 Code",
"version": "0.0.37",
"displayName": "T3 Code (patroza build)",
"version": "0.0.38",
"private": true,
"description": "A dedicated VS Code chat client for synchronized T3 Code threads.",
"description": "Unofficial fork build of T3 Code: a dedicated VS Code chat client for synchronized T3 Code threads.",
"categories": [
"AI",
"Chat",
"Other"
],
"publisher": "t3code",
"keywords": [
"agent",
"ai",
"chat",
"claude",
"codex"
],
"homepage": "https://github.com/patroza/t3code/tree/main/apps/vscode",
"bugs": {
"url": "https://github.com/patroza/t3code/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/patroza/t3code.git",
"directory": "apps/vscode"
},
"publisher": "patroza",
"type": "module",
"main": "./dist/extension.cjs",
"scripts": {
"build": "esbuild src/extension.ts --bundle --platform=node --format=cjs --target=node20 --external:vscode --outfile=dist/extension.cjs && esbuild src/webview.ts --bundle --platform=browser --format=iife --target=es2022 --outfile=dist/webview.js",
"typecheck": "tsgo --noEmit",
"test": "vp test run"
"test": "vp test run",
"vscode:prepublish": "vp run build",
"package": "node scripts/vsce.ts package",
"publish:vsce": "node scripts/vsce.ts publish",
"publish:ovsx": "ovsx publish --packagePath"
},
"dependencies": {
"@t3tools/client-runtime": "workspace:*",
Expand All @@ -27,7 +48,9 @@
},
"devDependencies": {
"@types/vscode": "1.95.0",
"@vscode/vsce": "^3.6.0",
"esbuild": "^0.28.0",
"ovsx": "^0.10.1",
"vite-plus": "catalog:"
},
"contributes": {
Expand Down Expand Up @@ -143,6 +166,16 @@
"command": "t3Code.openChat",
"title": "T3 Code: Open Chat",
"category": "T3 Code"
},
{
"command": "t3Code.setServerUrl",
"title": "T3 Code: Set Server URL",
"category": "T3 Code"
},
{
"command": "t3Code.openSettings",
"title": "T3 Code: Open Settings",
"category": "T3 Code"
}
],
"menus": {
Expand All @@ -161,7 +194,7 @@
"type": "string",
"scope": "machine",
"default": "http://127.0.0.1:3773",
"description": "Fallback T3 Code server HTTP URL when no local T3 Desktop runtime is advertised. WebSocket and environment endpoints are derived from it."
"markdownDescription": "Fallback T3 Code server HTTP URL, used when no local T3 Desktop runtime is advertised beside this extension host. WebSocket and environment endpoints are derived from it.\n\nThe default `http://127.0.0.1:3773` matches a T3 Code server on this machine. Point it at your own host (for example `https://t3.example.com`) to use a remote server, and run **T3 Code: Set Server Bearer Token** if that server requires authentication.\n\nRun **T3 Code: Set Server URL** to change this with validation."
},
"t3Code.defaultRuntimeMode": {
"type": "string",
Expand All @@ -170,13 +203,18 @@
"auto-accept-edits",
"full-access"
],
"enumDescriptions": [
"Ask before each edit or command.",
"Apply edits automatically, but ask before running commands.",
"Apply edits and run commands without asking."
],
"default": "full-access",
"description": "Runtime mode for new T3 Code threads."
"markdownDescription": "Runtime mode applied to new T3 Code threads. Defaults to `full-access`; choose `approval-required` to review every edit and command before it runs."
},
"t3Code.desktopClientSettingsPath": {
"type": "string",
"default": "",
"description": "Optional path to T3 Desktop's client-settings.json for sharing provider and model favorites. The default auto-detects ~/.t3/userdata or ~/.t3/dev."
"markdownDescription": "Optional path to T3 Desktop's `client-settings.json`, used to share provider and model favorites with the desktop app. Leave empty to auto-detect `~/.t3/userdata` or `~/.t3/dev`."
}
}
}
Expand All @@ -187,8 +225,10 @@
"onCommand:t3Code.clearBearerToken",
"onCommand:t3Code.newThread",
"onCommand:t3Code.openChat",
"onCommand:t3Code.openSettings",
"onCommand:t3Code.selectThread",
"onCommand:t3Code.setBearerToken",
"onCommand:t3Code.setServerUrl",
"onCommand:t3Code.showDiagnostics",
"onCommand:t3Code.toggleEditorContext",
"onView:t3Code.chatView",
Expand All @@ -197,6 +237,7 @@
"extensionKind": [
"workspace"
],
"icon": "media/icon.png",
"engines": {
"vscode": "^1.95.0"
}
Expand Down
Loading
Loading