Compare commits

..
Author SHA1 Message Date
Cursor Agent f485be5715 fix: reset publishProvider, publishVisibility, and publishProtocol on dialog close
The publish dialog's onOpenChange handler was resetting most state when closing
but omitted publishProvider, publishVisibility, and publishProtocol. This could
cause accidental public repository creation if a user previously selected 'public'
visibility and re-opened the dialog.
2026-05-04 01:07:13 +00:00
Cursor Agent df59af7222 Fix GitLab test URL assertions to match normalizeRepositoryCloneUrls using web_url
The normalizeRepositoryCloneUrls function was changed to return raw.web_url
instead of raw.http_url_to_repo || raw.web_url, but the test assertions still
expected the http_url_to_repo value (with .git suffix). Updated both assertions
to expect the web_url value (without .git suffix).

Applied via @cursor push command
2026-05-04 01:01:34 +00:00
cursor[bot] 4b30c82fd9 fix: use web_url instead of http_url_to_repo for GitLab repository URL
The normalizeRepositoryCloneUrls function was using http_url_to_repo (which
has a .git suffix) as the url field. This caused the 'Open on GitLab' button
to open a .git-suffixed URL and display it in the UI. Use web_url instead,
which is the proper browser URL and also works as an HTTPS clone URL.

Applied via @cursor push command
2026-05-04 00:45:09 +00:00
Cursor Agent 153bb29c80 fix: use web_url instead of http_url_to_repo for GitLab repository URL
The normalizeRepositoryCloneUrls function was using http_url_to_repo (which
has a .git suffix) as the url field. This caused the 'Open on GitLab' button
to open a .git-suffixed URL and display it in the UI. Use web_url instead,
which is the proper browser URL and also works as an HTTPS clone URL.
2026-05-04 00:44:28 +00:00
Julius Marmingeandcodex 22470229a9 Mock publish repository git mutations
- add publishRepository query key mock
- add sourceControlPublishRepository mutation options mock

Co-authored-by: codex <[email protected]>
2026-05-03 17:42:39 -07:00
Julius Marminge 98a7847022 Merge branch 'main' into t3code/remote-git-projects 2026-05-03 17:33:28 -07:00
Julius Marminge 27697abbad Push publishes to the selected remote
- Pass the ensured remote name through publish flow
- Push directly to that remote when publishing a repository
- Add coverage for remote-specific push behavior
2026-05-03 17:31:48 -07:00
Julius Marminge 92e2845b7c Add remote repository publish and discovery support
- add source control repository service for lookup, clone, and publish
- implement GitHub/GitLab repository creation and update discovery handling
- wire UI and server flows to use remote repository actions
2026-05-03 17:16:37 -07:00
3072 changed files with 28783 additions and 780460 deletions

No files matched your search

-80
View File
@@ -93,8 +93,6 @@ Examples:
A known environment may or may not know the target `environmentId` before first successful connect.
In the hosted web app, known environments are browser-local. A hosted pairing URL can create the saved entry, but it does not give the hosted app a server-side control plane or a copy of the session state.
### AccessEndpoint
An `AccessEndpoint` is one concrete way to reach a known environment.
@@ -110,67 +108,6 @@ A single environment may have many endpoints:
The environment stays the same. Only the access path changes.
### AdvertisedEndpoint
An `AdvertisedEndpoint` is a server or desktop-authored candidate endpoint for an environment. It is how the backend tells the client which URLs may be useful for pairing and reconnecting.
`AdvertisedEndpoint` is deliberately narrower than the full access model:
- it describes a concrete HTTP and WebSocket base URL pair
- it can mark the endpoint as default, available, or unavailable
- it includes reachability hints such as loopback, LAN, private, public, or tunnel
- it includes compatibility hints such as whether the endpoint can be used from the hosted HTTPS app
Clients should treat advertised endpoints as hints, not as proof that a route works from the current device. The final connection attempt still decides whether the endpoint is reachable.
The UI presents one default advertised endpoint in the network-access summary and keeps the rest behind an expandable advanced list. The default controls pairing QR codes and primary copy actions. Users can override it, but that override is a UI preference, not backend configuration.
Persist the override by stable endpoint kind rather than raw URL whenever possible. For example, a LAN endpoint should be stored as the desktop LAN endpoint preference, not as `192.168.x.y`, because the address can change when the user switches networks. Provider endpoints should use provider-specific stable keys such as Tailscale IP or Tailscale MagicDNS HTTPS. Custom endpoints may fall back to their concrete identity.
When no user default is saved, endpoint selection should prefer:
1. endpoints compatible with the hosted HTTPS app
2. explicitly default endpoints
3. non-loopback endpoints
4. loopback endpoints only for same-machine clients
This keeps endpoint discovery centralized without making any one provider, such as Tailscale or a future tunnel service, part of the core environment model.
### Endpoint providers
Endpoint providers are add-ons that contribute advertised endpoints for the current environment.
The provider boundary is intentionally outside the core environment model:
- core owns `ExecutionEnvironment`, saved environments, pairing, and connection lifecycle
- providers discover or synthesize endpoints
- providers return normalized `AdvertisedEndpoint` records
- the UI and pairing logic select from those records without knowing provider-specific commands
The first provider is Tailscale. It can discover Tailnet IP and MagicDNS addresses from the local machine and publish them as additional endpoint candidates. Future providers, such as a hosted tunnel service, should plug into the same shape rather than adding a separate remote environment path.
Provider-specific confidence should remain a hint. A Tailscale endpoint still needs a successful browser or desktop connection before the client treats it as connected.
### Hosted pairing request
A hosted pairing request is a bootstrap URL for the static web app, not a transport.
Example:
```text
https://app.t3.codes/pair?host=https://backend.example.com:3773#token=PAIRCODE
```
The hosted app reads the `host` parameter and pairing token, exchanges the token directly with that backend, then saves the resulting environment record in browser local storage.
Important constraints:
- the hosted app does not proxy HTTP or WebSocket traffic
- the backend must still be reachable directly from the browser
- HTTPS pages can only connect to HTTPS/WSS backends
- HTTP LAN endpoints should keep using direct desktop or CLI pairing URLs
- the token belongs in the URL hash so it is not sent to the hosted app origin
### RepositoryIdentity
`RepositoryIdentity` remains a best-effort logical repo grouping mechanism across environments.
@@ -214,8 +151,6 @@ Benefits:
- no client-specific process management required
- best fit for hosted or self-managed remote T3 deployments
Browser security rules are part of this access method. A hosted HTTPS web client can connect to `wss://` backends, but it cannot connect to plain `ws://` or `http://` LAN backends because that would be mixed content.
### 2. Tunneled WebSocket access
Examples:
@@ -235,8 +170,6 @@ This is especially useful when:
- mobile must reach a desktop-hosted environment
- a machine should be reachable without exposing raw LAN or public ports
Tailscale-backed access sits here architecturally even though the current implementation is endpoint discovery rather than a T3-managed tunnel. It contributes private-network endpoints and lets the existing HTTP/WebSocket client path do the actual connection.
### 3. Desktop-managed SSH access
SSH is an access and launch helper, not a separate environment type.
@@ -252,8 +185,6 @@ After that, the renderer should still connect using an ordinary WebSocket URL ag
This keeps the renderer transport model consistent with every other access method.
The desktop main process owns the SSH bridge because it can spawn local SSH processes, manage askpass prompts, write temporary launch scripts, and clean up forwards. The renderer receives a saved environment record and connects through the forwarded URL; it should not need SSH-specific RPC paths for normal environment traffic.
## Launch methods
Launch methods answer a different question:
@@ -296,15 +227,6 @@ The recommended T3 flow is:
4. Desktop establishes local port forwarding.
5. Renderer connects to the forwarded WebSocket endpoint as a normal environment.
The saved environment should remember that it was created by desktop SSH launch only for reconnect and lifecycle UX. That metadata should not change the server protocol or the environment identity model.
Failure handling should be explicit:
- SSH authentication failure should surface before any environment is saved
- remote launch failure should include remote logs or the launcher command output when available
- forwarded-port failure should leave the saved environment disconnected rather than falling back to an unrelated endpoint
- reconnect should attempt to restore the SSH bridge before reconnecting the normal WebSocket client
### 3. Client-managed local publish
This is the inverse of remote launch: a local T3 server is already running, and the client publishes it through a tunnel.
@@ -345,8 +267,6 @@ T3 already supports a WebSocket auth token on the server. That should become a f
For publicly reachable environments, authenticated access should be treated as required.
Hosted pairing should be treated as a client-side convenience only. The hosted app must not receive pairing tokens through query parameters, must not store pairing state server-side, and must not imply that an HTTP backend is safe or reachable from an HTTPS browser context.
## Relationship to Zed
Zed is a useful reference implementation for managed remote launch and reconnect behavior.
-35
View File
@@ -46,14 +46,6 @@ jobs:
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Ensure Electron runtime is installed
run: |
if ! node -e "require('./apps/desktop/node_modules/electron')" >/dev/null 2>&1; then
rm -rf apps/desktop/node_modules/electron/dist apps/desktop/node_modules/electron/path.txt
bun apps/desktop/node_modules/electron/install.js
fi
node -e "require('./apps/desktop/node_modules/electron')"
- name: Format
run: bun run fmt:check
@@ -82,33 +74,6 @@ jobs:
test -f apps/desktop/dist-electron/preload.cjs
grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
mobile_native_static_analysis:
name: Mobile Native Static Analysis
runs-on: blacksmith-12vcpu-macos-26
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: package.json
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Install mobile native static analysis tools
run: brew bundle install --file apps/mobile/Brewfile
- name: Lint mobile native sources
run: node scripts/mobile-native-static-check.ts
release_smoke:
name: Release Smoke
runs-on: blacksmith-8vcpu-ubuntu-2404
-3
View File
@@ -124,9 +124,6 @@ jobs:
group: pr-size-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
# This pull_request_target job may fetch untrusted PR commits only as passive
# git data. Do not add dependency installs, build/test scripts, or cache
# actions here; use pull_request plus workflow_run for that pattern instead.
- name: Checkout base repository
uses: actions/checkout@v4
with:
+3 -169
View File
@@ -23,8 +23,8 @@ on:
type: string
permissions:
contents: read
id-token: none
contents: write
id-token: write
jobs:
check_changes:
@@ -98,14 +98,6 @@ jobs:
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Ensure Electron runtime is installed
run: |
if ! node -e "require('./apps/desktop/node_modules/electron')" >/dev/null 2>&1; then
rm -rf apps/desktop/node_modules/electron/dist apps/desktop/node_modules/electron/path.txt
bun apps/desktop/node_modules/electron/install.js
fi
node -e "require('./apps/desktop/node_modules/electron')"
- id: release_meta
name: Resolve release version
shell: bash
@@ -252,68 +244,6 @@ jobs:
exit $code
}
- name: Prepare Azure Trusted Signing
if: matrix.platform == 'win'
shell: pwsh
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TRUSTED_SIGNING_ENDPOINT: ${{ secrets.AZURE_TRUSTED_SIGNING_ENDPOINT }}
AZURE_TRUSTED_SIGNING_ACCOUNT_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_ACCOUNT_NAME }}
AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME }}
AZURE_TRUSTED_SIGNING_PUBLISHER_NAME: ${{ secrets.AZURE_TRUSTED_SIGNING_PUBLISHER_NAME }}
run: |
$ErrorActionPreference = "Stop"
$requiredSecrets = @(
$env:AZURE_TENANT_ID,
$env:AZURE_CLIENT_ID,
$env:AZURE_CLIENT_SECRET,
$env:AZURE_TRUSTED_SIGNING_ENDPOINT,
$env:AZURE_TRUSTED_SIGNING_ACCOUNT_NAME,
$env:AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME,
$env:AZURE_TRUSTED_SIGNING_PUBLISHER_NAME
)
if ($requiredSecrets | Where-Object { [string]::IsNullOrWhiteSpace($_) }) {
Write-Host "Azure Trusted Signing disabled; skipping TrustedSigning module preparation."
exit 0
}
try {
Install-PackageProvider `
-Name NuGet `
-MinimumVersion 2.8.5.201 `
-Force `
-Scope CurrentUser `
-ErrorAction Stop
} catch {
Write-Warning "Could not bootstrap NuGet package provider. Continuing because the runner may already have a usable provider. $($_.Exception.Message)"
}
Install-Module `
-Name TrustedSigning `
-MinimumVersion 0.5.0 `
-Force `
-AllowClobber `
-Repository PSGallery `
-Scope CurrentUser `
-ErrorAction Stop
Import-Module TrustedSigning -MinimumVersion 0.5.0 -Force
Get-Command Invoke-TrustedSigning -ErrorAction Stop
$moduleRoots = @(
[System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "PowerShell", "Modules"),
[System.IO.Path]::Combine([Environment]::GetFolderPath("MyDocuments"), "WindowsPowerShell", "Modules"),
[System.IO.Path]::Combine($env:ProgramFiles, "PowerShell", "Modules"),
[System.IO.Path]::Combine($env:ProgramFiles, "WindowsPowerShell", "Modules")
)
$modulePathEntries = @($moduleRoots + ($env:PSModulePath -split ";")) |
Where-Object { $_ -and (Test-Path $_) } |
Select-Object -Unique
"PSModulePath=$($modulePathEntries -join ';')" >> $env:GITHUB_ENV
- name: Build desktop artifact
shell: bash
env:
@@ -428,9 +358,6 @@ jobs:
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.build.result == 'success' }}
runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -584,98 +511,6 @@ jobs:
fail_on_unmatched_files: true
token: ${{ steps.app_token.outputs.token }}
deploy_web:
name: Deploy hosted web app
needs: [preflight, release]
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' }}
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
T3CODE_WEB_ROUTER_URL: ${{ vars.T3CODE_WEB_ROUTER_URL }}
T3CODE_WEB_LATEST_DOMAIN: ${{ vars.T3CODE_WEB_LATEST_DOMAIN }}
T3CODE_WEB_NIGHTLY_DOMAIN: ${{ vars.T3CODE_WEB_NIGHTLY_DOMAIN }}
VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ needs.preflight.outputs.ref }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: package.json
- name: Install release tooling dependencies
run: bun install --frozen-lockfile --filter=@t3tools/scripts --filter=@t3tools/web
- name: Align package versions to release version
run: node scripts/update-release-package-versions.ts "${{ needs.preflight.outputs.version }}"
- name: Refresh release lockfile
run: bun install --lockfile-only --ignore-scripts
- name: Deploy and alias channel
shell: bash
run: |
set -euo pipefail
if [[ -z "${VERCEL_TOKEN:-}" || -z "${VERCEL_ORG_ID:-}" || -z "${VERCEL_PROJECT_ID:-}" ]]; then
echo "Missing one or more required Vercel secrets: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID." >&2
exit 1
fi
router_url="${T3CODE_WEB_ROUTER_URL:-https://app.t3.codes}"
latest_domain="${T3CODE_WEB_LATEST_DOMAIN:-latest.app.t3.codes}"
nightly_domain="${T3CODE_WEB_NIGHTLY_DOMAIN:-nightly.app.t3.codes}"
router_domain="${router_url#http://}"
router_domain="${router_domain#https://}"
router_domain="${router_domain%%/*}"
if [[ "${{ needs.preflight.outputs.release_channel }}" == "stable" ]]; then
channel_domain="$latest_domain"
channel_name="latest"
else
channel_domain="$nightly_domain"
channel_name="nightly"
fi
vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
vercel_scope_args=(--scope "$vercel_scope")
echo "Deploying hosted web app for $channel_name channel."
deployment_url="$(
bunx [email protected] deploy \
--prod \
--skip-domain \
--yes \
--token "$VERCEL_TOKEN" \
"${vercel_scope_args[@]}" \
--build-env "APP_VERSION=${{ needs.preflight.outputs.version }}" \
--build-env "VITE_HOSTED_APP_URL=$router_url" \
--build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
)"
echo "Aliasing $deployment_url to $channel_domain."
bunx [email protected] alias set "$deployment_url" "$channel_domain" \
--token "$VERCEL_TOKEN" \
"${vercel_scope_args[@]}"
if [[ "$channel_name" == "latest" && -n "$router_domain" && "$router_domain" != "$channel_domain" ]]; then
echo "Aliasing $deployment_url to router domain $router_domain."
bunx [email protected] alias set "$deployment_url" "$router_domain" \
--token "$VERCEL_TOKEN" \
"${vercel_scope_args[@]}"
fi
finalize:
name: Finalize release
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.release.result == 'success' && needs.preflight.outputs.release_channel == 'stable' }}
@@ -760,9 +595,8 @@ jobs:
always() && !cancelled() &&
needs.preflight.result == 'success' &&
needs.release.result == 'success' &&
needs.deploy_web.result == 'success' &&
(needs.finalize.result == 'success' || needs.finalize.result == 'skipped')
needs: [preflight, release, deploy_web, finalize]
needs: [preflight, release, finalize]
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
-4
View File
@@ -22,7 +22,3 @@ apps/web/src/components/__screenshots__
__screenshots__/
.tanstack
squashfs-root/
.vercel
.gstack/
dist-electron/
.electron-runtime/
-4
View File
@@ -2,7 +2,6 @@
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [
".reference",
".repos/**",
".plans",
"dist",
"dist-electron",
@@ -10,11 +9,8 @@
"bun.lock",
"*.tsbuildinfo",
"**/routeTree.gen.ts",
"apps/mobile/android/**",
"apps/mobile/ios/**",
"apps/web/public/mockServiceWorker.js",
"apps/web/src/lib/vendor/qrcodegen.ts",
"apps/mobile/uniwind-types.d.ts",
"*.icon/**"
],
"sortPackageJson": {},
+2 -10
View File
@@ -3,28 +3,20 @@
"ignorePatterns": [
"dist",
"dist-electron",
".repos/**",
"node_modules",
"bun.lock",
"*.tsbuildinfo",
"**/routeTree.gen.ts",
"apps/mobile/android/**",
"apps/mobile/ios/**",
"apps/mobile/uniwind-types.d.ts"
"**/routeTree.gen.ts"
],
"plugins": ["eslint", "oxc", "react", "unicorn", "typescript"],
"jsPlugins": ["./oxlint-plugin-t3code/index.ts"],
"categories": {
"correctness": "warn",
"suspicious": "warn",
"perf": "warn"
},
"rules": {
"unicorn/no-array-sort": "off",
"react-in-jsx-scope": "off",
"eslint/no-shadow": "off",
"eslint/no-await-in-loop": "off",
"eslint/no-underscore-dangle": "off",
"t3code/no-inline-schema-compile": "warn"
"eslint/no-await-in-loop": "off"
}
}
-349
View File
@@ -1,349 +0,0 @@
# Remote Endpoints and Hosted Static App Plan
## Purpose
Make remote access feel first-class while keeping the free DIY path open.
The immediate product goal is:
- users can expose a backend through LAN, their own Tailscale, MagicDNS, a manual HTTPS endpoint, or later T3 Tunnel
- users can generate a hosted pairing link for `app.t3.codes`
- the hosted app can pair, persist, reconnect, and operate against saved environments without requiring a backend at the hosted app origin
- all transports reuse the same backend auth, WebSocket runtime, saved environment registry, and pairing UX
This plan intentionally leaves the paid T3 cloud tunnel fabric out of scope. It defines the OSS foundation that T3 Tunnel should later plug into.
## Current State
Already present or in progress:
- Server auth distinguishes bootstrap credentials from session credentials.
- One-time pairing credentials can be exchanged for browser sessions or bearer sessions.
- Saved remote environments store `httpBaseUrl`, `wsBaseUrl`, and a bearer token.
- Remote environment WebSocket connections use a short-lived WebSocket token.
- Pairing URLs can carry tokens in the URL fragment.
- Hosted `/pair?host=...#token=...` can add a saved environment.
- Hosted static startup can avoid assuming the page origin is the backend.
Main gaps:
- Reachability is represented ad hoc as `endpointUrl`, manual host input, or saved environment URLs.
- Desktop exposure, hosted pairing, manual remote environments, and future tunnels do not share one endpoint model.
- Tailscale/MagicDNS endpoints are not detected or surfaced.
- Hosted-static empty/offline states are still thin.
- Browser compatibility is not explicitly modeled, especially HTTPS hosted app to HTTP backend mixed-content failure.
## Core Decision: Add `AdvertisedEndpoint`
Add a new first-class contract instead of extending the environment descriptor.
### Why not extend `ExecutionEnvironmentDescriptor`
`ExecutionEnvironmentDescriptor` answers: "What environment is this?"
Examples:
- environment id
- label
- platform
- server version
- capabilities
`AdvertisedEndpoint` answers: "How can a client reach this environment right now?"
Examples:
- loopback URL
- LAN URL
- Tailscale IP URL
- MagicDNS/Serve URL
- manual URL
- future T3 Tunnel URL
- browser compatibility and exposure level
Those are different lifecycles. One environment can have many endpoints, endpoints can appear/disappear as network interfaces change, and the same descriptor is returned regardless of which endpoint the client used. Extending the descriptor would blur environment identity with transport reachability and make saved environments harder to reason about.
### Target Contract
Add a schema in `packages/contracts`, likely `remoteAccess.ts`:
```ts
type AdvertisedEndpointProvider =
| "loopback"
| "lan"
| "tailscale-ip"
| "tailscale-magicdns"
| "manual"
| "t3-tunnel";
type AdvertisedEndpointVisibility = "local" | "private-network" | "tailnet" | "public";
type AdvertisedEndpointCompatibility = {
hostedHttpsApp: "compatible" | "mixed-content-blocked" | "untrusted-certificate" | "unknown";
desktopApp: "compatible" | "unknown";
};
type AdvertisedEndpoint = {
id: string;
provider: AdvertisedEndpointProvider;
label: string;
httpBaseUrl: string;
wsBaseUrl: string;
visibility: AdvertisedEndpointVisibility;
compatibility: AdvertisedEndpointCompatibility;
source: "server" | "desktop" | "user";
status: "available" | "unavailable" | "unknown";
isDefault?: boolean;
};
```
Keep the contract schema-only. All classification logic belongs in `packages/shared`, `apps/server`, `apps/desktop`, or `apps/web`.
## HTTP/WS and HTTPS/WSS Readiness
The codebase is partially ready, but the UX and compatibility model are not explicit enough.
What is ready:
- Remote target parsing already derives `ws://` from `http://` and `wss://` from `https://`.
- Saved environments store both HTTP and WebSocket base URLs.
- Remote auth uses bearer tokens instead of cookies, so cross-origin hosted clients are viable.
- WebSocket connections can use a dynamically issued `wsToken`.
- Server CORS support exists for browser remote auth endpoints.
What is not solved by code alone:
- `https://app.t3.codes` cannot reliably call `http://...` or `ws://...` endpoints because browsers block mixed content.
- `wss://100.x.y.z:3773` needs a certificate the browser trusts. A raw Tailscale IP does not solve certificate trust.
- LAN `http://192.168.x.y:3773` is usable from another desktop/native context but not from the hosted HTTPS app.
- The UI needs to explain why an endpoint is copyable for desktop pairing but not hosted-app compatible.
Policy:
- Support both HTTP/WS and HTTPS/WSS at the runtime layer.
- Mark endpoint compatibility at the product layer.
- Generate `app.t3.codes` links only from endpoints that are likely hosted-browser compatible, or show a warning with an explicit fallback.
## Architecture
### Endpoint Sources
Endpoint records can come from several providers:
1. **Server runtime**
- headless bind host and port
- server-known explicit advertised host config
2. **Desktop shell**
- loopback backend URL
- LAN exposure state
- network interface discovery
- Tailscale CLI/status discovery
3. **User configuration**
- manually added hostnames
- preferred endpoint labels
- hidden/disabled endpoints
4. **Future cloud provider**
- T3 Tunnel endpoint
- billing/account status
- tunnel lifecycle state
### Endpoint Registry
Create a central runtime registry:
- `packages/contracts/src/remoteAccess.ts`
- `packages/shared/src/remoteAccess.ts` for URL normalization and compatibility classification
- `apps/server/src/remoteAccess/*` for server/headless endpoints
- `apps/desktop/src/remoteAccess/*` for desktop-discovered endpoints
- `apps/web/src/environments/endpoints/*` for client-side display and pairing selection
The web app should consume endpoint records and not care whether they came from LAN, Tailscale, or a future tunnel.
### Pairing Link Generation
Move hosted pairing link generation to endpoint-driven input:
```ts
buildHostedPairingUrl({
endpoint: AdvertisedEndpoint,
token,
});
```
Generated URL:
```text
https://app.t3.codes/pair?host=<encoded endpoint httpBaseUrl>#token=<one-time token>
```
Use fragment tokens by default. Continue accepting `?token=` for compatibility.
## Phase 1: Endpoint Abstraction
### Goals
- Centralize URL normalization, protocol derivation, and compatibility checks.
- Replace ad hoc desktop `endpointUrl` pairing logic with endpoint selection.
- Preserve all current remote behavior.
### Tasks
1. Add `AdvertisedEndpoint` schemas to `packages/contracts`.
2. Add shared helpers:
- normalize HTTP base URL
- derive WebSocket base URL
- classify loopback/private/LAN/Tailscale/public host
- classify hosted HTTPS compatibility
3. Add server endpoint discovery:
- loopback endpoint
- configured non-loopback endpoint
- explicit advertised host override
4. Add desktop endpoint discovery:
- local loopback
- LAN exposure endpoint
- endpoint status labels
5. Add WebSocket/API method or existing config field for endpoint snapshots.
6. Refactor settings connections UI:
- render endpoint rows
- endpoint picker for pairing link copy
- show compatibility warnings
7. Refactor hosted link builder to accept endpoint records.
8. Add tests for URL normalization and compatibility classification.
### Acceptance Criteria
- Existing LAN/network access UI still works.
- Pairing links are generated from endpoint records.
- Loopback endpoints never produce hosted pairing links silently.
- HTTP private-network endpoints are marked incompatible with `app.t3.codes`.
- No remote environment runtime changes are required for existing saved environments.
## Phase 2: BYO Tailscale/MagicDNS
### Goals
- Detect free DIY Tailscale reachability.
- Surface Tailscale endpoints as normal advertised endpoints.
- Keep users in control of their own tailnet.
### Tasks
1. Detect Tailscale IPs from network interfaces:
- IPv4 `100.64.0.0/10`
- mark as `provider: "tailscale-ip"`
2. Add optional desktop-side `tailscale status --json` discovery:
- MagicDNS hostname
- Tailscale Serve/Funnel HTTPS endpoint if discoverable
- graceful failure if CLI is missing
3. Add manual Tailscale endpoint override:
- hostname
- label
- preferred/default flag
4. Show Tailscale endpoint rows in settings:
- raw IP HTTP endpoint: desktop-compatible, hosted-app likely blocked
- HTTPS MagicDNS/Serve endpoint: hosted-compatible if URL is HTTPS
5. Generate pairing links using selected Tailscale endpoint.
6. Document DIY setup:
- local desktop-to-desktop over Tailscale
- hosted app requirements
- why HTTPS matters
### Acceptance Criteria
- A machine on Tailscale shows a Tailscale endpoint without paid features.
- Users can copy a Tailscale-hosted pairing link when the endpoint is HTTPS-compatible.
- Users can still copy token-only/manual values when endpoint compatibility is unknown.
- Tailscale is optional and never required for regular LAN/loopback use.
## Phase 3: Hosted Static App Completion
### Goals
- `app.t3.codes` works as a real client shell.
- It can pair, persist, reconnect, and clearly explain offline/incompatible states.
### Tasks
1. Finish hosted-static root behavior:
- no primary backend required
- saved environment hydration before initial routing decisions
- first saved environment selected as active
2. Add hosted empty state:
- no saved environments
- paste pairing URL
- add host + token
3. Add offline saved environment UI:
- last connected
- reconnect
- remove
- copy/add alternate endpoint
4. Audit primary-backend assumptions:
- command palette
- settings pages
- server config atom defaults
- keybindings
- provider/model lists
- update/desktop-only affordances
5. Add route tests for:
- hosted `/pair?host=...#token=...`
- hosted root with no saved environments
- hosted root with saved environment
- primary backend unavailable but saved environment present
6. Add deployment hardening:
- SPA fallback
- strict CSP
- no third-party scripts
- no query token logging
- disable or hide source maps in production if needed
7. Add browser error messages:
- mixed content
- unreachable backend
- CORS failure
- certificate failure
### Acceptance Criteria
- `app.t3.codes` can pair a reachable HTTPS backend and reconnect after reload.
- A saved environment can be used without any backend at `app.t3.codes`.
- Offline machines show a useful state instead of a generic boot error.
- HTTP endpoints are still supported in desktop/native/local contexts.
- Hosted HTTPS app only promises compatibility for HTTPS/WSS endpoints.
## Phase 4: Future T3 Tunnel Provider
Not part of the current implementation, but the endpoint abstraction should make it straightforward.
Future tunnel provider responsibilities:
- create endpoint with `provider: "t3-tunnel"`
- surface tunnel status
- provide stable HTTPS URL
- use existing backend pairing/session auth
- never bypass server auth
The tunnel fabric can later be Pipenet-derived, Tailscale-derived, or another reverse tunnel implementation. The rest of T3 Code should only see an `AdvertisedEndpoint`.
## Security Checklist
- Pairing tokens are short-lived and one-time.
- Generated hosted pairing links put tokens in the fragment.
- The backend remains the authorization boundary.
- Endpoint discovery never disables backend auth.
- Hosted app does not silently downgrade to HTTP.
- Tunnel/public endpoints require explicit user action.
- Client sessions remain revocable.
- Endpoint URLs and request logs must avoid recording pairing tokens.
- Future cloud tunnel must authenticate tunnel creation and tunnel data connections separately from backend pairing.
## Verification
Each implementation PR should run:
- `bun fmt`
- `bun lint`
- `bun typecheck`
- focused tests for changed backend/web behavior
- backend tests for any server-side endpoint discovery or auth changes using `bun run test`, never `bun test`
@@ -1,43 +0,0 @@
---
name: grill-me
description: Interview the user about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
---
Interview me about every aspect of this plan until we reach a shared understanding and a defensible design.
Ask exactly one question at a time, then wait for my answer before asking the next question.
Use each answer to choose the next highest-leverage unresolved question. Maintain an implicit decision tree of resolved decisions, open questions, assumptions, dependencies, risks, and rejected alternatives.
For each question, include:
- clear answer options when appropriate
- your recommended answer, marked as recommended
- a brief reason for the recommendation
Use open-ended questions when fixed options would prematurely constrain the design space.
Challenge vague, inconsistent, risky, or unsupported assumptions. If an answer creates a contradiction or unresolved dependency, ask a follow-up before moving on.
Cover, as relevant:
- goals and non-goals
- users and stakeholders
- constraints
- alternatives
- APIs and interfaces
- data model
- error handling
- security
- observability
- testing
- migration and rollout
- failure modes
- operational ownership
- success criteria
If repository facts are needed, inspect the codebase instead of asking the user. Do not ask me to provide information that can be determined locally.
When an available user-input tool such as `request_user_input` fits the question, use it to ask one short question with a small set of mutually exclusive options. Otherwise, ask in plain text and present clear possible answers as a numbered list when that helps me answer quickly. Include your recommended option and mark it as recommended.
Stop when the major branches of the design tree have been resolved. Then summarize the agreed design, remaining risks, assumptions, rejected alternatives, and next steps.
@@ -1,188 +0,0 @@
---
name: jsdocs
description: Write, insert, or update Effect public API JSDoc so it satisfies the jsdocs oxlint rule. Use when adding or fixing JSDoc comments, resolving jsdocs diagnostics, preparing docs for JSON extraction, or reviewing public API documentation.
---
Use this skill to write well-formed JSDoc for Effect public APIs.
## Workflow
When updating public API JSDoc:
1. Inspect the declaration, implementation, nearby tests, and nearby JSDoc before editing.
2. Decide whether the task is a single API fix or a module refinement pass.
3. Rewrite comments into the required documentation shape while preserving correct facts and examples.
4. For module refinements, complex APIs, or APIs with related alternatives, run the `@see` and `**Gotchas**` audits.
5. Run the narrowest relevant validation.
## Required documentation shape
Use a normal multiline JSDoc comment in TypeScript source:
```ts
/**
* Short description as one paragraph.
*
* **When to use**
*
* Optional practical usage guidance.
*
* **Details**
*
* Optional details for complex APIs, options, overloads, or behavior.
*
* **Gotchas**
*
* Optional edge cases, footguns, or surprising behavior.
*
* **Example** (Short title)
*
* Optional prose explaining the example.
*
* ```ts
* const result = example()
* ```
*
* @category constructors
* @since 1.0.0
*/
```
## Prose Rules
- Use sober, practical prose.
- Write all public JSDoc prose in English.
- Do not use jargon when a plain word works.
- Do not be clever.
- Do not add filler sections.
- The short description is required and must be exactly one paragraph.
- Make the short description stand on its own. Do not rely on `**When to use**`
to make the API understandable.
- For functions and methods, prefer present-tense, action-first prose such as
`Creates`, `Returns`, `Checks`, `Provides`, `Represents`, `Converts`,
`Decodes`, or `Formats`.
- For technical value exports, use consistent noun forms such as `Schema for`,
`Layer that`, `Service that`, `Context reference that`, or
`Constructors and matchers for`.
- Avoid leading `A` or `An` for canonical technical nouns when the surrounding
module uses a standard noun family, for example prefer `Schema for ...` over
`A schema for ...`.
- Do not describe implementation mechanics when a public concept is clearer.
For example, prefer `Constructors and matchers for ...` over wording that
only says an API uses `Data.taggedEnum`.
- Avoid generic purity or non-mutation remarks unless they document a real
surprise, caveat, or meaningful contrast with a mutating-looking API.
- Optional sections must appear in this order:
1. `**When to use**`
2. `**Details**`
3. `**Gotchas**`
- Include an optional section only when it has useful, non-empty content.
- Prefer prose over bullet lists for single-item `**Details**`, `**When to use**`, or `**Gotchas**` sections. Use bullets only when there are two or more parallel facts, options, cases, or caveats.
- `**When to use**` describes the positive use case for the documented API. Do not use it as a routing section for sibling APIs. If neighboring APIs need to be mentioned, put that boundary in `@see` tag text instead.
- `**When to use**` is important when the API has close alternatives, trade-offs, or `@see` tags. If `@see` tags are present, inspect the referenced APIs and add `**When to use**` when it clarifies the documented API's own use case.
- `**When to use**` must start with one of these practical guidance forms: `Use to`, `Use when`, `Use as`, or `Use with`. Avoid bullet lists and vague openers such as `Use this...` or `Useful for...`.
- Keep `short` and `**When to use**` distinct: the short description says what
the API is or does; `**When to use**` says when to choose it.
- Add internal `@see` tags only for semantically useful related public APIs.
- Write `@see` tag text as normal prose after the link; no special separator is required. Prefer forms like `@see {@link otherApi} for ...` when a short explanation helps.
- Use exactly one blank line between the short description, sections, examples, and tags.
- Do not use Markdown headings such as `# Heading` or ad hoc bold headings such as `**Notes**`; only the standard headings are allowed.
- Examples must use `**Example** (Title)`, optional prose, and exactly one non-empty `ts` code fence.
- Example titles must be unique after trimming and lowercasing.
- Prefer examples with stable, deterministic output. Avoid assertions or
`console.log` comments that depend on stack traces, object inspection,
`Error` formatting, concurrency order, timing, randomness, or
environment-specific formatting. Examples may assume Node.js console
formatting. Direct `Set` / `Map` output is acceptable when insertion order is
deterministic and the expected output uses Node's format; otherwise
demonstrate a stable property instead.
- Do not use `@example`.
- Do not put TypeScript code fences outside `**Example** (Title)` sections.
- Inline `{@link Symbol}` targets must resolve to TypeScript symbols; do not link to URLs with `{@link}`.
- Avoid overlinking in prose. Use `{@link Symbol}` only when navigation to
that symbol helps the reader choose or understand the API. For the API being
documented, the module's central type, nearby obvious names, or repeated
mentions, prefer plain code formatting such as `Cause`, `Effect`, or
`Context`.
- Do not document module-level comments; module JSDoc is ignored by this rule.
- `@internal` means the item is ignored; do not rewrite it as public docs.
- Default exports are ignored by this rule and do not need JSDoc.
- Do not add unsupported constructs such as enums or empty exports in checked files.
- For low-level public values, prefer accurate categories such as `symbols`,
`type IDs`, or `prototypes` over compensating with verbose descriptions.
## Tag rules
When multiple tags are present, keep them in this order:
1. `@deprecated`
2. `@default`
3. `@see`
4. `@category`
5. `@since`
Tag requirements by declaration kind:
- Root declarations require `@category` and stable-semver `@since`, and must
not use `@default`.
- Namespaces and declarations inside namespaces require stable-semver `@since`,
may use `@category`, and must not use `@default`.
- Member JSDoc is optional. When present, it follows the same prose and layout
rules, may use optional stable-semver `@since`, may use non-empty `@default`,
and must not use `@category`.
- Any declaration may use `@deprecated` with a non-empty message and repeated
non-empty `@see` tags for semantically useful related public APIs.
## Updating existing JSDoc
When fixing or updating existing docs:
1. Preserve correct facts and examples.
2. Rewrite the layout into the standard template.
3. Move usage guidance into `**When to use**`, behavior details into `**Details**`, and real caveats into `**Gotchas**`.
4. Convert `@example` tags and loose `ts` fences into `**Example** (Title)` sections.
5. Preserve valid `@see`, `@deprecated`, `@default`, `@category`, and `@since` tags.
6. Remove `@see` tags that do not point to semantically useful related public APIs.
7. Replace redundant inline `{@link ...}` tags with plain code formatting when
the link target is already obvious from the current declaration or module.
8. Remove sections that would be empty.
## Module refinement
When asked to refine an existing module:
1. First scan the module for local documentation patterns, repeated API families, and category conventions.
2. Keep the change focused on documentation quality unless the user also asked for rule or source changes.
3. Prefer improving existing comments over rewriting every comment into a new voice.
4. Preserve examples unless they are wrong, stale, nondeterministic, or fail
the required documentation shape.
5. Apply the `@see` and `**Gotchas**` audits across the module before finishing.
## See audit
When refining an existing public API module, always do a dedicated `@see` pass:
1. Inspect existing `@see` tags and referenced APIs before keeping, changing, or removing them.
2. Look for close alternatives in the same module or API family when the documented API is one of several ways to do similar work.
3. Keep or add `@see` only when the linked API is semantically useful to understand the documented API.
4. Good `@see` targets include sibling APIs, alternatives, inverse operations, lower-level or higher-level variants, complementary operations, and closely returned, consumed, or configured types/values.
5. Do not use `@see` for implementation dependencies, broad concepts, external background links, APIs that merely share a word or name, helper APIs used only inside examples, undocumented/private members, or APIs that are only generally compatible.
6. When `@see` tags are kept or added, include `**When to use**` guidance if the documented API's own use case is not obvious from the short description. Keep comparisons with sibling APIs in the `@see` tag text.
## Gotchas audit
When refining an existing public API module, always do a dedicated `**Gotchas**` pass:
1. Scan existing prose for caveat language: warnings, exceptions, limitations, preconditions, special cases, or behavior that is easy to misuse.
2. Inspect the implementation and nearby tests for behavior that is not obvious from the type signature or short description.
3. Move real caveats from `**Details**` into `**Gotchas**` when they describe edge cases, footguns, preconditions, surprising behavior, or important failure modes.
4. Add `**Gotchas**` only when the caveat is concrete and useful to a reader choosing or using the API.
5. If no gotchas are added during a refinement pass, state that a gotchas audit was performed and why no caveats were worth documenting.
## Validation
Run the narrowest validation that matches the change:
- For JSDoc or example changes in a package with generated docs, run `pnpm docgen` from that package directory.
- Run `pnpm lint` because the linter includes the custom rule that checks public API JSDoc.
- Do not run broad validation for prose-only skill edits.
@@ -1,44 +0,0 @@
---
name: scratchpad
description: Extract the JSDoc example nearest the active source selection or cursor into ./scratchpad as a TypeScript file. Use when the user asks to dump, copy, open, or try a source example in scratchpad.
---
Use this skill to create a scratchpad TypeScript file from the JSDoc `**Example**`
nearest the user's active source cursor or selection.
## Workflow
1. Determine the source path and line:
- Use the IDE active file and selection/cursor line when present.
- Use an explicit file and line when the user provides them.
- If no line or selection is available, ask for it.
2. Run:
```sh
node .agents/skills/scratchpad/scripts/extract-example.mjs <source-path> <line>
```
3. If the script exits with code 2 because there is no obvious runner, ask the
user whether to preserve the example exactly, name an Effect value to run, or
cancel.
- To preserve exactly, rerun with `--mode preserve`.
- To run a specific Effect value, rerun with `--runner <identifier>`.
4. Report the created path as a clickable file link. This is the deterministic
way to open it in the code pane.
5. Do not run the scratchpad file unless the user explicitly asks.
## Behavior
- The script chooses the example whose `**Example**` section contains the line;
otherwise it chooses the first following example; otherwise the nearest
previous example.
- Filenames are derived from the source file and example title, for example
`scratchpad/Schedule-retrying-and-repeating-effects.ts`.
- Existing files are not overwritten. The script appends a numeric suffix.
- In auto mode, if a top-level `program` binding exists, the script appends:
```ts
Effect.runPromise(program).then(console.log, console.error)
```
- If the example already contains an Effect runner, the script preserves it.
@@ -1,7 +0,0 @@
interface:
display_name: "Scratchpad"
short_description: "Extract examples into scratchpad"
default_prompt: "Use $scratchpad to extract the active JSDoc example into scratchpad."
policy:
allow_implicit_invocation: true
@@ -1,260 +0,0 @@
#!/usr/bin/env node
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"
import { basename, extname, isAbsolute, join, relative, resolve } from "node:path"
const usage = `Usage:
node .agents/skills/scratchpad/scripts/extract-example.mjs <source-path> <line> [--mode auto|preserve] [--runner <identifier>] [--out-dir <dir>]
Examples:
node .agents/skills/scratchpad/scripts/extract-example.mjs packages/effect/src/Schedule.ts 9
node .agents/skills/scratchpad/scripts/extract-example.mjs packages/effect/src/Schedule.ts 9 --mode preserve
node .agents/skills/scratchpad/scripts/extract-example.mjs packages/effect/src/Schedule.ts 9 --runner myProgram
`
const args = process.argv.slice(2)
const sourcePath = args[0]
const lineInput = args[1]
let mode = "auto"
let runner = undefined
let outDir = "scratchpad"
for (let index = 2; index < args.length; index++) {
const arg = args[index]
if (arg === "--mode") {
mode = args[++index]
} else if (arg === "--runner") {
runner = args[++index]
} else if (arg === "--out-dir") {
outDir = args[++index]
} else {
fail(`Unknown option: ${arg}`)
}
}
if (!sourcePath || !lineInput) {
fail(usage)
}
if (mode !== "auto" && mode !== "preserve") {
fail(`Invalid --mode: ${mode}`)
}
if (runner !== undefined && !/^[A-Za-z_$][\w$]*$/.test(runner)) {
fail(`Invalid --runner identifier: ${runner}`)
}
const line = Number.parseInt(lineInput, 10)
if (!Number.isSafeInteger(line) || line < 1) {
fail(`Invalid line number: ${lineInput}`)
}
const resolvedSourcePath = resolve(sourcePath)
const source = readFileSync(resolvedSourcePath, "utf8")
const sourceLines = source.split(/\r?\n/)
const examples = findExamples(sourceLines)
if (examples.length === 0) {
fail(`No JSDoc examples found in ${sourcePath}`)
}
const example = chooseExample(examples, line)
const hasRunner = /\bEffect\.run[A-Za-z]*\s*\(/.test(example.code)
const programRunner = /^\s*(?:export\s+)?(?:const|let|var)\s+program\s*=/m.test(example.code)
let code = example.code.trimEnd()
let runnerStatus = "none"
if (runner !== undefined) {
code = appendRunner(code, runner)
runnerStatus = `appended:${runner}`
} else if (mode === "auto") {
if (hasRunner) {
runnerStatus = "already-present"
} else if (programRunner) {
code = appendRunner(code, "program")
runnerStatus = "appended:program"
} else {
const payload = {
status: "needs-runner",
title: example.title,
sourcePath: displayPath(resolvedSourcePath),
titleLine: example.titleLine,
codeStartLine: example.codeStartLine,
codeEndLine: example.codeEndLine
}
process.stderr.write(`${JSON.stringify(payload, null, 2)}\n`)
process.exit(2)
}
}
mkdirSync(outDir, { recursive: true })
const outputPath = uniqueOutputPath(outDir, resolvedSourcePath, example.title)
writeFileSync(outputPath, `${code}\n`, "utf8")
process.stdout.write(
`${JSON.stringify(
{
outputPath: displayPath(resolve(outputPath)),
title: example.title,
sourcePath: displayPath(resolvedSourcePath),
titleLine: example.titleLine,
codeStartLine: example.codeStartLine,
codeEndLine: example.codeEndLine,
runner: runnerStatus
},
null,
2
)}\n`
)
function findExamples(lines) {
const examples = []
let blockStart = -1
let block = []
for (let index = 0; index < lines.length; index++) {
const line = lines[index]
if (blockStart === -1 && line.includes("/**")) {
blockStart = index
block = [line]
if (line.includes("*/")) {
collectExamples(examples, block, blockStart)
blockStart = -1
}
continue
}
if (blockStart !== -1) {
block.push(line)
if (line.includes("*/")) {
collectExamples(examples, block, blockStart)
blockStart = -1
}
}
}
return examples
}
function collectExamples(examples, block, blockStart) {
const cleaned = block.map(cleanJSDocLine)
for (let index = 0; index < cleaned.length; index++) {
const line = cleaned[index]
const titleMatch = line.match(/\*\*Example\*\*(?:\s*\(([^)]+)\))?/)
if (titleMatch === null) {
continue
}
const title = titleMatch[1]?.trim() || `example-${blockStart + index + 1}`
const fenceStart = findFenceStart(cleaned, index + 1)
if (fenceStart === -1) {
continue
}
const fenceEnd = findFenceEnd(cleaned, fenceStart + 1)
if (fenceEnd === -1) {
continue
}
examples.push({
title,
titleLine: blockStart + index + 1,
codeStartLine: blockStart + fenceStart + 2,
codeEndLine: blockStart + fenceEnd,
code: cleaned.slice(fenceStart + 1, fenceEnd).join("\n")
})
index = fenceEnd
}
}
function findFenceStart(lines, startIndex) {
for (let index = startIndex; index < lines.length; index++) {
const trimmed = lines[index].trim()
if (trimmed.startsWith("**Example**")) {
return -1
}
if (/^```(?:ts|typescript)?\s*$/.test(trimmed)) {
return index
}
}
return -1
}
function findFenceEnd(lines, startIndex) {
for (let index = startIndex; index < lines.length; index++) {
if (lines[index].trim() === "```") {
return index
}
}
return -1
}
function cleanJSDocLine(line) {
return line.replace(/^\s*\/\*\*\s?/, "").replace(/^\s*\*\/\s?$/, "").replace(/^\s*\* ?/, "")
}
function chooseExample(examples, line) {
const containing = examples.find((example) => example.titleLine <= line && line <= example.codeEndLine)
if (containing !== undefined) {
return containing
}
const following = examples.find((example) => line < example.titleLine)
if (following !== undefined) {
return following
}
return examples[examples.length - 1]
}
function appendRunner(code, identifier) {
return `${code.trimEnd()}\n\nEffect.runPromise(${identifier}).then(console.log, console.error)`
}
function uniqueOutputPath(directory, source, title) {
const sourceName = basename(source, extname(source))
const titleSlug = slug(title) || "example"
const base = `${sourceName}-${titleSlug}`
let candidate = join(directory, `${base}.ts`)
let suffix = 2
while (existsSync(candidate)) {
candidate = join(directory, `${base}-${suffix}.ts`)
suffix++
}
return candidate
}
function slug(value) {
return value
.normalize("NFKD")
.replace(/[\u0300-\u036f]/g, "")
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "")
}
function displayPath(path) {
return isAbsolute(path) ? relative(process.cwd(), path) || "." : path
}
function fail(message) {
process.stderr.write(`${message}\n`)
process.exit(1)
}
@@ -1,5 +0,0 @@
---
"effect": patch
---
Added `BigDecimal.sumAll` and `BigDecimal.multiplyAll` for feature parity with `Number` and `BigInt`, closes #1880.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `Chunk` schema, closes #1585.
@@ -1,19 +0,0 @@
---
"effect": patch
---
Add `Command.withHidden` to hide subcommands from `--help` output, shell completions, and "did you mean?" suggestions, while keeping them fully invocable by exact name.
Useful for experimental or internal subcommands that should be accepted but not advertised on the public CLI surface.
```ts
import { Command } from "effect/unstable/cli"
const experimental = Command.make("experimental").pipe(
Command.withHidden
)
const root = Command.make("mycli").pipe(
Command.withSubcommands([experimental])
)
```
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Config.nested` combinator to scope a config under a named prefix, closes #1437.
@@ -1,15 +0,0 @@
---
"effect": patch
---
Add `Flag.withHidden` (and `Param.withHidden`) to hide flags from `--help` output and shell completions while keeping them fully parseable on the command line.
Useful for experimental, internal, or deprecated flags that should be accepted but not advertised, e.g. `--experimental-foo`, debug toggles, or escape hatches that are not yet committed to the public CLI surface.
```ts
import { Flag } from "effect/unstable/cli"
const experimental = Flag.boolean("experimental-foo").pipe(
Flag.withHidden
)
```
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `DateFromString`, `BigIntFromString`, `BigDecimalFromString`, `TimeZoneNamedFromString`, `TimeZoneFromString`, and `DateTimeZonedFromString` schemas, closes #1941.
@@ -1,5 +0,0 @@
---
"effect": patch
---
unstable/http Headers: add `removeMany` combinator for removing multiple headers at once
@@ -1,5 +0,0 @@
---
"@effect/platform-browser": patch
---
Adds an IndexedDB backed implementation of `KeyValueStore` as `BrowserKeyValueStore.layerIndexedDb`. This backend allows for non-blocking `KeyValueStore` operations, unlike the existing `Storage` api backed implementations.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `RpcSerialization.makeMsgPack` for creating MessagePack serialization with custom msgpackr options. On Cloudflare Workers with `allow_eval_during_startup` (default for `compatibility_date >= 2025-06-01`), pass `{ useRecords: false }` to prevent msgpackr's JIT code generation via `new Function()`, which is blocked during request handling. Also fixes silent error swallowing in the `msgPack` decode path — non-incomplete errors are now rethrown instead of returning `[]`.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `SchemaParser.makeOption` and `Schema.makeOption` for constructing schema values as `Option`.
@@ -1,11 +0,0 @@
---
"effect": patch
---
Add transactional STM modules: TxDeferred, TxPriorityQueue, TxPubSub, TxReentrantLock, TxSubscriptionRef.
Refactor transaction model: remove `Effect.atomic`/`Effect.atomicWith`. All Tx operations now return `Effect<A, E, Transaction>` requiring explicit `Effect.tx(...)` at boundaries.
Expose `TxPubSub.acquireSubscriber`/`releaseSubscriber` for composable transaction boundaries. Fix `TxSubscriptionRef.changes` race condition ensuring current value is delivered first.
Remove `TxRandom` module.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Newtype` module.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `showOperationId` to `HttpApiScalar.ScalarConfig`.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Added `Schedule.tap`, which allows observing full schedule metadata without altering schedule inputs or outputs.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `annotateEncoded` function for annotating the encoded side of a schema.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Schema.ArrayEnsure`.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `BigDecimal` schema with comparison checks (`isGreaterThanBigDecimal`, `isGreaterThanOrEqualToBigDecimal`, `isLessThanBigDecimal`, `isLessThanOrEqualToBigDecimal`, `isBetweenBigDecimal`).
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `DateTimeZoned`, `TimeZoneOffset`, `TimeZoneNamed`, and `TimeZone` schemas.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `OptionFromOptionalNullOr` schema, closes #1707.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `OptionFromUndefinedOr` and `OptionFromNullishOr` schemas.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Schema: add `StringFromBase64`, `StringFromBase64Url`, `StringFromHex`, and `StringFromUriComponent` schemas for decoding encoded strings into UTF-8 strings, closes #1995.
@@ -1,5 +0,0 @@
---
"@effect/sql-pglite": minor
---
Add `@effect/sql-pglite` package, wrapping `@electric-sql/pglite` with the Effect SQL client (Postgres dialect, Effect-managed transactions via savepoints, listen/notify, dumpDataDir/refreshArrayTypes, and a Migrator).
@@ -1,5 +0,0 @@
---
"@effect/oxc": patch
---
Add an `effect/standard-jsdoc` oxlint rule for staged public API JSDoc standardization.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add Stream.broadcastN for fixed-size stream broadcasts.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `unstable/encoding` subpath export.
@@ -1,5 +0,0 @@
---
"@effect/platform-node-shared": patch
---
default to endOnDone: false in NodeStdio
@@ -1,6 +0,0 @@
---
"@effect/ai-openai": patch
"@effect/ai-openai-compat": patch
---
Fix `OpenAiLanguageModel` leaking library-only config fields (`fileIdPrefixes`, `strictJsonSchema`) into request body, causing OpenAI 400 errors.
@@ -1,5 +0,0 @@
---
"@effect/ai-openai": patch
---
Fix `OpenAIFile` schema decode failure on responses where `expires_at` and `status_details` are returned as literal `null`. The OpenAI files endpoint returns `null` (not omitted) for these fields when no expiration / status detail applies (e.g. uploads with `purpose: "user_data"`), but the upstream OpenAPI spec marks them only as optional. Codegen patches widen both fields to allow `null`, which now decodes cleanly via `OpenAiClient.createFile`, `retrieveFile`, `listFiles`, and any other endpoint returning the `OpenAIFile` shape.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add an exhaustive finalizer to the AsyncResult builder.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Expose `NoSuchElementError` in the error type of stream-based `Atom.make` overloads.
@@ -1,5 +0,0 @@
---
"effect": patch
---
move ChildProcess apis into spawner service
@@ -1,5 +0,0 @@
---
"effect": patch
---
Effect.repeat now uses effect return value when using options
@@ -1,5 +0,0 @@
---
"@effect/ai-openai": patch
---
add back openai reasoning types
@@ -1,5 +0,0 @@
---
"effect": patch
---
add Rpc.custom
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Effect.filter` support for synchronous `Filter.Filter` overloads and correctly handle non-effect `Result` return values at runtime.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Update unstable schema variant helpers to use array-based arguments for `FieldOnly`, `FieldExcept`, and `Union`, aligning `VariantSchema` and `Model` with other v4 API shapes.
@@ -1,5 +0,0 @@
---
"@effect/ai-openai-compat": patch
---
Preserve streamed OpenAI compat tool call ids and names across fragmented chat completion chunks.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Ensure streamed tool results are emitted before the finish part so chat history includes tool outputs before stream termination.
@@ -1,7 +0,0 @@
---
"effect": patch
---
Fix consolePretty ignoring explicit colors option in non-TTY environments.
When colors is explicitly set to true, prettyLoggerTty was still gating it with processStdoutIsTTY check, making it impossible to enable colors in non-TTY environments like Vite dev server.
@@ -1,5 +0,0 @@
---
"effect": patch
---
add HttpApiTest module
@@ -1,5 +0,0 @@
---
"effect": patch
---
support tag unions in Effect.catchTag/Reason
@@ -1,5 +0,0 @@
---
"effect": patch
---
Run request resolver batch fibers with request services by using `Effect.runForkWith`, so resolver delay effects and `runAll` execution see the request service map.
@@ -1,5 +0,0 @@
---
"effect": patch
---
add support for deferred responses in rpc
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Model.BooleanSqlite`, a model field schema that uses `0 | 1` encoding for database variants and plain `boolean` encoding for JSON variants.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Config.Success` type utility, closes #1783.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Allow `Effect.acquireRelease` release finalizers to depend on the surrounding environment.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `responseText` to `AiError.StructuredOutputError` and populate it from `LanguageModel.generateObject` so failed structured output decodes include the full LLM text.
@@ -1,5 +0,0 @@
---
"effect": patch
---
make fiber keepAlive setInterval evaluation lazy
@@ -1,5 +0,0 @@
---
"effect": patch
---
Persist MCP HTTP session and protocol headers after initialize so follow-up JSON-RPC requests include `MCP-Protocol-Version`.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Rename Atom's `Context` type to `AtomContext`
@@ -1,5 +0,0 @@
---
"@effect/ai-openrouter": patch
---
Fix HTTP Referer header name in the `OpenRouterClient`
@@ -1,7 +0,0 @@
---
"effect": patch
"@effect/platform-bun": patch
"@effect/platform-node": patch
---
add rows to Terminal
@@ -1,5 +0,0 @@
---
"@effect/ai-openai": patch
---
improve openai socket errors
@@ -1,7 +0,0 @@
---
"effect": patch
---
Allow unstable HttpApi middleware to declare multiple error schemas with arrays.
Middleware errors now follow endpoint error behavior for response status resolution, client decoding, and generated API schemas.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add grouped subcommand support to `Command.withSubcommands`, including help output sections for named groups while keeping ungrouped commands under `SUBCOMMANDS`.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `disableFatalDefects` to `RpcServer.layerHttp`, `RpcServer.toHttpEffect`, and `RpcServer.toHttpEffectWebsocket` option types to match existing runtime support.
@@ -1,5 +0,0 @@
---
"effect": patch
---
add Context.Key type, used a base for Context.Service and Context.Reference
@@ -1,5 +0,0 @@
---
"effect": patch
---
remove Effect.Yieldable
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `HttpServerResponse.fromClientResponse` for directly converting client responses into server responses.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Make `Data.Class`, `Data.TaggedClass`, and `Cause.YieldableError` pipeable.
@@ -1,5 +0,0 @@
---
"effect": patch
---
fix issues with metro bundler
@@ -1,5 +0,0 @@
---
"effect": patch
---
allow undefined for VariantSchema.Overridable input
@@ -1,5 +0,0 @@
---
"@effect/ai-anthropic": patch
---
Remove duplicate `ToolApprovalResponsePartOptions` from Anthropic package
@@ -1,5 +0,0 @@
---
"effect": patch
---
Proxy function arity from `Effect.fn` APIs so wrapped functions preserve the original `length` value.
@@ -1,5 +0,0 @@
---
"@effect/sql-pg": patch
---
Use `pg_notify` in `PgClient.notify` so channel and payload are sent through parameters instead of a `NOTIFY` statement string.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Random.nextBoolean` for generating random boolean values.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Remove `Inspectable.stringifyCircular` and fix `Formatter.formatJson` so shared object references are preserved while only circular references are omitted.
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Ctrl-U` line clearing support to editable CLI prompts.
@@ -1,5 +0,0 @@
---
"@effect/sql-pg": patch
---
clean up sql-pg constructors and layers
@@ -1,5 +0,0 @@
---
"@effect/platform-browser": patch
---
improve idb support for compound indexes
@@ -1,5 +0,0 @@
---
"effect": patch
---
Append concrete choice values to CLI flag help descriptions so generated help shows valid command-line inputs.
@@ -1,35 +0,0 @@
---
"effect": patch
---
Port `Pipeable.Class` from v3.
```ts
class MyClass extends Pipeable.Class() {
constructor(public a: number) {
super()
}
methodA() {
return this.a
}
}
console.log(new MyClass(2).pipe((x) => x.methodA())) // 2
```
```ts
class A {
constructor(public a: number) {}
methodA() {
return this.a
}
}
class B extends Pipeable.Class(A) {
constructor(private b: string) {
super(b.length)
}
methodB() {
return [this.b, this.methodA()]
}
}
console.log(new B("pipe").pipe((x) => x.methodB())) // ['pipe', 4]
```
@@ -1,5 +0,0 @@
---
"@effect/platform-browser": patch
---
use Cause.NoSuchElementError for idb .first queries
@@ -1,5 +0,0 @@
---
"@effect/ai-openai": patch
---
Add support for OpenAI `keepalive` response stream events.
@@ -1,25 +0,0 @@
---
"effect": patch
---
Schema: collapse same-type literal branches in JSON Schema output into a single `enum` array, closes #1868.
Before:
```json
{
"anyOf": [
{ "type": "string", "enum": ["A"] },
{ "type": "string", "enum": ["B"] }
]
}
```
After:
```json
{
"type": "string",
"enum": ["A", "B"]
}
```
@@ -1,7 +0,0 @@
---
"effect": patch
---
Revert `Config.withDefault` to v3 behavior, closes #1530.
Make `Config.withDefault` accept an eager value instead of `LazyArg`, aligning with CLI module conventions.
-24
View File
@@ -1,24 +0,0 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "Effect-TS/effect-smol" }],
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"scratchpad",
"scripts"
],
"privatePackages": false,
"fixed": [
[
"effect",
"@effect/*"
]
],
"snapshot": {
"useCalculatedVersion": false,
"prereleaseTemplate": "{tag}-{commit}"
}
}
@@ -1,5 +0,0 @@
---
"effect": patch
---
Encoding: consolidate `effect/encoding` sub-modules (Base64, Base64Url, Hex, EncodingError) into a top-level `Encoding` module. Functions are now prefixed: `encodeBase64`, `decodeBase64`, `encodeHex`, `decodeHex`, etc. The `effect/encoding` sub-path export is removed.
@@ -1,16 +0,0 @@
---
"effect": patch
"@effect/sql-clickhouse": patch
"@effect/sql-d1": patch
"@effect/sql-libsql": patch
"@effect/sql-mssql": patch
"@effect/sql-mysql2": patch
"@effect/sql-pg": patch
"@effect/sql-sqlite-bun": patch
"@effect/sql-sqlite-do": patch
"@effect/sql-sqlite-node": patch
"@effect/sql-sqlite-react-native": patch
"@effect/sql-sqlite-wasm": patch
---
Consolidate the SqlError changes to the new reason-based shape across effect and the SQL drivers, classifying native failures into structured reasons with Unknown fallback where native codes are unavailable.
@@ -1,5 +0,0 @@
---
"effect": patch
---
ensure transformed Atom's don't extend idle ttl
@@ -1,5 +0,0 @@
---
"effect": patch
---
add Stream.timeoutOrElse
@@ -1,5 +0,0 @@
---
"effect": patch
---
add `Schema.HashSet` for decoding and encoding `HashSet` values.
@@ -1,5 +0,0 @@
---
"effect": patch
---
narrow types for Effect.retry/repeat while option
@@ -1,5 +0,0 @@
---
"effect": patch
---
Add `Effect.validate` for validating collections while accumulating all failures, equivalent to the v3 `Effect.validateAll` behavior.
@@ -1,5 +0,0 @@
---
"@effect/openapi-generator": patch
---
Add HttpApi generation support for custom OpenAPI HTTP security schemes.
@@ -1,5 +0,0 @@
---
"effect": patch
---
catch defects when building Entity handlers
@@ -1,5 +0,0 @@
---
"@effect/platform-browser": patch
---
improve idb transaction api
Loaded 100 of 3072 files, more files were not shown because too many files have changed in this diff. Show more