Skip to content

feat(onboarding): attach-your-own-vault in the wizard finale - #35

Merged
jack-champagne merged 2 commits into
local/amicodefrom
feat/onboarding-vault-attach
Jul 20, 2026
Merged

feat(onboarding): attach-your-own-vault in the wizard finale#35
jack-champagne merged 2 commits into
local/amicodefrom
feat/onboarding-vault-attach

Conversation

@jack-champagne

Copy link
Copy Markdown
Member

What

Folds an attach-your-own-vault affordance into the onboarding wizard finale, and adds the write endpoint behind it.

  • POST /amicode/vaults (server/amicode/vaults.ts + route in httpapi/server.ts): clones a repo or symlinks a local vault dir into ~/.amico/vaults, so resolveMountStack discovers it like any other mount. Refs resolve as: owner/repo / git URL / bare-name (→ harmoniqs/<name>) → clone (primary); an absolute/~/. path with an .amico-vault.toml marker → symlink (secondary). Success is independent of the amico-vault CLI and returns its own {ok,name,kind,path} shape (distinct from status()'s mounts shape).
  • Wizard finale (ui/src/amicode/onboarding-wizard.tsx): a quiet, collapsible "Already have a vault? Attach it →" that expands to a ref input + Attach, a ✓-list of attached mounts, and inline errors. Gated behind a new optional onAttachVault prop so the component degrades gracefully when unwired.
  • Host (app/src/pages/home.tsx): attachVault handler → POST /amicode/vaults, mapping server error codes to human-readable messages; passes onAttachVault to the wizard.

The personal vault itself is created by default on the extension side (amicode sister PR) — this PR is the "bring your own / additional vaults" half.

Test

  • packages/opencode: bun test test/server/amicode-vaults.test.ts15 pass (new: normalizeRef, sanitizeVaultName, attachVault incl. local-path symlink, not_a_vault, exists, bad-body).
  • ui / app / opencode typecheck clean; onboarding-wizard.test.ts passes.
  • Live in an isolated $HOME (no .amico) off a local build of this branch: POST /amicode/vaults symlinks a marker dir into the fresh vaults root (ok:true); not_a_vault/bad_request/exists errors correct; unauthenticated → 401. Built app asset carries the finale affordance.

🤖 Generated with Claude Code

Add POST /amicode/vaults (clone a repo / symlink a local vault dir into the
vaults root) and a quiet finale affordance in the onboarding wizard to attach
an existing vault. Repo refs (owner/repo, git URL, bare name → harmoniqs/) are
primary; local paths with an .amico-vault.toml marker are secondary. Attach
success is independent of the amico-vault CLI.
When amico-vault isn't resolvable (a fresh / marketplace user without the
amico-ops install), GET /amicode/vaults lists mounts straight off
~/.amico/vaults markers instead of returning cli_not_found — so the tab
reflects the personal vault + anything attached. The CLI stays the preferred
path (richer git sync info) when present.
@jack-champagne
jack-champagne force-pushed the feat/onboarding-vault-attach branch from f234cc4 to c3fd73a Compare July 20, 2026 13:05
@jack-champagne
jack-champagne merged commit f44738e into local/amicode Jul 20, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant