Skip to content

feat!: argc 10 — provider keys as secret apiKey fields, YAML whole input (3.0.0) - #5

Merged
ethan-huo merged 3 commits into
mainfrom
chore/argc-10
Nov 12, 2026
Merged

ethan-huo merged 3 commits into
mainfrom
chore/argc-10

Conversation

@ethan-huo

Copy link
Copy Markdown
Contributor

Summary

  • Upgrade to @celados/argc 10.0.0 + @celados/argc-latch 1.0.0; drop @celados/latch-source.
  • Provider keys → secret() apiKey fields (src/auth.ts), default chain env:DASHSCOPE_API_KEY → bw://… / env:MIMO_API_KEY → bw://….
    • Always-provider commands (vocab.sync, vocab.prune, voice.record, voice.remove) spread ...dashscopeAuth: resolved during validation, miss = INVALID_INPUT on apiKey.
    • Cache-aware commands (hear, say, vocab.list, voice.list) take an optional override; the default chain is read only when a provider is actually called (stored runs / cached audio stay offline), miss = key_unavailable.
    • status probes both default chains through the same field schemas.
  • Removed field-level --text - / --text @file and the say argv rewrite (src/text-body.ts); multi-line TTS uses vox say - <<'EOF' YAML with text: |.
  • valibot ^1.5 / @valibot/to-json-schema ^1.8 (argc 10 peers). Version 2.0.1 → 3.0.0 (breaking for callers).

Do not merge yet — batch review with the other argc 10 migrations; merging to main triggers the release workflow.

Test plan

  • bun run check (fmt, tsc, 57 tests) + bun run build; dist/vox status resolves both keys via latch
  • env-supplied key: latch env DASHSCOPE_API_KEY=bw://… -- vox vocab.list → quota 2/10
  • explicit apiKey: { ref: 'env:VOXK' } + YAML heredoc say → real TTS wav
  • invalid literal key / missing env ref → errors never contain the key value

🤖 Generated with Claude Code

…put (3.0.0)

- Provider keys are `secret()` `apiKey` fields (`@celados/argc/ref`) with the
  default chain env → `bw://` via `@celados/argc-latch` `createLatch()`.
  Commands that always call DashScope (vocab.sync/prune, voice.record/remove)
  resolve it during validation; cache-aware commands (hear, say, vocab.list,
  voice.list) take an optional override and read the chain only when a provider
  is called, so stored runs and cached audio stay offline.
- `defineValueSource`, `cli({ values })`, `@celados/latch-source` removed;
  `value_unavailable` → `INVALID_INPUT` on `apiKey` or `key_unavailable`.
- Field-level `--text -` / `--text @file` and the `say` argv rewrite removed
  (src/text-body.ts); multi-line text goes through `vox say - <<'EOF'` YAML.
- valibot ^1.5, @valibot/to-json-schema ^1.8 (argc 10 peers).
- @celados/argc ^10.2.0.
- Key fields named once with addGlobalDefs: DashScopeKey (default chain,
  commands that always call DashScope) and ProviderKey (lazy override);
  @Schema declares each type once instead of repeating it per command.
- say.text is ref(string, [file()]): a script on disk is
  text: { ref: 'file:script.txt' }, restoring reading text from a file.
- Tests: argv secret literal is refused (10.1); the whitespace-key check
  goes through stdin.
@ethan-huo
ethan-huo merged commit e0484aa into main Nov 12, 2026
1 check passed
@ethan-huo
ethan-huo deleted the chore/argc-10 branch November 12, 2026 15:18
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