feat: Add WizardAdapter for mounting on CLI - #11
Merged
Conversation
The wizard needs two things it cannot decide for itself: the developer's Seam login, and somewhere to keep what it learns about a project. Both belong to whoever mounts it — the Seam CLI owns the login, and owns where files go — so this is the shape of the answer. Nothing reads the host yet. It is stated and accepted here on its own, so that the CLI can be built against it without waiting on the change that puts it to use. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
This was referenced Aug 12, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
'Host' reads as a URL, which is the one thing it is not: it is whoever mounts the wizard, answering for what the wizard cannot decide. And the Seam API address is an endpoint everywhere else, including the environment variable that overrides it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
The adapter reported which kind of credential the CLI held so the wizard could decide what to do with it. The wizard only ever uses an API key, so the CLI hands over one or hands over nothing, and the enum goes with it. endpointSource goes the same way, and WizardValues is named for what it is. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
It is the default the wizard falls back to and the one its own tests set. Nothing outside imports it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The wizard needs two things it cannot decide for itself: the developer's Seam login, and somewhere to keep what it learns about a project. Both belong to whoever mounts it — the Seam CLI owns the login and owns where files go.
This states the shape of that answer and accepts it, and does nothing else. Split out of #7 so that seamapi/cli#614 can be built and released against it without waiting on the change that puts it to use.
The contract
The wizard picks the keys, the adapter picks the files. Values are plain JSON and hold no secrets.
apiKeyis a workspace API key or null: it is the only credential the wizard uses, and the only kind a project'sSEAM_API_KEYmay be, so a personal access token is never passed at all.Given no adapter, an in-memory one is used: every step works and nothing outlives the run.
Nothing reads it yet
Deliberately additive. Behaviour is unchanged:
.seam/onboarding.jsonis still written, and an adapter passed in is accepted, its auth loaded once, and otherwise unused until #7 lands. So this can be released on its own, and the CLI can depend on it, before anything about the wizard's storage moves.Changed
lib/adapter.ts— the interfaces, the in-memory default, and the run's adapter.lib/wizard.ts— anadapteroption, installed before the run and asked for its auth once.--helpand--versionask it nothing.lib/index.ts— exports the three types. Nothing else is added to the package surface.78 tests, 16 of them new: the in-memory default, replacing the adapter, the auth being asked for exactly once, and it being forgotten when the adapter changes.