feat(desktop,host-service): import project setup from external tools
What
Teams moving to Superset often already have workspace setup written for another tool. This detects it in a project's repo root and turns it into Superset project lifecycle scripts, after showing exactly what will be written.
Detected files, in this order (all candidates are offered when there are several):
| Tool | Files |
|---|---|
| Conductor | conductor.json |
| Orca | orca.yaml, .worktreeinclude |
| Codex | .codex/environments/environment.toml |
| cmux | .cmux/cmux.json, then cmux.json |
| T3 Code | t3.json |
Mapping, variable rewrites, and what is not imported are in the new docs page apps/docs/content/docs/switch-to-superset.mdx.
Where it shows up
- Sidebar setup card: when a project has no Superset scripts and a tool file exists, the card reads "Found Conductor setup" with an Import button. The success toast links to the project's scripts.
- Project settings → Project lifecycle scripts: an "Import from …" button next to the Setup / Teardown / Run tabs while an import would change something.
- Dialog: source picker, the commands to be written, a preview of any script file, current vs imported for fields it replaces ("Replace and import"), and a "Not imported" list with the reason for each field.
How
packages/host-service/src/runtime/setup/import/: one pure parser per source with Orca's limits (256 KiB file, 64 KiB field, list and line caps), plus variable rewrite, layout, conflict check and apply. Unit tests per source on small fixtures.- Multi-line scripts. Superset joins entries with
&&, and the editor treats each line as a command. A script where every line is a complete command is imported as one entry per line (comments dropped). Anything else (if/fi, loops, functions,\continuations, heredocs, inline comments) is written to.superset/<key>.shwithbash+set -e, and the config runsbash "$SUPERSET_ROOT_PATH/.superset/<key>.sh". Splitting those safely is not possible in general, and keeping a visible entry inconfig.jsonkeeps the editor honest about what runs. A later import that replaces such a script with plain commands deletes it, only if it carries the import header. - Orca shared and copied paths become guarded
ifblocks (skip a missing source or an existing destination, as Orca does), so an Orca setup with them always goes tosetup.sh. - Never overwrites silently.
importSetuprefuses withCONFLICTunlessoverwriteis set, and refuses a malformedconfig.jsonwithBAD_REQUEST(the dialog warns before Import and disables it). - tRPC: two new host-service procedures,
config.getSetupImportCandidatesandconfig.importSetup. Nothing existing changed. The renderer treats a host without them as "no candidates" (retry: false). - Run button refresh: the v2 Run button reads from a per-host query client, so imports and scripts-editor saves did not refresh it. Added
invalidateHostServiceQueryin@superset/workspace-client.
Also
SUPERSET_WORKSPACE_NAMEin v2 terminals. The docs promise it and v1 sets it; v2 left it out when host-service had no name column. It now comes fromworkspaces.name, with no fallback to the branch (as #3184 asked). Scripts that use it, including this repo's.supersetscripts, get the display name now instead of falling back to the folder name.bun.lockalso drops the staleapps/discord-triageentry left by #8474.- i18n: all new strings translated into every locale;
check:i18npasses.
Validation
Films, edge-case table and screenshots (org-only page): https://app.superset.sh/page/import-setup-from-other-tools-verification-aak94k
- Dev desktop app over CDP with real input, seven fixture repos. Both entry points, replace, recovery when files change mid-dialog, broken config, keyboard, light theme, Japanese, a new workspace actually running the imported setup (and printing
$SUPERSET_WORKSPACE_NAME), Orca links and copies. No console errors. - Tests: host-service import, setup, config router and terminal env suites pass (145), i18n (164). Full host-service run: 2 failures (session folder dedupe, terminal disposal with a real daemon); full desktop run: 36 failures, all in tests that drive real
gitor a login shell. None are in code this branch touches; I did not re-run them onmainto confirm. - Lint clean. Typecheck shows no errors in this branch's files; locally there are better-auth type errors in
packages/auth/packages/trpcfrom two installed copies of better-auth, which this branch doesn't touch. - Docs pass the Vale prose rules.
Not fixed here (existing)
- Escape inside project settings closes a dialog and also navigates back a level (same with the Delete project dialog).
- A malformed
config.jsonshows as empty in the scripts editor, and saving there replaces it (updateConfigresets it). The import refuses to do that.
Summary by cubic
Imports an existing project setup from Conductor, Orca, cmux, T3 Code, or Codex into Superset project lifecycle scripts after showing exactly what will be written. Also sets SUPERSET_WORKSPACE_NAME in v2 terminals, which previously was never populated there.
Import behavior
- Detects
conductor.json,orca.yamlwith.worktreeinclude,.codex/environments/environment.toml,.cmux/cmux.jsonorcmux.json, andt3.jsonin the project's repo root; every candidate is offered when there are several. - The import appears in the sidebar setup card and in Project settings → Project lifecycle scripts, with a preview of every command and script file, explicit replacement confirmation, and a list of fields that are not imported along with the reason.
- Simple multi-line scripts become one entry per line; anything with
if/fi, loops, functions,\continuations, heredocs, inline comments, or multi-line$(...)/backticks is written to.superset/<key>.shand run viabashwithset -e. Imported labels are shown as "to be imported" and replacements as "Replaces current commands". - Orca shared and copied paths become guarded
ifblocks so a missing source or an existing destination is skipped; copy/link destinations that are dangling symlinks are skipped and paths are./-prefixed. - The import never overwrites silently: existing setup requires an explicit overwrite confirmation; a malformed
.superset/config.jsonis refused withBAD_REQUEST; writes refuse to pass through a symlink or a.supersetdir resolving outside the project, and an unresolvable project root is refused outright (the dialog warns and disables Import); andimportSetuptakes the preview's fingerprint and returnsCONFLICTif the file changed since preview. Writes are atomic via temp file + rename usingnode:fs/promises. - Two new tRPC procedures,
config.getSetupImportCandidatesandconfig.importSetup, are added; no existing procedure changes, and hosts that predate them are treated as having no candidates. The TOML parser rejects out-of-range\Uescapes and decodes quoted table and key names, and a failing source no longer hides the others.
Also in this PR
SUPERSET_WORKSPACE_NAMEnow comes from the workspace display name in v2 terminals, with no branch fallback.- Adds
invalidateHostServiceQueryto@superset/workspace-clientso the v2 Run button and scripts editor are refreshed by imports and saves. - The full mapping is documented on a new "Switch to Superset" docs page, and all new strings are translated into every locale.
bun.lockdrops the stale@superset/discord-triageentry.
Summary by CodeRabbit
- New Features
- Import setup scripts and configuration from Conductor, Orca, cmux, T3 Code, and Codex into project lifecycle scripts.
- Review script previews, detected changes, conflicts, and items that cannot be imported before confirming.
- Start imports from project settings or the dashboard, and choose whether to replace existing scripts when conflicts arise.
- Imported scripts and working-directory settings are reflected in the project configuration. Unsafe import paths and invalid configuration are flagged.
- Documentation
- Added a guide to supported setup imports, mappings, and limitations.