The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
feat: launch videos staged from the real app (#39978)
Julius Marminge committed
Nov 20, 2026 at 15:15 UTC
22dcb0af5a836ec10a38674e219c123ba67a49de
28 files changed
+4890
-27
.agents/skills/launch-video/SKILL.md
new
+167
@@ -0,0 +1,167 @@
1
+---
2
+name: launch-video
3
+description: Make a short launch video (1920x1080 MP4 plus an outro PNG) that demos a T3 Code feature, built from the real app with added motion, for an X/Twitter announcement or release thread. Use when asked for a launch video, demo video, feature teaser or announcement clip, or to add a video to a release tweet.
4
+---
5
+
6
+# Launch videos
7
+
8
+A launch video is 20–30 seconds: the app goes through one story in two or three beats,
9
+the camera punches in on each, a caption names it, and an outro card closes. Frames are
10
+rendered one by one in headless Chromium, so the result is deterministic.
11
+
12
+There are two ways to build one:
13
+
14
+- **Real app (default).** A staging script runs the real server and web client with fictional
15
+ data and the free replay agent, drives the flow in a browser, and freezes the page at each
16
+ beat into `beats/<name>.html`. The story stacks those frozen pages and adds the motion: the
17
+ camera, cursor, pops, glows, typing and captions. The UI is whatever the app draws today, so
18
+ re-staging on main updates the video. `stagings/linked-environments/` is a finished example.
19
+- **Mock.** `template/story.html` is a hand-built HTML copy of the app (the 0.1.11 tunnels
20
+ video). Use it only for what a staging can't produce, such as another app on the desktop or
21
+ a desktop-only screen. It drifts as the app changes.
22
+
23
+## Workflow (real app)
24
+
25
+1. **Learn the feature.** Read the PRs and the components it touches. Write down the one
26
+ thing a user can now do that they couldn't before, in the user's words.
27
+2. **Write the story** before any code: who the user is, what they want, and two or three
28
+ beats that get them there. Show it to the maintainer if the angle is a guess.
29
+3. **Stage it.** Copy `stagings/linked-environments/` to `stagings/<slug>/`.
30
+ - `serve.mjs` builds fresh homes under `.t3/launch/<slug>/` with `scripts/stage-env.mjs`.
31
+ Each home gets a fictional machine label, the replay agent, and no paid provider.
32
+ It starts the servers, creates projects, writes `<out>/stage.json` and keeps running.
33
+ Run it in the background.
34
+ - `drive.mjs` opens the web client with `openBrowser()` (1440×720, dark, release
35
+ branding) and walks the flow. It calls `beat(name)` at each moment the video needs.
36
+ Re-run it as often as you like against the same servers.
37
+ - Agent turns: pass `claude: [turns]` to `prepareHome` and the real Claude provider runs
38
+ `scripts/fake-claude.mjs` as its CLI, so the video shows Claude's logo, models, thinking
39
+ and tool rows. Each turn is `{ match, steps }`: `think`, `text`, `bash` (+ `output`, `ms`),
40
+ `wait`, and `tool` (+ `input`), which calls that T3 MCP tool for real, e.g.
41
+ `delegate_task`. Match generated titles with a `{ match: "title", repeat: true }` turn.
42
+ `<var:name>` is filled from the JSON file at `T3_DEV_REPLAY_VARS`, for ids that change
43
+ every run. `fake-claude.log` in the home records the protocol, for debugging.
44
+ - The free replay agent (`apps/server/scripts/dev-replay-agent.ts`) still works without
45
+ `claude`, but it shows as an ACP provider.
46
+4. **Create the story:** `scripts/new.sh ~/launch-videos/<slug>`, then copy the beats in, or
47
+ pass that directory as the staging's `<out>`. Add one `<iframe data-beat>` per beat and
48
+ write `setup()` and `placeCursor()` (see Anatomy).
49
+5. **Find targets** in a beat: `scripts/find.mjs <dir>/beats/<name>.html "<text>"` prints
50
+ selectors and boxes for the elements containing that text and their ancestors.
51
+6. **Probe** with contact sheets at every beat, fix, repeat:
52
+ `scripts/sheet.sh ~/launch-videos/<slug> 1,4.5,8,12,16,21,26` then Read `sheet.png`.
53
+ The times are video seconds (after `Kit.timeline`), not animation seconds. Read the
54
+ full-size frames in `probe/` to check small text. A probe takes about 2 s a frame.
55
+7. **Render:** `scripts/render.sh ~/launch-videos/<slug> t3code-<slug>` gives
56
+ `t3code-<slug>.mp4` and `outro.png`. A 30 s video takes 3–6 minutes.
57
+8. **Hand back** with the video and outro embedded (``), the caption
58
+ copy, any `Kit.text` edits, and anything you assumed rather than verified.
59
+
60
+The scripts need this repo's `node_modules` (`vp i`) for `playwright-core`, any Chromium in
61
+the Playwright cache (or `CHROME=/path`), and `ffmpeg` on PATH. Stop `serve.mjs` with your
62
+harness's task stop; it ends its servers' process groups.
63
+
64
+### Staging traps
65
+
66
+- **Machine names and icons.** `T3CODE_ENVIRONMENT_LABEL` and `T3CODE_ENVIRONMENT_MACHINE_KIND`
67
+ (laptop, desktop, cloud, linux, mac-mini, mac-studio) override what the server detects.
68
+ `prepareHome({ label, machine })` records them and `startEnvironment` and `cli()` pass them
69
+ on; the CLI needs them too, because a link introduces the machine by its label.
70
+- **Linked environments** refuse loopback addresses ("this machine"), and plain http works
71
+ only on tailnet names. `serve.mjs` links to this machine's tailnet DNS name.
72
+- **Leaks.** Grep the beats for the real hostname, username and tailnet name before
73
+ rendering. `snapshot.mjs` drops hidden inputs' values (they hold local paths).
74
+- **Timing.** A replayed turn streams in real time (each frame delay caps at 2 s). Make a
75
+ recording long enough for the drive to catch the state you need, and freeze beats on a
76
+ timer when the UI summarises (a running command shows only "Running pnpm").
77
+- **Agent wake-ups.** When a delegated child finishes, the parent agent gets a new turn. Give
78
+ its recording a second turn, or the first replays and delegates again.
79
+
80
+## What the maintainers asked for
81
+
82
+These came from review of the 0.1.11 videos. Each one was a real correction.
83
+
84
+- **It must look like the real app.** "Quite far off how it actually looks" was the first
85
+ round's verdict on a mock. Stage the real app; mock only what can't be staged, rebuilt from
86
+ the real component (strings live in `apps/web/src/i18n/translations/en.json` under hashed
87
+ keys, so grep by the text).
88
+- **Punchier than the app.** Extra motion is welcome (pops, glows, punch-ins, typing), as
89
+ long as every pixel it moves is the real UI.
90
+- **Readable on a phone.** Captions are 40px; zoom the camera 1.5–1.9× onto whatever the
91
+ beat is about. If text is under ~14px after zoom, zoom further or cut it.
92
+- **Slow enough to follow.** Slow the key interactions to 0.6–0.8× and hold 0.8–1.5 s after
93
+ each payoff. A viewer must see the result before the next beat starts.
94
+- **A realistic example.** The demo has to be something a user would really do. A local
95
+ terminal querying a forwarded port was rejected ("why not use the in-app terminal?");
96
+ a desktop database client was the right example.
97
+- **Distinct features read as distinct.** Two features get two numbered captions and two
98
+ clearly separate payoffs, never one blended beat.
99
+- **Brand.** Production logo only (`logo-prod.png`, from `assets/prod/`), never the blue
100
+ dev icon. The app's dark palette (below); orange only where the app uses it.
101
+- **Only announced things.** Before showing a screen, check it ships enabled. Feature-flagged
102
+ or separately announced work (for 0.1.11: GitHub sign-in and PR tooling, the mobile app)
103
+ stays out, even as background UI. A video whose subject is an opt-in Labs feature is
104
+ fine when the maintainer asked for it; say where to turn it on in the caption or tweet,
105
+ and ask whether the outro should call it a beta. Ask when unsure.
106
+- **Fictional demo data.** Project `acme/mugshot`, machine `devbox`, made-up people with
107
+ `@example.com`. No real people, teams, emails, repos or the user's own threads.
108
+- **Timing is checked, not assumed.** Typing must finish before the cursor clicks, a
109
+ tooltip must appear before it is read, and card text must not overflow. The contact
110
+ sheet catches these; full-size probe frames catch the rest.
111
+
112
+## Look
113
+
114
+From `apps/web/src/index.css`, dark theme:
115
+
116
+- Background `#000` with a faint primary glow at the top (`rgba(52,107,241,.13)`).
117
+- Text `#f1f3f7`, secondary `#a3a3a3`, UI muted `#8e8e93`, dim `#636368`.
118
+- Borders `#1d1d20` or white at 8%; surfaces `#0e0e0f` to `#191a1d`; chips `#191a1d`.
119
+- Primary `#346bf1`, light primary `#6e9bfb`, success `#4ade80`, destructive `#e5484d`.
120
+- Orange `#f07a4a` only for the agent ✳ next to a Claude model and provider marks.
121
+- Fonts: Inter (UI) and JetBrains Mono as `JB` (code, ports, versions, URLs).
122
+
123
+## Anatomy of a real-app story
124
+
125
+Everything runs on one clock in **animation seconds**. capture.mjs serves the directory over
126
+HTTP, loads the beats, calls `setup()`, seeks to `layoutTime`, calls `placeCursor()`, then
127
+seeks every animation (in the story and inside each beat) to each frame's time.
128
+
129
+- **Canvas** 1600×900 CSS px, rendered at device scale 1.2 to 1920×1080. Beats were frozen at
130
+ 1440×720 and `.app` scales them 1.0556× into the 1520×760 window, so beat point (x, y) is
131
+ canvas (40 + 1.0556·x, 26 + 1.0556·y).
132
+- **Targets** are `"<beat> >> <css>"` (or `"* >> <css>"` for every beat). Prefer the app's
133
+ `data-*` and `aria-label` attributes; `find.mjs` prints them.
134
+- **`setup()`**: `Kit.beats([[name, at, fade?], ...])` gives each beat one visibility window.
135
+ Then the motion, all at absolute times:
136
+ `Kit.pop / rise / slide / stagger / type / press / punch / fadeIn` animate elements inside
137
+ a beat; `Kit.glow(target, at)` draws a ring on the story layer, so app overflow can't
138
+ clip it; `Kit.anim` takes raw keyframes; `Kit.text` makes a static edit (say so at
139
+ handback).
140
+- **`placeCursor()`**: wrap in `Kit.measure` and call `Kit.camera(steps)` and
141
+ `Kit.cursor("#cur", steps)` there. Both take `{ t, on|at: target, ... }` steps measured at
142
+ `layoutTime` with the camera at rest. Pick a `layoutTime` after every entrance has
143
+ finished. Camera steps centre `on` at screen height `y` (default 420, clear of the captions)
144
+ at scale `s`; repeat a step to hold. Cursor clicks draw a ripple.
145
+- **Captions** `.cap`: a numbered chip, a bold lead phrase and a muted rest. Short enough to
146
+ read in two seconds.
147
+- **Pacing**: `Kit.timeline([[realSeconds, animFrom, animTo], ...])` maps video time to
148
+ animation time; `animFrom == animTo` holds a frame. It also sets the video length.
149
+- **Outro** `.outro`: logo, a two-line headline, "Available now in **T3 Code** `<version>`",
150
+ `t3.codes`. Change the headline and version, keep the rest. Hold it about 3 s.
151
+
152
+Two animations on one property of one element fight (the later one wins for its whole
153
+fill). Give an element one animation per property, as `Kit.beats` does for visibility.
154
+
155
+### Mock stories
156
+
157
+`template/story.html` uses the same kit (cursor, timeline) but draws the app in HTML on a
158
+2000×1000 `.stage` scaled .76 (stage point (x, y) is canvas (40 + .76·x, 26 + .76·y)), with CSS
159
+`@keyframes` and delays for motion and one `@keyframes camera` for the camera. Rebuild any
160
+screen it lacks from the real component's strings, layout and lucide icons.
161
+
162
+## Delivery checklist
163
+
164
+- [ ] 1920×1080, 30 fps, 20–30 s (`render.sh` prints it).
165
+- [ ] Every beat checked in a contact sheet and at full size.
166
+- [ ] No unannounced feature, real person, real machine name or real thread on screen.
167
+- [ ] `outro.png` exported and embedded in the reply with the video.
.agents/skills/launch-video/assets/inter.woff2
Binary files /dev/null and b/.agents/skills/launch-video/assets/inter.woff2 differ
.agents/skills/launch-video/assets/jbmono.woff2
Binary files /dev/null and b/.agents/skills/launch-video/assets/jbmono.woff2 differ
.agents/skills/launch-video/assets/kit.js
new
+359
@@ -0,0 +1,359 @@
1
+// Runtime helpers for launch-video stories. capture.mjs seeks every animation on the page and in
2
+// its beat iframes, including the Web Animations created here, so nothing may depend on real time.
3
+//
4
+// Targets: a CSS selector in the story ("#cur"), or "<beat> >> <selector>" for an element inside
5
+// the frozen app page loaded as <iframe data-beat="<beat>">.
6
+window.Kit = (() => {
7
+ const frames = () => [...document.querySelectorAll("iframe[data-beat]")];
8
+ const ready = Promise.all(
9
+ frames().map(
10
+ (f) =>
11
+ new Promise((resolve) => {
12
+ const done = async () => {
13
+ await f.contentDocument.fonts.ready;
14
+ resolve();
15
+ };
16
+ if (
17
+ f.contentDocument?.readyState === "complete" &&
18
+ f.contentDocument.body?.childElementCount
19
+ )
20
+ done();
21
+ else f.addEventListener("load", done, { once: true });
22
+ }),
23
+ ),
24
+ );
25
+
26
+ const beat = (name) => {
27
+ const f = document.querySelector(`iframe[data-beat="${name}"]`);
28
+ if (!f) throw new Error(`Kit: no beat named ${name}`);
29
+ return f;
30
+ };
31
+ const resolve = (target) => {
32
+ if (target instanceof Element) return { el: target, frame: null };
33
+ const split = target.indexOf(" >> ");
34
+ if (split === -1) {
35
+ const el = document.querySelector(target);
36
+ if (!el) throw new Error(`Kit: no element matches ${target}`);
37
+ return { el, frame: null };
38
+ }
39
+ const frame = beat(target.slice(0, split));
40
+ const sel = target.slice(split + 4);
41
+ const el = frame.contentDocument.querySelector(sel);
42
+ if (!el) throw new Error(`Kit: no element matches ${sel} in beat ${frame.dataset.beat}`);
43
+ return { el, frame };
44
+ };
45
+ // "* >> <selector>" matches in every beat.
46
+ const all = (target) => {
47
+ const split = target.indexOf(" >> ");
48
+ if (split === -1) return [...document.querySelectorAll(target)];
49
+ const name = target.slice(0, split);
50
+ const docs =
51
+ name === "*" ? frames().map((f) => f.contentDocument) : [beat(name).contentDocument];
52
+ return docs.flatMap((doc) => [...doc.querySelectorAll(target.slice(split + 4))]);
53
+ };
54
+ // A static edit to the frozen page, e.g. a dev-only label. Say so when you hand the video back.
55
+ const text = (targets, value) => {
56
+ for (const node of all(targets)) node.textContent = value;
57
+ };
58
+ const el = (target) => resolve(target).el;
59
+
60
+ // Story-page coordinates of a target's box, through any iframe and its scale.
61
+ const rect = (target) => {
62
+ const { el: node, frame } = resolve(target);
63
+ const r = node.getBoundingClientRect();
64
+ if (!frame) return r;
65
+ const f = frame.getBoundingClientRect();
66
+ const s = f.width / frame.offsetWidth;
67
+ return new DOMRect(f.left + r.left * s, f.top + r.top * s, r.width * s, r.height * s);
68
+ };
69
+ const centerOf = (target, dx = 0, dy = 0) => {
70
+ if (Array.isArray(target)) return target;
71
+ const r = rect(target);
72
+ return [r.left + r.width / 2 + dx, r.top + r.height / 2 + dy];
73
+ };
74
+
75
+ // Measure with the camera at rest: capture.mjs seeks to window.layoutTime, then calls this.
76
+ const measure = (fn) => {
77
+ const cams = [...document.querySelectorAll(".cam")];
78
+ const scripted = cams.flatMap((cam) =>
79
+ cam.getAnimations().filter((a) => !(a instanceof CSSAnimation)),
80
+ );
81
+ for (const cam of cams) cam.style.animation = "none";
82
+ for (const a of scripted) a.cancel();
83
+ try {
84
+ const result = fn();
85
+ for (const place of overlays.splice(0)) place();
86
+ return result;
87
+ } finally {
88
+ for (const cam of cams) cam.style.animation = "";
89
+ }
90
+ };
91
+ // Overlays drawn on the story page over a target (so the app's own overflow cannot clip
92
+ // them). They are measured and placed when placeCursor runs Kit.measure.
93
+ const overlays = [];
94
+ const overlay = (target, style, keyframes, timing) =>
95
+ overlays.push(() => {
96
+ const r = rect(target);
97
+ const node = resolve(target).el;
98
+ const radius = parseFloat(getComputedStyle(node).borderRadius) || 10;
99
+ const scale = r.width / node.getBoundingClientRect().width;
100
+ const box = document.createElement("div");
101
+ box.className = "kit-overlay";
102
+ Object.assign(box.style, {
103
+ position: "absolute",
104
+ left: `${r.left - 6}px`,
105
+ top: `${r.top - 6}px`,
106
+ width: `${r.width + 12}px`,
107
+ height: `${r.height + 12}px`,
108
+ borderRadius: `${radius * scale + 6}px`,
109
+ pointerEvents: "none",
110
+ zIndex: 15,
111
+ opacity: 0,
112
+ ...style,
113
+ });
114
+ (document.querySelector(".cam") ?? document.body).append(box);
115
+ anim(box, keyframes, timing);
116
+ });
117
+
118
+ // One Web Animation at an absolute time (animation seconds). fill "both" holds the first
119
+ // keyframe before `at` and the last after it ends.
120
+ const anim = (
121
+ target,
122
+ keyframes,
123
+ { at = 0, dur = 0.4, ease = "cubic-bezier(.2,.8,.2,1)", fill = "both" } = {},
124
+ ) => {
125
+ const node = typeof target === "string" ? el(target) : target;
126
+ return node.animate(keyframes, { delay: at * 1000, duration: dur * 1000, easing: ease, fill });
127
+ };
128
+ const SPRING = "linear(0, .25 7%, .7 16%, 1.03 28%, 1.08 34%, 1.04 44%, .99 58%, 1)";
129
+ // One visibility window per element: hidden, then shown from `from` (fading in over `fade`),
130
+ // then hidden again at `to`. Two separate show/hide animations on one element fight.
131
+ const visible = (target, from, to = Infinity, fade = 0) => {
132
+ const shown = from + fade;
133
+ const open = !Number.isFinite(to);
134
+ const end = open ? shown + 1 : to;
135
+ const keys = [
136
+ { offset: 0, opacity: 0 },
137
+ { offset: from / end, opacity: 0 },
138
+ { offset: shown / end, opacity: 1 },
139
+ // Every keyframe list ends at offset 1, or the fill falls back to the element's CSS.
140
+ ...(open
141
+ ? [{ offset: 1, opacity: 1 }]
142
+ : [
143
+ { offset: Math.max(shown, to - 0.001) / end, opacity: 1 },
144
+ { offset: 1, opacity: 0 },
145
+ ]),
146
+ ];
147
+ return anim(target, keys, { at: 0, dur: end, ease: "linear" });
148
+ };
149
+ // The beats in order: [[name, at, fade?], ...]. Each shows from its `at` until the next beat
150
+ // has finished fading in over it.
151
+ const beats = (sequence) =>
152
+ sequence.forEach(([name, at, fade = 0], i) => {
153
+ const next = sequence[i + 1];
154
+ visible(beat(name), at, next ? next[1] + (next[2] ?? 0) : Infinity, fade);
155
+ });
156
+
157
+ const motion = {
158
+ // Appear: at `at` the element is hidden until then.
159
+ show: (t, at) => anim(t, [{ opacity: 0 }, { opacity: 1 }], { at, dur: 0.01 }),
160
+ hide: (t, at) => anim(t, [{ opacity: 1 }, { opacity: 0 }], { at, dur: 0.01 }),
161
+ fadeIn: (t, at, dur = 0.3) =>
162
+ anim(t, [{ opacity: 0 }, { opacity: 1 }], { at, dur, ease: "ease-out" }),
163
+ fadeOut: (t, at, dur = 0.3) =>
164
+ anim(t, [{ opacity: 1 }, { opacity: 0 }], { at, dur, ease: "ease-in" }),
165
+ // Spring pop: scales up from `from` with an overshoot.
166
+ pop: (t, at, { from = 0.6, dur = 0.55, origin = "center" } = {}) => {
167
+ el(t).style.transformOrigin = origin;
168
+ return anim(
169
+ t,
170
+ [
171
+ { opacity: 0, transform: `scale(${from})` },
172
+ { opacity: 1, offset: 0.25 },
173
+ { opacity: 1, transform: "none" },
174
+ ],
175
+ { at, dur, ease: SPRING },
176
+ );
177
+ },
178
+ // Rise into place from below (or any offset), springy.
179
+ rise: (t, at, { y = 24, x = 0, dur = 0.6 } = {}) =>
180
+ anim(
181
+ t,
182
+ [
183
+ { opacity: 0, transform: `translate(${x}px, ${y}px)` },
184
+ { opacity: 1, offset: 0.3 },
185
+ { opacity: 1, transform: "none" },
186
+ ],
187
+ { at, dur, ease: SPRING },
188
+ ),
189
+ // Slide in from a side, e.g. a panel: { x: 400 } comes from the right.
190
+ slide: (t, at, { x = 0, y = 0, dur = 0.5 } = {}) =>
191
+ anim(t, [{ transform: `translate(${x}px, ${y}px)` }, { transform: "none" }], {
192
+ at,
193
+ dur,
194
+ ease: "cubic-bezier(.16,1,.3,1)",
195
+ }),
196
+ // The same entrance on each match, `step` seconds apart.
197
+ stagger: (targets, at, step = 0.07, fn = "rise", opts) =>
198
+ all(targets).map((node, i) => motion[fn](node, at + i * step, opts)),
199
+ // Typewriter: reveals the element left to right in `chars` steps.
200
+ type: (t, at, dur, chars = 30) =>
201
+ anim(t, [{ clipPath: "inset(0 100% 0 0)" }, { clipPath: "inset(0 0 0 0)" }], {
202
+ at,
203
+ dur,
204
+ ease: `steps(${chars}, end)`,
205
+ }),
206
+ // Button squash on click.
207
+ press: (t, at) =>
208
+ anim(
209
+ t,
210
+ [{ transform: "none" }, { transform: "scale(.9)", offset: 0.35 }, { transform: "none" }],
211
+ { at, dur: 0.3, ease: "ease-out", fill: "none" },
212
+ ),
213
+ // Primary-blue glow ring that blooms and settles around the element (an overlay).
214
+ glow: (t, at, dur = 1.4) =>
215
+ overlay(
216
+ t,
217
+ {
218
+ border: "2px solid rgba(110,155,251,.95)",
219
+ boxShadow: "0 0 32px 6px rgba(52,107,241,.55), inset 0 0 18px rgba(52,107,241,.25)",
220
+ },
221
+ [
222
+ { opacity: 0, transform: "scale(1.06)" },
223
+ { opacity: 1, transform: "none", offset: 0.18 },
224
+ { opacity: 1, transform: "none", offset: 0.75 },
225
+ { opacity: 0, transform: "none" },
226
+ ],
227
+ { at, dur, ease: "ease-out" },
228
+ ),
229
+ // A punch: brief scale-up pulse that draws the eye.
230
+ punch: (t, at, scale = 1.06) =>
231
+ anim(
232
+ t,
233
+ [
234
+ { transform: "none" },
235
+ { transform: `scale(${scale})`, offset: 0.3 },
236
+ { transform: "none" },
237
+ ],
238
+ { at, dur: 0.45, ease: "ease-out", fill: "none" },
239
+ ),
240
+ };
241
+
242
+ // Click ripple drawn on the story page at a target's centre (call from setup or placeCursor).
243
+ const ripple = (target, at, { dx = 0, dy = 0 } = {}) => {
244
+ const [x, y] = centerOf(target, dx, dy);
245
+ const ring = document.createElement("div");
246
+ ring.className = "kit-ripple";
247
+ Object.assign(ring.style, {
248
+ position: "absolute",
249
+ left: `${x - 30}px`,
250
+ top: `${y - 30}px`,
251
+ width: "60px",
252
+ height: "60px",
253
+ borderRadius: "50%",
254
+ border: "3px solid rgba(110,155,251,.9)",
255
+ pointerEvents: "none",
256
+ zIndex: 25,
257
+ });
258
+ (document.querySelector(".cam") ?? document.body).append(ring);
259
+ return anim(
260
+ ring,
261
+ [
262
+ { opacity: 0, transform: "scale(.2)" },
263
+ { opacity: 1, offset: 0.15 },
264
+ { opacity: 0, transform: "scale(1.6)" },
265
+ ],
266
+ { at, dur: 0.55, ease: "ease-out" },
267
+ );
268
+ };
269
+
270
+ // Steps, in animation seconds:
271
+ // { t, at: [x, y] | target, dx, dy, click, hidden }
272
+ // at omitted = stay put (a hold). click = press at t. hidden = fade the cursor out by t.
273
+ const cursor = (selector, steps, { ease = "cubic-bezier(.45,0,.2,1)", ripples = true } = {}) => {
274
+ const node = document.querySelector(selector);
275
+ for (const a of node.getAnimations()) a.cancel();
276
+ const end = steps.at(-1).t;
277
+ const keys = [];
278
+ let pos = [0, 0];
279
+ let opacity = 0;
280
+ const push = (t, scale = 1) =>
281
+ keys.push({
282
+ offset: t / end,
283
+ transform: `translate(${pos[0] - 4}px, ${pos[1] - 3}px) scale(${scale})`,
284
+ opacity,
285
+ easing: ease,
286
+ });
287
+ steps.forEach((s, i) => {
288
+ if (s.at !== undefined) pos = centerOf(s.at, s.dx, s.dy);
289
+ if (i === 0) {
290
+ push(0);
291
+ opacity = s.hidden ? 0 : 1;
292
+ push(s.t);
293
+ return;
294
+ }
295
+ opacity = s.hidden ? 0 : 1;
296
+ push(s.t);
297
+ if (s.click) {
298
+ push(s.t + 0.07, 0.8);
299
+ push(s.t + 0.22, 1);
300
+ if (ripples) ripple(pos, s.t + 0.05);
301
+ }
302
+ });
303
+ keys.sort((a, b) => a.offset - b.offset);
304
+ for (const k of keys) k.offset = Math.min(1, Math.max(0, k.offset));
305
+ node.animate(keys, { duration: end * 1000, fill: "both" });
306
+ };
307
+
308
+ // Camera keyframes on .cam, in animation seconds: { t, on: target | [x, y] | "full", s, y, ease }.
309
+ // `on` is centred horizontally and placed at screen height `y` (default 420, clear of the
310
+ // captions); "full" is the whole canvas. Repeat a step at a later t to hold. Call it inside
311
+ // Kit.measure (placeCursor) so targets are measured with the camera at rest.
312
+ const camera = (steps, { selector = ".cam" } = {}) => {
313
+ const cam = document.querySelector(selector);
314
+ for (const a of cam.getAnimations()) a.cancel();
315
+ const end = steps.at(-1).t;
316
+ const keys = steps.map((step) => {
317
+ let transform = "none";
318
+ if (step.on !== "full") {
319
+ const s = step.s ?? 1.5;
320
+ const [x, y] = centerOf(step.on, step.dx, step.dy);
321
+ transform = `translate(${800 - s * x}px, ${(step.y ?? 420) - s * y}px) scale(${s})`;
322
+ }
323
+ return { offset: step.t / end, transform, easing: step.ease ?? "cubic-bezier(.65,0,.35,1)" };
324
+ });
325
+ cam.animate(keys, { duration: end * 1000, fill: "both" });
326
+ };
327
+
328
+ // Segments: [realSeconds, animFrom, animTo]; animFrom == animTo holds the frame.
329
+ const timeline = (segments) => {
330
+ window.totalDuration = segments.reduce((n, [d]) => n + d, 0);
331
+ const last = segments.at(-1)[2];
332
+ window.warp = (t) => {
333
+ for (const [d, a, b] of segments) {
334
+ if (t <= d) return a + (b - a) * (t / d);
335
+ t -= d;
336
+ }
337
+ return last;
338
+ };
339
+ };
340
+
341
+ return {
342
+ ready,
343
+ beat,
344
+ beats,
345
+ visible,
346
+ el,
347
+ all,
348
+ text,
349
+ rect,
350
+ centerOf,
351
+ measure,
352
+ anim,
353
+ ripple,
354
+ cursor,
355
+ camera,
356
+ timeline,
357
+ ...motion,
358
+ };
359
+})();
.agents/skills/launch-video/scripts/capture.mjs
new
+128
@@ -0,0 +1,128 @@
1
+#!/usr/bin/env node
2
+// Renders a story page frame by frame: every animation is paused and seeked, so output is deterministic.
3
+// Usage: capture.mjs <story.html> <outDir> [--at <seconds,...>] [--fps 30]
4
+import * as NodeModule from "node:module";
5
+import * as NodeFS from "node:fs";
6
+import * as NodeHttp from "node:http";
7
+
8
+import { findChrome } from "./chrome.mjs";
9
+import * as NodePath from "node:path";
10
+import * as NodeURL from "node:url";
11
+
12
+const args = process.argv.slice(2);
13
+const flag = (name) => {
14
+ const i = args.indexOf(name);
15
+ if (i === -1) return undefined;
16
+ const [, value] = args.splice(i, 2);
17
+ return value;
18
+};
19
+const at = flag("--at");
20
+const fps = Number(flag("--fps") ?? 30);
21
+const [html, outDir] = args;
22
+if (!html || !outDir) {
23
+ console.error("usage: capture.mjs <story.html> <outDir> [--at <seconds,...>] [--fps 30]");
24
+ process.exit(2);
25
+}
26
+
27
+const repoRoot = NodePath.resolve(
28
+ NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)),
29
+ "../../../..",
30
+);
31
+const loadChromium = () => {
32
+ const require = NodeModule.createRequire(NodePath.join(repoRoot, "scripts/package.json"));
33
+ try {
34
+ return require("playwright-core").chromium;
35
+ } catch {
36
+ console.error(`playwright-core is not installed in ${repoRoot}. Run \`vp i\` there first.`);
37
+ process.exit(1);
38
+ }
39
+};
40
+const chromium = loadChromium();
41
+
42
+// Served over HTTP, not file://, so the story can reach into its beat iframes.
43
+const TYPES = {
44
+ ".html": "text/html",
45
+ ".js": "text/javascript",
46
+ ".css": "text/css",
47
+ ".svg": "image/svg+xml",
48
+ ".png": "image/png",
49
+ ".woff2": "font/woff2",
50
+ ".woff": "font/woff",
51
+ ".ttf": "font/ttf",
52
+};
53
+const root = NodePath.dirname(NodePath.resolve(html));
54
+const server = NodeHttp.createServer((req, res) => {
55
+ const file = NodePath.join(root, decodeURIComponent(new URL(req.url, "http://x").pathname));
56
+ if (!file.startsWith(root)) return void res.writeHead(403).end();
57
+ NodeFS.readFile(file, (error, body) => {
58
+ if (error) return void res.writeHead(404).end();
59
+ res
60
+ .writeHead(200, {
61
+ "content-type": TYPES[NodePath.extname(file)] ?? "application/octet-stream",
62
+ })
63
+ .end(body);
64
+ });
65
+}).listen(0, "127.0.0.1");
66
+await new Promise((resolve) => server.once("listening", resolve));
67
+
68
+// Every animation in the story and in its beat iframes, paused at `ms`.
69
+const seek = (ms) => {
70
+ const docs = [
71
+ document,
72
+ ...[...document.querySelectorAll("iframe")].map((f) => f.contentDocument).filter(Boolean),
73
+ ];
74
+ for (const doc of docs)
75
+ for (const a of doc.getAnimations()) {
76
+ a.pause();
77
+ a.currentTime = ms;
78
+ }
79
+};
80
+
81
+if (!at) NodeFS.rmSync(outDir, { recursive: true, force: true });
82
+NodeFS.mkdirSync(outDir, { recursive: true });
83
+const browser = await chromium.launch({
84
+ executablePath: findChrome(chromium),
85
+ args: ["--no-sandbox"],
86
+});
87
+try {
88
+ const page = await browser.newPage({
89
+ viewport: { width: 1600, height: 900 },
90
+ deviceScaleFactor: 1.2,
91
+ });
92
+ const errors = [];
93
+ page.on("pageerror", (e) => errors.push(e.message));
94
+ page.on("requestfailed", (r) => errors.push(`failed to load ${r.url()}`));
95
+ page.on("response", (r) => r.status() >= 400 && errors.push(`${r.status()} ${r.url()}`));
96
+ await page.goto(`http://127.0.0.1:${server.address().port}/${NodePath.basename(html)}`);
97
+ await page.evaluate(async () => {
98
+ await window.Kit?.ready;
99
+ await document.fonts.ready;
100
+ window.setup?.();
101
+ });
102
+ await page.evaluate(
103
+ ([seekSource]) => {
104
+ window.__seek = new Function(`return ${seekSource}`)();
105
+ window.__seek((window.layoutTime ?? 15) * 1000);
106
+ window.placeCursor?.();
107
+ },
108
+ [seek.toString()],
109
+ );
110
+ if (errors.length) throw new Error(`story page errors:\n${errors.join("\n")}`);
111
+ const total = await page.evaluate(() => window.totalDuration);
112
+ if (!total) throw new Error("story must set window.totalDuration (Kit.timeline does this)");
113
+
114
+ const indices = at
115
+ ? at.split(",").map((s) => Math.min(Math.round(Number(s) * fps), Math.round(total * fps) - 1))
116
+ : [...Array(Math.round(total * fps)).keys()];
117
+ for (const i of indices) {
118
+ await page.evaluate((t) => window.__seek((window.warp ? window.warp(t) : t) * 1000), i / fps);
119
+ const name = at
120
+ ? `t${(i / fps).toFixed(2).padStart(6, "0")}.png`
121
+ : `f${String(i).padStart(4, "0")}.png`;
122
+ await page.screenshot({ path: NodePath.join(outDir, name) });
123
+ }
124
+ console.log(`${indices.length} frame(s) -> ${outDir} (video length ${total.toFixed(1)}s)`);
125
+} finally {
126
+ await browser.close();
127
+ server.close();
128
+}
.agents/skills/launch-video/scripts/chrome.mjs
new
+34
@@ -0,0 +1,34 @@
1
+import * as NodeFS from "node:fs";
2
+import * as NodeOS from "node:os";
3
+import * as NodePath from "node:path";
4
+
5
+// Playwright's pinned revision is often not downloaded; any cached Chromium renders the same CSS.
6
+export const findChrome = (chromium) => {
7
+ if (process.env.CHROME) return process.env.CHROME;
8
+ const pinned = chromium.executablePath();
9
+ if (NodeFS.existsSync(pinned)) return pinned;
10
+ const caches = [".cache/ms-playwright", "Library/Caches/ms-playwright"]
11
+ .map((d) => NodePath.join(NodeOS.homedir(), d))
12
+ .filter(NodeFS.existsSync);
13
+ const builds = caches
14
+ .flatMap((cache) =>
15
+ NodeFS.readdirSync(cache)
16
+ .filter((d) => /^chromium-\d+$/.test(d))
17
+ .map((d) => ({ cache, d, rev: Number(d.split("-")[1]) })),
18
+ )
19
+ .sort((a, b) => b.rev - a.rev);
20
+ const candidates = builds.flatMap(({ cache, d }) => [
21
+ NodePath.join(cache, d, "chrome-linux64/chrome"),
22
+ NodePath.join(cache, d, "chrome-linux/chrome"),
23
+ NodePath.join(cache, d, "chrome-mac-arm64/Chromium.app/Contents/MacOS/Chromium"),
24
+ NodePath.join(cache, d, "chrome-mac/Chromium.app/Contents/MacOS/Chromium"),
25
+ ]);
26
+ const found = candidates.find(NodeFS.existsSync);
27
+ if (!found) {
28
+ console.error(
29
+ "No Chromium found. Set CHROME=/path/to/chrome or run `vp exec playwright install chromium` in apps/web.",
30
+ );
31
+ process.exit(1);
32
+ }
33
+ return found;
34
+};
.agents/skills/launch-video/scripts/fake-claude.mjs
new
+341
@@ -0,0 +1,341 @@
1
+#!/usr/bin/env node
2
+// A stand-in `claude` CLI for staged launch videos: T3's real Claude provider runs it, and it
3
+// plays the scripted turns in FAKE_CLAUDE_SCRIPT over the Agent SDK's stream-json protocol.
4
+// Script format: see the launch-video SKILL.md. FAKE_CLAUDE_LOG records every line.
5
+import * as NodeCrypto from "node:crypto";
6
+import * as NodeFS from "node:fs";
7
+import * as NodeReadline from "node:readline";
8
+
9
+const VERSION = "2.1.329";
10
+if (process.argv.includes("--version") || process.argv.includes("-v")) {
11
+ console.log(`${VERSION} (Claude Code)`);
12
+ process.exit(0);
13
+}
14
+
15
+const log = (direction, value) => {
16
+ if (!process.env.FAKE_CLAUDE_LOG) return;
17
+ NodeFS.appendFileSync(
18
+ process.env.FAKE_CLAUDE_LOG,
19
+ `${direction} ${JSON.stringify(value).slice(0, 4000)}\n`,
20
+ );
21
+};
22
+log("argv", process.argv.slice(2));
23
+
24
+const readJson = (file, fallback) => {
25
+ try {
26
+ return JSON.parse(NodeFS.readFileSync(file, "utf8"));
27
+ } catch {
28
+ return fallback;
29
+ }
30
+};
31
+const script = readJson(process.env.FAKE_CLAUDE_SCRIPT ?? "", []);
32
+const played = new Set();
33
+const fill = (value) => {
34
+ const vars = readJson(process.env.T3_DEV_REPLAY_VARS ?? "", {});
35
+ const walk = (v) =>
36
+ typeof v === "string"
37
+ ? v.replace(/<var:([\w-]+)>/g, (m, name) => vars[name] ?? m)
38
+ : Array.isArray(v)
39
+ ? v.map(walk)
40
+ : v && typeof v === "object"
41
+ ? Object.fromEntries(Object.entries(v).map(([k, x]) => [k, walk(x)]))
42
+ : v;
43
+ return walk(value);
44
+};
45
+
46
+const argValue = (name) => {
47
+ const i = process.argv.indexOf(name);
48
+ return i === -1 ? undefined : process.argv[i + 1];
49
+};
50
+const sessionId = argValue("--session-id") ?? argValue("--resume") ?? NodeCrypto.randomUUID();
51
+let model = argValue("--model") ?? "claude-opus-5-5";
52
+const cwd = process.cwd();
53
+const mcpServers = {};
54
+const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
55
+const uuid = () => NodeCrypto.randomUUID();
56
+
57
+const send = (message) => {
58
+ log("out", message);
59
+ process.stdout.write(`${JSON.stringify(message)}\n`);
60
+};
61
+const usage = {
62
+ input_tokens: 1,
63
+ cache_creation_input_tokens: 0,
64
+ cache_read_input_tokens: 0,
65
+ output_tokens: 1,
66
+ service_tier: "standard",
67
+};
68
+const assistant = (content, id = `msg_${uuid().replaceAll("-", "").slice(0, 24)}`) =>
69
+ send({
70
+ type: "assistant",
71
+ message: {
72
+ model,
73
+ id,
74
+ type: "message",
75
+ role: "assistant",
76
+ content,
77
+ stop_reason: null,
78
+ stop_sequence: null,
79
+ usage,
80
+ },
81
+ parent_tool_use_id: null,
82
+ session_id: sessionId,
83
+ uuid: uuid(),
84
+ });
85
+const toolResult = (toolUseId, content, extra = {}) =>
86
+ send({
87
+ type: "user",
88
+ message: {
89
+ role: "user",
90
+ content: [{ tool_use_id: toolUseId, type: "tool_result", content, is_error: false }],
91
+ },
92
+ parent_tool_use_id: null,
93
+ session_id: sessionId,
94
+ uuid: uuid(),
95
+ timestamp: new Date().toISOString(),
96
+ ...extra,
97
+ });
98
+
99
+// Streams text the way the CLI does with partial messages on: deltas, then the whole block.
100
+const streamText = async (text, type = "text") => {
101
+ const id = `msg_${uuid().replaceAll("-", "").slice(0, 24)}`;
102
+ const delta = type === "text" ? "text_delta" : "thinking_delta";
103
+ const field = type === "text" ? "text" : "thinking";
104
+ send({
105
+ type: "stream_event",
106
+ event: {
107
+ type: "message_start",
108
+ message: { id, type: "message", role: "assistant", model, content: [], usage },
109
+ },
110
+ parent_tool_use_id: null,
111
+ session_id: sessionId,
112
+ uuid: uuid(),
113
+ });
114
+ send({
115
+ type: "stream_event",
116
+ event: {
117
+ type: "content_block_start",
118
+ index: 0,
119
+ content_block:
120
+ type === "text"
121
+ ? { type: "text", text: "" }
122
+ : { type: "thinking", thinking: "", signature: "" },
123
+ },
124
+ parent_tool_use_id: null,
125
+ session_id: sessionId,
126
+ uuid: uuid(),
127
+ });
128
+ const words = text.match(/\S+\s*|\s+/g) ?? [text];
129
+ for (let i = 0; i < words.length; i += 3) {
130
+ await sleep(35);
131
+ send({
132
+ type: "stream_event",
133
+ event: {
134
+ type: "content_block_delta",
135
+ index: 0,
136
+ delta: { type: delta, [field]: words.slice(i, i + 3).join("") },
137
+ },
138
+ parent_tool_use_id: null,
139
+ session_id: sessionId,
140
+ uuid: uuid(),
141
+ });
142
+ }
143
+ send({
144
+ type: "stream_event",
145
+ event: { type: "content_block_stop", index: 0 },
146
+ parent_tool_use_id: null,
147
+ session_id: sessionId,
148
+ uuid: uuid(),
149
+ });
150
+ assistant(
151
+ [
152
+ type === "text"
153
+ ? { type: "text", text }
154
+ : { type: "thinking", thinking: text, signature: "" },
155
+ ],
156
+ id,
157
+ );
158
+ send({
159
+ type: "stream_event",
160
+ event: { type: "message_stop" },
161
+ parent_tool_use_id: null,
162
+ session_id: sessionId,
163
+ uuid: uuid(),
164
+ });
165
+};
166
+
167
+// One MCP tools/call over streamable HTTP against the server T3 registered.
168
+async function callTool(name, args) {
169
+ const [serverName, server] = Object.entries(mcpServers).find(([, s]) => s.url) ?? [];
170
+ if (!server) return { serverName: "t3-code", text: `No MCP server for ${name}` };
171
+ let session;
172
+ const post = async (body) => {
173
+ const response = await fetch(server.url, {
174
+ method: "POST",
175
+ headers: {
176
+ accept: "application/json, text/event-stream",
177
+ "content-type": "application/json",
178
+ ...server.headers,
179
+ ...(session && { "mcp-session-id": session }),
180
+ },
181
+ body: JSON.stringify({ jsonrpc: "2.0", ...body }),
182
+ });
183
+ session = response.headers.get("mcp-session-id") ?? session;
184
+ const text = await response.text();
185
+ const data = text.split("\n").find((line) => line.startsWith("data:"));
186
+ return text ? JSON.parse(data ? data.slice(5) : text) : undefined;
187
+ };
188
+ await post({
189
+ id: 1,
190
+ method: "initialize",
191
+ params: {
192
+ protocolVersion: "2025-06-18",
193
+ capabilities: {},
194
+ clientInfo: { name: "fake-claude", version: VERSION },
195
+ },
196
+ });
197
+ await post({ method: "notifications/initialized" });
198
+ const result = await post({ id: 2, method: "tools/call", params: { name, arguments: args } });
199
+ log("mcp", result);
200
+ const text =
201
+ (result?.result?.content ?? []).map((c) => c.text ?? "").join("\n") ||
202
+ JSON.stringify(result?.error ?? result);
203
+ return { serverName, text };
204
+}
205
+
206
+async function playTurn(prompt) {
207
+ let index = script.findIndex(
208
+ (turn, i) => !played.has(i) && turn.match && new RegExp(turn.match, "i").test(prompt),
209
+ );
210
+ if (index === -1) index = script.findIndex((turn, i) => !played.has(i) && !turn.match);
211
+ const turn = index === -1 ? { steps: [{ text: "Done." }] } : script[index];
212
+ if (index !== -1 && !turn.repeat) played.add(index);
213
+ send({
214
+ type: "system",
215
+ subtype: "init",
216
+ apiKeySource: "none",
217
+ claude_code_version: VERSION,
218
+ cwd,
219
+ tools: ["Bash", "Read", "Edit"],
220
+ mcp_servers: Object.keys(mcpServers).map((name) => ({ name, status: "connected" })),
221
+ model,
222
+ permissionMode: "bypassPermissions",
223
+ slash_commands: [],
224
+ output_style: "default",
225
+ skills: [],
226
+ plugins: [],
227
+ agents: [],
228
+ uuid: uuid(),
229
+ session_id: sessionId,
230
+ });
231
+ let last = "";
232
+ for (const step of fill(turn.steps)) {
233
+ if (step.wait) await sleep(step.wait);
234
+ if (step.think) await streamText(step.think, "thinking");
235
+ if (step.text) {
236
+ await streamText(step.text);
237
+ last = step.text;
238
+ }
239
+ if (step.bash) {
240
+ const id = `toolu_${uuid().replaceAll("-", "").slice(0, 24)}`;
241
+ assistant([
242
+ {
243
+ type: "tool_use",
244
+ id,
245
+ name: "Bash",
246
+ input: { command: step.bash, description: step.description ?? step.bash },
247
+ },
248
+ ]);
249
+ await sleep(step.ms ?? 1200);
250
+ toolResult(id, step.output ?? "", {
251
+ tool_use_result: {
252
+ stdout: step.output ?? "",
253
+ stderr: "",
254
+ interrupted: false,
255
+ isImage: false,
256
+ },
257
+ });
258
+ }
259
+ if (step.tool) {
260
+ const id = `toolu_${uuid().replaceAll("-", "").slice(0, 24)}`;
261
+ const serverName = Object.keys(mcpServers)[0] ?? "t3-code";
262
+ assistant([
263
+ { type: "tool_use", id, name: `mcp__${serverName}__${step.tool}`, input: step.input ?? {} },
264
+ ]);
265
+ const { text } = await callTool(step.tool, step.input ?? {}).catch((error) => ({
266
+ text: String(error),
267
+ }));
268
+ toolResult(id, [{ type: "text", text }]);
269
+ }
270
+ }
271
+ send({
272
+ type: "result",
273
+ subtype: "success",
274
+ is_error: false,
275
+ duration_ms: 4000,
276
+ duration_api_ms: 3500,
277
+ num_turns: 1,
278
+ result: last,
279
+ stop_reason: "end_turn",
280
+ session_id: sessionId,
281
+ total_cost_usd: 0,
282
+ usage,
283
+ modelUsage: {},
284
+ permission_denials: [],
285
+ uuid: uuid(),
286
+ });
287
+}
288
+
289
+const controlResponse = (request) => {
290
+ switch (request.subtype) {
291
+ case "initialize":
292
+ return {
293
+ commands: [],
294
+ output_style: "default",
295
+ available_output_styles: ["default"],
296
+ models: [],
297
+ account: { email: "demo@example.com", subscriptionType: "max", tokenSource: "claude.ai" },
298
+ };
299
+ case "mcp_set_servers":
300
+ for (const [name, config] of Object.entries(request.servers ?? {})) mcpServers[name] = config;
301
+ return { added: Object.keys(request.servers ?? {}), removed: [], errors: {} };
302
+ case "set_model":
303
+ model = request.model ?? model;
304
+ return {};
305
+ case "get_usage":
306
+ return { rate_limits_available: false, rate_limits: [] };
307
+ default:
308
+ return {};
309
+ }
310
+};
311
+
312
+let queue = Promise.resolve();
313
+const input = NodeReadline.createInterface({ input: process.stdin, crlfDelay: Infinity });
314
+input.on("line", (line) => {
315
+ if (!line.trim()) return;
316
+ let message;
317
+ try {
318
+ message = JSON.parse(line);
319
+ } catch {
320
+ return;
321
+ }
322
+ log("in", message);
323
+ if (message.type === "control_request") {
324
+ send({
325
+ type: "control_response",
326
+ response: {
327
+ subtype: "success",
328
+ request_id: message.request_id,
329
+ response: controlResponse(message.request ?? {}),
330
+ },
331
+ });
332
+ return;
333
+ }
334
+ if (message.type === "user") {
335
+ const content = message.message?.content;
336
+ const prompt =
337
+ typeof content === "string" ? content : (content ?? []).map((c) => c.text ?? "").join("\n");
338
+ queue = queue.then(() => playTurn(prompt)).catch((error) => log("error", String(error)));
339
+ }
340
+});
341
+input.on("close", () => queue.then(() => process.exit(0)));
.agents/skills/launch-video/scripts/find.mjs
new
+95
@@ -0,0 +1,95 @@
1
+#!/usr/bin/env node
2
+// Finds elements in a frozen beat to target from a story: prints a selector, the box (in beat
3
+// pixels) and the text of the smallest elements containing `text`, and of their clickable or
4
+// labelled ancestors. Usage: find.mjs <beats/name.html> <text> [--all]
5
+import * as NodeHttp from "node:http";
6
+import * as NodeFS from "node:fs";
7
+import * as NodeModule from "node:module";
8
+import * as NodePath from "node:path";
9
+
10
+import { findChrome } from "./chrome.mjs";
11
+
12
+const [file, text] = process.argv.slice(2);
13
+if (!file || !text) {
14
+ console.error("usage: find.mjs <beats/name.html> <text>");
15
+ process.exit(2);
16
+}
17
+const REPO = NodePath.resolve(import.meta.dirname, "../../../..");
18
+const { chromium } = NodeModule.createRequire(NodePath.join(REPO, "scripts/package.json"))(
19
+ "playwright-core",
20
+);
21
+const root = NodePath.dirname(NodePath.resolve(file));
22
+const server = NodeHttp.createServer((req, res) => {
23
+ NodeFS.readFile(
24
+ NodePath.join(root, decodeURIComponent(new URL(req.url, "http://x").pathname)),
25
+ (error, body) =>
26
+ error
27
+ ? res.writeHead(404).end()
28
+ : res
29
+ .writeHead(200, req.url.endsWith(".html") ? { "content-type": "text/html" } : {})
30
+ .end(body),
31
+ );
32
+}).listen(0, "127.0.0.1");
33
+await new Promise((resolve) => server.once("listening", resolve));
34
+const browser = await chromium.launch({
35
+ executablePath: findChrome(chromium),
36
+ args: ["--no-sandbox"],
37
+});
38
+try {
39
+ const page = await browser.newPage({ viewport: { width: 1440, height: 720 } });
40
+ await page.goto(`http://127.0.0.1:${server.address().port}/${NodePath.basename(file)}`);
41
+ const found = await page.evaluate((needle) => {
42
+ // Short, stable selectors: data attributes and aria labels over generated classes.
43
+ const describe = (el) => {
44
+ const parts = [];
45
+ for (
46
+ let node = el;
47
+ node && node !== document.body && parts.length < 4;
48
+ node = node.parentElement
49
+ ) {
50
+ const data = [...node.attributes].find(
51
+ (a) => a.name.startsWith("data-") && !/^data-(base-ui|state|kit)/.test(a.name),
52
+ );
53
+ const label = node.getAttribute("aria-label");
54
+ const part =
55
+ node.tagName.toLowerCase() +
56
+ (node.id && !node.id.startsWith("base-ui") ? `#${CSS.escape(node.id)}` : "") +
57
+ (data ? `[${data.name}${data.value ? `="${data.value.slice(0, 40)}"` : ""}]` : "") +
58
+ (label ? `[aria-label="${label.slice(0, 50)}"]` : "");
59
+ parts.unshift(part);
60
+ if (data || label || node.id) {
61
+ const selector = parts.join(" > ");
62
+ try {
63
+ if (document.querySelectorAll(selector).length === 1) return selector;
64
+ } catch {}
65
+ }
66
+ }
67
+ return parts.join(" > ");
68
+ };
69
+ const matches = [...document.querySelectorAll("body *")].filter(
70
+ (el) =>
71
+ el.textContent.includes(needle) &&
72
+ ![...el.children].some((c) => c.textContent.includes(needle)),
73
+ );
74
+ return matches.slice(0, 6).map((el) => {
75
+ const chain = [];
76
+ for (let node = el; node && node !== document.body; node = node.parentElement) {
77
+ if (
78
+ node === el ||
79
+ node.matches("button, a, [role], [aria-label], li, section, aside, form, [data-slot]")
80
+ ) {
81
+ const r = node.getBoundingClientRect();
82
+ chain.push(
83
+ `${describe(node)} @ ${Math.round(r.left)},${Math.round(r.top)} ${Math.round(r.width)}×${Math.round(r.height)} "${node.textContent.trim().slice(0, 50)}"`,
84
+ );
85
+ }
86
+ if (chain.length >= 5) break;
87
+ }
88
+ return chain.join("\n ↑ ");
89
+ });
90
+ }, text);
91
+ console.log(found.length ? found.join("\n\n") : `no element contains "${text}"`);
92
+} finally {
93
+ await browser.close();
94
+ server.close();
95
+}
.agents/skills/launch-video/scripts/new.sh
new
+20
@@ -0,0 +1,20 @@
1
+#!/usr/bin/env bash
2
+# Creates a launch-video working directory. Usage: new.sh <dir> [real|mock]
3
+# real (default): template/real.html, a story over frozen pages of the real app (beats/).
4
+# mock: template/story.html, a hand-built HTML mock of the app.
5
+set -euo pipefail
6
+dir=${1:?usage: new.sh <dir> [real|mock]}
7
+mode=${2:-real}
8
+skill=$(cd "$(dirname "$0")/.." && pwd)
9
+repo=$(cd "$skill/../../.." && pwd)
10
+if [ -e "$dir/story.html" ]; then echo "$dir/story.html already exists" >&2; exit 1; fi
11
+case "$mode" in
12
+ real) template=real.html ;;
13
+ mock) template=story.html ;;
14
+ *) echo "mode is real or mock" >&2; exit 2 ;;
15
+esac
16
+mkdir -p "$dir"
17
+cp "$skill/template/$template" "$dir/story.html"
18
+cp "$skill/assets/kit.js" "$skill/assets/inter.woff2" "$skill/assets/jbmono.woff2" "$dir/"
19
+cp "$repo/assets/prod/black-macos-1024.png" "$dir/logo-prod.png"
20
+echo "$dir is ready ($mode): edit $dir/story.html"
.agents/skills/launch-video/scripts/render.sh
new
+13
@@ -0,0 +1,13 @@
1
+#!/usr/bin/env bash
2
+# Renders <dir>/story.html to <dir>/<name>.mp4 (1920x1080, 30 fps) and <dir>/outro.png (its last frame).
3
+# Usage: render.sh <dir> [name]
4
+set -euo pipefail
5
+dir=$(cd "${1:?usage: render.sh <dir> [name]}" && pwd)
6
+name=${2:-video}
7
+here=$(cd "$(dirname "$0")" && pwd)
8
+node "$here/capture.mjs" "$dir/story.html" "$dir/frames"
9
+ffmpeg -hide_banner -loglevel error -y -reinit_filter 0 -framerate 30 -i "$dir/frames/f%04d.png" \
10
+ -c:v libx264 -preset slow -crf 16 -pix_fmt yuv420p -movflags +faststart "$dir/$name.mp4"
11
+cp "$(ls "$dir/frames"/f*.png | tail -1)" "$dir/outro.png"
12
+ffprobe -v error -show_entries format=duration:stream=width,height -of default=nw=1 "$dir/$name.mp4"
13
+echo "video -> $dir/$name.mp4, outro -> $dir/outro.png"
.agents/skills/launch-video/scripts/sheet.sh
new
+17
@@ -0,0 +1,17 @@
1
+#!/usr/bin/env bash
2
+# Captures frames at the given real-time seconds and tiles them into one contact sheet.
3
+# Usage: sheet.sh <dir> <seconds,...> [out.png] (frames land in <dir>/probe, sheet in <dir>/sheet.png)
4
+set -euo pipefail
5
+dir=$(cd "${1:?usage: sheet.sh <dir> <seconds,...> [out.png]}" && pwd)
6
+times=${2:?give comma-separated seconds, e.g. 1,4.5,9}
7
+out=${3:-$dir/sheet.png}
8
+here=$(cd "$(dirname "$0")" && pwd)
9
+rm -rf "$dir/probe"
10
+node "$here/capture.mjs" "$dir/story.html" "$dir/probe" --at "$times"
11
+n=$(ls "$dir/probe"/*.png | wc -l)
12
+cols=$(( n < 3 ? n : 3 )); rows=$(( (n + cols - 1) / cols ))
13
+# Chromium saves some frames as RGBA and others as RGB; without -reinit_filter 0 the
14
+# format change restarts the tile filter and the sheet silently loses frames.
15
+ffmpeg -hide_banner -loglevel error -y -reinit_filter 0 -pattern_type glob -i "$dir/probe/*.png" \
16
+ -vf "format=rgb24,scale=960:-1,tile=${cols}x${rows}:padding=8:color=0x333333" -frames:v 1 -update 1 "$out"
17
+echo "sheet -> $out ($n frames; full-size frames in $dir/probe)"
.agents/skills/launch-video/scripts/snapshot.mjs
new
+121
@@ -0,0 +1,121 @@
1
+// Freezes the live app page into a static HTML file that a story can load and animate.
2
+// saveBeat(page, dir, name): `page` is anything with Playwright's `evaluate`, such as a
3
+// scenario's `browser`. Writes <dir>/beats/<name>.html; fonts and images go to
4
+// <dir>/beats/assets, shared by every beat.
5
+import * as NodeFS from "node:fs";
6
+import * as NodePath from "node:path";
7
+
8
+// Runs in the page. Returns the frozen document and the assets it references.
9
+async function freeze(known) {
10
+ const hash = (s) => {
11
+ let h1 = 0xdeadbeef;
12
+ let h2 = 0x41c6ce57;
13
+ for (let i = 0; i < s.length; i++) {
14
+ const c = s.charCodeAt(i);
15
+ h1 = Math.imul(h1 ^ c, 2654435761);
16
+ h2 = Math.imul(h2 ^ c, 1597334677);
17
+ }
18
+ h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
19
+ h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
20
+ return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
21
+ };
22
+ const assets = {};
23
+ const local = (raw, base) => {
24
+ if (!raw || raw.startsWith("data:") || raw.startsWith("#")) return raw;
25
+ const url = new URL(raw, base).href;
26
+ const ext = (new URL(url).pathname.match(/\.[a-z0-9]{1,5}$/i) ?? [""])[0];
27
+ const name = `assets/${hash(url)}${ext}`;
28
+ assets[name] = url;
29
+ return name;
30
+ };
31
+ const urlPattern = /url\(\s*(['"]?)([^'")]+)\1\s*\)/g;
32
+ const rewrite = (css, base) => css.replace(urlPattern, (_, __, u) => `url("${local(u, base)}")`);
33
+
34
+ let css = "";
35
+ for (const sheet of [...document.styleSheets, ...document.adoptedStyleSheets]) {
36
+ let rules;
37
+ try {
38
+ rules = [...sheet.cssRules];
39
+ } catch {
40
+ continue;
41
+ }
42
+ css += rewrite(rules.map((r) => r.cssText).join("\n"), sheet.href ?? location.href) + "\n";
43
+ }
44
+
45
+ const source = [...document.documentElement.querySelectorAll("*")];
46
+ const clone = document.documentElement.cloneNode(true);
47
+ const copies = [...clone.querySelectorAll("*")];
48
+ source.forEach((el, i) => {
49
+ const copy = copies[i];
50
+ if (el.scrollTop || el.scrollLeft)
51
+ copy.setAttribute("data-kit-scroll", `${el.scrollLeft},${el.scrollTop}`);
52
+ if (el instanceof HTMLTextAreaElement) copy.textContent = el.value;
53
+ else if (el instanceof HTMLInputElement) {
54
+ // Hidden inputs carry ids and local paths nobody sees; keep them out of the beat.
55
+ if (el.type === "hidden" || el.getAttribute("aria-hidden") === "true") {
56
+ copy.removeAttribute("value");
57
+ return;
58
+ }
59
+ copy.setAttribute("value", el.value);
60
+ if (el.checked) copy.setAttribute("checked", "");
61
+ } else if (el instanceof HTMLImageElement) {
62
+ copy.removeAttribute("srcset");
63
+ copy.setAttribute("src", local(el.currentSrc || el.src, location.href));
64
+ } else if (el instanceof HTMLCanvasElement) {
65
+ const img = document.createElement("img");
66
+ for (const a of el.attributes) img.setAttribute(a.name, a.value);
67
+ try {
68
+ img.src = el.toDataURL();
69
+ } catch {}
70
+ img.style.width = `${el.clientWidth}px`;
71
+ img.style.height = `${el.clientHeight}px`;
72
+ copy.replaceWith(img);
73
+ } else if (el instanceof HTMLIFrameElement) {
74
+ const box = document.createElement("div");
75
+ for (const a of el.attributes)
76
+ if (a.name !== "src" && a.name !== "srcdoc") box.setAttribute(a.name, a.value);
77
+ box.setAttribute("data-kit-iframe", el.src);
78
+ copy.replaceWith(box);
79
+ }
80
+ const style = copy.getAttribute?.("style");
81
+ if (style?.includes("url(")) copy.setAttribute("style", rewrite(style, location.href));
82
+ });
83
+ for (const el of clone.querySelectorAll("script, noscript, style, link, base")) el.remove();
84
+
85
+ const head = clone.querySelector("head");
86
+ const styleEl = document.createElement("style");
87
+ styleEl.textContent = css;
88
+ head.append(styleEl);
89
+ const restore = document.createElement("script");
90
+ restore.textContent = `for (const el of document.querySelectorAll("[data-kit-scroll]")) { const [x, y] = el.dataset.kitScroll.split(",").map(Number); el.scrollLeft = x; el.scrollTop = y; }`;
91
+ clone.querySelector("body").append(restore);
92
+
93
+ const fetched = {};
94
+ for (const [name, url] of Object.entries(assets)) {
95
+ if (known.includes(name)) continue;
96
+ try {
97
+ const buf = new Uint8Array(await (await fetch(url)).arrayBuffer());
98
+ let bin = "";
99
+ for (let i = 0; i < buf.length; i += 0x8000)
100
+ bin += String.fromCharCode(...buf.subarray(i, i + 0x8000));
101
+ fetched[name] = btoa(bin);
102
+ } catch {}
103
+ }
104
+ return {
105
+ html: `<!doctype html>\n${clone.outerHTML}`,
106
+ assets: fetched,
107
+ viewport: { width: innerWidth, height: innerHeight },
108
+ };
109
+}
110
+
111
+export async function saveBeat(page, dir, name) {
112
+ const beats = NodePath.join(dir, "beats");
113
+ NodeFS.mkdirSync(NodePath.join(beats, "assets"), { recursive: true });
114
+ const known = NodeFS.readdirSync(NodePath.join(beats, "assets")).map((f) => `assets/${f}`);
115
+ const result = await page.evaluate(freeze, known);
116
+ for (const [file, base64] of Object.entries(result.assets)) {
117
+ NodeFS.writeFileSync(NodePath.join(beats, file), Buffer.from(base64, "base64"));
118
+ }
119
+ NodeFS.writeFileSync(NodePath.join(beats, `${name}.html`), result.html);
120
+ return result.viewport;
121
+}
.agents/skills/launch-video/scripts/stage-env.mjs
new
+283
@@ -0,0 +1,283 @@
1
+// Starts real T3 Code dev environments for staging a launch video: fresh homes, fictional
2
+// machine labels, the free replay agent, no paid provider. Import from a staging script.
3
+import * as NodeChildProcess from "node:child_process";
4
+import * as NodeCrypto from "node:crypto";
5
+import * as NodeFS from "node:fs";
6
+import * as NodeNet from "node:net";
7
+import * as NodePath from "node:path";
8
+import * as NodeURL from "node:url";
9
+
10
+export const REPO = NodePath.resolve(
11
+ NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)),
12
+ "../../../..",
13
+);
14
+const BASE_WEB_PORT = 5733; // dev-runner.ts BASE_WEB_PORT
15
+const REAL_PROVIDERS = [
16
+ "codex",
17
+ "claudeAgent",
18
+ "cursor",
19
+ "grok",
20
+ "muse",
21
+ "pi",
22
+ "opencode",
23
+ "antigravity",
24
+];
25
+
26
+export const freePort = () =>
27
+ new Promise((resolve) => {
28
+ const server = NodeNet.createServer().listen(0, "127.0.0.1", () => {
29
+ const { port } = server.address();
30
+ server.close(() => resolve(port));
31
+ });
32
+ });
33
+
34
+const FAKE_CLAUDE = NodePath.join(
35
+ NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)),
36
+ "fake-claude.mjs",
37
+);
38
+const NO_MODEL = `#!/bin/sh\necho 'staging runs no model' >&2\nexit 1\n`;
39
+
40
+// What the server and its CLI call this machine, instead of the real host's name and kind.
41
+const identityEnv = (home) => {
42
+ const { label, machine } = JSON.parse(
43
+ NodeFS.readFileSync(NodePath.join(home, "identity.json"), "utf8"),
44
+ );
45
+ return { T3CODE_ENVIRONMENT_LABEL: label, T3CODE_ENVIRONMENT_MACHINE_KIND: machine };
46
+};
47
+
48
+/**
49
+ * A fresh T3 home whose server calls itself `label` on a `machine`. `settings` merge into
50
+ * settings.json. With `claude` (scripted turns) the real Claude provider runs fake-claude.mjs
51
+ * and `model` is a Claude model id; without it `model` is a replay-agent scenario.
52
+ */
53
+export function prepareHome(home, { label, machine = "laptop", settings = {}, model, claude }) {
54
+ NodeFS.rmSync(home, { recursive: true, force: true });
55
+ NodeFS.mkdirSync(NodePath.join(home, "userdata"), { recursive: true });
56
+ NodeFS.mkdirSync(NodePath.join(home, "bin"));
57
+ NodeFS.mkdirSync(NodePath.join(home, "workspaces"));
58
+ NodeFS.writeFileSync(NodePath.join(home, "bin/no-model"), NO_MODEL, { mode: 0o755 });
59
+ NodeFS.writeFileSync(NodePath.join(home, "identity.json"), JSON.stringify({ label, machine }));
60
+ if (claude)
61
+ NodeFS.writeFileSync(NodePath.join(home, "claude-script.json"), JSON.stringify(claude));
62
+ NodeFS.writeFileSync(
63
+ NodePath.join(home, "userdata/settings.json"),
64
+ JSON.stringify({
65
+ defaultModelSelection: claude
66
+ ? { instanceId: "claudeAgent", model: model ?? "claude-opus-5-5" }
67
+ : { instanceId: "devReplay", model: model ?? "showcase" },
68
+ providerInstances: Object.fromEntries(
69
+ REAL_PROVIDERS.map((driver) => [
70
+ driver,
71
+ driver === "claudeAgent" && claude
72
+ ? { driver, enabled: true, config: { binaryPath: FAKE_CLAUDE } }
73
+ : {
74
+ driver,
75
+ enabled: false,
76
+ ...(driver === "codex"
77
+ ? { config: { binaryPath: NodePath.join(home, "bin/no-model") } }
78
+ : {}),
79
+ },
80
+ ]),
81
+ ),
82
+ ...settings,
83
+ }),
84
+ );
85
+}
86
+
87
+const children = [];
88
+process.on("exit", () => {
89
+ for (const child of children) child.kill("SIGTERM");
90
+});
91
+for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => process.exit(130));
92
+
93
+function spawn(args, env, log) {
94
+ const out = NodeFS.openSync(log, "a");
95
+ const child = NodeChildProcess.spawn(process.execPath, args, {
96
+ cwd: REPO,
97
+ env,
98
+ stdio: ["ignore", "pipe", out],
99
+ // Its own process group, so stopping it ends the dev runner's children too.
100
+ detached: true,
101
+ });
102
+ children.push({
103
+ kill: (s) => {
104
+ try {
105
+ process.kill(-child.pid, s);
106
+ } catch {}
107
+ },
108
+ });
109
+ return child;
110
+}
111
+
112
+/**
113
+ * Starts a dev server on `home` (and the web client when `web` is set). Resolves when it listens,
114
+ * with its origin, the web origin and the startup pairing URL.
115
+ */
116
+export async function startEnvironment(
117
+ home,
118
+ { host = "127.0.0.1", web = false, allowedOrigins = [], env = {} } = {},
119
+) {
120
+ const serverPort = await freePort();
121
+ const webPort = web ? await freePort() : await freePort();
122
+ const webOrigin = `http://127.0.0.1:${webPort}`;
123
+ const token = NodeCrypto.randomUUID().replaceAll("-", "").repeat(2);
124
+ const baseEnv = {
125
+ PATH: process.env.PATH,
126
+ HOME: process.env.HOME,
127
+ TMPDIR: process.env.TMPDIR ?? "/tmp",
128
+ ...identityEnv(home),
129
+ ...(NodeFS.existsSync(NodePath.join(home, "claude-script.json"))
130
+ ? {
131
+ FAKE_CLAUDE_SCRIPT: NodePath.join(home, "claude-script.json"),
132
+ FAKE_CLAUDE_LOG: NodePath.join(home, "fake-claude.log"),
133
+ }
134
+ : {}),
135
+ T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD: "0",
136
+ T3CODE_PORT_OFFSET: String(webPort - BASE_WEB_PORT),
137
+ ...env,
138
+ };
139
+ const runner = (mode, extra) => [
140
+ "scripts/dev-runner.ts",
141
+ mode,
142
+ "--home-dir",
143
+ home,
144
+ "--no-seed",
145
+ "--port",
146
+ String(serverPort),
147
+ "--dev-url",
148
+ webOrigin,
149
+ ...extra,
150
+ ];
151
+ const log = NodePath.join(home, "dev.log");
152
+ const server = spawn(
153
+ runner("dev:server", ["--host", host]),
154
+ {
155
+ ...baseEnv,
156
+ T3CODE_DEV_ALLOWED_ORIGINS: [webOrigin, ...allowedOrigins].join(","),
157
+ T3CODE_DEV_AUTH_TOKEN: token,
158
+ },
159
+ log,
160
+ );
161
+ const pairingUrl = await new Promise((resolve, reject) => {
162
+ let buffer = "";
163
+ server.stdout.on("data", (chunk) => {
164
+ buffer += chunk;
165
+ NodeFS.appendFileSync(
166
+ log,
167
+ String(chunk).replace(/pairingUrl:\s*\S+/g, "pairingUrl: <hidden>"),
168
+ );
169
+ const match = /pairingUrl:\s*(\S+)/.exec(buffer);
170
+ if (match) resolve(match[1]);
171
+ });
172
+ server.once("exit", (code) =>
173
+ reject(new Error(`server on ${home} exited ${code}; see ${log}`)),
174
+ );
175
+ });
176
+ if (web) {
177
+ spawn(runner("dev:web", ["--", "--host", "127.0.0.1"]), baseEnv, log);
178
+ for (let i = 0; ; i++) {
179
+ try {
180
+ if ((await fetch(`${webOrigin}/.well-known/t3/environment`)).ok) break;
181
+ } catch {}
182
+ if (i > 300) throw new Error(`web client for ${home} never answered; see ${log}`);
183
+ await new Promise((r) => setTimeout(r, 500));
184
+ }
185
+ }
186
+ const origin = `http://127.0.0.1:${serverPort}`;
187
+ const descriptor = await (await fetch(`${origin}/.well-known/t3/environment`)).json();
188
+ return {
189
+ home,
190
+ origin,
191
+ serverPort,
192
+ webOrigin,
193
+ pairingUrl,
194
+ environmentId: descriptor.environmentId,
195
+ label: descriptor.label,
196
+ };
197
+}
198
+
199
+/** Runs the server CLI against `home`. */
200
+export function cli(home, args) {
201
+ return NodeChildProcess.execFileSync(
202
+ process.execPath,
203
+ ["apps/server/src/bin.ts", ...args, "--base-dir", home],
204
+ {
205
+ cwd: REPO,
206
+ // The CLI names this environment itself (a link introduces it by label).
207
+ env: { PATH: process.env.PATH, HOME: process.env.HOME, ...identityEnv(home) },
208
+ encoding: "utf8",
209
+ },
210
+ );
211
+}
212
+
213
+/** A git repository under `home` registered as a project. Returns { projectId, workspace }. */
214
+export async function createProject(environment, title, files = { "README.md": "" }) {
215
+ const workspace = NodePath.join(environment.home, "workspaces", title);
216
+ for (const [file, content] of Object.entries(files)) {
217
+ NodeFS.mkdirSync(NodePath.dirname(NodePath.join(workspace, file)), { recursive: true });
218
+ NodeFS.writeFileSync(NodePath.join(workspace, file), content);
219
+ }
220
+ const git = (...args) => NodeChildProcess.execFileSync("git", args, { cwd: workspace });
221
+ git("init", "--quiet", "--initial-branch=main");
222
+ git("add", "--all");
223
+ git(
224
+ "-c",
225
+ "user.name=Staging",
226
+ "-c",
227
+ "user.email=staging@example.invalid",
228
+ "commit",
229
+ "--quiet",
230
+ "-m",
231
+ "Initial commit",
232
+ );
233
+ const bearer = cli(environment.home, [
234
+ "auth",
235
+ "session",
236
+ "issue",
237
+ "--token-only",
238
+ "--label",
239
+ "staging",
240
+ ]).trim();
241
+ const projectId = NodeCrypto.randomUUID();
242
+ const response = await fetch(`${environment.origin}/api/projects/mutate`, {
243
+ method: "POST",
244
+ headers: { authorization: `Bearer ${bearer}`, "content-type": "application/json" },
245
+ body: JSON.stringify({
246
+ type: "project.create",
247
+ commandId: NodeCrypto.randomUUID(),
248
+ projectId,
249
+ title,
250
+ workspaceRoot: workspace,
251
+ }),
252
+ });
253
+ if (!response.ok)
254
+ throw new Error(
255
+ `project.create on ${environment.label}: ${response.status} ${await response.text()}`,
256
+ );
257
+ return { projectId, workspace };
258
+}
259
+
260
+/** A Playwright page at the size beats are frozen at, dark, with production branding. */
261
+export async function openBrowser({ width = 1440, height = 720 } = {}) {
262
+ const { createRequire } = await import("node:module");
263
+ const { chromium } = createRequire(NodePath.join(REPO, "scripts/package.json"))(
264
+ "playwright-core",
265
+ );
266
+ const { findChrome } = await import("./chrome.mjs");
267
+ const browser = await chromium.launch({
268
+ executablePath: findChrome(chromium),
269
+ args: ["--no-sandbox"],
270
+ });
271
+ const context = await browser.newContext({ viewport: { width, height }, colorScheme: "dark" });
272
+ await context.addInitScript(() => {
273
+ // "none" is what a release build shows: no dev or nightly artwork.
274
+ if (!localStorage.getItem("t3code:client-settings:v1")) {
275
+ localStorage.setItem(
276
+ "t3code:client-settings:v1",
277
+ JSON.stringify({ environmentIdentificationMode: "none" }),
278
+ );
279
+ }
280
+ });
281
+ const page = await context.newPage();
282
+ return { browser, context, page };
283
+}
.agents/skills/launch-video/stagings/linked-environments/drive.mjs
new
+83
@@ -0,0 +1,83 @@
1
+// Drives the MacBook web client through the linked-environments story and freezes a beat at
2
+// each step into <out>/beats. Needs serve.mjs running. Usage: drive.mjs <out-dir>
3
+import * as NodeFS from "node:fs";
4
+import * as NodePath from "node:path";
5
+
6
+import { saveBeat } from "../../scripts/snapshot.mjs";
7
+import { openBrowser } from "../../scripts/stage-env.mjs";
8
+
9
+const out = NodePath.resolve(process.argv[2] ?? "");
10
+const stage = JSON.parse(NodeFS.readFileSync(NodePath.join(out, "stage.json"), "utf8"));
11
+NodeFS.rmSync(NodePath.join(out, "beats"), { recursive: true, force: true });
12
+NodeFS.mkdirSync(NodePath.join(out, "shots"), { recursive: true });
13
+
14
+const { browser, page } = await openBrowser();
15
+const started = Date.now();
16
+const beat = async (name) => {
17
+ // Park the pointer off the app so no hover state is frozen in.
18
+ await page.mouse.move(1439, 719);
19
+ await page.waitForTimeout(250);
20
+ await saveBeat(page, out, name);
21
+ await page.screenshot({ path: NodePath.join(out, "shots", `${name}.png`) });
22
+ console.log(`beat ${name} at ${((Date.now() - started) / 1000).toFixed(1)}s`);
23
+};
24
+
25
+try {
26
+ await page.goto(stage.macbook.pairingUrl);
27
+ await page.waitForURL((url) => !url.pathname.startsWith("/pair"), { timeout: 120_000 });
28
+ const composer = page.getByRole("textbox").first();
29
+ await composer.waitFor({ timeout: 120_000 });
30
+ await beat("ask-empty");
31
+
32
+ await composer.click();
33
+ await composer.pressSequentially("run the full e2e suite on devbox and tell me what breaks", {
34
+ delay: 10,
35
+ });
36
+ await beat("ask-typed");
37
+ await composer.press("Enter");
38
+
39
+ const row = page
40
+ .locator("main button, main a, main [role=button]")
41
+ .filter({ hasText: "E2E suite" })
42
+ .filter({ hasText: "on devbox" })
43
+ .last();
44
+ await row.waitFor({ timeout: 60_000 });
45
+ await page.getByText("I'll tell you what fails", { exact: false }).waitFor({ timeout: 60_000 });
46
+ await page.waitForTimeout(600);
47
+ await beat("delegated");
48
+
49
+ console.log(`click at ${((Date.now() - started) / 1000).toFixed(1)}s`);
50
+ await row.click();
51
+ // The devbox run streams for about 25 s: freeze it early, mid-run, and once it reports.
52
+ await page.waitForTimeout(1500);
53
+ await beat("watch-install");
54
+ await page.waitForTimeout(6000);
55
+ await beat("watch-e2e");
56
+ await page.waitForTimeout(6000);
57
+ await beat("watch-e2e-late");
58
+ await page.getByText("The other 142 passed", { exact: false }).waitFor({ timeout: 60_000 });
59
+ await page.waitForTimeout(800);
60
+ await beat("watch-done");
61
+
62
+ await page.getByRole("button", { name: "Connect to interact" }).click();
63
+ await page.waitForTimeout(150);
64
+ await beat("connecting");
65
+ const reply = page.getByRole("textbox").first();
66
+ await page.waitForFunction(() => !document.body.innerText.includes("Connect to interact"), null, {
67
+ timeout: 60_000,
68
+ });
69
+ await page.waitForTimeout(1500);
70
+ await beat("connected");
71
+
72
+ await reply.click();
73
+ await reply.pressSequentially("fix the coupon rounding and rerun checkout.spec", { delay: 10 });
74
+ await beat("reply-typed");
75
+ await reply.press("Enter");
76
+ await page.waitForTimeout(1500);
77
+ await beat("reply-sent");
78
+} catch (error) {
79
+ await page.screenshot({ path: NodePath.join(out, "shots", "failure.png") });
80
+ throw error;
81
+} finally {
82
+ await browser.close();
83
+}
.agents/skills/launch-video/stagings/linked-environments/serve.mjs
new
+159
@@ -0,0 +1,159 @@
1
+// Two linked environments for the linked-environments video: "MacBook" (server + web client,
2
+// what the viewer drives) and "devbox" (a second server it delegates to). Keeps running; writes
3
+// what drive.mjs needs to <out>/stage.json. Usage: serve.mjs <out-dir>
4
+import * as NodeChildProcess from "node:child_process";
5
+import * as NodeFS from "node:fs";
6
+import * as NodePath from "node:path";
7
+
8
+import {
9
+ REPO,
10
+ cli,
11
+ createProject,
12
+ prepareHome,
13
+ startEnvironment,
14
+} from "../../scripts/stage-env.mjs";
15
+
16
+const out = NodePath.resolve(process.argv[2] ?? "");
17
+if (!process.argv[2]) throw new Error("usage: serve.mjs <out-dir>");
18
+NodeFS.mkdirSync(out, { recursive: true });
19
+const root = NodePath.join(REPO, ".t3/launch/linked-environments");
20
+const vars = NodePath.join(root, "replay-vars.json");
21
+
22
+// A linked environment must be another machine: loopback is refused, and plain http is accepted
23
+// only on a tailnet name. Both servers run here, so devbox is reached at this machine's tailnet name.
24
+const tailnetName = JSON.parse(
25
+ NodeChildProcess.execFileSync("tailscale", ["status", "--json"], { encoding: "utf8" }),
26
+).Self.DNSName.replace(/\.$/, "");
27
+
28
+const linked = { linkedEnvironmentsEnabled: true };
29
+// Generated thread titles go through Claude too; answer them before any scripted turn can.
30
+const title = (text) => ({ match: "title", repeat: true, steps: [{ text }] });
31
+const E2E_OUTPUT = `Running 144 tests using 8 workers
32
+
33
+ ✘ checkout.spec.ts:42 › applies a coupon
34
+ Expected: "$18.00"
35
+ Received: "$20.00"
36
+ ✘ avatar.spec.ts:17 › crops on Safari
37
+ Test timeout of 30000ms exceeded.
38
+
39
+ 2 failed
40
+ 142 passed (1.9m)`;
41
+prepareHome(NodePath.join(root, "macbook"), {
42
+ label: "MacBook",
43
+ settings: linked,
44
+ claude: [
45
+ title("Run the e2e suite on devbox"),
46
+ {
47
+ match: "e2e suite on devbox",
48
+ steps: [
49
+ {
50
+ think:
51
+ "The full e2e suite is slow on a laptop. devbox is linked with full access, so I'll run it there.",
52
+ },
53
+ { text: "The full suite takes a while on this laptop, so I'll run it on devbox." },
54
+ {
55
+ tool: "delegate_task",
56
+ input: {
57
+ title: "E2E suite",
58
+ task: "Run the e2e suite on main and report each failing spec with its error.",
59
+ target: { environmentId: "<var:environmentId>", projectId: "<var:projectId>" },
60
+ },
61
+ },
62
+ { text: "Started **E2E suite** on devbox. I'll tell you what fails when it finishes." },
63
+ ],
64
+ },
65
+ {
66
+ steps: [
67
+ {
68
+ text: "The suite finished on devbox: 144 specs ran and 2 failed.\n\n- `checkout.spec.ts` applies a coupon: the 10% coupon is applied after tax, so it charges $20.00 instead of $18.00.\n- `avatar.spec.ts` crops on Safari: times out waiting for the crop preview.\n\nWant me to fix the coupon first?",
69
+ },
70
+ ],
71
+ },
72
+ ],
73
+});
74
+prepareHome(NodePath.join(root, "devbox"), {
75
+ label: "devbox",
76
+ machine: "cloud",
77
+ settings: linked,
78
+ claude: [
79
+ title("E2E suite"),
80
+ {
81
+ match: "e2e suite on main",
82
+ steps: [
83
+ { text: "Installing dependencies, then running all 144 specs on 8 workers." },
84
+ {
85
+ bash: "pnpm install --frozen-lockfile",
86
+ output: "Packages: +1243\nDone in 18.4s",
87
+ ms: 2500,
88
+ },
89
+ { bash: "pnpm build", output: "✓ built in 6.2s", ms: 2500 },
90
+ { bash: "pnpm test:e2e", output: E2E_OUTPUT, ms: 14000 },
91
+ {
92
+ text: "144 specs ran and 2 failed:\n\n- `checkout.spec.ts` applies a coupon: expected **$18.00**, got **$20.00**. The 10% coupon is applied after tax instead of before.\n- `avatar.spec.ts` crops on Safari: timed out after 30s waiting for the crop preview.\n\nThe other 142 passed.",
93
+ },
94
+ ],
95
+ },
96
+ {
97
+ match: "coupon",
98
+ steps: [
99
+ {
100
+ think:
101
+ "The discount is applied to the taxed total. It should come off the subtotal before tax.",
102
+ },
103
+ {
104
+ text: "The coupon is applied after tax in `applyCoupon`. Moving it before tax and rerunning the spec.",
105
+ },
106
+ {
107
+ bash: "pnpm test:e2e checkout.spec.ts",
108
+ output: " ✓ checkout.spec.ts:42 › applies a coupon\n\n 1 passed (6.1s)",
109
+ ms: 4000,
110
+ },
111
+ { text: "Fixed: the coupon now comes off the subtotal, and `checkout.spec.ts` passes." },
112
+ ],
113
+ },
114
+ ],
115
+});
116
+NodeFS.writeFileSync(vars, "{}");
117
+
118
+const macbook = await startEnvironment(NodePath.join(root, "macbook"), {
119
+ web: true,
120
+ env: { T3_DEV_REPLAY_VARS: vars },
121
+});
122
+console.log(`MacBook: ${macbook.label} ${macbook.environmentId} web ${macbook.webOrigin}`);
123
+const devbox = await startEnvironment(NodePath.join(root, "devbox"), {
124
+ host: "0.0.0.0",
125
+ allowedOrigins: [macbook.webOrigin],
126
+});
127
+console.log(`devbox: ${devbox.label} ${devbox.environmentId}`);
128
+
129
+const devboxProject = await createProject(devbox, "mugshot", { "README.md": "# mugshot\n" });
130
+const macbookProject = await createProject(macbook, "mugshot", { "README.md": "# mugshot\n" });
131
+
132
+const pairing = cli(devbox.home, ["pair", "--label", "MacBook"]);
133
+const code = /pairingToken[=:]\s*([A-Za-z0-9_-]+)|token=([A-Za-z0-9_-]+)/.exec(pairing);
134
+if (!code)
135
+ throw new Error(
136
+ `could not read a pairing code from:\n${pairing.replace(/[A-Za-z0-9_-]{20,}/g, "<redacted>")}`,
137
+ );
138
+console.log(
139
+ cli(macbook.home, [
140
+ "environment",
141
+ "link",
142
+ `http://${tailnetName}:${devbox.serverPort}`,
143
+ "--pairing-code",
144
+ code[1] ?? code[2],
145
+ "--access",
146
+ "full-access",
147
+ ]).trim(),
148
+);
149
+
150
+NodeFS.writeFileSync(
151
+ vars,
152
+ JSON.stringify({ environmentId: devbox.environmentId, projectId: devboxProject.projectId }),
153
+);
154
+NodeFS.writeFileSync(
155
+ NodePath.join(out, "stage.json"),
156
+ JSON.stringify({ macbook, devbox, macbookProject, devboxProject }, null, 2),
157
+);
158
+console.log(`ready: ${NodePath.join(out, "stage.json")}`);
159
+await new Promise(() => {});
.agents/skills/launch-video/stagings/linked-environments/story.html
new
+429
@@ -0,0 +1,429 @@
1
+<!doctype html>
2
+<html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <!--
6
+ Real-app story: each beat is a frozen page of the real app (beats/<name>.html, written by
7
+ snapshot.mjs from a staging scenario), stacked as iframes in .app. The app was frozen at a
8
+ 1440×720 viewport; .app scales it 1.0556× into the 1520×760 window, so a point (x, y) in a
9
+ beat is canvas (40 + 1.0556·x, 26 + 1.0556·y).
10
+ -->
11
+ <style>
12
+ @font-face {
13
+ font-family: Inter;
14
+ src: url(inter.woff2) format("woff2");
15
+ font-weight: 100 900;
16
+ }
17
+ @font-face {
18
+ font-family: JB;
19
+ src: url(jbmono.woff2) format("woff2");
20
+ font-weight: 100 800;
21
+ }
22
+ * {
23
+ box-sizing: border-box;
24
+ margin: 0;
25
+ }
26
+ :root {
27
+ --text: #f1f3f7;
28
+ --muted: #a3a3a3;
29
+ --dim: #636368;
30
+ }
31
+ html,
32
+ body {
33
+ width: 1600px;
34
+ height: 900px;
35
+ overflow: hidden;
36
+ background: #000;
37
+ font-family: Inter, sans-serif;
38
+ color: var(--text);
39
+ -webkit-font-smoothing: antialiased;
40
+ }
41
+ .canvas {
42
+ position: relative;
43
+ width: 1600px;
44
+ height: 900px;
45
+ overflow: hidden;
46
+ background:
47
+ radial-gradient(1000px 520px at 50% 0%, rgba(52, 107, 241, 0.13), transparent 70%), #000;
48
+ }
49
+ .cam {
50
+ position: absolute;
51
+ inset: 0;
52
+ transform-origin: 0 0;
53
+ }
54
+ .win {
55
+ position: absolute;
56
+ left: 40px;
57
+ top: 26px;
58
+ width: 1520px;
59
+ height: 760px;
60
+ border-radius: 14px;
61
+ overflow: hidden;
62
+ background: #000;
63
+ box-shadow:
64
+ 0 0 0 1px rgba(255, 255, 255, 0.1),
65
+ 0 40px 120px rgba(0, 0, 0, 0.8);
66
+ }
67
+ .app {
68
+ position: absolute;
69
+ left: 0;
70
+ top: 0;
71
+ width: 1440px;
72
+ height: 720px;
73
+ transform: scale(1.05556);
74
+ transform-origin: 0 0;
75
+ }
76
+ .app iframe {
77
+ position: absolute;
78
+ inset: 0;
79
+ width: 1440px;
80
+ height: 720px;
81
+ border: 0;
82
+ opacity: 0;
83
+ background: #000;
84
+ }
85
+ .cursor {
86
+ position: absolute;
87
+ left: 0;
88
+ top: 0;
89
+ z-index: 20;
90
+ transform-origin: 4px 3px;
91
+ filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
92
+ }
93
+ .shade {
94
+ position: absolute;
95
+ left: 0;
96
+ right: 0;
97
+ bottom: 0;
98
+ height: 190px;
99
+ background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.96) 42%);
100
+ z-index: 30;
101
+ }
102
+ .cap {
103
+ position: absolute;
104
+ left: 0;
105
+ right: 0;
106
+ top: 806px;
107
+ display: flex;
108
+ justify-content: center;
109
+ align-items: center;
110
+ gap: 16px;
111
+ font-size: 40px;
112
+ font-weight: 700;
113
+ letter-spacing: -0.025em;
114
+ z-index: 31;
115
+ opacity: 0;
116
+ }
117
+ .cap .n {
118
+ width: 50px;
119
+ height: 50px;
120
+ border-radius: 13px;
121
+ display: grid;
122
+ place-items: center;
123
+ font-family: JB;
124
+ font-size: 25px;
125
+ font-weight: 700;
126
+ background: #191a1d;
127
+ color: var(--text);
128
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
129
+ }
130
+ .cap .m {
131
+ color: var(--muted);
132
+ font-weight: 560;
133
+ }
134
+ .outro {
135
+ position: absolute;
136
+ inset: 0;
137
+ z-index: 50;
138
+ opacity: 0;
139
+ display: grid;
140
+ place-items: center;
141
+ text-align: center;
142
+ background:
143
+ radial-gradient(760px 460px at 50% 34%, rgba(52, 107, 241, 0.16), transparent 70%), #000;
144
+ }
145
+ .outro .logo {
146
+ width: 176px;
147
+ height: 176px;
148
+ display: block;
149
+ margin: 0 auto -10px;
150
+ filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.35))
151
+ drop-shadow(0 18px 60px rgba(52, 107, 241, 0.35));
152
+ }
153
+ .outro h2 {
154
+ margin-top: 44px;
155
+ font-size: 76px;
156
+ line-height: 1.02;
157
+ font-weight: 760;
158
+ letter-spacing: -0.045em;
159
+ }
160
+ .outro h2 .and {
161
+ color: var(--muted);
162
+ }
163
+ .outro p {
164
+ margin-top: 22px;
165
+ font-size: 34px;
166
+ color: var(--muted);
167
+ font-weight: 550;
168
+ letter-spacing: -0.02em;
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ gap: 14px;
173
+ }
174
+ .outro p b {
175
+ color: var(--text);
176
+ font-weight: 650;
177
+ }
178
+ .ver {
179
+ font-family: JB;
180
+ font-size: 22px;
181
+ font-weight: 600;
182
+ color: var(--text);
183
+ padding: 6px 13px;
184
+ border-radius: 10px;
185
+ background: rgba(255, 255, 255, 0.07);
186
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
187
+ }
188
+ .outro .url {
189
+ margin-top: 46px;
190
+ font-family: JB;
191
+ font-size: 22px;
192
+ color: var(--dim);
193
+ }
194
+ </style>
195
+ </head>
196
+ <body>
197
+ <div class="canvas">
198
+ <div class="cam">
199
+ <div class="win">
200
+ <div class="app">
201
+ <iframe data-beat="ask-empty" src="beats/ask-empty.html"></iframe>
202
+ <iframe data-beat="ask-typed" src="beats/ask-typed.html"></iframe>
203
+ <iframe data-beat="delegated" src="beats/delegated.html"></iframe>
204
+ <iframe data-beat="watch-install" src="beats/watch-install.html"></iframe>
205
+ <iframe data-beat="watch-e2e" src="beats/watch-e2e.html"></iframe>
206
+ <iframe data-beat="watch-e2e-late" src="beats/watch-e2e-late.html"></iframe>
207
+ <iframe data-beat="watch-done" src="beats/watch-done.html"></iframe>
208
+ <iframe data-beat="connected" src="beats/connected.html"></iframe>
209
+ <iframe data-beat="reply-typed" src="beats/reply-typed.html"></iframe>
210
+ <iframe data-beat="reply-sent" src="beats/reply-sent.html"></iframe>
211
+ </div>
212
+ </div>
213
+ <div class="cursor" id="cur">
214
+ <svg viewBox="0 0 24 24" width="26" height="26">
215
+ <path
216
+ d="M4 2.5 L4 19.5 L8.6 15.2 L11.6 21.6 L14.6 20.2 L11.7 14 L18 14 Z"
217
+ fill="#fff"
218
+ stroke="#000"
219
+ stroke-width="1.4"
220
+ stroke-linejoin="round"
221
+ />
222
+ </svg>
223
+ </div>
224
+ </div>
225
+ <div class="shade"></div>
226
+ <div class="cap" id="cap1">
227
+ <span class="n">1</span
228
+ ><span>Delegate to another machine <span class="m">and it runs there.</span></span>
229
+ </div>
230
+ <div class="cap" id="cap2">
231
+ <span class="n">2</span><span>Watch it live <span class="m">without pairing.</span></span>
232
+ </div>
233
+ <div class="cap" id="cap3">
234
+ <span class="n">3</span
235
+ ><span>Connect to interact <span class="m">in one click.</span></span>
236
+ </div>
237
+ </div>
238
+ <div class="outro">
239
+ <div>
240
+ <img class="logo" src="logo-prod.png" />
241
+ <h2>Linked environments<br /><span class="and">every machine, one app</span></h2>
242
+ <p>Available now in <b>T3 Code</b> <span class="ver">0.1.12</span></p>
243
+ <div class="url">t3.codes</div>
244
+ </div>
245
+ </div>
246
+ <!-- kit.js last: Kit.ready waits for the beat iframes above. -->
247
+ <script src="kit.js"></script>
248
+ <script>
249
+ // Everything here is in animation seconds. capture.mjs calls setup() once the beats have loaded.
250
+ const B = (name) => `iframe[data-beat="${name}"]`;
251
+ const cap = (id, from, to) =>
252
+ Kit.anim(
253
+ id,
254
+ [
255
+ { opacity: 0, transform: "translateY(14px)" },
256
+ { opacity: 1, transform: "none", offset: 0.06 },
257
+ { opacity: 1, transform: "none", offset: 0.94 },
258
+ { opacity: 0, transform: "translateY(-8px)" },
259
+ ],
260
+ { at: from, dur: to - from, ease: "linear" },
261
+ );
262
+
263
+ window.setup = () => {
264
+ Kit.beats([
265
+ ["ask-empty", 0],
266
+ ["ask-typed", 1.2],
267
+ ["delegated", 3.4],
268
+ ["watch-install", 6.75],
269
+ ["watch-e2e", 8.9],
270
+ ["watch-e2e-late", 10.2],
271
+ ["watch-done", 11.5],
272
+ ["connected", 15.05],
273
+ ["reply-typed", 17.0],
274
+ ["reply-sent", 18.6],
275
+ ]);
276
+ Kit.anim(
277
+ ".win",
278
+ [
279
+ { opacity: 0, transform: "translateY(40px) scale(.98)" },
280
+ { opacity: 1, transform: "none" },
281
+ ],
282
+ { at: 0, dur: 0.8 },
283
+ );
284
+
285
+ // 1. Ask, delegate
286
+ Kit.type("ask-typed >> [data-testid=composer-editor] p", 1.2, 1.7, 56);
287
+ Kit.press("ask-typed >> [data-chat-composer-form] button[type=submit]", 3.15);
288
+ Kit.pop("delegated >> [data-user-message-bubble]", 3.4, { origin: "right center" });
289
+ Kit.stagger("delegated >> [data-assistant-citation-source] p", 3.75, 0.25, "rise", {
290
+ y: 16,
291
+ });
292
+ Kit.pop("delegated >> button[data-v2-item-type=subagent]", 4.4, {
293
+ from: 0.8,
294
+ origin: "left center",
295
+ });
296
+ Kit.glow("delegated >> button[data-v2-item-type=subagent]", 4.7, 1.6);
297
+ cap("#cap1", 3.6, 7.4);
298
+
299
+ // 2. Open it read-only, watch it stream
300
+ Kit.slide("watch-install >> [data-workspace-area=panel]", 6.75, { x: 560, dur: 0.55 });
301
+ Kit.punch("watch-install >> button[data-v2-item-type=subagent]", 6.75, 1.04);
302
+ Kit.stagger(
303
+ "watch-done >> [data-workspace-area=panel] [data-assistant-citation-source] :is(p, li)",
304
+ 11.6,
305
+ 0.18,
306
+ "rise",
307
+ { y: 14 },
308
+ );
309
+ Kit.glow("watch-done >> [data-workspace-area=panel] [data-slot=composer-host]", 13.1, 1.4);
310
+ cap("#cap2", 7.6, 14.2);
311
+
312
+ // 3. Connect, reply
313
+ Kit.press(
314
+ "watch-done >> [data-workspace-area=panel] [data-slot=composer-host] button",
315
+ 14.75,
316
+ );
317
+ Kit.pop("connected >> [data-position=top-right] > *", 15.25, {
318
+ from: 0.7,
319
+ origin: "top right",
320
+ });
321
+ Kit.glow(
322
+ "connected >> nav[aria-label='Thread breadcrumb'] li span[data-slot=tooltip-trigger]",
323
+ 15.6,
324
+ 1.4,
325
+ );
326
+ Kit.type("reply-typed >> [data-testid^=composer-editor] p", 17.0, 1.3, 47);
327
+ Kit.pop("reply-sent >> [data-user-message-body]", 18.6, { origin: "right center" });
328
+ cap("#cap3", 14.4, 20.0);
329
+
330
+ // Outro
331
+ Kit.anim(".outro", [{ opacity: 0 }, { opacity: 1 }], { at: 20.1, dur: 0.5 });
332
+ Kit.stagger(".outro .logo, .outro h2, .outro p, .outro .url", 20.15, 0.08, "rise", {
333
+ y: 18,
334
+ });
335
+ };
336
+
337
+ window.layoutTime = 19.5;
338
+ window.placeCursor = () =>
339
+ Kit.measure(() => {
340
+ Kit.camera([
341
+ { t: 0, on: "full" },
342
+ { t: 0.7, on: "full" },
343
+ {
344
+ t: 1.15,
345
+ on: "ask-typed >> [data-chat-composer-form]",
346
+ s: 1.75,
347
+ ease: "cubic-bezier(.3,1.2,.4,1)",
348
+ },
349
+ { t: 3.2, on: "ask-typed >> [data-chat-composer-form]", s: 1.75 },
350
+ { t: 3.75, on: "delegated >> button[data-v2-item-type=subagent]", s: 1.65, y: 400 },
351
+ { t: 6.4, on: "delegated >> button[data-v2-item-type=subagent]", s: 1.65, y: 400 },
352
+ { t: 7.1, on: "watch-install >> [data-workspace-area=panel]", s: 1.6, y: 560 },
353
+ { t: 12.5, on: "watch-done >> [data-workspace-area=panel]", s: 1.6, y: 560 },
354
+ {
355
+ t: 13.1,
356
+ on: "watch-done >> [data-workspace-area=panel] [data-slot=composer-host]",
357
+ s: 1.55,
358
+ y: 520,
359
+ },
360
+ {
361
+ t: 15.0,
362
+ on: "watch-done >> [data-workspace-area=panel] [data-slot=composer-host]",
363
+ s: 1.55,
364
+ y: 520,
365
+ },
366
+ {
367
+ t: 15.4,
368
+ on: "connected >> [data-workspace-area=conversation]",
369
+ s: 1.3,
370
+ y: 470,
371
+ ease: "cubic-bezier(.2,.8,.2,1)",
372
+ },
373
+ { t: 16.7, on: "connected >> [data-workspace-area=conversation]", s: 1.3, y: 470 },
374
+ { t: 17.1, on: "reply-typed >> [data-chat-composer-form]", s: 1.6, y: 520 },
375
+ { t: 18.4, on: "reply-typed >> [data-chat-composer-form]", s: 1.6, y: 520 },
376
+ { t: 18.9, on: "reply-sent >> [data-user-message-body]", dx: -200, s: 1.5, y: 420 },
377
+ { t: 20.1, on: "reply-sent >> [data-user-message-body]", dx: -200, s: 1.5, y: 420 },
378
+ ]);
379
+ Kit.cursor("#cur", [
380
+ { t: 5.2, at: [1150, 700], hidden: true },
381
+ { t: 5.4 },
382
+ {
383
+ t: 6.4,
384
+ at: "delegated >> button[data-v2-item-type=subagent]",
385
+ dx: -120,
386
+ click: true,
387
+ },
388
+ { t: 7.0, hidden: true },
389
+ {
390
+ t: 13.4,
391
+ at: "watch-done >> [data-workspace-area=panel] [data-slot=composer-host]",
392
+ dx: -60,
393
+ hidden: true,
394
+ },
395
+ { t: 13.7 },
396
+ {
397
+ t: 14.6,
398
+ at: "watch-done >> [data-workspace-area=panel] [data-slot=composer-host] button",
399
+ click: true,
400
+ },
401
+ { t: 15.1 },
402
+ { t: 15.4, hidden: true },
403
+ { t: 20, hidden: true },
404
+ ]);
405
+ });
406
+ Kit.timeline([
407
+ [0.7, 0, 0.7],
408
+ [0.5, 0.7, 1.2],
409
+ [2.2, 1.2, 3.2],
410
+ [0.6, 3.2, 3.8],
411
+ [2.6, 3.8, 6.0],
412
+ [0.6, 6.0, 6.4],
413
+ [0.9, 6.4, 7.2],
414
+ [1.7, 7.2, 8.9],
415
+ [3.0, 8.9, 11.5],
416
+ [2.0, 11.5, 13.1],
417
+ [0.8, 13.1, 13.6],
418
+ [1.4, 13.6, 14.8],
419
+ [0.6, 14.8, 15.4],
420
+ [1.6, 15.4, 16.9],
421
+ [1.8, 16.9, 18.4],
422
+ [0.4, 18.4, 18.6],
423
+ [1.6, 18.6, 20.0],
424
+ [0.8, 20.0, 20.8],
425
+ [2.8, 20.8, 20.8],
426
+ ]);
427
+ </script>
428
+ </body>
429
+</html>
.agents/skills/launch-video/template/real.html
new
+263
@@ -0,0 +1,263 @@
1
+<!doctype html>
2
+<html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <!--
6
+ Real-app story: each beat is a frozen page of the real app (beats/<name>.html, written by
7
+ snapshot.mjs from a staging scenario), stacked as iframes in .app. The app was frozen at a
8
+ 1440×720 viewport; .app scales it 1.0556× into the 1520×760 window, so a point (x, y) in a
9
+ beat is canvas (40 + 1.0556·x, 26 + 1.0556·y).
10
+ -->
11
+ <style>
12
+ @font-face {
13
+ font-family: Inter;
14
+ src: url(inter.woff2) format("woff2");
15
+ font-weight: 100 900;
16
+ }
17
+ @font-face {
18
+ font-family: JB;
19
+ src: url(jbmono.woff2) format("woff2");
20
+ font-weight: 100 800;
21
+ }
22
+ * {
23
+ box-sizing: border-box;
24
+ margin: 0;
25
+ }
26
+ :root {
27
+ --text: #f1f3f7;
28
+ --muted: #a3a3a3;
29
+ --dim: #636368;
30
+ }
31
+ html,
32
+ body {
33
+ width: 1600px;
34
+ height: 900px;
35
+ overflow: hidden;
36
+ background: #000;
37
+ font-family: Inter, sans-serif;
38
+ color: var(--text);
39
+ -webkit-font-smoothing: antialiased;
40
+ }
41
+ .canvas {
42
+ position: relative;
43
+ width: 1600px;
44
+ height: 900px;
45
+ overflow: hidden;
46
+ background:
47
+ radial-gradient(1000px 520px at 50% 0%, rgba(52, 107, 241, 0.13), transparent 70%), #000;
48
+ }
49
+ .cam {
50
+ position: absolute;
51
+ inset: 0;
52
+ transform-origin: 0 0;
53
+ }
54
+ .win {
55
+ position: absolute;
56
+ left: 40px;
57
+ top: 26px;
58
+ width: 1520px;
59
+ height: 760px;
60
+ border-radius: 14px;
61
+ overflow: hidden;
62
+ background: #000;
63
+ box-shadow:
64
+ 0 0 0 1px rgba(255, 255, 255, 0.1),
65
+ 0 40px 120px rgba(0, 0, 0, 0.8);
66
+ }
67
+ .app {
68
+ position: absolute;
69
+ left: 0;
70
+ top: 0;
71
+ width: 1440px;
72
+ height: 720px;
73
+ transform: scale(1.05556);
74
+ transform-origin: 0 0;
75
+ }
76
+ .app iframe {
77
+ position: absolute;
78
+ inset: 0;
79
+ width: 1440px;
80
+ height: 720px;
81
+ border: 0;
82
+ opacity: 0;
83
+ background: #000;
84
+ }
85
+ .cursor {
86
+ position: absolute;
87
+ left: 0;
88
+ top: 0;
89
+ z-index: 20;
90
+ transform-origin: 4px 3px;
91
+ filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
92
+ }
93
+ .shade {
94
+ position: absolute;
95
+ left: 0;
96
+ right: 0;
97
+ bottom: 0;
98
+ height: 190px;
99
+ background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.96) 42%);
100
+ z-index: 30;
101
+ }
102
+ .cap {
103
+ position: absolute;
104
+ left: 0;
105
+ right: 0;
106
+ top: 806px;
107
+ display: flex;
108
+ justify-content: center;
109
+ align-items: center;
110
+ gap: 16px;
111
+ font-size: 40px;
112
+ font-weight: 700;
113
+ letter-spacing: -0.025em;
114
+ z-index: 31;
115
+ opacity: 0;
116
+ }
117
+ .cap .n {
118
+ width: 50px;
119
+ height: 50px;
120
+ border-radius: 13px;
121
+ display: grid;
122
+ place-items: center;
123
+ font-family: JB;
124
+ font-size: 25px;
125
+ font-weight: 700;
126
+ background: #191a1d;
127
+ color: var(--text);
128
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
129
+ }
130
+ .cap .m {
131
+ color: var(--muted);
132
+ font-weight: 560;
133
+ }
134
+ .outro {
135
+ position: absolute;
136
+ inset: 0;
137
+ z-index: 50;
138
+ opacity: 0;
139
+ display: grid;
140
+ place-items: center;
141
+ text-align: center;
142
+ background:
143
+ radial-gradient(760px 460px at 50% 34%, rgba(52, 107, 241, 0.16), transparent 70%), #000;
144
+ }
145
+ .outro .logo {
146
+ width: 176px;
147
+ height: 176px;
148
+ display: block;
149
+ margin: 0 auto -10px;
150
+ filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.35))
151
+ drop-shadow(0 18px 60px rgba(52, 107, 241, 0.35));
152
+ }
153
+ .outro h2 {
154
+ margin-top: 44px;
155
+ font-size: 76px;
156
+ line-height: 1.02;
157
+ font-weight: 760;
158
+ letter-spacing: -0.045em;
159
+ }
160
+ .outro h2 .and {
161
+ color: var(--muted);
162
+ }
163
+ .outro p {
164
+ margin-top: 22px;
165
+ font-size: 34px;
166
+ color: var(--muted);
167
+ font-weight: 550;
168
+ letter-spacing: -0.02em;
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ gap: 14px;
173
+ }
174
+ .outro p b {
175
+ color: var(--text);
176
+ font-weight: 650;
177
+ }
178
+ .ver {
179
+ font-family: JB;
180
+ font-size: 22px;
181
+ font-weight: 600;
182
+ color: var(--text);
183
+ padding: 6px 13px;
184
+ border-radius: 10px;
185
+ background: rgba(255, 255, 255, 0.07);
186
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
187
+ }
188
+ .outro .url {
189
+ margin-top: 46px;
190
+ font-family: JB;
191
+ font-size: 22px;
192
+ color: var(--dim);
193
+ }
194
+ </style>
195
+ </head>
196
+ <body>
197
+ <div class="canvas">
198
+ <div class="cam">
199
+ <div class="win">
200
+ <div class="app">
201
+ <!-- One iframe per beat, in order. -->
202
+ <iframe data-beat="BEAT_ONE" src="beats/BEAT_ONE.html"></iframe>
203
+ </div>
204
+ </div>
205
+ <div class="cursor" id="cur">
206
+ <svg viewBox="0 0 24 24" width="26" height="26">
207
+ <path
208
+ d="M4 2.5 L4 19.5 L8.6 15.2 L11.6 21.6 L14.6 20.2 L11.7 14 L18 14 Z"
209
+ fill="#fff"
210
+ stroke="#000"
211
+ stroke-width="1.4"
212
+ stroke-linejoin="round"
213
+ />
214
+ </svg>
215
+ </div>
216
+ </div>
217
+ <div class="shade"></div>
218
+ <div class="cap" id="cap1">
219
+ <span class="n">1</span><span>Lead phrase <span class="m">and the rest.</span></span>
220
+ </div>
221
+ </div>
222
+ <div class="outro">
223
+ <div>
224
+ <img class="logo" src="logo-prod.png" />
225
+ <h2>Feature name<br /><span class="and">second line</span></h2>
226
+ <p>Available now in <b>T3 Code</b> <span class="ver">0.0.0</span></p>
227
+ <div class="url">t3.codes</div>
228
+ </div>
229
+ </div>
230
+ <!-- kit.js last: Kit.ready waits for the beat iframes above. -->
231
+ <script src="kit.js"></script>
232
+ <script>
233
+ // Everything here is in animation seconds. capture.mjs calls setup() once the beats have loaded.
234
+ window.setup = () => {
235
+ Kit.show("iframe[data-beat=BEAT_ONE]", 0);
236
+ Kit.anim(
237
+ "#cap1",
238
+ [
239
+ { opacity: 0, transform: "translateY(10px)" },
240
+ { opacity: 1, transform: "none" },
241
+ ],
242
+ { at: 0.4, dur: 0.3 },
243
+ );
244
+ Kit.anim(".outro", [{ opacity: 0 }, { opacity: 1 }], { at: 6, dur: 0.5 });
245
+ Kit.stagger(".outro .logo, .outro h2, .outro p, .outro .url", 6.05, 0.08, "rise", {
246
+ y: 18,
247
+ });
248
+ };
249
+ window.layoutTime = 1;
250
+ window.placeCursor = () =>
251
+ Kit.measure(() =>
252
+ Kit.cursor("#cur", [
253
+ { t: 0, at: [900, 600], hidden: true },
254
+ { t: 6, hidden: true },
255
+ ]),
256
+ );
257
+ Kit.timeline([
258
+ [6, 0, 6],
259
+ [3, 6.6, 6.6],
260
+ ]);
261
+ </script>
262
+ </body>
263
+</html>
.agents/skills/launch-video/template/story.html
new
+2150
@@ -0,0 +1,2150 @@
1
+<!doctype html>
2
+<html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ @font-face {
7
+ font-family: Inter;
8
+ src: url(inter.woff2) format("woff2");
9
+ font-weight: 100 900;
10
+ }
11
+ @font-face {
12
+ font-family: JB;
13
+ src: url(jbmono.woff2) format("woff2");
14
+ font-weight: 100 800;
15
+ }
16
+ * {
17
+ box-sizing: border-box;
18
+ margin: 0;
19
+ }
20
+ :root {
21
+ --primary: #346bf1;
22
+ --primary2: #6e9bfb;
23
+ --text: #f1f3f7;
24
+ --muted: #8e8e93;
25
+ --dim: #636368;
26
+ --line: #1d1d20;
27
+ --pop: #0f0f10;
28
+ --orange: #f07a4a;
29
+ --orange2: #ffa27c;
30
+ --blue: #4f8cff;
31
+ --blue2: #8ab4ff;
32
+ --green: #4ade80;
33
+ --teal: #5ccfa3;
34
+ }
35
+ html,
36
+ body {
37
+ width: 1600px;
38
+ height: 900px;
39
+ overflow: hidden;
40
+ background: #000;
41
+ font-family: Inter, sans-serif;
42
+ color: var(--text);
43
+ -webkit-font-smoothing: antialiased;
44
+ }
45
+ .canvas {
46
+ position: relative;
47
+ width: 1600px;
48
+ height: 900px;
49
+ overflow: hidden;
50
+ background:
51
+ radial-gradient(1000px 520px at 50% 0%, rgba(52, 107, 241, 0.13), transparent 70%), #000;
52
+ }
53
+ svg.i {
54
+ width: 1em;
55
+ height: 1em;
56
+ stroke: currentColor;
57
+ fill: none;
58
+ stroke-width: 1.8;
59
+ stroke-linecap: round;
60
+ stroke-linejoin: round;
61
+ flex: none;
62
+ }
63
+ .abs {
64
+ position: absolute;
65
+ }
66
+
67
+ .win {
68
+ position: absolute;
69
+ left: 40px;
70
+ top: 26px;
71
+ width: 1520px;
72
+ height: 760px;
73
+ border-radius: 14px;
74
+ overflow: hidden;
75
+ background: #000;
76
+ box-shadow:
77
+ 0 0 0 1px rgba(255, 255, 255, 0.12),
78
+ 0 40px 120px rgba(0, 0, 0, 0.7);
79
+ }
80
+ .stage {
81
+ position: absolute;
82
+ left: 0;
83
+ top: 0;
84
+ width: 2000px;
85
+ height: 1000px;
86
+ transform: scale(0.76);
87
+ transform-origin: 0 0;
88
+ font-size: 19px;
89
+ }
90
+
91
+ /* sidebar */
92
+ .side {
93
+ position: absolute;
94
+ left: 0;
95
+ top: 0;
96
+ bottom: 0;
97
+ width: 360px;
98
+ background: #070707;
99
+ border-right: 1px solid var(--line);
100
+ }
101
+ .lights {
102
+ position: absolute;
103
+ left: 22px;
104
+ top: 26px;
105
+ display: flex;
106
+ gap: 13px;
107
+ }
108
+ .lights b {
109
+ width: 18px;
110
+ height: 18px;
111
+ border-radius: 99px;
112
+ background: #ff5f57;
113
+ }
114
+ .lights b:nth-child(2) {
115
+ background: #febc2e;
116
+ }
117
+ .lights b:nth-child(3) {
118
+ background: #28c840;
119
+ }
120
+ .tb-icons {
121
+ position: absolute;
122
+ top: 25px;
123
+ color: var(--muted);
124
+ font-size: 21px;
125
+ }
126
+ .brandt {
127
+ position: absolute;
128
+ left: 177px;
129
+ top: 22px;
130
+ font-size: 19.5px;
131
+ }
132
+ .brandt b {
133
+ font-weight: 650;
134
+ }
135
+ .search {
136
+ position: absolute;
137
+ left: 22px;
138
+ top: 92px;
139
+ right: 18px;
140
+ display: flex;
141
+ align-items: center;
142
+ gap: 12px;
143
+ color: var(--muted);
144
+ }
145
+ .search .sp {
146
+ margin-left: auto;
147
+ display: flex;
148
+ gap: 18px;
149
+ font-size: 20px;
150
+ }
151
+ .threads {
152
+ position: absolute;
153
+ left: 10px;
154
+ right: 10px;
155
+ top: 146px;
156
+ }
157
+ .th {
158
+ padding: 10px 14px 12px;
159
+ border-radius: 12px;
160
+ height: 113px;
161
+ }
162
+ .th.on {
163
+ background: #161618;
164
+ }
165
+ .th .l1 {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: 9px;
169
+ font-size: 16.5px;
170
+ color: var(--muted);
171
+ }
172
+ .th .l1 .t {
173
+ margin-left: auto;
174
+ }
175
+ .pav {
176
+ width: 22px;
177
+ height: 22px;
178
+ border-radius: 6px;
179
+ display: grid;
180
+ place-items: center;
181
+ font-size: 10.5px;
182
+ font-weight: 700;
183
+ color: #fff;
184
+ }
185
+ .th .l2 {
186
+ margin-top: 6px;
187
+ font-size: 19px;
188
+ white-space: nowrap;
189
+ overflow: hidden;
190
+ text-overflow: ellipsis;
191
+ }
192
+ .th .l3 {
193
+ margin-top: 6px;
194
+ display: flex;
195
+ align-items: center;
196
+ gap: 8px;
197
+ font-size: 16px;
198
+ color: var(--muted);
199
+ }
200
+ .th .l3 .r {
201
+ margin-left: auto;
202
+ display: flex;
203
+ gap: 9px;
204
+ align-items: center;
205
+ }
206
+ .ast {
207
+ color: var(--orange);
208
+ font-size: 18px;
209
+ line-height: 1;
210
+ }
211
+ .pr {
212
+ color: var(--teal);
213
+ display: inline-flex;
214
+ align-items: center;
215
+ gap: 4px;
216
+ }
217
+ .sidefoot {
218
+ position: absolute;
219
+ left: 24px;
220
+ bottom: 26px;
221
+ display: flex;
222
+ gap: 30px;
223
+ color: var(--muted);
224
+ font-size: 21px;
225
+ }
226
+
227
+ /* main header */
228
+ .mhead {
229
+ position: absolute;
230
+ left: 362px;
231
+ top: 0;
232
+ width: 698px;
233
+ height: 70px;
234
+ display: flex;
235
+ align-items: center;
236
+ gap: 10px;
237
+ padding-left: 26px;
238
+ }
239
+ .mhead .muted {
240
+ color: var(--muted);
241
+ }
242
+ .mhead .tt {
243
+ font-weight: 500;
244
+ }
245
+ .dtoggle {
246
+ position: absolute;
247
+ left: 1003px;
248
+ top: 16px;
249
+ width: 38px;
250
+ height: 38px;
251
+ border-radius: 9px;
252
+ background: #1a1a1c;
253
+ display: grid;
254
+ place-items: center;
255
+ color: #d0d0d4;
256
+ font-size: 21px;
257
+ }
258
+
259
+ /* chat */
260
+ .chat {
261
+ position: absolute;
262
+ left: 433px;
263
+ top: 92px;
264
+ width: 560px;
265
+ line-height: 1.62;
266
+ }
267
+ .bubble {
268
+ margin-left: auto;
269
+ width: fit-content;
270
+ max-width: 400px;
271
+ background: #1d1d1f;
272
+ padding: 14px 19px;
273
+ border-radius: 20px;
274
+ line-height: 1.55;
275
+ }
276
+ .mut {
277
+ color: var(--muted);
278
+ }
279
+ .row {
280
+ display: flex;
281
+ align-items: center;
282
+ gap: 12px;
283
+ color: var(--muted);
284
+ }
285
+ .row .w {
286
+ color: var(--text);
287
+ }
288
+ code {
289
+ font-family: JB;
290
+ font-size: 16.5px;
291
+ background: #1a1a1c;
292
+ padding: 2px 7px;
293
+ border-radius: 6px;
294
+ color: var(--text);
295
+ }
296
+ .swap {
297
+ position: relative;
298
+ height: 31px;
299
+ }
300
+ .swap > * {
301
+ position: absolute;
302
+ left: 0;
303
+ top: 0;
304
+ white-space: nowrap;
305
+ }
306
+ .composer {
307
+ position: absolute;
308
+ left: 428px;
309
+ top: 832px;
310
+ width: 564px;
311
+ height: 148px;
312
+ border-radius: 22px;
313
+ background: #0e0e0f;
314
+ box-shadow: inset 0 0 0 1.5px #232326;
315
+ }
316
+ .composer .ph {
317
+ position: absolute;
318
+ left: 22px;
319
+ top: 22px;
320
+ color: #7c7c82;
321
+ }
322
+ .composer .typing {
323
+ position: absolute;
324
+ left: 22px;
325
+ top: 22px;
326
+ right: 22px;
327
+ }
328
+ .composer .ft {
329
+ position: absolute;
330
+ left: 20px;
331
+ right: 14px;
332
+ bottom: 14px;
333
+ height: 44px;
334
+ display: flex;
335
+ align-items: center;
336
+ gap: 22px;
337
+ color: var(--muted);
338
+ }
339
+ .composer .model {
340
+ margin-left: auto;
341
+ display: flex;
342
+ align-items: center;
343
+ gap: 8px;
344
+ color: var(--text);
345
+ }
346
+ .composer .send {
347
+ width: 44px;
348
+ height: 44px;
349
+ border-radius: 99px;
350
+ background: #e9e9ec;
351
+ color: #000;
352
+ display: grid;
353
+ place-items: center;
354
+ font-size: 21px;
355
+ position: relative;
356
+ }
357
+ .composer .send .stop {
358
+ position: absolute;
359
+ inset: 0;
360
+ border-radius: 99px;
361
+ background: #e5484d;
362
+ display: grid;
363
+ place-items: center;
364
+ }
365
+ .composer .send .stop b {
366
+ width: 13px;
367
+ height: 13px;
368
+ border-radius: 3px;
369
+ background: #fff;
370
+ }
371
+ .reveal {
372
+ display: inline-block;
373
+ white-space: nowrap;
374
+ }
375
+
376
+ /* popover */
377
+ .pop {
378
+ position: absolute;
379
+ left: 660px;
380
+ top: 82px;
381
+ width: 381px;
382
+ border-radius: 22px;
383
+ background: var(--pop);
384
+ box-shadow:
385
+ 0 0 0 1px #2a2a2d,
386
+ 0 30px 80px rgba(0, 0, 0, 0.7);
387
+ padding: 12px 0 10px;
388
+ transform-origin: 92% 0;
389
+ z-index: 5;
390
+ }
391
+ .prow {
392
+ position: relative;
393
+ display: flex;
394
+ align-items: center;
395
+ height: 44px;
396
+ padding: 0 26px 0 37px;
397
+ gap: 14px;
398
+ }
399
+ .prow .ic {
400
+ color: var(--muted);
401
+ font-size: 20px;
402
+ }
403
+ .prow .end {
404
+ margin-left: auto;
405
+ color: var(--muted);
406
+ }
407
+ .psep {
408
+ height: 1px;
409
+ background: #1f1f22;
410
+ margin: 10px 0;
411
+ }
412
+ .plabel {
413
+ font-size: 15.5px;
414
+ color: var(--muted);
415
+ padding: 10px 26px 6px;
416
+ }
417
+ .srv {
418
+ position: relative;
419
+ height: 66px;
420
+ display: flex;
421
+ align-items: center;
422
+ padding: 0 20px 0 37px;
423
+ gap: 14px;
424
+ overflow: visible;
425
+ }
426
+ .srv .ic {
427
+ color: var(--muted);
428
+ font-size: 21px;
429
+ }
430
+ .srv .t {
431
+ font-size: 19px;
432
+ }
433
+ .srv .s {
434
+ position: relative;
435
+ height: 22px;
436
+ font-size: 15.5px;
437
+ color: var(--muted);
438
+ margin-top: 2px;
439
+ }
440
+ .srv .s span {
441
+ position: absolute;
442
+ left: 0;
443
+ top: 0;
444
+ white-space: nowrap;
445
+ }
446
+ .srv .s .fw {
447
+ color: var(--primary2);
448
+ }
449
+ .srv .hl {
450
+ position: absolute;
451
+ left: 10px;
452
+ right: 10px;
453
+ top: 2px;
454
+ bottom: 2px;
455
+ border-radius: 12px;
456
+ background: #1b1b1d;
457
+ opacity: 0;
458
+ }
459
+ .srv .acts {
460
+ position: absolute;
461
+ right: 22px;
462
+ top: 15px;
463
+ display: flex;
464
+ gap: 12px;
465
+ align-items: center;
466
+ opacity: 0;
467
+ }
468
+ .fwd {
469
+ width: 36px;
470
+ height: 36px;
471
+ border-radius: 9px;
472
+ display: grid;
473
+ place-items: center;
474
+ font-size: 19px;
475
+ color: var(--text);
476
+ background: #2a2a2d;
477
+ }
478
+ .stopsq {
479
+ width: 14px;
480
+ height: 14px;
481
+ border-radius: 3px;
482
+ background: #e5484d;
483
+ }
484
+ .tip {
485
+ position: absolute;
486
+ right: 50px;
487
+ top: 15px;
488
+ transform-origin: right center;
489
+ background: #0b0b0c;
490
+ color: var(--text);
491
+ font-size: 15.5px;
492
+ padding: 8px 12px;
493
+ border-radius: 9px;
494
+ box-shadow:
495
+ 0 0 0 1px #2c2c30,
496
+ 0 10px 30px rgba(0, 0, 0, 0.6);
497
+ white-space: nowrap;
498
+ opacity: 0;
499
+ z-index: 6;
500
+ }
501
+
502
+ /* browser */
503
+ .bpanel {
504
+ position: absolute;
505
+ left: 1060px;
506
+ top: 0;
507
+ right: 0;
508
+ bottom: 0;
509
+ border-left: 1px solid var(--line);
510
+ }
511
+ .tabs {
512
+ position: absolute;
513
+ left: 14px;
514
+ top: 16px;
515
+ height: 38px;
516
+ display: flex;
517
+ gap: 6px;
518
+ }
519
+ .tab {
520
+ position: relative;
521
+ display: flex;
522
+ align-items: center;
523
+ gap: 9px;
524
+ height: 38px;
525
+ padding: 0 14px;
526
+ border-radius: 9px;
527
+ background: #19191b;
528
+ font-size: 17px;
529
+ color: #d6d6da;
530
+ min-width: 210px;
531
+ }
532
+ .tab .x {
533
+ margin-left: auto;
534
+ color: var(--dim);
535
+ font-size: 15px;
536
+ }
537
+ .tab .alt {
538
+ position: absolute;
539
+ left: 14px;
540
+ top: 0;
541
+ height: 38px;
542
+ display: flex;
543
+ align-items: center;
544
+ gap: 9px;
545
+ }
546
+ .brr {
547
+ position: absolute;
548
+ right: 18px;
549
+ top: 18px;
550
+ display: flex;
551
+ gap: 20px;
552
+ color: var(--muted);
553
+ font-size: 21px;
554
+ align-items: center;
555
+ }
556
+ .brr .on {
557
+ background: #1a1a1c;
558
+ border-radius: 9px;
559
+ padding: 8px;
560
+ margin: -8px;
561
+ color: #d0d0d4;
562
+ }
563
+ .urlrow {
564
+ position: absolute;
565
+ left: 0;
566
+ right: 0;
567
+ top: 70px;
568
+ height: 40px;
569
+ display: flex;
570
+ align-items: center;
571
+ padding: 0 18px;
572
+ gap: 18px;
573
+ color: var(--muted);
574
+ font-size: 19px;
575
+ }
576
+ .urlrow .u {
577
+ position: relative;
578
+ flex: 1;
579
+ color: var(--text);
580
+ height: 26px;
581
+ }
582
+ .urlrow .u > span {
583
+ position: absolute;
584
+ left: 0;
585
+ top: 0;
586
+ white-space: nowrap;
587
+ }
588
+ .urlrow .u .ph {
589
+ color: var(--dim);
590
+ }
591
+ .urlrow .rr {
592
+ display: flex;
593
+ gap: 20px;
594
+ }
595
+ .lbar {
596
+ position: absolute;
597
+ left: 0;
598
+ top: 116px;
599
+ height: 3px;
600
+ background: var(--primary);
601
+ width: 0;
602
+ }
603
+ .bblank {
604
+ position: absolute;
605
+ left: 0;
606
+ right: 0;
607
+ top: 120px;
608
+ bottom: 0;
609
+ display: grid;
610
+ place-items: center;
611
+ color: var(--dim);
612
+ font-size: 17px;
613
+ text-align: center;
614
+ }
615
+ .page {
616
+ position: absolute;
617
+ left: 0;
618
+ right: 0;
619
+ top: 120px;
620
+ bottom: 0;
621
+ background: #f6f4ef;
622
+ color: #1c1b18;
623
+ padding: 40px 48px;
624
+ opacity: 0;
625
+ }
626
+ .page .nav {
627
+ display: flex;
628
+ align-items: center;
629
+ gap: 12px;
630
+ font-weight: 720;
631
+ font-size: 21px;
632
+ }
633
+ .page .nav .logo {
634
+ width: 30px;
635
+ height: 30px;
636
+ border-radius: 9px;
637
+ background: #1c1b18;
638
+ }
639
+ .page .nav .r {
640
+ margin-left: auto;
641
+ font-size: 16px;
642
+ font-weight: 500;
643
+ color: #8a857b;
644
+ }
645
+ .page h3 {
646
+ margin-top: 40px;
647
+ font-size: 44px;
648
+ letter-spacing: -0.035em;
649
+ font-weight: 750;
650
+ }
651
+ .stats {
652
+ margin-top: 24px;
653
+ display: flex;
654
+ gap: 18px;
655
+ }
656
+ .stat {
657
+ flex: 1;
658
+ background: white;
659
+ border-radius: 18px;
660
+ padding: 22px 24px;
661
+ box-shadow: 0 0 0 1px #e8e3d9;
662
+ }
663
+ .stat .k {
664
+ font-size: 16px;
665
+ color: #8a857b;
666
+ font-weight: 550;
667
+ }
668
+ .stat .v {
669
+ margin-top: 8px;
670
+ font-size: 42px;
671
+ font-weight: 750;
672
+ letter-spacing: -0.03em;
673
+ }
674
+ .stat .v small {
675
+ font-size: 17px;
676
+ color: #2f9e5b;
677
+ font-weight: 600;
678
+ margin-left: 8px;
679
+ letter-spacing: 0;
680
+ }
681
+ .table {
682
+ margin-top: 20px;
683
+ background: white;
684
+ border-radius: 18px;
685
+ box-shadow: 0 0 0 1px #e8e3d9;
686
+ font-size: 17.5px;
687
+ overflow: hidden;
688
+ }
689
+ .table div {
690
+ display: flex;
691
+ padding: 15px 24px;
692
+ border-top: 1px solid #f0ece4;
693
+ }
694
+ .table div:first-child {
695
+ border-top: 0;
696
+ color: #8a857b;
697
+ font-size: 15px;
698
+ font-weight: 600;
699
+ }
700
+ .table span:nth-child(1) {
701
+ width: 210px;
702
+ font-weight: 550;
703
+ }
704
+ .table span:nth-child(2) {
705
+ flex: 1;
706
+ color: #6c685f;
707
+ }
708
+ .table span:nth-child(3) {
709
+ color: #8a857b;
710
+ font-family: JB;
711
+ font-size: 15px;
712
+ }
713
+
714
+ .toast {
715
+ position: absolute;
716
+ right: 26px;
717
+ bottom: 26px;
718
+ width: 470px;
719
+ display: flex;
720
+ gap: 14px;
721
+ padding: 20px 22px;
722
+ border-radius: 18px;
723
+ background: #141416;
724
+ box-shadow:
725
+ 0 0 0 1px #2a2a2d,
726
+ 0 24px 60px rgba(0, 0, 0, 0.6);
727
+ z-index: 8;
728
+ opacity: 0;
729
+ }
730
+ .toast .ok {
731
+ width: 28px;
732
+ height: 28px;
733
+ border-radius: 99px;
734
+ background: #1f3d2a;
735
+ color: var(--green);
736
+ display: grid;
737
+ place-items: center;
738
+ font-size: 16px;
739
+ flex: none;
740
+ }
741
+ .toast .tt {
742
+ font-weight: 600;
743
+ }
744
+ .toast .td {
745
+ margin-top: 4px;
746
+ font-size: 17px;
747
+ color: var(--muted);
748
+ }
749
+ .toast code {
750
+ font-size: 15px;
751
+ }
752
+
753
+ /* local database client */
754
+ .db {
755
+ position: absolute;
756
+ left: 110px;
757
+ top: 300px;
758
+ width: 760px;
759
+ height: 420px;
760
+ border-radius: 13px;
761
+ overflow: hidden;
762
+ background: #161618;
763
+ box-shadow:
764
+ 0 0 0 1px rgba(255, 255, 255, 0.16),
765
+ 0 40px 100px rgba(0, 0, 0, 0.8);
766
+ z-index: 6;
767
+ opacity: 0;
768
+ font-size: 14px;
769
+ }
770
+ .dtb {
771
+ height: 40px;
772
+ display: flex;
773
+ align-items: center;
774
+ padding: 0 14px;
775
+ gap: 8px;
776
+ background: #222225;
777
+ border-bottom: 1px solid #2c2c30;
778
+ font-size: 13.5px;
779
+ color: #d5d5da;
780
+ }
781
+ .dtb .name {
782
+ flex: 1;
783
+ text-align: center;
784
+ margin-right: 96px;
785
+ font-weight: 600;
786
+ }
787
+ .lights2 {
788
+ display: flex;
789
+ gap: 8px;
790
+ }
791
+ .lights2 b {
792
+ width: 12px;
793
+ height: 12px;
794
+ border-radius: 99px;
795
+ background: #ff5f57;
796
+ }
797
+ .lights2 b:nth-child(2) {
798
+ background: #febc2e;
799
+ }
800
+ .lights2 b:nth-child(3) {
801
+ background: #28c840;
802
+ }
803
+ .dbody {
804
+ position: absolute;
805
+ inset: 40px 0 0 0;
806
+ display: flex;
807
+ }
808
+ .dside {
809
+ width: 170px;
810
+ background: #1b1b1d;
811
+ border-right: 1px solid #2a2a2e;
812
+ padding: 12px 8px;
813
+ }
814
+ .dh {
815
+ font-size: 11.5px;
816
+ font-weight: 600;
817
+ letter-spacing: 0.06em;
818
+ text-transform: uppercase;
819
+ color: #77777d;
820
+ padding: 2px 8px 8px;
821
+ }
822
+ .dt {
823
+ display: flex;
824
+ align-items: center;
825
+ gap: 8px;
826
+ padding: 6px 8px;
827
+ border-radius: 7px;
828
+ color: #c8c8cd;
829
+ font-family: JB;
830
+ font-size: 13.5px;
831
+ }
832
+ .dt svg {
833
+ color: #77777d;
834
+ }
835
+ .dt.on {
836
+ background: #2d4fa8;
837
+ color: #fff;
838
+ }
839
+ .dt.on svg {
840
+ color: #cfe0ff;
841
+ }
842
+ .dmain {
843
+ flex: 1;
844
+ display: flex;
845
+ flex-direction: column;
846
+ }
847
+ .dbar {
848
+ height: 42px;
849
+ display: flex;
850
+ align-items: center;
851
+ gap: 10px;
852
+ padding: 0 14px;
853
+ border-bottom: 1px solid #2a2a2e;
854
+ }
855
+ .pill {
856
+ font-family: JB;
857
+ font-size: 13px;
858
+ background: #2a2a2e;
859
+ padding: 4px 10px;
860
+ border-radius: 7px;
861
+ }
862
+ .mutd {
863
+ color: #85858b;
864
+ font-size: 13px;
865
+ }
866
+ .grid {
867
+ font-family: JB;
868
+ font-size: 13.5px;
869
+ }
870
+ .gr {
871
+ display: grid;
872
+ grid-template-columns: 70px 140px 1fr 160px;
873
+ padding: 0 14px;
874
+ height: 38px;
875
+ align-items: center;
876
+ border-bottom: 1px solid #222226;
877
+ color: #dcdce0;
878
+ }
879
+ .gr:nth-child(odd):not(.gh) {
880
+ background: #1a1a1c;
881
+ }
882
+ .gh {
883
+ color: #85858b;
884
+ font-size: 12.5px;
885
+ height: 34px;
886
+ background: #1d1d20;
887
+ }
888
+ .sheet {
889
+ position: absolute;
890
+ left: 50%;
891
+ top: 22px;
892
+ width: 380px;
893
+ margin-left: -190px;
894
+ background: #232326;
895
+ border-radius: 12px;
896
+ padding: 20px 22px 18px;
897
+ box-shadow:
898
+ 0 0 0 1px #34343a,
899
+ 0 30px 80px rgba(0, 0, 0, 0.6);
900
+ }
901
+ .sh {
902
+ font-weight: 650;
903
+ font-size: 15.5px;
904
+ margin-bottom: 14px;
905
+ display: flex;
906
+ gap: 10px;
907
+ align-items: baseline;
908
+ }
909
+ .f {
910
+ display: flex;
911
+ align-items: center;
912
+ gap: 12px;
913
+ margin-bottom: 10px;
914
+ }
915
+ .f label {
916
+ width: 70px;
917
+ text-align: right;
918
+ color: #9a9aa0;
919
+ font-size: 13.5px;
920
+ }
921
+ .f .in {
922
+ flex: 1;
923
+ height: 32px;
924
+ border-radius: 7px;
925
+ background: #161618;
926
+ box-shadow: inset 0 0 0 1px #38383e;
927
+ display: flex;
928
+ align-items: center;
929
+ padding: 0 10px;
930
+ font-family: JB;
931
+ font-size: 14px;
932
+ }
933
+ .sbtns {
934
+ display: flex;
935
+ justify-content: flex-end;
936
+ gap: 10px;
937
+ margin-top: 16px;
938
+ }
939
+ .sbtns span {
940
+ padding: 7px 16px;
941
+ border-radius: 8px;
942
+ font-size: 14px;
943
+ font-weight: 600;
944
+ }
945
+ .b2 {
946
+ background: #34343a;
947
+ }
948
+ .b1 {
949
+ background: #3b74f0;
950
+ color: #fff;
951
+ }
952
+ .mac {
953
+ display: inline-flex;
954
+ align-items: center;
955
+ gap: 6px;
956
+ padding: 3px 9px;
957
+ border-radius: 7px;
958
+ background: rgba(52, 107, 241, 0.18);
959
+ color: var(--primary2);
960
+ font-size: 12px;
961
+ font-weight: 600;
962
+ }
963
+
964
+ .shade {
965
+ position: absolute;
966
+ left: 0;
967
+ right: 0;
968
+ bottom: 0;
969
+ height: 190px;
970
+ background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.96) 42%);
971
+ z-index: 30;
972
+ }
973
+ .cap {
974
+ position: absolute;
975
+ left: 0;
976
+ right: 0;
977
+ top: 806px;
978
+ display: flex;
979
+ justify-content: center;
980
+ align-items: center;
981
+ gap: 16px;
982
+ font-size: 40px;
983
+ font-weight: 700;
984
+ letter-spacing: -0.025em;
985
+ z-index: 31;
986
+ opacity: 0;
987
+ }
988
+ .cap .n {
989
+ width: 50px;
990
+ height: 50px;
991
+ border-radius: 13px;
992
+ display: grid;
993
+ place-items: center;
994
+ font-family: JB;
995
+ font-size: 25px;
996
+ font-weight: 700;
997
+ }
998
+ .cap .n {
999
+ background: #191a1d;
1000
+ color: var(--text);
1001
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
1002
+ }
1003
+ .cap .m {
1004
+ color: #a3a3a3;
1005
+ font-weight: 560;
1006
+ }
1007
+ .cursor {
1008
+ position: absolute;
1009
+ left: 0;
1010
+ top: 0;
1011
+ z-index: 20;
1012
+ transform-origin: 4px 3px;
1013
+ filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
1014
+ }
1015
+ .cam {
1016
+ position: absolute;
1017
+ inset: 0;
1018
+ transform-origin: 0 0;
1019
+ }
1020
+
1021
+ /* outro */
1022
+ .outro {
1023
+ position: absolute;
1024
+ inset: 0;
1025
+ z-index: 50;
1026
+ opacity: 0;
1027
+ display: grid;
1028
+ place-items: center;
1029
+ text-align: center;
1030
+ background:
1031
+ radial-gradient(760px 460px at 50% 34%, rgba(52, 107, 241, 0.16), transparent 70%), #000;
1032
+ }
1033
+ .outro .logo {
1034
+ width: 176px;
1035
+ height: 176px;
1036
+ display: block;
1037
+ margin: 0 auto -10px;
1038
+ filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.35))
1039
+ drop-shadow(0 18px 60px rgba(52, 107, 241, 0.35));
1040
+ }
1041
+ .outro h2 {
1042
+ margin-top: 44px;
1043
+ font-size: 76px;
1044
+ line-height: 1.02;
1045
+ font-weight: 760;
1046
+ letter-spacing: -0.045em;
1047
+ }
1048
+ .outro h2 {
1049
+ color: var(--text);
1050
+ }
1051
+ .outro h2 .and {
1052
+ color: #a3a3a3;
1053
+ }
1054
+ .outro p {
1055
+ margin-top: 22px;
1056
+ font-size: 34px;
1057
+ color: #a3a3a3;
1058
+ font-weight: 550;
1059
+ letter-spacing: -0.02em;
1060
+ display: flex;
1061
+ align-items: center;
1062
+ justify-content: center;
1063
+ gap: 14px;
1064
+ }
1065
+ .outro p b {
1066
+ color: var(--text);
1067
+ font-weight: 650;
1068
+ }
1069
+ .ver {
1070
+ font-family: JB;
1071
+ font-size: 22px;
1072
+ font-weight: 600;
1073
+ color: var(--text);
1074
+ padding: 6px 13px;
1075
+ border-radius: 10px;
1076
+ background: rgba(255, 255, 255, 0.07);
1077
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
1078
+ }
1079
+ .outro .url {
1080
+ margin-top: 46px;
1081
+ font-family: JB;
1082
+ font-size: 22px;
1083
+ color: var(--dim);
1084
+ }
1085
+ @keyframes outro {
1086
+ from {
1087
+ opacity: 0;
1088
+ }
1089
+ to {
1090
+ opacity: 1;
1091
+ }
1092
+ }
1093
+ @keyframes outroIn {
1094
+ from {
1095
+ opacity: 0;
1096
+ transform: translateY(18px);
1097
+ }
1098
+ to {
1099
+ opacity: 1;
1100
+ transform: none;
1101
+ }
1102
+ }
1103
+ .outro {
1104
+ animation: outro 0.5s ease-out 16.05s both;
1105
+ }
1106
+ .outro .logo {
1107
+ animation: outroIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 16.1s both;
1108
+ }
1109
+ .outro h2 {
1110
+ animation: outroIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 16.2s both;
1111
+ }
1112
+ .outro p {
1113
+ animation: outroIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 16.3s both;
1114
+ }
1115
+ .outro .url {
1116
+ animation: outroIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 16.4s both;
1117
+ }
1118
+
1119
+ /* ---------------- timeline (animation seconds) ---------------- */
1120
+ @keyframes fade {
1121
+ from {
1122
+ opacity: 0;
1123
+ }
1124
+ to {
1125
+ opacity: 1;
1126
+ }
1127
+ }
1128
+ @keyframes out {
1129
+ from {
1130
+ opacity: 1;
1131
+ }
1132
+ to {
1133
+ opacity: 0;
1134
+ }
1135
+ }
1136
+ @keyframes up {
1137
+ from {
1138
+ opacity: 0;
1139
+ transform: translateY(10px);
1140
+ }
1141
+ to {
1142
+ opacity: 1;
1143
+ transform: none;
1144
+ }
1145
+ }
1146
+ @keyframes rise {
1147
+ from {
1148
+ opacity: 0;
1149
+ transform: translateY(40px) scale(0.98);
1150
+ }
1151
+ to {
1152
+ opacity: 1;
1153
+ transform: none;
1154
+ }
1155
+ }
1156
+ @keyframes reveal {
1157
+ from {
1158
+ clip-path: inset(0 100% 0 0);
1159
+ }
1160
+ to {
1161
+ clip-path: inset(0 0 0 0);
1162
+ }
1163
+ }
1164
+ @keyframes popin {
1165
+ from {
1166
+ opacity: 0;
1167
+ transform: scale(0.96) translateY(-6px);
1168
+ }
1169
+ to {
1170
+ opacity: 1;
1171
+ transform: none;
1172
+ }
1173
+ }
1174
+ @keyframes grow {
1175
+ from {
1176
+ height: 0;
1177
+ opacity: 0;
1178
+ }
1179
+ to {
1180
+ height: 66px;
1181
+ opacity: 1;
1182
+ }
1183
+ }
1184
+ @keyframes load {
1185
+ 0% {
1186
+ width: 0;
1187
+ opacity: 1;
1188
+ }
1189
+ 80% {
1190
+ width: 100%;
1191
+ opacity: 1;
1192
+ }
1193
+ 100% {
1194
+ width: 100%;
1195
+ opacity: 0;
1196
+ }
1197
+ }
1198
+ @keyframes hold {
1199
+ 0% {
1200
+ opacity: 0;
1201
+ }
1202
+ 10% {
1203
+ opacity: 1;
1204
+ }
1205
+ 90% {
1206
+ opacity: 1;
1207
+ }
1208
+ 100% {
1209
+ opacity: 0;
1210
+ }
1211
+ }
1212
+ @keyframes cap {
1213
+ 0% {
1214
+ opacity: 0;
1215
+ transform: translateY(10px);
1216
+ }
1217
+ 7% {
1218
+ opacity: 1;
1219
+ transform: none;
1220
+ }
1221
+ 93% {
1222
+ opacity: 1;
1223
+ transform: none;
1224
+ }
1225
+ 100% {
1226
+ opacity: 0;
1227
+ transform: translateY(-6px);
1228
+ }
1229
+ }
1230
+ @keyframes fwdOn {
1231
+ 0% {
1232
+ transform: scale(1);
1233
+ }
1234
+ 35% {
1235
+ transform: scale(0.84);
1236
+ }
1237
+ 100% {
1238
+ background: var(--primary);
1239
+ color: #fff;
1240
+ box-shadow:
1241
+ 0 0 0 4px rgba(52, 107, 241, 0.25),
1242
+ 0 0 22px rgba(52, 107, 241, 0.55);
1243
+ transform: scale(1);
1244
+ }
1245
+ }
1246
+ @keyframes toast {
1247
+ 0% {
1248
+ opacity: 0;
1249
+ transform: translateY(16px);
1250
+ }
1251
+ 8% {
1252
+ opacity: 1;
1253
+ transform: none;
1254
+ }
1255
+ 92% {
1256
+ opacity: 1;
1257
+ transform: none;
1258
+ }
1259
+ 100% {
1260
+ opacity: 0;
1261
+ transform: translateY(8px);
1262
+ }
1263
+ }
1264
+ @keyframes press {
1265
+ 0%,
1266
+ 100% {
1267
+ transform: scale(1);
1268
+ }
1269
+ 40% {
1270
+ transform: scale(0.9);
1271
+ background: #2a2a2d;
1272
+ }
1273
+ }
1274
+ @keyframes camera {
1275
+ 0%,
1276
+ 5% {
1277
+ transform: none;
1278
+ }
1279
+ 8.125%,
1280
+ 18.125% {
1281
+ transform: translate(-302px, -930px) scale(1.9);
1282
+ }
1283
+ 21.25%,
1284
+ 34.375% {
1285
+ transform: translate(-139px, -6px) scale(1.6);
1286
+ }
1287
+ 38.125%,
1288
+ 47.5% {
1289
+ transform: translate(-229px, -38px) scale(1.5);
1290
+ }
1291
+ 51.875%,
1292
+ 63.75% {
1293
+ transform: translate(-724px, -100px) scale(1.45);
1294
+ }
1295
+ 67.5%,
1296
+ 76.875% {
1297
+ transform: translate(-503px, -428px) scale(1.9);
1298
+ }
1299
+ 80%,
1300
+ 83.125% {
1301
+ transform: none;
1302
+ }
1303
+ 86.875%,
1304
+ 100% {
1305
+ transform: translate(65px, -365px) scale(1.5);
1306
+ }
1307
+ }
1308
+
1309
+ .cam {
1310
+ animation: camera 16s cubic-bezier(0.65, 0, 0.35, 1) 0s both;
1311
+ }
1312
+ .win {
1313
+ animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0s both;
1314
+ }
1315
+ .cap.a {
1316
+ animation: cap 6.2s 0.4s both;
1317
+ }
1318
+ .cap.b {
1319
+ animation: cap 3.3s 7.1s both;
1320
+ }
1321
+ .cap.c {
1322
+ animation: fade 0.4s 10.5s both;
1323
+ }
1324
+
1325
+ .composer .typing .reveal {
1326
+ animation: reveal 1.7s steps(46, end) 0.9s both;
1327
+ }
1328
+ .composer .ph {
1329
+ animation:
1330
+ out 0.01s 0.9s both,
1331
+ fade 0.2s 2.9s forwards;
1332
+ }
1333
+ .composer .typing {
1334
+ animation: out 0.15s 2.8s both;
1335
+ }
1336
+ .composer .send .stop {
1337
+ animation:
1338
+ fade 0.1s 2.85s both,
1339
+ out 0.2s 5.3s forwards;
1340
+ }
1341
+ .bubble {
1342
+ animation: up 0.35s ease-out 2.8s both;
1343
+ }
1344
+ .working {
1345
+ animation: fade 0.3s 3.1s both;
1346
+ }
1347
+ .working .a {
1348
+ animation: out 0.1s 5.3s both;
1349
+ }
1350
+ .working .b {
1351
+ animation: fade 0.1s 5.3s both;
1352
+ }
1353
+ .cmd {
1354
+ animation: fade 0.3s 3.4s both;
1355
+ }
1356
+ .cmd .c1 {
1357
+ animation: out 0.1s 4.3s both;
1358
+ }
1359
+ .cmd .c2 {
1360
+ animation:
1361
+ fade 0.1s 4.3s both,
1362
+ out 0.1s 5.1s forwards;
1363
+ }
1364
+ .cmd .c3 {
1365
+ animation: fade 0.1s 5.1s both;
1366
+ }
1367
+ .reply {
1368
+ animation: up 0.4s ease-out 5.3s both;
1369
+ }
1370
+
1371
+ .dtoggle {
1372
+ animation: press 0.25s 6.2s both;
1373
+ }
1374
+ .pop {
1375
+ animation: popin 0.2s ease-out 6.32s both;
1376
+ }
1377
+ .srv.r1 {
1378
+ animation: grow 0.35s ease-out 6.6s both;
1379
+ }
1380
+ .srv.r2 {
1381
+ animation: grow 0.35s ease-out 6.9s both;
1382
+ }
1383
+ .srv.r2 .hl {
1384
+ animation: hold 1s 7.75s both;
1385
+ }
1386
+ .srv.r1 .hl {
1387
+ animation: hold 1.9s 11.1s both;
1388
+ }
1389
+ .srv.r1 .acts {
1390
+ animation: hold 1.9s 11.1s both;
1391
+ }
1392
+ .srv.r1 .fwd {
1393
+ animation: fwdOn 0.45s ease-out 11.85s both;
1394
+ }
1395
+ .srv.r1 .tip {
1396
+ animation: hold 1s 11.3s both;
1397
+ }
1398
+ .srv.r1 .s .ag {
1399
+ animation: out 0.2s 12.15s both;
1400
+ }
1401
+ .srv.r1 .s .fw {
1402
+ animation: fade 0.2s 12.2s both;
1403
+ }
1404
+
1405
+ .tab .a {
1406
+ animation: out 0.05s 8.15s both;
1407
+ }
1408
+ .tab .b {
1409
+ animation: fade 0.05s 8.15s both;
1410
+ }
1411
+ .urlrow .ph {
1412
+ animation: out 0.05s 8.15s both;
1413
+ }
1414
+ .urlrow .val {
1415
+ animation: fade 0.05s 8.15s both;
1416
+ }
1417
+ .lbar {
1418
+ animation: load 0.75s ease-in 8.2s both;
1419
+ }
1420
+ .bblank {
1421
+ animation: out 0.2s 8.8s both;
1422
+ }
1423
+ .page {
1424
+ animation: fade 0.4s 8.9s both;
1425
+ }
1426
+ .toast {
1427
+ animation: toast 3.6s 12.1s both;
1428
+ }
1429
+ .db {
1430
+ animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) 12.95s both;
1431
+ }
1432
+ .dmain,
1433
+ .dside .dt {
1434
+ opacity: 0;
1435
+ }
1436
+ .dside .dt {
1437
+ animation: fade 0.25s 14.5s both;
1438
+ }
1439
+ .dmain {
1440
+ animation: fade 0.3s 14.45s both;
1441
+ }
1442
+ .gr {
1443
+ animation: up 0.25s ease-out both;
1444
+ }
1445
+ .gr:nth-child(1) {
1446
+ animation-delay: 14.5s;
1447
+ }
1448
+ .gr:nth-child(2) {
1449
+ animation-delay: 14.58s;
1450
+ }
1451
+ .gr:nth-child(3) {
1452
+ animation-delay: 14.66s;
1453
+ }
1454
+ .gr:nth-child(4) {
1455
+ animation-delay: 14.74s;
1456
+ }
1457
+ .gr:nth-child(5) {
1458
+ animation-delay: 14.82s;
1459
+ }
1460
+ .gr:nth-child(6) {
1461
+ animation-delay: 14.9s;
1462
+ }
1463
+ .gr:nth-child(7) {
1464
+ animation-delay: 14.98s;
1465
+ }
1466
+ .r-host {
1467
+ animation: reveal 0.45s steps(9, end) 13.15s both;
1468
+ }
1469
+ .r-port {
1470
+ animation: reveal 0.25s steps(4, end) 13.6s both;
1471
+ }
1472
+ .connect {
1473
+ animation: press 0.25s 14.12s both;
1474
+ }
1475
+ .sheet {
1476
+ animation: out 0.2s 14.35s both;
1477
+ }
1478
+ </style>
1479
+ </head>
1480
+ <body>
1481
+ <div class="canvas">
1482
+ <div class="cam">
1483
+ <div class="win">
1484
+ <div class="stage">
1485
+ <div class="side">
1486
+ <div class="lights"><b></b><b></b><b></b></div>
1487
+ <svg class="i tb-icons" style="left: 133px" viewBox="0 0 24 24">
1488
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1489
+ <path d="M9 3v18" />
1490
+ </svg>
1491
+ <div class="brandt"><b>T3</b> Code</div>
1492
+ <svg
1493
+ class="i tb-icons"
1494
+ style="left: 266px; font-size: 19px; top: 26px"
1495
+ viewBox="0 0 24 24"
1496
+ >
1497
+ <path d="m12 19-7-7 7-7" />
1498
+ <path d="M19 12H5" />
1499
+ </svg>
1500
+ <svg
1501
+ class="i tb-icons"
1502
+ style="left: 304px; font-size: 19px; top: 26px; color: #4a4a4f"
1503
+ viewBox="0 0 24 24"
1504
+ >
1505
+ <path d="M5 12h14" />
1506
+ <path d="m12 5 7 7-7 7" />
1507
+ </svg>
1508
+ <div class="search">
1509
+ <svg class="i" viewBox="0 0 24 24" style="font-size: 21px">
1510
+ <circle cx="11" cy="11" r="8" />
1511
+ <path d="m21 21-4.3-4.3" /></svg
1512
+ >Search
1513
+ <span class="sp"
1514
+ ><svg class="i" viewBox="0 0 24 24">
1515
+ <path d="M3 6h18" />
1516
+ <path d="M7 12h10" />
1517
+ <path d="M10 18h4" /></svg
1518
+ ><svg class="i" viewBox="0 0 24 24">
1519
+ <path d="M12 10v6" />
1520
+ <path d="M9 13h6" />
1521
+ <path
1522
+ d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"
1523
+ /></svg
1524
+ ><svg class="i" viewBox="0 0 24 24">
1525
+ <path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
1526
+ <path
1527
+ d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"
1528
+ /></svg
1529
+ ></span>
1530
+ </div>
1531
+ <div class="threads">
1532
+ <div class="th on">
1533
+ <div class="l1">
1534
+ <span class="pav" style="background: #2e5bd8">MS</span>acme/mugshot<span
1535
+ class="t"
1536
+ >now</span
1537
+ >
1538
+ </div>
1539
+ <div class="l2">Spin up the dev stack</div>
1540
+ <div class="l3">
1541
+ <svg class="i" viewBox="0 0 24 24">
1542
+ <path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" /></svg
1543
+ >devbox<span class="r"><span class="ast">✳</span></span>
1544
+ </div>
1545
+ </div>
1546
+ <div class="th">
1547
+ <div class="l1">
1548
+ <span class="pav" style="background: #2e5bd8">MS</span>acme/mugshot<span
1549
+ class="t"
1550
+ >2h</span
1551
+ >
1552
+ </div>
1553
+ <div class="l2">Fix avatar upload on Safari</div>
1554
+ <div class="l3">
1555
+ <svg class="i" viewBox="0 0 24 24">
1556
+ <circle cx="6" cy="6" r="3" />
1557
+ <path d="M6 9v12" />
1558
+ <path d="M13 6h3a2 2 0 0 1 2 2v7" />
1559
+ <circle cx="18" cy="18" r="3" /></svg
1560
+ >fix/safari-avatar<span class="r"
1561
+ ><span class="pr">+42</span
1562
+ ><svg class="i" viewBox="0 0 24 24">
1563
+ <path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" /></svg
1564
+ ><span class="ast">✳</span></span
1565
+ >
1566
+ </div>
1567
+ </div>
1568
+ <div class="th">
1569
+ <div class="l1">
1570
+ <span class="pav" style="background: #2e5bd8">MS</span>acme/mugshot<span
1571
+ class="t"
1572
+ >5h</span
1573
+ >
1574
+ </div>
1575
+ <div class="l2">Pricing page copy</div>
1576
+ <div class="l3">
1577
+ <svg class="i" viewBox="0 0 24 24">
1578
+ <circle cx="6" cy="6" r="3" />
1579
+ <path d="M6 9v12" />
1580
+ <path d="M13 6h3a2 2 0 0 1 2 2v7" />
1581
+ <circle cx="18" cy="18" r="3" /></svg
1582
+ >copy/pricing<span class="r"
1583
+ ><span class="pr">+18</span
1584
+ ><svg class="i" viewBox="0 0 24 24">
1585
+ <rect width="20" height="14" x="2" y="3" rx="2" />
1586
+ <path d="M8 21h8" />
1587
+ <path d="M12 17v4" /></svg
1588
+ ><span class="ast">✳</span></span
1589
+ >
1590
+ </div>
1591
+ </div>
1592
+ <div class="th">
1593
+ <div class="l1">
1594
+ <span class="pav" style="background: #7a4fd6">IN</span>acme/infra<span class="t"
1595
+ >1d</span
1596
+ >
1597
+ </div>
1598
+ <div class="l2">Bump Postgres to 17</div>
1599
+ <div class="l3">
1600
+ <svg class="i" viewBox="0 0 24 24">
1601
+ <circle cx="6" cy="6" r="3" />
1602
+ <path d="M6 9v12" />
1603
+ <path d="M13 6h3a2 2 0 0 1 2 2v7" />
1604
+ <circle cx="18" cy="18" r="3" /></svg
1605
+ >pg-17<span class="r"
1606
+ ><span class="pr">+7</span
1607
+ ><svg class="i" viewBox="0 0 24 24">
1608
+ <path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" /></svg
1609
+ ><span class="ast">✳</span></span
1610
+ >
1611
+ </div>
1612
+ </div>
1613
+ <div class="th">
1614
+ <div class="l1">
1615
+ <span class="pav" style="background: #2e5bd8">MS</span>acme/mugshot<span
1616
+ class="t"
1617
+ >2d</span
1618
+ >
1619
+ </div>
1620
+ <div class="l2">Onboarding email tweaks</div>
1621
+ <div class="l3">
1622
+ <svg class="i" viewBox="0 0 24 24">
1623
+ <circle cx="6" cy="6" r="3" />
1624
+ <path d="M6 9v12" />
1625
+ <path d="M13 6h3a2 2 0 0 1 2 2v7" />
1626
+ <circle cx="18" cy="18" r="3" /></svg
1627
+ >main<span class="r"
1628
+ ><svg class="i" viewBox="0 0 24 24">
1629
+ <rect width="20" height="14" x="2" y="3" rx="2" />
1630
+ <path d="M8 21h8" />
1631
+ <path d="M12 17v4" /></svg
1632
+ ><span class="ast">✳</span></span
1633
+ >
1634
+ </div>
1635
+ </div>
1636
+ </div>
1637
+ <div class="sidefoot">
1638
+ <svg class="i" viewBox="0 0 24 24">
1639
+ <path
1640
+ d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
1641
+ />
1642
+ <circle cx="12" cy="12" r="3" /></svg
1643
+ ><svg class="i" viewBox="0 0 24 24">
1644
+ <circle cx="18" cy="18" r="3" />
1645
+ <circle cx="6" cy="6" r="3" />
1646
+ <path d="M13 6h3a2 2 0 0 1 2 2v7" />
1647
+ <path d="M6 9v12" /></svg
1648
+ ><svg class="i" viewBox="0 0 24 24">
1649
+ <circle cx="12" cy="12" r="10" />
1650
+ <circle cx="12" cy="12" r="1" /></svg
1651
+ ><svg class="i" viewBox="0 0 24 24">
1652
+ <path d="M3 3v16a2 2 0 0 0 2 2h16" />
1653
+ <path d="M18 17V9" />
1654
+ <path d="M13 17V5" />
1655
+ <path d="M8 17v-3" />
1656
+ </svg>
1657
+ </div>
1658
+ </div>
1659
+
1660
+ <div class="mhead">
1661
+ <span class="pav" style="background: #2e5bd8">MS</span
1662
+ ><span class="muted">mugshot</span><span class="muted">/</span
1663
+ ><span class="tt">Spin up the dev stack</span>
1664
+ </div>
1665
+ <div class="dtoggle">
1666
+ <svg class="i" viewBox="0 0 24 24">
1667
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1668
+ <path d="M7 8h10" />
1669
+ <path d="M7 12h10" />
1670
+ <path d="M7 16h10" />
1671
+ </svg>
1672
+ </div>
1673
+
1674
+ <div class="chat">
1675
+ <div class="bubble">spin up the app and a postgres for it so I can poke at it</div>
1676
+ <div class="working mut" style="margin-top: 26px">
1677
+ <div class="swap">
1678
+ <span class="a">Working for 4s</span
1679
+ ><span class="b" style="opacity: 0">Worked for 9s</span>
1680
+ </div>
1681
+ </div>
1682
+ <div class="cmd row" style="margin-top: 8px">
1683
+ <svg class="i" viewBox="0 0 24 24">
1684
+ <path d="m4 17 6-6-6-6" />
1685
+ <path d="M12 19h8" />
1686
+ </svg>
1687
+ <div class="swap" style="flex: 1">
1688
+ <span class="c1">Running <span class="w">docker compose up -d db</span></span
1689
+ ><span class="c2" style="opacity: 0">Running <span class="w">pnpm dev</span></span
1690
+ ><span class="c3" style="opacity: 0">Ran 2 commands</span>
1691
+ </div>
1692
+ </div>
1693
+ <div class="reply" style="margin-top: 14px">
1694
+ Both are up. The app is on <code>localhost:3000</code>, seeded from Postgres on
1695
+ <code>localhost:5432</code>.
1696
+ </div>
1697
+ </div>
1698
+
1699
+ <div class="composer">
1700
+ <span class="ph">Ask anything. @ files, $ skills, / commands</span>
1701
+ <div class="typing">
1702
+ <span class="reveal"
1703
+ >spin up the app and a postgres for it so I can poke at it</span
1704
+ >
1705
+ </div>
1706
+ <div class="ft">
1707
+ <svg class="i" viewBox="0 0 24 24" style="font-size: 22px">
1708
+ <path
1709
+ d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"
1710
+ />
1711
+ </svg>
1712
+ <span class="model"
1713
+ ><span class="ast">✳</span>Opus 5.5 <span class="mut">Medium</span></span
1714
+ >
1715
+ <svg class="i" viewBox="0 0 24 24" style="font-size: 22px">
1716
+ <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" />
1717
+ <path d="M19 10v2a7 7 0 0 1-14 0v-2" />
1718
+ <path d="M12 19v3" />
1719
+ </svg>
1720
+ <span class="send"
1721
+ ><svg class="i" viewBox="0 0 24 24" style="stroke-width: 2.4">
1722
+ <path d="m5 12 7-7 7 7" />
1723
+ <path d="M12 19V5" /></svg
1724
+ ><span class="stop" style="opacity: 0"><b></b></span
1725
+ ></span>
1726
+ </div>
1727
+ </div>
1728
+
1729
+ <div class="pop">
1730
+ <div class="prow">
1731
+ <svg class="i ic" viewBox="0 0 24 24">
1732
+ <path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" /></svg
1733
+ >devbox<svg class="i end" viewBox="0 0 24 24" style="font-size: 20px">
1734
+ <path
1735
+ d="M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"
1736
+ />
1737
+ <path
1738
+ d="M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"
1739
+ />
1740
+ <path d="M3 5a2 2 0 0 0 2 2h3" />
1741
+ <path d="M3 3v13a2 2 0 0 0 2 2h3" />
1742
+ </svg>
1743
+ </div>
1744
+ <div class="prow">
1745
+ <svg class="i ic" viewBox="0 0 24 24"><path d="M6 3v18l14-9z" /></svg>Dev<svg
1746
+ class="i end"
1747
+ viewBox="0 0 24 24"
1748
+ >
1749
+ <path d="m6 9 6 6 6-6" />
1750
+ </svg>
1751
+ </div>
1752
+ <div class="psep"></div>
1753
+ <div class="prow">
1754
+ <svg class="i ic" viewBox="0 0 24 24">
1755
+ <circle cx="6" cy="6" r="3" />
1756
+ <path d="M6 9v12" />
1757
+ <path d="M13 6h3a2 2 0 0 1 2 2v7" />
1758
+ <circle cx="18" cy="18" r="3" /></svg
1759
+ >main<svg class="i end" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6" /></svg>
1760
+ </div>
1761
+ <div class="prow">
1762
+ <svg class="i ic" viewBox="0 0 24 24">
1763
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
1764
+ <path d="M14 2v6h6" />
1765
+ <path d="M12 12v6" />
1766
+ <path d="M9 15h6" /></svg
1767
+ >Changes <span class="mut" style="margin-left: -4px">Uncommitted</span
1768
+ ><span class="end" style="font-family: JB; font-size: 17px">+0 −0</span>
1769
+ </div>
1770
+ <div class="psep"></div>
1771
+ <div class="plabel">Servers</div>
1772
+ <div class="srv r1">
1773
+ <div class="hl"></div>
1774
+ <svg class="i ic" viewBox="0 0 24 24" style="position: relative">
1775
+ <ellipse cx="12" cy="5" rx="9" ry="3" />
1776
+ <path d="M3 5V19A9 3 0 0 0 21 19V5" />
1777
+ <path d="M3 12A9 3 0 0 0 21 12" />
1778
+ </svg>
1779
+ <div style="position: relative">
1780
+ <div class="t">localhost:5432</div>
1781
+ <div class="s">
1782
+ <span class="ag">Agent · postgres</span
1783
+ ><span class="fw" style="opacity: 0">Forwarded to :5432</span>
1784
+ </div>
1785
+ </div>
1786
+ <div class="acts">
1787
+ <div class="fwd">
1788
+ <svg class="i" viewBox="0 0 24 24">
1789
+ <path
1790
+ d="M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z"
1791
+ />
1792
+ <path d="M17 21v-2" />
1793
+ <path d="M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10" />
1794
+ <path d="M21 21v-2" />
1795
+ <path d="M3 5V3" />
1796
+ <path
1797
+ d="M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z"
1798
+ />
1799
+ <path d="M7 5V3" />
1800
+ </svg>
1801
+ </div>
1802
+ <div class="stopsq"></div>
1803
+ </div>
1804
+ <div class="tip" style="right: 96px">Forward to this machine, for any app here</div>
1805
+ </div>
1806
+ <div class="srv r2">
1807
+ <div class="hl"></div>
1808
+ <svg class="i ic" viewBox="0 0 24 24" style="position: relative">
1809
+ <circle cx="12" cy="12" r="10" />
1810
+ <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" />
1811
+ <path d="M2 12h20" />
1812
+ </svg>
1813
+ <div style="position: relative">
1814
+ <div class="t">localhost:3000</div>
1815
+ <div class="s"><span>Agent · next-server</span></div>
1816
+ </div>
1817
+ </div>
1818
+ <div class="psep"></div>
1819
+ <div class="prow">
1820
+ <span class="mut" style="font-size: 17px">Limits</span
1821
+ ><span class="end" style="font-size: 17px">Unavailable</span>
1822
+ </div>
1823
+ </div>
1824
+
1825
+ <div class="bpanel">
1826
+ <div class="tabs">
1827
+ <div class="tab">
1828
+ <span
1829
+ class="a"
1830
+ style="
1831
+ position: absolute;
1832
+ left: 14px;
1833
+ display: flex;
1834
+ gap: 9px;
1835
+ align-items: center;
1836
+ "
1837
+ ><svg class="i" viewBox="0 0 24 24">
1838
+ <circle cx="12" cy="12" r="10" />
1839
+ <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" />
1840
+ <path d="M2 12h20" /></svg
1841
+ >New tab</span
1842
+ >
1843
+ <span
1844
+ class="b"
1845
+ style="
1846
+ position: absolute;
1847
+ left: 14px;
1848
+ display: flex;
1849
+ gap: 9px;
1850
+ align-items: center;
1851
+ opacity: 0;
1852
+ "
1853
+ ><span
1854
+ style="
1855
+ width: 18px;
1856
+ height: 18px;
1857
+ border-radius: 5px;
1858
+ background: #1c1b18;
1859
+ box-shadow: 0 0 0 1px #444;
1860
+ "
1861
+ ></span
1862
+ >Mugshot admin</span
1863
+ ><span class="x">✕</span>
1864
+ </div>
1865
+ <div
1866
+ style="
1867
+ display: grid;
1868
+ place-items: center;
1869
+ width: 38px;
1870
+ color: var(--muted);
1871
+ font-size: 22px;
1872
+ "
1873
+ >
1874
+ +
1875
+ </div>
1876
+ </div>
1877
+ <div class="brr">
1878
+ <svg class="i" viewBox="0 0 24 24">
1879
+ <path d="M15 3h6v6" />
1880
+ <path d="m21 3-7 7" />
1881
+ <path d="m3 21 7-7" />
1882
+ <path d="M9 21H3v-6" /></svg
1883
+ ><svg class="i" viewBox="0 0 24 24">
1884
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1885
+ <path d="M3 15h18" /></svg
1886
+ ><span class="on"
1887
+ ><svg class="i" viewBox="0 0 24 24" style="display: block">
1888
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1889
+ <path d="M15 3v18" /></svg
1890
+ ></span>
1891
+ </div>
1892
+ <div class="urlrow">
1893
+ <svg class="i" viewBox="0 0 24 24">
1894
+ <path d="m12 19-7-7 7-7" />
1895
+ <path d="M19 12H5" /></svg
1896
+ ><svg class="i" viewBox="0 0 24 24">
1897
+ <path d="M5 12h14" />
1898
+ <path d="m12 5 7 7-7 7" /></svg
1899
+ ><svg class="i" viewBox="0 0 24 24">
1900
+ <path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" />
1901
+ <path d="M21 3v5h-5" />
1902
+ </svg>
1903
+ <div class="u">
1904
+ <span class="ph">Search or enter a URL</span
1905
+ ><span class="val" style="opacity: 0">http://localhost:3000/admin</span>
1906
+ </div>
1907
+ <span class="rr"
1908
+ ><svg class="i" viewBox="0 0 24 24">
1909
+ <path d="M14 4.1 12 6" />
1910
+ <path d="m5.1 8-2.9-.8" />
1911
+ <path d="m6 12-1.9 2" />
1912
+ <path d="M7.2 2.2 8 5.1" />
1913
+ <path
1914
+ d="M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"
1915
+ /></svg
1916
+ ><svg class="i" viewBox="0 0 24 24">
1917
+ <path
1918
+ d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"
1919
+ />
1920
+ <circle cx="12" cy="13" r="3" /></svg
1921
+ ><svg class="i" viewBox="0 0 24 24">
1922
+ <circle cx="12" cy="12" r="1" />
1923
+ <circle cx="12" cy="5" r="1" />
1924
+ <circle cx="12" cy="19" r="1" /></svg
1925
+ ></span>
1926
+ </div>
1927
+ <div class="lbar"></div>
1928
+ <div class="bblank"></div>
1929
+ <div class="page">
1930
+ <div class="nav">
1931
+ <div class="logo"></div>
1932
+ Mugshot admin<span class="r">dev</span>
1933
+ </div>
1934
+ <h3>Good morning.</h3>
1935
+ <div class="stats">
1936
+ <div class="stat">
1937
+ <div class="k">Users</div>
1938
+ <div class="v">1,204<small>+37 today</small></div>
1939
+ </div>
1940
+ <div class="stat">
1941
+ <div class="k">Mugs shot</div>
1942
+ <div class="v">8,911</div>
1943
+ </div>
1944
+ </div>
1945
+ <div class="table">
1946
+ <div><span>Name</span><span>Email</span><span>Joined</span></div>
1947
+ <div><span>Ada Park</span><span>ada@example.com</span><span>2m ago</span></div>
1948
+ <div><span>Sam Okafor</span><span>sam@example.com</span><span>14m ago</span></div>
1949
+ <div><span>Lena Ruiz</span><span>lena@example.com</span><span>1h ago</span></div>
1950
+ <div><span>Mira Holt</span><span>mira@example.com</span><span>3h ago</span></div>
1951
+ </div>
1952
+ </div>
1953
+ <div class="toast">
1954
+ <div class="ok">✓</div>
1955
+ <div>
1956
+ <div class="tt">Forwarded port 5432</div>
1957
+ <div class="td">
1958
+ Apps on this machine reach it at <code>localhost:5432</code>.
1959
+ </div>
1960
+ </div>
1961
+ </div>
1962
+ </div>
1963
+ </div>
1964
+ </div>
1965
+
1966
+ <div class="db">
1967
+ <div class="dtb">
1968
+ <div class="lights2"><b></b><b></b><b></b></div>
1969
+ <span class="name"
1970
+ >mugshot_dev <span style="color: #6d6d73">— localhost:5432</span></span
1971
+ ><span class="mac"
1972
+ ><svg class="i" viewBox="0 0 24 24">
1973
+ <rect width="18" height="12" x="3" y="4" rx="2" />
1974
+ <path d="M2 20h20" /></svg
1975
+ >on your Mac</span
1976
+ >
1977
+ </div>
1978
+ <div class="dbody">
1979
+ <div class="dside">
1980
+ <div class="dh">Tables</div>
1981
+ <div class="dt on">
1982
+ <svg class="i" viewBox="0 0 24 24">
1983
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1984
+ <path d="M3 9h18" />
1985
+ <path d="M9 21V9" /></svg
1986
+ >users
1987
+ </div>
1988
+ <div class="dt">
1989
+ <svg class="i" viewBox="0 0 24 24">
1990
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1991
+ <path d="M3 9h18" />
1992
+ <path d="M9 21V9" /></svg
1993
+ >mugs
1994
+ </div>
1995
+ <div class="dt">
1996
+ <svg class="i" viewBox="0 0 24 24">
1997
+ <rect width="18" height="18" x="3" y="3" rx="2" />
1998
+ <path d="M3 9h18" />
1999
+ <path d="M9 21V9" /></svg
2000
+ >sessions
2001
+ </div>
2002
+ <div class="dt">
2003
+ <svg class="i" viewBox="0 0 24 24">
2004
+ <rect width="18" height="18" x="3" y="3" rx="2" />
2005
+ <path d="M3 9h18" />
2006
+ <path d="M9 21V9" /></svg
2007
+ >_migrations
2008
+ </div>
2009
+ </div>
2010
+ <div class="dmain">
2011
+ <div class="dbar">
2012
+ <span class="pill">users</span><span class="mutd">1,204 rows</span
2013
+ ><span class="mutd" style="margin-left: auto">LIMIT 300</span>
2014
+ </div>
2015
+ <div class="grid">
2016
+ <div class="gr gh">
2017
+ <span>id</span><span>name</span><span>email</span><span>created_at</span>
2018
+ </div>
2019
+ <div class="gr">
2020
+ <span>1204</span><span>Ada Park</span><span>ada@example.com</span
2021
+ ><span>2026-11-19 09:41</span>
2022
+ </div>
2023
+ <div class="gr">
2024
+ <span>1203</span><span>Sam Okafor</span><span>sam@example.com</span
2025
+ ><span>2026-11-19 09:29</span>
2026
+ </div>
2027
+ <div class="gr">
2028
+ <span>1202</span><span>Lena Ruiz</span><span>lena@example.com</span
2029
+ ><span>2026-11-19 08:43</span>
2030
+ </div>
2031
+ <div class="gr">
2032
+ <span>1201</span><span>Mira Holt</span><span>mira@example.com</span
2033
+ ><span>2026-11-19 06:58</span>
2034
+ </div>
2035
+ <div class="gr">
2036
+ <span>1200</span><span>Priya Nair</span><span>priya@example.com</span
2037
+ ><span>2026-11-18 22:10</span>
2038
+ </div>
2039
+ <div class="gr">
2040
+ <span>1199</span><span>Jonas Berg</span><span>jonas@example.com</span
2041
+ ><span>2026-11-18 19:37</span>
2042
+ </div>
2043
+ </div>
2044
+ </div>
2045
+ <div class="sheet">
2046
+ <div class="sh">New connection <span class="mutd">PostgreSQL</span></div>
2047
+ <div class="f">
2048
+ <label>Host</label>
2049
+ <div class="in"><span class="reveal r-host">localhost</span></div>
2050
+ </div>
2051
+ <div class="f">
2052
+ <label>Port</label>
2053
+ <div class="in"><span class="reveal r-port">5432</span></div>
2054
+ </div>
2055
+ <div class="f">
2056
+ <label>User</label>
2057
+ <div class="in">app</div>
2058
+ </div>
2059
+ <div class="f">
2060
+ <label>Database</label>
2061
+ <div class="in">mugshot_dev</div>
2062
+ </div>
2063
+ <div class="sbtns">
2064
+ <span class="b2">Test</span><span class="b1 connect">Connect</span>
2065
+ </div>
2066
+ </div>
2067
+ </div>
2068
+ </div>
2069
+
2070
+ <div class="cursor" id="cur">
2071
+ <svg viewBox="0 0 24 24" width="26" height="26">
2072
+ <path
2073
+ d="M4 2.5 L4 19.5 L8.6 15.2 L11.6 21.6 L14.6 20.2 L11.7 14 L18 14 Z"
2074
+ fill="#fff"
2075
+ stroke="#000"
2076
+ stroke-width="1.4"
2077
+ stroke-linejoin="round"
2078
+ />
2079
+ </svg>
2080
+ </div>
2081
+ </div>
2082
+
2083
+ <div class="shade"></div>
2084
+ <div class="cap a"><span>Ask an agent on a remote box to start your stack</span></div>
2085
+ <div class="cap b">
2086
+ <span class="n">1</span
2087
+ ><span
2088
+ >Open a server
2089
+ <span class="m">in the in-app browser. Tunnelled automatically.</span></span
2090
+ >
2091
+ </div>
2092
+ <div class="cap c">
2093
+ <span class="n">2</span
2094
+ ><span>Forward a port <span class="m">and every app on your Mac can use it.</span></span>
2095
+ </div>
2096
+ </div>
2097
+ <div class="outro">
2098
+ <div>
2099
+ <img class="logo" src="logo-prod.png" />
2100
+ <h2>Browser tunnels <span class="and">and</span><br />port forwarding</h2>
2101
+ <p>Available now in <b>T3 Code</b> <span class="ver">0.1.11</span></p>
2102
+ <div class="url">t3.codes</div>
2103
+ </div>
2104
+ </div>
2105
+ <script src="kit.js"></script>
2106
+ <script>
2107
+ // Cursor waypoints, in animation seconds. Positions are measured at window.layoutTime with the camera at rest.
2108
+ window.layoutTime = 15;
2109
+ window.placeCursor = () =>
2110
+ Kit.measure(() =>
2111
+ Kit.cursor("#cur", [
2112
+ { t: 5.6, at: [1100, 760], hidden: true },
2113
+ { t: 5.75 },
2114
+ { t: 6.2, at: ".dtoggle", dx: 2, dy: 3, click: true },
2115
+ { t: 7.4 },
2116
+ { t: 8.0, at: ".srv.r2 .t", dx: -12, dy: 4, click: true },
2117
+ { t: 10.6 },
2118
+ { t: 11.3, at: ".srv.r1 .fwd", dx: 2, dy: 3 },
2119
+ { t: 11.85, click: true },
2120
+ { t: 13.2 },
2121
+ { t: 14.0, at: ".connect", dy: 2, click: true },
2122
+ { t: 14.6 },
2123
+ { t: 15.0, at: ".connect", dx: 150, dy: 162, hidden: true },
2124
+ ]),
2125
+ );
2126
+ // Real seconds -> animation seconds: [realDuration, animFrom, animTo]; animFrom == animTo holds.
2127
+ Kit.timeline([
2128
+ [2.8, 0, 2.8],
2129
+ [3.2, 2.8, 5.6],
2130
+ [0.8, 5.6, 5.6],
2131
+ [1.2, 5.6, 6.6],
2132
+ [1.0, 6.6, 7.2],
2133
+ [0.8, 7.2, 7.2],
2134
+ [1.4, 7.2, 8.1],
2135
+ [1.4, 8.1, 9.2],
2136
+ [1.4, 9.2, 9.2],
2137
+ [1.6, 9.2, 10.6],
2138
+ [1.0, 10.6, 11.3],
2139
+ [1.6, 11.3, 12.4],
2140
+ [1.0, 12.4, 13.0],
2141
+ [1.4, 13.0, 14.0],
2142
+ [0.9, 14.0, 14.5],
2143
+ [1.4, 14.5, 16.0],
2144
+ [1.8, 16.0, 16.0],
2145
+ [1.0, 16.0, 17.0],
2146
+ [3.0, 17.0, 17.0],
2147
+ ]);
2148
+ </script>
2149
+ </body>
2150
+</html>
apps/server/scripts/dev-replay-agent.ts
+132
-8
@@ -1,5 +1,5 @@
1
#!/usr/bin/env node
2
-// @effect-diagnostics nodeBuiltinImport:off globalTimers:off
2
+// @effect-diagnostics nodeBuiltinImport:off globalTimers:off globalFetch:off
3
/**
4
* A free ACP agent for dev servers. It plays recorded ACP transcripts with simulated
5
* streaming, so the real adapter, orchestration, and UI run without a paid model.
@@ -69,6 +69,16 @@ export const SCENARIOS = [
69
name: "Command output",
70
file: "./dev-replay/command_output_transcript.ndjson",
71
},
72
+ {
73
+ id: "delegate-remote",
74
+ name: "Delegate to a linked environment",
75
+ file: "./dev-replay/delegate_remote_transcript.ndjson",
76
+ },
77
+ {
78
+ id: "remote-child",
79
+ name: "E2E suite run",
80
+ file: "./dev-replay/remote_child_transcript.ndjson",
81
+ },
82
] as const;
83
84
// Session setup and vendor state stay out: they would replace the replay agent's own models.
@@ -84,8 +94,11 @@ const REPLAYED_UPDATES = new Set([
94
"usage_update",
95
]);
96
97
+const MCP_CALL = "t3/mcp_call";
98
+
99
// Only requests that ask the user. A replayed terminal/create would run a real command.
88
-const REPLAYED_REQUESTS = new Set(["session/request_permission", "elicitation/create"]);
100
+// `t3/mcp_call` is this agent's own: it calls a T3 tool over the session's MCP server.
101
+const REPLAYED_REQUESTS = new Set(["session/request_permission", "elicitation/create", MCP_CALL]);
102
103
const CHUNK_DELAY_MS = 30;
104
const FRAME_DELAY_MS = 250;
@@ -142,12 +155,35 @@ export function streamChunks(text: string): ReadonlyArray<string> {
155
return chunks.length === 0 ? [text] : chunks;
156
}
157
145
-/** Fills the live session, workspace, and per-prompt tool ids, so repeated turns add rows. */
158
+/**
159
+ * Values a recording can name as `<var:name>`, read per turn from the JSON file at
160
+ * T3_DEV_REPLAY_VARS, for ids that change every run such as another environment's.
161
+ */
162
+function readReplayVars(): Record<string, string> {
163
+ const file = process.env.T3_DEV_REPLAY_VARS;
164
+ if (file === undefined || file === "") return {};
165
+ try {
166
+ return JSON.parse(NodeFS.readFileSync(file, "utf8")) as Record<string, string>;
167
+ } catch {
168
+ return {};
169
+ }
170
+}
171
+
172
+/** Fills the live session, workspace, vars, and per-prompt tool ids, so repeated turns add rows. */
173
function materialize(
174
value: unknown,
148
- live: { readonly sessionId: string; readonly workspace: string; readonly turnKey: string },
175
+ live: {
176
+ readonly sessionId: string;
177
+ readonly workspace: string;
178
+ readonly turnKey: string;
179
+ readonly vars: Record<string, string>;
180
+ },
181
): unknown {
150
- if (typeof value === "string") return value.replaceAll("<workspace>", live.workspace);
182
+ if (typeof value === "string") {
183
+ return value
184
+ .replaceAll("<workspace>", live.workspace)
185
+ .replace(/<var:([\w-]+)>/g, (match, name: string) => live.vars[name] ?? match);
186
+ }
187
if (Array.isArray(value)) return value.map((entry) => materialize(entry, live));
188
if (typeof value !== "object" || value === null) return value;
189
return Object.fromEntries(
@@ -176,6 +212,58 @@ function permissionRejectedToolCallId(request: LogicalFrame, answer: unknown): s
212
return rejected ? params.toolCall?.toolCallId : undefined;
213
}
214
215
+interface McpServer {
216
+ readonly endpoint: string;
217
+ readonly authorization: string;
218
+}
219
+
220
+/** The T3 MCP server T3 hands the agent in session/new, through the stdio bridge's env. */
221
+function t3McpServer(servers: unknown): McpServer | undefined {
222
+ if (!Array.isArray(servers)) return undefined;
223
+ for (const server of servers as ReadonlyArray<{
224
+ env?: ReadonlyArray<{ name: string; value: string }>;
225
+ }>) {
226
+ const env = new Map((server.env ?? []).map((entry) => [entry.name, entry.value]));
227
+ const endpoint = env.get("T3_ACP_MCP_ENDPOINT");
228
+ const authorization = env.get("T3_ACP_MCP_AUTHORIZATION");
229
+ if (endpoint !== undefined && authorization !== undefined) return { endpoint, authorization };
230
+ }
231
+ return undefined;
232
+}
233
+
234
+/** One MCP tools/call over streamable HTTP: initialize, initialized, then the call. */
235
+async function callT3Tool(server: McpServer, name: string, args: unknown): Promise<unknown> {
236
+ let sessionHeader: string | undefined;
237
+ const post = async (body: object) => {
238
+ const response = await fetch(server.endpoint, {
239
+ method: "POST",
240
+ headers: {
241
+ authorization: server.authorization,
242
+ accept: "application/json, text/event-stream",
243
+ "content-type": "application/json",
244
+ ...(sessionHeader === undefined ? {} : { "mcp-session-id": sessionHeader }),
245
+ },
246
+ body: JSON.stringify({ jsonrpc: "2.0", ...body }),
247
+ });
248
+ sessionHeader = response.headers.get("mcp-session-id") ?? sessionHeader;
249
+ const text = await response.text();
250
+ // A streamed answer carries the JSON-RPC message on a `data:` line.
251
+ const data = text.split("\n").find((line) => line.startsWith("data:"));
252
+ return text.length === 0 ? undefined : JSON.parse(data === undefined ? text : data.slice(5));
253
+ };
254
+ await post({
255
+ id: 1,
256
+ method: "initialize",
257
+ params: {
258
+ protocolVersion: "2025-06-18",
259
+ capabilities: {},
260
+ clientInfo: { name: "t3-dev-replay", version: "1" },
261
+ },
262
+ });
263
+ await post({ method: "notifications/initialized" });
264
+ return post({ id: 2, method: "tools/call", params: { name, arguments: args } });
265
+}
266
+
267
function runAgent(): void {
268
const turnsByScenario = new Map<string, ReadonlyArray<ReplayTurn>>();
269
const loadTurns = (scenarioId: string) => {
@@ -191,7 +279,13 @@ function runAgent(): void {
279
280
const sessions = new Map<
281
string,
194
- { cwd: string; model: string; promptCount: number; cancel: (() => void) | undefined }
282
+ {
283
+ cwd: string;
284
+ model: string;
285
+ promptCount: number;
286
+ cancel: (() => void) | undefined;
287
+ mcp: McpServer | undefined;
288
+ }
289
>();
290
const pendingAgentRequests = new Map<string, (result: unknown) => void>();
291
let nextAgentRequestId = 1;
@@ -222,9 +316,33 @@ function runAgent(): void {
316
): Promise<"cancelled" | undefined> => {
317
const session = sessions.get(sessionId)!;
318
// Random, so a session loaded after a restart cannot reuse earlier tool rows.
225
- const live = { sessionId, workspace: session.cwd, turnKey: NodeCrypto.randomUUID() };
319
+ const live = {
320
+ sessionId,
321
+ workspace: session.cwd,
322
+ turnKey: NodeCrypto.randomUUID(),
323
+ vars: readReplayVars(),
324
+ };
325
for (const recorded of turn.frames) {
326
const frame = materialize(recorded.frame, live) as LogicalFrame;
327
+ if (frame.kind === "request" && frame.method === MCP_CALL) {
328
+ await sleep(recorded.afterMs ?? FRAME_DELAY_MS, signal);
329
+ if (signal.aborted) return;
330
+ const call = frame.params as { name: string; arguments?: unknown };
331
+ if (session.mcp === undefined) {
332
+ process.stderr.write(`dev replay agent has no T3 MCP server for ${call.name}\n`);
333
+ continue;
334
+ }
335
+ const result = await callT3Tool(session.mcp, call.name, call.arguments ?? {}).catch(
336
+ (error: unknown) => ({ error: String(error) }),
337
+ );
338
+ const failed = result as { error?: unknown; result?: { isError?: boolean } } | undefined;
339
+ if (failed?.error !== undefined || failed?.result?.isError === true) {
340
+ process.stderr.write(
341
+ `dev replay agent: ${call.name} failed: ${JSON.stringify(result)}\n`,
342
+ );
343
+ }
344
+ continue;
345
+ }
346
if (frame.kind === "request") {
347
await sleep(recorded.afterMs ?? FRAME_DELAY_MS, signal);
348
if (signal.aborted) return;
@@ -296,7 +414,13 @@ function runAgent(): void {
414
const sessionId =
415
message.method === "session/load" ? String(params.sessionId) : NodeCrypto.randomUUID();
416
const cwd = typeof params.cwd === "string" ? params.cwd : process.cwd();
299
- sessions.set(sessionId, { cwd, model: SCENARIOS[0].id, promptCount: 0, cancel: undefined });
417
+ sessions.set(sessionId, {
418
+ cwd,
419
+ model: SCENARIOS[0].id,
420
+ promptCount: 0,
421
+ cancel: undefined,
422
+ mcp: t3McpServer(params.mcpServers),
423
+ });
424
return {
425
...(message.method === "session/new" ? { sessionId } : {}),
426
models: {
apps/server/scripts/dev-replay/delegate_remote_transcript.ndjson
new
+9
@@ -0,0 +1,9 @@
1
+{"type": "transcript_start", "provider": "acpRegistry", "protocol": "acp.ndjson-jsonrpc", "version": "1", "scenario": "dev_replay_delegate_remote", "metadata": {"generatedBy": "hand-written for the dev replay agent"}}
2
+{"type": "expect_outbound", "frame": {"kind": "request", "method": "session/prompt", "params": "<any>"}}
3
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "The full suite takes a while on this laptop, so I'll run it on devbox."}}}}}
4
+{"type": "emit_inbound", "frame": {"kind": "request", "method": "t3/mcp_call", "params": {"name": "delegate_task", "arguments": {"title": "E2E suite", "task": "Run the e2e suite on main and report each failing spec with its error.", "target": {"environmentId": "<var:environmentId>", "projectId": "<var:projectId>", "model": "remote-child"}}}}, "afterMs": 600}
5
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "\n\nStarted **E2E suite** on devbox. I'll tell you what fails when it finishes."}}}}, "afterMs": 400}
6
+{"type": "emit_inbound", "frame": {"kind": "response", "method": "session/prompt", "result": {"stopReason": "end_turn"}}}
7
+{"type": "expect_outbound", "frame": {"kind": "request", "method": "session/prompt", "params": "<any>"}}
8
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "The suite finished on devbox: 144 specs ran and 2 failed.\n\n- `checkout.spec.ts` applies a coupon: the 10% coupon is applied after tax, so it charges $20.00 instead of $18.00.\n- `avatar.spec.ts` crops on Safari: times out waiting for the crop preview.\n\nWant me to fix the coupon first?"}}}}, "afterMs": 400}
9
+{"type": "emit_inbound", "frame": {"kind": "response", "method": "session/prompt", "result": {"stopReason": "end_turn"}}}
apps/server/scripts/dev-replay/remote_child_transcript.ndjson
new
+17
@@ -0,0 +1,17 @@
1
+{"type": "transcript_start", "provider": "acpRegistry", "protocol": "acp.ndjson-jsonrpc", "version": "1", "scenario": "dev_replay_remote_child", "metadata": {"generatedBy": "hand-written for the dev replay agent"}}
2
+{"type": "expect_outbound", "frame": {"kind": "request", "method": "session/prompt", "params": "<any>"}}
3
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "Installing dependencies, then running all 144 specs on 8 workers."}}}}, "afterMs": 300}
4
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call", "toolCallId": "install", "kind": "execute", "title": "pnpm install --frozen-lockfile", "status": "in_progress", "rawInput": {"command": "pnpm install --frozen-lockfile"}}}}, "afterMs": 600}
5
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "install", "status": "completed", "rawOutput": "Packages: +1243\nDone in 18.4s\n"}}}, "afterMs": 2000}
6
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call", "toolCallId": "build", "kind": "execute", "title": "pnpm build", "status": "in_progress", "rawInput": {"command": "pnpm build"}}}}, "afterMs": 400}
7
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "build", "status": "completed", "rawOutput": "✓ built in 6.2s\n"}}}, "afterMs": 2000}
8
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call", "toolCallId": "e2e", "kind": "execute", "title": "pnpm test:e2e", "status": "in_progress", "rawInput": {"command": "pnpm test:e2e"}}}}, "afterMs": 400}
9
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "in_progress", "rawOutput": "Running 144 tests using 8 workers\n 24/144 done, 0 failed\n"}}}, "afterMs": 2000}
10
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "in_progress", "rawOutput": "Running 144 tests using 8 workers\n 48/144 done, 1 failed\n"}}}, "afterMs": 2000}
11
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "in_progress", "rawOutput": "Running 144 tests using 8 workers\n 72/144 done, 1 failed\n"}}}, "afterMs": 2000}
12
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "in_progress", "rawOutput": "Running 144 tests using 8 workers\n 96/144 done, 1 failed\n"}}}, "afterMs": 2000}
13
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "in_progress", "rawOutput": "Running 144 tests using 8 workers\n 120/144 done, 2 failed\n"}}}, "afterMs": 2000}
14
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "in_progress", "rawOutput": "Running 144 tests using 8 workers\n 144/144 done, 2 failed\n"}}}, "afterMs": 2000}
15
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "tool_call_update", "toolCallId": "e2e", "status": "completed", "rawOutput": "Running 144 tests using 8 workers\n ✘ checkout.spec.ts:42 › applies a coupon\n Expected: \"$18.00\"\n Received: \"$20.00\"\n ✘ avatar.spec.ts:17 › crops on Safari\n Test timeout of 30000ms exceeded.\n\n 2 failed\n 142 passed (1.9m)\n"}}}, "afterMs": 1500}
16
+{"type": "emit_inbound", "frame": {"kind": "notification", "method": "session/update", "params": {"sessionId": "dev-replay-session", "update": {"sessionUpdate": "agent_message_chunk", "content": {"type": "text", "text": "\n\n144 specs ran and 2 failed:\n\n- `checkout.spec.ts` applies a coupon: expected **$18.00**, got **$20.00**. The 10% coupon is applied after tax instead of before.\n- `avatar.spec.ts` crops on Safari: timed out after 30s waiting for the crop preview.\n\nThe other 142 passed."}}}}, "afterMs": 1200}
17
+{"type": "emit_inbound", "frame": {"kind": "response", "method": "session/prompt", "result": {"stopReason": "end_turn"}}}
apps/server/src/environment/ServerEnvironment.test.ts
+30
@@ -4,6 +4,7 @@ import { ORCHESTRATION_PROTOCOL_VERSION } from "@t3tools/contracts";
4
import { expect, it } from "@effect/vitest";
5
import * as SecureRandom from "effect/crypto/SecureRandom";
6
import * as Deferred from "effect/Deferred";
7
+import * as ConfigProvider from "effect/ConfigProvider";
8
import * as Effect from "effect/Effect";
9
import * as FileSystem from "effect/FileSystem";
10
import * as Layer from "effect/Layer";
@@ -167,6 +168,35 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("ServerEnvironmen
168
});
169
}),
170
);
171
+ it.effect("names the environment and its machine from the overrides", () =>
172
+ Effect.gen(function* () {
173
+ const fileSystem = yield* FileSystem.FileSystem;
174
+ const baseDir = yield* fileSystem.makeTempDirectoryScoped({
175
+ prefix: "t3-server-environment-override-test-",
176
+ });
177
+ const descriptor = yield* Effect.gen(function* () {
178
+ const serverEnvironment = yield* ServerEnvironment.ServerEnvironment;
179
+ return yield* serverEnvironment.getDescriptor;
180
+ }).pipe(
181
+ Effect.provide(
182
+ layerServerEnvironment(baseDir).pipe(
183
+ Layer.provide(
184
+ ConfigProvider.layer(
185
+ ConfigProvider.fromEnv({
186
+ env: {
187
+ T3CODE_ENVIRONMENT_LABEL: " MacBook ",
188
+ T3CODE_ENVIRONMENT_MACHINE_KIND: "laptop",
189
+ },
190
+ }),
191
+ ),
192
+ ),
193
+ ),
194
+ ),
195
+ );
196
+ expect(descriptor.label).toBe("MacBook");
197
+ expect(descriptor.platform.machine).toBe("laptop");
198
+ }),
199
+ );
200
it.effect.each([
201
{ platform: "darwin", architecture: "arm64", supported: true },
202
{ platform: "linux", architecture: "x64", supported: true },
apps/server/src/environment/ServerEnvironmentLabel.ts
+12
@@ -1,4 +1,5 @@
1
import * as HostProcess from "@t3tools/shared/HostProcess";
2
+import * as Config from "effect/Config";
3
import * as Effect from "effect/Effect";
4
import * as FileSystem from "effect/FileSystem";
5
import * as Option from "effect/Option";
@@ -192,9 +193,20 @@ const isWsl = Effect.fn("isWsl")(function* () {
193
return kernelRelease.toLowerCase().includes("microsoft");
194
});
195
196
+// Names this environment instead of the machine, e.g. for staged demos and scenario captures.
197
+const labelOverride = Config.String("T3CODE_ENVIRONMENT_LABEL").pipe(
198
+ Config.option,
199
+ Config.map(Option.flatMap((label) => Option.fromNullishOr(normalizeLabel(label)))),
200
+);
201
+
202
export const resolveServerEnvironmentLabel = Effect.fn("resolveServerEnvironmentLabel")(function* (
203
input: ResolveServerEnvironmentLabelInput,
204
) {
205
+ const override = yield* labelOverride.pipe(Effect.orElseSucceed(() => Option.none<string>()));
206
+ if (Option.isSome(override)) {
207
+ return override.value;
208
+ }
209
+
210
const friendlyHostLabel = yield* resolveFriendlyHostLabel();
211
if (friendlyHostLabel) {
212
return friendlyHostLabel;
apps/server/src/environment/ServerEnvironmentMachine.ts
+15
-1
@@ -1,7 +1,9 @@
1
-import type { EnvironmentMachineKind } from "@t3tools/contracts";
1
+import { EnvironmentMachineKind } from "@t3tools/contracts";
2
import * as HostProcess from "@t3tools/shared/HostProcess";
3
+import * as Config from "effect/Config";
4
import * as Effect from "effect/Effect";
5
import * as FileSystem from "effect/FileSystem";
6
+import * as Option from "effect/Option";
7
8
import * as ProcessRunner from "../processRunner.ts";
9
@@ -142,8 +144,20 @@ const detectLinuxMachineKind = Effect.fn("detectLinuxMachineKind")(function* ()
144
return machineKindFromDmi({ chassisType, sysVendor, productName });
145
});
146
147
+// Overrides detection, e.g. for staged demos on a VM that should read as a laptop.
148
+const machineKindOverride = Config.schema(
149
+ EnvironmentMachineKind,
150
+ "T3CODE_ENVIRONMENT_MACHINE_KIND",
151
+).pipe(Config.option);
152
+
153
export const detectServerEnvironmentMachineKind = Effect.fn("detectServerEnvironmentMachineKind")(
154
function* () {
155
+ const override = yield* machineKindOverride.pipe(
156
+ Effect.orElseSucceed(() => Option.none<EnvironmentMachineKind>()),
157
+ );
158
+ if (Option.isSome(override)) {
159
+ return override.value;
160
+ }
161
const platform = yield* HostProcess.Platform;
162
switch (platform) {
163
case "darwin":
docs/operations/development.md
+3
-1
@@ -96,7 +96,9 @@ Dev servers add it back on start, so turn it off in Settings instead of removing
96
To add a scenario, point a `SCENARIOS` entry at a generic ACP replay fixture
97
(`registry_transcript.ndjson`) or a file in [dev-replay](../../apps/server/scripts/dev-replay).
98
The agent replays session updates, permission requests, and questions. It drops session setup
99
-and vendor frames, so Grok and fx recordings lose their vendor-only behavior.
99
+and vendor frames, so Grok and fx recordings lose their vendor-only behavior. A `t3/mcp_call`
100
+request frame (`{ name, arguments }`) makes the agent call that T3 tool itself over its MCP
101
+session, and `<var:name>` in any frame is filled from the JSON file at `T3_DEV_REPLAY_VARS`.
102
103
### Profiling dev startup
104
scripts/scenarios/machine-switch-keeps-selected-models.e2e.ts
+2
@@ -54,6 +54,8 @@ test(
54
await dialog.getByPlaceholder("backend.example.com").fill(host);
55
await dialog.getByPlaceholder("PAIRCODE").fill(token);
56
await dialog.getByRole("button", "Add environment").tap();
57
+ // The map is the default view; its rows carry no actions menu.
58
+ await screen.getByRole("button", "List", { exact: true }).tap();
59
await expect(screen.getByRole("button", "More actions for Scenario")).toBeVisible({
60
timeout: 60_000,
61
});
scripts/scenarios/second-server.ts
+2
-1
@@ -12,7 +12,7 @@ import * as Path from "effect/Path";
12
13
import { APP_DIR, T3_HOME } from "../e2e.config.ts";
14
import { ScenarioError } from "./shell.ts";
15
-import { prepareHome, start } from "./start-app.ts";
15
+import { prepareHome, SCENARIO_MACHINE_ENV, start } from "./start-app.ts";
16
17
export const SECOND_HOME = `${T3_HOME}-second-environment`;
18
@@ -47,6 +47,7 @@ const runSecondServer = Effect.fn("scenario.secondServer")(function* (
47
PATH: `${path.join(SECOND_HOME, "bin")}:${hostEnvironment.PATH ?? ""}`,
48
HOME: hostEnvironment.HOME,
49
T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD: "0",
50
+ ...SCENARIO_MACHINE_ENV,
51
},
52
onLine: (line) => {
53
const value = /^Token:\s*(\S+)/.exec(line)?.[1];
scripts/scenarios/start-app.ts
+6
-16
@@ -38,17 +38,11 @@ const REAL_PROVIDERS = [
38
"antigravity",
39
];
40
41
-// The server labels its environment with the host's name, probed through these commands.
42
-// Captures must not depend on, or show, the machine that made them.
43
-const HOST_LABEL_SHIM = `#!/bin/sh
44
-case "$*" in
45
- "--pretty" | "--get ComputerName") echo "Scenario" ;;
46
- *) for real in /usr/bin /usr/sbin /bin; do
47
- [ -x "$real/$(basename "$0")" ] && exec "$real/$(basename "$0")" "$@"
48
- done
49
- exit 127 ;;
50
-esac
51
-`;
41
+/** Captures must not depend on, or show, the machine that made them. */
42
+export const SCENARIO_MACHINE_ENV = {
43
+ T3CODE_ENVIRONMENT_LABEL: "Scenario",
44
+ T3CODE_ENVIRONMENT_MACHINE_KIND: "laptop",
45
+};
46
47
const encodeSettings = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
48
@@ -58,11 +52,6 @@ export const prepareHome = Effect.fn("startApp.prepareHome")(function* (home: st
52
yield* fs.remove(home, { recursive: true, force: true });
53
yield* fs.makeDirectory(path.join(home, "userdata"), { recursive: true });
54
yield* fs.makeDirectory(path.join(home, "bin"));
61
- for (const command of ["hostnamectl", "scutil"]) {
62
- const shim = path.join(home, "bin", command);
63
- yield* fs.writeFileString(shim, HOST_LABEL_SHIM);
64
- yield* fs.chmod(shim, 0o755);
65
- }
55
// Editor discovery is cached, so the recording shim must exist before the server starts.
56
const editor = path.join(home, "bin", "cursor");
57
yield* fs.writeFileString(
@@ -137,6 +126,7 @@ const startApp = Effect.fn("startApp")(function* (input: {
126
...hostEnvironment,
127
PATH: `${path.join(input.home, "bin")}:${hostEnvironment.PATH ?? ""}`,
128
T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD: "0",
129
+ ...SCENARIO_MACHINE_ENV,
130
};
131
const devRunner = (mode: string, args: ReadonlyArray<string>) => [
132
"scripts/dev-runner.ts",