Skip to content

Commit de66979

Browse files
donjor-agent[bot]donjor
authored andcommitted
refactor(fork-meta): drop the dev-app launcher; agents run upstream dev and place windows with donjor hypr (#1827)
## Problem A delegated agent ran `vp run dev:app --external` and a tab opened in the human's own Chrome. `scripts/lib/dev-app.ts` passed `--browser`, so the server ran `xdg-open`. The launcher also duplicated desktop placement that `donjor hypr` owns. ## Change Removed the fork's dev-app launcher and its seams; agents use upstream `vp run dev`. **Deleted:** - `dev:app`, `dev:desktop:agent`, `hypr:workspace` - their scripts, libs, and tests - `--preview`, `--external`, `--desktop`, `--workspace` - raw `hyprctl` workspace helpers - web preview handoff - desktop agent placement - desktop user-data override - `scripts/cli-exemptions.json` **Restored to upstream:** - `t3.json`, `.env.example` - `DesktopUserData.ts` - `test-t3-app`, `test-t3-mobile` skills - `runProjectScript` in `useChatTerminalActions.ts` **Simplified:** the Hyprland rule lifetime option had one caller left; removed. **Kept:** - `T3CODE_DESKTOP_DEVTOOLS`: generic dev opt-out - multi-window web fixes from the same commit - `t3code.desktop-agent.*` Lua handle names Agents start the app plainly and open its URL with `donjor hypr cdp page new`. Nothing auto-opens the human's browser. **Diff:** 43 files, +41 / −4,854. ## Scope and approval Fixes RSI-Software/donjor-skills#1200; the human asked for the removal. GitHub refuses a private-to-public transfer, so that issue closes by hand after merge. ## Verification ```text vp run typecheck → exit 0 vp run build → exit 0 vp run fork:ci → exit 0 vp test run apps/desktop/src/window apps/desktop/src/app → exit 0 (272 passed) vp test run src/components/chat (apps/web) → exit 0 (360 passed) vp run check:changed → exit 1 ``` `check:changed` fails one test: `GitManager > includes CLAUDE.md for Claude writers`. It fails locally with `apps/server` untouched; `hyprws CI` is green on the base. Claude Opus 5.5, via Claude Code. ## Fork trailers Squashes: - d651c3e refactor(fork-meta): drop the dev-app launcher; agents run upstream dev and place windows with donjor hypr (#1827) (#1827) - 0d96820 fixup! refactor(fork-meta): drop the dev-app launcher; agents run upstream dev and place windows with donjor hypr (#1827) (#1827) Fork-Domain: fork-meta Fork-Tier: qol Co-authored-by: donjor <[email protected]>
1 parent 96ccee7 commit de66979

43 files changed

Lines changed: 81 additions & 4896 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/test-t3-app/SKILL.md‎

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,10 @@ testing, use [test-t3-mobile](../test-t3-mobile/SKILL.md).
1212

1313
## Start the app
1414

15-
Reuse this task's healthy dev server. Otherwise run `vp run dev:app` from the
16-
checkout whose code must be tested and retain its terminal session: `--preview`
17-
for a native T3 agent, `--external` for the external browser, `--desktop` for
18-
Electron. The launcher owns startup pairing, uses that checkout's ignored `.t3`
19-
state, and creates or reuses the editable fixture repository at
20-
`.t3/test-project`. Read the actual ports and ready URL from the dev-runner
21-
output; do not infer a port or open an earlier URL. Never run against
22-
`~/.t3/userdata` or set `VITE_HTTP_URL` or `VITE_WS_URL`.
23-
24-
Keep one backend per checkout home. Stop the owned launcher before changing
25-
surface, then start the new selection against the same retained home. T3's
26-
**Dev Web** project action spells `--preview`, and `--desktop` accepts
27-
`--workspace <+1|-1|id|none>` when explicit placement is required. **Dev Web**
28-
launches on the checkout's machine and needs the primary local environment;
29-
secondary desktop backends, remote, relay and SSH environments are out of
30-
scope, and it gives a cold build ten minutes to emit its ready URL before
31-
timing out. `t3.json`
32-
actions are imported into T3 once and stored as project-owned copies, so update
33-
the imported copy after changing a checked-in action.
15+
Reuse this task's healthy dev server. Otherwise run `vp run dev` from the
16+
repository root and retain its terminal session. Use the worktree's ignored
17+
`.t3` state and read the actual ports and pairing URL from the dev-runner output.
18+
Never run against `~/.t3/userdata` or set `VITE_HTTP_URL` or `VITE_WS_URL`.
3419

3520
Test with meaningful project and thread data. Read
3621
[references/sqlite-fixtures.md](references/sqlite-fixtures.md) only when
@@ -41,21 +26,15 @@ inspecting or seeding SQLite. Stop the test server before direct fixture writes.
4126
Call `preview_status`, then `preview_open` if the Browser panel is
4227
closed. Navigate to the complete startup pairing URL once with
4328
`preview_navigate`, then use `preview_snapshot` and T3's interaction tools.
44-
If the token was consumed or expired, run
45-
`node apps/server/src/bin.ts pair --base-dir "$PWD/.t3"` from the same checkout
46-
root for a fresh one; the explicit home stops it selecting the installed app's
47-
home. Keep using the same tab.
29+
If the token was consumed or expired, run `node apps/server/src/bin.ts pair`
30+
for a fresh one. Keep using the same tab.
4831

4932
## Verify and retain
5033

5134
Exercise the affected flow and capture the state that proves it works. Keep
5235
the server, state, and panel available while the user inspects or iterates.
5336
An assistant turn ending is not teardown. Stop only processes you started,
54-
using retained terminal sessions or captured PIDs. Preserve the checkout's
55-
`.t3` home and `.t3/test-project`; they carry the retained test state for the
56-
next run. When authentication, migrations, or fixture state becomes ambiguous,
57-
inspect the retained home and name the problem; do not replace it with a fresh
58-
home as an implicit reset.
37+
using retained terminal sessions or captured PIDs.
5938

6039
When sharing is requested, start with `vp run dev --share` and give the user
6140
a fresh complete pairing URL that you have not consumed. Keep other credentials

‎.agents/skills/test-t3-mobile/SKILL.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ and stop verification. Do not install or switch to another automation system.
1717

1818
## Use an isolated backend
1919

20-
Reuse this task's healthy backend. When a `dev:app` web or Electron surface
21-
already owns that checkout's backend, reuse its printed server port and `.t3`
22-
base directory instead of starting a second one; each mobile client still needs
23-
its own pairing credential. Otherwise run `vp run dev` from the repository root,
24-
retain its terminal session, and read the actual backend port from the
25-
dev-runner output. Use the worktree's ignored `.t3` state. Never run
20+
Reuse this task's healthy backend. Otherwise run `vp run dev` from the
21+
repository root, retain its terminal session, and read the actual backend port
22+
from the dev-runner output. Use the worktree's ignored `.t3` state. Never run
2623
against `~/.t3/userdata`. The Browser panel is not required for this workflow.
2724

2825
Test with meaningful project and thread data. Read the shared

‎.env.example‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
# secrets. Remove or comment them out to build with cloud features disabled.
55
# Do not add server-side secrets to this file.
66

7-
# Optional: place the Dev Desktop Agent action one numbered Hyprland workspace
8-
# before the invoking app. Unset by default so the compositor chooses placement.
9-
# T3CODE_DESKTOP_AGENT_WORKSPACE=-1
10-
117
# Production Clerk instance. To use your own, get these from the Clerk Dashboard
128
# under API keys, JWT templates, and OAuth applications.
139
T3CODE_CLERK_PUBLISHABLE_KEY=pk_live_Y2xlcmsudDMuY29kZXMk

‎apps/desktop/src/app/DesktopClerk.fork.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const makeDesktopClerkLayer = (
3838
const environment = DesktopEnvironment.DesktopEnvironment.of({
3939
stateDir: "/tmp/t3-state",
4040
isDevelopment: true,
41-
userDataDirectoryOverride: Option.none(),
4241
appDataDirectory: "/tmp/app-data",
4342
platform: "darwin",
4443
} as unknown as DesktopEnvironment.DesktopEnvironment["Service"]);

‎apps/desktop/src/app/DesktopClerk.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const layerDesktopClerk = (
6060
const environment = DesktopEnvironment.DesktopEnvironment.of({
6161
stateDir: "/tmp/t3-state",
6262
isDevelopment,
63-
userDataDirectoryOverride: Option.none(),
6463
appDataDirectory: "/tmp/app-data",
6564
platform,
6665
} as unknown as DesktopEnvironment.DesktopEnvironment["Service"]);

‎apps/desktop/src/app/DesktopConfig.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ export const DesktopConfig = Config.all({
6060
disableAutoUpdate: optionalBoolean("T3CODE_DISABLE_AUTO_UPDATE"),
6161
mockUpdates: optionalBoolean("T3CODE_DESKTOP_MOCK_UPDATES"),
6262
devToolsEnabled: Config.Boolean("T3CODE_DESKTOP_DEVTOOLS").pipe(Config.withDefault(true)), // fork-hook: fork-meta/desktop-config-devtools
63-
userDataDirectoryOverride: trimmedString("T3CODE_DESKTOP_USER_DATA_DIR"),
64-
agentWorkspace: Config.Int("T3CODE_DESKTOP_AGENT_WORKSPACE").pipe(Config.option), // fork-hook: fork-meta/desktop-config-agent-workspace
65-
agentPlacementTitle: trimmedString("T3CODE_DESKTOP_AGENT_PLACEMENT_TITLE"),
6663
mockUpdateServerPort: Config.Port("T3CODE_DESKTOP_MOCK_UPDATE_SERVER_PORT").pipe(
6764
Config.withDefault(3000),
6865
),

‎apps/desktop/src/app/DesktopEnvironment.fork.test.ts‎

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
22
import { assert, describe, it } from "@effect/vitest";
33
import * as Effect from "effect/Effect";
44
import * as Layer from "effect/Layer";
5-
import * as Option from "effect/Option";
65
import * as DesktopEnvironment from "./DesktopEnvironment.ts";
76
import * as DesktopConfig from "./DesktopConfig.ts";
87
const defaultInput = {
@@ -30,39 +29,6 @@ const makeEnvironment = (
3029
) =>
3130
DesktopEnvironment.DesktopEnvironment.pipe(Effect.provide(makeEnvironmentLayer(overrides, env)));
3231
describe("DesktopEnvironment", () => {
33-
it.effect("resolves agent placement only for a valid development launch", () =>
34-
Effect.gen(function* () {
35-
const placement = yield* makeEnvironment(
36-
{},
37-
{
38-
VITE_DEV_SERVER_URL: "http://localhost:5173",
39-
T3CODE_DESKTOP_AGENT_WORKSPACE: "8",
40-
T3CODE_DESKTOP_AGENT_PLACEMENT_TITLE: "t3code-dev-agent-abc",
41-
},
42-
);
43-
assert.deepEqual(
44-
placement.devAgentPlacement,
45-
Option.some({ workspace: 8, title: "t3code-dev-agent-abc" }),
46-
);
47-
const production = yield* makeEnvironment(
48-
{},
49-
{
50-
T3CODE_DESKTOP_AGENT_WORKSPACE: "8",
51-
T3CODE_DESKTOP_AGENT_PLACEMENT_TITLE: "t3code-dev-agent-abc",
52-
},
53-
);
54-
assert.deepEqual(production.devAgentPlacement, Option.none());
55-
const invalid = yield* makeEnvironment(
56-
{},
57-
{
58-
VITE_DEV_SERVER_URL: "http://localhost:5173",
59-
T3CODE_DESKTOP_AGENT_WORKSPACE: "0",
60-
T3CODE_DESKTOP_AGENT_PLACEMENT_TITLE: "invalid,title",
61-
},
62-
);
63-
assert.deepEqual(invalid.devAgentPlacement, Option.none());
64-
}),
65-
);
6632
it.effect("keeps devtools on by default and lets a dev run opt out", () =>
6733
Effect.gen(function* () {
6834
const defaults = yield* makeEnvironment({}, { VITE_DEV_SERVER_URL: "http://localhost:5173" });

‎apps/desktop/src/app/DesktopEnvironment.ts‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ import { resolveDesktopBaseDir, resolveDesktopStateDir } from "./DesktopStatePat
1818
import { isNightlyDesktopVersion } from "../updates/updateChannels.ts";
1919
import type { OtlpProtocol } from "@t3tools/shared/observability";
2020

21-
export type DesktopDevAgentPlacement = {
22-
readonly workspace: number;
23-
readonly title: string;
24-
};
25-
2621
export interface MakeDesktopEnvironmentInput {
2722
readonly dirname: string;
2823
readonly homeDirectory: string;
@@ -45,10 +40,6 @@ export class DesktopEnvironment extends Context.Service<
4540
readonly isPackaged: boolean;
4641
readonly isDevelopment: boolean;
4742
readonly devToolsEnabled: boolean; // fork-hook: multi-window/devtools-enabled
48-
// Development-only: isolates Electron/Clerk state and the single-instance lock.
49-
readonly userDataDirectoryOverride: Option.Option<string>;
50-
// Development-only map-time placement requested by dev:desktop:agent.
51-
readonly devAgentPlacement: Option.Option<DesktopDevAgentPlacement>;
5243
readonly appVersion: string;
5344
readonly appPath: string;
5445
readonly resourcesPath: string;
@@ -153,21 +144,6 @@ function resolveDesktopRuntimeInfo(input: {
153144
};
154145
}
155146

156-
function resolveDesktopDevAgentPlacement(input: {
157-
readonly isDevelopment: boolean;
158-
readonly workspace: Option.Option<number>;
159-
readonly title: Option.Option<string>;
160-
}): Option.Option<DesktopDevAgentPlacement> {
161-
if (!input.isDevelopment || Option.isNone(input.workspace) || Option.isNone(input.title)) {
162-
return Option.none();
163-
}
164-
const workspace = input.workspace.value;
165-
const title = input.title.value;
166-
return Number.isInteger(workspace) && workspace > 0 && !title.includes(",")
167-
? Option.some({ workspace, title })
168-
: Option.none();
169-
}
170-
171147
const make = Effect.fn("desktop.environment.make")(function* (
172148
input: MakeDesktopEnvironmentInput,
173149
): Effect.fn.Return<DesktopEnvironment["Service"], Config.ConfigError, Path.Path> {
@@ -206,11 +182,6 @@ const make = Effect.fn("desktop.environment.make")(function* (
206182
joinPath: path.join,
207183
t3Home: config.t3Home,
208184
});
209-
const devAgentPlacement = resolveDesktopDevAgentPlacement({
210-
isDevelopment,
211-
workspace: config.agentWorkspace,
212-
title: config.agentPlacementTitle,
213-
});
214185
const linuxApplicationsDir = path.join(
215186
Option.getOrElse(config.xdgDataHome, () => path.join(homeDirectory, ".local", "share")),
216187
"applications",
@@ -225,8 +196,6 @@ const make = Effect.fn("desktop.environment.make")(function* (
225196
isPackaged: input.isPackaged,
226197
isDevelopment,
227198
devToolsEnabled: config.devToolsEnabled, // fork-hook: multi-window/devtools-enabled
228-
userDataDirectoryOverride: isDevelopment ? config.userDataDirectoryOverride : Option.none(),
229-
devAgentPlacement,
230199
appVersion: input.appVersion,
231200
appPath: input.appPath,
232201
resourcesPath,

‎apps/desktop/src/app/DesktopUserData.fork.test.ts‎

Lines changed: 0 additions & 106 deletions
This file was deleted.

‎apps/desktop/src/app/DesktopUserData.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as Effect from "effect/Effect";
22
import * as FileSystem from "effect/FileSystem";
3-
import * as Option from "effect/Option"; // fork-hook: fork-meta/user-data-override-import
43
import * as Path from "effect/Path";
54
import * as PlatformError from "effect/PlatformError";
65
import * as Schema from "effect/Schema";
@@ -37,13 +36,9 @@ export const resolveUserDataPath = Effect.fn("desktop.userData.resolveUserDataPa
3736
readonly appDataDirectory: string;
3837
readonly isDevelopment: boolean;
3938
readonly platform: NodeJS.Platform;
40-
readonly userDataDirectoryOverride?: Option.Option<string>; // fork-hook: fork-meta/user-data-override-input
4139
}) {
4240
const fs = yield* FileSystem.FileSystem;
4341
const path = yield* Path.Path;
44-
if (input.userDataDirectoryOverride && Option.isSome(input.userDataDirectoryOverride)) {
45-
return path.resolve(input.userDataDirectoryOverride.value);
46-
} // fork-hook: fork-meta/user-data-override
4742
const names = input.isDevelopment
4843
? { current: "t3code-dev", legacy: "T3 Code (Dev)" }
4944
: { current: "t3code-v2", legacy: "T3 Code (Alpha)" };

0 commit comments

Comments
 (0)