Compare commits

...
Author SHA1 Message Date
Theo BrowneandClaude Fable 5 ec34a6f4c4 Restyle the sweep view to match the app's design language
The results view used ad-hoc chrome: colored left-border card stripes,
uppercase micro-headers, and raw-div lists. Restyled to the same
patterns as the settings pages: section headers with tinted icon chips
and a title/hint stack, standard Card surfaces with the app's title
tracking and 13px muted body copy, hover-revealed card actions, the
settings scroll-fade container, and the progress list inside a Card
with row dividers. Cards drop the accent stripe — the section a card
sits in already says what kind it is.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-27 00:19:54 -07:00
Theo BrowneandClaude Fable 5 efa97f27bb Raise sweep review concurrency from 3 to 5
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-27 00:14:10 -07:00
Theo BrowneandClaude Fable 5 1593b08a43 Persist sweep results across reloads
Results were ephemeral module state, so a reload or accidental
navigation threw away a multi-minute (and real-money) run. The store
now persists to localStorage. In-flight RPCs can't survive a reload,
so pending/running items rehydrate as retry-able errors and an
interrupted run reports as complete — the header offers Re-run rather
than a progress bar that would never advance.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-27 00:13:47 -07:00
Theo BrowneandClaude Fable 5 f70a4e59ab Show live per-thread progress, timing, and token usage while reviewing
The in-progress view was a spinner and a counter, which wasted the most
interesting moment of a multi-minute sweep. It now shows a progress bar
plus a live list of every thread being reviewed — running ones first —
with project favicon, a per-thread elapsed clock that ticks while the
review runs, and the tokens and cost each review actually consumed.
The header aggregates run totals.

Usage is real, not estimated: the Claude CLI's `--output-format json`
envelope already reports `usage` and `total_cost_usd`, so
runClaudeJson now surfaces them through an optional onUsage sink,
generateThreadReview attaches them to its result, and the review RPC
returns them as an optional `usage` field. Input counts fold in
cache-creation and cache-read tokens so the number matches billing.
Providers that report nothing simply omit the field.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 23:02:27 -07:00
Theo BrowneandClaude Fable 5 8c9dbfc01a Add traits picker to the review modal and stop wiping model options
The modal exposed only the model, so reasoning effort, thinking, and
fast mode weren't reachable — and worse, picking a model called
createModelSelection without options, silently clearing whatever traits
the sticky selection carried.

The modal now renders the composer's TraitsPicker beside the model
picker, and a model switch preserves the current options when the
instance is unchanged (a different instance's options aren't
transferable, so those start clean). No server change needed: the
provider CLIs already derive effort/thinking/fastMode/ultracode from
modelSelection.options.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 22:51:05 -07:00
Theo BrowneandClaude Fable 5 a8c3047710 Review with the user's last-used model, pickable in the modal
The server's textGenerationModelSelection is tuned for commit messages
and PR bodies — the wrong default for reasoning over a thread. The
sweep now sends an explicit modelSelection, defaulting to the composer
picker's sticky (last-used) model, and the launch modal embeds the same
ProviderModelPicker so it can be changed per run. The server falls back
to its text-gen setting only when a client sends no selection.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 22:37:17 -07:00
Theo Browne 900a40ecd4 Merge remote-tracking branch 'origin/main' into t3code/sidebar-work-overview 2026-07-26 22:13:22 -07:00
Theo Browne 89c5a192f4 fix(dev): skip browser-blocked ports (#4608) 2026-07-26 20:26:21 -07:00
Theo Browne bcd4dfaec0 Merge remote-tracking branch 'origin/main' into t3code/sidebar-work-overview 2026-07-26 19:51:16 -07:00
Theo BrowneandClaude Opus 5 23b5502217 feat(dev): Make t3 code dev instances shareable over Tailscale (#4556)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 19:48:09 -07:00
Theo BrowneandClaude Fable 5 c1b3390f42 Address review feedback and sync with main
Merged origin/main (9 commits) and fixed review findings:

- Macroscope (CI failure): ReviewMergeError dropped the underlying
  failure by stringifying it into `detail`. It now carries an optional
  `cause` and uses a static detail, matching the sibling mapper in
  summarizeThread.
- Cursor (medium, real bug): diffStats used only the latest checkpoint,
  but CheckpointReactor diffs previous→current, so each checkpoint's
  files are that turn's delta. Now sums every ready checkpoint, deduping
  the file count by path. Regression test added.
- Cursor (medium): SidebarV2 remounting published an empty PR-state map
  and wiped the mirrored cache, making merged-PR threads look unsettled.
  publishSweepChangeRequestStates now merges instead of replacing.
- Macroscope (medium): the buckets memo read live shells via
  readThreadShell but only depended on items, so cards could stay in a
  stale bucket. It now depends on thread shells too.
- Cursor (low): sweep candidate selection used a raw wall clock while
  SidebarV2 quantizes to the minute, disagreeing near the merged-PR idle
  boundary. Both now use the same minute-quantized clock.
- Cursor (low): threads with a queued turn start are classified as
  in-flight rather than needing attention.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-26 19:42:43 -07:00
Theo Browne 57e2ffd72e Merge remote-tracking branch 'origin/main' into t3code/sidebar-work-overview 2026-07-26 19:38:41 -07:00
Theo BrowneandClaude Opus 5 a17cbc3b40 feat(dev): keep worktree dev state isolated on T3 Code dev servers (#4555)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 15:26:59 -07:00
Theo BrowneandClaude Opus 5 5719e8ac40 feat(web): show fast mode as a bolt instead of a "Normal" label (#4488)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
2026-07-24 19:28:37 -07:00
jan 38cfc25e54 feat(web): add collapse-all toggle to diff panel (#4475) 2026-07-24 18:15:45 -04:00
41a430a88e Add Claude Opus 5 model (#4472)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
2026-07-24 13:16:33 -07:00
Theo BrowneandClaude Fable 5 3e757bd28b Background sweep, launch modal, PR investigation, and merge queue
Four features from real-data testing feedback:

- The sidebar button now opens a launch modal (scope + model + cost
  summary) instead of navigating. Starting closes the modal and shows
  a "running in background" toast; completion raises a toast with an
  actionable-count summary and a "View results" link. The sweep was
  already navigation-proof; now the UX matches.

- Reviews investigate deeper: when a thread's branch has a PR, the
  server fetches state, review decision, CI rollup, mergeability, and
  the last five comments via `gh pr view`, feeds them into the review
  prompt, and returns a prStatus with a computed mergeReady flag
  (open + clean merge + CI not failing + not blocked on review).
  Lookups degrade to "no PR context" on any failure.

- New "Merge ready" bucket at the top of the results grid with
  per-card "Merge & settle" and a section-level "Merge all (N)".

- Merging runs through a SEQUENTIAL queue: each PR is re-validated
  against live GitHub state before merging (an earlier queue entry may
  have just changed the base), merged PRs settle their thread
  immediately, and a conflict marks the card and hands the rebase to
  the thread's own agent via a turn message — the queue continues past
  it. review.mergePullRequest returns conflict/already-closed/not-ready
  as outcomes rather than errors so the queue can branch on them.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-24 05:36:14 -07:00
Julius Marmingeandcodex ece05087a7 [codex] Fix glass hover compositing artifacts (#4446)
Co-authored-by: codex <[email protected]>
2026-07-24 12:25:01 +00:00
Julius Marmingeandcodex a7ee3092c3 Color settled PR labels on hover (#4451)
Co-authored-by: codex <[email protected]>
2026-07-24 14:08:39 +02:00
Theo BrowneandClaude Fable 5 ade848702d Constrain nextStep to a 10-word command with prompt examples
The screenshot from real-data testing showed nextStep rambling into
status recaps ("The requested comparison and hosted write-up are
complete, and..."). The prompt now demands a verb-first command of at
most 10 words with explicit GOOD/BAD examples, and normalizeThreadReview
backstops drift by truncating to the first sentence, hard-capped at 80
chars. Attention-bucket cards fall back to the summary when an older
server omits nextStep, so they always say what's being waited on.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-24 05:06:55 -07:00
Theo BrowneandClaude Fable 5 b763709a3e Sweep UI v3: grid, reveal-when-done, one-line next steps
Real-data feedback round two:

- Results render as a responsive grid (1/2/3 columns) instead of a
  full-width list.
- While the sweep runs, the page shows only a progress count
  ("Reviewing your work — 7 of 18"); results reveal all at once when
  every thread is done, so triage happens in one pass over a stable
  layout instead of chasing cards as they pop in.
- The model now returns a one-sentence imperative nextStep ("Review
  and merge PR #4415.") which becomes the card body — a direct answer
  to "what should I do here". Summaries are capped at one sentence and
  demoted to an info-icon tooltip.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-24 05:05:01 -07:00
Julius Marmingeandcodex f7cc776488 Restore model picker layout and retain iterative test state (#4450)
Co-authored-by: codex <[email protected]>
2026-07-24 14:01:47 +02:00
Theo BrowneandClaude Fable 5 f508f42215 Redesign review sweep as a triage board
Real-data feedback: uniform gray cards grouped by project buried the
actionable items. The results view is now organized by what the user
should do, ordered easiest-to-clear first:

  1. Ready to settle (one-click, emerald accent)
  2. Title fixes (sky)
  3. Needs your attention (amber — awaiting review/input)
  4. In flight / review-failed / still-reviewing tails

Cards are denser, carry a per-bucket accent stripe and a single
primary action, and gain a metadata row: project favicon + name,
branch, thread age, and diff size. Diff stats (+adds/−dels/files) come
from the thread's latest ready checkpoint, returned by the review RPC
as a new optional diffStats field — no extra client requests. Within
each bucket, smallest diff sorts first to build clearing momentum.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-24 04:57:36 -07:00
Theo BrowneandClaude Fable 5 4faf0e9418 Make sweep respect merged-PR auto-settle like the sidebar
Real-data testing surfaced the gap the plan had flagged: the sweep
passed changeRequestState: null, so threads the sidebar auto-settles
(merged/closed PR + idle) counted as unsettled — 18 candidates vs ~7
sidebar cards. SidebarV2 now mirrors its per-row PR-state map into the
sweep store, isSweepCandidate consults it, and the pre-run summary
subscribes to a version counter so its count tracks PR states as they
stream in.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-24 04:48:22 -07:00
Julius Marminge 15e875a2d9 Increase light-mode contrast for user message bubbles (#4441) 2026-07-24 10:02:36 +00:00
Julius Marminge 5d173547ff Upgrade Clerk packages and Expo integration (#4440) 2026-07-24 11:21:19 +02:00
Theo BrowneandClaude Fable 5 c68e9fa23c Address cursor round-3 review feedback
- Group sweep cards and resolve project titles by scoped
  (environmentId, projectId) key — bare project ids can collide across
  connected environments.
- Withdraw a settle recommendation from the card when the apply-time
  canSettle guard refuses it, instead of leaving a CTA the guard will
  keep rejecting.
- Document why summarizeThread's two projection reads are ordered
  transcript-then-shell: reading the activity view last catches
  sessions that start mid-read, and the reverse skew only affects
  summary staleness — settles are re-validated at apply time and by
  the decider, so no consistency window can settle live work.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 22:25:20 -07:00
Theo Browne b806ba34c2 Merge remote-tracking branch 'origin/main' into t3code/sidebar-work-overview
# Conflicts:
#	apps/server/src/environment/ServerEnvironment.ts
#	packages/contracts/src/environment.ts
2026-07-23 22:13:31 -07:00
Theo BrowneandClaude Fable 5 3afe22dd31 Fail thread review loudly when workspace cwd is unresolvable
The provider CLI spawn reads local context files (AGENTS.md, CLAUDE.md)
from its cwd, so silently falling back to process.cwd() when a thread
has no worktree and its project shell is missing would mix the server's
own directory contents into an external LLM prompt. Return a typed
TextGenerationError instead — the sweep UI already renders it as a
retry-able error card.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 22:12:37 -07:00
202e5609ff feat(sidebar-v2): thread snoozing (#4311)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: maria <[email protected]>
2026-07-23 22:09:32 -07:00
Theo BrowneandClaude Fable 5 f8e63b222d Key pre-run model rows by environment id, not label
Environment labels can collide (e.g. identical hostnames); keying the
rows by label would make React mis-reconcile them. Key by the unique
environment id instead.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 19:42:58 -07:00
Theo BrowneandClaude Fable 5 f8b9d79934 Make pre-run summary reflect the capped selection exactly
The environment/model breakdown previously aggregated every sweep
candidate, so with more than SWEEP_MAX_THREADS unsettled threads it
could list environments whose threads would all be skipped and row
totals exceeding the actual call count. The summary now sorts and caps
candidates with the same helpers startReviewSweep uses, so the rows
always describe exactly the calls a run would make.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 19:42:11 -07:00
Theo BrowneandClaude Fable 5 dc66ff1d5c Add pre-run confirmation screen to review sweep
The sidebar button now only navigates to /review-sweep; the sweep no
longer auto-starts. The idle screen shows exactly what a run will do
before any model call happens: how many threads will be reviewed (and
how many the cap would skip), which text-generation model each
environment's server will use, and a cost/latency heads-up when the
run is large (15+ threads). Starting requires an explicit click.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 19:38:32 -07:00
Theo BrowneandClaude Fable 5 8aad08dc68 Address bot review feedback on review sweep
- macroscope: guard apply-title/apply-settle completions with the runId
  captured before the RPC so a Re-run mid-flight never stamps applied
  state onto the new run's cards; applyAll re-reads items from the
  store each step so mid-apply dismissals are respected, and bails out
  entirely when the run changes.
- cursor: the server's activity re-check now also treats a queued turn
  start (user message no session has adopted yet) as active, mirroring
  the decider's thread.settle guard; sweep candidate ordering uses
  NaN-safe toSortableTimestamp instead of raw Date.parse.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 19:33:45 -07:00
Theo BrowneandClaude Fable 5 f8aa8450d1 Add Review Sweep: one-click agentic review of unsettled work
Adds a sidebar-v2 button that reviews every unsettled thread across all
connected environments: an LLM summarizes each thread, suggests a
corrected title when the current one is misleading, and recommends
settling threads whose work has concluded. Results stream into a new
/review-sweep page with per-item Apply buttons and Apply All — nothing
applies without a click.

- contracts: ReviewThreadSummaryInput/Result, review.summarizeThread WS
  RPC, reviewSweep capability flag (old servers are skipped)
- server: generateThreadReview TextGeneration op across all five
  providers, conservative prompt with transcript capping, and
  ReviewService.summarizeThread reading the projection
- client-runtime: summarizeThread RPC command atom
- web: reviewSweepStore runner (concurrency 3, runId-guarded, survives
  navigation), /review-sweep view, SidebarV2 entry button

Settle recommendations are blocked for active threads at four layers:
prompt rules, normalizeThreadReview, a server-side projection re-check
(never trusts the client's canSettleNow), and a client canSettle
re-check at apply time.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-23 19:24:05 -07:00
Theo BrowneandClaude Fable 5 bb38c3320d fix(web): keep settled threads reachable when opened directly (#4413)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 19:18:32 -07:00
Theo BrowneandClaude Fable 5 6b9a5987f6 fix: Claude Code skills discoverable for the composer $ picker (#4414)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 18:39:42 -07:00
Theo BrowneandClaude Fable 5 fc3f78f5d9 fix: tone down branch-mismatch banner (#4416)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 18:38:05 -07:00
Theo BrowneandClaude Fable 5 2f41c073a2 Stop new threads inheriting checkout/branch from viewed thread (#4411)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 18:06:21 -07:00
Theo Browne 51672b6ecb feat(web): collapse large git diffs by default to make chat more readable (#4409) 2026-07-23 18:06:04 -07:00
Julius Marmingeandcodex 67a7b1a1d3 Improve composer glass fallbacks (#4406)
Co-authored-by: codex <[email protected]>
2026-07-23 22:41:10 +00:00
Julius Marminge ce467da9cf Polish iOS git progress overlay with glass effects (#4387) 2026-07-24 00:39:09 +02:00
Julius Marminge 6ef7aa8399 Fix composer context strip alignment and glass shell (#4404) 2026-07-23 18:32:14 -04:00
Theo BrowneandClaude Fable 5 193e3c62e6 fix(client-runtime): keep a warm thread un-settled despite a merged/closed PR (#4309)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 15:20:44 -07:00
Theo Browne 91dfe60a99 Fix thread loading flash (#4396) 2026-07-23 15:19:06 -07:00
maria edb12401e5 fix(cli): publish nightly branded favicons (#4372) 2026-07-23 23:36:02 +02:00
79fe11bc1c Add preview color scheme controls and simplify project grouping (#4385)
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 23:35:40 +02:00
Julius Marmingeandcodex b3e51317e4 Fix logical project grouping labels on mobile (#4391)
Co-authored-by: codex <[email protected]>
2026-07-23 22:57:42 +02:00
Theo BrowneandClaude Fable 5 ddd5a46f39 fix(web): sidebar v2 polish — jump hints, working duration, in-flight fade, settled sort (#4274)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 22:50:19 +02:00
Theo Browne 88c69ffff6 fix(server): parse CLI version in update preflight (#4389) 2026-07-23 12:58:33 -07:00
maria 979854895c Fix thread tooltip folder icon color (#4383) 2026-07-23 18:10:51 +00:00
maria 9cbe50d10d fix(web): restore dark composer toolbar styling 2026-07-23 12:52:15 -04:00
Julius Marmingeandcodex 9d9208cec5 [codex] Group projects in new-thread pickers (#4312)
Co-authored-by: codex <[email protected]>
2026-07-23 16:11:48 +00:00
Julius Marmingeandcodex 57100fba85 [codex] restore Sidebar V2 project actions (#4373)
Co-authored-by: codex <[email protected]>
2026-07-23 16:11:27 +00:00
3afb4a9ef9 Restore grouped project filtering in Sidebar V2 (#4282)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-23 18:06:56 +02:00
Julius Marmingeandcodex 315b27385d [codex] Deduplicate connection failure messaging (#4367)
Co-authored-by: codex <[email protected]>
2026-07-23 18:06:49 +02:00
Julius Marmingeandcodex 719c905eac [codex] Move mobile project grouping to General settings (#4315)
Co-authored-by: codex <[email protected]>
2026-07-23 18:06:44 +02:00
Julius Marmingeandcodex 0542abc75e [codex] Group project scopes in mobile thread lists (#4314)
Co-authored-by: codex <[email protected]>
2026-07-23 18:06:38 +02:00
Julius Marmingeandcodex 7609495bf7 [codex] Move project grouping to General settings (#4313)
Co-authored-by: codex <[email protected]>
2026-07-23 18:06:33 +02:00
Yukun Shan b41e89eba9 fix(web): warn before silent Windows updates (#4350) 2026-07-23 14:36:56 +02:00
Julius Marmingeandcodex 4d83436415 Unify dialog glass and fix composer overlays (#4365)
Co-authored-by: codex <[email protected]>
2026-07-23 14:15:29 +02:00
Julius Marminge e51538b812 Restore light-mode surfaces and refine dialog styling
- Restore light-mode glass, dialog, dropdown, and composer colors
- Refine provider wizard, changed-file cards, sidebar controls, and buttons
- Update wizard step tests for the new list structure
2026-07-23 13:09:55 +02:00
Julius Marminge 1c9a6de26e Add shared t3.json project configuration support (#4317) 2026-07-23 09:42:35 +00:00
Theo BrowneandClaude Fable 5 fbd77420f2 feat: add "Auto" runtime mode — AI-reviewed approvals for Codex and Claude (#4272)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 02:06:24 -07:00
Theo BrowneandClaude Fable 5 16491a84b9 fix(web): new-thread defaults ignored for remote environments (#4276)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-23 02:06:00 -07:00
maria-rcks b44ed835c6 fix(web): sync provider banner dismissal 2026-07-23 01:13:29 -04:00
maria-rcks 9c9916aefe fix(web): address redesign review findings 2026-07-23 01:13:29 -04:00
maria-rcks 936394b6f2 test(desktop): include glass opacity in settings fixture 2026-07-23 01:13:29 -04:00
maria-rcks c38225ef1c style(web): fade settings content beneath navbar 2026-07-23 01:13:29 -04:00
maria-rcks 39cd15b954 test(web): stabilize timeline module setup 2026-07-23 01:13:29 -04:00
maria-rcks 160d97f403 fix(web): honor composer glass opacity 2026-07-23 01:13:29 -04:00
maria-rcks d330759f58 fix(web): add glass composer alerts 2026-07-23 01:13:29 -04:00
maria-rcks 5961d36769 fix(web): apply glass opacity to command palette 2026-07-23 01:13:29 -04:00
maria-rcks 0b1ce58824 style(web): polish glass opacity slider 2026-07-23 01:13:29 -04:00
maria-rcks 10da67b9da fix(web): apply glass opacity to model picker 2026-07-23 01:13:29 -04:00
maria-rcks 6e5df67f15 fix(web): override thread tooltip background 2026-07-23 01:13:29 -04:00
maria-rcks 29b1abc45e fix(web): apply glass opacity to thread tooltip 2026-07-23 01:13:29 -04:00
Julius Marmingeandcodex 14b6bfdf15 fix(web): unify and tune glass surfaces
Co-authored-by: codex <[email protected]>
2026-07-23 01:13:29 -04:00
maria-rcks b6a2563db7 style(web): polish dark mode dialogs 2026-07-23 01:13:29 -04:00
maria-rcks c5ff51ec1f feat(web): refresh application surfaces 2026-07-23 01:13:29 -04:00
2d31cb022d improve and prevent silent thread branch drift and PR fetching (#2284)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-23 01:13:21 +02:00
Rushikesh Gaikwad bc9428a06a fix(mobile): don't mark Android VPN/Tailscale as offline when connected (#3949) 2026-07-22 21:59:20 +00:00
593289c3c7 Refine light-mode sidebar surfaces (#4268)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-22 23:51:31 +02:00
Julius Marmingeandcodex ab4a88386d Add remote server updates and standalone service management (#4286)
Co-authored-by: codex <[email protected]>
2026-07-22 23:49:21 +02:00
Theo BrowneandClaude Fable 5 78a0ea55c1 feat(web): copy branch name via right-click in the branch selector (#4275)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-22 23:33:07 +02:00
Julius MarmingeandClaude Fable 5 9a0a07167f fix(server): don't drop sticky PR fallback when remote URL can't be resolved (#4289)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-22 18:11:07 +02:00
Utkarsh Patil 9fe4832a3f fix: open command palette instead of custom dialog for new thread picker in SidebarV2 (#4269) 2026-07-22 15:54:09 +00:00
Julius MarmingeandClaude Fable 5 376c149eac Stabilize PR status lookups and provider session lifecycle (#4281)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-22 17:49:46 +02:00
Julius Marminge 7e2bb47504 Move mobile working timer into the thread timeline (#4285) 2026-07-22 17:36:22 +02:00
Julius Marmingeandcodex 18fa89c4ad Preserve draft thread highlighting during promotion (#4283)
Co-authored-by: codex <[email protected]>
2026-07-22 17:26:41 +02:00
Utkarsh Patil f74eb62661 fix(desktop): handle EPIPE errors on stdout/stderr to prevent crash dialog (#4213) 2026-07-22 17:23:07 +02:00
Henry ZhangandJulius Marminge e5fba263e6 Restore Copy Link in chat link context menu (#4161)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-22 16:35:38 +02:00
Julius Marminge 18b468871e Stabilize sidebar settling animations (#4280) 2026-07-22 16:21:45 +02:00
Utkarsh Patil 020179c19a fix(web): use message-square icon for settled icon-less project threads in sidebar v2 (#4279) 2026-07-22 16:20:20 +02:00
Julius Marminge 571a8b44bd Unify temporary worktree branch naming (#4278) 2026-07-22 14:19:01 +00:00
b6e1b39335 fix(web): default provider selection for users without Codex (#4117)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-22 15:58:27 +02:00
c7b21ff172 [codex] keep scoped package references as text (#4167)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-22 15:57:39 +02:00
Yukun Shanandcodex 4e09cddb40 fix(server): stop restoring stale OpenCode models (#4095)
Co-authored-by: codex <[email protected]>
2026-07-22 15:57:29 +02:00
Ishanandcodex 783692afc1 Preserve connecting status while a turn starts (#4101)
Co-authored-by: codex <[email protected]>
2026-07-22 15:54:55 +02:00
Jaret Bottomsandcodex aa5ec80364 fix(claude): isolate capability probe from user MCP servers (#4015)
Co-authored-by: codex <[email protected]>
2026-07-22 15:54:30 +02:00
282ecb3178 fix(settings): validate the add-provider wizard step before advancing (#2813) (#3100)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-22 15:54:20 +02:00
32c6012dab Sidebar v2 beta: flat thread list with a server-backed settled lifecycle (#4026)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: maria-rcks <[email protected]>
2026-07-22 03:36:34 -07:00
Theo BrowneandClaude Fable 5 6f34ad3e87 fix(claude): handle all SDK stream messages; stop spurious work-log warning rows (#4244)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-21 19:58:39 -07:00
Theo BrowneandClaude Fable 5 62cf461759 fix: better defaults — Claude 1M context, Codex gpt-5.6, worktrees from origin main (#4240)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-21 17:13:44 -07:00
Theo BrowneandClaude Fable 5 23c18fda7a fix(web): keep composer editable while disconnected (#4241)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-21 14:29:23 -07:00
Theo BrowneandClaude Fable 5 c0bb237345 fix(web): always show environment chip for remote projects (#4217)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-20 18:27:57 -07:00
Julius Marmingeandcodex 5d34f9ff23 Pass CLI OAuth config to hosted web deploy (#4186)
Co-authored-by: codex <[email protected]>
2026-07-20 14:22:35 +00:00
ssandJulius Marminge c8a04bd59b Finale: upgrade changed files card to fix various UI issues (#4113)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-20 12:45:36 +00:00
db4b2d8a0f perf(orchestration): speed up new-chat propagation and offline catch-up (#4177)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-20 14:44:58 +02:00
2c199aacac fix(desktop): preserve main window bounds (#3851)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-20 14:43:22 +02:00
Yordis PrietoandJulius Marminge 8ca4eec9ca feat(web): drag files from the explorer into the chat composer (#4140)
Co-authored-by: Julius Marminge <[email protected]>
Signed-off-by: Yordis Prieto <[email protected]>
2026-07-20 14:26:46 +02:00
0936fd271f fix(web): preview workspace images in the file panel (#3996)
Co-authored-by: Rhiz3K <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-20 14:22:03 +02:00
Maxwell Young fa69f05b69 [codex] preserve custom model slugs (#4168) 2026-07-20 13:32:30 +02:00
Yordis Prieto c710167bde fix(web): paint text selection over composer chips (#4139)
Signed-off-by: Yordis Prieto <[email protected]>
2026-07-20 13:30:16 +02:00
Maxwell Young a135f2c2d3 [codex] show complete approval details (#4111) 2026-07-20 13:16:57 +02:00
xxashxx-svgandClaude Fable 5 946b867666 fix(web): scope timeline minimap hover target to the side gutter (#3869)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-20 11:16:47 +00:00
Utkarsh Patil 0ca3240691 fix(server): use CLI for OpenCode health check instead of spawning server (#4153) 2026-07-20 12:22:00 +02:00
Vadym Kotaiandcodex f4da4f3b40 fix(opencode): resume the OpenCode session on follow-ups instead of starting an empty one (#3617)
Co-authored-by: codex <[email protected]>
2026-07-20 10:20:28 +00:00
Julius Marmingeandcodex b6d9ce325c Gate iOS glass layout on native support (#4032)
Co-authored-by: codex <[email protected]>
2026-07-20 10:17:30 +00:00
Julius Marmingeandcodex 8e3467fe60 Synchronize mobile threads with authoritative shell snapshots (#4163)
Co-authored-by: codex <[email protected]>
2026-07-20 11:54:59 +02:00
2fae0d0ac3 fix(preview): preserve direct localhost navigation (#3939)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-20 11:49:22 +02:00
Julius Marmingeandcodex 08993a5ec8 Regenerate Codex reset credit protocol bindings (#4173)
Co-authored-by: codex <[email protected]>
2026-07-20 11:14:19 +02:00
Andrew ForsterandJulius Marminge 501ce27b81 [orchestration] Clear stale active turn when session becomes inactive (#3159)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-20 11:04:48 +02:00
40c0ab0883 Add Codex launch arguments setting (#2892)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: root <[email protected]>
2026-07-20 11:04:03 +02:00
Guilherme VieiraandJulius Marminge 33f1cb4224 fix(codex): show web search query and url in tool call details (#2093)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-20 10:58:38 +02:00
d266c068d0 fix: allow sidebar to be shrunk when wider than viewport (#2456)
Co-authored-by: Shoaib Ansari <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-20 10:58:20 +02:00
Andrew Barnes 5fcfe242c1 fix(cli): support force removing projects (#3922) 2026-07-20 08:53:02 +00:00
Christoph Herzog df65a6c3ad Archive selected threads from the context menu (#3895) 2026-07-20 08:51:22 +00:00
Tristan Knight 3235658c08 fix: delegate OpenCode session titles to provider (#3720) 2026-07-20 08:43:07 +00:00
Theo BrowneandClaude Fable 5 749baec353 feat(server): title background-task work-log rows with the task name (#3751)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-20 10:42:02 +02:00
mel d7baa37e5c Fix incorrect pluralization of “entry” (#3933) 2026-07-20 08:35:47 +00:00
Pieter van Zyl 68ea280388 fix(server): recognize Bedrock-backed Claude as authenticated (#3931) 2026-07-20 08:35:08 +00:00
Andrew Barnes dfbda84362 fix(web): handle sidebar shortcut before editors (#3921) 2026-07-20 08:33:43 +00:00
Carlos Rico-Ospina 78485e6d50 fix(desktop): allow clipboard writes in the preview browser (#3889) 2026-07-20 08:32:44 +00:00
coach007 63b6b44627 Fix project action preview settings persistence (#3842) 2026-07-20 08:32:14 +00:00
David Whatley 3795dbb017 fix(server): resolve Claude SDK executable path on Windows npm installs (#3740) 2026-07-20 08:31:13 +00:00
eeinarsson 2640e6dcfc fix(client): use lightweight connection probe (#4137) 2026-07-20 01:33:01 +02:00
Julius Marmingeandcodex e34250df46 Add portable mobile app testing guidance (#4165)
Co-authored-by: codex <[email protected]>
2026-07-20 01:32:19 +02:00
Julius Marmingeandcodex 7e1a0d551c Fix draft banner stack overlap (#4164)
Co-authored-by: codex <[email protected]>
2026-07-20 01:24:57 +02:00
maria b511227b7a fix(web): improve dev sidebar backdrop contrast & remove version pills (#4166) 2026-07-19 21:02:23 +00:00
Julius MarmingeandClaude Sonnet 5 69c8be2ee5 Make test-t3-app skill discoverable by Claude Code (#4162)
Co-authored-by: Claude Sonnet 5 <[email protected]>
2026-07-19 20:32:36 +02:00
Julius Marmingeandcodex 271454cbd2 fix(mobile): Stabilize native stack option updates (#4037)
Co-authored-by: codex <[email protected]>
2026-07-19 19:40:22 +02:00
Kriday Dave e8ff6bc7f8 fix(shared): delete unused agentAwareness phase predicates (#4134) 2026-07-19 19:37:22 +02:00
Utkarsh Patil 398140a9bd fix: increase OpenCode server startup timeout from 5s to 30s (#4132) 2026-07-19 19:33:10 +02:00
Julius Marmingeandcodex 2b180a2b2d Refine T3 Connect authorization surfaces (#4159)
Co-authored-by: codex <[email protected]>
2026-07-19 19:23:53 +02:00
7a820abfdd feat: add headless t3 connect setup for SSH hosts (#3749)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-19 18:59:23 +02:00
53e3c98a55 feat(web): themed sidebar header art for nightly and dev builds (#4130)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-19 12:35:58 +02:00
Julius Marmingeandcodex 4f11740510 Add isolated app testing workflow (#4121)
Co-authored-by: codex <[email protected]>
2026-07-19 11:57:58 +02:00
Taras 1735e27d9e Add terminal selection copy action (#2904) 2026-07-19 00:05:09 +02:00
Julius Marminge ebe8afb1df Refresh splash screen and favicon branding (#4120) 2026-07-18 15:44:06 +02:00
Utkarsh PatilandJulius Marminge bf76535fe4 fix(desktop): Validate WSL node version against engine range after probe success (#3621)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 11:54:13 +00:00
5c66110e26 [fix/feat:ui] Make selected menu checks blue (#3234)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-18 13:50:33 +02:00
Maxwell Young da3c2030f7 [codex] canonicalize client timestamps (#4112) 2026-07-18 13:40:34 +02:00
Noah ZepnerandJulius Marminge 0506508e9b Allow failed remote environments to be removed (#4084)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:31:10 +02:00
Guilherme VieiraandJulius Marminge b859a575d1 fix(web): handle macOS Home and End in composer (#2508)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:23:57 +02:00
ssandJulius Marminge e63403fe92 [fix/feat:ui] Preserve open-in editor brand colors (#3225)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:22:37 +02:00
ssandJulius Marminge c0e161af06 [fix/feat:ui] Show default option badge (#3232)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:21:50 +02:00
d0b9f8d40d [codex] Route OpenCode missing-session errors through Effect (#3608)
Co-authored-by: Codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:19:52 +02:00
Jake LeventhalandJulius Marminge d8b12ae801 Fix sending messages during active turns (#3919)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:19:14 +02:00
Jake LeventhalandJulius Marminge 31caa5652b Fix reopening existing Diff tab (#3973)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:18:18 +02:00
Aditya Mer e350c0a07b Add Grok to marketing site provider list (#3484) 2026-07-18 11:18:17 +00:00
Jake LeventhalandJulius Marminge 38e0bb07bb Default diffs to working changes (#3974)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:17:30 +02:00
Chris Michael Guzman 765e1b5fc0 perf(client): defer active thread cache writes (#4006) 2026-07-18 13:16:38 +02:00
AlexandJulius Marminge 03e20c875c fix(mobile): restore iOS home screen branding (#4025)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:14:59 +02:00
Julius Marmingeandcodex 2318e00270 fix(web): avoid duplicate mention text on paste
Co-authored-by: codex <[email protected]>
2026-07-18 13:05:45 +02:00
Yordis PrietoandJulius Marminge 4cfec8c128 feat: file explorer mention actions and zoom-aware context menus (#4054)
Signed-off-by: Yordis Prieto <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-18 13:05:26 +02:00
1bd2fa25e2 feat: draft hero landing on the index route (#4055)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Signed-off-by: Yordis Prieto <[email protected]>
2026-07-18 12:45:45 +02:00
5ca32661b7 fix(web): increase contrast of question option descriptions (#3867)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:53:50 +02:00
Julius Marminge 8b33799523 Preserve T3 Code identity in macOS development launcher (#4102) 2026-07-17 23:39:29 +02:00
Julius Marminge 24f9c2a08e Share MCP OAuth locks across Codex shadow homes (#4104) 2026-07-17 23:26:53 +02:00
31ca9e5531 fix(server): skip undecodable provider runtime rows when listing sessions (#3951)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-17 21:26:22 +00:00
73bf127d71 [codex] Fix provider update checks restore defaults (#3531)
Co-authored-by: Codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:25:21 +02:00
43e2aeab38 [codex] fix: tolerate invalid latest user message timestamps (#3521)
Co-authored-by: Codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:24:52 +02:00
b655a9f183 [codex] fix: guard invalid web timestamps (#3515)
Co-authored-by: Codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:24:10 +02:00
Matt Van HornandJulius Marminge 4e3f2f04d5 fix(server): thread cwd through Claude capability probe (#2048) (#2124)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:22:19 +02:00
1047dac0c5 fix(terminal): strip AppImage runtime env from spawned terminals (#3108)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-17 23:21:19 +02:00
JamesandJulius Marminge 143b9c9280 fix(ux): spamming cmd + , no longer stack opening settings (#2757)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:20:28 +02:00
cf58cadd02 feat(server): include runtime model and effort in Codex developer instructions (#3948)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 23:15:53 +02:00
6a17629670 [codex] fix mobile composer Enter behavior (#3930)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-17 23:14:45 +02:00
7b8d12618b fix(web): inset Windows desktop scrollbars from resize edge (#4097)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 19:52:42 +00:00
Maxwell YoungandJulius Marminge bcd640bf4d [codex] prevent ACP assistant ID collisions after restarts (#3932)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 21:51:16 +02:00
b49a2e677c Remove unused code parameter from describePreviewError (#3970)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 19:50:33 +00:00
ed81c156da fix(server): image upload crashed dispatchCommand with a stack overflow (#3952)
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 21:47:52 +02:00
Kriday DaveandJulius Marminge 7dc75127c2 Fix duplicate keybinding rule when replacing with an existing rule (#3969)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 21:47:35 +02:00
Fazal Kadivar e057e2e985 fix: prevent initial right-click from selecting a context menu item (#3877) 2026-07-17 21:42:13 +02:00
Olivier Melcher a7f6d97b94 Allow preview panel to grow on wide displays (#4044) 2026-07-17 18:40:24 +00:00
Kriday DaveandJulius Marminge f9a4f59930 Fix documented task-runner commands (bun run -> vp) (#3965)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 20:35:24 +02:00
BunnyGamezsc 7f1cb61031 fix(cursor): default binary path to cursor-agent (avoid path conflict w/ grok) (#4094) 2026-07-17 18:01:02 +00:00
Kriday Dave c49d424e3a Normalize protocol-relative remote host input as https (#3971) 2026-07-17 18:59:42 +02:00
Manuel De Ceglie 4804a9824f fix(marketing): correct Cursor icon color (#4090) 2026-07-17 18:56:59 +02:00
Manuel De Ceglie 0748134cec Update marketing GitHub star count (#4088) 2026-07-17 18:56:35 +02:00
Julius Marmingeandcodex 6e9987cf17 Refresh app icons across release variants (#4080)
Co-authored-by: codex <[email protected]>
2026-07-17 18:51:14 +02:00
Eric Tsai 8b5469863a fix(server): stabilize non-repository Git diagnostics (#4077) 2026-07-17 11:15:31 +00:00
Eric Tsai 58302b2010 fix(git): treat selected commit paths literally (#3998) 2026-07-17 11:14:29 +00:00
Hugo Vizcaino SantanaandClaude Opus 4.8 1f2797325b feat: show nightly update changelog tooltip (#3832)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-17 13:10:51 +02:00
Ishan c14a5ca492 Fix dropped events during initial thread snapshot (#4079) 2026-07-17 11:58:09 +02:00
Dimitar StoykovandClaude Opus 4.8 eb733c10f2 fix(server): use CLAUDE_CONFIG_DIR instead of HOME for Claude instanc… (#4017)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-17 11:46:55 +02:00
Julius Marmingeandcodex 8a02c71861 [codex] Expand real-route app store screenshot harness (#4014)
Co-authored-by: codex <[email protected]>
2026-07-17 11:33:40 +02:00
Julius Marmingeandcodex fdca15471d Add native mobile share target support (#4021)
Co-authored-by: codex <[email protected]>
2026-07-16 14:29:17 +00:00
Julius Marminge 5d68fca8f2 Fix iOS terminal Enter input encoding (#4043) 2026-07-16 16:17:03 +02:00
Julius Marminge 2a33a18716 fix(mobile): Send composer images in upload wire format (#4035) 2026-07-16 13:04:41 +02:00
Julius Marmingeandcodex bde0a4c0dd Resolve localhost preview URLs for remote environments (#4011)
Co-authored-by: codex <[email protected]>
2026-07-16 11:07:38 +02:00
Julius Marmingeandcodex 54f167e2e0 Normalize over-indented markdown list items (#4020)
Co-authored-by: codex <[email protected]>
2026-07-16 08:47:36 +00:00
Julius Marmingeandcodex d114e2772d Prevent duplicate project workspace roots (#3829)
Co-authored-by: codex <[email protected]>
2026-07-16 10:39:13 +02:00
Ishan 0418301de7 Fix macOS fullscreen titlebar spacing (#4019) 2026-07-16 09:34:33 +02:00
Julius Marminge 5e8b2c800e Isolate native diff highlight grammar state (#4029) 2026-07-16 09:24:41 +02:00
Julius Marmingeandcodex b98233702c [codex] Fix onboarding connection status (#4001)
Co-authored-by: codex <[email protected]>
2026-07-16 09:22:07 +02:00
Julius Marmingeandcodex ecb35f7583 Fix Legal modal header crash (#4000)
Co-authored-by: codex <[email protected]>
2026-07-15 10:48:55 +00:00
Julius Marmingeandcodex d359789ed4 docs: Add T3 Code Legal Docs (#3972)
Co-authored-by: codex <[email protected]>
2026-07-15 11:44:03 +02:00
Kriday Dave 462442667e fix(docs): replace stale codething-mvp absolute paths with repo-relative links (#3992) 2026-07-15 10:55:01 +02:00
Kriday Dave c69120f484 fix(docs): repair broken source links in architecture overview (#3991) 2026-07-15 10:54:40 +02:00
Kriday Dave 7b928d5488 fix(docs): correct CI task-runner commands in ci.md (#3990) 2026-07-15 10:53:48 +02:00
Theo Browne 2fdc704bbb perf(web): duty-cycle status animations and remove fixed noise overlay (#3978) 2026-07-15 09:08:33 +02:00
Julius Marminge 3513fa04fb Prepare Android beta branding and review diff UI (#3967) 2026-07-14 19:21:12 +02:00
Julius Marminge 735240f316 Skip stale working-task notifications (#3961) 2026-07-14 18:00:16 +02:00
Julius Marminge 8de254a685 Use client-side fallbacks for missing project favicons (#3959) 2026-07-14 17:59:00 +02:00
c1ec1915fc [codex] Add Android mobile support (#3579)
Co-authored-by: Horus Lugo <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: maria-rcks <[email protected]>
Co-authored-by: Shivam Sharma <[email protected]>
Co-authored-by: Ben Davis <[email protected]>
Co-authored-by: Alex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-07-12 12:03:35 +02:00
Vedank Purohit 619b0ece94 fix(marketing): show platform-appropriate commit shortcut on the website (#3644) 2026-07-12 09:58:55 +00:00
Jake Leventhal ef943a26ab Fix truncated chat error alert layout (#3899) 2026-07-12 09:50:15 +00:00
Julius Marmingeandcodex f61fa9499d Expose mobile PR indicator labels to accessibility (#3828)
Co-authored-by: codex <[email protected]>
2026-07-09 14:00:51 +00:00
Julius Marmingeandcodex 8619ef22e9 Show compact PR number badges in mobile thread rows (#3827)
Co-authored-by: codex <[email protected]>
2026-07-09 15:29:55 +02:00
Julius Marmingeandcodex 843cf176ea fix(mobile): embed fonts and render project favicons reliably (#3823)
Co-authored-by: codex <[email protected]>
2026-07-09 13:49:16 +02:00
Julius Marmingeandcodex ca1e08b5a0 [codex] Label max and ultra reasoning (#3824)
Co-authored-by: codex <[email protected]>
2026-07-09 10:20:32 +00:00
2250e3ee7a feat(client): persist offline environment data and mobile preferences (#3795)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-07-09 11:23:51 +02:00
Julius Marmingeandcodex 3201e00ad4 [codex] Preserve worktree metadata during branch sync (#3822)
Co-authored-by: codex <[email protected]>
2026-07-09 09:01:23 +02:00
Julius Marmingeandcodex e9127658a6 [codex] Upgrade Clerk stack (#3821)
Co-authored-by: codex <[email protected]>
2026-07-09 07:54:28 +02:00
Patricio Gómez Meneses 18a41388eb Fix desktop native optional dependency packaging (#3816) 2026-07-09 03:55:33 +00:00
Rowan 0c66565854 fix(release): bump electron-builder so pnpm 11 deduped deps land in the asar (#3790) 2026-07-08 04:38:45 -07:00
Julius Marminge e775bc6228 Upgrade Clerk toolchain to latest versions (#3785) 2026-07-08 04:30:07 -07:00
Julius MarmingeandCursor Agent 03ac1f0cd9 fix(release): stage pnpm 11 allowBuilds for desktop installs (#3781)
Co-authored-by: Cursor Agent <[email protected]>
2026-07-07 15:55:18 -07:00
Julius MarmingeandCursor Agent 7778a1cea7 Use rounded depth logo for production splash screen (#3780)
Co-authored-by: Cursor Agent <[email protected]>
2026-07-07 22:49:50 +00:00
Julius MarmingeandClaude Fable 5 dad0889766 Revert "Revert "Add T3 Connect onboarding for mobile and web"" (#3777)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-07 14:17:18 -07:00
b9cc8d6ef1 Set up Cursor Cloud dev environment (web + Android toolchain) (#3755)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
2026-07-07 13:18:58 -07:00
Julius MarmingeandClaude Fable 5 0e0040832c Expose Clerk Google sign-in env vars to Expo (#3772)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-07 12:45:40 -07:00
Julius Marminge cd8b9fc8b3 Revert "Add T3 Connect onboarding for mobile and web" (#3776) 2026-07-07 12:40:12 -07:00
Julius Marminge fa6073e2e1 Add T3 Connect onboarding for mobile and web (#3765) 2026-07-07 12:39:56 -07:00
Julius Marminge 4eb1b57933 Lead with the outcome when no agents are active in the Live Activity (#3768) 2026-07-07 09:12:52 -07:00
Julius Marminge 4414f922fe Clear VCS presentation state on finish (#3764) 2026-07-07 08:54:27 -07:00
Julius Marminge 6e42231cb1 Extend Done display to 15 minutes and show up to 5 Live Activity banner rows (#3761) 2026-07-07 02:00:36 -07:00
Julius Marminge bdf5aed665 Fix Expo widget asset wiring order (#3763) 2026-07-07 02:00:10 -07:00
Julius Marminge 0b62e2eb11 Use variant-specific splash icons in mobile app (#3762) 2026-07-07 01:59:13 -07:00
Julius Marminge f9727d0853 Prevent Add Project sheet from collapsing on relayout (#3759) 2026-07-07 01:58:29 -07:00
Julius MarmingeandClaude Opus 4.8 d8e0ba3ea0 Improve live activity routing and diagnostics (#3685)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-07 00:56:20 -07:00
Julius MarmingeandClaude Fable 5 32e7844837 Fix mobile legend anchor under automatic iOS insets (#3684)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-05 22:50:33 -07:00
Julius MarmingeandClaude Opus 4.8 482d56233d Load thread snapshots over HTTP before live sync (#3719)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-05 22:00:13 -07:00
Theo BrowneandClaude Fable 5 6009720844 Add repo-root favicon.svg so t3 code shows its own icon (#3683)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-04 15:05:45 -07:00
Theo BrowneandClaude Opus 4.8 e26e55f389 fix(mobile): combined test branch — scroll, back-swipe, thread lists, computer switching (#3687)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-07-04 14:28:51 -07:00
Julius Marminge 4ac094fef6 Surface pending tasks in mobile home and draft flow (#3670) 2026-07-03 13:32:14 -07:00
Julius Marminge a7e43b2281 Upgrade Vite Plus and enable bundled dev opt-in (#3679) 2026-07-03 11:21:47 -07:00
Julius MarmingeandClaude Fable 5 cabc93bad3 Make the thread composer read as elevated liquid glass (#3668)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-03 07:05:38 +00:00
Julius MarmingeandClaude Fable 5 5cda815626 fix(mobile): compile patched native pods from source on EAS (#3667)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-03 06:52:01 +00:00
32d17d3db5 Add adaptive split-view layout for iPad/mobile workspace (#3514)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-07-02 22:42:14 -07:00
Theo Browne 6d35a87c5d fix(dev): Fix electron dev launch and add test (#3662) 2026-07-02 18:57:59 -07:00
Julius Marminge 7b9eef7ac2 Restore the ultrathink frame border effect (#3625) 2026-07-01 00:25:36 +00:00
Julius Marminge 9d66b104fe Add Claude Sonnet 5 as the default Claude model (#3620) 2026-06-30 11:40:35 -07:00
Utkarsh Patil 51ea084c87 fix: warm WSL before preflight in WSL-only backend mode (#3588) 2026-06-30 11:27:34 -07:00
Hugo BlomandJulius Marminge 0615fd7df1 Add middle-click close for right panel tabs (#3161)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-30 17:13:38 +00:00
t3-code[bot] 2448212367 chore(release): prepare v0.0.28 2026-06-29 22:57:48 +00:00
Julius Marminge fda6486233 Restore chat scroll affordances and add timeline minimap (#3587) 2026-06-29 19:35:16 +00:00
Jgratton24 a9b1190a11 Desktop: parallel WSL + Windows backends with mode picker (#2751) 2026-06-27 08:53:34 -07:00
Julius Marminge 44fb34ad53 Stabilize preview browser surfaces, automation, and recording (#3565) 2026-06-27 08:18:28 -07:00
Julius Marminge 6245c547c2 Fix native composer lag with revision-gated updates (#3574) 2026-06-26 16:55:44 -07:00
Julius Marminge 24abab789e Stabilize chat scroll anchoring after send (#3564) 2026-06-26 14:26:36 -07:00
52b04b947e fix(grok): Harden ACP resume with replay-idle load readiness (#3156)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-25 23:34:08 -07:00
Julius Marmingeandcodex e9ed70c5b9 [codex] Fix preview automation edge cases (#3561)
Co-authored-by: codex <[email protected]>
2026-06-25 20:08:27 -07:00
Julius Marmingeandcodex ffae5410e8 Route preview automation through live owner streams (#3548)
Co-authored-by: codex <[email protected]>
2026-06-25 19:06:44 -07:00
Julius MarmingeandJulius Marminge 31dfe3596e Fix Electron dev and packaged renderer startup (#3557)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-25 20:58:38 +00:00
Julius Marminge c2776c2336 Restore right panel inset when maximized (#3555) 2026-06-25 17:07:33 +00:00
Julius MarmingeandJulius Marminge 22f021ed69 [codex] Upgrade Legend List chat scrolling (#3545)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-24 15:39:17 -07:00
Wout StiensandCodex a4964b3b36 [codex] fix: show standalone element-pick context (#3527)
Co-authored-by: Codex <[email protected]>
2026-06-23 13:04:20 -07:00
c6c64918f8 Reduce ChatMarkdown settings rerenders (#3536)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-06-23 11:47:26 -07:00
Wout StiensandCodex 4abf8b46c5 [codex] fix: ignore stale shell reducer events (#3517)
Co-authored-by: Codex <[email protected]>
2026-06-22 22:33:23 -07:00
Wout StiensandCodex 3083d712ee [codex] fix: clarify Cursor CLI setup error (#3519)
Co-authored-by: Codex <[email protected]>
2026-06-22 22:33:01 -07:00
Julius Marminge 6672a1d210 Bump Clerk packages and refresh lockfile (#3511) 2026-06-22 16:59:56 -07:00
92e54fb96c [codex] fix: guard DPoP fallback URL construction (#3503)
Co-authored-by: Codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-06-22 16:21:06 -07:00
Julius MarmingeandJulius Marminge 8cc9a6fa6b [codex] Restore T3 Connect account controls (#3492)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-22 15:58:54 -07:00
b2d17b7108 Add main sidebar toggle (#3497)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-22 14:00:30 -07:00
Abdul AzeezandJulius Marminge fb1034546f feat: add persistent word-wrap setting for chat code blocks and tables (#3480)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-22 13:14:24 -07:00
f5f98cf0ae Stabilize composer provider state while typing (#3507)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-06-22 12:52:13 -07:00
Julius Marmingeandcodex 37ac970e28 Persist mobile composer selectors across drafts (#3496)
Co-authored-by: codex <[email protected]>
2026-06-22 12:37:31 -07:00
Wout StiensandCodex 8919ae7c53 [codex] Reject unsupported remote pairing protocols (#3498)
Co-authored-by: Codex <[email protected]>
2026-06-22 10:15:43 -07:00
Wout StiensandCodex c1e2408e1f [codex] fix: preserve localhost preview hosts (#3499)
Co-authored-by: Codex <[email protected]>
2026-06-22 10:14:16 -07:00
Wout StiensandCodex 8b993bc9ff [codex] fix: restore pending input keyboard activation (#3501)
Co-authored-by: Codex <[email protected]>
2026-06-22 10:10:47 -07:00
Wout StiensandCodex ea52bb1dbd [codex] fix: guard trace ID clipboard copy (#3505)
Co-authored-by: Codex <[email protected]>
2026-06-22 09:46:15 -07:00
Illia Panasenko 28107e89c2 chore: remove AnnotatableFileDiff leftovers, rename file (#3488) 2026-06-21 20:31:26 -07:00
Julius Marminge 82a9bcc7f4 [codex] add session context to credential errors (#3349) 2026-06-20 20:45:17 -07:00
Julius Marminge 61f8d46fa2 [codex] Enforce Effect error handling conventions (#3380) 2026-06-20 20:43:41 -07:00
Julius Marminge 0debebafbb [codex] Structure thread archive blocked error (#3451) 2026-06-20 20:41:58 -07:00
Julius Marmingeandcodex 2a29de7502 [codex] Structure primary auth validation failures (#3471)
Co-authored-by: codex <[email protected]>
2026-06-20 20:20:12 -07:00
Julius Marmingeandcodex 8c1605b383 [codex] Structure OpenCode text generation failures (#3472)
Co-authored-by: codex <[email protected]>
2026-06-20 20:20:09 -07:00
Julius Marmingeandcodex 90074e359f [codex] Preserve desktop update state causes (#3473)
Co-authored-by: codex <[email protected]>
2026-06-20 20:20:07 -07:00
Julius Marmingeandcodex 6155f5cf64 [codex] Preserve VCS project config error causes (#3474)
Co-authored-by: codex <[email protected]>
2026-06-20 20:20:04 -07:00
Julius Marmingeandcodex e3970e755b [codex] Preserve APNs delivery failure context (#3475)
Co-authored-by: codex <[email protected]>
2026-06-20 20:20:01 -07:00
Julius Marmingeandcodex 3c246f56b4 [codex] Structure VCS process boundary errors (#3476)
Co-authored-by: codex <[email protected]>
2026-06-20 20:19:59 -07:00
Julius Marmingeandcodex cebbe6ff19 [codex] Preserve child process termination context (#3469)
Co-authored-by: codex <[email protected]>
2026-06-20 19:20:04 -07:00
Julius Marmingeandcodex e4a84a348e [codex] Structure release output failures (#3470)
Co-authored-by: codex <[email protected]>
2026-06-20 19:20:01 -07:00
Julius Marmingeandcodex 61e6d89d69 [codex] Structure GitHub CLI failures (#3456)
Co-authored-by: codex <[email protected]>
2026-06-20 19:14:35 -07:00
Julius Marmingeandcodex 1b2f39d018 [codex] Structure theme synchronization failures (#3466)
Co-authored-by: codex <[email protected]>
2026-06-20 19:09:05 -07:00
Julius Marmingeandcodex 8c2d33abde [codex] Structure release package updater failures (#3468)
Co-authored-by: codex <[email protected]>
2026-06-20 19:09:02 -07:00
Julius Marmingeandcodex 60dc4af916 [codex] Structure desktop build script failures (#3452)
Co-authored-by: codex <[email protected]>
2026-06-20 18:58:22 -07:00
Julius Marmingeandcodex d389cfd4e3 [codex] Structure Azure DevOps CLI failures (#3460)
Co-authored-by: codex <[email protected]>
2026-06-20 18:58:19 -07:00
Julius Marmingeandcodex 6fc79737c3 [codex] Structure mobile native static-check failures (#3464)
Co-authored-by: codex <[email protected]>
2026-06-20 18:58:16 -07:00
Julius Marmingeandcodex cdd03591ef [codex] Structure release metadata failures (#3467)
Co-authored-by: codex <[email protected]>
2026-06-20 18:58:13 -07:00
Julius Marmingeandcodex 2fbb0565d7 [codex] Structure workspace search cleanup failures (#3465)
Co-authored-by: codex <[email protected]>
2026-06-20 18:58:08 -07:00
Julius Marmingeandcodex a3dadc04bf [codex] Structure Bitbucket API errors (#3457)
Co-authored-by: codex <[email protected]>
2026-06-20 18:47:12 -07:00
Julius Marmingeandcodex 1a59277dc8 [codex] Structure GitLab CLI failures (#3458)
Co-authored-by: codex <[email protected]>
2026-06-20 18:41:25 -07:00
Julius Marmingeandcodex 6424197a19 [codex] Structure unroutable app-server messages (#3463)
Co-authored-by: codex <[email protected]>
2026-06-20 18:30:19 -07:00
Julius Marmingeandcodex 8d4a8b4f31 [codex] Structure preview capability errors (#3454)
Co-authored-by: codex <[email protected]>
2026-06-20 18:19:12 -07:00
Julius Marmingeandcodex 23ab75e84a [codex] Split project command failures (#3459)
Co-authored-by: codex <[email protected]>
2026-06-20 18:19:07 -07:00
Julius Marmingeandcodex 0488e47d9c [codex] Structure checkpoint diff failures (#3453)
Co-authored-by: codex <[email protected]>
2026-06-20 18:07:22 -07:00
Julius Marmingeandcodex 0eba548282 [codex] Model asset access failures with distinct errors (#3448)
Co-authored-by: codex <[email protected]>
2026-06-20 17:35:07 -07:00
Julius Marmingeandcodex 68c0dd3b70 [codex] Structure server CLI failures (#3450)
Co-authored-by: codex <[email protected]>
2026-06-20 17:35:02 -07:00
Julius Marmingeandcodex 4cd958445f [codex] Migrate desktop app errors to Schema (#3449)
Co-authored-by: codex <[email protected]>
2026-06-20 17:25:27 -07:00
Julius Marmingeandcodex 9f7861aadd [codex] Structure desktop update persistence errors (#3261)
Co-authored-by: codex <[email protected]>
2026-06-20 17:09:17 -07:00
Julius Marmingeandcodex 9243ead1c3 [codex] Preserve Linux icon resize fallback failures (#3447)
Co-authored-by: codex <[email protected]>
2026-06-20 17:09:11 -07:00
Julius Marmingeandcodex 803c2b7738 [codex] Preserve desktop backend output read failures (#3444)
Co-authored-by: codex <[email protected]>
2026-06-20 16:58:21 -07:00
Julius Marmingeandcodex 28e7c9ae17 [codex] Structure mobile waitlist enrollment failures (#3446)
Co-authored-by: codex <[email protected]>
2026-06-20 16:58:15 -07:00
Julius Marmingeandcodex a9460bb772 [codex] Structure pull request link failures (#3445)
Co-authored-by: codex <[email protected]>
2026-06-20 16:44:22 -07:00
Julius Marmingeandcodex 5edf7c56ba [codex] Preserve PR materialization failure chains (#3443)
Co-authored-by: codex <[email protected]>
2026-06-20 16:38:56 -07:00
Julius Marmingeandcodex 90dc76b11e Preserve asset access failure causes (#3342)
Co-authored-by: codex <[email protected]>
2026-06-20 16:15:22 -07:00
Julius Marmingeandcodex 57d25c934b [codex] Structure persistence error correlation (#3439)
Co-authored-by: codex <[email protected]>
2026-06-20 16:15:16 -07:00
Julius Marmingeandcodex a26f0dc89f [codex] structure source-control repository failures (#3336)
Co-authored-by: codex <[email protected]>
2026-06-20 15:56:46 -07:00
Julius Marmingeandcodex 6ff6c13fc8 [codex] structure desktop backend process errors (#3254)
Co-authored-by: codex <[email protected]>
2026-06-20 15:55:50 -07:00
Julius Marmingeandcodex 60c9ca0e33 [codex] Preserve checkpoint repository detection failures (#3360)
Co-authored-by: codex <[email protected]>
2026-06-20 15:55:44 -07:00
Julius Marmingeandcodex ad2cb1dd57 [codex] Diagnose desktop client settings read failures (#3432)
Co-authored-by: codex <[email protected]>
2026-06-20 15:55:38 -07:00
Julius Marmingeandcodex 674590e009 [codex] Fix terminal cwd error test construction (#3440)
Co-authored-by: codex <[email protected]>
2026-06-20 15:47:58 -07:00
Julius Marmingeandcodex f2cb14e774 [codex] Structure mobile relay token-store failures (#3309)
Co-authored-by: codex <[email protected]>
2026-06-20 15:31:33 -07:00
Julius Marmingeandcodex e042c25f56 [codex] Structure rotating log sink errors (#3279)
Co-authored-by: codex <[email protected]>
2026-06-20 15:24:38 -07:00
Julius Marmingeandcodex 90f1936fad [codex] Structure server runtime-state failures (#3319)
Co-authored-by: codex <[email protected]>
2026-06-20 15:15:05 -07:00
Julius Marmingeandcodex 42ff43915a [codex] Preserve mobile review highlighter failures (#3337)
Co-authored-by: codex <[email protected]>
2026-06-20 15:15:00 -07:00
Julius Marmingeandcodex 834e5db458 [codex] structure project CLI failures (#3339)
Co-authored-by: codex <[email protected]>
2026-06-20 15:14:55 -07:00
Julius Marmingeandcodex 8ce627ba91 [codex] Structure mobile thread outbox failures (#3341)
Co-authored-by: codex <[email protected]>
2026-06-20 15:14:51 -07:00
Julius Marmingeandcodex 9a78c6f2ba [codex] Structure web local storage failures (#3350)
Co-authored-by: codex <[email protected]>
2026-06-20 15:14:46 -07:00
Julius Marmingeandcodex aab72f10c1 [codex] Report markdown interaction failures (#3355)
Co-authored-by: codex <[email protected]>
2026-06-20 15:14:41 -07:00
Julius Marmingeandcodex a76b7bbfb5 Preserve PortScanner probe defects (#3282)
Co-authored-by: codex <[email protected]>
2026-06-20 15:14:02 -07:00
Julius Marmingeandcodex a51691a9b0 [codex] Structure server environment-label probe failures (#3321)
Co-authored-by: codex <[email protected]>
2026-06-20 15:13:53 -07:00
Julius Marmingeandcodex 97de7d7e15 [codex] Structure agent awareness registration errors (#3328)
Co-authored-by: codex <[email protected]>
2026-06-20 15:13:48 -07:00
Julius Marmingeandcodex d7718e81e0 [codex] Structure mobile notification navigation failures (#3359)
Co-authored-by: codex <[email protected]>
2026-06-20 15:13:04 -07:00
Julius Marmingeandcodex b88873508e [codex] Structure cross-client clipboard failures (#3361)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:59 -07:00
Julius Marmingeandcodex 58053d146b [codex] Structure terminal PTY operation failures (#3364)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:54 -07:00
Julius Marmingeandcodex 50767683b3 [codex] Preserve terminal preview link failure context (#3367)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:50 -07:00
Julius Marmingeandcodex d1339f3846 [codex] Structure client state key errors (#3374)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:45 -07:00
Julius Marmingeandcodex faccdd4ca9 [codex] Preserve desktop backend log failures (#3375)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:40 -07:00
Julius Marmingeandcodex dd48bfd98c [codex] Structure server settings failures (#3376)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:36 -07:00
Julius Marmingeandcodex 6d8d995621 [codex] Correlate protocol request failures (#3433)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:31 -07:00
Julius Marmingeandcodex b6c590af38 [codex] Fix desktop preview event delivery errors (#3435)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:27 -07:00
Julius Marmingeandcodex b51aef10c4 [codex] Preserve cloud disconnect diagnostics (#3437)
Co-authored-by: codex <[email protected]>
2026-06-20 15:12:22 -07:00
Julius Marmingeandcodex fc2cdeceb9 [codex] Structure preview automation boundary failures (#3436)
Co-authored-by: codex <[email protected]>
2026-06-20 13:50:19 -07:00
Julius Marmingeandcodex c637dfc454 [codex] enrich Git workflow errors (#3241)
Co-authored-by: codex <[email protected]>
2026-06-20 13:16:32 -07:00
Julius Marmingeandcodex 6e9b43cb84 Preserve trace file read causes (#3300)
Co-authored-by: codex <[email protected]>
2026-06-20 13:11:52 -07:00
Julius Marmingeandcodex be56fa43b0 [codex] Preserve workspace root stat failures (#3278)
Co-authored-by: codex <[email protected]>
2026-06-20 12:58:59 -07:00
Julius Marmingeandcodex eb5eb0d9fa [codex] Structure managed endpoint allocation failures (#3421)
Co-authored-by: codex <[email protected]>
2026-06-20 12:58:10 -07:00
Julius Marmingeandcodex 621616268a [codex] Sanitize text generation CLI errors (#3431)
Co-authored-by: codex <[email protected]>
2026-06-20 12:33:22 -07:00
Julius Marmingeandcodex 630df6b986 [codex] Enrich source-control errors (#3248)
Co-authored-by: codex <[email protected]>
2026-06-20 12:32:34 -07:00
Julius Marmingeandcodex 569b3e5959 [codex] Structure desktop SSH prompt presentation failures (#3429)
Co-authored-by: codex <[email protected]>
2026-06-20 12:31:49 -07:00
Julius Marmingeandcodex d7ff7e7333 [codex] Audit managed endpoint error context (#3245)
Co-authored-by: codex <[email protected]>
2026-06-20 12:30:03 -07:00
Julius Marmingeandcodex bd8e3ee008 Align text generation error catches (#3292)
Co-authored-by: codex <[email protected]>
2026-06-20 12:29:24 -07:00
Julius Marmingeandcodex c1d8a22f07 [codex] Structure desktop persisted credential errors (#3239)
Co-authored-by: codex <[email protected]>
2026-06-20 12:28:14 -07:00
Julius Marmingeandcodex 7b791895ad [codex] Structure relay auth persistence errors (#3250)
Co-authored-by: codex <[email protected]>
2026-06-20 12:27:28 -07:00
Julius Marmingeandcodex 4c16c66368 [codex] Structure ACP transport errors (#3251)
Co-authored-by: codex <[email protected]>
2026-06-20 12:25:16 -07:00
Julius Marmingeandcodex 4407a5a6b7 [codex] Structure Codex shadow home errors (#3262)
Co-authored-by: codex <[email protected]>
2026-06-20 12:24:32 -07:00
Julius Marmingeandcodex c7b375e9b0 [codex] Structure Electron window failures (#3276)
Co-authored-by: codex <[email protected]>
2026-06-20 12:23:46 -07:00
Julius Marmingeandcodex abc253d97d [codex] Preserve native SQLite failure context (#3428)
Co-authored-by: codex <[email protected]>
2026-06-20 12:12:41 -07:00
Julius Marmingeandcodex ce11e6facd [codex] Structure desktop browser session errors (#3273)
Co-authored-by: codex <[email protected]>
2026-06-20 12:10:51 -07:00
Julius Marmingeandcodex f1052dd8b1 [codex] Structure Discord release webhook failures (#3285)
Co-authored-by: codex <[email protected]>
2026-06-20 12:09:34 -07:00
Julius Marmingeandcodex e85144a58c [codex] Structure relay delivery attempt errors (#3312)
Co-authored-by: codex <[email protected]>
2026-06-20 12:08:37 -07:00
Julius Marmingeandcodex defd9dfe20 [codex] Structure Electron menu failures (#3317)
Co-authored-by: codex <[email protected]>
2026-06-20 12:07:57 -07:00
Julius Marmingeandcodex 8c03188c1c [codex] Structure preview automation failures (#3333)
Co-authored-by: codex <[email protected]>
2026-06-20 12:07:09 -07:00
Julius Marmingeandcodex 3e5f9f2cdd [codex] Structure browser recording failures (#3330)
Co-authored-by: codex <[email protected]>
2026-06-20 12:06:31 -07:00
Julius Marmingeandcodex 6888276f19 [codex] Sanitize YAML schema diagnostics (#3427)
Co-authored-by: codex <[email protected]>
2026-06-20 12:05:35 -07:00
Julius Marmingeandcodex e06c33c38d [codex] Structure relay Live Activity errors (#3314)
Co-authored-by: codex <[email protected]>
2026-06-20 12:05:13 -07:00
Julius Marmingeandcodex 5f860439e9 [codex] Structure APNs delivery job errors (#3322)
Co-authored-by: codex <[email protected]>
2026-06-20 12:04:27 -07:00
Julius Marmingeandcodex c9159b67b3 [codex] Structure APNs client errors (#3318)
Co-authored-by: codex <[email protected]>
2026-06-20 12:03:43 -07:00
Julius Marmingeandcodex a1b727f62d [codex] Structure relay device persistence errors (#3344)
Co-authored-by: codex <[email protected]>
2026-06-20 12:02:59 -07:00
Julius Marmingeandcodex fdc1e8b3a2 [codex] Structure pairing grant failures (#3386)
Co-authored-by: codex <[email protected]>
2026-06-20 12:02:16 -07:00
Julius Marmingeandcodex c8454ad88a [codex] structure workspace search failures (#3352)
Co-authored-by: codex <[email protected]>
2026-06-20 12:01:31 -07:00
Julius Marmingeandcodex 336d176027 [codex] Structure preview automation errors (#3272)
Co-authored-by: codex <[email protected]>
2026-06-20 12:00:54 -07:00
Julius Marmingeandcodex 204984bf8c [codex] Structure relay deploy output errors (#3340)
Co-authored-by: codex <[email protected]>
2026-06-20 12:00:04 -07:00
Julius Marmingeandcodex be4a38e578 [codex] add structured Electron dialog errors (#3284)
Co-authored-by: codex <[email protected]>
2026-06-20 11:59:27 -07:00
Julius Marmingeandcodex f50a7cddc1 [codex] Structure dev-runner failures (#3283)
Co-authored-by: codex <[email protected]>
2026-06-20 11:58:24 -07:00
Julius Marmingeandcodex 97487d9959 [codex] Structure reference repo sync failures (#3281)
Co-authored-by: codex <[email protected]>
2026-06-20 11:57:48 -07:00
Julius Marmingeandcodex d2e38c5373 [codex] Structure Tailscale command failures (#3257)
Co-authored-by: codex <[email protected]>
2026-06-20 11:56:52 -07:00
Julius Marmingeandcodex 90bd5ee0c1 [codex] structure desktop preview failures (#3244)
Co-authored-by: codex <[email protected]>
2026-06-20 11:55:10 -07:00
Julius Marmingeandcodex 430ece4c0a [codex] Structure Codex app-server request errors (#3258)
Co-authored-by: codex <[email protected]>
2026-06-20 11:54:38 -07:00
Julius Marmingeandcodex 4238a0e769 [codex] Enrich Git VCS driver errors (#3253)
Co-authored-by: codex <[email protected]>
2026-06-20 11:53:53 -07:00
Julius Marmingeandcodex ff0f702c7c [codex] Structure client VCS action errors (#3263)
Co-authored-by: codex <[email protected]>
2026-06-20 11:52:20 -07:00
Julius Marmingeandcodex 1cbe8a7a90 [codex] Structure VCS project config failures (#3315)
Co-authored-by: codex <[email protected]>
2026-06-20 11:51:52 -07:00
Julius Marmingeandcodex 46fdc769d9 [codex] Structure telemetry identity errors (#3306)
Co-authored-by: codex <[email protected]>
2026-06-20 11:50:58 -07:00
Julius Marmingeandcodex 0cd0ed1a3d [codex] Sanitize client error log diagnostics (#3405)
Co-authored-by: codex <[email protected]>
2026-06-20 11:50:46 -07:00
Julius Marmingeandcodex d53237cbd1 [codex] sanitize ACP native event diagnostics (#3417)
Co-authored-by: codex <[email protected]>
2026-06-20 11:50:14 -07:00
Julius Marmingeandcodex 0e718855b8 [codex] Structure primary environment target failures (#3413)
Co-authored-by: codex <[email protected]>
2026-06-20 11:49:21 -07:00
Julius Marmingeandcodex 731b1a67ac [codex] structure VCS process errors (#3408)
Co-authored-by: codex <[email protected]>
2026-06-20 11:49:08 -07:00
Julius Marmingeandcodex cdfecb36a6 [codex] Structure workspace file system errors (#3274)
Co-authored-by: codex <[email protected]>
2026-06-20 11:48:14 -07:00
Julius Marmingeandcodex f4ef356215 [codex] structure desktop IPC registration errors (#3291)
Co-authored-by: codex <[email protected]>
2026-06-20 11:43:21 -07:00
Julius Marmingeandcodex d60f5c6101 [codex] Structure mobile external link failures (#3363)
Co-authored-by: codex <[email protected]>
2026-06-20 11:42:41 -07:00
Julius Marmingeandcodex eacceb9e7b [codex] Bound shared schema diagnostics (#3424)
Co-authored-by: codex <[email protected]>
2026-06-20 11:41:29 -07:00
Julius Marmingeandcodex 13a4789a5d [codex] Structure terminal adapter startup defects (#3425)
Co-authored-by: codex <[email protected]>
2026-06-20 11:40:36 -07:00
Julius Marmingeandcodex b6e384fb27 [codex] Preserve trace IDs across error causes (#3426)
Co-authored-by: codex <[email protected]>
2026-06-20 11:40:08 -07:00
Julius Marmingeandcodex d8bf307d22 [codex] Enrich process runner errors (#3268)
Co-authored-by: codex <[email protected]>
2026-06-20 11:37:50 -07:00
Julius Marmingeandcodex d512deac84 [codex] Structure preview URL failures (#3275)
Co-authored-by: codex <[email protected]>
2026-06-20 11:37:01 -07:00
Julius Marmingeandcodex 32c7f90d9e [codex] Structure APNs delivery queue errors (#3326)
Co-authored-by: codex <[email protected]>
2026-06-20 11:36:08 -07:00
Julius Marmingeandcodex 2c16edd0cb [codex] Structure desktop bridge state errors (#3381)
Co-authored-by: codex <[email protected]>
2026-06-20 11:32:47 -07:00
Julius Marmingeandcodex 708bc7091d Structure server environment ID failures (#3286)
Co-authored-by: codex <[email protected]>
2026-06-20 11:31:57 -07:00
Julius Marmingeandcodex 7eb7b4f4a3 [codex] Structure release metadata failures (#3296)
Co-authored-by: codex <[email protected]>
2026-06-20 11:31:09 -07:00
Julius Marmingeandcodex e01b1903de [codex] Structure process diagnostics failures (#3389)
Co-authored-by: codex <[email protected]>
2026-06-20 11:30:17 -07:00
Julius Marmingeandcodex 1dc36cef73 Structure relay auth parsing errors (#3290)
Co-authored-by: codex <[email protected]>
2026-06-20 11:29:28 -07:00
Julius Marmingeandcodex 833c8ab7c6 [codex] Remove project setup error constructor wrappers (#3329)
Co-authored-by: codex <[email protected]>
2026-06-20 11:28:33 -07:00
Julius Marmingeandcodex 5b1b35c773 [codex] Preserve desktop shell environment probe failures (#3383)
Co-authored-by: codex <[email protected]>
2026-06-20 11:28:06 -07:00
Julius Marmingeandcodex ee3e2dae78 [codex] Structure remote pairing input errors (#3393)
Co-authored-by: codex <[email protected]>
2026-06-20 11:27:39 -07:00
Julius Marmingeandcodex 9c98cd60e8 Remove persistence error constructor wrappers (#3398)
Co-authored-by: codex <[email protected]>
2026-06-20 11:26:51 -07:00
Julius Marmingeandcodex 48f88d5220 [codex] Structure desktop Clerk bridge failures (#3308)
Co-authored-by: codex <[email protected]>
2026-06-20 11:26:03 -07:00
Julius Marmingeandcodex 2910d9ff01 [codex] Structure preview config failures (#3271)
Co-authored-by: codex <[email protected]>
2026-06-20 11:25:14 -07:00
Julius Marmingeandcodex 2b8e012924 [codex] Structure desktop server exposure errors (#3269)
Co-authored-by: codex <[email protected]>
2026-06-20 11:24:35 -07:00
Julius Marmingeandcodex 49c23221d8 [codex] Structure mobile secure storage failures (#3345)
Co-authored-by: codex <[email protected]>
2026-06-20 11:23:58 -07:00
Julius Marmingeandcodex 5ca7676661 [codex] Structure Claude adapter failures (#3406)
Co-authored-by: codex <[email protected]>
2026-06-20 11:22:57 -07:00
Julius Marmingeandcodex c3e3e26844 [codex] Structure primary environment request failures (#3409)
Co-authored-by: codex <[email protected]>
2026-06-20 11:22:28 -07:00
Julius Marmingeandcodex 1486a4a2b9 [codex] Structure Electron updater errors (#3280)
Co-authored-by: codex <[email protected]>
2026-06-20 11:20:46 -07:00
Julius Marmingeandcodex 1e5f62801b [codex] Structure MCP snapshot failures (#3423)
Co-authored-by: codex <[email protected]>
2026-06-20 11:20:14 -07:00
Julius Marmingeandcodex ed6ba7439d [codex] sanitize provider runtime failure diagnostics (#3414)
Co-authored-by: codex <[email protected]>
2026-06-20 11:19:57 -07:00
Julius Marmingeandcodex f98448e872 [codex] Structure relay JWT failures (#3270)
Co-authored-by: codex <[email protected]>
2026-06-20 11:19:39 -07:00
Julius Marmingeandcodex bfe61741b8 [codex] Simplify desktop client settings errors (#3265)
Co-authored-by: codex <[email protected]>
2026-06-20 11:19:11 -07:00
Julius Marmingeandcodex 4d3fcacd84 [codex] Type malformed Clerk public config failures (#3422)
Co-authored-by: codex <[email protected]>
2026-06-20 11:18:38 -07:00
Julius Marmingeandcodex 4d790f0064 [codex] Bound relay registration replay diagnostics (#3420)
Co-authored-by: codex <[email protected]>
2026-06-20 11:13:27 -07:00
Julius Marmingeandcodex 3ecf3685ba [codex] structure Bitbucket API failures (#3332)
Co-authored-by: codex <[email protected]>
2026-06-20 11:13:02 -07:00
Julius Marmingeandcodex 716ae73c40 [codex] Structure relay publish signature errors (#3335)
Co-authored-by: codex <[email protected]>
2026-06-20 11:12:31 -07:00
Julius Marmingeandcodex 300d4d566a [codex] Structure missing provider command failures (#3384)
Co-authored-by: codex <[email protected]>
2026-06-20 11:12:02 -07:00
Julius Marmingeandcodex 53a477c2e9 [codex] Structure desktop backend settings read errors (#3379)
Co-authored-by: codex <[email protected]>
2026-06-20 11:11:43 -07:00
Julius Marmingeandcodex d84ebe8319 [codex] Structure process resource sampling failures (#3415)
Co-authored-by: codex <[email protected]>
2026-06-20 11:11:15 -07:00
Julius Marmingeandcodex 5a2c92e86d [codex] Structure Electron app boundary failures (#3301)
Co-authored-by: codex <[email protected]>
2026-06-20 11:10:45 -07:00
Julius Marmingeandcodex 61aade9ea4 [codex] Preserve desktop asset probe failures (#3373)
Co-authored-by: codex <[email protected]>
2026-06-20 11:10:16 -07:00
Julius Marmingeandcodex 04f82ae1f3 [codex] Structure relay environment link errors (#3334)
Co-authored-by: codex <[email protected]>
2026-06-20 11:09:30 -07:00
Julius Marmingeandcodex ce0c20b840 [codex] Structure desktop network interface failures (#3313)
Co-authored-by: codex <[email protected]>
2026-06-20 11:09:02 -07:00
Julius Marmingeandcodex fccecd8749 [codex] Preserve detached desktop action causes (#3371)
Co-authored-by: codex <[email protected]>
2026-06-20 11:08:32 -07:00
Julius Marmingeandcodex 30a084c463 [codex] Preserve mobile composer draft failures (#3348)
Co-authored-by: codex <[email protected]>
2026-06-20 11:08:03 -07:00
Julius Marmingeandcodex 9d5ca2cb7c [codex] Structure Electron protocol teardown failures (#3310)
Co-authored-by: codex <[email protected]>
2026-06-20 11:07:35 -07:00
Julius Marmingeandcodex ac77fe452b [codex] Preserve relay trace error causes (#3377)
Co-authored-by: codex <[email protected]>
2026-06-20 11:07:06 -07:00
Julius Marmingeandcodex 4fbc4f9b20 [codex] Structure mobile project thread validation errors (#3387)
Co-authored-by: codex <[email protected]>
2026-06-20 11:06:38 -07:00
Julius Marmingeandcodex 779c237487 [codex] Structure native view resolution failures (#3353)
Co-authored-by: codex <[email protected]>
2026-06-20 11:06:08 -07:00
Julius Marmingeandcodex 350e229f7a [codex] Structure OAuth scope encoding failures (#3368)
Co-authored-by: codex <[email protected]>
2026-06-20 11:05:40 -07:00
Julius Marmingeandcodex 8112aff7c2 [codex] Structure relay install confirmation conflicts (#3365)
Co-authored-by: codex <[email protected]>
2026-06-20 11:05:24 -07:00
Julius Marmingeandcodex b9e22de6a3 [codex] Preserve desktop update state read failures (#3370)
Co-authored-by: codex <[email protected]>
2026-06-20 11:04:53 -07:00
Julius Marmingeandcodex f3b43a148b [codex] Structure missing client cloud config errors (#3346)
Co-authored-by: codex <[email protected]>
2026-06-20 11:03:09 -07:00
Julius Marmingeandcodex 8331511b97 [codex] structure Electron theme source errors (#3294)
Co-authored-by: codex <[email protected]>
2026-06-20 11:02:37 -07:00
Julius Marmingeandcodex 08650a7424 [codex] Structure web diff worker failures (#3356)
Co-authored-by: codex <[email protected]>
2026-06-20 11:02:07 -07:00
Julius Marmingeandcodex 40d14647db [codex] Structure catalog dependency resolution failures (#3298)
Co-authored-by: codex <[email protected]>
2026-06-20 11:01:36 -07:00
Julius Marmingeandcodex cc69aef4dd [codex] Structure relay domain label errors (#3347)
Co-authored-by: codex <[email protected]>
2026-06-20 11:00:42 -07:00
Julius Marmingeandcodex 71608142c2 [codex] Split preferred editor precondition errors (#3324)
Co-authored-by: codex <[email protected]>
2026-06-20 10:59:54 -07:00
Julius Marmingeandcodex bf1a6501c7 [codex] Preserve review path resolution failures (#3357)
Co-authored-by: codex <[email protected]>
2026-06-20 10:59:10 -07:00
Julius Marmingeandcodex f7867addbe [codex] Structure mobile notification setting failures (#3391)
Co-authored-by: codex <[email protected]>
2026-06-20 10:58:39 -07:00
Julius Marmingeandcodex 7a8bab5d9d [codex] Keep PTY spawn errors structural (#3325)
Co-authored-by: codex <[email protected]>
2026-06-20 10:58:03 -07:00
Julius Marmingeandcodex 06752526b3 [codex] Structure unavailable Bun PTY operations (#3394)
Co-authored-by: codex <[email protected]>
2026-06-20 10:57:33 -07:00
Julius Marmingeandcodex d87ec967bf [codex] Structure empty mobile pairing payload errors (#3372)
Co-authored-by: codex <[email protected]>
2026-06-20 10:56:12 -07:00
Julius Marmingeandcodex e55dd0067d [codex] Structure preview session key errors (#3388)
Co-authored-by: codex <[email protected]>
2026-06-20 10:54:56 -07:00
Julius Marmingeandcodex 8c3755aecc [codex] Structure bootstrap errors (#3256)
Co-authored-by: codex <[email protected]>
2026-06-20 10:54:12 -07:00
Julius Marmingeandcodex b4fe8faa1d [codex] Structure relay activity-row persistence errors (#3305)
Co-authored-by: codex <[email protected]>
2026-06-20 10:42:38 -07:00
Julius Marmingeandcodex 515303edf2 [codex] Preserve desktop user-data probe failures (#3304)
Co-authored-by: codex <[email protected]>
2026-06-20 10:41:55 -07:00
Julius Marmingeandcodex 20734d4a78 [codex] Structure macOS passkey signing failures (#3303)
Co-authored-by: codex <[email protected]>
2026-06-20 10:41:13 -07:00
Julius Marmingeandcodex 86db35ca61 [codex] Structure mobile native static-check failures (#3302)
Co-authored-by: codex <[email protected]>
2026-06-20 10:40:55 -07:00
Julius Marmingeandcodex 97e5cd3bf7 [codex] align server auth Effect services (#3180)
Co-authored-by: codex <[email protected]>
2026-06-20 01:34:52 -07:00
Julius Marmingeandcodex b19fc1b87b [codex] refactor desktop Electron Effect services (#3178)
Co-authored-by: codex <[email protected]>
2026-06-20 01:24:04 -07:00
Julius Marmingeandcodex 2fa37ec183 [codex] Enforce canonical Node namespace imports (#3238)
Co-authored-by: codex <[email protected]>
2026-06-20 01:06:37 -07:00
ss db27502aff [fix/feat:ui] Capitalize Work Log heading (#3228) 2026-06-20 00:52:38 -07:00
ss 6c5fb7930d [fix/feat:ui] Use shared button for model favorites (#3223) 2026-06-20 00:40:57 -07:00
ss 30acfa9c51 [fix/feat:ui] Fix clipped chatbar provider badge (#3224) 2026-06-20 00:39:54 -07:00
Julius Marmingeandcodex f58b6da230 [codex] Preserve workspace RPC error messages (#3222)
Co-authored-by: codex <[email protected]>
2026-06-20 00:39:04 -07:00
Julius Marmingeandcodex 9a1c4875a3 [codex] Remove redundant Effect type annotations (#3229)
Co-authored-by: codex <[email protected]>
2026-06-20 00:37:47 -07:00
Julius Marmingeandcodex 7eda6ba5fc [codex] Migrate desktop shell and SSH Effect services (#3194)
Co-authored-by: codex <[email protected]>
2026-06-20 00:36:41 -07:00
Julius Marmingeandcodex c00e721c04 [codex] Refactor client runtime Effect services (#3200)
Co-authored-by: codex <[email protected]>
2026-06-20 07:17:29 +00:00
Julius Marmingeandcodex b0a3a50448 [codex] Refactor project and workspace Effect services (#3190)
Co-authored-by: codex <[email protected]>
2026-06-20 00:12:46 -07:00
Julius MarmingeandJulius Marminge 79c57170c7 [codex] Make settings environment-scoped by default (#3216)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-20 00:08:32 -07:00
Julius Marmingeandcodex 3900c45f25 Preserve observable Effect error semantics (#3220)
Co-authored-by: codex <[email protected]>
2026-06-19 23:49:51 -07:00
Wout StiensandCodex 8d61172f8b Cosmetic fix: Sync web title with nightly server branding (#3219)
Co-authored-by: Codex <[email protected]>
2026-06-19 23:49:33 -07:00
Julius MarmingeandJulius Marminge dc82f792c3 [codex] Close right panel when its last tab closes (#3221)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-19 23:48:41 -07:00
Julius MarmingeandJulius Marminge 335e0b59ea Fix PR creation from origin-based worktrees (#3218)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-19 23:38:54 -07:00
Julius Marmingeandcodex 2fbbe68c24 Clarify Effect error discriminator modeling (#3217)
Co-authored-by: codex <[email protected]>
2026-06-19 23:27:15 -07:00
Julius Marmingeandcodex 65385c0281 [codex] Refactor desktop settings Effect services (#3188)
Co-authored-by: codex <[email protected]>
2026-06-19 22:59:43 -07:00
Julius Marmingeandcodex 6d2dae0627 Preserve full cause chains in Effect error checks (#3215)
Co-authored-by: codex <[email protected]>
2026-06-20 05:53:48 +00:00
Julius Marmingeandcodex 10a8d3fbd9 Tighten structural Effect error checks (#3213)
Co-authored-by: codex <[email protected]>
2026-06-20 05:39:21 +00:00
Julius Marmingeandcodex 0ad1e9d9e4 [codex] Refactor client-runtime Effect services (#3198)
Co-authored-by: codex <[email protected]>
2026-06-19 22:31:45 -07:00
Julius Marmingeandcodex 2f8d3baa88 [codex] finish server process and preview Effect cleanup (#3209)
Co-authored-by: codex <[email protected]>
2026-06-19 22:21:58 -07:00
Julius Marmingeandcodex 6b74476322 Add Effect service conventions check (#3212)
Co-authored-by: codex <[email protected]>
2026-06-19 22:16:45 -07:00
Julius Marmingeandcodex d9e9539862 [codex] Migrate server source control Effect services (#3186)
Co-authored-by: codex <[email protected]>
2026-06-19 22:13:36 -07:00
Julius Marmingeandcodex 7118e43d16 [codex] Refactor checkpointing Effect services (#3181)
Co-authored-by: codex <[email protected]>
2026-06-19 22:05:35 -07:00
Julius Marmingeandcodex 4e8ee13d8f [codex] Align terminal Effect service modules (#3193)
Co-authored-by: codex <[email protected]>
2026-06-19 21:59:32 -07:00
Julius Marmingeandcodex b17b6d50c5 [codex] Complete relay agent activity Effect cleanup (#3210)
Co-authored-by: codex <[email protected]>
2026-06-19 21:37:43 -07:00
Julius Marmingeandcodex ccf8331600 [codex] Align diagnostics and telemetry Effect services (#3189)
Co-authored-by: codex <[email protected]>
2026-06-19 21:29:25 -07:00
Julius Marmingeandcodex ffae12f329 [codex] refactor desktop backend Effect services (#3192)
Co-authored-by: codex <[email protected]>
2026-06-19 21:23:54 -07:00
Julius Marmingeandcodex 01cd564557 [codex] Align desktop preview Effect services (#3199)
Co-authored-by: codex <[email protected]>
2026-06-19 21:22:04 -07:00
Julius Marmingeandcodex 4ee719a094 [codex] refactor server cloud Effect services (#3183)
Co-authored-by: codex <[email protected]>
2026-06-19 21:21:15 -07:00
Julius Marmingeandcodex 01492ebd3b [codex] Refactor agent awareness relay service (#3197)
Co-authored-by: codex <[email protected]>
2026-06-19 21:18:55 -07:00
Julius Marmingeandcodex 93fd972108 [codex] Refactor desktop window and update Effect services (#3202)
Co-authored-by: codex <[email protected]>
2026-06-19 21:17:56 -07:00
Julius Marmingeandcodex df1540f3ac [codex] align persistence Effect service modules (#3184)
Co-authored-by: codex <[email protected]>
2026-06-19 21:14:18 -07:00
Julius Marmingeandcodex d5a72d5be1 [codex] align relay agent activity Effect services (#3179)
Co-authored-by: codex <[email protected]>
2026-06-19 21:13:01 -07:00
Julius Marmingeandcodex 742dd7af0d [codex] Standardize Effect protocol adapter services (#3201)
Co-authored-by: codex <[email protected]>
2026-06-19 21:11:33 -07:00
Julius Marmingeandcodex 5c1ac92257 [codex] normalize server process and preview Effect services (#3191)
Co-authored-by: codex <[email protected]>
2026-06-19 21:09:22 -07:00
Julius Marmingeandcodex 8bfdacf206 [codex] Use namespace imports for desktop core services (#3207)
Co-authored-by: codex <[email protected]>
2026-06-19 21:04:49 -07:00
Julius Marmingeandcodex b6302784f8 [codex] Refactor review and text generation services (#3196)
Co-authored-by: codex <[email protected]>
2026-06-19 21:04:13 -07:00
Yash Singh 9544e72d08 chore: run eas only when labelled (#3208) 2026-06-20 03:28:51 +00:00
Julius Marmingeandcodex 938b19a6bb [codex] Normalize Desktop IPC Effect service (#3203)
Co-authored-by: codex <[email protected]>
2026-06-20 03:10:33 +00:00
Julius Marmingeandcodex 3b56dc17a5 [codex] Refactor primary HTTP Effect service (#3205)
Co-authored-by: codex <[email protected]>
2026-06-19 20:07:29 -07:00
Julius Marminge d2c0a6a48f Add diff scope switching and provider update settings (#3169) 2026-06-19 20:02:20 -07:00
Julius Marmingeandcodex 1cf3647da6 [codex] Normalize server core Effect service modules (#3187)
Co-authored-by: codex <[email protected]>
2026-06-19 19:58:48 -07:00
Julius Marmingeandcodex 53d0107759 [codex] align relay foundation Effect services (#3182)
Co-authored-by: codex <[email protected]>
2026-06-19 19:56:36 -07:00
Julius Marmingeandcodex 60b16d1f28 [codex] Refactor desktop app Effect services (#3185)
Co-authored-by: codex <[email protected]>
2026-06-19 19:42:41 -07:00
Julius Marmingeandcodex ab0baaa886 [codex] Inline contracts request-context service shapes (#3204)
Co-authored-by: codex <[email protected]>
2026-06-20 02:34:44 +00:00
Julius Marminge 753bc4672d Harden preview ownership and option-based secret handling (#3172) 2026-06-19 17:38:45 -07:00
Julius Marmingeandcodex e29ad7604b Unify mobile typography tokens across the app (#3162)
Co-authored-by: codex <[email protected]>
2026-06-19 16:49:35 -07:00
Julius Marminge cdaba7fa8b Share thread state idle TTL across client atoms (#3163) 2026-06-19 13:15:19 -07:00
Julius MarmingeandJulius Marminge fbf6263876 Only show enabled providers in picker sidebar (#3168)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-19 19:14:06 +00:00
c08b968f4e Use Effect schema decoders for JSON parsing (#3060)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-19 11:48:24 -07:00
Icarus Wingsandcodex d9f59be704 feat(sidebar): worktree indicator on session rows (#3057)
Co-authored-by: codex <[email protected]>
2026-06-19 11:23:47 -07:00
a4446e263d Improve idiomatic Effect usage in config and Tailscale paths (#3073)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-19 11:21:39 -07:00
Icarus Wingsandcodex 494350cc0b feat(composer): clickable PR pill next to branch selector (#3065)
Co-authored-by: codex <[email protected]>
2026-06-19 11:20:59 -07:00
Wout Stiensandcodex 7dc182337c [codex] fix: show nightly badge from primary web server version (#3103)
Co-authored-by: codex <[email protected]>
2026-06-19 11:16:37 -07:00
13917df1fe Use idiomatic Effect options for server secret reads (#3110)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-19 11:15:35 -07:00
Ulises Britosandcodex 5d4e2fae01 feat: allow disabling provider update checks (#3130)
Co-authored-by: codex <[email protected]>
2026-06-19 11:07:23 -07:00
Julius Marmingeandcodex 3e01c4bc57 Migrate desktop auth to Clerk bridge (#3092)
Co-authored-by: codex <[email protected]>
2026-06-19 10:28:28 -07:00
Mika CohenandJulius Marminge 20f37f367a Avoid repeated theme DOM sync during startup (#2779)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-19 05:46:12 +00:00
Soorria SaruvaandCursor 804d44cfb1 fix(ssh): fix support for remotes that use fnm (#2641)
Co-authored-by: Cursor <[email protected]>
2026-06-18 22:45:04 -07:00
Ishan 0651af92b8 fix(server): use bound host for MCP endpoint (#3114) 2026-06-18 20:41:14 -07:00
Julius Marminge 52a24c8902 Add origin-based worktree bootstrap option (#3157) 2026-06-18 20:39:52 -07:00
30034ecedc Add archived threads and mobile file viewer (#3155)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-18 20:24:48 -07:00
Mike Olson 1fcc57af13 fix(web): Remove saved environments atomically (#2917) 2026-06-18 20:20:53 -07:00
Julius Marmingeandcodex e95b57dc26 [codex] Rewrite client connection architecture (#2978)
Co-authored-by: codex <[email protected]>
2026-06-18 13:10:32 -07:00
Theo BrowneandClaude Opus 4.8 3bdaa6e100 Polish marketing homepage: nav, hero, and endorsements (#3137)
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-17 23:23:14 -07:00
Wout StiensandJulius Marminge b7b00bfb9d fix: Adapt destructive menu icon to dark mode (#3126)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-18 05:43:47 +00:00
Ryan Skinner ae2b523503 fix(mobile): bump react-native-shiki-engine to 0.3.12 (#3120) 2026-06-17 22:33:01 -07:00
Andrew Forster 75b3b3c48a [codex] Make background VCS fetch non-interactive (#3133) 2026-06-17 22:49:09 +00:00
Julius Marminge b489ea52a8 Improve inline panel, file preview, and MCP session handling (#3121) 2026-06-16 22:40:22 -07:00
Julius Marmingeandcodex 3a5ec9464b Render the plan surface in the inline right panel (#3118)
Co-authored-by: codex <[email protected]>
2026-06-16 17:30:22 -07:00
Julius Marminge e56bb200fa Add right-panel bulk close and tab context menu actions (#3116) 2026-06-16 16:39:40 -07:00
Julius Marminge c2ca9de33a Add file preview comments and task toggles (#3115) 2026-06-16 16:22:18 -07:00
Icarus WingsandClaude Opus 4.8 60b546cf01 Double-click a sidebar thread row to rename (#3064)
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-16 11:04:47 -07:00
Jan JaapandClaude Haiku 4.5 4b73827334 fix(settings): disable auto-open of task sidebar by default (#2421)
Co-authored-by: Claude Haiku 4.5 <[email protected]>
2026-06-16 10:58:27 -07:00
Julius Marminge a5efb7cb6b Parallelize VCS status refresh and status reads (#3112) 2026-06-16 10:54:00 -07:00
Julius Marminge 8f9911f79d Add DELETE-based MCP session termination (#3113) 2026-06-16 10:53:25 -07:00
Julius Marmingeandcodex 689a882045 [codex] Add native mobile composer and markdown (#3101)
Co-authored-by: codex <[email protected]>
2026-06-16 09:31:57 -07:00
Julius Marminge 85fe62d402 Stage fff native binaries in desktop builds (#3109) 2026-06-16 09:12:32 -07:00
Julius Marmingeandcodex 708d5383a9 [codex] Trace first-party relay clients (#2995)
Co-authored-by: codex <[email protected]>
2026-06-16 00:11:29 -07:00
Wout Stiens 5cd2744100 [codex] Fix terminal line height for QR readability (#3096) 2026-06-16 07:08:17 +00:00
Julius Marminge d12da198ad Use fff for workspace search queries (#3099) 2026-06-16 00:02:03 -07:00
d0a7d18cdb [codex] Fix first browser annotation capture (#3095)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-16 00:10:28 +00:00
Julius Marminge 71ea5fa1ab Show disabled reasons for unavailable right panel surfaces (#3093) 2026-06-15 23:21:06 +00:00
Julius Marminge 9d5e632d4d Tighten workspace control spacing in the header
- Align header controls with the 12px right inset
- Use a smaller control offset in window controls overlay mode
2026-06-15 16:05:36 -07:00
Julius Marminge c2d44a312c Unify compact subheaders and diff file navigation
- Add shared compact subheader styling for preview, file, and diff panels
- Open diff files in the thread file viewer when available
- Fix macOS cursor auto-hide and Option-modified shortcut matching
2026-06-15 15:58:03 -07:00
Julius Marminge de8bdc10fa Add workspace file browser and preview panel (#3087) 2026-06-15 14:17:07 -07:00
477795697d refactor: resolve host process state through Effect (#2959)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-14 16:47:56 -07:00
Icarus Wings a23b83314e fix(desktop): mac start:desktop crash from rewritten framework symlinks (#3058) 2026-06-14 18:52:22 +00:00
Julius Marminge ce90563709 Preserve diff surface when toggling right panel (#3083) 2026-06-14 11:41:36 -07:00
Julius Marminge 31e68229d6 Wrap authorized clients in fading scroll area (#3085) 2026-06-14 11:41:26 -07:00
Julius Marminge 1db585878e Guard VCS status updates against stale targets (#3084) 2026-06-14 11:41:12 -07:00
JustMarkDev 56e57de947 Fix Bitbucket source control availability toggle 2026-06-14 11:07:19 -07:00
Julius Marminge 3a0623f1cd rm test artifacts 2026-06-13 22:18:37 -07:00
Julius Marminge cd91ec75f3 Remove outdated plans for shared HTTP MCP server and visible preview browser automation via CDP. Consolidate and refine the architecture and process models for the new preview automation framework, including updated contracts, server-side broker, and desktop integration. Introduce new WS methods for client communication and enhance security measures for token management. Ensure comprehensive testing strategies are in place for all components. 2026-06-13 22:18:37 -07:00
Julius Marminge d4ba9e9618 Document browser preview phase 0.5 findings and plans
- Add phase 0 and 0.5 ADRs, findings, and spike notes
- Update browser preview docs and supporting UI/test files
- Record the chosen renderer, automation, recording, tunnel, and input decisions
2026-06-13 22:18:37 -07:00
Julius Marminge c1792bc9a6 Use real preview tooltips 2026-06-13 22:18:37 -07:00
Julius Marminge 1b4317ec35 Restore terminal drawer header toggle 2026-06-13 22:18:37 -07:00
Julius Marminge f452d63fef Fix terminal browser test mock 2026-06-13 22:18:37 -07:00
Julius Marminge 18a49abcec Fix preview CI test fixtures 2026-06-13 22:18:37 -07:00
Julius Marminge 85d5df6256 Unify browser asset preview routing
- Replace attachment and favicon routes with signed asset URLs
- Harden workspace and attachment asset resolution
- Update browser preview components and shared contracts
2026-06-13 22:18:37 -07:00
Julius Marminge b5b769dddf Prevent stale preview snapshots from resurrecting sessions
- Track preview store revisions per thread
- Ignore stale SWR results while revalidating
- Avoid restoring closed sessions from outdated data
2026-06-13 22:18:37 -07:00
Julius Marminge 3c7862edd7 Add SWR preview session state and resubscribe handling
- Fetch preview sessions through atom-backed SWR state
- Recover browser preview sessions after reconnects
- Ignore older streamed snapshots when SWR revalidates
2026-06-13 22:18:37 -07:00
Julius Marminge d8fe3d72c8 Scope preview listeners and control sessions
- Tie preview and debugger listeners to Effect scopes
- Factor shared automation helpers for snapshot and input handling
- Improve cleanup for browser preview sessions and port scanning
2026-06-13 22:18:37 -07:00
Julius Marminge 70ec39ae80 Port preview manager to Effect-based browser sessions
- derive preview partitions through `BrowserSession`
- serialize session state and async preview control flow
- update tests for screenshot, automation, and partition behavior
2026-06-13 22:18:37 -07:00
Julius Marminge 3d9e8dea7d Refactor desktop preview IPC onto shared manager
- Move preview session and IPC wiring into the new preview module
- Tighten IPC validation with schema-based handlers
- Update preview asset paths and tests for the browser preview port
2026-06-13 22:18:37 -07:00
Julius Marminge f7c422d581 Refactor MCP services into top-level modules
- Move MCP session registry and preview broker out of `Layers/` and `Services/`
- Update imports, tests, and server wiring to use the new module layout
2026-06-13 22:18:37 -07:00
Julius Marminge dd739c880d Port browser preview annotations to desktop
- Add IPC and runtime plumbing for preview annotation theming
- Generate and ship annotation CSS for the desktop overlay
- Add pointer and artifact handling for browser preview interactions
2026-06-13 22:18:37 -07:00
Julius Marmingeandcodex 6c6740e381 Refine collaborative browser preview
Co-authored-by: codex <[email protected]>
2026-06-13 22:18:37 -07:00
Julius Marminge 29150b5736 Add shared MCP preview automation 2026-06-13 22:18:37 -07:00
Julius Marmingeandcodex 07c6d70b91 Add preview annotation capture tooling
- Add structured annotation payload validation and tests
- Update preview preload to capture selected elements, regions, and strokes
- Wire new preview annotation UI into the web app

Co-authored-by: codex <[email protected]>
2026-06-13 22:18:37 -07:00
Julius Marmingeandcodex 50bc18b208 fix(preview): declare RPC authorization scopes
Co-authored-by: codex <[email protected]>
2026-06-13 22:18:37 -07:00
Julius Marmingeandcodex 63d42a5e58 fix(preview): initialize and open browser reliably
Co-authored-by: codex <[email protected]>
2026-06-13 22:18:37 -07:00
Julius Marmingeandcodex 9b43123ba2 fix(preview): port browser preview to current main
Co-authored-by: codex <[email protected]>
2026-06-13 22:18:37 -07:00
Aiden Bai 17fb0e4a9a feat(preview): element-pick attachments + sandboxed picker preload
Adds an in-page element picker to the preview browser. Clicking the
crosshair button in the chrome row activates a blue-highlight picker
inside the guest webview; clicking an element captures its component
name (via react-grab), source location, html/css preview, and selector,
then attaches it to the chat composer as a chip that serializes into an
`<element_context>` block in the outgoing message.

Architecture:
- Per-`<webview>` preload bundle (`preview-pick-preload.cjs`) renders
  the overlay, hosts the picker event loop, and bubbles the picked
  payload back to main via the per-WebContents `wc.ipc` channel (not
  `sendToHost`, which only fires on the host renderer's <webview>
  element and never reaches main).
- Main coordinates via `PreviewViewManager.pickElement(tabId)`, which
  cancels any in-flight session, force-focuses the guest (so the first
  click on a remote page actually reaches the preload), then awaits the
  payload. User-initiated cancels (Escape, beforeunload) echo `null`
  back to main; main-initiated cancels and supersession tear down
  silently to avoid the new-pick-resolves-with-stale-null race.
- Renderer fetches partition + webPreferences + preload URL in a single
  `getPreviewConfig()` IPC call, snapshots the previously-focused host
  element before triggering a pick, and restores focus when the pick
  resolves so the user's textarea cursor isn't lost.

Security posture for the guest webview:
- `webpreferences="contextIsolation=false,sandbox=true,nodeIntegration=false"`
  centralized in `preview-webview-preferences.ts`. contextIsolation off
  is required so react-grab's `getElementContext` can reach the page's
  React DevTools hook on `globalThis`. sandbox stays on so the page
  cannot reach Node APIs even with shared globals (without it, the
  preload's `require` would land on the page's `globalThis` and any
  third-party site could send arbitrary IPC to main).
- Defense in depth: a `will-attach-webview` handler in main, gated on
  the preview partition, force-pins `sandbox: true`, all
  `nodeIntegration*: false`, and the absolute preload PATH (not URL —
  that field rejects file:// URLs with "preload script must have
  absolute path" and silently disables the picker).

Composer + transcript integration:
- New `elementContexts` slice in `composerDraftStore` (mirrors the
  terminal-context slice: dedup by selector+tag+component+url, persist
  via partializer, restore on send-failure retry).
- `ComposerPendingElementContexts` chip row above the editor.
- `deriveDisplayedUserMessageState` now strips both `<element_context>`
  AND `<terminal_context>` blocks (element first, since it's appended
  last) and exposes element entries to `MessagesTimeline`, which renders
  them as compact chips beneath the message body.
- Pick button is disabled with explanatory tooltip when the page failed
  to load (the React `<PreviewUnreachable>` overlay covers the webview,
  so picks would silently dangle otherwise).

Tests added:
- `preview-webview-preferences.test.ts` locks down the security flags
  (contextIsolation=false, sandbox=true, nodeIntegration=false, no
  whitespace, only true/false literal values).
- `preview-pick-label-position.test.ts` covers the floating-label
  clamp/flip math (no off-screen overflow, flip-below when no room
  above, etc.).
- `picked-element-payload.test.ts` validator coverage.
- `elementContext.test.ts` for the serialization round-trip,
  normalization, dedup, and label formatting.
- `composerDraftStore.test.ts` element-contexts slice (add, dedup,
  remove, set, clear, persistence round-trip).
- `ChatView.logic.test.ts` sendable-content-with-element-only.

Build: new `tsdown` entry inlines react-grab + bippy into the picker
preload bundle (~59KB / 19KB gzipped).
2026-06-13 22:18:37 -07:00
Aiden Bai 43e8bbd7ae fix 2026-06-13 22:18:37 -07:00
Aiden Bai 52c77c1ec4 feat(preview): in-app browser preview panel
Adds a desktop-only browser preview that lives in the right panel slot
alongside plan/diff. Lets the user point an Electron <webview> at any
URL — typed into a chrome-style URL bar, clicked from the empty-state
list of detected localhost dev servers, or auto-opened by a project
script with `previewUrl` set. Single-tab per thread.

Server (Effect/Layers):
- PreviewManager: per-(thread, tab) session metadata via SynchronizedRef
  + PubSub<PreviewEvent>; survives WS reconnect via `list`/replay.
- PreviewPortScanner: lsof on macOS/Linux, TCP probe fallback on
  Windows; reference-counted polling so we only scan when subscribed.
- WS RPC + streams (`preview.open|navigate|refresh|close|list|reportStatus`,
  `subscribePreviewEvents`, `subscribeDiscoveredLocalServers`).

Desktop:
- PreviewViewManager owns Chromium WebContents per tab, mediates
  navigation/zoom/devtools/clear-storage. registerWebview gates by
  webContents.getType() === "webview" and host-window match.
- IPC channels for create/close/register/navigate/back/forward/refresh/
  zoom/hardReload/openDevTools/clearCookies/clearCache/getBrowserPartition.
- Forwards app-level shortcuts (mod+shift+J, mod+K, mod+,, mod+W) from
  the webview back to the main window.
- Persisted browser session partition (cookies, cache).

Web:
- PreviewPanel/PreviewView/PreviewWebview render the surface; chrome row
  with back/forward/refresh + URL input + Open-in-browser + 3-dot menu
  (Hard reload, DevTools, Zoom −/+/reset, Clear cookies/cache).
- usePreviewSession subscribes to server events; usePreviewBridge
  mirrors desktop state into the store and forwards Loading→Success/
  LoadFailed back to the server.
- previewStateStore: per-thread snapshot + desktopOverlay + recently-
  seen URLs (Zustand).
- rightPanelStore arbitrates plan vs. preview vs. diff; ChatView's
  toggles strip the `?diff=1` URL hint when switching to preview and
  vice versa so the panels are mutually exclusive.
- Top-nav Globe toggle in ChatHeader (desktop builds only) and a
  `mod+shift+J` keybinding routed via a typed previewActionBus.
- PreviewEmptyState lists detected localhost servers (scanner +
  configured project URLs + recently-seen) with live "listening" pulse.
- PreviewUnreachable: theme-aware port of Chromium's "site can't be
  reached" page.
- Resizable inline panel (RightPanelResizeHandle + useResizableWidth);
  width persists to localStorage on drag-end.
- Terminal link "Open in preview" context-menu integration for loopback
  URLs.

Contracts:
- preview.ts schemas (PreviewSessionSnapshot, PreviewNavStatus,
  PreviewEvent, RPC inputs/results, DiscoveredLocalServer).
- ProjectScript schema gains optional `previewUrl` + `autoOpenPreview`.
- New keybinding commands: preview.toggle/refresh/focusUrl/zoomIn/Out/
  resetZoom; new `when:` contexts `previewFocus` / `previewOpen`.

Shared:
- @t3tools/shared/preview: normalizePreviewUrl, isPreviewableUrl,
  isLoopbackHost, newPreviewTabId, LSOF_LOCAL_HOST_TOKENS.

Tests:
- contracts: schema decode tests for all preview events/snapshots/inputs.
- shared: URL normalization coverage.
- server: PreviewManager (open/navigate/reportStatus/refresh/close,
  multi-subscriber isolation, idempotency); PortScanner (lsof parsing
  including IPv6, TCP probe, reference-counted polling).
- web: previewStateStore (per-tab event application, dedupe,
  reconnect recovery); rightPanelStore arbitration.
2026-06-13 22:18:37 -07:00
Aiden Bai d6eb386e3d planning 2026-06-13 22:18:37 -07:00
HuakunandJulius Marminge d25090cf6d fix: avoid sending composer during IME enter (#2817)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-12 02:14:13 +00:00
Mika CohenandJulius Marminge ae39bacf0e Handle non-resumable pending user input (#2766)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-12 02:13:34 +00:00
Julius MarmingeandJulius Marminge 1ea17026ee [codex] fix slow websocket shutdown (#2869)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-12 01:39:25 +00:00
Julius Marmingeandcodex 649f4328ea [codex] Refine inline tool call timeline UI (#3052)
Co-authored-by: codex <[email protected]>
2026-06-11 18:18:27 -07:00
Magnus Alexander StrømsengandJulius Marminge 7db034905b fix(git): disable external diff for patch output (#2553)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-11 18:18:13 -07:00
Julius MarmingeandClaude Fable 5 57f6bf7edb Fix turn fold proejctions (#3041)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-06-10 23:51:43 -07:00
Julius Marmingeandcodex 0baf1986e8 [codex] Reduce Git status polling churn (#3037)
Co-authored-by: codex <[email protected]>
2026-06-10 17:10:19 -07:00
Julius Marmingeandcodex ae7e88b0e0 [codex] Sync app-server protocol, service tiers, and provider startup (#3036)
Co-authored-by: codex <[email protected]>
2026-06-10 16:24:19 -07:00
1916ac6d55 Rework message metadata, timestamps, and tool work log rows (#3022)
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
2026-06-10 14:38:42 -07:00
Julius Marmingeandcodex 343061a053 Misc chrome polish: header badges, plan sidebar, diff panel, empty state (#3027)
Co-authored-by: codex <[email protected]>
2026-06-10 12:25:03 -07:00
0b40ea62e1 Extract changed files card with compact aligned diff stats (#3023)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-10 08:27:32 +00:00
a4757c2656 Composer polish: focus ring, send/stop buttons, command menu, context meter, answer panel (#3018)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: codex <[email protected]>
2026-06-10 08:02:32 +00:00
3efabdcd3a Polish web context menu fallback and sidebar icon actions (#3025)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-10 07:29:21 +00:00
c5f7cd40ba Polish branch picker trigger, scroll fade, and list layout (#3024)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-06-10 07:13:34 +00:00
e2db800f7c Provider env vars table and reworked accent color picker (#3026)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-09 23:27:59 -07:00
31533466b0 Model picker UI Improvements, Virtualize Model List (#3021)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-10 06:22:55 +00:00
7f741a56d1 Misc markdown styling improvements (#3017)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-06-09 21:21:58 -07:00
RuzbyteandJulius Marminge cc9e81ac93 fix(marketing) : marketing showing wrong icons on linux (#2696)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-09 20:04:36 -07:00
238715fd6f Polish dialog/alert surfaces and unauthenticated provider banner (#3016)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-09 17:52:16 -07:00
b03bc4b52d Mute icons in labeled controls and suppress popup focus rings (#3015)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-09 17:15:09 -07:00
aca14507f7 Bundle DM Sans and JetBrains Mono fonts instead of Google Fonts (#3014)
Co-authored-by: ss <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
2026-06-09 16:57:38 -07:00
t3-code[bot] 04f7f32ace chore(release): prepare v0.0.27 2026-06-09 21:14:36 +00:00
Julius Marmingeandcodex a3422a9bb5 Fix Clerk browser test mock (#3013)
Co-authored-by: codex <[email protected]>
2026-06-09 20:38:20 +00:00
Julius Marmingeandcodex 22f9f3058b [codex] Rebrand T3 Cloud as T3 Connect (#3011)
Co-authored-by: codex <[email protected]>
2026-06-09 12:25:02 -07:00
t3-code[bot] 983a8c7fa6 chore(release): prepare v0.0.26 2026-06-09 17:53:22 +00:00
Julius Marmingeandcodex de58ec8e24 Add Claude Fable 5 model (#3009)
Co-authored-by: codex <[email protected]>
2026-06-09 17:39:18 +00:00
Julius Marmingeandcodex 8e6f4229da [codex] Fix main CI Effect test runtimes (#3008)
Co-authored-by: codex <[email protected]>
2026-06-09 09:43:03 -07:00
Milosz JankiewiczandJulius Marminge 38ea6d483e feat(grok): add Grok CLI provider via ACP (#2809)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-09 09:28:40 -07:00
Julius Marmingeandcodex 0e4a43519f [codex] Extract infrastructure, telemetry, and test tooling (#2994)
Co-authored-by: codex <[email protected]>
2026-06-07 20:21:47 -07:00
Julius Marmingeandcodex 3ea6adf17d [codex] Enrich relay authorization diagnostics (#2977)
Co-authored-by: codex <[email protected]>
2026-06-05 18:01:34 -07:00
Julius Marminge a56496c7f2 Annotate relay error spans with schema fields (#2976) 2026-06-05 16:35:14 -07:00
b76f161d55 fix(desktop): stop looping macOS TCC permission prompts (#2745)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-06-05 12:07:18 -07:00
Peter Hozák 75257d64e9 "claude system message" instead of "runtime warning" when using 4.8 from claude code (#2972) 2026-06-05 11:27:37 -07:00
Abdul AzeezandJulius Marminge e1ce9f8500 fix: handle Claude Agent SDK 0.3.x system messages to stop runtime-warning flood (#2872)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-05 18:26:32 +00:00
Julius Marminge 602148f8fe fix(cloud): use Electron fetch for proxying Clerk IPC requests (#2973) 2026-06-05 11:08:34 -07:00
Julius Marminge 92be60e7c1 include @latest 2026-06-04 23:01:09 -07:00
Julius Marminge 0d6e9e9add we support cursor, duhhh 2026-06-04 23:00:40 -07:00
Julius Marminge 8ab58a0b26 tip 2026-06-04 22:59:28 -07:00
Julius Marminge 6f42bd9c88 cleanup 2026-06-04 22:58:53 -07:00
Julius Marminge 5b26bd408b link 2026-06-04 22:57:04 -07:00
Julius Marminge c04d15d3be document vp instead of mise 2026-06-04 22:56:18 -07:00
Julius Marminge 9da430c828 Refactor recoverable Effect fallbacks to orElseSucceed (#2968) 2026-06-05 05:47:56 +00:00
Julius Marminge a084fbbc0a Remove duplicate 'publish' argument in CLI script 2026-06-04 22:39:59 -07:00
Julius Marminge b870a6e349 Rename function for publishing arguments to vp pm (#2967) 2026-06-05 05:22:37 +00:00
Julius Marminge e1cb19b55b Use pnpm for server publish workflow (#2966) 2026-06-04 22:16:52 -07:00
Julius Marminge 94fc117561 publish deploy status on relay deploy workflow 2026-06-04 21:47:12 -07:00
Julius Marminge 113b9d84c7 remove vp staged 2026-06-04 21:41:54 -07:00
Julius Marminge f60def2054 Migrate tests to vite-plus test APIs (#2964) 2026-06-05 04:39:19 +00:00
Julius Marminge eda163ca17 bump alchemy to fix drizzle schema out attempt 2 2026-06-04 21:03:05 -07:00
Julius Marminge 3579005114 bump alchemy to fix absolute drizzle schema out 2026-06-04 20:45:34 -07:00
Julius Marminge af3dfd229e forward args directly 2026-06-04 20:19:06 -07:00
Julius Marminge 969e6d274c implicit install from vp 2026-06-04 20:16:56 -07:00
Julius Marminge 769bdd251d fallback to None when RELAY_DOMAIN is unset 2026-06-04 20:16:23 -07:00
Julius Marminge 295b9db113 dont fail if env-file is unspecified 2026-06-04 20:12:42 -07:00
Julius Marminge b5a62504d4 move 2026-06-04 20:05:30 -07:00
Julius Marminge ec18938bf9 Restructure documentation into topical folders (#2963) 2026-06-04 20:03:12 -07:00
Julius Marmingeandcodex 5ae77c0d63 feat(relay): Add managed relay tunnels and APN service (#2837)
Co-authored-by: codex <[email protected]>
2026-06-04 19:53:56 -07:00
Julius MarmingeandJulius Marminge 300f7fd11d [codex] Avoid shell for system executables (#2950)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 15:25:46 -07:00
Guilherme Vieira 53042f47f8 fix(composer): support spaces in file mentions (#2625) 2026-06-04 15:19:06 -07:00
Julius MarmingeandJulius Marminge 6ce6f678b5 [codex] Avoid shell for Windows environment probe (#2951)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 15:15:26 -07:00
Julius MarmingeandJulius Marminge a74dfd4f3c [codex] Avoid shell for Node executable spawns (#2952)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 15:14:07 -07:00
Guilherme VieiraandJulius Marminge 49c1b64687 fix(source-control): handle self-hosted GitLab, multi-account GitHub auth & azure devops web url (#2480)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 15:13:04 -07:00
Julius MarmingeandJulius Marminge dfdb5a46db [codex] fix release finalize install (#2961)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 21:57:43 +00:00
Julius Marminge b0fa60a121 Prevent settings layout shifts with scrollbar gutters (#2960) 2026-06-04 14:31:24 -07:00
Julius MarmingeandJulius Marminge 348a9140e9 fix(cli): bundle patched diff parser dependency (#2957)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 18:53:47 +00:00
Julius Marminge 9fc485afaf fix(release): install hosted web workspace closure (#2949) 2026-06-04 17:31:54 +00:00
Julius Marmingeandcodex a6edad1974 [codex] Filter staged desktop patched dependencies (#2945)
Co-authored-by: codex <[email protected]>
2026-06-03 23:47:20 -07:00
Julius Marmingeandcodex 203f58e456 [codex] Fix desktop packaging patched dependencies (#2944)
Co-authored-by: codex <[email protected]>
2026-06-04 06:34:21 +00:00
Julius MarmingeandJulius Marminge 52ae8e88df fix(release): preserve desktop artifact arch (#2943)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 06:29:19 +00:00
Julius MarmingeandJulius Marminge 80b40ce96a [codex] fix mobile native static analysis source discovery (#2942)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 23:13:01 -07:00
Julius MarmingeandJulius Marminge 4c262c4b4e [codex] split ci workflow jobs (#2940)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 22:57:42 -07:00
Julius MarmingeandJulius Marminge 4f3d00f063 fix(release): install dependency closures in partial jobs (#2941)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 05:54:33 +00:00
Julius MarmingeandJulius Marminge 37bf0f0d1d [codex] remove duplicated pnpm root config (#2939)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 05:34:23 +00:00
Julius MarmingeandJulius Marminge 6a1c4da528 fix(release): use workspace electron-builder for desktop packaging (#2938)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 22:15:15 -07:00
Yash SinghandJulius Marminge dca93d0ee8 chore: setup eas ci (#2911)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 22:08:34 -07:00
Julius MarmingeandJulius Marminge 1288909b66 fix(release): surface desktop packaging subprocess output (#2937)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 20:47:20 -07:00
Julius MarmingeandJulius Marminge 30d36b8c48 ci: let setup-vp install dependencies (#2936)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 19:37:03 -07:00
Julius MarmingeandJulius Marminge e4643eccc7 fix: build web before desktop release packaging (#2934)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 19:15:06 -07:00
Mike OlsonandJulius Marminge 4956415f7f fix(desktop): Preserve SSH HTTP auth status (#2923)
Co-authored-by: Julius Marminge <[email protected]>
2026-06-04 02:10:17 +00:00
Mike Olson f5849f7d78 fix(ssh): Surface redacted stdout for failed commands (#2920) 2026-06-03 18:50:13 -07:00
Mike Olson 6e6163255d test(web): CI stability - prebundle react-dom client for browser tests (#2928) 2026-06-03 18:45:34 -07:00
b440dd1812 Migrate workspace to Vite+ and pnpm (#2899)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-06-03 16:16:53 -07:00
d78e02cd0b Probe Cursor models via list_available_models (#2428)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-06-03 17:06:52 +00:00
Mike Olson f0116e44b6 fix(desktop): Include standard Linux AppImage icons for Niri/Noctalia (#2915) 2026-06-02 20:38:29 -07:00
Julius Marmingeandcodex bd851c0203 chore: add Alchemy reference repo subtree (#2918)
Co-authored-by: codex <[email protected]>
2026-06-03 00:08:31 +00:00
Julius Marmingeandcodex a04c09a190 Use HttpApi for Environment APIs & standardize authn/authz (#2858)
Co-authored-by: codex <[email protected]>
2026-06-02 15:20:30 -07:00
Julius Marmingeandcodex e3f1405884 chore: add vendored reference repo subtree sync tooling (#2902)
Co-authored-by: codex <[email protected]>
2026-06-01 21:44:23 -07:00
b3e8c0334b T3 Code Mobile [WIP] (#2013)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Yash Singh <[email protected]>
2026-05-29 17:00:54 -07:00
Julius Marminge e3accd6e95 Ensure Electron runtime is installed in release workflow (#2861) 2026-05-29 09:38:25 -07:00
cf07d06321 Extract independent web cleanup from mobile stack (#2855)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-05-28 16:50:40 -07:00
Julius Marmingeandcodex 31268945f8 Extract collection performance refactors from mobile stack (#2854)
Co-authored-by: codex <[email protected]>
2026-05-28 16:18:58 -07:00
Julius Marminge 6b3050ee74 Migrate TypeScript checks to Effect TSGo (#2851) 2026-05-28 15:59:42 -07:00
Ibrahim Elkamali 83f0cc9e31 Add Claude Opus 4.8 support (#2849) 2026-05-28 18:43:48 +00:00
Julius Marmingeandcodex e6330ead82 [codex] Bump Effect to beta.73 and migrate compatibility APIs (#2840)
Co-authored-by: codex <[email protected]>
2026-05-28 11:13:50 -07:00
Adam Buchweitz 4f0f24f055 fix: maintain reasoning selections for multiple providers (#2760) 2026-05-22 07:02:35 -07:00
t3-code[bot] d1e85c4e8f chore(release): prepare v0.0.24 2026-05-15 06:40:13 +00:00
Julius Marminge ea20e80021 Exclude workspace packages from desktop runtime deps (#2688) 2026-05-14 07:32:48 +00:00
Julius MarmingeandJulius Marminge 9e632f5cec [codex] add diagnostics resource history (#2685)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-14 09:14:32 +02:00
Julius Marminge 4120e94598 Back off VCS remote refresh failures (#2686) 2026-05-14 08:41:02 +02:00
Theo Browne 34bb18c8cf feat(marketing): Made marketing site less cringe (#2681) 2026-05-13 18:31:06 -07:00
Julius Marminge 90eea047a9 Skip healthy env reconnects after browser resume (#2677) 2026-05-13 22:29:36 +02:00
Julius Marminge f92e1e1b06 Simplify workspace package builds and deps (#2676) 2026-05-13 21:35:01 +02:00
Julius Marminge 556c42452c Harden GitHub workflow permissions
- Restrict release workflow defaults to read-only access
- Grant `id-token` only to the publish job
- Document safe handling for `pull_request_target` in PR size checks
2026-05-13 14:19:18 +02:00
Julius Marminge 7e20b23e7e Constrain provider update popover overflow (#2669) 2026-05-13 10:23:31 +02:00
Julius Marminge b83e9c95e4 Refactor composer refs and context providers (#2664) 2026-05-12 21:54:28 +02:00
a41f4895ce Reduce chat timeline activity rerenders (#2660)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-12 20:56:03 +02:00
d15909af15 Use Effect child process for editor launches (#2659)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-12 20:15:11 +02:00
447236d51f Stabilize project grouping settings selector (#2629)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-11 10:07:50 +00:00
legsandJulius Marminge 5165b8c333 Optimize VCS diff loading to be up to 98% faster (#2586)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-11 12:07:26 +02:00
Julius Marmingeandcodex 8fc317939f Preserve Codex probe results across scoped teardown (#2638)
Co-authored-by: codex <[email protected]>
2026-05-11 10:48:19 +02:00
Julius Marminge 16c69ba7ff Remove outline styling from git success toast action (#2639) 2026-05-11 08:45:40 +00:00
Julius Marminge e64c19f1af Alias stable releases to the router domain (#2636) 2026-05-11 10:41:32 +02:00
Utkarsh Patil 6ab8f93a23 fix(codex): use longer and shared auth probe timeout for provider status check (#2616) 2026-05-11 00:29:56 -07:00
t3-code[bot] b793401aee chore(release): prepare v0.0.23 2026-05-09 22:22:22 +00:00
Julius MarmingeandJulius Marminge 3c32bc8fd1 [codex] Fix hosted channel bootstrap (#2613)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-08 22:57:16 -07:00
Julius MarmingeandJulius Marminge 6efdf67e15 [codex] Fix Vercel Turbo env forwarding (#2612)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-08 22:09:40 -07:00
Julius MarmingeandJulius Marminge 39371c6012 [codex] Fix Vercel release web deploy scope (#2611)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-08 22:01:57 -07:00
Kainoa NewtonandJulius Marminge 99efaa0faa Collapse long user messages by default (#2180)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-09 02:00:03 +00:00
Julius Marminge 6b9feb1bd3 Update deployment command in release workflow (#2610) 2026-05-08 18:30:44 -07:00
Ben Vargas e0f3abd1a4 Fix remote pairing CORS responses (#2594) 2026-05-08 23:52:47 +00:00
34ec8a86fb [codex] add configurable automatic git fetch interval (#2605)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-05-08 16:41:55 -07:00
932df4ed17 fix(ssh): fix reconnect issues and node binary path resolution (#2504)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-05-08 16:17:29 -07:00
Julius MarmingeandCursor Agent 63859aa072 perf: Add archived shell snapshot support (#2593)
Co-authored-by: Cursor Agent <[email protected]>
2026-05-08 15:49:41 -07:00
Julius MarmingeandJulius Marminge 7bfacd55d8 [codex] Handle NuGet provider bootstrap failures (#2608)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-08 15:20:02 -07:00
Kiri110K 271d65e047 Fix OpenCode raw text delta assembly (#2526) 2026-05-08 13:00:24 -07:00
aa8b9f2286 Deploy hosted web app from release workflow (#2507)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-05-08 12:47:08 -07:00
Julius MarmingeandJulius Marminge 073eb389d3 [codex] Fix Windows release signing setup (#2606)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-08 12:35:52 -07:00
Julius Marmingeandcodex 825263b6f9 Scaffold oxlint plugin with initial rule (#2603)
Co-authored-by: codex <[email protected]>
2026-05-08 11:52:19 -07:00
Julius MarmingeandCursor Agent 25b02f4ba2 Enable stricter Effect LSP rules (#2596)
Co-authored-by: Cursor Agent <[email protected]>
2026-05-08 09:58:29 -07:00
Julius Marminge 131234be3f Match sticky changed-files header tint to card background (#2592) 2026-05-08 05:16:27 +00:00
7455472c34 Reduce sidebar selection rerenders (#2560)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-07 21:44:30 -07:00
Julius Marminge 9d919d0bb8 Move desktop server exposure logic into backend (#2591) 2026-05-08 04:25:33 +00:00
aa219be713 port desktop app to Effect (#2546)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: codex <[email protected]>
2026-05-07 21:17:08 -07:00
Julius Marminge dd32f52655 Refresh Codex protocol bindings and adapter mappings (#2590) 2026-05-07 19:47:20 -07:00
Julius Marmingeandcodex 31b52acc8d [codex] Fix sidebar preview settings reset (#2587)
Co-authored-by: codex <[email protected]>
2026-05-07 17:24:40 -07:00
466d8ee5b0 feat(web): add configurable sidebar thread preview count (#1856)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-07 17:12:59 -07:00
maria 11f40556de feat(web): render skill calls as inline chips (#2572) 2026-05-07 14:43:16 -07:00
1bcfc88f58 Adopt idiomatic Effect APIs in generator and decider (#2581)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-07 12:19:32 -07:00
2ba58076fa Avoid timeline timer rerender commits (#2580)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-07 11:54:46 -07:00
maria c27109cc20 feat(web): mention skills in composer placeholder (#2570) 2026-05-07 10:51:32 -07:00
Julius Marminge a74ed8ed32 Revert "Cache desktop build assets in CI and release workflows" (#2568) 2026-05-06 23:04:28 +00:00
6c79039ce7 Cache desktop build assets in CI and release workflows (#2543)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-05-06 13:55:37 -07:00
Julius Marmingeandcodex 449e1aaa48 Make changed-files header sticky in chat timeline (#2565)
Co-authored-by: codex <[email protected]>
2026-05-06 13:24:34 -07:00
22384ae977 Adopt Effect JSON and DateTime idioms (#2559)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-06 10:36:25 -07:00
Julius MarmingeandJulius Marminge 499f1463d5 Split server CLI into focused submodules (#2545)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-05 23:02:05 -07:00
a2ff50dbba Add process and trace diagnostics views (#2532)
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-05-06 04:22:50 +00:00
Minigamer42 166bce0389 Feature/intellij editors (#2475) 2026-05-06 04:12:52 +00:00
1498335e39 Optimize MessagesTimeline work row stability (#2527)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-05 20:57:33 -07:00
Julius MarmingeandJulius Marminge 25c9d267ac Stabilize git workspace and terminal tests (#2540)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-05 20:31:44 -07:00
536dcad19e Reduce timeline row rerenders (#2498)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-05 20:26:38 -07:00
Julius Marmingeandcodex 0e38870647 Add keybindings settings editor (#2533)
Co-authored-by: codex <[email protected]>
2026-05-06 00:08:52 +00:00
9b604bcae1 provider update advisories (#2312)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-05-05 15:59:51 -07:00
t3-code[bot] 35721d9a08 chore(release): prepare v0.0.22 2026-05-05 01:09:49 +00:00
shivamandJulius Marminge f4c9418d40 Add collapsible file diffs + @pierre/diffs version update. (#2502)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-04 17:06:07 -07:00
PeterandPeter van der Heijden 02dd47ea31 Fix repeated effect-language-service prepare hooks during bun install (#2497)
Co-authored-by: Peter van der Heijden <[email protected]>
2026-05-04 22:56:59 +00:00
legsandJulius Marminge aca0fa4e5b reduce startup time by ~47% and memory usage by up to 150-300MB (#2204)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-04 13:56:01 -07:00
Julius Marminge 0576820755 Prevent focus-ring clipping in AnimatedHeight (#2503) 2026-05-04 20:50:30 +00:00
Anirudh Vempati cb3211c8f3 README: Add OpenCode to first mention of supported agents (#2436) 2026-05-04 20:17:47 +00:00
Julius MarmingeandJulius Marminge 826965978b bitubicket base brnach (#2500)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-04 10:02:25 -07:00
623e471a02 Fix markdown highlight render stability (#2479)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-04 09:38:17 -07:00
91a03e0747 feat(source-control): add Bitbucket & Azure Devops providers (#2473)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-05-04 00:59:58 -07:00
Julius Marminge d501ebe877 fix version test (#2490) 2026-05-04 05:27:18 +00:00
Julius Marmingeandcodex 3772fa127c feat: Hosted Frontend, Tailscale Integration & SSH Lancher (#2361)
Co-authored-by: codex <[email protected]>
2026-05-03 22:19:15 -07:00
92e340d80c feat(web): collapse mobile composer by default (#1263)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-05-03 19:48:10 -07:00
d7969264de Add remote repository publish and discovery support (#2482)
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-05-03 18:05:46 -07:00
Illia Panasenko f7748a0d65 feat: add "hide whitespace changes" option for diffs (#2389) 2026-05-03 11:47:37 -07:00
Julius MarmingeandJulius Marminge 0ce7e56e43 feat(scm): Gitlab (#2462)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-02 18:59:47 -07:00
Julius MarmingeandJulius Marminge 350d76ee14 [codex] Align GitHub source control adapter errors (#2476)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-02 16:59:03 -07:00
6d7fe2eeb7 Introduce pluggable VCS driver foundation (#2435)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-05-02 16:08:17 -07:00
Julius MarmingeandJulius Marminge 460d9c3eb9 Refactor provider settings to declarative metadata (#2452)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-02 14:14:34 -07:00
Ishan cb8015a34d fix(claude-agent): opt into claude_code system prompt preset (#2472) 2026-05-02 12:38:42 -07:00
Saikrishna Ambeti 8f50ca8e2c fix(web): show friendly error for invalid pairing token (#2222) 2026-05-02 12:23:26 -07:00
Julius MarmingeandJulius Marminge 4ceabac764 Fix dialog footer button clipping in Git actions dialog (#2458)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-01 23:57:44 -07:00
Julius MarmingeandJulius Marminge 7a3f21e7ca [codex] fix Discord release version flag (#2449)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-01 18:39:41 +00:00
Julius MarmingeandJulius Marminge 17b43960e8 Add structured Discord webhook logging for release notifications (#2431)
Co-authored-by: Julius Marminge <[email protected]>
2026-05-01 03:53:47 +00:00
Julius MarmingeandJulius Marminge e5c7ac5a8c Optimize release workflow job execution (#2430)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 20:08:11 -07:00
a480f07241 Add Discord release announcements (#2429)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 19:13:05 -07:00
Adam Mansfield 1eb6fcea84 fix: opencode is not on PATH on Windows (#2183) 2026-04-30 18:15:45 -07:00
4ef361da73 fix(mobile): enable touch scrolling in file picker modal (#2420)
Co-authored-by: Claude Haiku 4.5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 18:12:48 -07:00
Noah Gregory c07ac592d8 fix: bump electron version to v40.9.3 and add it to our trusted dependencies (#2427) 2026-04-30 17:34:21 -07:00
d649ccf715 fix(web): respect iOS safe areas across mobile chrome & other mobile layout fixes (#2392)
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 16:26:36 -07:00
shivam f54f4385e5 Narrow the right sidebar and update task panel and diff panel (#2409) 2026-04-30 15:33:06 -07:00
Julius Marminge e25ce07cc2 Add new GitHub users to VOUCHED.td (#2425) 2026-04-30 18:58:31 +00:00
532a1d891d fix(web): make thread archive button always visible on mobile (#2423)
Co-authored-by: Claude Sonnet 4.7 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 18:46:05 +00:00
9e2f7129e3 fix(web): make new thread button always visible on mobile (#2419)
Co-authored-by: Claude Haiku 4.5 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 18:18:12 +00:00
a4298f1ceb fix(web): hide mobile sidebar after thread selection or creation (#1293)
Co-authored-by: Murat Aslan <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-30 11:10:37 -07:00
kp 86c94b4852 fix(web): allow closing diff panel in non-git projects (#2413) 2026-04-30 04:36:05 +00:00
Guilherme Vieira 69d9a659a3 fix(git): hide stale merged/closed PRs on the default branch (#1966) 2026-04-29 21:29:48 -07:00
9acf46a76d fix(web): prevent iOS Safari auto-zoom on input focus (#1652)
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-29 18:03:40 -07:00
Bas Milius 44b39fe2ec fix(server): key AskUserQuestion answers by question text (#2404) 2026-04-29 17:44:44 -07:00
Julius Marmingeandcodex 02903f2db8 [codex] fix terminal dimension validation (#2411)
Co-authored-by: codex <[email protected]>
2026-04-30 00:09:00 +00:00
Julius Marmingeandcodex 22b7d8c524 [codex] Fix visited timestamp under clock skew (#2408)
Co-authored-by: codex <[email protected]>
2026-04-29 17:07:21 -07:00
pomp fe2fde5172 Add OpenCode to README (#2154) 2026-04-29 23:49:49 +00:00
zurielbm 7da6522fb8 fix: updated UI "add project" icon to match the command pallete icon (#2176) 2026-04-29 23:48:08 +00:00
08e6d4cfbf feat: Multi-Provider support (#2277)
Co-authored-by: Claude Opus 4.7 <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-29 16:13:55 -07:00
Josh Meads 35822884d1 Stop OpenCode refresh from leaking serve processes
OpenCode can leave the long-lived serve child in the spawned process group after the wrapper exits. Provider refresh owns only a scoped inventory probe, so cleanup targets that local process group when the refresh scope closes.

Constraint: Keep active OpenCode thread sessions scoped to their own session lifecycle.
Rejected: Disable provider refresh | would hide model and auth state changes.
Confidence: high
Scope-risk: narrow
Tested: bun run test src/provider/Layers/OpenCodeProvider.test.ts src/provider/Layers/OpenCodeAdapter.test.ts
Tested: bun fmt
Tested: bun lint
Tested: bun typecheck
Tested: bun run build:desktop
2026-04-29 11:02:16 -07:00
Julius Marminge dbebc387dd Ignore stale WebSocket lifecycle events after reconnect (#2372) 2026-04-27 09:50:19 -07:00
Julius Marmingeandcodex 5cf83ffe8f fix(release): use configured node for smoke manifest merge (#2364)
Co-authored-by: codex <[email protected]>
2026-04-27 02:30:18 +00:00
t3-code[bot] ada410bccf chore(release): prepare v0.0.21 2026-04-23 18:05:15 +00:00
legs 00b5c3e1b3 Add task sidebar auto-open setting (#2314) 2026-04-23 13:59:08 -04:00
188df6da07 Fix Claude session cwd resume drift (#2292)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-23 13:29:54 -04:00
Pedro Silva 0d55a42840 fix(web): ignore stale runtime projection snapshots (#2301) 2026-04-23 15:52:02 +00:00
Thimo Sietsma 0ee302e24d fix(request-permission): add dynamic_tool_call to command request (#2311) 2026-04-23 15:42:35 +00:00
Julius Marminge d5b7690f95 Exclude subscribe RPCs from latency tracking (#2313) 2026-04-23 15:24:06 +00:00
8d1d699f88 Refactor provider model selections to option arrays (#2246)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: codex <[email protected]>
2026-04-23 09:35:40 -04:00
Raul Pereira da Silvaandmacroscopeapp[bot] b0b7b38da1 fix(server): detect localized Windows command errors (#2152)
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
2026-04-23 04:42:19 +00:00
Bas Milius fd3b96b487 Add IntelliJ project icon to the list of possible favicon paths (#1651) 2026-04-23 04:40:27 +00:00
Hauke Schnau aa2d385a62 fix(server): restore CODEX_HOME tilde expansion for Codex launches (#2255) 2026-04-23 00:37:58 -04:00
e25db3a572 Fix provider cache atomic write temp path collisions (#2291)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-23 00:33:16 -04:00
Heinz-GandHeinz Gericke b8305afa29 fix: increase Claude auth probe timeout to 10s (#2272)
Co-authored-by: Heinz Gericke <[email protected]>
2026-04-22 01:04:50 +00:00
Julius MarmingeandCursor Agent b7c89cf496 Refresh Codex protocol bindings to be75785504ff152fa6333e380a2d50642f42fba0 (#2276)
Co-authored-by: Cursor Agent <[email protected]>
2026-04-21 15:30:54 -07:00
NoxireandJulius Marminge 3a1daa87ac Add close buttons to toasts (#2023)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-21 08:32:08 -07:00
Mike Olson 055897f0ea fix: enforce opencode >= 1.14.19 and reveal window on Wayland (#2262) 2026-04-21 08:15:41 -07:00
Adin Schmidt 40b3a80034 fix(server): trim OpenCode provider model names (#2252) 2026-04-21 02:45:56 +00:00
Adam Mansfield f6978db605 chore(turbo): pass through PATHEXT (#2184) 2026-04-19 23:35:37 -07:00
Mike Olson de05b0c94e fix(web): restore manual sort drag and keep per-group expand state (#2221) 2026-04-19 23:29:56 -07:00
CraigandJulius Marminge 6d1505c9fb fix: Change right panel sheet to be below title bar / action bar (#2224)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-19 23:25:39 -07:00
Julius MarmingeandClaude Opus 4.7 306ec4bb84 Refactor OpenCode lifecycle and structured output handling (#2218)
Co-authored-by: Claude Opus 4.7 <[email protected]>
2026-04-19 22:56:44 -07:00
Julius Marmingeandcodex 3b98fe3548 effect-codex-app-server (#1942)
Co-authored-by: codex <[email protected]>
2026-04-19 21:46:40 -07:00
Ellie GummereandJulius Marminge 66c326b8c4 Redesign model picker with favorites and search (#2153)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-19 17:43:40 -07:00
8dbcf92a0d fix(server): prevent probeClaudeCapabilities from wasting API requests (#2192)
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-20 00:13:20 +00:00
Abdul Azeez 37965da01d fix(server): handle OpenCode text response format in commit message g… (#2202) 2026-04-20 00:12:35 +00:00
Kyle Gottfried 57b59b5bf2 Devcontainer / IDE updates (#2208) 2026-04-19 17:07:12 -07:00
20f346d8ef Expand leading ~ in Codex home paths before exporting CODEX_HOME (#2210)
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: = <=>
2026-04-20 00:06:19 +00:00
Efe Baran Durmaz c83bc5d48a fix(release): use v<semver> tag format for nightly releases (#2186) 2026-04-19 10:58:04 -07:00
Julius Marminge 9df3c64021 Use GitHub App token for release uploads (#2149) 2026-04-17 16:52:56 -07:00
Julius Marminge 8ac57f7944 Guard release workflow jobs on upstream success (#2147) 2026-04-17 16:40:43 -07:00
Julius Marminge 29cb917ac4 Guard release workflow jobs from upstream failures (#2146) 2026-04-17 16:34:19 -07:00
9c64f12ea0 Add ACP support with Cursor provider (#1355)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-17 16:21:31 -07:00
Matt Van HornandMatt Van Horn 0f184c28b0 fix(web): use capture-phase keydown listener so CTRL+J toggles terminal from terminal focus on Windows (#2113) (#2142)
Co-authored-by: Matt Van Horn <[email protected]>
2026-04-17 23:07:04 +00:00
Julius Marminge a3b1df5224 Add Claude Opus 4.5 to built-in Claude models (#2143) 2026-04-17 16:02:41 -07:00
4e0c003e78 fix(web): allow deleting non-empty projects from the warning toast (#1264)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-17 15:05:56 -07:00
Utkarsh Patil 60387f67e9 fix: show restore defaults only on General settings (#1710) 2026-04-17 13:49:18 -07:00
ce94feeea1 feat: add opencode provider support (#1758)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-04-17 13:31:41 -07:00
Ariaj 39ca3ee858 fix(web): bypass xterm for global terminal shortcuts (#1580) 2026-04-17 13:11:04 -07:00
Julius Marminge 52a6067802 Throttle nightly release workflow to every 3 hours (#2134) 2026-04-17 11:39:20 -07:00
721b6b4c6f Preserve provider bindings when stopping sessions (#2125)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-17 11:27:12 -07:00
Julius Marminge 40009735ee Extract backend startup readiness coordination (#2133) 2026-04-17 11:09:26 -07:00
df9d34004f Modernize release workflow runners (#2129)
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-04-17 16:23:02 +00:00
Julius Marminge f297e30e4c Clean up invalid pending approval projections (#2106) 2026-04-16 23:26:28 -07:00
Evan YuandJulius Marminge a7a44d0662 Fix Windows PATH hydration and repair (#1729)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-17 06:12:17 +00:00
Jono Kemball d8d329691a Show thread status in command palette (#2107) 2026-04-16 22:21:57 -07:00
Julius Marminge 54179c86b8 Update workflow to use ubuntu-24.04 runner (#2110) 2026-04-16 22:16:13 -07:00
Julius Marminge 8dba2d6484 Adopt Node-native TypeScript for desktop and server (#2098) 2026-04-16 22:14:35 -07:00
Nathan HarmonandJulius Marminge ed6b7fbf27 fix(server): honor gitignored files in workspace search (#2078)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-16 21:19:14 -07:00
Julius Marminge b991b9b9e6 Revert to Github Runner for Windows (#2103) 2026-04-16 20:35:56 -07:00
Julius Marminge 505db9f696 try out blacksmith for releases (#2101) 2026-04-16 20:12:09 -07:00
t3-code[bot] 2d87574e62 chore(release): prepare v0.0.20 2026-04-17 03:00:57 +00:00
Julius Marminge b2cca674df ci(release): install deps before finalize version bump (#2100) 2026-04-16 19:42:17 -07:00
Julius Marminge 549043863a fix: guard against missing sidebarProjectGroupingOverrides in client settings (#2099) 2026-04-17 02:36:39 +00:00
Julius Marminge b7df3dfca0 [codex] Fix Windows release manifest publishing (#2095) 2026-04-16 17:56:16 -07:00
Evan YuandJulius Marminge 6891c77d3e Build for Windows ARM (#2080)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-16 17:01:27 -07:00
m9d5m d90e15d1d7 fix(server): extend negative repository identity cache ttl (#2083) 2026-04-16 16:57:39 -07:00
e0117b271a Fix Claude Process leak[MEMORY INTENSIVE], archiving, and stale claude session monitoring. (#2042)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-16 16:30:56 -07:00
188a40c315 feat: configurable project grouping (#2055)
Co-authored-by: tlh38 <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-16 16:29:25 -07:00
Utkarsh Patil 7a08fcf2e8 fix(server): drop stale text generation options when resetting text-gen model selection (#2076) 2026-04-16 20:01:35 +00:00
Utkarsh Patil 19d47408a5 fix(web): prevent composer controls overlap on narrow windows (make plan sidebar responsive) (#1198) 2026-04-16 11:13:59 -07:00
Ibrahim ElkamaliandJulius Marminge 3e07f5a6a4 feat: add Claude Opus 4.7 to built-in models (#2072)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-16 11:11:59 -07:00
Marcus Grando d22c6f5280 fix: prevent user-input activities from leaking into pending approvals projection (#2051) 2026-04-16 05:09:29 +00:00
Marcus Grando 5e13f53571 fix: remove trailing newline from CLAUDE.md symlink (#2052) 2026-04-15 22:05:10 -07:00
f9580ff088 Default nightly desktop builds to the nightly update channel (#2049)
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-04-15 21:31:24 -07:00
AndreiandJulius Marminge 5e1dd56d2c feat: add Launch Args setting for Claude provider (#1971)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-15 21:26:36 +00:00
legsandJulius Marminge 68061af042 Improve markdown file link UX (#1956)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-15 14:20:28 -07:00
Guilherme Vieira 28cb9db20b feat(web): add tooltip to composer file mention pill (#1944) 2026-04-15 13:29:13 -07:00
SakethandJulius Marminge 7968f278ee Fix terminal Cmd+Backspace on macOS (#2027)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-15 06:29:45 +00:00
44afe784a3 Add filesystem browse API and command palette project picker (#2024)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-14 23:26:05 -07:00
Julius Marmingeandcodex 9ff31f8c35 Fix nightly desktop product name (#2025)
Co-authored-by: codex <[email protected]>
2026-04-14 19:12:36 -07:00
409ff90a14 Nightly release channel (#2012)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-14 18:18:37 -07:00
0d280262f6 fix(claude): emit plan events for TodoWrite during input streaming (#1541)
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-13 19:35:40 -07:00
Julius MarmingeandCursor Agent c9b07d665d Backfill projected shell summaries and stale approval cleanup (#2004)
Co-authored-by: Cursor Agent <[email protected]>
2026-04-13 18:10:13 -07:00
2e42f3fdf6 Improve shell PATH hydration and fallback detection (#1799)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-13 16:31:43 -07:00
008ac5c3e5 Cache provider status and gate desktop startup (#1962)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-13 15:29:08 -07:00
Julius Marminge 9dcea68bce Refresh git status after branch rename and worktree setup (#2005) 2026-04-13 14:58:03 -07:00
Julius Marminge 5f7ec73a22 Fix new-thread draft reuse for worktree defaults (#2003) 2026-04-13 14:57:46 -07:00
Julius MarmingeandCursor Agent 569fea87a9 Warm sidebar thread detail subscriptions (#2001)
Co-authored-by: Cursor Agent <[email protected]>
2026-04-13 13:55:20 -07:00
Julius Marminge 33dadb5aec Fix thread timeline autoscroll and simplify branch state (#2002) 2026-04-13 13:51:12 -07:00
Ashvin Nihalani d18e43b674 fix: lost provider session recovery (#1938) 2026-04-13 13:34:02 -07:00
Julius Marminge 6f699346e4 Use latest user message time for thread timestamps (#1996) 2026-04-13 13:20:10 -07:00
Julius Marminge f5ecca4480 Clear tracked RPCs on reconnect (#2000) 2026-04-13 20:16:08 +00:00
Utkarsh Patil cadd708646 feat: show full thread title in a tooltip when hovering sidebar thread names (#1994) 2026-04-13 12:26:41 -07:00
Ashvin NihalaniandJulius Marminge 5f7becf386 feat: Add Kiro editor support to open picker (#1974)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-13 19:16:00 +00:00
Ashvin Nihalani 9b29be916b docs: Document environment prep before local development (#1975) 2026-04-13 12:14:27 -07:00
Utkarsh Patil 047a0a697c fix: add pointer cursor to the permissions mode select trigger (#1997) 2026-04-13 12:13:44 -07:00
Julius Marmingeandcodex 77fcad3586 Prevent live thread branches from regressing to temp worktree names (#1995)
Co-authored-by: codex <[email protected]>
2026-04-13 19:04:56 +00:00
Julius Marminge 801b83e937 Allow empty server threads to bootstrap new worktrees (#1936) 2026-04-13 11:52:59 -07:00
Julius Marminge f2205bdc42 Pad composer model picker to prevent ring clipping (#1992) 2026-04-13 17:59:31 +00:00
Barry Michael Doyle 1bf048eb8b fix: avoid copy button overlapping long code blocks (#1985) 2026-04-13 09:59:22 -07:00
f7fa62aaf9 Add shell snapshot queries for orchestration state (#1973)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: codex <[email protected]>
2026-04-13 08:50:50 -07:00
Guilherme Vieira 57d7746a5d fix(web): replace turn strip overlay gradients with mask-image fade (#1949) 2026-04-13 01:11:34 -07:00
rowalth 850c912556 fix(desktop): increase backend readiness timeout from 10s to 30s (#1979) 2026-04-13 08:10:53 +00:00
Tarasandjulius dff8784aef window controls overlay (windows&linux) (#1969)
Co-authored-by: julius <[email protected]>
2026-04-13 07:21:40 +00:00
Julius MarmingeandCursor Agent 96c9306dbd Migrate chat scrolling and branch lists to LegendList (#1953)
Co-authored-by: Cursor Agent <[email protected]>
2026-04-12 23:23:14 -07:00
Julius Marminge 94d13a2b75 Preserve live stream subscriptions across explicit reconnects (#1972) 2026-04-12 18:22:38 -07:00
7a008461fc fix: Align token usage metrics for both Claude and Codex (#1943)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-12 01:03:36 -07:00
Ashvin Nihalani f59ee36bf1 fix(web): allow concurrent browser tests to retry ports (#1951) 2026-04-12 07:46:44 +00:00
Ishan 2fce84a1d4 fix: quote editor launch args on Windows to support paths with spaces (#1805) 2026-04-12 00:41:11 -07:00
Julius Marmingeandcodex f9019cd63f Coalesce status refreshes by remote (#1940)
Co-authored-by: codex <[email protected]>
2026-04-11 18:51:04 -07:00
Adam Mansfield f9372a4c3d chore(desktop): separate dev AppUserModelID on Windows (#1934) 2026-04-12 00:18:59 +00:00
934037cb66 feat(web): add extensible command palette (#1103)
Co-authored-by: Hugo Blom <[email protected]>
Co-authored-by: eggfriedrice <[email protected]>
Co-authored-by: Jono Kemball <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-11 11:02:06 -07:00
Ishan 5467d11980 fix(web): prevent number-key shortcuts from hijacking input in focused editor (#1810) 2026-04-10 20:13:58 -07:00
Oliver Sargison 1f4a3f65bf Fix opening urls wrapped across lines in the terminal (#1913) 2026-04-10 19:30:25 -07:00
shivamandJulius Marminge 26cc1fffb3 Add assistant message copy action and harden related test/storage fallbacks (#1211)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-11 02:27:29 +00:00
Mike OlsonandJulius Marminge 97880e8870 fix(web): resolve logical-to-physical key mismatch in project drag reorder (#1904)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-10 19:25:43 -07:00
Julius MarmingeandCursor Agent b80e8476b8 Memoize derived thread reads (#1908)
Co-authored-by: Cursor Agent <[email protected]>
2026-04-10 19:06:10 -07:00
Julius Marminge e0e01b4a54 Handle deleted git directories as non-repositories (#1907) 2026-04-10 18:31:24 -07:00
58e5f714b0 Add provider skill discovery (#1905)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-10 17:19:23 -07:00
Julius Marminge 4ae9de311b Stabilize auth session cookies per server mode (#1898) 2026-04-10 16:33:25 -07:00
shivam 5fa09fa2d9 [codex] fix composer footer compact layout (#1894) 2026-04-10 16:09:27 -07:00
Guilherme Vieira 12c3af7821 feat(desktop): add "Copy Image" to right-click context menu (#1052) 2026-04-10 15:02:07 -07:00
Julius Marminge e2316814da Fix worktree base branch updates for active draft (#1900) 2026-04-10 15:01:17 -07:00
Julius Marminge 678f827f0b Remove Claude subscription-based model adjustment (#1899) 2026-04-10 15:00:47 -07:00
t3-code[bot] a3dadf311e chore(release): prepare v0.0.17 2026-04-10 20:25:34 +00:00
Julius Marmingeandcodex e3004ae806 Harden secret store and resolve catalog overrides (#1891)
Co-authored-by: codex <[email protected]>
2026-04-10 13:09:39 -07:00
Ibrahim Elkamali 9385314d26 Persist changed-files expansion state per thread (#1858) 2026-04-10 10:41:41 -07:00
t3-code[bot] a3f292770e chore(release): prepare v0.0.16 2026-04-10 17:09:07 +00:00
Julius Marminge 2028d57e88 Fix server publish check for bin entrypoint (#1885) 2026-04-10 16:47:35 +00:00
3405a64dd8 bump effect to latest beta (#1866)
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-10 01:51:31 -07:00
Julius Marminge 1cba2f64d3 Harden workspace git indexing against repo-configured fsmonitor execution (#1873) 2026-04-10 01:07:05 -07:00
Julius Marminge 1a05d8ca1a Document remote server network access setup (#1872) 2026-04-10 07:43:38 +00:00
Julius Marminge cf9f236c80 Add headless t3 serve pairing output (#1871) 2026-04-10 00:12:52 -07:00
Julius Marminge e82b987386 Select desktop backend port by sequential scan (#1870) 2026-04-09 21:51:04 -07:00
Julius Marminge ea9e61b266 Align chat composer and toolbar widths (#1869) 2026-04-10 04:42:52 +00:00
Julius Marminge e32077cee7 Persist client settings and saved environment secrets (#1868) 2026-04-09 20:18:41 -07:00
Noah GregoryandJulius Marminge 5d9eb18312 fix: don't let un-updateable builds check for an update (#1808)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-09 18:27:24 -07:00
Noah Gregory abb84c09e3 fix: use different bundle ID for dev runner (#1806) 2026-04-09 17:57:50 -07:00
Magnus BuvarpandJulius Marminge 65d797c13e feat(web): add surround selection in composer (#1502)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-10 00:53:06 +00:00
Jacob 7c0849fe2e fix(web): harmonize typography in chat messages and code blocks (#1861) 2026-04-09 17:52:41 -07:00
Yash SinghandJulius Marminge 592c234fd5 fix: make file uri links clickable (#1867)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-09 17:49:35 -07:00
66d76b5d02 Fix composer footer focus ring overflow (#1865)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-10 00:40:27 +00:00
Julius Marmingeandcodex 528bb2a1fa [codex] Harden WebSocket reconnect recovery (#1864)
Co-authored-by: codex <[email protected]>
2026-04-09 17:23:37 -07:00
869789b4ed Extract ChatComposer to fix composer keystroke re-renders (#1857)
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-04-09 16:37:47 -07:00
Julius Marminge 9bedd7140c Debounce reconnect disconnect logging (#1862) 2026-04-09 15:39:28 -07:00
Julius MarmingeandJulius Marminge 70f5dfcef7 Stabilize keybindings toast stream setup (#1860)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-09 14:26:28 -07:00
Julius Marminge 9847e9b621 fix build (#1859) 2026-04-09 21:20:05 +00:00
Julius Marminge b547fee77e Scope git toast state by thread ref (#1855) 2026-04-09 19:59:30 +00:00
Julius Marminge 7b3cdc6a8c Clarify environment and workspace picker labels (#1854) 2026-04-09 12:51:17 -07:00
Noxire 386eb18a58 Fix persisted composer image hydration typo (#1831) 2026-04-09 18:20:47 +00:00
7372184d06 fix: map runtime modes to correct permission levels (#1587)
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-09 18:10:05 +00:00
Klemencina d9ded65dfe fix(desktop): add Copy Link action for chat links (#1835) 2026-04-09 18:07:53 +00:00
Julius Marmingeandcodex 2aa73985ea Refresh local git status on turn completion (#1821)
Co-authored-by: codex <[email protected]>
2026-04-09 11:02:43 -07:00
Julius Marminge 5b3b31b6e6 Use dev proxy for loopback auth and environment requests (#1853) 2026-04-09 17:53:46 +00:00
b7559c4678 Implement server auth bootstrap and pairing flow (#1768)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-09 10:18:30 -07:00
b96308fc5a Prepare datamodel for multi-environment (#1765)
Co-authored-by: justsomelegs <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-09 02:05:20 +00:00
Kyle Gottfried 72b7f90c50 Add VSCode Insiders and VSCodium icons (#1847) 2026-04-08 18:50:58 -07:00
legs 1ec346c22e Refactor web stores into atomic slices ready to split ChatView (#1708) 2026-04-08 17:25:49 -07:00
Jacob 28e481eb24 fix(web): distinguish singular/plural in pending action submit label (#1826) 2026-04-07 14:46:24 -07:00
Julius Marminge b1934b925a Add explicit timeouts to CI and release workflows (#1825) 2026-04-07 21:13:24 +00:00
Kyle Gottfried 8244fb80e6 Closes #1795 - Support building and developing in a devcontainer (#1791) 2026-04-07 19:41:08 +00:00
afc3924393 Add Zed support to Open actions via editor command aliases (#1303)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-06 16:46:17 -07:00
Julius Marminge 11d456f6c8 Support multi-select pending user inputs (#1797) 2026-04-06 16:08:46 -07:00
Julius Marminge a221542921 Add project rename support in the sidebar (#1798) 2026-04-06 16:06:36 -07:00
Julius Marminge 226ed997e1 Assign default capabilities to Codex custom models (#1793) 2026-04-06 15:29:11 -07:00
sonderandJulius Marminge c6f57a1064 Rename "Chat" to "Build" in interaction mode toggle (#1769)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-06 17:29:58 +00:00
legs 340dbbb36e fix(web): unwrap windows shell command wrappers (#1719) 2026-04-06 17:19:27 +00:00
Julius Marmingeandcodex 53a552e80d Stream git status updates over WebSocket (#1763)
Co-authored-by: codex <[email protected]>
2026-04-06 09:26:29 -07:00
Julius Marminge cf2c628bc0 Use active worktree path for workspace saves (#1762) 2026-04-05 11:22:24 -07:00
Julius Marminge e0874b651d Raise slow RPC ack warning threshold to 15s (#1760) 2026-04-05 16:53:53 +00:00
Danila Yudin 12347082ef [codex] Fix marketing download fallback links (#1747) 2026-04-04 23:25:43 -07:00
Julius Marmingeandcodex 740d7a3216 Use lazy stream accessors for provider runtime events (#1746)
Co-authored-by: codex <[email protected]>
2026-04-04 23:22:55 -07:00
Danila Yudin cd7980b457 [codex] Canonicalize PR number references (#1749) 2026-04-04 19:56:26 -07:00
f2cd53f232 Add WebSocket disconnect recovery and slow RPC toast UX (#1730)
Co-authored-by: Hwanseo Choi <[email protected]>
Co-authored-by: codex <[email protected]>
2026-04-04 17:12:49 -07:00
Julius Marmingeandcodex 04a1ae77e6 Proxy browser OTLP traces through the server (#1739)
Co-authored-by: codex <[email protected]>
2026-04-04 13:01:51 -07:00
Julius Marminge 6de4b47ecb Return replay retry state from orchestration recovery (#1728) 2026-04-03 22:05:33 -07:00
27c2b145f8 feat(cli): allow optional positional cwd argument (#1727)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-03 19:49:10 -07:00
8515f02770 Move worktree bootstrap to the server and persist terminal launch context (#1518)
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-04-03 19:49:01 -07:00
Julius Marmingeandcodex e9ed849b53 Persist server OTLP tracing settings across restarts (#1705)
Co-authored-by: codex <[email protected]>
2026-04-02 20:33:30 -07:00
Julius Marmingeandcodex e8f5b4ad5b [codex] Revert stale send spinner fix (#1704)
Co-authored-by: codex <[email protected]>
2026-04-02 20:19:58 -07:00
Julius Marmingeandcodex 752f96e9ae Add server observability tracing and metrics (#1697)
Co-authored-by: codex <[email protected]>
2026-04-03 02:30:51 +00:00
c1yde3 1b272fd709 feat: support IntelliJ IDEA open-in launch (#1673) 2026-04-02 23:57:09 +00:00
Julius Marminge 9013c07f6d Clean up terminal state when threads are archived (#1702) 2026-04-02 16:26:18 -07:00
Vakhtang Vakhtangishvili 085340588a Fix scroll to bottom button flickering near bottom of the chat (#1692) 2026-04-02 23:04:47 +00:00
Harry 48481aa923 Fix stale send spinner after completed turns (#1700) 2026-04-02 22:59:27 +00:00
Julius Marminge da107f315c Fix websocket closing and reopening connections too eagerly (#1701) 2026-04-02 15:56:53 -07:00
IshanandJulius Marminge d2822a8883 fix: use explicit refspec for push in worktrees with slashed branch names (#1684)
Co-authored-by: Julius Marminge <[email protected]>
2026-04-02 15:29:30 -07:00
Svilen Petrov ae3ea3980d Clicking logo now navigates to threads (#1617) 2026-04-02 21:45:34 +00:00
915a0548c0 Paginate git branch listing and search results (#1691)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-02 12:38:19 -07:00
Julius Marminge 5ce5472bc3 Scope git action progress toasts to the originating thread (#1675) 2026-04-02 11:39:27 -07:00
Julius Marminge 9ea443d73a Split PR creation into granular progress stages (#1694) 2026-04-02 11:24:24 -07:00
60f7ae86bb Add copy-to-clipboard action for proposed plan card (#1620)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
2026-04-02 00:47:47 -07:00
Julius Marmingeandcodex 867cf4cf09 fix: stabilize messages timeline virtualization (#1664)
Co-authored-by: codex <[email protected]>
2026-04-02 00:10:34 -07:00
Julius MarmingeandCursor Agent ae6f9715c6 Normalize sidebar thread state for faster updates (#1668)
Co-authored-by: Cursor Agent <[email protected]>
2026-04-01 23:56:40 +00:00
Julius Marminge b92c78f552 Scope git query invalidation by cwd (#1670) 2026-04-01 23:52:28 +00:00
801dfe5b41 [codex] fix git remote parsing, PR resolution, and sidebar PR state (#1619)
Co-authored-by: codex <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
2026-04-01 16:13:19 -07:00
Julius Marmingeandcodex 823d69f621 perf(server): bootstrap engine from persisted projections (#1648)
Co-authored-by: codex <[email protected]>
2026-04-01 15:07:15 -07:00
Julius Marmingeandcodex 4963fccb05 perf(server): avoid thread-wide scans for message projection (#1647)
Co-authored-by: codex <[email protected]>
2026-04-01 14:48:39 -07:00
Julius Marmingeandcodex dd89d5ce1a perf(server): add targeted projection queries (#1646)
Co-authored-by: codex <[email protected]>
2026-04-01 14:41:03 -07:00
Julius Marmingeandcodex 9132c37c86 [codex] migrate Effect.fn in apps/server/src/persistence/NodeSqliteClient.ts (#1633)
Co-authored-by: codex <[email protected]>
2026-04-01 16:34:52 +00:00
Julius Marmingeandcodex b9c7ea0581 [codex] migrate Effect.fn in apps/server/src/orchestration/Layers/ProviderCommandReactor.ts (#1629)
Co-authored-by: codex <[email protected]>
2026-04-01 16:26:52 +00:00
Julius Marmingeandcodex 556a195c9d [codex] migrate Effect.fn in apps/server/src/provider/Layers/ProviderService.ts (#1639)
Co-authored-by: codex <[email protected]>
2026-04-01 16:19:38 +00:00
Julius Marmingeandcodex 80b282ece7 [codex] migrate Effect.fn in apps/server/src/provider/Layers/ProviderRegistry.ts (#1638)
Co-authored-by: codex <[email protected]>
2026-04-01 16:19:36 +00:00
Julius Marmingeandcodex d15075b32d [codex] migrate Effect.fn in apps/server/src/provider/Layers/EventNdjsonLogger.ts (#1636)
Co-authored-by: codex <[email protected]>
2026-04-01 16:14:55 +00:00
Julius Marmingeandcodex 9f6686a13d [codex] migrate Effect.fn in apps/server/src/persistence/Layers/Sqlite.ts (#1631)
Co-authored-by: codex <[email protected]>
2026-04-01 16:14:26 +00:00
Julius Marmingeandcodex c6ff7c0d5b [codex] migrate Effect.fn in apps/server/src/provider/makeManagedServerProvider.ts (#1640)
Co-authored-by: codex <[email protected]>
2026-04-01 16:03:08 +00:00
Julius Marmingeandcodex a9e5a84c03 [codex] migrate Effect.fn in apps/server/src/provider/Layers/ProviderAdapterRegistry.ts (#1637)
Co-authored-by: codex <[email protected]>
2026-04-01 08:58:04 -07:00
Julius Marmingeandcodex 67ca528fea [codex] migrate Effect.fn in apps/server/src/provider/Layers/ClaudeProvider.ts (#1634)
Co-authored-by: codex <[email protected]>
2026-04-01 15:57:31 +00:00
Julius Marmingeandcodex 6d9b21c5d0 [codex] migrate Effect.fn in apps/server/src/provider/Layers/CodexProvider.ts (#1635)
Co-authored-by: codex <[email protected]>
2026-04-01 08:56:04 -07:00
Julius Marmingeandcodex ddffdfc095 [codex] migrate Effect.fn in apps/server/src/telemetry/Layers/AnalyticsService.ts (#1642)
Co-authored-by: codex <[email protected]>
2026-04-01 08:53:55 -07:00
Julius Marmingeandcodex a58290ed79 [codex] migrate Effect.fn in apps/server/src/git/Layers/CodexTextGeneration.ts (#1624)
Co-authored-by: codex <[email protected]>
2026-04-01 15:53:25 +00:00
Julius Marmingeandcodex 3488ca3570 [codex] migrate Effect.fn in apps/server/src/persistence/Migrations.ts (#1632)
Co-authored-by: codex <[email protected]>
2026-04-01 08:44:49 -07:00
Julius Marmingeandcodex c542ce3369 [codex] migrate Effect.fn in apps/server/src/git/Layers/ClaudeTextGeneration.ts (#1625)
Co-authored-by: codex <[email protected]>
2026-04-01 15:44:38 +00:00
Julius Marmingeandcodex 15f0be848d [codex] migrate Effect.fn in apps/server/src/checkpointing/Layers/CheckpointStore.ts (#1623)
Co-authored-by: codex <[email protected]>
2026-04-01 08:39:23 -07:00
Julius Marmingeandcodex 1c3fa67374 [codex] migrate Effect.fn in apps/server/src/checkpointing/Layers/CheckpointDiffQuery.ts (#1622)
Co-authored-by: codex <[email protected]>
2026-04-01 08:35:54 -07:00
Lars Nieuwenhuis 0ac59d569d Feat: Added Trae IDE support for opening current working directory (#1656) 2026-04-01 15:19:12 +00:00
6051 changed files with 1464478 additions and 74040 deletions

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) OpenAI
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.
@@ -0,0 +1,64 @@
---
name: ios-debugger-agent
description: Build, launch, inspect, and drive iOS apps with the repository-configured XcodeBuildMCP server. Use on macOS for iOS Simulator builds, focused native test runs, semantic UI automation, screenshots, logs, or debugging, including T3 Code Mobile verification.
---
# iOS Debugger Agent
Use the repository-configured `xcodebuildmcp` tools instead of requiring a globally installed Codex plugin. Prefer MCP tools over raw `xcodebuild`, `xcrun`, or `simctl` when the client exposes them.
## Confirm availability
This workflow requires macOS 14.5 or newer, Xcode 16 or newer, and Node.js 18 or newer. The repository pins XcodeBuildMCP in both `.mcp.json` for Claude Code and `.codex/config.toml` for Codex. Project MCP servers may require one-time trust or approval followed by a new session.
If the tools are missing:
1. Confirm the repository is trusted and its project MCP server was approved.
2. Restart or recreate the agent session after approving configuration.
3. Run `npx --yes [email protected] doctor` when the server starts but simulator or UI-automation tools are unavailable. Follow its actionable Xcode or AXe setup guidance.
4. Fall back to the pinned XcodeBuildMCP CLI or native Apple CLIs only when the current agent client cannot expose project MCP tools.
Do not ask contributors to install the OpenAI `build-ios-apps` plugin globally.
## Establish one simulator context
1. Call `session_show_defaults` before discovery, build, launch, or UI work.
2. Call `list_sims` and select one explicit simulator UDID. Prefer a simulator that is already booted; boot an installed simulator when verification requires it, but do not create or download runtimes without user authorization.
3. Call `session_set_defaults` with the project or workspace, scheme, Debug configuration, simulator ID, and bundle identifier when known.
4. Keep every subsequent build, launch, screenshot, log capture, and UI action pinned to that same UDID.
Avoid generic Mac window automation for switching among Simulator windows. Explicit device identity is more reliable.
## Choose build or launch
- Use `build_run_sim` when native source, native dependencies, entitlements, or project configuration changed.
- Use `test_sim` for the smallest relevant native test target or test cases; do not run an entire workspace test matrix routinely.
- Use `launch_app_sim` when a compatible app is already installed and no native rebuild is needed.
- To reuse an existing build artifact, use `get_sim_app_path` or `get_app_bundle_id`, install it with `install_app_sim` when necessary, and then launch it.
- Do not run a build-only action immediately before `build_run_sim` unless the task requires both artifacts.
After launch, call `snapshot_ui` or `screenshot` before interacting. An open Simulator window alone is not evidence that the intended app launched.
## Drive the UI semantically
1. Call `snapshot_ui` to obtain the current accessibility hierarchy and element references.
2. Use only current `elementRef` values whose snapshot entries list the intended action. XcodeBuildMCP `2.6.2` does not accept coordinates for `tap`; when the app exposes no actionable reference, prefer a registered deep link or another app-supported route and otherwise report the accessibility blocker.
3. Refresh with `snapshot_ui` after navigation or layout changes. Element references are snapshot-specific.
4. Use `wait_for_ui` for asynchronous transitions when available rather than fixed sleeps.
5. Capture a final `screenshot` for the state that proves the affected flow.
Use `gesture` or scoped swipe actions when needed. If a gesture is unreliable, return to a known route or relaunch rather than switching to generic desktop automation.
## Capture logs and debug
- Use `start_sim_log_cap` and `stop_sim_log_cap` with the exact bundle identifier for focused runtime logs.
- Use debugger tools only when the task requires runtime diagnosis; attach to the selected simulator and app rather than an ambiguous process.
- Summarize relevant errors instead of returning unbounded logs.
## Clean up
Stop only log captures, debugger sessions, apps, or simulators started for the current test. Leave pre-existing simulators and unrelated sessions alone.
## Upstream
Adapted from OpenAI's [`build-ios-apps`](https://github.com/openai/plugins/tree/main/plugins/build-ios-apps) plugin version `0.1.2` (`ios-debugger-agent`, MIT) and aligned with XcodeBuildMCP `2.6.2` tool names.
@@ -0,0 +1,9 @@
interface:
display_name: "iOS Debugger Agent"
short_description: "Build and drive iOS Simulator apps"
default_prompt: "Use $ios-debugger-agent to build, launch, and inspect the current iOS app on Simulator."
dependencies:
tools:
- type: "mcp"
value: "xcodebuildmcp"
description: "Repository-configured Xcode build, simulator, logging, debugging, and semantic UI tools"
@@ -0,0 +1,21 @@
MIT License
Copyright (c) OpenAI
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.
@@ -0,0 +1,51 @@
---
name: ios-simulator-browser
description: Stream an explicit iOS Simulator through pinned serve-sim into the T3 Code in-app browser or another agent browser. Use on Apple Silicon macOS when the user should watch simulator verification live or when browser-visible simulator evidence is needed.
---
# iOS Simulator Browser
Use serve-sim as the shared visual feed for an iOS Simulator. Use `ios-debugger-agent` and XcodeBuildMCP semantic UI tools to drive the app; do not treat browser-canvas coordinates as a substitute for missing app accessibility.
## Confirm availability
serve-sim `0.1.45` requires Apple Silicon macOS, Xcode command-line tools, and Node.js 20 or newer. If the host is unsupported, continue with XcodeBuildMCP screenshots and report that live streaming was unavailable.
When running inside T3 Code, use its product-native browser MCP to open the stream. Other agent hosts may use their own browser or preview surface.
Keep serve-sim on its default `127.0.0.1` binding. Do not expose its preview to a LAN or tunnel unless the user explicitly requests that access and the network is trusted; the preview includes a token-gated shell-execution route.
## Start one owned stream
1. Obtain the exact simulator UDID from the iOS build or launch workflow.
2. Check whether an existing serve-sim stream for that UDID belongs to another task. Reuse it only when explicitly shared; never kill another task's stream.
3. Otherwise, clear only a stale stream for that UDID and start the pinned version with scoped cleanup:
```bash
SIMULATOR_ID=<simulator-udid>
cleanup_serve_sim() {
npx --yes [email protected] --kill "$SIMULATOR_ID" >/dev/null 2>&1 || true
}
trap cleanup_serve_sim EXIT INT TERM HUP
cleanup_serve_sim
npx --yes [email protected] "$SIMULATOR_ID"
```
4. Keep the terminal alive and open the exact local URL printed by serve-sim in the agent's browser.
5. Verify that a live simulator frame renders. A loaded wrapper page is not sufficient evidence.
## Observe while driving semantically
- Let the user watch the serve-sim stream while XcodeBuildMCP performs `snapshot_ui`, semantic taps, typing, gestures, and screenshots.
- Keep the browser and Xcode tooling pinned to the same simulator UDID.
- Do not switch to generic desktop automation or browser-canvas clicking merely because the stream is visible.
If the in-app browser explicitly reports that previews are unavailable, do not install unrelated browser automation. Continue through XcodeBuildMCP, capture a simulator screenshot, report the unavailable live stream, and clean up the owned serve-sim process.
## Finish
Stop the long-running terminal and wait for its cleanup trap to finish. If it disappeared without cleanup, run `npx --yes serve-sim@0.1.45 --kill <simulator-udid>` for that exact simulator. Never run an unscoped `--kill`.
## Upstream
Adapted from OpenAI's [`build-ios-apps`](https://github.com/openai/plugins/tree/main/plugins/build-ios-apps) plugin version `0.1.2` (`ios-simulator-browser`, MIT). It invokes serve-sim `0.1.45` under its Apache-2.0 license without vendoring the package.
@@ -0,0 +1,4 @@
interface:
display_name: "iOS Simulator Browser"
short_description: "Stream iOS Simulator in the browser"
default_prompt: "Use $ios-simulator-browser to stream the selected iOS Simulator into the T3 Code in-app browser."
+101
View File
@@ -0,0 +1,101 @@
---
name: test-t3-app
description: Launch, retain, and test the T3 Code web app in isolated development environments, including first-try browser authentication with one-time pairing URLs, pairing-token recovery, worktree-safe state directories, cross-turn dev server lifecycle, and direct SQLite inspection or fixture seeding. Use when an agent needs to run T3 locally, iteratively test UI behavior with a human, recover from an expired or consumed pairing token, isolate dev state, or prepare test data in state.sqlite.
---
# Test T3 App
Use this skill for the web client. For iOS Simulator, Android Emulator, or physical-device testing against an isolated T3 backend, use the sibling [`test-t3-mobile`](../test-t3-mobile/SKILL.md) skill.
## Start an isolated web environment
1. Run commands from the repository root.
2. Choose a base directory that belongs only to the current worktree or test:
- Use the repository's ignored `.t3` directory for reusable worktree-local state.
- Use `mktemp -d /tmp/t3code-test.XXXXXX` for disposable state and retain the printed absolute path.
3. Start the full web stack with `vp run dev`. Add `--share` when the user needs to open it from another tailnet device. In a linked worktree it defaults to that worktree's gitignored `.t3`; pass `--home-dir <base-dir>` only when the test needs a different isolated directory.
4. Keep the terminal session alive and read the selected server port, web port, base directory, and pairing URL from its output.
Treat a base directory as disposable only when it was created or deliberately selected for the current test. Never delete or directly seed the shared `~/.t3` directory. Prefer starting with a new temporary base directory over clearing state of uncertain ownership.
The worktree-local default deliberately outranks an ambient `T3CODE_HOME`; do not pass the shared home through to a worktree dev server.
Ports are derived from the worktree path but can shift when occupied. Always read the actual values from the `[dev-runner]` line.
Shared browser dev is single-origin: Vite proxies the backend paths, so never set `VITE_HTTP_URL` or `VITE_WS_URL` for `dev`/`dev:web`.
The dev runner disables browser auto-open by default. Do not pass `--browser` during automated testing: an automatically opened page can consume the one-time bootstrap token before the controlled browser uses it.
### Verify a shared environment before human handoff
When another person will use the printed pairing URL, first open the shared origin without the pairing path or fragment in the controlled browser and confirm the T3 Code app loads. This browser navigation is required even when curl succeeds because browsers block some otherwise reachable ports before making a network request.
Do not open the other person's complete pairing URL during this reachability check; doing so consumes its one-time token. If the agent also needs an authenticated browser, create and consume a separate pairing token, then leave a fresh token for the other person.
## Preserve the environment while iterating
Treat the overall testing or implementation loop—not an assistant turn or one verification pass—as the environment lifecycle boundary.
- Keep the dev process, base directory, selected ports, authenticated browser tab, registered projects, and seeded fixtures alive while the user may inspect the result or request follow-up changes.
- Do not stop the server merely because one verification pass completed or because you are yielding a response to the user.
- Before starting another environment, check whether the existing process and browser tab still serve the task. Reuse them when healthy instead of discarding useful state.
- On a later turn, verify that the existing process is alive and reuse its printed ports and base directory. If it exited, restart with the same base directory; create a new pairing token only when the browser session is no longer valid.
- Tell the user when a test environment remains available, including its non-secret web URL when useful. Never include a pairing token.
## Authenticate the browser on the first navigation
1. Wait for the server log that says authentication is required and includes a URL ending in `/pair#token=...`.
2. Use the controlled in-app browser or browser-automation surface available to the agent. Do not use a system-browser launch command during automated testing.
3. Open that complete URL exactly once as the controlled browser's first navigation. Preserve the fragment and token verbatim.
4. Wait for the pairing exchange and redirect to finish before navigating elsewhere.
5. Continue in the same browser context so its stored bearer session remains available.
Treat pairing URLs as secrets. Do not copy them into final responses, screenshots, committed files, or durable logs. A pairing token is short-lived and single-use; opening the URL in another browser or opening it twice can consume it.
## Recover a consumed or expired pairing token
Create another token against the same database and web URL as the running dev server:
```bash
T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
--base-dir <base-dir> \
--dev-url <web-url> \
--base-url <web-url> \
--ttl 15m \
--label agent-ui-test
```
Use the `Pair URL` from this command once. Derive `<server-port>` and `<web-url>` from the current dev-runner output, including any automatically selected port offset. Setting `T3CODE_PORT` keeps the administrative CLI from probing for an unrelated free port.
Always pass `--dev-url` for a dev-runner environment so the generated pairing URL uses the current web origin. An explicit base directory stores runtime state in `<base-dir>/userdata`; the `<base-dir>/dev` fallback is only used by an implicit dev home. A worktree-local `.t3` counts as explicit, so its state lives in `<worktree>/.t3/userdata`. Use `auth pairing list` to inspect active token metadata; it intentionally cannot reveal token secrets.
## Inspect or seed SQLite state
Read [references/sqlite-fixtures.md](references/sqlite-fixtures.md) before changing the database.
- Use `node apps/server/scripts/t3-sqlite-state.ts query` for schema discovery and read-only checks.
- Stop the dev server before using `node apps/server/scripts/t3-sqlite-state.ts exec`, then restart it with the same base directory.
- Seed projection tables only for disposable UI fixtures. Use application commands and APIs when testing business behavior or projection correctness.
- Use the auth CLI, not direct `auth_*` table edits, for pairing and sessions.
The helper refuses to write to the shared `~/.t3` directory by default and creates a database backup before each mutation.
## Tear down only when the testing loop is finished
Tear down when the user explicitly asks, confirms the iteration is finished, or the overall task is genuinely complete with no pending human review. Do not infer completion from the end of an assistant turn.
When teardown is appropriate:
1. Stop the dev process with its terminal interrupt.
2. Preserve the isolated base directory when it contains useful reproduction evidence or state for a likely follow-up.
3. Otherwise remove only a path created for this test after resolving and verifying the exact target.
If completion is uncertain, keep the environment alive and mention that it is retained for further iteration. A fresh isolated base directory remains the safest reset when authentication, migrations, or fixture state becomes ambiguous.
## Troubleshoot predictably
- If the browser shows an unauthenticated pairing screen, issue a new token instead of retrying the consumed URL.
- If the pairing URL is no longer visible, create a replacement token with both `--dev-url` and `--base-url`.
- If the replacement token is rejected, verify that the CLI and server use the identical absolute base directory and web URL.
- If the UI shows unexpected data, verify that every command uses the identical explicit base directory before editing anything.
- If ports move because another instance is running, trust the current dev-runner output rather than assuming ports `13773` and `5733`.
@@ -0,0 +1,4 @@
interface:
display_name: "T3 App Testing"
short_description: "Launch and retain isolated T3 test environments"
default_prompt: "Use $test-t3-app to launch an isolated T3 environment and iteratively test it in the browser while preserving state."
@@ -0,0 +1,58 @@
# SQLite fixtures
Load this reference only when inspecting or seeding local T3 state directly.
## Select the correct database
When `--base-dir` or `--home-dir` is explicit, runtime state lives under `<base-dir>/userdata` and the database path is `<base-dir>/userdata/state.sqlite`. The `<base-dir>/dev` state directory is only the fallback for an implicit development home, preventing an ordinary `vp run dev` from touching production state.
Start the target runtime once before seeding so all migrations have run. Use an isolated base directory. Stop the server before writes to avoid racing application state or an active projection.
## Use the helper
List tables:
```bash
node apps/server/scripts/t3-sqlite-state.ts query \
--base-dir <base-dir> \
--sql "SELECT name FROM sqlite_schema WHERE type = 'table' ORDER BY name"
```
Inspect current columns before writing a fixture:
```bash
node apps/server/scripts/t3-sqlite-state.ts query \
--base-dir <base-dir> \
--sql "PRAGMA table_info(projection_threads)"
```
Apply a SQL fixture from a file:
```bash
node apps/server/scripts/t3-sqlite-state.ts exec \
--base-dir <base-dir> \
--file /tmp/t3-seed.sql
```
Use one statement per invocation for both `query` and `exec`; the helper wraps writes in a transaction and prints the backup path after a successful mutation. Use a single insert with multiple value rows when a fixture needs several records.
## Seed projection data carefully
The web UI primarily reads these projection tables:
- `projection_projects`
- `projection_threads`
- `projection_thread_messages`
- `projection_thread_activities`
- `projection_thread_sessions`
- `projection_turns`
- `projection_pending_approvals`
- `projection_thread_proposed_plans`
Inspect `PRAGMA table_info(<table>)` and the current migrations under `apps/server/src/persistence/Migrations/` before constructing inserts. Keep identifiers unique, timestamps as ISO strings, JSON columns valid, and related project/thread/turn IDs consistent.
For a substantial current example, inspect `seedDatabase` in `scripts/mobile-showcase-environment.ts`. Adapt its column set to the target database instead of assuming copied SQL remains current.
Direct projection writes are appropriate for ephemeral visual states, edge-case counts, long titles, activity lists, and similar UI fixtures. They do not create a coherent orchestration event history. Do not modify `orchestration_events` unless the test specifically exercises projector internals, and do not use direct projection writes to claim backend business behavior works.
Use the app's commands or APIs for behavior tests. Use `node apps/server/src/bin.ts auth ...` for auth state rather than editing `auth_pairing_links` or `auth_sessions`.
+188
View File
@@ -0,0 +1,188 @@
---
name: test-t3-mobile
description: Launch and test T3 Code Mobile on an iOS Simulator or Android Emulator against disposable local T3 environments, including Metro and dev-client reuse, native rebuild decisions, per-client pairing, seeded projects, semantic UI control, screenshots, and iOS serve-sim streaming. Use after mobile UI or native changes, when reproducing phone or tablet behavior, pairing an emulator to isolated state, or verifying mobile behavior on macOS, Linux, or Windows.
---
# Test T3 Mobile
Run one focused, end-to-end mobile verification pass against disposable T3 state. Use the sibling [`test-t3-app`](../test-t3-app/SKILL.md) skill as the detailed reference for pairing-token semantics and SQLite fixtures.
Command examples use POSIX shell syntax. On Windows, use PowerShell equivalents: set variables with `$env:NAME = "value"`, use an explicit temporary directory from `[System.IO.Path]::GetTempPath()`, and run multiline examples on one line or with PowerShell backticks. Use `$env:ANDROID_HOME\platform-tools\adb.exe` when `adb` is not already on `PATH`.
## Select a viable platform
Inspect the host and the affected code before launching processes:
- On macOS with Xcode, prefer one representative iOS Simulator when the change is cross-platform so the user can watch through serve-sim. Load and follow [`ios-debugger-agent`](../ios-debugger-agent/SKILL.md), and load [`ios-simulator-browser`](../ios-simulator-browser/SKILL.md) when live streaming is available.
- On macOS, Linux, or Windows with the Android SDK, use one Android Emulator when Android is the affected surface or iOS tooling is unavailable.
- When the change is platform-specific, test that platform. When neither platform is viable, report the missing SDK, emulator, or dev-client prerequisite rather than claiming verification.
Do not treat unavailable iOS tooling as a blocker when Android is a valid representative target.
## Choose the lightest valid launch path
- For JavaScript, TypeScript, or asset-only changes, reuse a compatible installed development client and start Metro. Do not rebuild native code merely to load a new bundle.
- For native source, native dependencies, entitlements, config plugins, or generated project changes, rebuild the affected platform.
- Use `vp run ios:dev` or `vp run android:dev` only when an Expo clean prebuild is actually required; both commands regenerate the native project.
- If the user requested no native rebuild and no compatible app is installed, reuse an existing compatible `.app` or `.apk` artifact when available. Otherwise report the missing dev client instead of silently rebuilding.
The development identity on both platforms is:
- App: `T3 Code Dev`
- Bundle/package identifier: `com.t3tools.t3code.dev`
- URL scheme: `t3code-dev`
Bundle or package presence proves the correct variant, not native compatibility. Reuse it only when the current changes did not alter its Expo SDK, native dependencies, config plugins, entitlements, generated project, or native source.
## Start one disposable T3 environment
Run backend commands from the repository root. Use the ignored, worktree-local `.t3` directory or create a fresh directory with the host OS's temporary-directory mechanism. An explicit base directory stores state in `<base-dir>/userdata`; never point testing at shared `~/.t3` state.
Seed a small number of meaningful Git projects before starting the backend:
```bash
node apps/server/src/bin.ts project add <git-workspace> \
--base-dir <base-dir> \
--title <project-title>
```
Running `project add` before the backend starts gives it exclusive offline database access. If a backend is already running, wait until it is ready so the CLI dispatches through the live server; never run offline mutations concurrently with the server.
Use direct SQLite mutation only for disposable projection fixtures. Follow `test-t3-app` and stop the backend before writing.
Start a headless backend after seeding:
```bash
node apps/server/src/bin.ts serve \
--host 127.0.0.1 \
--port <server-port> \
--base-dir <base-dir> \
--no-browser
```
Use these client origins:
- iOS Simulator: `http://127.0.0.1:<server-port>`
- Android Emulator: `http://10.0.2.2:<server-port>`
- Physical device: bind the backend to `0.0.0.0` and use the host's reachable LAN origin
Always enter the complete `http://` origin; the mobile host field otherwise assumes HTTPS. When testing web and mobile together, run `vp run dev --home-dir <base-dir> --host 127.0.0.1` instead and do not launch a second backend over the same base directory.
## Start or reuse Metro safely
Run Metro from `apps/mobile`.
1. Inspect any process on the intended Metro port and its `/status` response. Reuse it only when it is healthy, belongs to this worktree, and matches `APP_VARIANT=development`, `--dev-client`, and scheme `t3code-dev`.
2. Never kill another worktree's Metro. Use a free explicit port when necessary.
3. Run `vp run dev:client` on the standard port. For another port, retain the complete development identity:
```bash
APP_VARIANT=development vp exec expo start \
--dev-client \
--scheme t3code-dev \
--clear \
--lan \
--port <metro-port>
```
In PowerShell, set `$env:APP_VARIANT = "development"` first and then run the `vp exec expo start ...` command without the leading assignment.
4. Open the exact development-client URL for the selected device and confirm the loaded bundle belongs to this worktree and Metro port.
### iOS launch
Use `ios-debugger-agent` to select one UDID and set these XcodeBuildMCP session defaults:
- Workspace: `<repo>/apps/mobile/ios/T3CodeDev.xcworkspace`
- Scheme: `T3CodeDev`
- Configuration: `Debug`
- Simulator ID: the selected UDID
- Bundle ID: `com.t3tools.t3code.dev`
Check the installed client with:
```bash
xcrun simctl get_app_container <simulator-udid> com.t3tools.t3code.dev app
xcrun simctl openurl <simulator-udid> <printed-dev-client-url>
```
Accept the iOS confirmation prompt and dismiss the developer menu when it obscures the app.
### Android launch
Select one running emulator serial from `adb devices` and check the installed client:
```bash
adb -s <emulator-serial> shell pm path com.t3tools.t3code.dev
adb -s <emulator-serial> reverse tcp:<metro-port> tcp:<metro-port>
adb -s <emulator-serial> shell am start -W \
-a android.intent.action.VIEW \
-d '<printed-dev-client-url>' \
com.t3tools.t3code.dev
```
Do not start, stop, erase, or reconfigure an emulator owned by another task. Track and later stop only processes owned by this test.
## Pair each client once
Issue a fresh credential against the running backend's exact base directory:
```bash
T3CODE_PORT=<server-port> node apps/server/src/bin.ts auth pairing create \
--base-dir <base-dir> \
--base-url <mobile-origin> \
--ttl 15m \
--label agent-mobile-<short-device-id>
```
In PowerShell, set `$env:T3CODE_PORT = "<server-port>"` first and run the `node ... auth pairing create` command without the leading assignment.
If the visible Add Environment action is not exposed as a semantic target, open the app's registered route instead of guessing coordinates:
```bash
xcrun simctl openurl <simulator-udid> 't3code-dev://connections/new'
adb -s <emulator-serial> shell am start -W \
-a android.intent.action.VIEW \
-d 't3code-dev://connections/new' \
com.t3tools.t3code.dev
```
Run only the command for the selected platform.
In T3 Code Dev, open Add Environment and enter the complete `<mobile-origin>` and newly printed `Token`. Verify the expected seeded projects appear before exercising the affected flow.
Pairing credentials are secret, short-lived, and single-use. Create a different credential for every simulator, emulator, physical device, or browser. If an attempt fails, issue a new credential rather than retrying the old one. Do not expose tokens in screenshots, commits, or final responses.
## Drive and observe the affected flow
### iOS
Use `snapshot_ui` and current element references from XcodeBuildMCP for taps and typing. Stream the same UDID through `ios-simulator-browser` so the user can watch in T3 Code when the host supports it. Use the stream as a visual feed rather than a reason to switch to fragile browser coordinates.
### Android
Prefer semantic Android automation exposed by the current agent host. Otherwise inspect the current hierarchy with `adb shell uiautomator dump`, target stable resource IDs, content descriptions, text, or bounds, and use scoped `adb shell input` actions. Refresh the hierarchy after navigation. Capture the final state with `adb exec-out screencap -p`.
Android does not use serve-sim. Use a browser-compatible Android mirror when the host already provides one; otherwise return focused emulator screenshots as evidence rather than installing unrelated streaming infrastructure during verification.
## Verify and clean up
Exercise only the affected flow on one representative device unless the change specifically concerns platform, OS version, or screen size. Before finishing:
1. Confirm the app connected to the intended disposable environment instead of merely rendering an empty disconnected state.
2. Capture the relevant final state.
3. Remove the disposable environment from T3 Code Dev.
4. Remove any `adb reverse` rule created for this test with `adb -s <emulator-serial> reverse --remove tcp:<metro-port>`.
5. Stop only the serve-sim, Metro, backend, emulator, and log processes started by this test.
6. Remove only base directories and temporary Git repositories deliberately created for this test. Preserve them when they contain useful reproduction evidence.
Keep local verification focused. Do not turn this workflow into a full repository test run.
## Troubleshoot predictable failures
- **Old UI or an old error appears:** verify Metro's worktree, variant, URL, and port before diagnosing the app.
- **The environment remains empty:** verify the platform-specific HTTP origin, use a fresh token, and confirm project seeding used the identical base directory.
- **A second client cannot pair:** pairing tokens are single-use; issue another token.
- **iOS semantic actions fail:** set explicit XcodeBuildMCP defaults and refresh with `snapshot_ui`.
- **Android cannot reach Metro:** verify `adb reverse` for the exact Metro port and relaunch the development-client URL.
- **Android cannot reach the backend:** use `10.0.2.2`, not `127.0.0.1`, for the Android Emulator.
@@ -0,0 +1,4 @@
interface:
display_name: "Test T3 Mobile"
short_description: "Test T3 Code on iOS or Android"
default_prompt: "Use $test-t3-mobile to launch T3 Code against an isolated backend and verify the affected flow on an available simulator or emulator."
+1
View File
@@ -0,0 +1 @@
../.agents/skills
+9
View File
@@ -0,0 +1,9 @@
[mcp_servers.xcodebuildmcp]
enabled = true
required = false
command = "npx"
args = ["--yes", "[email protected]", "mcp"]
startup_timeout_sec = 20.0
[mcp_servers.xcodebuildmcp.env]
XCODEBUILDMCP_ENABLED_WORKFLOWS = "simulator,ui-automation,debugging,logging"
+1
View File
@@ -0,0 +1 @@
plans/
+72
View File
@@ -0,0 +1,72 @@
---
description: Cursor Cloud environment setup and run notes for T3 Code (Cursor-specific; not for other editors/CI)
alwaysApply: true
---
# Cursor Cloud specific instructions
These notes apply only to Cursor Cloud agents (kept out of the shared `AGENTS.md` since T3 Code is
developed in many places). They cover the pre-provisioned VM environment and non-obvious run caveats.
## Toolchain
Pre-installed and wired into login shells (`~/.bashrc`/`~/.profile`): Node 24 (via nvm), the global
`vp` (Vite+) CLI, and its bundled pnpm. `vp` is the package manager + task runner for this repo
(`vp i`, `vp check`, `vp run typecheck`, `vp test`, `vp run --filter <pkg> <script>`).
- Node gotcha: the base image also ships an older Node on `/exec-daemon` that wins on `PATH` in
non-login shells. Run commands in a login shell (`bash -lc '...'`) or prepend
`$HOME/.nvm/versions/node/v24.13.1/bin` so Node 24 (`engines.node: ^24.13.1`) is used.
- `vp check` also runs the formatter (not just lint); markdown edits must be formatter-clean. Run
`vp check --fix` before committing.
## Running the web app
- `npm run dev` (from repo root) starts contracts (watch), web (Vite, port 5733), and the server
(`node --watch`, port 13773) together, auto-wiring `VITE_HTTP_URL`/`VITE_WS_URL`. Use
`npm run dev:server` / `npm run dev:web` for one side. If base ports are taken it auto-offsets to
the next free pair, so read the actual ports from stdout. Avoid production `build`/`start` in dev.
- Auth/pairing: the server is unauthenticated by default and prints a pairing URL to stdout on startup
(e.g. `http://localhost:5733/pair#token=XXXX`). Open that URL in the browser to pair before the web
UI can talk to the server. Server state (SQLite, auth, projects) lives under `~/.t3`
(`T3CODE_HOME`); multiple `npm run dev` instances bind different ports but share that same DB.
- Agent providers are external CLIs (`codex`, `claude`, `cursor-agent`, `opencode`) probed on `PATH`.
Without one installed the UI loads but no agent can run. Claude Code
(`npm i -g @anthropic-ai/claude-code`) works headlessly using `ANTHROPIC_API_KEY` from the
environment (the server forwards `process.env` to the child; no interactive `claude auth login`
needed). Provider probing runs at startup and refreshes roughly every 5 minutes — restart the dev
server to pick up a newly installed provider CLI immediately.
## Android native builds (apps/mobile)
The Android toolchain is pre-installed and wired into login shells: OpenJDK 17
(`JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64`; the base image's default `java` is 21, so builds must
use `JAVA_HOME`), and the Android SDK at `$HOME/Android/Sdk` (`ANDROID_HOME`/`ANDROID_SDK_ROOT`) with
platform-tools, `platforms;android-36`, `build-tools;36.0.0`, `ndk;27.1.12297006`, and `cmake;3.22.1`.
Gradle auto-downloads any additional pinned SDK packages on demand.
- Generate the native project first: from `apps/mobile`,
`EXPO_NO_GIT_STATUS=1 APP_VARIANT=development npx expo prebuild --clean --platform android`
(the `android/` folder is generated, not committed). RN 0.85 defaults: compileSdk/targetSdk 36,
minSdk 24, NDK `27.1.12297006` (see `react-native/gradle/libs.versions.toml`).
- Build with Gradle from `apps/mobile/android`, e.g. `./gradlew :app:assembleDebug`. First build is
slow (Kotlin + C++/NDK codegen). Limit ABIs to speed things up, e.g.
`-PreactNativeArchitectures=arm64-v8a`. Verified working end-to-end on a native module:
`./gradlew :react-native-worklets:assembleDebug` compiles Kotlin + C++ and emits an AAR + `.so`s.
- No emulator: this VM has no `/dev/kvm` (nested virtualization), so a hardware-accelerated Android
emulator will not run. Use a physical device (`adb`) or EAS cloud builds (`vp run eas:android:*`) to
actually run the app. The full IDE GUI is unnecessary here — the SDK/NDK/Gradle toolchain that
Android Studio bundles is what is installed.
- Known blocker for the full-app `:app:assembleDebug` (pre-existing, app-level — not the environment):
`:react-native-screens:compileDebugKotlin` fails because `patches/[email protected]`
adds new codegen props (`subtitle`, `largeSubtitle`, `navigationItemStyle`,
`headerCenterBarButtonItems`, `headerToolbarItems`) to the JS spec + iOS native code but includes no
Android Kotlin setters, so the generated `ScreenStackHeaderConfigManagerInterface` is unimplemented.
The mobile README documents only iOS for local builds and routes Android through EAS. Fixing local
Android app builds requires an app/patch change (add the Android Kotlin setters), which is out of
scope for environment setup.
## Known flaky tests (unrelated to setup)
- `apps/server/src/git/GitManager.test.ts` (cross-repo PR metadata, can time out at 12s).
- `apps/server/src/provider/Layers/ProviderRegistry.test.ts` (codex binaryPath re-probe ordering).
+29
View File
@@ -0,0 +1,29 @@
{
"name": "T3 Code Dev",
"image": "debian:bookworm",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers-extra/features/bun:1": {
"version": "1.3.11"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "24.13.1"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10",
"installTools": false
}
},
"overrideFeatureInstallOrder": [
"ghcr.io/devcontainers/features/git",
"ghcr.io/devcontainers-extra/features/bun"
],
"postCreateCommand": {
"bun-install": "bun install --backend=copyfile --frozen-lockfile"
},
"customizations": {
"vscode": {
"extensions": ["oxc.oxc-vscode"]
}
}
}
-6
View File
@@ -1,6 +0,0 @@
# CI quality gates
- `.github/workflows/ci.yml` runs `bun run lint`, `bun run typecheck`, and `bun run test` on pull requests and pushes to `main`.
- `.github/workflows/release.yml` builds macOS (`arm64` and `x64`), Linux (`x64`), and Windows (`x64`) desktop artifacts from a single `v*.*.*` tag and publishes one GitHub release.
- The release workflow auto-enables signing only when secrets are present: Apple credentials for macOS and Azure Trusted Signing credentials for Windows. Without secrets, it still releases unsigned artifacts.
- See `docs/release.md` for full release/signing setup checklist.
-42
View File
@@ -1,42 +0,0 @@
# Scripts
- `bun run dev` — Starts contracts, server, and web in `turbo watch` mode.
- `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution).
- `bun run dev:web` — Starts just the Vite dev server for the web app.
- Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state.
- Override server CLI-equivalent flags from root dev commands with `--`, for example:
`bun run dev -- --base-dir ~/.t3-2`
- `bun run start` — Runs the production server (serves built web app as static files).
- `bun run build` — Builds contracts, web app, and server through Turbo.
- `bun run typecheck` — Strict TypeScript checks for all packages.
- `bun run test` — Runs workspace tests.
- `bun run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch.
- `bun run dist:desktop:dmg` — Builds a shareable macOS `.dmg` into `./release`.
- `bun run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
- `bun run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
- `bun run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
## Desktop `.dmg` packaging notes
- Default build is unsigned/not notarized for local sharing.
- The DMG build uses `assets/macos-icon-1024.png` as the production app icon source.
- Desktop production windows load the bundled UI from `t3://app/index.html` (not a `127.0.0.1` document URL).
- Desktop packaging includes `apps/server/dist` (the `t3` backend) and starts it on loopback with an auth token for WebSocket/API traffic.
- Your tester can still open it on macOS by right-clicking the app and choosing **Open** on first launch.
- To keep staging files for debugging package contents, run: `bun run dist:desktop:dmg -- --keep-stage`
- To allow code-signing/notarization when configured in CI/secrets, add: `--signed`.
- Windows `--signed` uses Azure Trusted Signing and expects:
`AZURE_TRUSTED_SIGNING_ENDPOINT`, `AZURE_TRUSTED_SIGNING_ACCOUNT_NAME`,
`AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME`, and `AZURE_TRUSTED_SIGNING_PUBLISHER_NAME`.
- Azure authentication env vars are also required (for example service principal with secret):
`AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`.
## Running multiple dev instances
Set `T3CODE_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
- Default ports: server `3773`, web `5733`
- Shifted ports: `base + offset` (offset is hashed from `T3CODE_DEV_INSTANCE`)
- Example: `T3CODE_DEV_INSTANCE=branch-a bun run dev:desktop`
If you want full control instead of hashing, set `T3CODE_PORT_OFFSET` to a numeric offset.
+28
View File
@@ -0,0 +1,28 @@
# Optional: T3 Connect source builds
# Leave these unset to disable optional T3 Connect features in local source builds.
# Release builds inject their public values at build time. Do not add server-side
# secrets to this file.
# Get these from the Clerk Dashboard under API keys, JWT templates, and OAuth applications.
# T3CODE_CLERK_PUBLISHABLE_KEY=pk_test_...
# T3CODE_CLERK_JWT_TEMPLATE=t3-relay
# T3CODE_CLERK_CLI_OAUTH_CLIENT_ID=oauthapp_...
# Optional: signed macOS passkey builds. The RP domain defaults to the Frontend API
# hostname encoded in T3CODE_CLERK_PUBLISHABLE_KEY. Set the override only when Clerk
# returns a different RP ID or when multiple domains must be entitled.
# T3CODE_APPLE_TEAM_ID=ABC1234567
# T3CODE_MACOS_PROVISIONING_PROFILE=/absolute/path/to/t3code.provisionprofile
# T3CODE_CLERK_PASSKEY_RP_DOMAINS=example.clerk.accounts.dev,clerk.example.com
# Get this from your relay deployment. `infra/relay` deploys update it automatically.
# T3CODE_RELAY_URL=https://relay.example.com
# Optional: hosted app origin used by the CLI's out-of-band OAuth flow.
# Defaults to https://app.t3.codes; override to test against a staging deployment.
# T3CODE_HOSTED_APP_URL=https://nightly.app.t3.codes
# Public, ingest-only mobile OpenTelemetry configuration.
# T3CODE_MOBILE_OTLP_TRACES_URL=https://api.axiom.co/v1/traces
# T3CODE_MOBILE_OTLP_TRACES_DATASET=t3-code-mobile-traces-dev
# T3CODE_MOBILE_OTLP_TRACES_TOKEN=xaat-...
+3
View File
@@ -30,3 +30,6 @@ github:Yash-Singh1
github:eggfriedrice24
github:Ymit24
github:shivamhwp
github:jappyjan
github:justsomelegs
github:UtkarshUsername
+67 -60
View File
@@ -7,88 +7,95 @@ on:
- main
jobs:
quality:
name: Format, Lint, Typecheck, Test, Browser Test, Build
runs-on: blacksmith-4vcpu-ubuntu-2404
check:
name: Check
runs-on: blacksmith-8vcpu-ubuntu-2404
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
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Cache Bun and Turbo
uses: actions/cache@v5
with:
path: |
~/.bun/install/cache
.turbo
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
restore-keys: |
${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- name: Cache Playwright browsers
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Format
run: bun run fmt:check
- name: Lint
run: bun run lint
- name: Check
run: vp check
- name: Typecheck
run: bun run typecheck
- name: Test
run: bun run test
- name: Install browser test runtime
run: |
cd apps/web
bunx playwright install --with-deps chromium
- name: Browser test
run: bun run --cwd apps/web test:browser
run: vpr typecheck
- name: Build desktop pipeline
run: bun run build:desktop
run: vp run build:desktop
- name: Verify preload bundle output
run: |
test -f apps/desktop/dist-electron/preload.js
grep -nE "desktopBridge|getWsUrl|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.js
test -f apps/desktop/dist-electron/preload.cjs
grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
grep -n "__clerk_internal_electron_passkeys" apps/desktop/dist-electron/preload.cjs
release_smoke:
name: Release Smoke
runs-on: ubuntu-24.04
test:
name: Test
runs-on: blacksmith-8vcpu-ubuntu-2404
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
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Ensure Electron runtime is installed
run: vp run --filter @t3tools/desktop ensure:electron
- name: Test
run: vp run test
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 Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Install mobile native static analysis tools
run: brew bundle install --file apps/mobile/Brewfile
- name: Lint mobile native sources
run: vp run lint:mobile
release_smoke:
name: Release Smoke
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Exercise release-only workflow steps
run: node scripts/release-smoke.ts
+80
View File
@@ -0,0 +1,80 @@
name: Deploy T3 Connect relay
on:
push:
branches:
- main
permissions:
contents: read
id-token: none
statuses: write
concurrency:
group: relay-production
cancel-in-progress: false
jobs:
deploy_relay:
name: Deploy production relay
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 15
environment:
name: production
env:
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
PLANETSCALE_ORGANIZATION: ${{ vars.PLANETSCALE_ORGANIZATION }}
AXIOM_ORG_ID: ${{ vars.AXIOM_ORG_ID }}
RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
RELAY_TUNNEL_ZONE_NAME: ${{ vars.RELAY_TUNNEL_ZONE_NAME }}
CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
CLERK_JWT_AUDIENCE: ${{ vars.CLERK_JWT_AUDIENCE }}
APNS_ENVIRONMENT: ${{ vars.APNS_ENVIRONMENT }}
APNS_TEAM_ID: ${{ vars.APNS_TEAM_ID }}
APNS_KEY_ID: ${{ vars.APNS_KEY_ID }}
APNS_BUNDLE_ID: ${{ vars.APNS_BUNDLE_ID }}
ALCHEMY_TELEMETRY_DISABLED: "1"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Deploy production relay stage
id: deploy
run: vp run --filter t3code-relay deploy --stage prod --yes --github-output
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
PLANETSCALE_API_TOKEN_ID: ${{ secrets.PLANETSCALE_API_TOKEN_ID }}
PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
- name: Publish relay deploy commit status
uses: actions/github-script@v8
with:
script: |
const result = "${{ steps.deploy.outputs.result }}";
const changed = "${{ steps.deploy.outputs.changed }}" === "true";
const description = changed
? "Relay production deploy applied infrastructure changes."
: result === "noop"
? "Relay production deploy was a no-op."
: `Relay production deploy completed with result: ${result}.`;
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: "success",
context: "Relay deploy / production",
description,
target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
});
+83
View File
@@ -0,0 +1,83 @@
name: Mobile EAS Preview
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
jobs:
preview:
name: EAS Preview
if: contains(github.event.pull_request.labels.*.name, '🚀 Mobile Continuous Deployment')
runs-on: blacksmith-8vcpu-ubuntu-2404
permissions:
contents: read
pull-requests: write
env:
APP_VARIANT: preview
NODE_OPTIONS: --max-old-space-size=8192
MOBILE_VERSION_POLICY: fingerprint
steps:
- id: expo-token
name: Check for EXPO_TOKEN
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: |
if [ -n "$EXPO_TOKEN" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "EXPO_TOKEN is not available; skipping EAS preview."
fi
- name: Checkout
if: steps.expo-token.outputs.present == 'true'
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Expose pnpm
if: steps.expo-token.outputs.present == 'true'
run: |
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
"$vp_pnpm_bin/pnpm" --version
- name: Setup EAS
if: steps.expo-token.outputs.present == 'true'
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
# npm, not pnpm: this only installs eas-cli into the action's own
# tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
# ignored build script (no allowBuilds config outside the repo).
packager: npm
- name: Pull preview environment variables
if: steps.expo-token.outputs.present == 'true'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: eas env:pull preview --non-interactive
- name: Deploy with fingerprint check
if: steps.expo-token.outputs.present == 'true'
uses: expo/expo-github-action/continuous-deploy-fingerprint@main
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
with:
profile: preview:dev
branch: pr-${{ github.event.pull_request.number }}
platform: all
environment: preview
working-directory: apps/mobile
github-token: ${{ secrets.GITHUB_TOKEN }}
+113
View File
@@ -0,0 +1,113 @@
name: Mobile EAS Production
# Production builds and OTA updates run from CI (Linux) — never from a laptop.
# Under the fingerprint runtime-version policy the fingerprint must be computed
# in the same OS/pnpm as the EAS build; a macOS `eas build` computes a different
# fingerprint (platform-specific deps + pnpm version) and errors. On this Linux
# runner, with corepack pinning pnpm 10.24 in eas.json, local == build.
on:
workflow_dispatch:
inputs:
mode:
description: "build (+ auto-submit to TestFlight) or update (OTA)"
required: true
type: choice
default: build
options:
- build
- update
platform:
description: "Target platform"
required: true
type: choice
default: ios
options:
- ios
- android
- all
message:
description: "OTA update message (mode=update only)"
required: false
type: string
jobs:
production:
name: EAS Production ${{ inputs.mode }}
runs-on: blacksmith-8vcpu-ubuntu-2404
permissions:
contents: read
env:
APP_VARIANT: production
NODE_OPTIONS: --max-old-space-size=8192
steps:
- id: expo-token
name: Check for EXPO_TOKEN
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: |
if [ -n "$EXPO_TOKEN" ]; then
echo "present=true" >> "$GITHUB_OUTPUT"
else
echo "present=false" >> "$GITHUB_OUTPUT"
echo "EXPO_TOKEN is not available; skipping EAS production job."
fi
- name: Checkout
if: steps.expo-token.outputs.present == 'true'
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Vite+
if: steps.expo-token.outputs.present == 'true'
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Expose pnpm
if: steps.expo-token.outputs.present == 'true'
run: |
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
"$vp_pnpm_bin/pnpm" --version
- name: Setup EAS
if: steps.expo-token.outputs.present == 'true'
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
# npm, not pnpm: this only installs eas-cli into the action's own
# tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
# ignored build script (no allowBuilds config outside the repo).
packager: npm
- name: Pull production environment variables
if: steps.expo-token.outputs.present == 'true'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: eas env:pull production --non-interactive
- name: Build and submit
if: steps.expo-token.outputs.present == 'true' && inputs.mode == 'build'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: eas build --platform ${{ inputs.platform }} --profile production --auto-submit --non-interactive --no-wait
- name: Publish OTA update
if: steps.expo-token.outputs.present == 'true' && inputs.mode == 'update'
working-directory: apps/mobile
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
run: |
eas update \
--channel production \
--environment production \
--platform ${{ inputs.platform }} \
--message "${{ inputs.message || format('Production OTA ({0})', github.sha) }}" \
--non-interactive
@@ -0,0 +1,134 @@
name: Mobile Showcase Screenshots
on:
workflow_dispatch:
inputs:
platform:
description: Device platforms to capture
required: true
default: all
type: choice
options:
- all
- ios
- android
appearance:
description: System appearances to capture
required: true
default: both
type: choice
options:
- both
- dark
- light
permissions:
contents: read
env:
NODE_OPTIONS: --max-old-space-size=8192
jobs:
ios:
name: iPhone 6.9, iPhone 6.5, and iPad 13
if: inputs.platform == 'all' || inputs.platform == 'ios'
runs-on: blacksmith-12vcpu-macos-26
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Expose pnpm
run: |
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
"$vp_pnpm_bin/pnpm" --version
- name: Capture iOS showcase
run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}"
- name: Validate App Store Connect assets
run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --validate-only
- name: Upload iOS screenshots
if: always()
uses: actions/upload-artifact@v7
with:
name: app-store-connect-screenshots
path: artifacts/app-store/screenshots/apple/
if-no-files-found: warn
retention-days: 14
android:
name: Android phone, 7-inch tablet, and 10-inch tablet
if: inputs.platform == 'all' || inputs.platform == 'android'
runs-on: blacksmith-16vcpu-ubuntu-2404
timeout-minutes: 60
env:
T3_SHOWCASE_ANDROID_ABI: x86_64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version-file: package.json
cache: true
run-install: true
- name: Expose pnpm
run: |
pnpm_version="$(node --print "require('./package.json').packageManager.split('@').pop()")"
vp_pnpm_bin="$HOME/.vite-plus/package_manager/pnpm/$pnpm_version/pnpm/bin"
echo "$vp_pnpm_bin" >> "$GITHUB_PATH"
"$vp_pnpm_bin/pnpm" --version
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Setup Gradle cache
uses: gradle/actions/setup-gradle@v5
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Capture Android showcase
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 36
target: google_apis
arch: x86_64
profile: pixel_7_pro
avd-name: Pixel_10_Pro
cores: 8
ram-size: 4096M
disable-animations: false
script: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}"
- name: Validate Google Play assets
run: pnpm screenshots:mobile --platform android --appearance "${{ inputs.appearance }}" --validate-only
- name: Upload Android screenshots
if: always()
uses: actions/upload-artifact@v7
with:
name: google-play-screenshots
path: artifacts/app-store/screenshots/google-play/
if-no-files-found: warn
retention-days: 14
+3
View File
@@ -124,6 +124,9 @@ 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:
File diff suppressed because it is too large. Load diff
+14
View File
@@ -5,6 +5,7 @@ node_modules
*.log
*.tsbuildinfo
apps/*/dist
infra/*/dist
.astro
packages/*/dist
.env
@@ -21,3 +22,16 @@ apps/web/src/components/__screenshots__
.vitest-*
__screenshots__/
.tanstack
squashfs-root/
.vercel
.gstack/
dist-electron/
.electron-runtime/
.showcase/
apps/mobile/.showcase/
artifacts/app-store/screenshots/
node_modules/
.alchemy/
*.log
.env*
!.env.example
@@ -0,0 +1,92 @@
---
title: Effect Service Conventions
model: claude-opus-4-8
effort: high
input: full_diff
tools:
- browse_code
- git_tools
- github_api_read_only
- modify_pr
include:
- "apps/**/*.ts"
- "apps/**/*.tsx"
- "packages/**/*.ts"
- "packages/**/*.tsx"
- "infra/**/*.ts"
- "infra/**/*.tsx"
conclusion: failure
showToolCalls: true
---
# Effect service review
Review changed TypeScript and directly affected call sites for the conventions below. Apply them when a pull request creates, moves, refactors, or consumes an Effect service. Do not demand unrelated repository-wide cleanup. Treat these instructions as authoritative when older code differs.
## Imports and module namespaces
- Import Effect library modules from their subpaths as namespaces, for example `import * as Effect from "effect/Effect"` and `import * as Layer from "effect/Layer"`. Flag consolidated named imports from `"effect"` in touched Effect service code.
- At a service boundary, import the local service module as a namespace and use its public module shape: `WorkspacePaths.WorkspacePaths`, `WorkspacePaths.make`, and `WorkspacePaths.layer`. Flag aliases such as `import { layer as workspacePathsLayer }` that erase the module namespace.
- Namespace imports are not a blanket rule. Keep named imports for whole packages such as `@t3tools/contracts`, and for modules used only for a pure helper, error, schema, config value, or standalone type. Do not request `import type * as Contracts`.
- A package subpath that is itself a service module may use a namespace import when callers access its service/tag, `make`, or `layer` members.
- When a barrel exposes an entire service module, prefer `export * as TokenStore from "./tokenStore.ts"` so consumers can use `TokenStore.TokenStore` and `TokenStore.layer`. Do not individually rename `make` and `layer` exports to simulate a namespace.
## Service definition
- Use the canonical single-file order: imports, error/schema declarations, the `Context.Service` tag with its inline interface, `make`, then `layer`.
- Keep a service's schemas/errors, `Context.Service` tag, construction, and layer in one canonical module when they form one implementation.
- Define the service interface inline in the `Context.Service` declaration. Do not retain a standalone `FooShape` or `FooServiceShape` interface/type.
- Refer to the inferred service interface as `Foo["Service"]`, including in mechanically updated orchestration, MCP, tests, and integration harnesses.
- Export a real `make` when the module owns construction. Do not create `make = Effect.succeed(...)` solely to force `Layer.effect`.
- Export the canonical layer as `export const layer = Layer...`. `Layer.effect` is not required: use `Layer.succeed`, `Layer.scoped`, or another appropriate constructor when that matches the implementation.
- In a concrete implementation module already named for the implementation, use plain `make` and `layer` (for example `BunPtyAdapter.ts` and `NodePtyAdapter.ts`).
- Keep implementation-specific names when an abstract port module contains one of several possible implementations, for example `makeCloudflaredRelayClient` and `layerCloudflared` in `RelayClient.ts`.
- `infra/relay/src/db.ts` is an intentional exception: an inline `Layer.succeed(RelayDb, db)` is acceptable without generic `make`/`layer` exports.
## Dependency acquisition and runtime boundaries
- Production service construction must acquire Effect service dependencies from the environment with `yield* Foo.Foo`, and its `make`/`layer` types must expose those requirements. Flag factories or constructors that accept `Foo["Service"]` (or a plain object whose methods return `Effect`) when that value is an implementation dependency owned by the service. Passing service instances explicitly is acceptable in tests and integration harnesses; passing pure configuration, immutable domain values, or deliberate callback strategies is not service injection.
- Do not hide dependencies in module globals, closures over singleton services, or `Layer.succeed` implementations that call runtime-backed or imperative APIs. Trace helpers used by a supposedly synchronous layer far enough to verify that asynchronous services are represented in the Effect environment.
- `ManagedRuntime.make`, `runPromise`, and `runPromiseExit` belong at explicit application/framework boundaries such as React, native callback, CLI, or HTTP adapters. Flag their use in domain services, repositories, persistence implementations, and service constructors. A clearly named imperative adapter may bridge an Effect service into a Promise API, but it must not become a dependency of another Effect service.
- Do not create per-feature managed runtimes or Atom runtimes to smuggle the same owned resource into multiple consumers. Compose the resource once in an application-owned layer/runtime and provide its context to integration runtimes.
- When acquisition can fail but a caller must retain fallback behavior, keep the failure typed in Effect rather than bypassing the layer through an imperative runtime. Model unavailability in service operations or with an explicit optional-service layer so downstream recovery remains visible and testable.
- During review, search touched code and affected call sites for service-instance parameters, `Layer.succeed`, `ManagedRuntime.make`, and `.runPromise`/`.runPromiseExit`. Verify that each occurrence is a legitimate test seam, pure value injection, or application boundary—not fake dependency injection or a hidden runtime.
## Errors and predicates
- Define service failures with `Schema.TaggedErrorClass` and structured attributes. Derive `message` from those attributes rather than storing an unstructured message as the only data.
- `Schema.Defect()` is not a substitute for modeling a generic error: its tag, fields, or both must identify the failure structurally, and its `message` must not merely stringify an opaque cause. A semantically precise error tag may preserve a real `cause` without inventing a redundant singleton field when no additional variable context exists; still retain any real path, resource, request, or entity context available at the wrapping site.
- Capture stable, serializable domain context such as the operation or stage, resource/path or entity identifier, and normalized category/status. Map failures where that context is known instead of wrapping an entire multi-step pipeline in one generic error. Do not add a `detail` field that merely copies `cause.message` and then use it to construct the wrapper message.
- Keep direct error attributes and log annotations safe and bounded. Do not copy raw wire payloads, command arguments or output, signed URLs, credentials, query strings, fragments, selectors, or arbitrary defect text into `detail`, `reason`, `message`, or a parallel log payload. Preserve the exact underlying value only as `cause`; expose normalized categories plus lengths/counts and safe URL protocol/hostname diagnostics where useful. Logging a sanitized error must not reintroduce a removed legacy `detail` or serialized `cause` field beside it.
- When translating or wrapping a real failure, preserve the immediate underlying error itself as `cause` alongside the structural fields so the complete error chain and stack remain available. If every construction wraps a failure, `cause` should be required; make it optional only when the same error can legitimately originate without an underlying failure.
- At a translation boundary, pass through an already structured domain error when it is part of the declared target error channel. Wrap only unknown or genuinely lower-level failures. A static factory or mapper may perform this classification when it is reused and keeps the policy next to the target error type.
- Derive the wrapper's `message` exclusively from its stable structural attributes, never from `cause`, `cause.message`, or a stringified defect. Do not replace the immediate error with only `error.cause`, erase a structured upstream error into a string, or manufacture an `Error` merely to populate `cause`. Pure validation/domain errors created without an underlying failure do not need a cause.
- Do not encode the same distinction twice with both a specific error tag and a single-value `operation`, `reason`, `kind`, or `phase` literal. Choose one coherent model: use distinct error classes and omit the redundant discriminator when callers or messages treat the failures as genuinely different, or use one service-level error with a multi-value operation discriminator and a generic message derived from that operation when the failures share the same semantics.
- Treat an error message exposed through an HTTP/RPC response, persisted state, UI, or another caller-visible boundary as behavior. Preserve those messages during a structural refactor. Existing distinct caller-visible messages are evidence that the failures should normally remain distinct error tags without redundant singleton discriminators, rather than being collapsed into a generic operation error.
- Split semantically distinct failures into separate error classes when a `reason`, `kind`, `phase`, or similar discriminator is used to choose the user-facing message or drive caller control flow. A discriminator used only for internal diagnostics may remain a field.
- Use `Schema.Union` of error classes when a shared schema, predicate, or helper type is useful.
- Export direct schema predicates such as `export const isFoo = Schema.is(Foo)`. Flag a private `Schema.is` constant wrapped by a redundant function with the same signature.
- Do not introduce a large `switch` or lookup table in an error's `message` getter to model failures that deserve separate error classes.
- Catch statically known tagged failures with `Effect.catchTags({ ... })`, including when handling only one tag. Do not use `catchIf` with a schema predicate merely to recover one or more known `_tag` variants, and do not use `catchTag`. `Effect.catch` is appropriate when the entire error channel is intentionally handled; `catchIf` remains appropriate for genuinely structural predicates such as inspecting an underlying platform error code.
- Do not add a helper whose only behavior is `(...args) => new SomeError({ ...args })`, including curried aliases used once with `mapError`. Construct the error at the failure boundary so its attributes and cause remain visible. Keep a mapper only when it performs real normalization, passes through existing domain errors, or adds reusable context/control flow.
- When a reusable error-to-error translation clearly belongs to the target error type, prefer a descriptive static factory on that error class over a detached production-side switch. Do not force a static method for one-off inline mappings.
## File layout and migrations
- When combining `domain/Services/Foo.ts` and `domain/Layers/Foo.ts`, hoist the result to `domain/Foo.ts`.
- Delete the old service/layer files. Do not leave compatibility re-export shims. Mechanically update every consumer, including orchestration, MCP, tests, and integration harnesses, to the canonical path.
- Do not flag genuinely separate implementation/adapter modules merely because they remain in an implementation-oriented directory.
- Avoid substantive orchestration or MCP redesign in service-cleanup PRs. Mechanical import, layer, and `Service["Service"]` updates are expected when required to remove obsolete paths or shapes.
## Change discipline
- Preserve useful comments, invariants, and specification documentation while moving code.
- Do not add large tests solely to prove a mechanical refactor. Update existing tests and imports as needed.
- If backend behavior changes, require focused tests. Use test implementations/layers for external services only; do not mock out core business logic.
- Do not require `Layer.effect`, universal namespace imports, generic `make`/`layer` names for abstract-port implementations, separate error classes for diagnostic-only fields, or new tests for import-only changes.
## Reporting
Report only concrete violations introduced or retained in the pull request's changed scope. Prefer precise inline comments on the smallest relevant line range and state the expected fix. A clear convention violation may fail the check. Do not fail for optional style preferences or unrelated legacy code.
This check defaults to failure. When there are no findings, stop immediately and make the entire final response exactly `All clear` on one line. Do not add a title, explanation, punctuation, Markdown, JSON, or trailing analysis, and do not continue reasoning after deciding the review is clean.
+11
View File
@@ -0,0 +1,11 @@
{
"mcpServers": {
"xcodebuildmcp": {
"command": "npx",
"args": ["--yes", "[email protected]", "mcp"],
"env": {
"XCODEBUILDMCP_ENABLED_WORKFLOWS": "simulator,ui-automation,debugging,logging"
}
}
}
}
-3
View File
@@ -1,3 +0,0 @@
[tools]
node = "24.13.1"
bun = "1.3.9"
-15
View File
@@ -1,15 +0,0 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [
".reference",
".plans",
"dist",
"dist-electron",
"node_modules",
"bun.lock",
"*.tsbuildinfo",
"**/routeTree.gen.ts",
"apps/web/public/mockServiceWorker.js"
],
"sortPackageJson": {}
}
-22
View File
@@ -1,22 +0,0 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"dist",
"dist-electron",
"node_modules",
"bun.lock",
"*.tsbuildinfo",
"**/routeTree.gen.ts"
],
"plugins": ["eslint", "oxc", "react", "unicorn", "typescript"],
"categories": {
"correctness": "warn",
"suspicious": "warn",
"perf": "warn"
},
"rules": {
"react-in-jsx-scope": "off",
"eslint/no-shadow": "off",
"eslint/no-await-in-loop": "off"
}
}
+823
View File
@@ -0,0 +1,823 @@
# Server Auth Model Plan
## Purpose
Define the long-term server auth architecture for T3 Code before first-class remote environments ship.
This plan is deliberately broader than the current WebSocket token check and narrower than a complete remote collaboration system. The goal is to make the server secure by default, keep local desktop UX frictionless, and leave clean integration points for future remote access methods.
This document is written in terms of Effect-native services and layers because auth needs to be a core runtime concern, not route-local glue code.
## Primary goals
- Make auth server-wide, not WebSocket-only.
- Make insecure exposure hard to do accidentally.
- Preserve zero-login local desktop UX for desktop-managed environments.
- Support browser-native pairing and session auth.
- Leave room for native/mobile credentials later without rewriting the server boundary.
- Keep auth separate from transport and launch method.
## Non-goals
- Full multi-user authorization and RBAC.
- OAuth / SSO / enterprise identity.
- Passkeys or biometric UX in v1.
- Syncing auth state across environments.
- Designing the full remote environment product in this document.
## Core decisions
### 1. Auth is a server concern
Every privileged surface of the T3 server must go through the same auth policy engine:
- HTTP routes
- WebSocket upgrades
- RPC methods reached through WebSocket
The current split where [`/ws`](../apps/server/src/ws.ts) checks `authToken` but routes in [`http.ts`](../apps/server/src/http.ts) do not is not sufficient for a remote-capable product.
### 2. Pairing and session are different things
The system should distinguish:
- bootstrap credentials
- session credentials
Bootstrap credentials are short-lived and high-trust. They allow a client to become authenticated.
Session credentials are the durable credentials used after pairing.
Bootstrap should never become the long-lived request credential.
### 3. Auth and transport are separate
Auth must not be defined by how the client reached the server.
Examples:
- local desktop-managed server
- LAN `ws://`
- public `wss://`
- tunneled `wss://`
- SSH-forwarded `ws://127.0.0.1:<port>`
All of these should feed into the same auth model.
### 4. Exposure level changes defaults
The more exposed an environment is, the narrower the safe default should be.
Safe default expectations:
- local desktop-managed: auto-pair allowed
- loopback browser access: explicit bootstrap allowed
- non-loopback bind: auth required
- tunnel/public endpoint: auth required, explicit enablement required
### 5. Browser and native clients may use different session credentials
The auth model should support more than one session credential type even if only one ships first.
Examples:
- browser session cookie
- native bearer/device token
This should be represented in the model now, even if browser cookies are the first implementation.
## Target auth domain
### Route classes
Every route or transport entrypoint should be classified as one of:
1. `public`
2. `bootstrap`
3. `authenticated`
#### `public`
Unauthenticated by definition.
Should be extremely small. Examples:
- static shell needed to render the pairing/login UI
- favicon/assets required for the pairing screen
- a minimal server health/version endpoint if needed
#### `bootstrap`
Used only to exchange a bootstrap credential for a session.
Examples:
- Initial bootstrap envelope over file descriptor at startup
- `POST /api/auth/bootstrap`
- `GET /api/auth/session` if unauthenticated checks are part of bootstrap UX
#### `authenticated`
Everything that reveals machine state or mutates it.
Examples:
- WebSocket upgrade
- orchestration snapshot and events
- terminal open/write/close
- project search and file writes
- git routes
- attachments
- project favicon lookup
- server settings
The default stance should be: if it touches the machine, it is authenticated.
## Credential model
### Bootstrap credentials
Initial credential types to model:
- `desktop-bootstrap`
- `one-time-token`
Possible future credential types:
- `device-code`
- `passkey-assertion`
- `external-identity`
#### `desktop-bootstrap`
Used when the desktop shell manages the server and should be the only default pairing method for desktop-local environments.
Properties:
- launcher-provided
- short-lived
- one-time or bounded-use
- never shown to the user as a reusable password
#### `one-time-token`
Used for explicit browser/mobile pairing flows.
Properties:
- short TTL
- one-time use
- safe to embed in a pairing URL fragment
- exchanged for a session credential
### Session credentials
Initial credential types to model:
- `browser-session-cookie`
- `bearer-session-token`
#### `browser-session-cookie`
Primary browser credential.
Properties:
- signed
- `HttpOnly`
- bounded lifetime
- revocable by server key rotation or session invalidation
#### `bearer-session-token`
Reserved for native/mobile or non-browser clients.
Properties:
- opaque token, not a bootstrap secret
- long enough lifetime to survive reconnects
- stored in secure client storage when available
## Auth policy model
Auth behavior should be driven by an explicit environment auth policy, not route-local heuristics.
### Policy examples
#### `DesktopManagedLocalPolicy`
Default for desktop-managed local server.
Allowed bootstrap methods:
- `desktop-bootstrap`
Allowed session methods:
- `browser-session-cookie`
Disabled by default:
- `one-time-token`
- `bearer-session-token`
- password login
- public pairing
#### `LoopbackBrowserPolicy`
Used for browser access on localhost without desktop-managed bootstrap.
Allowed bootstrap methods:
- `one-time-token`
Allowed session methods:
- `browser-session-cookie`
#### `RemoteReachablePolicy`
Used when binding non-loopback or using an explicit remote/tunnel workflow.
Allowed bootstrap methods:
- `one-time-token`
- possibly `desktop-bootstrap` when a desktop shell is brokering access
Allowed session methods:
- `browser-session-cookie`
- `bearer-session-token`
#### `UnsafeNoAuthPolicy`
Should exist only as an explicit escape hatch.
Requirements:
- explicit opt-in flag
- loud startup warnings
- never defaulted automatically
## Effect-native service model
### `ServerAuth`
The main auth facade used by HTTP routes and WebSocket upgrade handling.
Responsibilities:
- classify requests
- authenticate requests
- authorize bootstrap attempts
- create sessions from bootstrap credentials
- enforce policy by environment mode
Sketch:
```ts
export interface ServerAuthShape {
readonly getCapabilities: Effect.Effect<AuthCapabilities>;
readonly authenticateHttpRequest: (
request: HttpServerRequest.HttpServerRequest,
routeClass: RouteAuthClass,
) => Effect.Effect<AuthContext, AuthError>;
readonly authenticateWebSocketUpgrade: (
request: HttpServerRequest.HttpServerRequest,
) => Effect.Effect<AuthContext, AuthError>;
readonly exchangeBootstrapCredential: (
input: BootstrapExchangeInput,
) => Effect.Effect<SessionGrant, AuthError>;
}
export class ServerAuth extends ServiceMap.Service<ServerAuth, ServerAuthShape>()(
"t3/ServerAuth",
) {}
```
### `BootstrapCredentialService`
Owns issuance, storage, validation, and consumption of bootstrap credentials.
Responsibilities:
- issue desktop bootstrap grants
- issue one-time pairing tokens
- validate TTL and single-use semantics
- consume bootstrap grants atomically
Sketch:
```ts
export interface BootstrapCredentialServiceShape {
readonly issueDesktopBootstrap: (
input: IssueDesktopBootstrapInput,
) => Effect.Effect<BootstrapCredential>;
readonly issueOneTimeToken: (
input: IssueOneTimeTokenInput,
) => Effect.Effect<BootstrapCredential>;
readonly consume: (
presented: PresentedBootstrapCredential,
) => Effect.Effect<ConsumedBootstrapCredential, BootstrapCredentialError>;
}
```
### `SessionCredentialService`
Owns creation and validation of authenticated sessions.
Responsibilities:
- mint cookie sessions
- mint bearer sessions
- validate active session credentials
- revoke sessions if needed later
Sketch:
```ts
export interface SessionCredentialServiceShape {
readonly createBrowserSession: (
input: CreateSessionFromBootstrapInput,
) => Effect.Effect<BrowserSessionGrant, SessionCredentialError>;
readonly createBearerSession: (
input: CreateSessionFromBootstrapInput,
) => Effect.Effect<BearerSessionGrant, SessionCredentialError>;
readonly authenticateCookie: (
request: HttpServerRequest.HttpServerRequest,
) => Effect.Effect<AuthContext, SessionCredentialError>;
readonly authenticateBearer: (
request: HttpServerRequest.HttpServerRequest,
) => Effect.Effect<AuthContext, SessionCredentialError>;
}
```
### `ServerAuthPolicy`
Pure policy/config service that decides which credential types are allowed.
Responsibilities:
- map runtime mode and bind/exposure settings to allowed auth methods
- answer whether a route can be public
- answer whether remote exposure requires auth
This should stay mostly pure and cheap to test.
### `ServerSecretStore`
Owns long-lived server signing keys and secrets.
Responsibilities:
- get or create signing key
- rotate signing key
- abstract secure OS-backed storage vs filesystem fallback
Important:
- prefer platform secure storage when available
- support hardened filesystem fallback for headless/server-only environments
### `BrowserSessionCookieCodec`
Focused utility service for cookie encode/decode/signing behavior.
This should not own policy. It should only own the cookie format.
### `AuthRouteGuards`
Thin helper layer used by routes to enforce auth consistently.
Responsibilities:
- require auth for HTTP route handlers
- classify route auth mode
- convert auth failures into `401` / `403`
This prevents every route from re-implementing the same pattern.
Integrates with `HttpRouter.middleware` to enforce auth consistently.
## Suggested layer graph
```text
ServerSecretStore
├─> BootstrapCredentialService
├─> BrowserSessionCookieCodec
└─> SessionCredentialService
ServerAuthPolicy
├─> BootstrapCredentialService
├─> SessionCredentialService
└─> ServerAuth
ServerAuth
└─> AuthRouteGuards
```
Layer naming should follow existing repo style:
- `ServerSecretStoreLive`
- `BootstrapCredentialServiceLive`
- `SessionCredentialServiceLive`
- `ServerAuthPolicyLive`
- `ServerAuthLive`
- `AuthRouteGuardsLive`
## High-level implementation examples
### Example: WebSocket upgrade auth
Current state:
- `authToken` query param is checked in [`ws.ts`](../apps/server/src/ws.ts)
Target shape:
```ts
const websocketUpgradeAuth = HttpMiddleware.make((httpApp) =>
Effect.gen(function* () {
const request = yield* HttpServerRequest.HttpServerRequest;
const serverAuth = yield* ServerAuth;
yield* serverAuth.authenticateWebSocketUpgrade(request);
return yield* httpApp;
}),
);
```
Then the `/ws` route becomes:
```ts
export const websocketRpcRouteLayer = HttpRouter.add(
"GET",
"/ws",
rpcWebSocketHttpEffect.pipe(
websocketUpgradeAuth,
Effect.catchTag("AuthError", (error) => toUnauthorizedResponse(error)),
),
);
```
This keeps the route itself declarative and makes auth compose like normal HTTP middleware.
### Example: authenticated HTTP route
For routes like attachments or project favicon:
```ts
const authenticatedRoute = (routeClass: RouteAuthClass) =>
HttpMiddleware.make((httpApp) =>
Effect.gen(function* () {
const request = yield* HttpServerRequest.HttpServerRequest;
const serverAuth = yield* ServerAuth;
yield* serverAuth.authenticateHttpRequest(request, routeClass);
return yield* httpApp;
}),
);
```
Then:
```ts
export const attachmentsRouteLayer = HttpRouter.add(
"GET",
`${ATTACHMENTS_ROUTE_PREFIX}/*`,
serveAttachment.pipe(
authenticatedRoute(RouteAuthClass.Authenticated),
Effect.catchTag("AuthError", (error) => toUnauthorizedResponse(error)),
),
);
```
### Example: desktop bootstrap exchange
The desktop shell launches the local server and gets a short-lived bootstrap grant through a trusted side channel.
That grant is then exchanged for a browser cookie session when the renderer loads.
Sketch:
```ts
const pairDesktopRenderer = Effect.gen(function* () {
const bootstrapService = yield* BootstrapCredentialService;
const credential = yield* bootstrapService.issueDesktopBootstrap({
audience: "desktop-renderer",
ttlMs: 30_000,
});
return credential;
});
```
The renderer then calls a bootstrap endpoint and receives a cookie session. The bootstrap credential is consumed and becomes invalid.
### Example: one-time pairing URL
For browser-driven pairing:
```ts
const createPairingToken = Effect.gen(function* () {
const bootstrapService = yield* BootstrapCredentialService;
return yield* bootstrapService.issueOneTimeToken({
ttlMs: 5 * 60_000,
audience: "browser",
});
});
```
The server can emit a pairing URL where the token lives in the URL fragment so it is not automatically sent to the server before the client explicitly exchanges it.
## Sequence diagrams
These flows are meant to anchor the auth model in concrete user journeys.
The important invariant across all of them is:
- access method is not the auth method
- launch method is not the auth method
- bootstrap credential is not the session credential
### Normal desktop user
This is the default desktop-managed local flow.
The desktop shell is trusted to bootstrap the local renderer, but the renderer should still exchange that one-time bootstrap grant for a normal browser session cookie.
```text
Participants:
DesktopMain = Electron main
SecretStore = secure local secret backend
T3Server = local backend child process
Frontend = desktop renderer
DesktopMain -> SecretStore : getOrCreate("server-signing-key")
SecretStore --> DesktopMain : signing key available
DesktopMain -> T3Server : spawn server (--bootstrap-fd ...)
DesktopMain -> T3Server : send desktop bootstrap envelope
note over T3Server : policy = DesktopManagedLocalPolicy
note over T3Server : allowed pairing = desktop-bootstrap only
Frontend -> DesktopMain : request local bootstrap grant
DesktopMain --> Frontend : short-lived desktop bootstrap grant
Frontend -> T3Server : POST /api/auth/bootstrap
T3Server -> T3Server : validate desktop bootstrap grant
T3Server -> T3Server : create browser session
T3Server --> Frontend : Set-Cookie: session=...
Frontend -> T3Server : GET /ws + authenticated cookie
T3Server -> T3Server : validate cookie session
T3Server --> Frontend : websocket accepted
```
### `npx t3` user
This is the standalone local server flow.
There is no trusted desktop shell here, so pairing should be explicit.
```text
Participants:
UserShell = npx t3 launcher
T3Server = standalone local server
Browser = browser tab
UserShell -> T3Server : start server
T3Server -> T3Server : getOrCreate("server-signing-key")
note over T3Server : policy = LoopbackBrowserPolicy
UserShell -> T3Server : issue one-time pairing token
T3Server --> UserShell : pairing URL or pairing token
UserShell --> Browser : open /pair?token=...
Browser -> T3Server : GET /pair?token=...
T3Server -> T3Server : validate one-time token
T3Server -> T3Server : create browser session
T3Server --> Browser : Set-Cookie: session=...
T3Server --> Browser : redirect to app
Browser -> T3Server : GET /ws + authenticated cookie
T3Server --> Browser : websocket accepted
```
### Phone user with tunneled host
This is the explicit remote access flow for a browser on another device.
The tunnel only provides reachability. It must not imply trust.
Recommended UX:
- desktop shows a QR code
- desktop also shows a copyable pairing URL
- if the phone opens the host URL without a valid token, the server should render a login or pairing screen rather than granting access
```text
Participants:
DesktopUser = user at the host machine
DesktopMain = desktop app
Tunnel = tunnel provider
T3Server = T3 server
PhoneBrowser = mobile browser
DesktopUser -> DesktopMain : enable remote access via tunnel
DesktopMain -> T3Server : switch policy to RemoteReachablePolicy
DesktopMain -> Tunnel : publish local T3 endpoint
Tunnel --> DesktopMain : public https/wss URL
DesktopMain -> T3Server : issue one-time pairing token
T3Server --> DesktopMain : pairing token
DesktopMain -> DesktopUser : show QR code / shareable URL
DesktopUser -> PhoneBrowser : scan QR / open URL
PhoneBrowser -> Tunnel : GET https://public-host/pair?token=...
Tunnel -> T3Server : forward request
T3Server -> T3Server : validate one-time token
T3Server -> T3Server : create mobile browser session
T3Server --> PhoneBrowser : Set-Cookie: session=...
T3Server --> PhoneBrowser : redirect to app
PhoneBrowser -> Tunnel : GET /ws + authenticated cookie
Tunnel -> T3Server : forward websocket upgrade
T3Server --> PhoneBrowser : websocket accepted
```
### Phone user with private network
This is operationally similar to the tunnel flow, but the access endpoint is on a private network such as Tailscale.
The auth flow should stay the same.
```text
Participants:
DesktopUser = user at the host machine
T3Server = T3 server
PrivateNet = tailscale / private LAN
PhoneBrowser = mobile browser
DesktopUser -> T3Server : enable private-network access
T3Server -> T3Server : switch policy to RemoteReachablePolicy
DesktopUser -> T3Server : issue one-time pairing token
T3Server --> DesktopUser : pairing URL / QR
DesktopUser -> PhoneBrowser : open private-network URL
PhoneBrowser -> PrivateNet : GET http(s)://private-host/pair?token=...
PrivateNet -> T3Server : route request
T3Server -> T3Server : validate one-time token
T3Server -> T3Server : create mobile browser session
T3Server --> PhoneBrowser : Set-Cookie: session=...
T3Server --> PhoneBrowser : redirect to app
PhoneBrowser -> PrivateNet : GET /ws + authenticated cookie
PrivateNet -> T3Server : websocket upgrade
T3Server --> PhoneBrowser : websocket accepted
```
### Desktop user adding new SSH hosts
SSH should be treated as launch and reachability plumbing, not as the long-term auth model.
The desktop app uses SSH to start or reach the remote server, then the renderer pairs against that server using the same bootstrap/session split as every other environment.
```text
Participants:
DesktopUser = local desktop user
DesktopMain = desktop app
SSH = ssh transport/session
RemoteHost = remote machine
RemoteT3 = remote T3 server
Frontend = desktop renderer
DesktopUser -> DesktopMain : add SSH host
DesktopMain -> SSH : connect to remote host
SSH -> RemoteHost : probe environment / verify t3 availability
DesktopMain -> SSH : run remote launch command
SSH -> RemoteHost : t3 remote launch --json
RemoteHost -> RemoteT3 : start or reuse server
RemoteT3 --> RemoteHost : port + environment metadata
RemoteHost --> SSH : launch result JSON
SSH --> DesktopMain : remote server details
DesktopMain -> SSH : establish local port forward
SSH --> DesktopMain : localhost:FORWARDED_PORT ready
note over RemoteT3 : policy = RemoteReachablePolicy
note over DesktopMain,RemoteT3 : desktop may use a trusted bootstrap flow here
Frontend -> DesktopMain : request bootstrap for selected environment
DesktopMain --> Frontend : short-lived bootstrap grant
Frontend -> RemoteT3 : POST /api/auth/bootstrap via forwarded port
RemoteT3 -> RemoteT3 : validate bootstrap grant
RemoteT3 -> RemoteT3 : create browser session
RemoteT3 --> Frontend : Set-Cookie: session=...
Frontend -> RemoteT3 : GET /ws + authenticated cookie
RemoteT3 --> Frontend : websocket accepted
```
## Storage decisions
### Server secrets
Use a `ServerSecretStore` abstraction.
Preferred order (use a layer for each, resolve on startup):
1. OS secure storage if available
2. hardened filesystem fallback if not
The filesystem fallback should store only opaque signing material with strict file permissions. It should not store user passwords or reusable third-party credentials.
### Client credentials
Client-side credential persistence should prefer secure storage when available:
- desktop: OS keychain / secure store
- mobile: platform secure storage
- browser: cookie session for browser auth
This concern should stay in the client shell/runtime layer, not the server auth layer.
## What to build now
These are the parts worth building before remote environments ship:
1. `ServerAuth` service boundary.
2. route classification and route guards.
3. `ServerSecretStore` abstraction.
4. bootstrap vs session credential split.
5. browser session cookie codec as one session method.
6. explicit auth capabilities/config surfaced in contracts.
Even if only one pairing flow is used initially, these seams will keep future remote and mobile work contained.
## What to add as part of first remote-capable auth
1. Browser pairing flow using one-time bootstrap token and cookie session.
2. Desktop-managed auto-bootstrap for the local desktop-managed environment.
3. Auth-required defaults for any non-loopback or explicitly published server.
4. Explicit environment auth policy selection instead of scattered `if (host !== localhost)` checks.
## What to defer
- passkeys / WebAuthn
- iCloud Keychain / Face ID-specific UX
- multi-user permissions
- collaboration roles
- OAuth / SSO
- polished session management UI
- complex device approval flows
These can all sit on top of the same bootstrap/session/service split.
## Relationship to future remote environments
Remote access is one reason this auth model matters, but the auth model should not be remote-shaped.
Keep the design focused on:
- one T3 server
- one auth policy
- multiple credential types
- multiple future access methods
That keeps the server auth model stable even as access methods expand later.
## Recommended implementation order
### Phase 1
- Introduce route auth classes.
- Add `ServerAuth` and `AuthRouteGuards`.
- Move existing `authToken` check behind `ServerAuth`.
- Require auth for all privileged HTTP routes as well as WebSocket.
### Phase 2
- Add `ServerSecretStore` service with platform-specific layer implementations.
- `layerOSXKeychain`, `layer
- Add bootstrap/session split.
- Add browser session cookie support.
- Add one-time bootstrap exchange endpoint.
### Phase 3
- Add desktop bootstrap flow on top of the same services.
- Make desktop-managed local environments default to bootstrap-only pairing.
- Surface auth capabilities in shared contracts and renderer bootstrap.
### Phase 4
- Add non-browser bearer session support if mobile/native needs it.
- Add richer policy modes for remote-reachable environments.
## Acceptance criteria
- No privileged HTTP or WebSocket path bypasses auth policy.
- Local desktop-managed flows still avoid a visible login screen.
- Non-loopback or published environments require explicit authenticated pairing by default.
- Bootstrap and session credentials are distinct in code and in behavior.
- Auth logic is centralized in Effect services/layers rather than route-local branching.
+349
View File
@@ -0,0 +1,349 @@
# 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`
@@ -0,0 +1,216 @@
# Version Control Phase 1: VCS Driver Foundation
## Goal
Introduce a provider-neutral VCS layer and rewrite the local Git implementation as an Effect-native driver. This phase should preserve user-visible behavior while replacing the Git-first service boundary with an abstraction that can support Git, Jujutsu, and later Sapling or another viable VCS.
The existing `GitCore` implementation is a behavior reference and source of regression tests, not the target architecture. New code should follow the newer package style used by `effect-acp` and `effect-codex-app-server`: typed service tags, schema-backed tagged errors, scoped process usage, explicit decode boundaries, and no Promise-based process helper as the core execution primitive.
## Scope
- Add VCS-domain contracts in `packages/contracts/src/vcs.ts`.
- Add shared runtime parsing helpers in `packages/shared/src/vcs/*` only when they are useful to both server and web.
- Add server services under `apps/server/src/vcs`:
- `Services/VcsDriver.ts`
- `Services/VcsRepositoryResolver.ts`
- `Services/VcsProcess.ts`
- `Layers/GitVcsDriver.ts`
- `errors.ts`
- Migrate server callers from Git-specific terms where the operation is actually VCS-generic.
- Update active consumers to the new VCS APIs in the same phase; do not add backwards-compatible export shims.
- Leave source-control hosting providers out of this phase except for remote metadata needed to describe repository status.
## Non-Goals
- No GitLab, Azure DevOps, or GitHub provider rewrite yet.
- No Jujutsu driver yet, but every interface must be designed so a Jujutsu driver does not have to pretend to be Git.
- No T3 Review implementation yet.
- No broad UI redesign.
## Driver Model
Use provider-neutral nouns in new APIs:
- `VcsDriver`: local repository mechanics.
- `RepositoryIdentity`: detected VCS kind, root path, common metadata path when available, remotes.
- `WorkingCopyStatus`: dirty state, changed files, aggregate insertions/deletions, current branch/bookmark/change name.
- `ChangeSet`: a committed or pending unit of change, not necessarily a Git commit.
- `RefName`: branch, bookmark, tag, or provider-specific ref.
The initial driver capabilities should be explicit:
```ts
export interface VcsDriverCapabilities {
readonly kind: "git" | "jj" | "sapling" | "unknown";
readonly supportsWorktrees: boolean;
readonly supportsBookmarks: boolean;
readonly supportsAtomicSnapshot: boolean;
readonly supportsPushDefaultRemote: boolean;
}
```
Do not model Jujutsu as `GitCoreShape extends ...`. The Git driver can expose Git-specific implementation details internally, but the public VCS layer should describe operations by intent:
- `detectRepository(cwd)`
- `status(cwd, options)`
- `listRefs(cwd, query/pagination)`
- `checkoutRef(cwd, ref)`
- `createRef(cwd, ref, from?)`
- `createWorkspace(cwd, ref, path?)`
- `removeWorkspace(path)`
- `prepareChangeContext(cwd, filePaths?)`
- `createChange(cwd, message, options)`
- `push(cwd, target?)`
- `rangeContext(cwd, base, head)`
- `listWorkspaceFiles(cwd, options)`
## Effect Process Layer
Create a small reusable `VcsProcess` service instead of using `runProcess`.
Requirements:
- Implement with `ChildProcess` and `ChildProcessSpawner` from `effect/unstable/process`.
- Support scoped acquisition/release for long-running commands and interruption.
- Support bounded stdout/stderr collection with truncation markers.
- DO not eagerly consume full stdout/stderr, return stream apis and expose helpers for consumers so we don't consume streams to memory unnecessarily...
- Support stdin.
- Support timeout through Effect scheduling/interruption, not ad-hoc timers.
- Stream output lines to progress callbacks as Effects.
- Return a typed `ProcessOutput` value for successful execution.
- Fail with typed errors, not generic thrown exceptions.
Errors should be schema-backed tagged classes, for example:
- `VcsProcessSpawnError`
- `VcsProcessExitError`
- `VcsProcessTimeoutError`
- `VcsOutputDecodeError`
- `VcsRepositoryDetectionError`
- `VcsUnsupportedOperationError`
Every error should carry operation name, command display string, cwd when applicable, exit code when applicable, stderr/stdout tails when useful, and original cause where available. Override `message` for user readable messages that provides meaning and hints where appropriate. Errors are schema backed so the full error details will be persisted and serialized properly when stored to DB/Logfiles.
## Git Driver Rewrite
Rewrite Git support against `VcsProcess`.
Carry forward current behavior from:
- `apps/server/src/git/Layers/GitCore.ts`
- `apps/server/src/git/Layers/GitCore.test.ts`
- current Git status/branch/worktree contracts
But split the implementation into smaller modules:
- command execution and hardening config
- repository detection
- status parsing
- branch/ref parsing
- worktree operations
- commit/range context generation
- push/pull operations
Keep parsing deterministic. Prefer Git porcelain formats, null-separated output, and schema decoding for JSON-like command output. Avoid regex parsing where Git gives a structured format.
## Freshness and Local Caching
Define freshness rules in the VCS layer before adding more providers. Local VCS status is cheap enough to refresh often; network-backed status is not.
Treat these as live/local:
- repository detection for the active cwd
- working copy dirty state
- staged/unstaged/untracked file summaries
- current branch/bookmark/change name
- local branch/bookmark lists
- local worktree/workspace lists
These may run on user-visible polling, but should still be debounced and coalesced per repository root. Prefer filesystem-triggered invalidation where available, with a short fallback poll interval. Concurrent requests for the same repository/status shape should share one in-flight Effect.
Treat these as cached or explicit-refresh only:
- remote tracking branch refreshes
- ahead/behind counts that require network fetches
- default branch discovery from a remote provider
- remote branch lists beyond locally known refs
The VCS driver should expose freshness metadata with status results:
```ts
export interface VcsFreshness {
readonly source: "live-local" | "cached-local" | "cached-remote" | "explicit-remote";
readonly observedAt: string;
readonly expiresAt?: string;
}
```
Remote refreshes should be opt-in per operation, for example `refresh: "local-only" | "allow-cached-remote" | "force-remote"`. The default for background status should be `local-only`.
Use Effect `Cache` for repository identity and expensive local metadata:
- key by resolved repository root plus VCS kind
- invalidate on cwd/root changes and workspace mutation operations
- use short TTLs for local status caches when filesystem events are unavailable
- never hide command failures behind stale values unless the caller explicitly accepts stale data
## Cutover Policy
Prefer direct migration and deletion over compatibility wrappers.
Rules:
- Update consumers to call `VcsDriver`/`VcsRepositoryResolver` directly as soon as the new API exists.
- Delete migrated `GitCore` service methods and tests in the same PR that moves their consumers.
- Do not keep backwards-compatible export shims, barrel aliases, or old service names for convenience.
- Transitional modules are allowed only when a caller group is too complex or risky to migrate in the same PR.
- Every transitional module must have a narrow owner, a removal checklist, and a test proving it delegates to the new implementation.
- No new feature work may depend on transitional modules.
Expected transitional candidates:
- The highest-level `GitManager` orchestration can be migrated in slices if doing the full Commit + PR flow in one PR is too risky.
- WebSocket payload compatibility can remain only where changing it would require a coordinated UI/server protocol migration. Internal server code should still use the new VCS contracts.
## Tests
Add integration-style tests with real temporary Git repositories for the new Git driver:
- non-repository detection
- status for clean/dirty/untracked/staged states
- branch/ref list with pagination
- checkout/create branch
- worktree create/remove
- commit context generation with file filters
- commit creation with hook progress events
- push behavior against a local bare remote
- status polling does not perform remote network refresh by default
- concurrent duplicate status requests are coalesced
- bounded output/truncation
- timeout/interruption
- typed error shape for command failure and missing executable
Move or duplicate only the tests needed to prove behavior, then delete the old service tests in the same migration slice.
## Migration Steps
1. Add `vcs` contracts and tagged errors.
2. Add `VcsProcess` and unit tests around process execution semantics.
3. Add `VcsDriver` and `VcsRepositoryResolver` service contracts.
4. Implement `GitVcsDriver` with real Git command integration tests.
5. Move `GitStatusBroadcaster` and branch/worktree flows to the VCS service directly.
6. Move commit/range/push callers to the VCS service directly.
7. Delete migrated `GitCore` internals and tests as each caller group moves.
8. Add a transitional adapter only for any remaining `GitManager` path that is explicitly too complex to cut over safely in one PR.
9. Remove every transitional adapter before starting Phase 2 unless the adapter is documented as blocking on the provider cutover.
## Acceptance Criteria
- Current Git branch/status/worktree/commit behavior remains intact.
- New Git implementation does not depend on `processRunner.ts`.
- New errors are typed and inspectable by tests.
- VCS interfaces contain no GitHub/GitLab/Azure concepts.
- Active consumers use the new VCS APIs directly; any remaining transitional module has a written removal checklist and no compatibility export shim.
- Background status refresh is local-only by default and cannot hit provider rate limits.
- Jujutsu can be added by implementing a real driver instead of conforming to Git command semantics.
- `bun fmt`, `bun lint`, and `bun typecheck` pass.
@@ -0,0 +1,268 @@
# Version Control Phase 2: Source Control Provider Foundation
## Goal
Introduce a pluggable source-control provider layer and rewrite GitHub support as an Effect-native provider. This phase should preserve the existing GitHub Commit + PR flow while making GitLab and Azure DevOps additive drivers rather than branches inside GitHub-oriented code.
The existing `GitHubCli` service and GitHub-specific `GitManager` paths are behavior references. The new provider layer should use detailed tagged errors, schema decode boundaries, `effect/unstable/process`, capability flags, and provider-neutral change-request types.
## Scope
- Add provider-domain contracts in `packages/contracts/src/sourceControl.ts`.
- Add provider URL/reference parsing helpers in `packages/shared/src/sourceControl/*`.
- Add server services under `apps/server/src/sourceControl`:
- `Services/SourceControlProvider.ts`
- `Services/SourceControlProviderRegistry.ts`
- `Services/SourceControlProcess.ts`
- `Layers/GitHubSourceControlProvider.ts`
- `errors.ts`
- Migrate PR creation, PR lookup, default-branch lookup, clone URL lookup, and PR checkout through the provider layer.
- Update active consumers to the provider APIs directly; do not add backwards-compatible `GitHubCli` export shims.
- Keep GitHub as the only production provider at the end of this phase, but make GitLab and Azure implementation paths obvious and bounded.
## Non-Goals
- No GitLab implementation in this phase, except fixtures/contracts that prove the abstraction can represent merge requests.
- No Azure DevOps implementation in this phase, except URL/reference parser test cases if cheap.
- No in-app review UI yet.
- No hard dependency on one CLI forever. The first GitHub driver may use `gh`, but the interface should support REST/GraphQL implementations later.
## Provider Model
Use provider-neutral names:
- `SourceControlProvider`: hosted repository and change-request mechanics.
- `ChangeRequest`: GitHub pull request, GitLab merge request, Azure pull request.
- `ChangeRequestThread`: review or discussion thread.
- `ChangeRequestComment`: top-level or inline comment.
- `ProviderRepository`: owner/project/repo identity plus clone URLs.
Core provider operations:
- `detectRemote(remoteUrl)`
- `checkAuth(cwd)`
- `getRepository(cwd | remoteUrl)`
- `getDefaultTargetRef(repository)`
- `listChangeRequests(repository, filters)`
- `getChangeRequest(repository, reference)`
- `createChangeRequest(repository, input)`
- `checkoutChangeRequest(cwd, changeRequest, options)`
- `getCloneUrls(repository)`
Review-facing operations should be designed now, even if unimplemented:
- `listReviewThreads(changeRequest)`
- `createReviewComment(changeRequest, input)`
- `replyToReviewThread(thread, input)`
- `resolveReviewThread(thread)`
- `submitReview(changeRequest, input)`
Each operation should be guarded by capabilities:
```ts
export interface SourceControlProviderCapabilities {
readonly kind: "github" | "gitlab" | "azure-devops" | "unknown";
readonly supportsCreateChangeRequest: boolean;
readonly supportsCheckoutChangeRequest: boolean;
readonly supportsReviewThreads: boolean;
readonly supportsInlineComments: boolean;
readonly supportsDraftChangeRequests: boolean;
}
```
## Provider Registry
Add a registry that resolves a provider from repository remotes and explicit user input.
Rules:
- Detection should be pure where possible and testable without spawning CLIs.
- Remote URL parsing belongs in `packages/shared`, not server-only provider layers.
- Unknown providers should return explicit unsupported-operation errors, not silently fall back to GitHub.
- Provider selection should be stable per operation and logged with enough context to debug bad remote detection.
The registry should support multiple provider implementations at runtime, not a single dispatcher file with inline provider branches.
## Rate Limits and Provider Caching
Design the provider layer around a strict freshness budget. Provider API and CLI calls must not be part of frequent background polling unless the operation is explicitly marked safe and cached.
Default behavior:
- Pure URL/remote parsing is always live because it is local.
- Provider detection from local remotes is live-local.
- Authentication checks are cached.
- Repository metadata is cached.
- Default branch metadata is cached.
- Change-request lists are cached and refreshed on explicit user actions or coarse intervals.
- Full review threads, comments, file diffs, and timeline data are fetched only when the user opens the relevant review surface or explicitly refreshes it.
- Create/update operations invalidate affected cache keys immediately after success.
The provider API should make freshness explicit:
```ts
export interface SourceControlFreshness {
readonly source: "live-local" | "cached-provider" | "live-provider";
readonly observedAt: string;
readonly expiresAt?: string;
readonly stale?: boolean;
}
export type ProviderRefreshPolicy =
| "cache-first"
| "stale-while-revalidate"
| "force-refresh"
| "local-only";
```
Every read operation that can touch a provider should accept a refresh policy. Background UI reads should default to `cache-first` or `stale-while-revalidate`; direct user actions like pressing refresh can use `force-refresh`.
Use Effect `Cache` for provider data:
- auth status: key by provider kind, hostname, workspace identity, and account if known; TTL around minutes, not seconds
- repository metadata/default branch: key by provider repository stable ID or normalized remote URL; TTL around tens of minutes
- change-request summary lists: key by provider repository, state/filter, source ref, target ref; short TTL with stale-while-revalidate
- individual change-request summaries: key by provider repository and provider CR ID; short TTL, invalidated after create/update/comment operations
- review threads/comments/diffs: key by provider CR ID and head SHA/version when available; fetch on demand for T3 Review
Provider drivers should surface rate-limit signals when available:
- remaining quota
- reset time
- retry-after duration
- whether the limit is primary, secondary/abuse, or unknown
Rate-limit errors should be typed, retryable when the provider gives a reset/retry time, and visible enough for the UI to avoid repeatedly retrying a blocked operation.
Avoid rate-limit footguns:
- no provider calls from render loops or fast status polling
- no listing all PRs/MRs across all repos to infer one branch state
- no silent GitHub fallback for unknown providers
- no unbounded cache cardinality for branch names or free-form search queries
- no per-thread duplicate provider refresh when multiple views observe the same repository
## GitHub Provider Rewrite
Rewrite GitHub support as `GitHubSourceControlProvider`.
Carry forward behavior from:
- `apps/server/src/git/Layers/GitHubCli.ts`
- `apps/server/src/git/Layers/GitHubCli.test.ts`
- `apps/server/src/git/githubPullRequests.ts`
- GitHub-specific `GitManager` PR paths
Implementation requirements:
- Use `SourceControlProcess` built on `effect/unstable/process`, not `runProcess`.
- Decode `gh api` and `gh pr --json` responses with Effect Schema.
- Use typed errors for auth failure, missing CLI, command failure, output decode failure, unsupported reference, and provider mismatch.
- Keep stdout/stderr bounded.
- Avoid global mutable auth caches unless they are Effect `Cache` values with explicit keys, TTLs, and invalidation behavior.
- Parse provider rate-limit headers or CLI/API error payloads when available and map them to typed rate-limit errors.
- Keep GitHub nouns inside the GitHub driver; convert to `ChangeRequest` at the provider boundary.
## GitManager Cutover
Refactor `GitManager` so it coordinates three independent services:
- `VcsDriver` for local repository mechanics.
- `SourceControlProviderRegistry` for hosted provider selection.
- `TextGeneration` for message/body generation.
`GitManager` should stop depending directly on GitHub services. User-visible step labels should be provider-neutral unless the selected provider is known and the label is intentionally provider-specific.
The Commit + PR flow should become:
1. Resolve VCS repository and local status.
2. Resolve source-control provider from remotes.
3. Generate commit content through the existing text generation service.
4. Create local change through `VcsDriver`.
5. Push through `VcsDriver` or a narrow provider push helper only if the VCS requires provider-specific target syntax.
6. Generate change-request title/body.
7. Create the change request through `SourceControlProvider`.
## Cutover Policy
This phase should aggressively remove old GitHub-specific internals.
Rules:
- Move each active consumer directly to `SourceControlProviderRegistry` or a concrete provider test layer.
- Delete migrated `GitHubCli` methods, tests, and GitHub-specific helper exports in the same PR that moves their final consumer.
- Do not add compatibility export shims from `apps/server/src/git` to `apps/server/src/sourceControl`.
- Transitional modules are allowed only for a bounded `GitManager` slice that cannot move safely with the rest of the provider cutover.
- Every transitional module must have an owner comment, a removal checklist, and no public exports consumed by new code.
- Provider-neutral web parsing should replace GitHub-only parsing directly; do not keep parallel parser stacks unless a route still requires both during a single PR.
## GitLab and Azure Readiness
Use the triaged references as implementation inputs, not merge targets:
- GitLab PR #592 is useful for `glab mr` command mapping and JSON normalization.
- Azure issue #1138 defines a good first Azure slice: remote/URL detection and change-request thread setup for same-repo URLs.
The abstraction should let Phase 3 add:
- `GitLabSourceControlProvider` using `glab`.
- `AzureDevOpsSourceControlProvider` using `az repos pr` or REST APIs.
No provider should need to edit GitHub code to join the registry.
## T3 Review Design Constraint
Do not optimize only for creation/checkout. The provider layer must be able to support a future in-app review surface.
That means contracts should include stable IDs and enough metadata for:
- file-level diffs
- inline review threads
- resolved/unresolved state
- top-level discussion comments
- pending review submission
- provider URL back-links
Provider-specific fields can live in a metadata bag, but core review behavior should not require the UI to know whether the backing service is GitHub, GitLab, or Azure DevOps.
## Tests
Add tests at three levels:
- Pure parser tests for GitHub, GitLab, and Azure remote URLs and change-request references.
- Provider unit tests with fake `SourceControlProcess` output and schema decode failures.
- Integration-style GitHub CLI tests only where they can run hermetically or be skipped without hiding unit coverage.
Required cases:
- GitHub PR URL, number, and branch-ish references.
- GitLab MR URL/reference parsing.
- Azure DevOps PR URL parsing for same-repo URLs.
- unknown provider returns unsupported-operation errors.
- missing CLI and auth failures produce distinct typed errors.
- invalid CLI JSON fails at decode boundary with useful context.
## Migration Steps
1. Add `sourceControl` contracts and provider-neutral schemas.
2. Add shared remote/reference parser helpers and tests.
3. Add `SourceControlProcess` and provider errors.
4. Add provider registry with GitHub-only registration.
5. Implement `GitHubSourceControlProvider` from scratch against the new process layer.
6. Cut GitHub PR operations in `GitManager` over to the provider registry.
7. Replace web PR-reference parsing with provider-neutral parser output while keeping current GitHub UX.
8. Add provider cache metrics and tests for cache hit, stale refresh, invalidation, and rate-limit error mapping.
9. Delete the migrated `GitHubCli` implementation, tests, and GitHub-specific helper exports unless an explicit transitional checklist remains.
## Acceptance Criteria
- Existing GitHub Commit + PR and PR checkout flows still work.
- `GitManager` no longer imports or depends on `GitHubCli`.
- Active consumers use source-control provider APIs directly; any remaining transitional module has a written removal checklist and no compatibility export shim.
- Source-control contracts can represent GitHub PRs, GitLab MRs, and Azure DevOps PRs.
- Unknown/unsupported providers fail explicitly and visibly.
- GitHub command execution does not depend on `processRunner.ts`.
- Background provider reads are cached/coalesced and do not consume provider API quota on every status refresh.
- Rate-limit responses become typed errors with retry/reset metadata where available.
- The provider API includes the review operations needed by future T3 Review work, even if they are capability-gated.
- `bun fmt`, `bun lint`, and `bun typecheck` pass.
+2
View File
@@ -10,3 +10,5 @@
8. `08-precommit-format-and-lint.md`
9. `09-event-state-test-expansion.md`
10. `10-unify-process-session-abstraction.md`
19. `19-version-control-phase-1-vcs-driver-foundation.md`
20. `20-version-control-phase-2-source-control-provider-foundation.md`
+257
View File
@@ -0,0 +1,257 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Plan: seamless `npx t3 connect` for remote boxes</title>
<style>
:root {
--bg: #000;
--fg: #fff;
--muted: #a3a3a3;
--surface: #121212;
--surface2: #1a1a1a;
--border: #2a2a2a;
--accent: #7c9cff;
--green: #4ade80;
--amber: #fbbf24;
--red: #f87171;
}
* { box-sizing: border-box; }
body {
margin: 0;
background: var(--bg);
color: var(--fg);
font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main { max-width: 880px; margin: 0 auto; padding: 48px 24px 96px; }
h1 { font-size: 30px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 48px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); }
h3 { font-size: 16px; margin: 24px 0 8px; }
p, li { color: #e5e5e5; }
.sub { color: var(--muted); margin: 0 0 24px; }
code, pre {
font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
font-size: 13.5px;
}
code { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
pre {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 16px;
overflow-x: auto;
line-height: 1.5;
}
pre code { background: none; border: none; padding: 0; }
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
padding: 18px 20px;
margin: 16px 0;
}
.card h3 { margin-top: 0; }
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 12px; border: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface2); font-weight: 600; }
td code { white-space: nowrap; }
.pill {
display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px;
padding: 2px 10px; margin-right: 6px; vertical-align: 2px;
}
.pill.core { background: #1e2a4a; color: var(--accent); }
.pill.new { background: #14301e; color: var(--green); }
.pill.later { background: #33270e; color: var(--amber); }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.no { color: var(--red); }
ul { padding-left: 22px; }
li { margin: 4px 0; }
.terminal {
background: #0a0a0a; border: 1px solid var(--border); border-radius: 8px;
padding: 16px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
font-size: 13.5px; line-height: 1.65; color: #d4d4d4; overflow-x: auto;
}
.terminal .dim { color: #737373; }
.terminal .g { color: var(--green); }
.terminal .b { color: var(--accent); }
figure { margin: 24px 0; }
figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }
svg text { font-family: -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.kv { color: var(--muted); font-size: 13.5px; }
</style>
</head>
<body>
<main>
<h1>Seamless <code>npx t3 connect</code> for remote boxes</h1>
<p class="sub">Design principle: <strong>the smallest diff that ships the UX.</strong> No relay/infra changes, no new backend surface, no new auth primitives &mdash; every step reuses code that already exists. One PR, built as four phases with clear commit boundaries &mdash; each phase compiles, passes tests, and leaves the product working, so the PR reviews commit-by-commit. (Phase 4, web-triggered update, is an optional follow-up PR.)</p>
<div class="terminal">
$ npx t3 connect<br><br>
To set up T3 Connect, open this URL and sign in:<br>
&nbsp;&nbsp;<span class="b">https://app.t3.codes/connect#B64URL_STATE_AND_CHALLENGE</span><br><br>
Enter your authentication code: <span class="dim">[code]</span><br><br>
<span class="g">Connected as [email protected]!</span><br><br>
Run T3 Code in the background whenever this machine boots? (y/n): y<br><br>
<span class="g">T3 Code is set up and ready to go.</span>
</div>
<h2>Why this is a small change</h2>
<p>The entire <code>t3 connect</code> data plane already works: Clerk PKCE token exchange, encrypted secret store, cloudflared relay-client install, relay environment linking, DPoP tokens. The <em>only</em> broken piece on an SSH box is the redirect: <code>CliTokenManager.login()</code> hardcodes a loopback callback (<code>http://127.0.0.1:34338/callback</code>) that requires a browser on the same machine.</p>
<p>We swap that one leg for a hosted out-of-band authorization page and keep everything else. Because PKCE's <code>code_verifier</code> never leaves the box, the displayed one-time code is useless to anyone who sees it &mdash; no new token-minting or storage is needed anywhere.</p>
<div class="card">
<h3>Reused as-is (zero changes)</h3>
<ul>
<li><code>exchangeToken()</code> PKCE exchange &mdash; <code>apps/server/src/cloud/CliTokenManager.ts:147</code></li>
<li>Token persistence in <code>ServerSecretStore</code> (<code>cloud-cli-oauth-token</code>)</li>
<li><code>acquireRelayClientForLink()</code> cloudflared install + progress &mdash; <code>cli/connect.ts:146</code></li>
<li><code>CliState.setCliDesiredCloudLink()</code> + server-side provisioning on start</li>
<li>All relay endpoints (<code>infra/relay</code>) and contracts &mdash; <strong>untouched</strong></li>
<li>Existing subcommands <code>login/link/status/unlink/logout</code> &mdash; semantics unchanged</li>
<li>Web app Clerk session + hosted-page precedent (<code>routes/pair.tsx</code>, <code>hostedPairing.ts</code>)</li>
</ul>
</div>
<h2>Auth flow (hosted out-of-band OAuth, Clerk PKCE)</h2>
<figure>
<svg viewBox="0 0 820 470" width="100%" role="img" aria-label="Sequence diagram of the out-of-band OAuth flow">
<!-- lanes -->
<rect x="20" y="16" width="220" height="44" rx="8" fill="#121212" stroke="#2a2a2a"/>
<rect x="300" y="16" width="220" height="44" rx="8" fill="#121212" stroke="#2a2a2a"/>
<rect x="580" y="16" width="220" height="44" rx="8" fill="#121212" stroke="#2a2a2a"/>
<text x="130" y="43" fill="#fff" font-size="14" font-weight="600" text-anchor="middle">Remote box &#8212; t3 CLI</text>
<text x="410" y="43" fill="#fff" font-size="14" font-weight="600" text-anchor="middle">Laptop &#8212; app.t3.codes</text>
<text x="690" y="43" fill="#fff" font-size="14" font-weight="600" text-anchor="middle">Clerk</text>
<line x1="130" y1="60" x2="130" y2="450" stroke="#2a2a2a"/>
<line x1="410" y1="60" x2="410" y2="450" stroke="#2a2a2a"/>
<line x1="690" y1="60" x2="690" y2="450" stroke="#2a2a2a"/>
<!-- 1: generate + print -->
<rect x="30" y="80" width="200" height="34" rx="6" fill="#1e2a4a"/>
<text x="130" y="101" fill="#7c9cff" font-size="12.5" text-anchor="middle">1. gen verifier + challenge + state</text>
<!-- 2: user opens URL -->
<line x1="130" y1="140" x2="404" y2="140" stroke="#7c9cff" stroke-dasharray="5 4"/>
<polygon points="404,140 394,135 394,145" fill="#7c9cff"/>
<text x="267" y="132" fill="#a3a3a3" font-size="12.5" text-anchor="middle">2. user opens /connect#&#123;state,challenge&#125;</text>
<!-- 3: redirect to clerk -->
<line x1="410" y1="185" x2="684" y2="185" stroke="#e5e5e5"/>
<polygon points="684,185 674,180 674,190" fill="#e5e5e5"/>
<text x="547" y="177" fill="#a3a3a3" font-size="12.5" text-anchor="middle">3. sign in &#8594; /oauth/authorize (PKCE)</text>
<!-- 4: redirect back with code -->
<line x1="690" y1="230" x2="416" y2="230" stroke="#e5e5e5"/>
<polygon points="416,230 426,225 426,235" fill="#e5e5e5"/>
<text x="553" y="222" fill="#a3a3a3" font-size="12.5" text-anchor="middle">4. redirect /connect/callback?code&amp;state</text>
<!-- 5: page shows code -->
<rect x="310" y="252" width="200" height="34" rx="6" fill="#14301e"/>
<text x="410" y="273" fill="#4ade80" font-size="12.5" text-anchor="middle">5. shows account + authorization code</text>
<!-- 6: user enters code -->
<line x1="410" y1="316" x2="136" y2="316" stroke="#7c9cff" stroke-dasharray="5 4"/>
<polygon points="136,316 146,311 146,321" fill="#7c9cff"/>
<text x="273" y="308" fill="#a3a3a3" font-size="12.5" text-anchor="middle">6. user enters code in terminal</text>
<!-- 7: token exchange -->
<line x1="130" y1="360" x2="684" y2="360" stroke="#e5e5e5"/>
<polygon points="684,360 674,355 674,365" fill="#e5e5e5"/>
<text x="407" y="352" fill="#a3a3a3" font-size="12.5" text-anchor="middle">7. POST /oauth/token &#123;code + verifier&#125; &#8594; access/refresh tokens</text>
<!-- 8: done -->
<rect x="30" y="392" width="200" height="46" rx="6" fill="#14301e"/>
<text x="130" y="411" fill="#4ade80" font-size="12.5" text-anchor="middle">8. store token, set desired link,</text>
<text x="130" y="427" fill="#4ade80" font-size="12.5" text-anchor="middle">install relay client &#8594; Connected!</text>
</svg>
<figcaption>The verifier never leaves the box (steps 1&#8594;7), so the authorization code is worthless if observed. state/challenge ride the URL fragment &mdash; they are not secrets.</figcaption>
</figure>
<div class="card">
<h3>Details that keep it simple</h3>
<ul>
<li><strong>Stateless URL, no short-link service.</strong> The <code>/connect</code> page reads <code>state</code> + <code>code_challenge</code> from the URL fragment and builds the Clerk authorize URL client-side. ~100-char URL &mdash; fine to transfer into an SSH session.</li>
<li><strong>State check without a backend:</strong> the callback page displays one authorization blob of <code>code.state</code>; the CLI splits it and verifies <code>state</code> matches what it generated. One line on each side, preserves the loopback flow's CSRF check.</li>
<li><strong>Phishing is addressed with copy, not code:</strong> the callback page shows <em>which account</em> is being connected ("Connecting as theo@&hellip;") and warns: <em>"Only enter this code in a terminal session you started yourself."</em> No mechanism needed.</li>
<li><strong>Code expiry is a non-issue:</strong> Clerk auth codes live 10 minutes &mdash; the same timeout the existing loopback flow already uses. Wrong/expired code &#8594; friendly retry that reprints the URL.</li>
<li><strong>One external config step:</strong> register <code>https://app.t3.codes/connect/callback</code> as an allowed redirect URI on the existing Clerk CLI OAuth client. No new client, no new scopes.</li>
</ul>
</div>
<h2>The phases (one PR, one commit each)</h2>
<p class="kv">Ordering is dependency order: each phase is independently revertable and the tree is green at every boundary. Phases 1&ndash;3 are the PR; phase 4 ships separately later.</p>
<table>
<tr><th style="width:1%">Phase</th><th>Scope</th><th>Files</th><th style="width:1%">~LOC</th></tr>
<tr>
<td><span class="pill core">1</span></td>
<td><strong>Hosted code page</strong> (web-only, purely additive, zero risk). Two static routes modeled on <code>pair.tsx</code>: <code>/connect</code> (ensure Clerk session, then client-side redirect to authorize &mdash; it's a static SPA, no server 302) and <code>/connect/callback</code> (validate params, show account + copyable code + safety warning). Both routes guard against non-hosted deployments &mdash; redirect to <code>/</code> unless <code>isHostedStaticApp()</code>, same pattern as <code>pair.tsx</code>, since this bundle also ships in local instances. Plus the Clerk dashboard redirect-URI entry.</td>
<td><code>apps/web/src/routes/connect.tsx</code><br><code>apps/web/src/routes/connect.callback.tsx</code></td>
<td>~200</td>
</tr>
<tr>
<td><span class="pill core">2</span></td>
<td><strong>CLI out-of-band OAuth flow + single command.</strong> Add an out-of-band OAuth login path to <code>CliTokenManager</code> (print URL, <code>Prompt.text</code> for the code, reuse <code>exchangeToken</code>). Make bare <code>t3 connect</code> a handler = login + link (subcommands untouched). Auto-pick headless mode inside SSH sessions (<code>SSH_CONNECTION</code>/<code>SSH_TTY</code> &mdash; nothing else); <code>--headless</code> flag as manual override. Loopback stays the default on desktop &mdash; no regression.</td>
<td><code>cloud/CliTokenManager.ts</code> (+60)<br><code>cloud/publicConfig.ts</code> (+10)<br><code>cli/connect.ts</code> (+60)</td>
<td>~150</td>
</tr>
<tr>
<td><span class="pill new">3</span></td>
<td><strong>Background on boot &mdash; Linux first</strong> (the SSH case). One new module: pinned runtime install to <code>~/.t3/runtime/versions/&lt;v&gt;</code> + <code>current</code> symlink, systemd <em>user</em> unit with absolute node/t3 paths, <code>enable-linger</code>. y/n prompt at the end of <code>connect</code>; teardown in <code>logout</code>. Install and service-start failures must land in a log file (under <code>~/.t3/userdata/logs/</code>) whose path is printed at connect time &mdash; systemd user units fail invisibly otherwise. Unit-file generation is pure string-building &#8594; trivially testable. macOS launchd / Windows follow as 3b/3c only if wanted.</td>
<td><code>cloud/bootService.ts</code> (new)<br><code>cli/connect.ts</code> (+prompt/teardown)</td>
<td>~250</td>
</tr>
<tr>
<td><span class="pill later">4</span></td>
<td><strong>Web-triggered update</strong> (optional follow-up PR; not part of this one, not needed for the core UX). Web detects <code>daemon version &lt; latest-on-channel</code> using the existing version-skew surface + hosted manifest; one authenticated "update" command &mdash; client says <em>update</em>, daemon resolves/verifies the version itself (never client-specified &mdash; that would be RCE). Stage install &#8594; verify &#8594; atomic symlink swap &#8594; <code>systemctl --user restart</code>. Progress streams reuse the <code>RelayClientInstallProgressEvent</code> pattern.</td>
<td>web banner + one control command + daemon update routine</td>
<td>later</td>
</tr>
</table>
<h3>Runtime layout (phase 3)</h3>
<pre><code>~/.t3/runtime/
├── versions/0.0.27/ &larr; npm install --prefix (gets native deps right: node-pty etc.)
└── current -> versions/0.0.27
~/.config/systemd/user/t3code.service &larr; ExecStart=/abs/path/node .../current/.../t3 serve
loginctl enable-linger $USER &larr; survives SSH logout / reboot</code></pre>
<p class="kv">Why a real <code>npm install</code> and not "reuse the npx binary": the npx cache is ephemeral and <code>t3</code> ships native deps (<code>node-pty</code>, <code>@ff-labs/fff-node</code>) that need per-platform prebuilds. Why pinned and not <code>npx t3@latest</code> in the unit: a boot-time registry fetch means the box may simply not come up (network down, PATH-less systemd env, nvm). Deterministic boot; updates happen out-of-band (phase 4 follow-up) or by re-running <code>npx t3 connect</code>.</p>
<h2>Explicitly not doing</h2>
<ul>
<li><span class="no">&#10007;</span> Relay / <code>infra</code> / contracts changes &mdash; none, in any phase</li>
<li><span class="no">&#10007;</span> Short-link service (<code>app.t3.codes/c/AB7K</code>) &mdash; only matters for hand-typing; revisit if ever needed</li>
<li><span class="no">&#10007;</span> RFC 8628 device grant &mdash; wrong UX direction, unverified Clerk support</li>
<li><span class="no">&#10007;</span> Auto-update loop in the daemon &mdash; web-triggered only (phase 4 follow-up), user stays in control</li>
<li><span class="no">&#10007;</span> Project auto-registration &mdash; workspace assumed set up; the web UI handles the rest</li>
<li><span class="no">&#10007;</span> Changing existing loopback flow, subcommands, or desktop behavior</li>
</ul>
<h2>Risks &amp; checks</h2>
<ul>
<li><span class="warn">&#9888;</span> <strong>Clerk redirect URI:</strong> confirm the CLI OAuth client accepts the hosted redirect and that the token endpoint honors PKCE exchange for codes issued to it. Verify in staging before the phase 2 commit. <em>(Only external dependency in the plan.)</em></li>
<li><span class="warn">&#9888;</span> <strong>systemd user env is minimal:</strong> always write absolute paths for node + t3 into the unit; never rely on PATH. Service failures are invisible by default &mdash; hence the phase 3 requirement to log to a printed file path.</li>
<li><span class="warn">&#9888;</span> <strong>Linger prompt honesty:</strong> the y/n prompt should say the machine becomes reachable via T3 Connect whenever powered on &mdash; that's the feature, but say it.</li>
<li><span class="ok">&#10003;</span> Re-running <code>connect</code> when linked &#8594; idempotent: refresh token, re-confirm service, done.</li>
</ul>
<h2>Decision log</h2>
<ul class="kv">
<li>Auth: hosted out-of-band OAuth redirect on Clerk PKCE (not relay-brokered pairing, not device grant) &mdash; chosen for minimal new surface.</li>
<li>URL: stateless static page, no backend short-link.</li>
<li>Service: real per-user login service (systemd user + linger first); detect + offer install, never silent.</li>
<li>Binary: pinned managed runtime under <code>~/.t3</code>; interactive <code>npx</code> usage untouched.</li>
<li>Updates: not always-latest; web UI surfaces available updates with one-click trigger (phase 4 follow-up).</li>
<li>Delivery: one PR with a commit per phase (green tree at every boundary), not separate PRs.</li>
<li>Workspace: assumed already set up; no auto-registration.</li>
</ul>
</main>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
alchemy/test/**
+137
View File
@@ -0,0 +1,137 @@
name: Deploy Website
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "website/**"
- "packages/alchemy/**"
- "bun.lock"
- ".github/workflows/deploy.yml"
pull_request:
types:
- opened
- reopened
- synchronize
- closed
paths:
- "website/**"
- "packages/alchemy/**"
- "bun.lock"
- ".github/workflows/deploy.yml"
concurrency:
group: deploy-website-${{ github.ref }}
cancel-in-progress: false
env:
STAGE: ${{ github.event_name == 'pull_request' && format('pr-{0}',
github.event.number) || (github.ref == 'refs/heads/main' && 'prod' ||
github.ref_name) }}
jobs:
deploy:
if: ${{ github.event.action != 'closed' }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Mint a token for the alchemy-version-bot GitHub App so the PR
# preview comment (created via GitHub.Comment in alchemy.run.ts)
# posts under the bot's identity instead of `github-actions[bot]`.
# Same App as release.yml — its installation scopes already cover
# PR comments.
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install dependencies
run: bun install
# Build the website ahead of `alchemy deploy`. The
# Cloudflare.StaticSite resource declares the same `bun run build`
# in its config and runs it as part of the create lifecycle, but
# on update plans alchemy reads `dist/` during plan.diff before
# the embedded Build resource gets a chance to (re)run, causing
# a NotFound on a fresh CI checkout. Building here makes the
# workflow correct under both create and update plans.
- name: Build website
working-directory: website
run: bun run build
- name: Deploy
working-directory: website
run: bun alchemy deploy --stage ${{ env.STAGE }} --yes
env:
# Alchemy's Cloudflare auth provider accepts either a scoped
# API token (CLOUDFLARE_API_TOKEN) or the legacy global API
# key paired with email (CLOUDFLARE_API_KEY +
# CLOUDFLARE_EMAIL). We use the latter here so CI matches
# the credentials in Doppler / .env, where only the admin
# global key is provisioned.
CLOUDFLARE_API_KEY: ${{ secrets.ADMIN_CLOUDFLARE_API_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.ADMIN_CLOUDFLARE_EMAIL }}
CLOUDFLARE_ACCOUNT_ID: ${{ env.STAGE == 'prod' &&
secrets.PROD_CLOUDFLARE_ACCOUNT_ID ||
secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
PULL_REQUEST: ${{ github.event.number }}
# On `pull_request` events GitHub Actions' built-in
# `GITHUB_SHA` is the synthetic merge commit (PR head merged
# into base) — that SHA never shows up in the PR's git log.
# `GITHUB_SHA` is also a reserved env var, so a step-level
# override is silently ignored. Pass the PR head SHA under
# a non-reserved name and read it from alchemy.run.ts.
BUILD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
cleanup:
runs-on: ubuntu-latest
if:
${{ github.event_name == 'pull_request' && github.event.action == 'closed'
}}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Install dependencies
run: bun install
- name: Safety Check
run: |-
if [ "${{ env.STAGE }}" = "prod" ]; then
echo "ERROR: Cannot destroy prod environment in cleanup job"
exit 1
fi
- name: Destroy Preview Environment
working-directory: website
run: bun alchemy destroy --stage ${{ env.STAGE }} --yes
env:
CLOUDFLARE_API_KEY: ${{ secrets.ADMIN_CLOUDFLARE_API_KEY }}
CLOUDFLARE_EMAIL: ${{ secrets.ADMIN_CLOUDFLARE_EMAIL }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
PULL_REQUEST: ${{ github.event.number }}
GITHUB_TOKEN: ${{ steps.bot-token.outputs.token }}
+180
View File
@@ -0,0 +1,180 @@
name: pr-package
# Publishes alchemy + better-auth + pr-package tarballs to the pr-package
# service at pkg.ing on every push to main and every PR sync. On PR close,
# deletes every tag we ever assigned for that PR so the underlying tarballs
# become orphaned and the bucket cleans them up.
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, closed]
permissions:
contents: read
pull-requests: write
env:
PR_PACKAGE_HOST: pkg.ing
NODE_VERSION: "24"
jobs:
# ── Publish on push-to-main and PR sync. ──────────────────────────────────
publish:
if: github.event_name == 'push' || (github.event_name == 'pull_request' &&
github.event.action != 'closed')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
# Build everything: tsdown bundles alchemy (bin/ + cli lib) and tsc -b
# populates lib/ for the layer packages (better-auth, pr-package).
# Their tarballs ship both src/ and lib/, and consumers in non-bun
# runtimes resolve via the `import` condition → ./lib/index.js.
- run: bun run build:packages
- name: Compute tags
id: tags
env:
EVENT: ${{ github.event_name }}
# `head_ref` for PRs (source branch), `ref_name` for push (e.g. "main").
BRANCH: ${{ github.event_name == 'pull_request' && github.head_ref ||
github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
# PR builds run on the merge commit by default; tag the actual head sha
# so consumers can pin to a specific PR commit.
SHA: ${{ github.event_name == 'pull_request' &&
github.event.pull_request.head.sha || github.sha }}
run: |
set -euo pipefail
short="${SHA:0:7}"
long="$SHA"
tags=("$short" "$long" "$BRANCH")
if [ "$EVENT" = "pull_request" ]; then
tags+=("pr-${PR_NUMBER}")
fi
json=$(printf '%s\n' "${tags[@]}" | jq -R . | jq -s -c .)
echo "tags=$json" >> "$GITHUB_OUTPUT"
echo "short=$short" >> "$GITHUB_OUTPUT"
echo "Tags: $json"
# PR builds expire after 1 week; pushes to main omit the header and
# fall back to the worker's defaultTtl (3 weeks).
- name: Publish alchemy
env:
TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
TAGS: ${{ steps.tags.outputs.tags }}
TTL: ${{ github.event_name == 'pull_request' && '1 week' || '' }}
working-directory: packages/alchemy
run: |
set -euo pipefail
rm -f *.tgz
bun pm pack --destination .
tgz=$(ls *.tgz)
echo "Publishing $tgz with tags $TAGS ttl=${TTL:-default}"
curl -fsSL --show-error -X PUT \
"https://${PR_PACKAGE_HOST}/projects/alchemy/packages" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tags: ${TAGS}" \
${TTL:+-H "X-TTL: ${TTL}"} \
-H "Content-Type: application/gzip" \
--data-binary "@${tgz}"
- name: Publish better-auth
env:
TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
TAGS: ${{ steps.tags.outputs.tags }}
TTL: ${{ github.event_name == 'pull_request' && '1 week' || '' }}
working-directory: packages/better-auth
run: |
set -euo pipefail
rm -f *.tgz
bun pm pack --destination .
tgz=$(ls *.tgz)
echo "Publishing $tgz with tags $TAGS ttl=${TTL:-default}"
curl -fsSL --show-error -X PUT \
"https://${PR_PACKAGE_HOST}/projects/@alchemy.run/better-auth/packages" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tags: ${TAGS}" \
${TTL:+-H "X-TTL: ${TTL}"} \
-H "Content-Type: application/gzip" \
--data-binary "@${tgz}"
- name: Publish pr-package
env:
TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
TAGS: ${{ steps.tags.outputs.tags }}
TTL: ${{ github.event_name == 'pull_request' && '1 week' || '' }}
working-directory: packages/pr-package
run: |
set -euo pipefail
rm -f *.tgz
bun pm pack --destination .
tgz=$(ls *.tgz)
echo "Publishing $tgz with tags $TAGS ttl=${TTL:-default}"
curl -fsSL --show-error -X PUT \
"https://${PR_PACKAGE_HOST}/projects/@alchemy.run/pr-package/packages" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tags: ${TAGS}" \
${TTL:+-H "X-TTL: ${TTL}"} \
-H "Content-Type: application/gzip" \
--data-binary "@${tgz}"
# PR-only: leave a sticky comment with the install URLs pinned to this
# commit. Uses pkg.ing (the canonical short host), which serves both
# the pretty alias paths and the underlying /projects/:project/tags/:tag
# API directly.
- name: Generate bot token
if: github.event_name == 'pull_request'
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- name: Comment on PR
if: github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ steps.bot-token.outputs.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
SHORT_SHA: ${{ steps.tags.outputs.short }}
run: |
set -euo pipefail
MARKER="<!-- pr-package-comment -->"
# Use `bun add <name>@<url>` instead of `bun add <url>`. Without an
# explicit name, bun's resolver hits a DependencyLoop bug when the
# consumer already has the same package name resolved from npm
# (oven-sh/bun#5789, oven-sh/bun#17946). The aliased form bypasses
# the buggy reconciliation path and works on fresh and existing
# projects alike.
BODY=$(printf '%s\n\nInstall the packages built from this commit:\n\n**alchemy**\n```sh\nbun add alchemy@https://pkg.ing/alchemy/%s\n```\n\n**@alchemy.run/better-auth**\n```sh\nbun add @alchemy.run/better-auth@https://pkg.ing/@alchemy.run/better-auth/%s\n```\n\n**@alchemy.run/pr-package**\n```sh\nbun add @alchemy.run/pr-package@https://pkg.ing/@alchemy.run/pr-package/%s\n```\n' "$MARKER" "$SHORT_SHA" "$SHORT_SHA" "$SHORT_SHA")
existing=$(gh api --paginate \
"repos/${REPO}/issues/${PR_NUMBER}/comments" \
--jq ".[] | select(.user.login == \"alchemy-version-bot[bot]\") | select(.body | startswith(\"${MARKER}\")) | .id" \
| head -1)
if [ -n "$existing" ]; then
gh api -X PATCH "repos/${REPO}/issues/comments/${existing}" -f body="$BODY"
else
gh api -X POST "repos/${REPO}/issues/${PR_NUMBER}/comments" -f body="$BODY"
fi
+432
View File
@@ -0,0 +1,432 @@
name: Release NPM Package
on:
workflow_dispatch:
inputs:
channel:
description: "Release channel"
required: true
type: choice
default: beta
options:
- release
- beta
- alpha
- tag
spec:
description: >-
Channel-specific value. tag: REQUIRED, the explicit full version (e.g.
2.0.0-experimental.1). release: REQUIRED, patch|minor|major or an
explicit x.y.z. beta|alpha: optional, an integer N to force
2.0.0-<channel>.N; leave blank to auto-increment.
required: false
type: string
permissions:
contents: write
id-token: write
env:
NODE_VERSION: "24"
# Files produced by the bump job and consumed by every publish job + the
# final commit job. Listed once here so additions stay in sync.
BUMP_ARTIFACT_PATHS: |
packages/alchemy/lib
packages/alchemy/bin
packages/alchemy/package.json
packages/better-auth/package.json
packages/better-auth/lib
packages/pr-package/package.json
packages/pr-package/lib
bun.lock
jobs:
# ── Step 1: Compute the next version and stage the bump in-memory. ──
# No git commit: we want a failed publish to leave no orphan commit
# behind. The staged files ride to the publish jobs (and the final commit
# job) as an artifact.
bump:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.bump.outputs.version }}
channel: ${{ inputs.channel }}
sha: ${{ steps.sha.outputs.sha }}
steps:
- name: Validate inputs
env:
CHANNEL: ${{ inputs.channel }}
SPEC: ${{ inputs.spec }}
run: |
case "$CHANNEL" in
tag)
if [ -z "$SPEC" ]; then
echo "::error::'tag' channel requires an explicit version in 'spec' (e.g. 2.0.0-experimental.1)"
exit 1
fi
;;
release)
if [ -z "$SPEC" ]; then
echo "::error::'release' channel requires a 'spec' (patch|minor|major|x.y.z)"
exit 1
fi
;;
esac
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- id: sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- id: bump
env:
CHANNEL: ${{ inputs.channel }}
SPEC: ${{ inputs.spec }}
run: |
if [ -n "$SPEC" ]; then
VERSION=$(bun ./scripts/release/bump.ts "$CHANNEL" "$SPEC")
else
VERSION=$(bun ./scripts/release/bump.ts "$CHANNEL")
fi
echo "Resolved version: $VERSION (channel: $CHANNEL)"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# Build everything once, up front, against the bumped versions. Outputs
# ride to every publish job as the `build-output` artifact so we don't
# rebuild three times in parallel.
- run: bun run build:packages
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bump-files
path: ${{ env.BUMP_ARTIFACT_PATHS }}
if-no-files-found: error
retention-days: 7
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-output
path: |
packages/*/lib
packages/*/bin
if-no-files-found: error
retention-days: 7
include-hidden-files: true
# ── Step 2: Commit (bump + changelog) and tag BEFORE publishing.
# Committing first means the publishable source of truth is the tagged
# commit; publish jobs check it out by SHA. Durability: if a previous
# attempt already committed and tagged but failed during npm publish, the
# bump job's HEAD-tag detection reuses the existing version, and this job
# detects HEAD is already at the tag and skips the commit/push.
# Skipped for `tag` channel — those releases are intentionally uncommitted.
commit-and-tag:
needs: bump
if: inputs.channel != 'tag'
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.commit.outputs.sha }}
steps:
- name: Generate bot token
id: bot-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ALCHEMY_VERSION_BOT_ID }}
private-key: ${{ secrets.ALCHEMY_VERSION_BOT_PRIVATE_KEY }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ steps.bot-token.outputs.token }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- name: Configure git
run: |
git config user.email "alchemy-version-bot[bot]@users.noreply.github.com"
git config user.name "alchemy-version-bot[bot]"
- id: commit
name: Commit bump + changelog, tag, push
env:
VERSION: ${{ needs.bump.outputs.version }}
run: |
set -euo pipefail
TAG="v${VERSION}"
# Durability: if HEAD already points at the release tag (resumed
# run after a previous attempt committed+tagged but publish
# failed), there is nothing to do. Use HEAD as the publish SHA.
HEAD_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || true)
if [ "$HEAD_TAG" = "$TAG" ]; then
echo "HEAD is already at ${TAG}; skipping commit/tag/push"
SHA=$(git rev-parse HEAD)
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
exit 0
fi
# Generate release notes; release-notes.ts is idempotent and
# bails out if the tag heading is already present in CHANGELOG.md.
bun scripts/release/release-notes.ts "${TAG}"
# Stage bump files (overwritten by the downloaded artifact) and
# the new changelog entry as a single commit.
git add packages/alchemy/package.json \
packages/better-auth/package.json \
packages/pr-package/package.json \
bun.lock \
CHANGELOG.md
if git diff --cached --quiet; then
echo "No changes to commit (already on a release commit?)"
else
git commit -m "chore(release): ${VERSION}"
fi
if ! git rev-parse --verify "refs/tags/${TAG}" >/dev/null 2>&1; then
git tag -a "${TAG}" -m "Release ${TAG}"
fi
git push origin HEAD
if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
echo "Tag ${TAG} already on remote, skipping tag push"
else
git push origin "refs/tags/${TAG}"
fi
SHA=$(git rev-parse HEAD)
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
# ── Step 3a: Build and publish `alchemy`. ──
# For non-tag channels, checkout the just-committed tagged SHA; for the
# `tag` channel (no commit), checkout the bump's pre-bump SHA and rely
# on the bump-files artifact instead.
publish-alchemy:
needs: [bump, commit-and-tag]
if:
always() && needs.bump.result == 'success' && (needs.commit-and-tag.result
== 'success' || needs.commit-and-tag.result == 'skipped')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha || needs.bump.outputs.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- name: Upgrade npm for OIDC trusted publishing
run: |
npm install -g npm@latest && npm --version
sed -i '/always-auth/d' ~/.npmrc 2>/dev/null || true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-output
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- run: bun scripts/release/publish-package.ts packages/alchemy ${{
needs.bump.outputs.channel }}
# ── Step 3b: Build and publish `@alchemy.run/better-auth`. ──
publish-better-auth:
needs: [bump, commit-and-tag, publish-alchemy]
if:
always() && needs.bump.result == 'success' && (needs.commit-and-tag.result
== 'success' || needs.commit-and-tag.result == 'skipped') &&
needs.publish-alchemy.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha || needs.bump.outputs.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- name: Upgrade npm for OIDC trusted publishing
run: |
npm install -g npm@latest && npm --version
sed -i '/always-auth/d' ~/.npmrc 2>/dev/null || true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-output
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- run: bun scripts/release/publish-package.ts packages/better-auth ${{
needs.bump.outputs.channel }}
# ── Step 3c: Build and publish `@alchemy.run/pr-package`. ──
publish-pr-package:
needs: [bump, commit-and-tag, publish-alchemy]
if:
always() && needs.bump.result == 'success' && (needs.commit-and-tag.result
== 'success' || needs.commit-and-tag.result == 'skipped') &&
needs.publish-alchemy.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha || needs.bump.outputs.sha }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
registry-url: https://registry.npmjs.org/
node-version: ${{ env.NODE_VERSION }}
- name: Upgrade npm for OIDC trusted publishing
run: |
npm install -g npm@latest && npm --version
sed -i '/always-auth/d' ~/.npmrc 2>/dev/null || true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bump-files
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: build-output
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- run: bun scripts/release/publish-package.ts packages/pr-package ${{
needs.bump.outputs.channel }}
# ── Step 4: Create GitHub Release and notify Discord. ──
# Runs only after every publish job succeeded. The bump+changelog commit
# and tag were already pushed by `commit-and-tag` before publishing.
finalize:
needs:
[
bump,
commit-and-tag,
publish-alchemy,
publish-better-auth,
publish-pr-package,
]
if: inputs.channel != 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ needs.commit-and-tag.outputs.sha }}
fetch-depth: 0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-
- run: bun install
- name: Create GitHub Release
env:
VERSION: ${{ needs.bump.outputs.version }}
CHANNEL: ${{ needs.bump.outputs.channel }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun scripts/release/github-release.ts "v${VERSION}" "${CHANNEL}"
- name: Notify Discord
if: success() && env.DISCORD_WEBHOOK != ''
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
VERSION: ${{ needs.bump.outputs.version }}
CHANNEL: ${{ needs.bump.outputs.channel }}
run: bun scripts/release/discord-notify.ts "v${VERSION}" "${CHANNEL}"
+93
View File
@@ -0,0 +1,93 @@
name: test
# Smoke-tests `alchemy destroy → deploy → destroy` against each example.
# `bun test:canary` drives the whole suite — it iterates both bun and pnpm
# runtimes itself and publishes canary tarballs to pkg.ing before deploying.
on:
# TODO(sam): re-enable these when they are running reliably and not polluting our account
# push:
# branches: [main]
# pull_request:
# types: [opened, reopened, synchronize]
workflow_dispatch:
permissions:
contents: read
# Required for aws-actions/configure-aws-credentials to mint a session
# via OIDC instead of long-lived AWS_ACCESS_KEY_ID secrets.
id-token: write
env:
PKGING_HOST: pkg.ing
NODE_VERSION: "24"
# PR runs use `pr-<n>` so each PR has its own isolated cloud namespace;
# main pushes use `main`; manual `workflow_dispatch` runs use the branch
# name. Forwarded to the smoke test as $SMOKE_STAGE.
SMOKE_STAGE: ${{ github.event_name == 'pull_request' && format('pr-{0}',
github.event.number) || (github.ref == 'refs/heads/main' && 'main' ||
github.ref_name) }}
concurrency:
# Cancel an in-progress run for the same PR (or branch) when a new push
# arrives — the smoke suite mutates real cloud state, so two parallel
# runs against the same SMOKE_STAGE would race.
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: latest
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
with:
version: latest
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
# Bootstrap install so `bun test:canary` itself can resolve. The
# test then runs its own `bun install` + `pnpm install` in canary
# `beforeAll` after rewriting the catalog to pkg.ing tarballs, so
# there's nothing pnpm-specific to wire up here.
- run: bun install
# OIDC → short-lived AWS session. Exports AWS_ACCESS_KEY_ID,
# AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION; the
# `output-credentials: true` flag also surfaces aws-account-id as a
# step output (which we forward as `AWS_ACCOUNT_ID` below — the
# action does NOT set it as an env var on its own).
- id: aws-creds
uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
output-credentials: true
- name: Smoke
env:
# AWS — `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`,
# `AWS_SESSION_TOKEN`, `AWS_REGION` are already exported by
# configure-aws-credentials; we only need to forward the account
# id, which Alchemy's `loadFromEnv` requires when CI=true.
AWS_ACCOUNT_ID: ${{ steps.aws-creds.outputs.aws-account-id }}
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
PR_PACKAGE_TOKEN: ${{ secrets.PR_PACKAGE_TOKEN }}
PKGING_HOST: ${{ env.PKGING_HOST }}
SMOKE_STAGE: ${{ env.SMOKE_STAGE }}
run: bun test:canary
+48
View File
@@ -0,0 +1,48 @@
node_modules/
dist/
/lib/
/alchemy/lib/
.out/
.test/
.DS_Store
.env
*.tsbuildinfo
.claude/
.alchemy/
# !.alchemy/github:alchemy/
# examples/*/.alchemy
.repomix-output.txt
wrangler.jsonc
# Husky - ignore generated files but keep hooks
.husky/_
!.husky/pre-commit
.smoke
.smoke.logs
smoke
# Generated by test/smoke.test.ts to make pnpm 11's deps-status check
# resolve the bun catalog. Cleaned up at end of suite.
pnpm-workspace.yaml
.svelte-kit
.astro
.wrangler
*.tgz
*.js
*.d.ts
*.map
.attest
.cache
.external
.bundle-benchmark
packages/alchemy/docs
.sonda
examples/cloudflare-worker/src/scratch.ts
!/packages/alchemy/bin/cli.js
.vendor/*
.tmp
pnpm-lock.yaml
+3
View File
@@ -0,0 +1,3 @@
[submodule "vendor/alchemy"]
path = .vendor/alchemy
url = [email protected]:alchemy-run/alchemy.git
+2
View File
@@ -0,0 +1,2 @@
bun format
git update-index --again
+1
View File
@@ -0,0 +1 @@
# see: https://opencode.ai/docs/tools/#ignore-patterns
+22
View File
@@ -0,0 +1,22 @@
{
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"endOfLine": "lf",
"ternaries": true,
"experimental_sort_imports": {
"order": "asc"
},
"ignorePatterns": [
"dist/**",
"*.min.js",
"**/lib/**",
"**/mdx/**",
"**/*.mdx",
"**/*.md",
"**/.vendor/**",
"**/package.json"
]
}
+8
View File
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"rules": {
"no-misused-new": "off",
"require-yield": "off",
"no-non-null-asserted-optional-chain": "off"
}
}
Submodule .repos/alchemy-effect/.vendor/alchemy added at c9f5e549cf.
+65
View File
@@ -0,0 +1,65 @@
{
"diffEditor.renderSideBySide": false,
"js/ts.experimental.useTsgo": true,
"typescript.experimental.useTsgo": true,
"typescript.tsdk": "node_modules/@typescript/native-preview/lib",
"typescript.native-preview.tsdk": "node_modules/@typescript/native-preview/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifierEnding": "js",
"oxc.enable": true,
"oxc.lint.run": "onSave",
"json.schemaDownload.enable": true,
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.codeLens": false,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.inlayHints.enabled": "offUnlessPressed",
"editor.tabSize": 2,
"editor.indentSize": 2,
"editor.insertSpaces": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.formatOnSave": false,
"editor.defaultFormatter": null
},
"[mdx]": {
"editor.defaultFormatter": null,
"editor.formatOnSave": false
},
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true,
"packages/alchemy/bin/**/*.js*": true,
"packages/alchemy/bin/**/*.d*": true
},
"[typescript]": {
"editor.indentSize": 2,
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[javascript]": {
"editor.indentSize": 2,
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescriptreact]": {
"editor.indentSize": 2,
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[javascriptreact]": {
"editor.indentSize": 2,
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"oxc.enable.oxfmt": true
}
+854
View File
@@ -0,0 +1,854 @@
# alchemy
Alchemy Effect is an Infrastructure-as-Effects (IaE) framework that extends Infrastructure-as-Code (IaC) by combining business logic and infrastructure config into a single, type-safe program expressed as Effects.
It includes a core IaC engine built with Effect. Effect provides the foundation for type-safe, composable, and testable infrastructure programs. It brings errors into the type-system and provides declarative/composable retry logic that ensure proper and reliable handling of failures.
# Concepts
- **Cloud Provider** - a cloud provider that offers a set of Services, e.g. AWS, Azure, GCP, Cloudflare, Stripe, Planetscale, Neon, etc.
- **Service** - a collection of Resources, Functions, and Bindings offered by a Cloud Provider.
- **Resource** - a named entity that is configuted with "Input Properties" and produces "Output Attributes". May or may not have Binding Contract.
- **Input Properties** - the properties passed as input to configure a Resource. Otherwise known as the "desired state" of the Resource.
- **Output Attributes** - the attributes produced by a Resource. Otherwise known as the "current state" of the Resource.
- **Stable Properties** - properties that are not affected by an Update, e.g. the ID or ARN of a Resource.
- **Function** (aka. **Runtime**) - a special kind of Resource that includes a runtime implementation expressed as a Function producing an `Effect<A, Err, Req>`. The `Req` type captures runtime dependencies, from which Infrastructure Dependencies are inferred.
- **Resource Provider** (see [Provider](./packages/alchemy/src/Provider.ts))
A Resource Provider implements the following Lifecycle Operations:
- **Diff** - compares new props with old props and determines if the Resource needs to be updated or replaced. For updates, it can also specify a list of Stable Properties that will not be changed by the update.
- **Read** - reads the current state of a Resource and returns the current Output Attributes. May return `Unowned(attrs)` to signal an existing-but-foreign resource that the engine should refuse to take over unless `--adopt` is set.
- **Pre-Create** - an optional operation that creates a stub of a Resource before reconcile runs. Used to resolve circular dependencies — e.g. Function A and B depend on each other, so we create a stub of Function A first and then `reconcile` later wires up the real dependency.
- **Reconcile** - converges a Resource's actual cloud state to the desired state described by the new Input Properties. Called for both first-time provisioning and subsequent updates. The provider receives `output` (current Attributes) and `olds` (previous Props) which may both be `undefined` on a greenfield create, both defined on an update, or `output !== undefined && olds === undefined` on an adoption. See the **Reconciler doctrine** section below for the required shape.
- **Delete** - deletes an existing Resource. It must be designed as idempotent because it is always possible for state persistence to fail after the delete operation is called. If the resource doesn't exist during deletion, it should not be considered an error.
- **Capability** - a runtime requirement of a Function (e.g. require `SQS.SendMessage` on a `SQS.Queue`). Each Capability is split into two parts: a `Binding.Service` (runtime SDK wrapper) and a `Binding.Policy` (deploy-time IAM/binding attachment).
- **Binding.Service** - an Effect Service that wraps an SDK client and exposes a `.bind(resource)` method returning a typed callable for runtime use. Provided as a Layer on the **Function** Effect so it gets bundled into the Lambda/Worker. See [Binding](./packages/alchemy/src/Binding.ts).
- **Binding.Policy** - an Effect Service that runs only at deploy time to attach IAM policies (AWS) or bindings (Cloudflare) to a Function's role/config. At runtime, `Binding.Policy` uses `Effect.serviceOption` so it gracefully becomes a no-op when the layer is not provided. Policy layers are provided on the **Stack** via `AWS.providers()()`, not on the Function.
- **Binding** - data attached to a Resource via `resource.bind(data)`. A Binding is a `{ context: PolicyContext, data: BindingData }` tuple that is collected on the Stack during plan/deploy. Bindings enable circular references between Resources — the `Binding.Policy` calls `ctx.bind({ policyStatements: [...] })` on the target Function, which records the binding data on the Stack. The Resource Provider then receives the resolved binding data in its `reconcile` lifecycle operation via the `bindings` parameter.
- **Binding Contract** - the shape of data a Resource accepts from Bindings. For example, a Lambda Function accepts `{ env?: Record<string, any>, policyStatements?: PolicyStatement[] }` because it needs environment variables and IAM policies. A Cloudflare Worker accepts `{ bindings: Worker.Binding[] }` for its native binding system. The Binding Contract is declared as the fourth type parameter on the `Resource` interface. See [Lambda Function](./packages/alchemy/src/AWS/Lambda/Function.ts) and [Cloudflare Worker](./packages/alchemy/src/Cloudflare/Workers/Worker.ts).
- **Dependency** - Resources depend on other Resources through two mechanisms:
- Output Properties of one Resource passed as Input Properties to another Resource (non-circular, directed acyclic graph)
- Bindings that attach data (IAM policies, env vars, Cloudflare bindings) from one Resource to another, enabling circular references between Resources.
- **Output** - a reference to (or derived from) a Resource's "Output Attributes". E.g. Bucket.bucketArn
- **Stack** - a collection of Resources, Functions, and Bindings that are deployed together.
- **Stack Name** - the name of a Stack, e.g. `my-stack`
- **Stage** - the stage of a Stack, e.g. `dev`, `prod`, `dev-sam`
- **Stack Instance** - a deployed instance of a Stack+Stage
- **Resource Type** - the type of a Resource, e.g. `Bucket`, `Instance`
- **Physical Name** - a unique name for a Resource, e.g. `my-bucket-1234567890`. It is usually best to generate them using the built-in createPhysicalName utility function which generates
- **Logical ID** - the logical ID identifying a resource within a Stack, e.g. `my-bucket`. It is stable across creates, updates, deletes and replaces.
- **Instance ID** - a unique identifier for an instance of a Resource. It is stable across creates, updates and deletes. It changes when a resource is replaced. It is truncated and used as the suffix of the Physical Name.
- **Event Source** - a special kind of Binding between a Function and a Resource that produces events that invoke the Function, e.g. `SQS.QueueEventSource`. Event Sources are implemented as Binding.Service + Binding.Policy pairs, where the attach logic creates/updates the event source mapping via the cloud provider API.
- **Replacement** - the process of replacing a Resource with a new one. A new one is created, downstream dependencies are updated with the new reference, and then the old one is deleted. Or, the old one is deleted first and then the new one is created.
- **Dependency Violation** - an error that some APIs call when an operation cannot be performed because a dependency is not met. E.g. you cannot delete an EIP until the NAT Gateway it is attached to is deleted. Lifecycle operations typically retry Dependency Violations.
- **Eventual Consistency** - create/update/delete operations can be eventually consistent leading to a variety of failure modes. For example, a Resource may be created but not yet available for use, or a Resource may be deleted but still appear in the console. Errors caused by eventual consistency should be retried, and lifecycle operations/tests should be carefully designed to wait for consistency before proceeding.
- **Retryable Error** - an error that can be retried. E.g. a Dependency Violation, Eventual Consistency Error, Transient Failure, etc.
- **Non-Retryable Error** - an error that cannot be retried. E.g. a Validation Error, Authorization Error, etc.
- **Retry Policy** - a policy for retrying errors. E.g. a fixed delay, exponential backoff, max retries, while some condition is true, or until some condition is true/false, etc.
# File System Conventions
Each Service's Resources follow the same pattern. Resource contract and provider are co-located in the same file. Capabilities (Binding.Service + Binding.Policy) are in separate files named after the capability.
```sh
# source files
packages/alchemy/src/{Cloud}/{Service}/index.ts # re-exports all resources and capabilities
packages/alchemy/src/{Cloud}/{Service}/{Resource}.ts # resource contract + resource provider
packages/alchemy/src/{Cloud}/{Service}/{Capability}.ts # Binding.Service + Binding.Policy for a capability
# test files
packages/alchemy/test/{Cloud}/{Service}/{Resource}.test.ts
# docs (auto-generated from source-code JSDoc - DO NOT manually edit)
website/src/content/docs/providers/{Cloud}/{Resource}.md # API reference, generated by `bun generate:api-reference`
```
Examples of actual paths:
```sh
packages/alchemy/src/AWS/S3/Bucket.ts # S3 Bucket resource + provider
packages/alchemy/src/AWS/S3/GetObject.ts # S3 GetObject Binding.Service + Binding.Policy
packages/alchemy/src/AWS/S3/PutObject.ts # S3 PutObject Binding.Service + Binding.Policy
packages/alchemy/src/AWS/SQS/Queue.ts # SQS Queue resource + provider
packages/alchemy/src/AWS/SQS/SendMessage.ts # SQS SendMessage capability
packages/alchemy/src/AWS/Kinesis/Stream.ts # Kinesis Stream resource + provider
packages/alchemy/src/AWS/Kinesis/PutRecord.ts # Kinesis PutRecord capability
packages/alchemy/src/AWS/Lambda/Function.ts # Lambda Function resource + provider
packages/alchemy/src/AWS/DynamoDB/Table.ts # DynamoDB Table resource + provider
packages/alchemy/src/AWS/DynamoDB/GetItem.ts # DynamoDB GetItem capability
packages/alchemy/src/AWS/EC2/Vpc.ts # VPC resource + provider
packages/alchemy/src/AWS/EC2/Subnet.ts # Subnet resource + provider
```
# Documentation Generation
**Source of truth:** The source code is the single source of truth for all API documentation. JSDoc comments in `packages/alchemy/src/**/*.ts` are extracted and used to generate the public API reference markdown.
:::warning
**Never edit the generated markdown files** under `website/src/content/docs/providers/{Cloud}/`. They are overwritten on every regeneration.
To "update the docs", edit the JSDoc on the source `.ts` file (resource-level JSDoc on the exported `const`, plus field-level JSDoc on each prop/attribute) and re-run the generator. There is no separate doc file to update.
:::
**How to generate docs:**
```sh
bun generate:api-reference # -> website/src/content/docs/providers/{Cloud}/{Resource}.md
```
This is the only doc generator that produces user-facing output. ([scripts/generate-api-reference.ts](./scripts/generate-api-reference.ts)) does the following:
1. Discovers resource files in `packages/alchemy/src/{Cloud}/{Service}/`
2. Parses TypeScript with `ts-morph`
3. Extracts the resource-level summary plus `@section` / `@example` blocks from JSDoc
4. Writes one markdown file per resource at `website/src/content/docs/providers/{Cloud}/{Resource}.md`
After editing JSDoc on a resource, run `bun generate:api-reference` to refresh the website docs.
**Writing good documentation:** When adding or updating a resource, ensure all Props and Attrs have JSDoc comments:
```typescript
export interface BucketProps {
/**
* Name of the bucket. If omitted, a unique name will be generated.
* Must be lowercase and between 3-63 characters.
*/
bucketName?: string;
/**
* Whether to delete all objects when the bucket is destroyed.
* @default false
*/
forceDestroy?: boolean;
}
```
The `@default` tag is used to document default values and will appear in the generated documentation.
### Examples and Sections (IMPORTANT)
**Examples are critical for documentation.** Every resource should have examples demonstrating common use cases. Use `@section` and `@example` JSDoc tags on the main Resource export to organize examples into a navigable table of contents.
**Format:**
- `@section <Section Title>` - Creates a heading in the Examples section and adds an entry to the Quick Reference table of contents
- `@example <Example Title>` - Creates a subheading for a specific code example (must follow a `@section`)
- Code blocks inside examples use standard markdown fenced code blocks (` `)
**Example:**
````typescript
/**
* An S3 bucket for storing objects.
*
* @section Creating a Bucket
* @example Basic Bucket
* ```typescript
* const bucket = yield* Bucket("my-bucket", {});
* ```
*
* @example Bucket with Force Destroy
* ```typescript
* const bucket = yield* Bucket("my-bucket", {
* forceDestroy: true,
* });
* ```
*
* @section Reading Objects
* @example Get Object from Bucket
* ```typescript
* const response = yield* getObject(bucket, { key: "my-key" });
* const body = yield* Effect.tryPromise(() => response.Body?.transformToString());
* ```
*
* @section Writing Objects
* @example Put Object to Bucket
* ```typescript
* yield* putObject(bucket, {
* key: "hello.txt",
* body: "Hello, World!",
* contentType: "text/plain",
* });
* ```
*/
export const Bucket = Resource<...>("AWS.S3.Bucket");
````
This generates:
1. A "Quick Reference" section with links to each `@section`
2. An "Examples" section with organized code examples under each section heading
**Best practices for examples:**
- Start with the simplest use case and progress to more complex ones
- Include examples for all major capabilities (GetObject, PutObject, etc.)
- Show real-world patterns like error handling, combining with other resources
- Use descriptive titles that explain what the example demonstrates
# Workflow
Development of Alchemy-Effect Resources is heavily pattern based. Each Service has many Resources that each have 0 oor more Capabilities and Event Sources. When working on a new Service, the following steps should be followed.
1. Research the AWS Service and identify its Resources, Identifier Types, Structs, Capabilities, and Event Sources. Refer to the corresponding Terraform Provider, Pulumi Provider, and CloudFormation docs for that service (use the provided tools specifically for searching these docs for services and resources).
Example (abbreviated):
Service: S3
Resources:
- Bucket
- BucketPolicy
- etc.
Bucket Capabilities:
- GetObject
- PutObject
- DeleteObject
Identifier Types:
- Bucket Name
- Bucket ARN
Structs:
- CorsRule
- LifecycleConfiguration
2. Document each of the Resource interfaces
Include the following information:
- ResourceName, e.g. Bucket, Instance, Queue
- Input Properties (for each property: Name, Type, Description, Default Value, Required, Constraints, Replaces: true/false)
- Output Attributes (for each attribute: Name, Type, Description)
3. Document each of the Capabilities and Bindings
Include the following information:
- Capability Name, e.g. `GetObject`, `PutObject` (it maps 1:1 with an AWS API)
- Constraints (e.g. `Key`)
- IAM Policies (how the capability maps to an IAM Policy, e.g. Effect: Allow, Action: s3:GetObject, Resource: `arn:aws:s3:::${bucketName}/${Key}`)
- Environment Variables (what environment variables should be added to a Lambda Function so that it can access the capability, e.g. `BUCKET_NAME`, `BUCKET_ARN`, `QUEUE_URL`, `QUEUE_ARN`, etc.)
4. Research and design each of the Lifecycle Operations
- **Diff** - identify which properties are always stable across any update, which properties change conditionally depending on new and old values, which properties trigger a replacement. This is usually just a distinct list, but can sometimes require if-this-then-that logic. Document it explicitly and exhaustively. Cross-reference with AWS CloudFormation, Terraform Provider and Pulumi Provider docs.
:::warning
You should almost never use `no-op` in the Diff. No-op should be explicitly designed as a way to say "i know this property changed, but i don't want it to trigger an update". This is an edge-case and not the norm. Usually you want diff to return `undefined` or `void` to let the engine apply the default update logic. Diff is usually just use as an optimization or to identify replacement instead of update.
:::
- **Read** - determine which API calls are required to read the Output Attributes of a Resource from the Cloud Provider state (otherwise known as refresh or synchronize resource state). This is usually a single Get{Resource} API call, but can be a complex set of calls depending on the Service. Read can also be called without the current Output Attributes because of past state persistence failures. These cases are handled by computing the deterministic Physical Name and looking it up or by searching for Resources using tags (if the Cloud Provider supports it). Read may return `Unowned(attrs)` when the resource exists but lacks our ownership tags, signalling the engine to gate adoption behind `--adopt` or `adopt(true)`.
- **Pre-Create** - determine if the Resource needs a pre-create operation. This is usually only the case for the special Function/Runtime Resources like AWS Lambda Functions. If it is required, then document which API call(s) should be called and what the empty (unit) input properties are. E.g. a Lambda Function takes a simple script that exports a no-op handler function.
- **Reconcile** - determine the API calls needed to converge the cloud's actual state to the desired state described by the new Input Properties. Reconcile must be a single flow that works whether the resource is missing (greenfield create), pre-existing under our ownership (update), or freshly adopted (`output` defined but `olds` absent). See the **Reconciler doctrine** section below.
- **Delete** - determine which APIs should be called and in what order to delete an existing Resource. Delete should be idempotent so that if the resource has already been deleted, it is not considered an error. It is common for deletions to fail because of Dependency Violations or Eventual Consistency Errors. These are not always called Dependency Violations in the API docs, so attention should be paid to investigating each API's possible error codes and how they should be handled by the Delete operation. Should we retry for a period of time, indefinitely, or fail immediately?
# Reconciler doctrine
The provider's `reconcile` function replaces the legacy `create` + `update` pair. It runs every time the engine wants to make the cloud match the desired state — whether that's the first time the resource is being provisioned, a routine update, or a takeover after `read` returned an existing cloud resource.
It receives `output: Attributes | undefined` and `olds: Props | undefined`:
| `output` | `olds` | Meaning |
| ------------ | ------------ | ------------------------------------------------- |
| `undefined` | `undefined` | Greenfield — no prior physical resource |
| defined | defined | Routine update — engine-owned resource |
| defined | `undefined` | Adoption — engine adopted via `read` |
A reconciler MUST work correctly for all three combinations. It MUST NOT branch the body on `output === undefined` and run different code paths for "create" vs "update". That pattern is just rename-and-branch and re-introduces every assumption the old `create`/`update` split made. Instead, write one flow:
```
1. Observe — derive the physical identifier; read live cloud state via getX/describeX
2. Ensure — if the resource is missing, call createX. Catch AlreadyExists/ConflictException
as a race and continue. Wait for active state if applicable.
3. Sync — for each mutable aspect (settings, sub-resources, tags, policy):
- read OBSERVED cloud state (not olds)
- compute desired state from news + bindings
- diff observed against desired
- apply only the delta API call (skip the API entirely on no-op)
4. Return — re-read final state if needed; return the fresh Attributes shape
```
Key invariants:
- **Observation > assumption.** Cloud state is authoritative. `olds` is at most a hint to skip a no-op API call; it is never the source of truth for what's actually deployed.
- **Each sync step is independently idempotent.** Crash mid-reconcile, re-run, you converge.
- **`output` is treated as a cache** for stable identifiers (physical name, ARN, immutable id). It is NOT a guarantee that the resource still exists. If it doesn't, observation falls through to "missing" and ensure recreates.
- **`AlreadyExists`/`NotFoundException`/`ResourceInUseException`-style errors are caught**, not propagated — they're races or eventual-consistency, not failures.
- **Tags use observed cloud tags as the diff baseline**, not `olds.tags` or `output.tags`. Adoption may bring you a resource with foreign tags that need to be reconciled.
:::warning
**Do not write `if (output === undefined) { /* create body */ } else { /* update body */ }`.** That is rename-and-branch, not reconciliation. The reconciler's body is one observe-ensure-sync flow that produces correct cloud state regardless of starting point.
:::
The canonical reference reconcilers cover the common shapes:
- [S3 Bucket](./packages/alchemy/src/AWS/S3/Bucket.ts) — uses `ensureBucketExists` + `syncBucketTags` + `syncBucketPolicy` helpers; each helper is itself a tiny reconciler.
- [SQS Queue](./packages/alchemy/src/AWS/SQS/Queue.ts) — observe via `getQueueUrl`, ensure via `createQueue` (tolerates `QueueNameExists` race), sync attributes by diffing `getQueueAttributes` against desired, sync tags.
- [Kinesis Stream](./packages/alchemy/src/AWS/Kinesis/Stream.ts) — many mutable aspects (mode, shards, retention, encryption, metrics), each its own observed-vs-desired sync block.
- [DynamoDB Table](./packages/alchemy/src/AWS/DynamoDB/Table.ts) — multi-API observation (table + tags + PITR + TTL), per-aspect diffing, GSI delta application.
- [EC2 Vpc](./packages/alchemy/src/AWS/EC2/Vpc.ts) — auto-assigned id, observe via `describeVpcs([output.vpcId])` with NotFound fallback to create, sync DNS attrs by reading `describeVpcAttribute`, sync tags from observed `vpc.Tags`.
- [Lambda Function](./packages/alchemy/src/AWS/Lambda/Function.ts) — uses `createOrUpdateFunction` / `createOrUpdateFunctionUrl` / `attachBindings` helpers, each idempotent.
- [Cloudflare Worker](./packages/alchemy/src/Cloudflare/Workers/Worker.ts) — non-AWS API; the underlying `putWorker` is a true upsert, so reconcile observes existing settings and delegates.
Existence-only resources (Lambda Permission, EC2 Route, EC2 RouteTableAssociation, IAM AccessKey, etc.) have nothing mutable beyond their identity. Their reconciler is just observe → if missing, create. There is no sync step.
5. Research and design the test cases for each resource. Test cases can be single or multi-step. Single-step test cases are just testing a single create success or failure mode. Multi-step cases are testing a sequence of operations, starting with create and then updating or replacing the resource multiple times. Test cases should be designed to be exhaustive and cover all possible success and failure modes, starting from simple happy paths to long, complicated aggregate (including other resources) smoke tests.
6. Implement the Resource contract and Provider in `packages/alchemy/src/{Cloud}/{Service}/{Resource}.ts`.
The Resource contract (Props, Attributes, Binding Contract) and the Resource Provider (lifecycle operations) are co-located in the same file.
Read through the established examples to understand the pattern:
- [S3 Bucket](./packages/alchemy/src/AWS/S3/Bucket.ts)
- [SQS Queue](./packages/alchemy/src/AWS/SQS/Queue.ts)
- [DynamoDB Table](./packages/alchemy/src/AWS/DynamoDB/Table.ts)
- [Kinesis Stream](./packages/alchemy/src/AWS/Kinesis/Stream.ts)
- [Lambda Function](./packages/alchemy/src/AWS/Lambda/Function.ts)
- [VPC](./packages/alchemy/src/AWS/EC2/Vpc.ts)
- [Subnet](./packages/alchemy/src/AWS/EC2/Subnet.ts)
The Resource interface takes four type parameters: `Resource<Type, Props, Attributes, BindingContract>`.
```ts
export interface Stream extends Resource<
"AWS.Kinesis.Stream",
StreamProps,
{
streamName: string;
streamArn: string;
streamStatus: StreamStatus;
}
> {}
export const Stream = Resource<Stream>("AWS.Kinesis.Stream");
```
For Resources that accept Bindings (like Lambda Function), include a fourth type parameter for the Binding Contract:
```ts
export interface Function extends Resource<
"AWS.Lambda.Function",
FunctionProps,
{
functionArn: string;
functionName: string;
functionUrl: string | undefined;
roleName: string;
roleArn: string;
},
{
env?: Record<string, any>;
policyStatements?: PolicyStatement[];
}
> {}
```
:::tip
Some Input Property types are wrapped in an `Input<T>`, but not all are. Only properties that may need to be references to another resource's Output Attribute. E.g. common use-cases are `Input<VpcId>`, `Input<QueueUrl>`, `Tags: Record<string, Input<string>>`.
:::
:::warning
For fields like `name: string`, `bucketName: string`, `bucketPrefix: string`, you should not use `Input<string>` because these properties need to be statically knowable in the `diff` function.
:::
7. Implement the Capabilities as `Binding.Service` + `Binding.Policy` pairs in `packages/alchemy/src/{Cloud}/{Service}/{Capability}.ts`.
Each capability has two parts:
- **`Binding.Service`** — runtime SDK wrapper, provided on the Function Effect (bundled into Lambda/Worker)
- **`Binding.Policy`** — deploy-time IAM policy attachment, provided on the Stack via `AWS.providers()()` (never bundled)
Read through the established capabilities to understand the pattern:
- [S3 GetObject](./packages/alchemy/src/AWS/S3/GetObject.ts) — `Binding.Service` + `Binding.Policy`
- [S3 PutObject](./packages/alchemy/src/AWS/S3/PutObject.ts) — `Binding.Service` + `Binding.Policy`
- [SQS SendMessage](./packages/alchemy/src/AWS/SQS/SendMessage.ts) — `Binding.Service` + `Binding.Policy`
- [DynamoDB GetItem](./packages/alchemy/src/AWS/DynamoDB/GetItem.ts) — `Binding.Service` + `Binding.Policy`
- [Kinesis PutRecord](./packages/alchemy/src/AWS/Kinesis/PutRecord.ts) — `Binding.Service` + `Binding.Policy`
- [Lambda InvokeFunction](./packages/alchemy/src/AWS/Lambda/InvokeFunction.ts) — `Binding.Service` + `Binding.Policy`
For Event Sources, see:
- [SQS QueueEventSource](./packages/alchemy/src/AWS/SQS/QueueEventSource.ts)
- [S3 BucketEventSource](./packages/alchemy/src/AWS/S3/BucketEventSource.ts)
The `Binding.Policy` implementation calls `ctx.bind({ policyStatements: [...] })` on the target Function, which records binding data on the Stack. The `Binding.Service` implementation resolves the Policy via `yield* Policy(resource)`, then returns a typed callable that wraps the SDK client. At runtime, the Policy is not provided and becomes a no-op.
Each capability exports four things:
```ts
// 1. The Binding.Service class
export class PutRecord extends Binding.Service<...>()("AWS.Kinesis.PutRecord") {}
// 2. The Binding.Service Live layer (provided on Function Effect)
export const PutRecordLive = Layer.effect(PutRecord, ...);
// 3. The Binding.Policy class
export class PutRecordPolicy extends Binding.Policy<...>()("AWS.Kinesis.PutRecord") {}
// 4. The Binding.Policy Live layer (provided on Stack via AWS.providers()())
export const PutRecordPolicyLive = Layer.effect(PutRecordPolicy, ...);
```
### Runtime-only methods: color with `Alchemy.RuntimeContext`
The runtime callable returned by a `Binding.Service` (the inner Effect inside `.bind(resource)`'s return) **must** declare `Alchemy.RuntimeContext` as a requirement. This is how Alchemy models "this code can only run inside a deployed Function/Worker" at the type level — analogous to a colored function.
```ts
import type { RuntimeContext } from "../../RuntimeContext.ts";
export class GetItem extends Binding.Service<
GetItem,
<T extends Table>(
table: T,
) => Effect.Effect<
(
request: GetItemRequest,
) => Effect.Effect<
DynamoDB.GetItemOutput,
DynamoDB.GetItemError,
RuntimeContext // ← runtime-only
>
>
>()("AWS.DynamoDB.GetItem") {}
```
Rules:
- **Outer Effect** (the `bind(resource)` setup) runs at the Function's init phase. It does NOT require `RuntimeContext`.
- **Inner Effect** (the actual SDK invocation) only makes sense inside a running Function. It MUST require `RuntimeContext`.
- Resolve cloud-environment services (`WorkerEnvironment`, AWS SDK clients, etc.) once during Layer construction and close over them. Do NOT leak `WorkerEnvironment` / `Lambda.FunctionEnvironment` onto the runtime callable — that couples downstream service code to a specific cloud and breaks Layer encapsulation. The Function/Worker runtime satisfies `RuntimeContext` automatically.
- The implementation can return `Effect.Effect<A, E>` without explicitly providing `RuntimeContext` (it's contravariant in `R`); just declare it on the interface.
Why this matters: consumers can build cloud-agnostic services on top of bindings using `Layer.effect(Tag, ...)` without polluting their service interface with `WorkerEnvironment`. See [Layers concept](./website/src/content/docs/concepts/layers.mdx).
After implementing, register the Policy in `AWS.providers()()`:
- Add the `*PolicyLive` layer to `bindings()` in [Providers.ts](./packages/alchemy/src/AWS/Providers.ts)
- Re-export from the service's `index.ts`
:::tip
If you need to know what AWS region or account ID the resource is being created/updated in, you can use this inside any of the lifecycle operations.
```ts
const region = yield * Region;
const account = yield * Account;
```
:::
:::warning
You should favor getting the region/account INSIDE the lifecycle operations instead of inside the Layer effect like this because then it's scoped to the resource isntead of the resource provider:
```ts
reconcile: Effect.fn(function* ({ id, news, output, session }) {
const region = yield* Region;
const accountId = yield* Account;
});
```
:::
:::warning
Do not use `Effect.orDie` in the lifecycle operations since this will crash the whole IaC engine.
:::
:::warning
**Never use `async`/`await`, raw `Promise`, `node:fs/promises`, `node:fs`, `node:os`, or `pathe` directly in resource code.** Always use the Effect platform services so that effects remain composable, traceable, retryable, and testable:
| Don't | Do |
| ---------------------------------------------------- | ----------------------------------------------------------- |
| `import fs from "node:fs/promises"` | `const fs = yield* FileSystem.FileSystem` |
| `await fs.readFile(p, "utf8")` | `yield* fs.readFileString(p)` |
| `await fs.mkdtemp(...)` | `yield* fs.makeTempDirectory({ prefix: ... })` |
| `import path from "pathe"` / `node:path` | `const path = yield* Path.Path` |
| `await fetch(...)` | `yield* HttpClient.HttpClient` + `HttpClientRequest` |
| `Effect.promise(() => listSqlFiles(dir))` | Make `listSqlFiles` itself return `Effect` and `yield*` it |
| `new Promise((res) => setTimeout(res, ms))` | `yield* Effect.sleep(Duration.millis(ms))` |
Sync, CPU-only Node APIs (e.g. `crypto.createHash().update().digest()`, `process.cwd()`, `Buffer`, `TextEncoder`) must still be wrapped in `Effect.sync(() => ...)` (or `Effect.try` if they can throw) so the call participates in the Effect runtime — tracing, interruption, and error channels. Don't call them as bare expressions inside `Effect.gen`.
```ts
const hash = yield* Effect.sync(() =>
crypto.createHash("sha256").update(input).digest("hex"),
);
const cwd = yield* Effect.sync(() => process.cwd());
```
This applies to **lifecycle operations, helpers, AND tests**. Tests must use `FileSystem.FileSystem`/`Path.Path` for any file/path access (see [Database.test.ts](./packages/alchemy/test/Cloudflare/D1/Database.test.ts) for the pattern).
:::
:::tip
If a Resource supports tags, you should always include the internal Alchemy tags to brand the resource with the app, stage and logical ID so that we can "know" that we created it and are responsible for it.
```ts
reconcile: Effect.fn(function* ({ id, news, output, session }) {
const internalTags = yield* createInternalTags(id);
const userTags = news.tags ?? {};
const allTags = { ...internalTags, ...userTags };
});
```
:::
:::warning
Do not roll your own tag diffing logic, always use `diffTags` from [Tags.ts](./packages/alchemy/src/Tags.ts), and diff against **observed cloud tags** (not `olds.tags` or `output.tags`). Adoption can hand you a resource whose tags don't match what we last persisted.
```ts
reconcile: Effect.fn(function* ({ id, news, output, session }) {
const internalTags = yield* createInternalTags(id);
const newTags = { ...news.tags, ...internalTags };
// Read tags fresh from the cloud so adoption (where tags may not match
// what we last persisted) converges correctly.
const oldTags = yield* fetchObservedTags(/* … */);
// Option 1. use `upsert` if the API expects you to create/update tags in one call
const { removed, upsert } = diffTags(oldTags, newTags);
// Option 2. use `added` and `updated` if the API expects you to create/update tags in separate calls
const { removed, added, updated } = diffTags(oldTags, newTags);
// Option 3. use `upsert` only if the API doesn't expect you to remove tags (only PUT/UPDATe)
const { upsert } = diffTags(oldTags, newTags);
```
:::
9. Implement the test cases in `packages/alchemy/test/{Cloud}/{Service}/{Resource}.test.ts`.
Read through the established test cases before continuing so that you understand the pattern and structure of the test cases.
- [S3 Bucket Test Cases](./test/AWS/S3/Bucket.test.ts)
- [SQS Queue Test Cases](./test/AWS/SQS/Queue.test.ts)
- [Lambda Function Test Cases](./test/AWS/Lambda/Function.test.ts)
- [Kinesis Stream Test Cases](./test/AWS/Kinesis/Stream.test.ts)
- [DynamoDB Table Test Cases](./test/AWS/DynamoDB/Table.test.ts)
- [VPC Test Cases](./test/AWS/EC2/Vpc.test.ts)
- [Subnet Test Cases](./test/AWS/EC2/Subnet.test.ts)
:::warning
Never use `Date.now()` when constructing the physical name of a resource. You should either:
1. Do not proide a name and rely on the resource provider to generate a unique name for you from the app, stage and logical ID.
2. Construct a deterministic one unique to each test case. But it should be the same on each subsequent run of the test case.
:::
3. Consider implementing an aggregate Smoke test that brings together multiple resources that are often used together.
See the [VPC Smoke Test](./test/AWS/EC2/Vpc.smoke.test.ts) for an example.
11. Add the resource-level JSDoc (`@section` + `@example` blocks) and field-level JSDoc on each prop/attribute on the source `.ts` file. Then run `bun generate:api-reference` to refresh `website/src/content/docs/providers/{Cloud}/{Resource}.md`. Do NOT manually edit the generated markdown.
# Test Fixtures for Effect-Native Workers / Functions
To test runtime behavior of an Effect-native Worker, Workflow, Lambda, etc., write a **fixture** that defines the Worker/Function with the bindings under test and exposes one HTTP route per behavior, then write a **test** that deploys the fixture once via `beforeAll` and drives it over HTTP.
## File system layout
Put fixtures in a `fixtures/` directory next to the test file. Each test suite owns its own fixtures — never reach across suites:
```sh
packages/alchemy/test/{Cloud}/{Service}/{Resource}.test.ts
packages/alchemy/test/{Cloud}/{Service}/fixtures/{worker|workflow|handler}.ts
```
## Fixture shape
Resolve the bindings, expose one route per behavior, default-export the class so the test can deploy it directly:
```ts
// fixtures/worker.ts
import * as Cloudflare from "@/Cloudflare/index.ts";
import * as Effect from "effect/Effect";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import { Gateway } from "./gateway.ts";
export default class TestWorker extends Cloudflare.Worker<TestWorker>()(
"TestWorker",
{
main: import.meta.filename,
},
Effect.gen(function* () {
const aiGateway = yield* Cloudflare.AiGateway.bind(Gateway);
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
if (request.url.startsWith("/url")) {
const url = yield* aiGateway.getUrl().pipe(Effect.orDie);
return yield* HttpServerResponse.json({ url });
}
return HttpServerResponse.text("ok");
}),
};
}).pipe(Effect.provide(Cloudflare.AiGatewayBindingLive)),
) {}
```
## Test shape
Compose a `Stack` that deploys the fixture, share one deploy across the file with `beforeAll`/`afterAll`, drive it via `HttpClient`, and retry the first request through edge propagation:
```ts
// Service.test.ts
import * as Alchemy from "@/index.ts";
import * as Cloudflare from "@/Cloudflare";
import * as Test from "@/Test/Vitest";
import { expect } from "@effect/vitest";
import * as Effect from "effect/Effect";
import * as Schedule from "effect/Schedule";
import * as HttpClient from "effect/unstable/http/HttpClient";
import TestWorker from "./fixtures/worker.ts";
const { test, beforeAll, afterAll, deploy, destroy } = Test.make({
providers: Cloudflare.providers(),
});
const Stack = Alchemy.Stack(
"ServiceTestStack",
{ providers: Cloudflare.providers(), state: Cloudflare.state() },
Effect.gen(function* () {
const worker = yield* TestWorker;
return { url: worker.url.as<string>() };
}),
);
const stack = beforeAll(deploy(Stack));
afterAll.skipIf(!!process.env.NO_DESTROY)(destroy(Stack));
test(
"deployed worker exercises the binding",
Effect.gen(function* () {
const { url } = yield* stack;
const client = yield* HttpClient.HttpClient;
const res = yield* client.get(`${url}/url`).pipe(
Effect.retry({ schedule: Schedule.exponential("500 millis"), times: 10 }),
);
expect(res.status).toBe(200);
const body = (yield* res.json) as { url: string };
expect(body.url).toContain("gateway.ai.cloudflare.com");
}),
{ timeout: 180_000 },
);
```
Notes:
- `Test.make({ providers: Cloudflare.providers() })` gives you `test`, `beforeAll`, `afterAll`, `deploy`, `destroy`.
- `beforeAll(deploy(Stack))` returns a handle (`stack` above) that every `test` body can `yield*` to get the stack outputs.
- `afterAll.skipIf(!!process.env.NO_DESTROY)(destroy(Stack))` is the standard cleanup — set `NO_DESTROY=1` locally to keep the deployment around between runs while iterating.
- Always retry the first request (`Schedule.exponential("500 millis")`) — fresh workers.dev URLs and Lambda function URLs take a few seconds to start serving 200s.
- For POST: use `client.post(url)` for empty bodies, or `HttpClient.execute(HttpClientRequest.post(url).pipe(HttpClientRequest.bodyJsonUnsafe(body)))` for typed bodies.
- **Never use `while (Date.now() < deadline)` loops to poll** for an async side effect (a workflow status, a cron fire, a queue drain, eventual-consistency read, etc.). Use `Effect.repeat` with a `Schedule` and an `until` predicate so the polling participates in the Effect runtime — tracing, interruption, and error propagation work correctly, and the intent is declarative. Cap iterations with `times: N` (or a bounded schedule) so the test fails fast instead of running until the vitest timeout:
```ts
// good — declarative, bounded, interruption-safe
const value = yield* fetchValue.pipe(
Effect.repeat({
schedule: Schedule.spaced("5 seconds"),
until: (v) => v.ready,
times: 36,
}),
);
// bad — opaque loop, ignores interruption, leaks into vitest timeout
let value: Value | undefined;
const deadline = Date.now() + 180_000;
while (Date.now() < deadline) {
value = yield* fetchValue;
if (value.ready) break;
yield* Effect.sleep("5 seconds");
}
```
See [CronEventSource.test.ts](./packages/alchemy/test/Cloudflare/Workers/CronEventSource.test.ts) for a real-world example (polling a DO via the worker's `/times` route until the cron handler fires).
## Reference implementations
- Cloudflare AiGateway — [worker fixture](./packages/alchemy/test/Cloudflare/AiGateway/worker.ts) + [test](./packages/alchemy/test/Cloudflare/AiGateway/AiGateway.test.ts) (the deploy+fetch case lives at the bottom of the file)
- Cloudflare D1Connection — [worker fixture](./packages/alchemy/test/Cloudflare/D1/d1-worker.ts) + [test](./packages/alchemy/test/Cloudflare/D1/D1Binding.test.ts)
- Cloudflare Workflow — [workflow fixture](./packages/alchemy/test/Cloudflare/Workers/fixtures/test-workflow.ts) + [worker fixture](./packages/alchemy/test/Cloudflare/Workers/fixtures/workflow-worker.ts) + [test](./packages/alchemy/test/Cloudflare/Workers/Workflow.test.ts)
- Cloudflare Cron Trigger — [worker + DO fixture](./packages/alchemy/test/Cloudflare/Workers/fixtures/cron-worker.ts) + [test](./packages/alchemy/test/Cloudflare/Workers/CronEventSource.test.ts) (cron handler writes to a DO; test polls a fetch route with `Effect.repeat` until the scheduled handler fires)
- Cloudflare Images — [effect fixture](./packages/alchemy/test/Cloudflare/Images/fixtures/effect-worker.ts) + [async fixture](./packages/alchemy/test/Cloudflare/Images/fixtures/async-worker.ts) + [test](./packages/alchemy/test/Cloudflare/Images/Images.test.ts)
- AWS Lambda (DynamoDB bindings) — [Lambda fixture](./packages/alchemy/test/AWS/DynamoDB/handler.ts) + [test](./packages/alchemy/test/AWS/DynamoDB/Bindings.test.ts) (one `describe("<BindingName>")` per binding, all driving the same deployed Lambda)
# Spec-Driven Service Bring-Up
Use @processes/AWS.md as the source of truth for bringing a single AWS service from zero to full coverage.
That process covers:
- deriving resources, bindings, event sources, and helpers from distilled
- the audit-driven implementation loop
- deterministic checks for registration and binding test coverage
- Lambda fixture testing conventions
- learned conventions like no auto-marshalling and one `describe("<BindingName>")` block per binding
Keep `AGENTS.md` high-level and update @processes/AWS.md when the process evolves.
When a canonical resource needs mutable event-source configuration and there is any chance of circularity, prefer a resource binding contract over a plain input prop. DynamoDB Streams is the reference case: `Table` owns the actual stream state, while `streams(table)` injects that state via bindings and the runtime-specific layer handles the subscription mechanics. See @processes/AWS.md for the DynamoDB Streams case study.
# Build and Type Checking
Always run type checking before committing changes:
```bash
bun tsc -b
```
This runs the TypeScript compiler in build mode, which checks all projects in the workspace. This is critical because CI will fail if there are type errors.
## Build Commands
| Command | Description |
| ----------------- | -------------------------------------------------------------------------------------------- |
| `bun tsc -b` | Type check all projects (always run before committing) |
| `bun run build` | Clean, type check, and build the alchemy package |
| `bun build:clean` | Full clean rebuild: cleans all artifacts, reinstalls dependencies, builds, and downloads env |
Use `bun build:clean` when you encounter stale build artifacts or dependency issues. It runs:
1. `bun clean .` - Removes all untracked files except .env
2. `bun i` - Reinstalls dependencies
3. `bun run build` - Builds the project
4. `bun download:env` - Downloads environment files
# Tutorial Documentation Standard
Tutorials under `website/src/content/docs/tutorial/` are **step-by-step and granular**: every code snippet introduces exactly **one** new thing, followed by a short prose explanation of just that thing. Each step gets its own `##` heading.
**Anti-pattern** — one snippet that adds multiple distinct changes, followed by a numbered list or bullet list explaining each:
````md
## Bind the DO to the Worker
```diff lang="typescript"
+import Counter from "./counter.ts";
+import { HttpServerRequest } from "...";
Effect.gen(function* () {
+ const counters = yield* Counter;
return {
fetch: Effect.gen(function* () {
+ const request = yield* HttpServerRequest;
+ if (request.url.startsWith("/counter/") && ...) {
+ const next = yield* counters.getByName(name).increment();
+ return HttpServerResponse.text(String(next));
+ }
return HttpServerResponse.text("Hello!");
}),
};
})
```
Two things just happened:
1. `yield* Counter` registers the DO ...
2. `counters.getByName(name)` returns a typed stub ...
````
**Correct** — split into one heading per step, each with one snippet and one explanation:
````md
## Bind the DO to the Worker
```diff lang="typescript"
+import Counter from "./counter.ts";
Effect.gen(function* () {
+ const counters = yield* Counter;
...
})
```
`yield* Counter` registers the DO with the Worker (binding + class-migration metadata) and hands you the namespace.
## Call the DO from `fetch`
```diff lang="typescript"
+import { HttpServerRequest } from "...";
fetch: Effect.gen(function* () {
+ const request = yield* HttpServerRequest;
+ if (request.url.startsWith("/counter/") && ...) {
+ const next = yield* counters.getByName(name).increment();
+ return HttpServerResponse.text(String(next));
+ }
return HttpServerResponse.text("Hello!");
})
```
`counters.getByName(name)` returns a typed stub — `increment()` and `get()` round-trip through Cloudflare's RPC machinery.
````
Rules of thumb:
- If you find yourself writing "Two/three things just happened", "A few things are happening here", or a numbered/bulleted list explaining separate parts of a single snippet — **split the snippet**.
- One concept ⇒ one heading ⇒ one diff snippet ⇒ one explanation paragraph (no bullets).
- Bullet/numbered lists are fine when they describe a recap, prerequisites, or genuinely list-shaped content (e.g. "the Worker now handles two routes: PUT and GET" at the end). They are **not** fine as a substitute for splitting a compound snippet.
- A single API call that internally does several things (e.g. `Cloudflare.upgrade()`) doesn't need splitting — describe its behavior in prose.
- Use `diff lang="typescript"` blocks so each step shows what's added on top of the previous step.
# Pull Request Conventions
When you automatically open a PR, it MUST follow this structure:
- **Title**: Use conventional commit format (e.g. `fix(website): mobile theme metas`, `feat(aws/s3): add bucket lifecycle rules`).
- **Description heading levels**: NEVER use `#` or `##` in the PR description. The smallest heading allowed is `###`. The PR description must NOT begin with its own title heading — GitHub already renders the PR title above it.
- **Content**: Aim for the minimal content needed to convey the idea.
- Use simple sentences. If there are multiple discrete changes, use bullet points.
- **Prefer code snippets over prose.** A short ` ```ts ` or ` ```diff ` block showing the new/changed shape is worth more than a paragraph explaining it. Reach for code first; only add prose to fill in the "why" the snippet can't show on its own.
- Be direct and succinct. Cut adjectives, justifications, and anything that reads like marketing copy. If a sentence is restating what the diff already shows, delete it.
- **Never include a "Test plan", "Testing", or checklist of TODOs.** PR descriptions document the change, not the verification process. If something needs manual verification, follow the draft-PR rule below.
- Skip examples for trivial fixes, internal refactors, or doc-only changes.
Example PR description (good — code snippet does the talking):
````
Track which state-store backend each project uses by emitting a `state_store.init` span tagged with `alchemy.state_store.kind`.
```ts
// every Layer.effect(State, …) site now wraps construction:
makeLocalState().pipe(recordStateStoreInit("local"))
```
Dashboard groups projects by kind from these spans (Axiom can't APL-query metric datasets).
````
- **Outstanding work / testing / review needed**: If there are outstanding steps, manual testing required, or review items, DO NOT leave a comment on the PR and DO NOT include them in the PR description. Instead:
1. Mark the PR as **draft**.
2. Tell the user (in the chat that initiated the PR creation) what is outstanding.
:::warning
**Markdown content must reach GitHub verbatim** — un-escaped backticks, fenced code blocks, etc. The reliable shape is to write the description to a file and pass `--body-file <path>` to `gh pr create` / `gh pr edit`:
```sh
# write the body to a temp file (use Write tool, not echo/cat heredoc)
gh pr edit 179 --body-file /tmp/pr-body.md
```
Do **not** inline the body via `--body "$(cat <<'EOF' ... EOF)"`. Even with a single-quoted heredoc some shells / `gh` versions still mangle backticks and backslashes; the resulting PR body ends up with literal `\`` sequences instead of inline code spans. `--body-file` sidesteps shell quoting entirely.
If you need to update an already-created PR's body, prefer `gh pr edit --body-file ...`. If that silently no-ops (older `gh` versions), fall back to `gh api -X PATCH repos/<owner>/<repo>/pulls/<n> -F body=@/tmp/pr-body.md`.
:::
The summary goes at the very top of the description as plain prose — NO heading above it, no `### Summary`, nothing. The PR title already serves as the title; do not repeat or re-title it. Only add `###` subheadings further down if the description genuinely has multiple sections worth separating.
Example PR description (good):
```
Persist the user's selected theme across reloads and fix a hero scroll glitch on mobile.
- Read theme from `localStorage` on mount before first paint
- Add `<meta name="theme-color">` per theme so mobile chrome matches
```
Example PR description (BAD — do not do this):
```
## Theme persistence fix ← no, the PR title already exists
### Summary ← no, summary needs no heading
Persist the user's theme...
```
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
@AGENTS.md
+85
View File
@@ -0,0 +1,85 @@
<div align="center">
<a href="https://v2.alchemy.run">
<img src="./images/readme-hero.png" alt="Alchemy — Infrastructure as Effects" width="360" />
</a>
<br />
[![npm](https://img.shields.io/npm/v/alchemy?style=flat-square&color=3f5a2a&label=alchemy)](https://www.npmjs.com/package/alchemy)
[![license](https://img.shields.io/badge/license-Apache%202.0-3f5a2a?style=flat-square)](./LICENSE)
[![discord](https://img.shields.io/badge/discord-join-3f5a2a?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/jwKw8dBJdN)
**Infrastructure-as-Effects** — cloud infrastructure and application logic as a single, type-safe [Effect](https://effect.website) program.
[Docs](https://v2.alchemy.run) · [Tutorial](https://v2.alchemy.run/tutorial/part-1) · [Examples](./examples) · [Discord](https://discord.gg/jwKw8dBJdN)
</div>
---
A Worker bound to a R2 bucket and serving objects from it:
```typescript
const Bucket = Cloudflare.R2Bucket("bucket");
export default Cloudflare.Worker(
"api",
{ main: import.meta.path },
Effect.gen(function* () {
const bucket = yield* Cloudflare.R2Bucket.bind(Bucket);
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
const object = yield* bucket.get(request.url);
return HttpServerResponse.stream(object!.body);
})
};
}),
);
```
One `bind()` wires the binding, env var, and typed connection — at deploy time and at runtime.
---
- **One program, one language.** Resources, Lambdas/Workers, IAM, and SDKs live in the same Effect program — no YAML, no second runtime.
- **Bindings, not glue code.** `S3.GetObject.bind(bucket)` wires the IAM policy, env var, and a typed SDK call in a single line.
- **Errors in the type system.** Every cloud API failure is a tagged Effect error you handle — or don't — on purpose.
- **AWS + Cloudflare today.** S3, SQS, DynamoDB, Kinesis, Lambda, EC2 / Workers, R2, D1, Durable Objects, Containers.
- **Same code, every stage.** Local dev, `plan` / `deploy`, smoke tests, and CI all share one mental model.
```sh
bun add alchemy effect
```
## Bootstrap with an AI coding agent
Paste this into Claude Code, Cursor, or any agent that can fetch a URL:
```
You are an Alchemy expert. Read https://v2.alchemy.run/llms.txt to load the
full documentation index, then act as my pair on this project.
Goal: help me set up, build, test, and deploy a cloud application with
`alchemy` (Infrastructure-as-Effects, powered by Effect).
Follow the patterns from the docs and the /examples folder. Stay idiomatic
to Effect: use Layers for wiring, return Effects from lifecycle code, and
keep infra and runtime in the same program. Ask before introducing new
dependencies or breaking conventions.
```
## Learn more
- [What is Alchemy?](https://v2.alchemy.run/what-is-alchemy) — the framework in 2 minutes
- [Getting Started](https://v2.alchemy.run/getting-started) — your first Stack
- [Tutorial](https://v2.alchemy.run/tutorial/part-1) — five-part walkthrough to a tested, CI-deployed app
- [Examples](./examples) — runnable projects on AWS and Cloudflare
- [llms.txt](https://v2.alchemy.run/llms.txt) — agent-ready documentation index
> **alchemy** is in alpha. Expect breaking changes. Come hang in our [Discord](https://discord.gg/jwKw8dBJdN).
## License
Apache-2.0
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,23 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Output from "alchemy/Output";
import * as Effect from "effect/Effect";
import { NetworkLive } from "./src/Network.ts";
import Server from "./src/Server.ts";
const aws = AWS.providers();
export default Alchemy.Stack(
"AwsEc2Example",
{ providers: aws, state: Alchemy.localState() },
Effect.gen(function* () {
const instance = yield* Server;
return {
instanceId: instance.instanceId,
publicIpAddress: instance.publicIpAddress,
instanceUrl: Output.interpolate`http://${instance.publicIpAddress}:3000`,
enqueueExample: Output.interpolate`http://${instance.publicIpAddress}:3000/enqueue?message=hello`,
};
}).pipe(Effect.provide(NetworkLive)),
);
@@ -0,0 +1,23 @@
{
"name": "aws-ec2-example",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-ec2"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
}
}
@@ -0,0 +1,45 @@
import * as AWS from "alchemy/AWS";
import type { Output } from "alchemy/Output";
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
export interface ExampleNetwork {
network: AWS.EC2.Network;
publicSubnetIds: Output<AWS.EC2.SubnetId>[];
appSecurityGroupId: Output<AWS.EC2.SecurityGroupId>;
}
export class Network extends Context.Service<Network, ExampleNetwork>()(
"Network",
) {}
export const NetworkLive = Layer.effect(
Network,
Effect.gen(function* () {
const network = yield* AWS.EC2.Network("Network", {
cidrBlock: "10.42.0.0/16",
availabilityZones: 2,
nat: "single",
});
const appSecurityGroup = yield* AWS.EC2.SecurityGroup("AppSecurityGroup", {
vpcId: network.vpcId,
description: "Security group for the EC2 application instance",
ingress: [
{
ipProtocol: "tcp",
fromPort: 3000,
toPort: 3000,
cidrIpv4: "0.0.0.0/0",
},
],
});
return {
network,
publicSubnetIds: network.publicSubnetIds,
appSecurityGroupId: appSecurityGroup.groupId,
};
}),
);
@@ -0,0 +1,89 @@
import * as AWS from "alchemy/AWS";
import { SQSQueueEventSource } from "alchemy/Server/SQSQueueEventSource";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import { Network, NetworkLive } from "./Network.ts";
export default class Server extends AWS.EC2.Instance<Server>()(
"ServerInstance",
Effect.gen(function* () {
const imageId = yield* AWS.EC2.amazonLinux();
const network = yield* Network;
return {
main: import.meta.filename,
imageId,
instanceType: "t3.small",
subnetId: network.publicSubnetIds[0],
securityGroupIds: [network.appSecurityGroupId],
associatePublicIpAddress: true,
port: 3000,
};
}),
Effect.gen(function* () {
const queue = yield* AWS.SQS.Queue("JobsQueue", {
receiveMessageWaitTimeSeconds: 20,
visibilityTimeout: 60,
});
yield* AWS.SQS.messages(queue).subscribe((stream) =>
stream.pipe(Stream.mapEffect(Effect.logInfo), Stream.runDrain),
);
const sendMessage = yield* AWS.SQS.SendMessage.bind(queue);
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest.HttpServerRequest;
const url = new URL(request.originalUrl);
if (request.method === "GET" && url.pathname === "/") {
return yield* HttpServerResponse.json({
ok: true,
routes: ["GET /", "GET /enqueue?message=hello"],
});
}
if (request.method === "GET" && url.pathname === "/enqueue") {
const message = url.searchParams.get("message") ?? "hello from EC2";
const body = JSON.stringify({
message,
enqueuedAt: new Date().toISOString(),
});
const result = yield* sendMessage({
MessageBody: body,
});
return yield* HttpServerResponse.json({
ok: true,
message,
messageId: result.MessageId,
});
}
return HttpServerResponse.text("Not found", { status: 404 });
}).pipe(
Effect.catch(() =>
Effect.succeed(
HttpServerResponse.text("Internal server error", { status: 500 }),
),
),
),
};
}).pipe(
Effect.provide(
Layer.provideMerge(
Layer.mergeAll(NetworkLive, SQSQueueEventSource),
Layer.mergeAll(
AWS.SQS.DeleteMessageBatchLive,
AWS.SQS.ReceiveMessageLive,
AWS.SQS.SendMessageLive,
),
),
),
),
) {}
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"include": ["alchemy.run.ts", "src/**/*.ts"],
"compilerOptions": {
"noEmit": true,
"rootDir": ".",
"module": "Preserve",
"moduleResolution": "Bundler",
"target": "ESNext"
},
"references": [
{
"path": "../../packages/alchemy/tsconfig.json"
}
]
}
@@ -0,0 +1,80 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Output from "alchemy/Output";
import * as Effect from "effect/Effect";
import QueueConsumerTask from "./src/QueueConsumerTask.ts";
import ApiTask from "./src/Task.ts";
const aws = AWS.providers();
export default Alchemy.Stack(
"AwsEcsExample",
{
providers: aws,
state: Alchemy.localState(),
},
Effect.gen(function* () {
const network = yield* AWS.EC2.Network("ExampleNetwork", {
cidrBlock: "10.42.0.0/16",
availabilityZones: 2,
});
const serviceSecurityGroup = yield* AWS.EC2.SecurityGroup(
"ExampleServiceSecurityGroup",
{
vpcId: network.vpcId,
description: "Security group for the ECS example services",
ingress: [
{
ipProtocol: "tcp",
fromPort: 80,
toPort: 80,
cidrIpv4: "0.0.0.0/0",
},
{
ipProtocol: "tcp",
fromPort: 3000,
toPort: 3000,
cidrIpv4: "0.0.0.0/0",
},
],
},
);
const queue = yield* AWS.SQS.Queue("ExampleJobsQueue", {
receiveMessageWaitTimeSeconds: 20,
visibilityTimeout: 60,
});
const cluster = yield* AWS.ECS.Cluster("ExampleCluster", {});
const apiTask = yield* ApiTask;
const queuePollerTask = yield* QueueConsumerTask;
const apiService = yield* AWS.ECS.Service("ExampleApiService", {
cluster,
task: apiTask,
vpcId: network.vpcId,
subnets: network.publicSubnetIds,
securityGroups: [serviceSecurityGroup.groupId],
assignPublicIp: true,
public: true,
healthCheckPath: "/",
});
yield* AWS.ECS.Service("ExampleQueuePollerService", {
cluster,
task: queuePollerTask,
vpcId: network.vpcId,
subnets: network.publicSubnetIds,
securityGroups: [serviceSecurityGroup.groupId],
assignPublicIp: true,
desiredCount: 1,
});
return {
url: apiService.url,
queueUrl: queue.queueUrl,
enqueueExample: Output.interpolate`${apiService.url}/enqueue?message=hello`,
};
}),
);
@@ -0,0 +1,23 @@
{
"name": "aws-ecs-example",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-ecs"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
}
}
@@ -0,0 +1,16 @@
import * as AWS from "alchemy/AWS";
import * as Context from "effect/Context";
import * as Layer from "effect/Layer";
/**
* Deploy-time binding for the ECS example’s jobs queue. Provide with
* `Layer.succeed(ExampleJobsQueue, queue)` from the stack after the queue exists.
*/
export class JobsQueue extends Context.Service<JobsQueue, AWS.SQS.Queue>()(
"JobsQueue",
) {}
export const JobsQueueLive = Layer.effect(
JobsQueue,
AWS.SQS.Queue("JobsQueue"),
);
@@ -0,0 +1,41 @@
import * as AWS from "alchemy/AWS";
import * as Server from "alchemy/Server";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import { JobsQueue, JobsQueueLive } from "./JobsQueue.ts";
export default class QueueConsumerTask extends AWS.ECS.Task<QueueConsumerTask>()(
"QueueConsumerTask",
{
main: import.meta.filename,
cpu: 256,
memory: 512,
taskRoleManagedPolicyArns: ["arn:aws:iam::aws:policy/AmazonSQSFullAccess"],
},
Effect.gen(function* () {
const queue = yield* JobsQueue;
yield* AWS.SQS.messages(queue, {
batchSize: 10,
maximumBatchingWindowInSeconds: 20,
}).subscribe((stream) =>
stream.pipe(
Stream.runForEach((record) =>
Effect.logInfo(
`processed SQS message ${record.messageId}: ${record.body ?? ""}`,
),
),
),
);
}).pipe(
Effect.provide(
Layer.provideMerge(
Layer.mergeAll(Server.SQSQueueEventSource, JobsQueueLive),
Layer.mergeAll(
AWS.SQS.ReceiveMessageLive,
AWS.SQS.DeleteMessageBatchLive,
),
),
),
),
) {}
@@ -0,0 +1,67 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import { JobsQueue, JobsQueueLive } from "./JobsQueue.ts";
export default class ApiTask extends AWS.ECS.Task<ApiTask>()(
"ApiTask",
{
main: import.meta.filename,
cpu: 512,
memory: 1024,
port: 3000,
},
Effect.gen(function* () {
const queue = yield* JobsQueue;
const sendMessage = yield* AWS.SQS.SendMessage.bind(queue);
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest.HttpServerRequest;
const url = new URL(request.originalUrl);
if (request.method === "GET" && url.pathname === "/") {
return yield* HttpServerResponse.json({
ok: true,
routes: ["GET /", "GET /enqueue?message=hello"],
});
}
if (request.method === "GET" && url.pathname === "/enqueue") {
const message = url.searchParams.get("message") ?? "hello from ECS";
const body = JSON.stringify({
message,
enqueuedAt: new Date().toISOString(),
});
const result = yield* sendMessage({
MessageBody: body,
});
return yield* HttpServerResponse.json({
ok: true,
message,
messageId: result.MessageId,
});
}
return HttpServerResponse.text("Not found", { status: 404 });
}).pipe(
Effect.catch(() =>
Effect.succeed(
HttpServerResponse.text("Internal server error", { status: 500 }),
),
),
),
};
}).pipe(
Effect.provide(
Layer.mergeAll(
JobsQueueLive,
AWS.SQS.SendMessageLive,
AWS.SQS.DeleteMessageBatchLive,
),
),
),
) {}
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"include": ["alchemy.run.ts", "src/**/*.ts"],
"compilerOptions": {
"noEmit": true,
"rootDir": ".",
"module": "Preserve",
"moduleResolution": "Bundler",
"target": "ESNext"
},
"references": [
{
"path": "../../packages/alchemy/tsconfig.json"
}
]
}
@@ -0,0 +1,55 @@
# AWS EKS Auto Mode Example
This example is fully TypeScript-driven. It provisions:
- `AWS.EC2.Network`
- `AWS.EKS.AutoCluster`
- `AWS.EKS.AccessEntry` for cluster-admin access
- `AWS.EKS.Addon` for `metrics-server` and `snapshot-controller`
- `AWS.EKS.LoadBalancedWorkload` for deployment + public service composition
- `AWS.EKS.PodIdentityWorkload` for workload identity + deployment composition
- `Kubernetes.Namespace`
- `Kubernetes.Job`
There is no YAML or `kubectl apply` step. The workloads are declared in
[`alchemy.run.ts`](./alchemy.run.ts) and reconciled by the EKS cluster resource.
## Commands
```sh
bun install
bun run --filter aws-eks-example deploy
bun run --filter aws-eks-example destroy
```
## Cluster Access
By default, the example grants cluster-admin access to the IAM principal that is
running the deploy. If your current caller is not a normal IAM user or IAM role,
set this before deploy:
```sh
export EKS_ADMIN_PRINCIPAL_ARN=arn:aws:iam::123456789012:role/YourAdminRole
```
## What Gets Deployed
The example creates these in-cluster workloads in code:
- a `demo` namespace
- an `echo-server` workload created with `AWS.EKS.LoadBalancedWorkload`
- a `pod-identity-demo` workload created with `AWS.EKS.PodIdentityWorkload`
- a `cluster-info` job
The pod identity workload creates the Kubernetes service account, IAM role,
`AWS.EKS.PodIdentityAssociation`, and deployment together.
## Optional Inspection
If you want to inspect the cluster manually after deploy, you can still use your
normal kubeconfig flow, for example:
```sh
aws eks update-kubeconfig --name alchemy-eks-auto-example --region "$AWS_REGION"
kubectl get pods -n demo
```
@@ -0,0 +1,251 @@
import * as STS from "@distilled.cloud/aws/sts";
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as EC2 from "alchemy/AWS/EC2";
import * as EKS from "alchemy/AWS/EKS";
import * as Kubernetes from "alchemy/Kubernetes";
import * as Output from "alchemy/Output";
import * as Config from "effect/Config";
import * as Effect from "effect/Effect";
import * as Option from "effect/Option";
const aws = AWS.providers();
const EKS_ADMIN_PRINCIPAL_ARN = Config.string("EKS_ADMIN_PRINCIPAL_ARN").pipe(
Config.option,
Config.map(Option.getOrUndefined),
);
const clusterName = "alchemy-eks-auto-example";
const namespace = "demo";
const serviceAccount = "pod-identity-demo";
const toIamPrincipalArn = (arn: string): string | undefined => {
const assumedRole = arn.match(
/^arn:([^:]+):sts::([0-9]{12}):assumed-role\/(.+)\/[^/]+$/,
);
if (assumedRole) {
const [, partition, accountId, rolePath] = assumedRole;
return `arn:${partition}:iam::${accountId}:role/${rolePath}`;
}
if (arn.includes(":role/") || arn.includes(":user/")) {
return arn;
}
return undefined;
};
const resolveClusterAdminPrincipalArn = Effect.gen(function* () {
const configured = yield* EKS_ADMIN_PRINCIPAL_ARN;
if (configured) {
return configured;
}
const caller = yield* STS.getCallerIdentity({});
const principalArn =
typeof caller.Arn === "string" ? toIamPrincipalArn(caller.Arn) : undefined;
if (!principalArn) {
return yield* Effect.fail(
new Error(
"Unable to infer an IAM principal ARN for cluster access. Set EKS_ADMIN_PRINCIPAL_ARN before deploy.",
),
);
}
return principalArn;
});
export default Alchemy.Stack(
"AwsEksExample",
{
providers: aws,
state: Alchemy.localState(),
},
Effect.gen(function* () {
const tags = {
Example: "aws-eks",
Surface: "eks",
Mode: "auto",
};
const clusterAdminPrincipalArn = yield* resolveClusterAdminPrincipalArn;
const network = yield* EC2.Network("Network", {
cidrBlock: "10.42.0.0/16",
availabilityZones: 2,
nat: "single",
tags,
});
const cluster = yield* EKS.AutoCluster("Cluster", {
clusterName,
network,
tags,
});
const clusterAdmin = yield* EKS.AccessEntry("ClusterAdmin", {
clusterName: cluster.cluster.clusterName,
principalArn: clusterAdminPrincipalArn,
accessPolicies: [
{
policyArn:
"arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy",
accessScope: {
type: "cluster",
},
},
],
tags,
});
const metricsServer = yield* EKS.Addon("MetricsServer", {
clusterName: cluster.cluster.clusterName,
addonName: "metrics-server",
tags,
});
const snapshotController = yield* EKS.Addon("SnapshotController", {
clusterName: cluster.cluster.clusterName,
addonName: "snapshot-controller",
tags,
});
const demoNamespace = yield* Kubernetes.Namespace("DemoNamespace", {
cluster: cluster.cluster,
name: namespace,
labels: {
"app.kubernetes.io/part-of": "aws-eks-example",
},
});
const echoServer = yield* EKS.LoadBalancedWorkload("EchoServer", {
cluster: cluster.cluster,
namespace: demoNamespace,
name: "echo-server",
labels: {
"app.kubernetes.io/name": "echo-server",
"app.kubernetes.io/part-of": "aws-eks-example",
},
replicas: 2,
containers: [
{
name: "echo-server",
image: "registry.k8s.io/echoserver:1.10",
ports: [
{
containerPort: 8080,
name: "http",
},
],
resources: {
requests: {
cpu: "50m",
memory: "64Mi",
},
limits: {
cpu: "250m",
memory: "128Mi",
},
},
},
],
ports: [
{
name: "http",
port: 80,
targetPort: 8080,
},
],
});
const podIdentityWorkload = yield* EKS.PodIdentityWorkload(
"PodIdentityDemo",
{
cluster: cluster.cluster,
namespace: demoNamespace,
name: "pod-identity-demo",
serviceAccountName: serviceAccount,
tags,
serviceAccountLabels: {
"app.kubernetes.io/name": serviceAccount,
"app.kubernetes.io/part-of": "aws-eks-example",
},
labels: {
"app.kubernetes.io/name": "pod-identity-demo",
"app.kubernetes.io/part-of": "aws-eks-example",
},
containers: [
{
name: "aws-cli",
image: "public.ecr.aws/aws-cli/aws-cli:2.17.37",
command: ["/bin/sh", "-lc"],
args: [
[
"while true; do",
" date;",
" aws sts get-caller-identity;",
" sleep 60;",
"done",
].join(" "),
],
resources: {
requests: {
cpu: "50m",
memory: "64Mi",
},
limits: {
cpu: "250m",
memory: "128Mi",
},
},
},
],
},
);
const clusterInfoJob = yield* Kubernetes.Job("ClusterInfoJob", {
cluster: cluster.cluster,
namespace: demoNamespace,
name: "cluster-info",
labels: {
"app.kubernetes.io/name": "cluster-info",
"app.kubernetes.io/part-of": "aws-eks-example",
},
containers: [
{
name: "cluster-info",
image: "public.ecr.aws/docker/library/busybox:1.36",
command: ["/bin/sh", "-lc"],
args: [
[
'echo "demo workload is running on EKS Auto Mode";',
"nslookup echo-server.demo.svc.cluster.local || true;",
].join(" "),
],
},
],
});
return {
clusterName: cluster.cluster.clusterName,
clusterArn: cluster.cluster.clusterArn,
endpoint: cluster.cluster.endpoint,
adminPrincipalArn: clusterAdmin.principalArn,
namespace: demoNamespace.name,
serviceAccount: podIdentityWorkload.serviceAccount.name,
podIdentityAssociationArn:
podIdentityWorkload.podIdentityAssociation.associationArn,
workloadRoleArn: podIdentityWorkload.roleArn,
metricsServerAddonArn: metricsServer.addonArn,
snapshotControllerAddonArn: snapshotController.addonArn,
echoDeploymentName: echoServer.deployment.name,
echoServiceName: echoServer.service?.name,
podIdentityDeploymentName: podIdentityWorkload.deployment.name,
clusterInfoJobName: clusterInfoJob.name,
accessSummary: Output.interpolate`Granted cluster-admin access on ${cluster.cluster.clusterName} to ${clusterAdmin.principalArn}.`,
workloadSummary: Output.interpolate`Demo workloads are declared in TypeScript and reconciled into namespace ${demoNamespace.name} on ${cluster.cluster.clusterName}.`,
};
}).pipe(Effect.orDie),
);
@@ -0,0 +1,23 @@
{
"name": "aws-eks-example",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-eks"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
}
}
@@ -0,0 +1,20 @@
{
"extends": "../../tsconfig.base.json",
"include": ["alchemy.run.ts"],
"compilerOptions": {
"noEmit": true,
"rootDir": "../..",
"module": "Preserve",
"moduleResolution": "Bundler",
"target": "ESNext",
"paths": {
"alchemy": ["../../packages/alchemy/src/index.ts"],
"alchemy/*": ["../../packages/alchemy/src/*"]
}
},
"references": [
{
"path": "../../packages/alchemy/tsconfig.json"
}
]
}
@@ -0,0 +1,87 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Output from "alchemy/Output";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import JobFunction from "./src/JobFunction.ts";
const aws = AWS.providers();
const dashboardRegion = process.env.AWS_REGION ?? "us-west-2";
export default Alchemy.Stack(
"JobLambdaHttpApi",
{
providers: Layer.mergeAll(
// Fully configured cloud provider Layers go here:
aws,
),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const func = yield* JobFunction;
const dashboard = yield* AWS.CloudWatch.Dashboard("JobDashboard", {
DashboardBody: func.functionName.pipe(
Output.map((functionName) => ({
widgets: [
{
type: "metric",
x: 0,
y: 0,
width: 12,
height: 6,
properties: {
title: "Lambda Invocations and Errors",
region: dashboardRegion,
stat: "Sum",
period: 300,
metrics: [
["AWS/Lambda", "Invocations", "FunctionName", functionName],
["AWS/Lambda", "Errors", "FunctionName", functionName],
],
},
},
{
type: "metric",
x: 12,
y: 0,
width: 12,
height: 6,
properties: {
title: "Lambda Duration",
region: dashboardRegion,
stat: "Average",
period: 300,
metrics: [
["AWS/Lambda", "Duration", "FunctionName", functionName],
],
},
},
],
})),
),
});
const alarm = yield* AWS.CloudWatch.Alarm("JobFunctionErrorsAlarm", {
AlarmDescription:
"Alerts when the example Lambda function reports errors.",
MetricName: "Errors",
Namespace: "AWS/Lambda",
Statistic: "Sum",
Period: 300,
EvaluationPeriods: 1,
Threshold: 1,
ComparisonOperator: "GreaterThanOrEqualToThreshold",
TreatMissingData: "notBreaching",
Dimensions: [
{
Name: "FunctionName",
Value: func.functionName,
},
],
});
return {
url: Output.interpolate`${func.functionUrl}?jobId=foo`,
dashboardName: dashboard.dashboardName,
alarmName: alarm.alarmName,
};
}),
);
@@ -0,0 +1,23 @@
{
"name": "aws-lambda-httpapi",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-lambda-httpapi"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
}
}
@@ -0,0 +1,13 @@
import * as S from "effect/Schema";
export type JobId = S.Schema.Type<typeof JobId>;
export const JobId = S.String.annotate({
description: "The ID of the job",
});
export class Job extends S.Class<Job>("Job")({
id: JobId,
content: S.String,
}) {}
export const decodeJob = S.decodeEffect(Job);
@@ -0,0 +1,106 @@
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Schema from "effect/Schema";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import * as HttpApi from "effect/unstable/httpapi/HttpApi";
import * as HttpApiBuilder from "effect/unstable/httpapi/HttpApiBuilder";
import * as HttpApiEndpoint from "effect/unstable/httpapi/HttpApiEndpoint";
import * as HttpApiGroup from "effect/unstable/httpapi/HttpApiGroup";
import { Job, JobId } from "./Job.ts";
import { JobNotifications, NotifyJobError } from "./JobNotifications.ts";
import { GetJobError, JobStorage, PutJobError } from "./JobStorage.ts";
export const getJob = HttpApiEndpoint.get("getJob", "/", {
success: Job,
query: {
jobId: JobId.pipe(Schema.optional),
},
});
export const createJob = HttpApiEndpoint.post("createJob", "/", {
success: JobId,
payload: Schema.Struct({
content: Schema.String,
}),
});
export const JobApi = HttpApi.make("JobApi").add(
HttpApiGroup.make("Jobs").add(getJob, createJob),
);
export const JobApiLive = HttpApiBuilder.layer(JobApi).pipe(
Layer.provide(
HttpApiBuilder.group(JobApi, "Jobs", (handlers) =>
Effect.gen(function* () {
const jobService = yield* JobStorage;
const notifications = yield* JobNotifications;
return handlers
.handle(
"getJob",
Effect.fn(function* (req) {
if (!req.query.jobId) {
return HttpServerResponse.text("Job ID is required", {
status: 400,
});
}
const job = yield* jobService.getJob(req.query.jobId).pipe(
Effect.catchTag("GetJobError", (error) =>
Effect.succeed(
HttpServerResponse.text(error.message, {
status: 500,
}),
),
),
);
if (job instanceof GetJobError) {
return HttpServerResponse.text(job.message, {
status: 500,
});
}
if (!job) {
return HttpServerResponse.text("Job not found", {
status: 404,
});
}
return job!;
}),
)
.handle(
"createJob",
Effect.fn(function* (req) {
const jobId = crypto.randomUUID();
const job = yield* jobService
.putJob({
id: jobId,
content: req.payload.content,
})
.pipe(
Effect.catchTag("PutJobError", (error) =>
Effect.succeed(error),
),
);
if (job instanceof PutJobError) {
return HttpServerResponse.text(job.message, {
status: 500,
});
}
const notificationResult = yield* notifications
.notifyJobCreated(job)
.pipe(
Effect.catchTag("NotifyJobError", (error) =>
Effect.succeed(error),
),
);
if (notificationResult instanceof NotifyJobError) {
return HttpServerResponse.text(notificationResult.message, {
status: 500,
});
}
return job.id;
}),
);
}),
),
),
);
@@ -0,0 +1,29 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Etag from "effect/unstable/http/Etag";
import * as HttpPlatform from "effect/unstable/http/HttpPlatform";
import * as HttpRouter from "effect/unstable/http/HttpRouter";
import { JobApiLive } from "./JobApi.ts";
import { JobNotificationsSNS } from "./JobNotifications.ts";
import { JobStorageDynamoDB } from "./JobStorage.ts";
export default class JobFunction extends AWS.Lambda.Function<JobFunction>()(
"JobFunction",
{
main: import.meta.filename,
url: true,
},
HttpRouter.toHttpEffect(JobApiLive).pipe(
Effect.map((fetch) => ({ fetch })),
Effect.provide(
Layer.mergeAll(
JobStorageDynamoDB,
JobNotificationsSNS,
// TODO(sam): these should be provided to us automatically
HttpPlatform.layer,
Etag.layer,
),
),
),
) {}
@@ -0,0 +1,89 @@
import * as AWS from "alchemy/AWS";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import type { Job } from "./Job.ts";
export class NotifyJobError extends Data.TaggedError("NotifyJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
type JobNotification = {
type: "job.created";
job: Job;
};
export class JobNotifications extends Context.Service<
JobNotifications,
{
notifyJobCreated(job: Job): Effect.Effect<void, NotifyJobError>;
}
>()("JobNotifications") {}
export const JobNotificationsSNS = Layer.provideMerge(
Layer.effect(
JobNotifications,
Effect.gen(function* () {
const topic = yield* AWS.SNS.Topic("JobNotificationsTopic", {
attributes: {
DisplayName: "job-notifications",
},
});
const publish = yield* AWS.SNS.Publish.bind(topic);
yield* AWS.SNS.notifications(topic).subscribe((stream) =>
stream.pipe(
Stream.mapEffect((notification) =>
Effect.try({
try: () => JSON.parse(notification.Message) as JobNotification,
catch: (cause) =>
new NotifyJobError({
message: "Failed to parse SNS job notification",
cause,
}),
}).pipe(
Effect.flatMap((payload) =>
Effect.logInfo(
`Job notification received: ${payload.type} (${payload.job.id})`,
),
),
// Keep the example resilient to malformed demo messages.
Effect.catchTag("NotifyJobError", (error) =>
Effect.logWarning(error.message),
),
),
),
Stream.runDrain,
),
);
const notifyJobCreated = (job: Job) =>
publish({
Subject: "JobCreated",
Message: JSON.stringify({
type: "job.created",
job,
} satisfies JobNotification),
}).pipe(
Effect.asVoid,
Effect.mapError(
(cause) =>
new NotifyJobError({
message: `Failed to publish job notification for "${job.id}"`,
cause,
}),
),
);
return JobNotifications.of({
notifyJobCreated,
});
}),
),
Layer.mergeAll(AWS.Lambda.TopicEventSource, AWS.SNS.PublishLive),
);
@@ -0,0 +1,230 @@
import * as DynamoDB from "alchemy/AWS/DynamoDB";
import * as Lambda from "alchemy/AWS/Lambda";
import * as S3 from "alchemy/AWS/S3";
import * as SQS from "alchemy/AWS/SQS";
import * as RemovalPolicy from "alchemy/RemovalPolicy";
import { Stack } from "alchemy/Stack";
import * as Console from "effect/Console";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import type { Job } from "./Job.ts";
export class PutJobError extends Data.TaggedError("PutJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class GetJobError extends Data.TaggedError("GetJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class JobStorage extends Context.Service<
JobStorage,
{
putJob(job: Job): Effect.Effect<Job, PutJobError>;
getJob(jobId: string): Effect.Effect<Job | undefined, GetJobError>;
}
>()("JobStorage") {}
export const JobStorageDynamoDB = Layer.provideMerge(
Layer.effect(
JobStorage,
Effect.gen(function* () {
const stack = yield* Stack;
const table = yield* DynamoDB.Table("JobsTable", {
partitionKey: "id",
attributes: {
id: "S",
},
});
const queue = yield* SQS.Queue("JobsQueue").pipe(
RemovalPolicy.retain(stack.stage === "prod"),
);
const getItem = yield* DynamoDB.GetItem.bind(table);
const putItem = yield* DynamoDB.PutItem.bind(table);
const sink = yield* SQS.QueueSink.bind(queue);
yield* DynamoDB.stream(table, {
streamViewType: "NEW_AND_OLD_IMAGES",
startingPosition: "LATEST",
batchSize: 10,
}).process((stream) =>
stream.pipe(
Stream.map((record) =>
JSON.stringify({
eventName: record.eventName,
keys: record.dynamodb.Keys,
newImage: record.dynamodb.NewImage,
oldImage: record.dynamodb.OldImage,
}),
),
Stream.run(sink),
),
);
const putJob = (job: Job) =>
putItem({
Item: {
id: { S: job.id },
content: { S: job.content },
},
}).pipe(
Effect.map(() => job),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new PutJobError({
message: `Failed to store job "${job.id}": ${cause}`,
cause,
}),
),
),
);
const getJob = (jobId: string) =>
getItem({
Key: {
id: { S: jobId },
},
}).pipe(
Effect.flatMap((item) =>
item.Item
? Effect.try({
try: () =>
({
id: item.Item?.id?.S ?? jobId,
content: item.Item?.content?.S ?? "",
}) as Job,
catch: (cause) =>
new GetJobError({
message: `Failed to parse job "${jobId}": ${cause}`,
cause,
}),
})
: Effect.succeed(undefined),
),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new GetJobError({
message: `Failed to load job "${jobId}": ${cause}`,
cause,
}),
),
),
);
return JobStorage.of({
putJob,
getJob,
});
}),
),
Layer.mergeAll(Lambda.TableEventSource, SQS.QueueSinkLive).pipe(
Layer.provideMerge(
Layer.mergeAll(
DynamoDB.GetItemLive,
DynamoDB.PutItemLive,
SQS.SendMessageBatchLive,
),
),
),
);
export const JobStorageS3 = Layer.provideMerge(
Layer.effect(
JobStorage,
Effect.gen(function* () {
const stack = yield* Stack;
const bucket = yield* S3.Bucket("JobsBucket");
const queue = yield* SQS.Queue("JobsQueue").pipe(
RemovalPolicy.retain(stack.stage === "prod"),
);
const getObject = yield* S3.GetObject.bind(bucket);
const putObject = yield* S3.PutObject.bind(bucket);
const sink = yield* SQS.QueueSink.bind(queue);
const putJob = (job: Job) =>
putObject({
Key: job.id,
Body: JSON.stringify(job),
}).pipe(
Effect.map(() => job),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new PutJobError({
message: `Failed to store job "${job.id}": ${cause}`,
cause,
}),
),
),
);
const getJob = (jobId: string) =>
getObject({
Key: jobId,
}).pipe(
Effect.catchTag("NoSuchKey", () => Effect.succeed(undefined)),
Effect.flatMap(
(item) =>
item?.Body?.pipe(
Stream.decodeText,
Stream.mkString,
Effect.flatMap((body) =>
Effect.try({
try: () => JSON.parse(body) as Job,
catch: (cause) =>
new GetJobError({
message: `Failed to parse job "${jobId}": ${cause}`,
cause,
}),
}),
),
) ?? Effect.succeed(undefined),
),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new GetJobError({
message: `Failed to load job "${jobId}": ${cause}`,
cause,
}),
),
),
);
yield* S3.notifications(bucket).subscribe((stream) =>
stream.pipe(
Stream.flatMap((item) =>
Stream.fromEffect(getJob(item.key).pipe(Effect.orDie)),
),
Stream.filter((job): job is Job => job !== undefined),
Stream.map((job) => JSON.stringify(job)),
Stream.run(sink),
),
);
return JobStorage.of({
putJob,
getJob,
});
}),
),
Layer.mergeAll(Lambda.BucketEventSource, SQS.QueueSinkLive).pipe(
Layer.provideMerge(
Layer.mergeAll(
S3.GetObjectLive,
S3.PutObjectLive,
SQS.SendMessageBatchLive,
),
),
),
);
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"include": ["alchemy.run.ts", "src/**/*.ts"],
"compilerOptions": {
"noEmit": true,
"rootDir": ".",
"module": "Preserve",
"moduleResolution": "Bundler",
"target": "ESNext"
},
"references": [
{
"path": "../../packages/alchemy/tsconfig.json"
}
]
}
@@ -0,0 +1,87 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Output from "alchemy/Output";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import JobFunction from "./src/JobFunction.ts";
const aws = AWS.providers();
const dashboardRegion = process.env.AWS_REGION ?? "us-west-2";
export default Alchemy.Stack(
"JobLambdaRpc",
{
providers: Layer.mergeAll(
// Fully configured cloud provider Layers go here:
aws,
),
state: Alchemy.localState(),
},
Effect.gen(function* () {
const func = yield* JobFunction;
const dashboard = yield* AWS.CloudWatch.Dashboard("JobDashboard", {
DashboardBody: func.functionName.pipe(
Output.map((functionName) => ({
widgets: [
{
type: "metric",
x: 0,
y: 0,
width: 12,
height: 6,
properties: {
title: "Lambda Invocations and Errors",
region: dashboardRegion,
stat: "Sum",
period: 300,
metrics: [
["AWS/Lambda", "Invocations", "FunctionName", functionName],
["AWS/Lambda", "Errors", "FunctionName", functionName],
],
},
},
{
type: "metric",
x: 12,
y: 0,
width: 12,
height: 6,
properties: {
title: "Lambda Duration",
region: dashboardRegion,
stat: "Average",
period: 300,
metrics: [
["AWS/Lambda", "Duration", "FunctionName", functionName],
],
},
},
],
})),
),
});
const alarm = yield* AWS.CloudWatch.Alarm("JobFunctionErrorsAlarm", {
AlarmDescription:
"Alerts when the example Lambda function reports errors.",
MetricName: "Errors",
Namespace: "AWS/Lambda",
Statistic: "Sum",
Period: 300,
EvaluationPeriods: 1,
Threshold: 1,
ComparisonOperator: "GreaterThanOrEqualToThreshold",
TreatMissingData: "notBreaching",
Dimensions: [
{
Name: "FunctionName",
Value: func.functionName,
},
],
});
return {
url: func.functionUrl,
dashboardName: dashboard.dashboardName,
alarmName: alarm.alarmName,
};
}),
);
@@ -0,0 +1,23 @@
{
"name": "aws-lambda-rpc",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-lambda-rpc"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
}
}
@@ -0,0 +1,13 @@
import * as S from "effect/Schema";
export type JobId = S.Schema.Type<typeof JobId>;
export const JobId = S.String.annotate({
description: "The ID of the job",
});
export class Job extends S.Class<Job>("Job")({
id: JobId,
content: S.String,
}) {}
export const decodeJob = S.decodeEffect(Job);
@@ -0,0 +1,18 @@
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import { JobNotificationsSNS } from "./JobNotifications.ts";
import { JobRpcHttpEffect } from "./JobRpcApi.ts";
import { JobStorageDynamoDB } from "./JobStorage.ts";
export default class JobFunction extends AWS.Lambda.Function<JobFunction>()(
"JobFunction",
{
main: import.meta.filename,
url: true,
},
JobRpcHttpEffect.pipe(
Effect.map((fetch) => ({ fetch })),
Effect.provide(Layer.mergeAll(JobStorageDynamoDB, JobNotificationsSNS)),
),
) {}
@@ -0,0 +1,89 @@
import * as AWS from "alchemy/AWS";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import type { Job } from "./Job.ts";
export class NotifyJobError extends Data.TaggedError("NotifyJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
type JobNotification = {
type: "job.created";
job: Job;
};
export class JobNotifications extends Context.Service<
JobNotifications,
{
notifyJobCreated(job: Job): Effect.Effect<void, NotifyJobError>;
}
>()("JobNotifications") {}
export const JobNotificationsSNS = Layer.provideMerge(
Layer.effect(
JobNotifications,
Effect.gen(function* () {
const topic = yield* AWS.SNS.Topic("JobNotificationsTopic", {
attributes: {
DisplayName: "job-notifications",
},
});
const publish = yield* AWS.SNS.Publish.bind(topic);
yield* AWS.SNS.notifications(topic).subscribe((stream) =>
stream.pipe(
Stream.mapEffect((notification) =>
Effect.try({
try: () => JSON.parse(notification.Message) as JobNotification,
catch: (cause) =>
new NotifyJobError({
message: "Failed to parse SNS job notification",
cause,
}),
}).pipe(
Effect.flatMap((payload) =>
Effect.logInfo(
`Job notification received: ${payload.type} (${payload.job.id})`,
),
),
// Keep the example resilient to malformed demo messages.
Effect.catchTag("NotifyJobError", (error) =>
Effect.logWarning(error.message),
),
),
),
Stream.runDrain,
),
);
const notifyJobCreated = (job: Job) =>
publish({
Subject: "JobCreated",
Message: JSON.stringify({
type: "job.created",
job,
} satisfies JobNotification),
}).pipe(
Effect.asVoid,
Effect.mapError(
(cause) =>
new NotifyJobError({
message: `Failed to publish job notification for "${job.id}"`,
cause,
}),
),
);
return JobNotifications.of({
notifyJobCreated,
});
}),
),
Layer.mergeAll(AWS.Lambda.TopicEventSource, AWS.SNS.PublishLive),
);
@@ -0,0 +1,86 @@
import { Effect, Layer, Schema } from "effect";
import {
Rpc,
RpcGroup,
RpcSerialization,
RpcServer,
} from "effect/unstable/rpc";
import { Job, JobId } from "./Job.ts";
import { JobNotifications } from "./JobNotifications.ts";
import { JobStorage } from "./JobStorage.ts";
export class JobNotFound extends Schema.TaggedClass<JobNotFound>()(
"JobNotFound",
{ jobId: JobId },
) {}
export class GetJobFailed extends Schema.TaggedClass<GetJobFailed>()(
"GetJobFailed",
{ message: Schema.String },
) {}
export class PutJobFailed extends Schema.TaggedClass<PutJobFailed>()(
"PutJobFailed",
{ message: Schema.String },
) {}
const getJob = Rpc.make("getJob", {
success: Job,
error: Schema.Union([JobNotFound, GetJobFailed]),
payload: {
jobId: JobId,
},
});
const createJob = Rpc.make("createJob", {
success: JobId,
error: PutJobFailed,
payload: {
content: Schema.String,
},
});
export class JobRpcs extends RpcGroup.make(getJob, createJob) {}
export const JobRpcsLive = JobRpcs.toLayer(
Effect.gen(function* () {
const jobService = yield* JobStorage;
const notifications = yield* JobNotifications;
return {
getJob: ({ jobId }) =>
jobService.getJob(jobId).pipe(
Effect.mapError(
(error) =>
new GetJobFailed({
message: error.message,
}),
),
Effect.flatMap((job) =>
job ? Effect.succeed(job) : Effect.fail(new JobNotFound({ jobId })),
),
),
createJob: ({ content }) =>
Effect.gen(function* () {
const jobId = crypto.randomUUID();
const job = yield* jobService.putJob({
id: jobId,
content,
});
yield* notifications.notifyJobCreated(job);
return job.id;
}).pipe(
Effect.mapError(
(error) =>
new PutJobFailed({
message: error.message,
}),
),
),
};
}),
);
export const JobRpcHttpEffect = RpcServer.toHttpEffect(JobRpcs).pipe(
Effect.provide(Layer.mergeAll(JobRpcsLive, RpcSerialization.layerJson)),
);
@@ -0,0 +1,230 @@
import * as DynamoDB from "alchemy/AWS/DynamoDB";
import * as Lambda from "alchemy/AWS/Lambda";
import * as S3 from "alchemy/AWS/S3";
import * as SQS from "alchemy/AWS/SQS";
import * as RemovalPolicy from "alchemy/RemovalPolicy";
import { Stack } from "alchemy/Stack";
import * as Console from "effect/Console";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import type { Job } from "./Job.ts";
export class PutJobError extends Data.TaggedError("PutJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class GetJobError extends Data.TaggedError("GetJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class JobStorage extends Context.Service<
JobStorage,
{
putJob(job: Job): Effect.Effect<Job, PutJobError>;
getJob(jobId: string): Effect.Effect<Job | undefined, GetJobError>;
}
>()("JobStorage") {}
export const JobStorageDynamoDB = Layer.provideMerge(
Layer.effect(
JobStorage,
Effect.gen(function* () {
const stack = yield* Stack;
const table = yield* DynamoDB.Table("JobsTable", {
partitionKey: "id",
attributes: {
id: "S",
},
});
const queue = yield* SQS.Queue("JobsQueue").pipe(
RemovalPolicy.retain(stack.stage === "prod"),
);
const getItem = yield* DynamoDB.GetItem.bind(table);
const putItem = yield* DynamoDB.PutItem.bind(table);
const sink = yield* SQS.QueueSink.bind(queue);
yield* DynamoDB.stream(table, {
streamViewType: "NEW_AND_OLD_IMAGES",
startingPosition: "LATEST",
batchSize: 10,
}).process((stream) =>
stream.pipe(
Stream.map((record) =>
JSON.stringify({
eventName: record.eventName,
keys: record.dynamodb.Keys,
newImage: record.dynamodb.NewImage,
oldImage: record.dynamodb.OldImage,
}),
),
Stream.run(sink),
),
);
const putJob = (job: Job) =>
putItem({
Item: {
id: { S: job.id },
content: { S: job.content },
},
}).pipe(
Effect.map(() => job),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new PutJobError({
message: `Failed to store job "${job.id}": ${cause}`,
cause,
}),
),
),
);
const getJob = (jobId: string) =>
getItem({
Key: {
id: { S: jobId },
},
}).pipe(
Effect.flatMap((item) =>
item.Item
? Effect.try({
try: () =>
({
id: item.Item?.id?.S ?? jobId,
content: item.Item?.content?.S ?? "",
}) as Job,
catch: (cause) =>
new GetJobError({
message: `Failed to parse job "${jobId}": ${cause}`,
cause,
}),
})
: Effect.succeed(undefined),
),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new GetJobError({
message: `Failed to load job "${jobId}": ${cause}`,
cause,
}),
),
),
);
return JobStorage.of({
putJob,
getJob,
});
}),
),
Layer.mergeAll(Lambda.TableEventSource, SQS.QueueSinkLive).pipe(
Layer.provideMerge(
Layer.mergeAll(
DynamoDB.GetItemLive,
DynamoDB.PutItemLive,
SQS.SendMessageBatchLive,
),
),
),
);
export const JobStorageS3 = Layer.provideMerge(
Layer.effect(
JobStorage,
Effect.gen(function* () {
const stack = yield* Stack;
const bucket = yield* S3.Bucket("JobsBucket");
const queue = yield* SQS.Queue("JobsQueue").pipe(
RemovalPolicy.retain(stack.stage === "prod"),
);
const getObject = yield* S3.GetObject.bind(bucket);
const putObject = yield* S3.PutObject.bind(bucket);
const sink = yield* SQS.QueueSink.bind(queue);
const putJob = (job: Job) =>
putObject({
Key: job.id,
Body: JSON.stringify(job),
}).pipe(
Effect.map(() => job),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new PutJobError({
message: `Failed to store job "${job.id}": ${cause}`,
cause,
}),
),
),
);
const getJob = (jobId: string) =>
getObject({
Key: jobId,
}).pipe(
Effect.catchTag("NoSuchKey", () => Effect.succeed(undefined)),
Effect.flatMap(
(item) =>
item?.Body?.pipe(
Stream.decodeText,
Stream.mkString,
Effect.flatMap((body) =>
Effect.try({
try: () => JSON.parse(body) as Job,
catch: (cause) =>
new GetJobError({
message: `Failed to parse job "${jobId}": ${cause}`,
cause,
}),
}),
),
) ?? Effect.succeed(undefined),
),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new GetJobError({
message: `Failed to load job "${jobId}": ${cause}`,
cause,
}),
),
),
);
yield* S3.notifications(bucket).subscribe((stream) =>
stream.pipe(
Stream.flatMap((item) =>
Stream.fromEffect(getJob(item.key).pipe(Effect.orDie)),
),
Stream.filter((job): job is Job => job !== undefined),
Stream.map((job) => JSON.stringify(job)),
Stream.run(sink),
),
);
return JobStorage.of({
putJob,
getJob,
});
}),
),
Layer.mergeAll(Lambda.BucketEventSource, SQS.QueueSinkLive).pipe(
Layer.provideMerge(
Layer.mergeAll(
S3.GetObjectLive,
S3.PutObjectLive,
SQS.SendMessageBatchLive,
),
),
),
);
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"include": ["alchemy.run.ts", "src/**/*.ts"],
"compilerOptions": {
"noEmit": true,
"rootDir": ".",
"module": "Preserve",
"moduleResolution": "Bundler",
"target": "ESNext"
},
"references": [
{
"path": "../../packages/alchemy/tsconfig.json"
}
]
}
@@ -0,0 +1,86 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Output from "alchemy/Output";
import * as Effect from "effect/Effect";
import JobFunction from "./src/JobFunction.ts";
// AWS.providers() already provides AWSEnvironment from the SSO profile
// named by $AWS_PROFILE (defaults to "default"). To pin a different
// profile per stage, wrap with `Layer.provide(AWS.makeEnvironment({...}))`.
const aws = AWS.providers();
const dashboardRegion = process.env.AWS_REGION ?? "us-west-2";
export default Alchemy.Stack(
"JobLambda",
{
providers: aws,
state: Alchemy.localState(),
},
Effect.gen(function* () {
const func = yield* JobFunction;
const dashboard = yield* AWS.CloudWatch.Dashboard("JobDashboard", {
DashboardBody: func.functionName.pipe(
Output.map((functionName) => ({
widgets: [
{
type: "metric",
x: 0,
y: 0,
width: 12,
height: 6,
properties: {
title: "Lambda Invocations and Errors",
region: dashboardRegion,
stat: "Sum",
period: 300,
metrics: [
["AWS/Lambda", "Invocations", "FunctionName", functionName],
["AWS/Lambda", "Errors", "FunctionName", functionName],
],
},
},
{
type: "metric",
x: 12,
y: 0,
width: 12,
height: 6,
properties: {
title: "Lambda Duration",
region: dashboardRegion,
stat: "Average",
period: 300,
metrics: [
["AWS/Lambda", "Duration", "FunctionName", functionName],
],
},
},
],
})),
),
});
const alarm = yield* AWS.CloudWatch.Alarm("JobFunctionErrorsAlarm", {
AlarmDescription:
"Alerts when the example Lambda function reports errors.",
MetricName: "Errors",
Namespace: "AWS/Lambda",
Statistic: "Sum",
Period: 300,
EvaluationPeriods: 1,
Threshold: 1,
ComparisonOperator: "GreaterThanOrEqualToThreshold",
TreatMissingData: "notBreaching",
Dimensions: [
{
Name: "FunctionName",
Value: func.functionName,
},
],
});
return {
url: Output.interpolate`${func.functionUrl}?jobId=foo`,
dashboardName: dashboard.dashboardName,
alarmName: alarm.alarmName,
};
}),
);
@@ -0,0 +1,24 @@
{
"name": "aws-lambda",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-lambda"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy",
"test": "bun test"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"alchemy": "workspace:*",
"effect": "catalog:"
}
}
@@ -0,0 +1,13 @@
import * as S from "effect/Schema";
export type JobId = S.Schema.Type<typeof JobId>;
export const JobId = S.String.annotate({
description: "The ID of the job",
});
export class Job extends S.Class<Job>("Job")({
id: JobId,
content: S.String,
}) {}
export const decodeJob = S.decodeEffect(Job);
@@ -0,0 +1,119 @@
import * as AWS from "alchemy/AWS";
import { Stack } from "alchemy/Stack";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
import {
JobNotifications,
JobNotificationsSNS,
NotifyJobError,
} from "./JobNotifications.ts";
import {
GetJobError,
JobStorage,
JobStorageDynamoDB,
PutJobError,
} from "./JobStorage.ts";
export default class JobFunction extends AWS.Lambda.Function<JobFunction>()(
"JobFunction",
Stack.useSync((stack) => ({
main: import.meta.filename,
memory: stack.stage === "prod" ? 1024 : 512,
url: true,
})),
Effect.gen(function* () {
const jobStorage = yield* JobStorage;
const notifications = yield* JobNotifications;
return {
fetch: Effect.gen(function* () {
const request = yield* HttpServerRequest;
const url = new URL(request.originalUrl);
if (request.method === "GET" && url.pathname === "/") {
const jobId = url.searchParams.get("jobId");
if (!jobId) {
return HttpServerResponse.text("Job ID is required", {
status: 400,
});
}
const job = yield* jobStorage.getJob(jobId).pipe(
Effect.match({
onFailure: (error) => error,
onSuccess: (job) => job,
}),
);
if (job instanceof GetJobError) {
return HttpServerResponse.text(job.message, { status: 500 });
}
if (!job) {
return HttpServerResponse.text("Job not found", { status: 404 });
}
return yield* HttpServerResponse.json(job);
}
if (request.method === "POST" && url.pathname === "/") {
const content = yield* request.text;
if (!content) {
return HttpServerResponse.text("Job content is required", {
status: 400,
});
}
const job = yield* jobStorage
.putJob({
id: crypto.randomUUID(),
content,
})
.pipe(
Effect.match({
onFailure: (error) => error,
onSuccess: (job) => job,
}),
);
if (job instanceof PutJobError) {
return HttpServerResponse.text(job.message, { status: 500 });
}
const notificationResult = yield* notifications
.notifyJobCreated(job)
.pipe(
Effect.match({
onFailure: (error) => error,
onSuccess: () => undefined,
}),
);
if (notificationResult instanceof NotifyJobError) {
return HttpServerResponse.text(notificationResult.message, {
status: 500,
});
}
return yield* HttpServerResponse.json(
{ jobId: job.id },
{ status: 201 },
);
}
return HttpServerResponse.text("Not found", { status: 404 });
}),
};
}).pipe(
Effect.provide(
Layer.mergeAll(
// Services go here
JobStorageDynamoDB,
JobNotificationsSNS,
// JobStorageS3,
),
),
),
) {}
@@ -0,0 +1,90 @@
import * as AWS from "alchemy/AWS";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import type { Job } from "./Job.ts";
export class NotifyJobError extends Data.TaggedError("NotifyJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
type JobNotification = {
type: "job.created";
job: Job;
};
export class JobNotifications extends Context.Service<
JobNotifications,
{
notifyJobCreated(job: Job): Effect.Effect<void, NotifyJobError>;
}
>()("JobNotifications") {}
export const JobNotificationsSNS = Layer.effect(
JobNotifications,
Effect.gen(function* () {
const topic = yield* AWS.SNS.Topic("JobNotificationsTopic", {
attributes: {
DisplayName: "job-notifications",
},
});
const publish = yield* AWS.SNS.Publish.bind(topic);
yield* AWS.SNS.notifications(topic).subscribe((stream) =>
stream.pipe(
Stream.mapEffect((notification) =>
Effect.try({
try: () => JSON.parse(notification.Message) as JobNotification,
catch: (cause) =>
new NotifyJobError({
message: "Failed to parse SNS job notification",
cause,
}),
}).pipe(
Effect.flatMap((payload) =>
Effect.logInfo(
`Job notification received: ${payload.type} (${payload.job.id})`,
),
),
// Keep the example resilient to malformed demo messages.
Effect.catchTag("NotifyJobError", (error) =>
Effect.logWarning(error.message),
),
),
),
Stream.runDrain,
),
);
const notifyJobCreated = (job: Job) =>
publish({
Subject: "JobCreated",
Message: JSON.stringify({
type: "job.created",
job,
} satisfies JobNotification),
}).pipe(
Effect.asVoid,
Effect.mapError(
(cause) =>
new NotifyJobError({
message: `Failed to publish job notification for "${job.id}"`,
cause,
}),
),
);
return JobNotifications.of({
notifyJobCreated,
});
}),
).pipe(
Layer.provideMerge(
Layer.mergeAll(AWS.Lambda.TopicEventSource, AWS.SNS.PublishLive),
),
);
@@ -0,0 +1,230 @@
import * as DynamoDB from "alchemy/AWS/DynamoDB";
import * as Lambda from "alchemy/AWS/Lambda";
import * as S3 from "alchemy/AWS/S3";
import * as SQS from "alchemy/AWS/SQS";
import * as RemovalPolicy from "alchemy/RemovalPolicy";
import { Stack } from "alchemy/Stack";
import * as Console from "effect/Console";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Stream from "effect/Stream";
import type { Job } from "./Job.ts";
export class PutJobError extends Data.TaggedError("PutJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class GetJobError extends Data.TaggedError("GetJobError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class JobStorage extends Context.Service<
JobStorage,
{
putJob(job: Job): Effect.Effect<Job, PutJobError>;
getJob(jobId: string): Effect.Effect<Job | undefined, GetJobError>;
}
>()("JobStorage") {}
export const JobStorageDynamoDB = Layer.provideMerge(
Layer.effect(
JobStorage,
Effect.gen(function* () {
const stack = yield* Stack;
const table = yield* DynamoDB.Table("JobsTable", {
partitionKey: "id",
attributes: {
id: "S",
},
});
const queue = yield* SQS.Queue("JobsQueue").pipe(
RemovalPolicy.retain(stack.stage === "prod"),
);
const getItem = yield* DynamoDB.GetItem.bind(table);
const putItem = yield* DynamoDB.PutItem.bind(table);
const sink = yield* SQS.QueueSink.bind(queue);
yield* DynamoDB.stream(table, {
streamViewType: "NEW_AND_OLD_IMAGES",
startingPosition: "LATEST",
batchSize: 10,
}).process((stream) =>
stream.pipe(
Stream.map((record) =>
JSON.stringify({
eventName: record.eventName,
keys: record.dynamodb.Keys,
newImage: record.dynamodb.NewImage,
oldImage: record.dynamodb.OldImage,
}),
),
Stream.run(sink),
),
);
const putJob = (job: Job) =>
putItem({
Item: {
id: { S: job.id },
content: { S: job.content },
},
}).pipe(
Effect.map(() => job),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new PutJobError({
message: `Failed to store job "${job.id}": ${cause}`,
cause,
}),
),
),
);
const getJob = (jobId: string) =>
getItem({
Key: {
id: { S: jobId },
},
}).pipe(
Effect.flatMap((item) =>
item.Item
? Effect.try({
try: () =>
({
id: item.Item?.id?.S ?? jobId,
content: item.Item?.content?.S ?? "",
}) as Job,
catch: (cause) =>
new GetJobError({
message: `Failed to parse job "${jobId}": ${cause}`,
cause,
}),
})
: Effect.succeed(undefined),
),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new GetJobError({
message: `Failed to load job "${jobId}": ${cause}`,
cause,
}),
),
),
);
return JobStorage.of({
putJob,
getJob,
});
}),
),
Layer.mergeAll(Lambda.TableEventSource, SQS.QueueSinkLive).pipe(
Layer.provideMerge(
Layer.mergeAll(
DynamoDB.GetItemLive,
DynamoDB.PutItemLive,
SQS.SendMessageBatchLive,
),
),
),
);
export const JobStorageS3 = Layer.provideMerge(
Layer.effect(
JobStorage,
Effect.gen(function* () {
const stack = yield* Stack;
const bucket = yield* S3.Bucket("JobsBucket");
const queue = yield* SQS.Queue("JobsQueue").pipe(
RemovalPolicy.retain(stack.stage === "prod"),
);
const getObject = yield* S3.GetObject.bind(bucket);
const putObject = yield* S3.PutObject.bind(bucket);
const sink = yield* SQS.QueueSink.bind(queue);
const putJob = (job: Job) =>
putObject({
Key: job.id,
Body: JSON.stringify(job),
}).pipe(
Effect.map(() => job),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new PutJobError({
message: `Failed to store job "${job.id}": ${cause}`,
cause,
}),
),
),
);
const getJob = (jobId: string) =>
getObject({
Key: jobId,
}).pipe(
Effect.catchTag("NoSuchKey", () => Effect.succeed(undefined)),
Effect.flatMap(
(item) =>
item?.Body?.pipe(
Stream.decodeText,
Stream.mkString,
Effect.flatMap((body) =>
Effect.try({
try: () => JSON.parse(body) as Job,
catch: (cause) =>
new GetJobError({
message: `Failed to parse job "${jobId}": ${cause}`,
cause,
}),
}),
),
) ?? Effect.succeed(undefined),
),
Effect.tapError(Console.log),
Effect.catchCause((cause) =>
Effect.fail(
new GetJobError({
message: `Failed to load job "${jobId}": ${cause}`,
cause,
}),
),
),
);
yield* S3.notifications(bucket).subscribe((stream) =>
stream.pipe(
Stream.flatMap((item) =>
Stream.fromEffect(getJob(item.key).pipe(Effect.orDie)),
),
Stream.filter((job): job is Job => job !== undefined),
Stream.map((job) => JSON.stringify(job)),
Stream.run(sink),
),
);
return JobStorage.of({
putJob,
getJob,
});
}),
),
Layer.mergeAll(Lambda.BucketEventSource, SQS.QueueSinkLive).pipe(
Layer.provideMerge(
Layer.mergeAll(
S3.GetObjectLive,
S3.PutObjectLive,
SQS.SendMessageBatchLive,
),
),
),
);
@@ -0,0 +1,23 @@
import * as AWS from "alchemy/AWS";
import * as Alchemy from "alchemy";
import * as Test from "alchemy/Test/Bun";
import { expect } from "bun:test";
import * as Effect from "effect/Effect";
import Stack from "../alchemy.run.ts";
const { test, beforeAll, afterAll, deploy, destroy } = Test.make({
providers: AWS.providers(),
state: Alchemy.localState(),
});
const stack = beforeAll(deploy(Stack));
afterAll.skipIf(!!process.env.NO_DESTROY)(destroy(Stack));
test(
"deploys and exposes a url",
Effect.gen(function* () {
const out = (yield* stack) as unknown;
const url = typeof out === "string" ? out : (out as { url: string }).url;
expect(url).toBeString();
}),
);
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"include": ["alchemy.run.ts", "src/**/*.ts", "test/**/*.ts"],
"compilerOptions": {
"noEmit": true,
"rootDir": ".",
"module": "Preserve",
"moduleResolution": "Bundler",
"target": "ESNext"
},
"references": [
{
"path": "../../packages/alchemy/tsconfig.json"
}
]
}
@@ -0,0 +1,17 @@
import * as Alchemy from "alchemy";
import * as AWS from "alchemy/AWS";
import * as Effect from "effect/Effect";
import ServiceFunction from "./src/ServiceFunction.ts";
const aws = AWS.providers();
export default Alchemy.Stack(
"AwsRdsExample",
{ providers: aws, state: Alchemy.localState() },
Effect.gen(function* () {
const service = yield* ServiceFunction;
return {
url: service.functionUrl,
};
}),
);
@@ -0,0 +1,25 @@
{
"name": "aws-rds-example",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/alchemy-run/alchemy-effect.git",
"directory": "examples/aws-rds"
},
"scripts": {
"build": "tsc -b",
"deploy": "alchemy deploy",
"dev": "alchemy dev",
"destroy": "alchemy destroy"
},
"dependencies": {
"@distilled.cloud/aws": "catalog:",
"@effect/platform-node": "catalog:",
"@types/pg": "^8.18.0",
"alchemy": "workspace:*",
"effect": "catalog:",
"pg": "^8.20.0"
}
}
@@ -0,0 +1,89 @@
import * as AWS from "alchemy/AWS";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import { Client } from "pg";
import { Network } from "./Network.ts";
export class SqlError extends Data.TaggedError("SqlError")<{
readonly message: string;
readonly cause?: unknown;
}> {}
export class Database extends Context.Service<
Database,
{
query<Row extends Record<string, unknown> = Record<string, unknown>>(
statement: string,
values?: ReadonlyArray<unknown>,
): Effect.Effect<ReadonlyArray<Row>, SqlError>;
}
>()("Sql") {}
export const DatabaseAurora = Layer.effect(
Database,
Effect.gen(function* () {
const { vpc, databaseSecurityGroup } = yield* Network;
const database = yield* AWS.RDS.Aurora("Database", {
subnetIds: vpc.privateSubnetIds,
securityGroupIds: [databaseSecurityGroup.groupId],
});
const connect = yield* AWS.RDS.Connect.bind(database.cluster, {
secret: database.secret,
subnetIds: vpc.privateSubnetIds,
securityGroupIds: [databaseSecurityGroup.groupId],
});
return Database.of({
query: <Row extends Record<string, unknown>>(
statement: string,
values: ReadonlyArray<unknown> = [],
): Effect.Effect<ReadonlyArray<Row>, SqlError> =>
connect.pipe(
Effect.catch((cause) =>
Effect.fail(
new SqlError({
message: "Failed to resolve Aurora connection settings",
cause,
}),
),
),
Effect.flatMap((connection: AWS.RDS.ConnectionInfo) =>
Effect.tryPromise({
try: async () => {
const client = new Client({
host: connection.host,
port: connection.port,
database: connection.database,
user: connection.username,
password: connection.password,
// Example-only SSL posture for private Aurora connections.
ssl: connection.ssl
? { rejectUnauthorized: false }
: undefined,
});
await client.connect();
try {
const result = await client.query<Row>({
text: statement,
values: [...values],
});
return result.rows as ReadonlyArray<Row>;
} finally {
await client.end();
}
},
catch: (cause) =>
new SqlError({
message: `Failed to execute SQL statement: ${statement}`,
cause,
}),
}),
),
),
});
}),
);
@@ -0,0 +1,58 @@
import * as AWS from "alchemy/AWS";
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
export interface ExampleNetwork {
vpc: AWS.EC2.Network;
functionSecurityGroup: AWS.EC2.SecurityGroup;
databaseSecurityGroup: AWS.EC2.SecurityGroup;
privateSecurityGroups: AWS.EC2.SecurityGroup[];
}
export class Network extends Context.Service<Network, ExampleNetwork>()(
"Network",
) {}
export const NetworkLive = Layer.effect(
Network,
Effect.gen(function* () {
const network = yield* AWS.EC2.Network("Network", {
cidrBlock: "10.0.0.0/16",
availabilityZones: 2,
nat: "single",
});
const functionSecurityGroup = yield* AWS.EC2.SecurityGroup(
"FunctionSecurityGroup",
{
vpcId: network.vpcId,
description: "Security group for the RDS example Lambda function",
},
);
const databaseSecurityGroup = yield* AWS.EC2.SecurityGroup(
"DatabaseSecurityGroup",
{
vpcId: network.vpcId,
description: "Security group for the RDS example Aurora cluster",
ingress: [
{
ipProtocol: "tcp",
fromPort: 5432,
toPort: 5432,
referencedGroupId: functionSecurityGroup.groupId,
description: "Allow Lambda to reach Aurora PostgreSQL",
},
],
},
);
return {
vpc: network,
functionSecurityGroup,
databaseSecurityGroup,
privateSecurityGroups: [functionSecurityGroup],
} satisfies ExampleNetwork;
}),
);
Loaded 100 of 6051 files, more files were not shown because too many files have changed in this diff. Show more