Skip to content

feat: agent setup with a one-time code, and settings drafts from the CLI - #57

Closed
sonpiaz wants to merge 1 commit into
mainfrom
feat/agent-draft-cli
Closed

sonpiaz wants to merge 1 commit into
mainfrom
feat/agent-draft-cli

Conversation

@sonpiaz

@sonpiaz sonpiaz commented Oct 21, 2026

Copy link
Copy Markdown
Member

What

Slice P3 of .internal/specs/2026-10-20-SPEC-agent-draft.md (spec Codex r4 ĐẠT). Works once the CMS slices are deployed (cms#686 drafts, then the setup-code PR on top of it).

  • affitor agent setup --client <name> --code <aff_sc_…>: redeems the dashboard's single-use setup code (POST /api/v1/agent-setup-codes/redeem, no session) and installs that one agent's private credential, same file and launcher as today. Exactly one client per code. Never retried; a failed local write names the key id to revoke; code_used / code_expired / code_cancelled / issuer_changed answer in plain words.
  • affitor draft show / affitor draft set --name … --website … --tagline … --description … --type --rate --months (or --file): uses the saved agent key; set reads the open draft and replaces it with its draft_id + revision (or opens one), then prints the dashboard link where an owner or admin applies it.
  • CHANGELOG "Unreleased" entry. No version bump in this PR.

Tests

  • tests/agent-draft.test.ts (12): redeem without session, typed refusals, malformed code / foreign origin refused before any request, one-client install, draft set binds draft_id + revision, server field reasons, flag shaping, and an end-to-end run of the built CLI (agent setup --code then draft set, no secret printed).
  • Full CLI suite after build: 320 passed, 6 skipped. tsc clean. Mutants 4/4 killed.

🤖 Generated with Claude Code

Spec .internal/specs/2026-10-20-SPEC-agent-draft.md slice P3 (needs cms#686
and the setup-code PR deployed).

- affitor agent setup --client <name> --code <aff_sc_…>: redeems the
  dashboard's single-use code with no session and installs that one agent's
  private credential; a failed local write names the key to revoke.
- affitor draft show / draft set: read the open draft, then replace it with
  its draft_id + revision (or open one); prints where an owner applies it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonpiaz

sonpiaz commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Closed without merge: founder decision 21/10 to skip the agent-draft feature for now (CMS #686/#694 closed too). Branch kept so this can be reopened.

@sonpiaz sonpiaz closed this Oct 21, 2026
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