Skip to content

feat: Pass adapter to the wizard - #614

Merged
razor-x merged 1 commit into
mainfrom
claude/wizard-file-store-cli-4njgxv
Aug 12, 2026
Merged

feat: Pass adapter to the wizard#614
razor-x merged 1 commit into
mainfrom
claude/wizard-file-store-cli-4njgxv

Conversation

@razor-x

@razor-x razor-x commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

The CLI mounts the wizard as seam wizard, owns the login, and owns where files go. It now answers for all three, so the wizard asks rather than working them out for itself.

Two files: createWizardAdapter beside the runWizard that hands it over, and its test. Built on @seamapi/wizard@0.7.0, and on #619, now in main.

The contract

export interface WizardAdapter {
  getAuth: () => Promise[WizardAuth]   // endpoint, apiKey, workspaceId
  config: StorageAdapter               // get/set — preferences the developer chose
  state: StorageAdapter                // get/set — what each project was set up with
}
  • getAuth passes on the endpoint and workspace resolveAuth resolved — a flag over the environment over what is stored — and an API key, or nothing. The wizard only ever uses an API key, and only a workspace-scoped one may go in a project's .env, so a personal access token is not passed at all. isApiKey is @seamapi/http's own predicate, the one seam login validates with, so the two cannot disagree about what a token is.
  • config and state wrap one JSON file each in the two methods the wizard reads and writes through: wizard.json beside cli.json, in the config and state directories, named off the config's rootPaths where the wizard is mounted.

The store and both paths are parameters with defaults, so a test hands it a memory config and a temp directory — the convention login() uses.

What the wizard does with it

Stored Handed over What the developer sees
nothing apiKey: null asked how to connect: browser or paste
PAT + workspace apiKey: null, workspaceId asked how to connect
API key apiKey offered that workspace by name, no browser trip

Once seamapi/wizard#7 lands. Until then the wizard accepts the adapter and does not read it, so this changes nothing for anyone.

Verified

seam login with a stored key, then the adapter built and driven end to end:

auth handed to the wizard: { endpoint: 'https://connect.getseam.com',
                             apiKey: 'seam_apikey1_…', workspaceId: null }
~/.config/seam/wizard.json        ← config.set('sdk', 'python')
~/.local/state/seam/wizard.json   ← state.set('projects.demo-app-…', record)
$ seam wizard --version → runs the mounted wizard

179 tests pass against the published 0.7.0.

@razor-x razor-x changed the title Export file paths and auth keys as public API contract Host the wizard: answer for the login and keep its files Aug 11, 2026
Comment thread README.md Outdated
@razor-x razor-x changed the title Host the wizard: answer for the login and keep its files Adapt the wizard: answer for the login and keep its files Aug 12, 2026
The CLI mounts the wizard, owns the login, and owns where files go, so it
answers for all three. createWizardAdapter hands over the endpoint and
workspace resolveAuth resolved, and an API key or nothing: the wizard only
uses an API key, and only a workspace-scoped one may go in a project's .env,
so a personal access token is not passed at all.

Its two files are named where the wizard is mounted, off the config's
rootPaths: wizard.json beside cli.json in the config and state directories.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCJ1v1NFc6b43GooAhij2c
@razor-x
razor-x force-pushed the claude/wizard-file-store-cli-4njgxv branch from 342f7de to 60b27fc Compare August 12, 2026 04:59
@razor-x razor-x changed the title Adapt the wizard: answer for the login and keep its files feat: Pass adapter to the wizard Aug 12, 2026
@razor-x
razor-x marked this pull request as ready for review August 12, 2026 05:02
@razor-x
razor-x merged commit 3fef0db into main Aug 12, 2026
14 checks passed
@razor-x
razor-x deleted the claude/wizard-file-store-cli-4njgxv branch August 12, 2026 05:02
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.

2 participants