@andorra-labs/code 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -205
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/dist/src/agent-execution.js +50 -2
- package/dist/src/agent-mcp.js +5 -0
- package/dist/src/app-server/protocol.d.ts +9 -1
- package/dist/src/app-server/protocol.js +1 -1
- package/dist/src/app-server.d.ts +49 -1
- package/dist/src/app-server.js +353 -64
- package/dist/src/automation-service.js +1 -1
- package/dist/src/browser-panel-tool.d.ts +24 -3
- package/dist/src/browser-panel-tool.js +80 -6
- package/dist/src/browser-runner.js +3 -1
- package/dist/src/browser-session.d.ts +8 -0
- package/dist/src/browser-session.js +27 -1
- package/dist/src/browser-ui/app.js +237 -15
- package/dist/src/browser-ui/index.html +5 -5
- package/dist/src/browser-ui/style.css +110 -65
- package/dist/src/browser-ui/tokens.css +27 -26
- package/dist/src/browser-view.d.ts +16 -0
- package/dist/src/browser-view.js +38 -2
- package/dist/src/claude-provider.js +15 -2
- package/dist/src/cli.d.ts +2 -1
- package/dist/src/cli.js +175 -43
- package/dist/src/code-intelligence/CodeIntelligenceManager.js +1 -1
- package/dist/src/codex-provider.js +6 -3
- package/dist/src/coding-tools.d.ts +26 -1
- package/dist/src/coding-tools.js +104 -33
- package/dist/src/command-screens.js +1 -1
- package/dist/src/commands.js +1 -1
- package/dist/src/completion-gates.d.ts +42 -7
- package/dist/src/completion-gates.js +55 -9
- package/dist/src/completion.d.ts +51 -1
- package/dist/src/completion.js +164 -5
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.js +2 -0
- package/dist/src/dashboard-view.js +2 -2
- package/dist/src/deadline.js +4 -0
- package/dist/src/decision/PreparedSteps.js +1 -1
- package/dist/src/delegation-changes.js +19 -2
- package/dist/src/diff-preview.d.ts +1 -0
- package/dist/src/diff-preview.js +12 -3
- package/dist/src/engine-streams.d.ts +22 -0
- package/dist/src/engine-streams.js +16 -0
- package/dist/src/extensions.js +17 -6
- package/dist/src/file-read-key.d.ts +8 -0
- package/dist/src/file-read-key.js +12 -0
- package/dist/src/graph-editor-session.js +2 -1
- package/dist/src/graph-health.d.ts +21 -0
- package/dist/src/graph-health.js +46 -0
- package/dist/src/graph-manager-chat.d.ts +52 -3
- package/dist/src/graph-manager-chat.js +62 -17
- package/dist/src/graph-runner.js +62 -5
- package/dist/src/graph-server.d.ts +1 -1
- package/dist/src/graph-server.js +48 -27
- package/dist/src/graph-sync.d.ts +8 -0
- package/dist/src/graph-sync.js +54 -3
- package/dist/src/graph-tool.js +1 -1
- package/dist/src/graph-ui/app.js +362 -123
- package/dist/src/graph-ui/controls.css +95 -22
- package/dist/src/graph-ui/controls.js +31 -1
- package/dist/src/graph-ui/embed.js +62 -13
- package/dist/src/graph-ui/icons.js +7 -0
- package/dist/src/graph-ui/index.html +4 -4
- package/dist/src/graph-ui/manager-state.js +143 -5
- package/dist/src/graph-ui/manager.css +21 -20
- package/dist/src/graph-ui/manager.js +337 -75
- package/dist/src/graph-ui/model-picker.js +279 -0
- package/dist/src/graph-ui/provider-glyphs/alibaba-cloud.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/anthropic.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/aws-bedrock.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/claude.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/deepseek.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/fireworks.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/kimi.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/minimax.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/openai.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/opencode.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/openrouter.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/xai.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/xiaomi-mimo.png +0 -0
- package/dist/src/graph-ui/provider-glyphs/zai.png +0 -0
- package/dist/src/graph-ui/skill-picker.js +1 -1
- package/dist/src/graph-ui/studio-canvas.js +8 -8
- package/dist/src/graph-ui/studio.css +18 -15
- package/dist/src/graph-ui/studio.js +92 -35
- package/dist/src/graph-ui/style.css +122 -79
- package/dist/src/graph-ui/theme.js +2 -2
- package/dist/src/graph-ui/tokens.css +33 -29
- package/dist/src/graphs.d.ts +5 -2
- package/dist/src/graphs.js +10 -9
- package/dist/src/mcp.d.ts +52 -14
- package/dist/src/mcp.js +285 -128
- package/dist/src/membership-errors.d.ts +7 -1
- package/dist/src/membership-errors.js +9 -3
- package/dist/src/memory/ProjectMemory.d.ts +77 -0
- package/dist/src/memory/ProjectMemory.js +310 -0
- package/dist/src/memory/index.d.ts +1 -0
- package/dist/src/memory/index.js +1 -0
- package/dist/src/opencode-provider.js +5 -6
- package/dist/src/package-name.d.ts +3 -0
- package/dist/src/package-name.js +3 -0
- package/dist/src/provider-engine.js +2 -2
- package/dist/src/pull-requests.d.ts +42 -6
- package/dist/src/pull-requests.js +11 -3
- package/dist/src/qa/runtime/PtyManager.js +2 -1
- package/dist/src/react-runtime.js +137 -22
- package/dist/src/read-document-doc.d.ts +20 -0
- package/dist/src/read-document-doc.js +524 -0
- package/dist/src/read-document-docx.d.ts +21 -0
- package/dist/src/read-document-docx.js +584 -0
- package/dist/src/read-document-text.d.ts +29 -0
- package/dist/src/read-document-text.js +67 -0
- package/dist/src/read-document-tool.d.ts +48 -0
- package/dist/src/read-document-tool.js +162 -0
- package/dist/src/read-document.d.ts +78 -0
- package/dist/src/read-document.js +353 -0
- package/dist/src/read-image.d.ts +29 -2
- package/dist/src/read-image.js +42 -17
- package/dist/src/remote/cert.d.ts +1 -1
- package/dist/src/remote/cert.js +2 -7
- package/dist/src/remote/client.js +1 -1
- package/dist/src/remote/pem.d.ts +6 -0
- package/dist/src/remote/pem.js +11 -0
- package/dist/src/run-records.js +49 -10
- package/dist/src/runtime.d.ts +21 -0
- package/dist/src/runtime.js +10 -1
- package/dist/src/session-changes.d.ts +6 -1
- package/dist/src/session-changes.js +13 -5
- package/dist/src/sessions.d.ts +3 -1
- package/dist/src/sessions.js +5 -3
- package/dist/src/side-panel.d.ts +6 -1
- package/dist/src/side-panel.js +12 -10
- package/dist/src/sign-in-detection.d.ts +82 -0
- package/dist/src/sign-in-detection.js +197 -0
- package/dist/src/sign-in-offer.d.ts +35 -0
- package/dist/src/sign-in-offer.js +116 -0
- package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
- package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
- package/dist/src/skills/bundled/graph-manager/SKILL.md +59 -7
- package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
- package/dist/src/skills/bundled/provenance.json +4 -4
- package/dist/src/skills/runtime-skills.d.ts +6 -0
- package/dist/src/skills/runtime-skills.js +16 -3
- package/dist/src/stall-recovery.d.ts +6 -2
- package/dist/src/stall-recovery.js +7 -2
- package/dist/src/stray-files.d.ts +14 -0
- package/dist/src/stray-files.js +81 -0
- package/dist/src/subagent-run.js +6 -1
- package/dist/src/terminal-ui.d.ts +1 -1
- package/dist/src/terminal-ui.js +11 -5
- package/dist/src/time-limit.d.ts +53 -0
- package/dist/src/time-limit.js +79 -0
- package/dist/src/tool-activity.js +1 -1
- package/dist/src/tool-schema-compatibility.d.ts +7 -2
- package/dist/src/tool-schema-compatibility.js +8 -4
- package/dist/src/tools.js +92 -7
- package/dist/src/transcript.d.ts +5 -0
- package/dist/src/transcript.js +12 -4
- package/dist/src/types.d.ts +8 -0
- package/dist/src/untracked-file-removal.d.ts +3 -0
- package/dist/src/untracked-file-removal.js +125 -0
- package/dist/src/update-check.js +1 -1
- package/dist/src/update.d.ts +11 -1
- package/dist/src/update.js +27 -5
- package/dist/src/usage-analytics.d.ts +3 -1
- package/dist/src/usage-analytics.js +16 -2
- package/dist/src/workspace-git-metadata.d.ts +15 -0
- package/dist/src/workspace-git-metadata.js +50 -1
- package/dist/src/workspace-instructions.js +1 -1
- package/package.json +6 -26
- package/docs/README.md +0 -36
- package/docs/agents/README.md +0 -62
- package/docs/agents/install-for-agents.md +0 -56
- package/docs/agents/mcp-server.md +0 -212
- package/docs/agents/subagent-mode.md +0 -149
- package/docs/concepts/README.md +0 -47
- package/docs/concepts/jev-actionable-routing.md +0 -113
- package/docs/concepts/jev-decision-thresholds.md +0 -412
- package/docs/concepts/jev-efficiency.md +0 -217
- package/docs/concepts/jev-eval-2026-11-01.md +0 -78
- package/docs/concepts/limits.md +0 -52
- package/docs/concepts/memory.md +0 -10
- package/docs/concepts/security.md +0 -50
- package/docs/concepts/workspace-instructions.md +0 -29
- package/docs/getting-started/README.md +0 -82
- package/docs/getting-started/accounts.md +0 -78
- package/docs/getting-started/configure-providers.md +0 -132
- package/docs/guides/README.md +0 -13
- package/docs/guides/browser.md +0 -39
- package/docs/guides/desktop-app.md +0 -414
- package/docs/guides/extensions.md +0 -102
- package/docs/guides/graph-builder.md +0 -116
- package/docs/guides/headless.md +0 -46
- package/docs/guides/tui.md +0 -75
- package/docs/guides/update.md +0 -70
- package/docs/guides/web-search.md +0 -51
- package/docs/guides/windows-code-signing.md +0 -319
- package/docs/llms.txt +0 -45
- package/docs/reference/README.md +0 -7
- package/docs/reference/cli.md +0 -76
- package/docs/reference/config.md +0 -91
- package/docs/reference/slash-commands.md +0 -59
- package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
- package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
- package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
- package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
- package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
- package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
- package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
- package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
- package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
- package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
- package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
- package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
- package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
- package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
- package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
- package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
- package/scripts/jev-efficiency-eval.mjs +0 -187
- package/scripts/jev-efficiency-live.mjs +0 -193
- package/scripts/zcode-engine-replay.mjs +0 -223
- package/tests/agent-centric-mcp-test-plan.md +0 -208
- package/tests/analytics-settings-test-plan.md +0 -165
- package/tests/browser-cli-smoke.mjs +0 -276
- package/tests/browser-test-plan.md +0 -280
- package/tests/chat-side-panel-test-plan.md +0 -309
- package/tests/decision-engine-test-plan.md +0 -163
- package/tests/default-active-jev-test-plan.md +0 -85
- package/tests/harness-extensions-test-plan.md +0 -113
- package/tests/jev-all-decisions-test-plan.md +0 -156
- package/tests/jev-efficiency/criteria.json +0 -158
- package/tests/jev-efficiency/workloads.mjs +0 -242
- package/tests/jev-efficiency-test-plan.md +0 -198
- package/tests/permissions-sandbox-probe.mjs +0 -74
- package/tests/permissions-test-plan.md +0 -191
- package/tests/product-telemetry-test-plan.md +0 -536
- package/tests/thinking-stream-preview-test-plan.md +0 -136
- package/tests/zcode-react-engine-test-plan.md +0 -396
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# Claude Console Sign-in Implementation Plan
|
|
2
|
-
|
|
3
|
-
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
|
-
|
|
5
|
-
**Goal:** Let an `anthropic` provider authenticate with a Claude Console login made through `ant auth login`, from the desktop settings and the TUI, and default Anthropic providers to `claude-opus-5-5`.
|
|
6
|
-
|
|
7
|
-
**Architecture:** `ant` performs the browser login into a per-provider config directory (`<andorra home>/anthropic-accounts/<provider id>`). The engine reads that directory with the Client SDK's `resolveCredentialsFromConfig`, which refreshes tokens, and sends `Authorization: Bearer` plus the OAuth beta and workspace headers. Sign-in is exposed through the existing `providers.auth.*` app-server methods and a TUI menu entry.
|
|
8
|
-
|
|
9
|
-
**Tech Stack:** TypeScript (Node ≥ 22, ESM), `@anthropic-ai/sdk` 0.124.0, `node:test` via `scripts/run-tests.mjs`, React + Vitest in `desktop/`.
|
|
10
|
-
|
|
11
|
-
Spec: `docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md`.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## File map
|
|
16
|
-
|
|
17
|
-
| File | Change |
|
|
18
|
-
|---|---|
|
|
19
|
-
| `src/providers.ts` | `anthropicAuth` field; credential assertions; `send` uses the header helper and retries a 401 once; Opus default |
|
|
20
|
-
| `src/config.ts` | validation for `anthropicAuth` |
|
|
21
|
-
| `src/anthropic-credentials.ts` (new) | account directory, saved-login reader, `providerAuthHeaders` |
|
|
22
|
-
| `src/anthropic-console-auth.ts` (new) | `ant` resolution, `AnthropicConsoleAuth` start/status/cancel/logout, account retirement |
|
|
23
|
-
| `src/provider-connection.ts`, `src/model-metadata.ts` | use `providerAuthHeaders` |
|
|
24
|
-
| `src/app-server.ts`, `src/app-server/protocol.ts` | `providerType: 'anthropic'` sign-in, `organization`/`workspace` fields, capability, upsert passthrough, retirement |
|
|
25
|
-
| `src/provider-settings.ts`, `src/command-screens.ts` | TUI credential toggle, sign-in entry, retirement |
|
|
26
|
-
| `desktop/src/engine/*`, `desktop/src/components/AnthropicConsoleSignIn.tsx` (new), `SettingsView.tsx`, `providerPresets.ts` | form choice, sign-in panel, labels |
|
|
27
|
-
| `test/anthropic-credentials.test.ts`, `test/anthropic-console-auth.test.ts` (new), existing config/app-server/desktop tests | coverage |
|
|
28
|
-
| `tests/claude-console-sign-in-test-plan.md` (new) | QA plan |
|
|
29
|
-
|
|
30
|
-
## Task 1: Config field and validation
|
|
31
|
-
|
|
32
|
-
**Files:** `src/providers.ts` (ProviderConfig, `assertProviderCredentials`, `defaultProviders`), `src/config.ts` (provider loop), `test/config.test.ts`.
|
|
33
|
-
|
|
34
|
-
- [ ] Add to `ProviderConfig`, after `codexEmail`:
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
/** `console`: requests use the Claude Console login stored for this provider instead of an API key. */
|
|
38
|
-
anthropicAuth?: 'console';
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
- [ ] In `assertProviderCredentials` (widen its `Pick` to include `anthropicAuth`):
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
if (provider.anthropicAuth !== undefined && (provider.type !== 'anthropic' || provider.anthropicAuth !== 'console')) {
|
|
45
|
-
throw new Error('anthropicAuth is an Anthropic-only setting whose only value is console.');
|
|
46
|
-
}
|
|
47
|
-
if (provider.anthropicAuth === 'console' && (provider.apiKey !== undefined || provider.apiKeyEnv !== undefined)) {
|
|
48
|
-
throw new Error('Claude Console sign-in replaces the API key; remove the key or the sign-in.');
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
- [ ] In `validateConfig`'s provider loop: a console provider's `baseUrl` must be `https://api.anthropic.com/v1`; after the loop, reject two console providers whose ids fold to the same lowercase string.
|
|
53
|
-
- [ ] `defaultProviders()` anthropic model becomes `claude-opus-5-5`.
|
|
54
|
-
- [ ] Tests in `test/config.test.ts`: accepted console provider; rejected on `openai-compatible`; rejected with `apiKeyEnv`; rejected with another base URL; rejected case-colliding ids. Run `node scripts/run-tests.mjs test/config.test.ts` (fail → implement → pass). Commit.
|
|
55
|
-
|
|
56
|
-
## Task 2: Saved login and request headers (`src/anthropic-credentials.ts`)
|
|
57
|
-
|
|
58
|
-
- [ ] Exports:
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
export const ANTHROPIC_CONSOLE_BASE_URL = 'https://api.anthropic.com/v1';
|
|
62
|
-
export function anthropicAccountHome(providerId: string, configHome = configDirectory()): string; // join(configHome, 'anthropic-accounts', providerId)
|
|
63
|
-
export interface AnthropicConsoleAccount { email?: string; organization?: string; workspace?: string }
|
|
64
|
-
export async function readAnthropicConsoleAccount(home: string): Promise<AnthropicConsoleAccount | undefined>;
|
|
65
|
-
export async function providerAuthHeaders(provider: ProviderConfig, options?: { forceRefresh?: boolean; configHome?: string; fetch?: typeof fetch }): Promise<Record<string, string>>;
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
- `readAnthropicConsoleAccount` reads `credentials/default.json`; returns `undefined` unless it has a string `access_token` and either a refresh token or an `expires_at` in the future. Display fields are bounded strings without control characters.
|
|
69
|
-
- `providerAuthHeaders`: API-key providers return today's headers (`anthropic-version` + `x-api-key` for Anthropic; `authorization: Bearer` otherwise; nothing without a key). Console providers: read `configs/default.json`, require `authentication.type === 'user_oauth'`, set `credentials_path`, call `resolveCredentialsFromConfig(config, { baseURL: 'https://api.anthropic.com', fetch })`, call `provider({ forceRefresh })`, and return `anthropic-version`, `authorization: Bearer <token>`, `anthropic-beta: oauth-2025-04-20`, plus `extraHeaders`. Missing files → `Sign in with Claude Console for provider <id>, then retry.`; any SDK failure → `Your Claude Console sign-in expired or could not be refreshed. Sign in again.` (never the SDK message, which can echo response bodies).
|
|
70
|
-
- [ ] `test/anthropic-credentials.test.ts`: API-key headers unchanged; console headers from a temp dir (token, beta, workspace); missing login message; an expired token with a refresh token refreshes against a local HTTP token endpoint (`configs/default.json` `base_url` pointing at `http://127.0.0.1:<port>`) and the file is rewritten; refresh failure message contains no token text. Fail → implement → pass. Commit.
|
|
71
|
-
|
|
72
|
-
## Task 3: Use the helper in inference, test and discovery
|
|
73
|
-
|
|
74
|
-
- [ ] `src/providers.ts` `send`: replace the header block with `Object.assign(headers, await providerAuthHeaders(config, { forceRefresh }))`; when a console provider answers 401, cancel the body and resend once with `forceRefresh: true`.
|
|
75
|
-
- [ ] `src/provider-connection.ts` and `src/model-metadata.ts`: build headers with `providerAuthHeaders` (the connection test turns a thrown helper error into `failed(message)`).
|
|
76
|
-
- [ ] Extend `test/anthropic-credentials.test.ts` with an adapter test: a local HTTP server returns 401 then 200, the adapter's `listModels` succeeds and the server saw two requests with Bearer headers. Run existing `test/providers*.test.ts` and `test/provider-connection.test.ts` to confirm API-key behaviour is unchanged. Commit.
|
|
77
|
-
|
|
78
|
-
## Task 4: Sign-in manager (`src/anthropic-console-auth.ts`)
|
|
79
|
-
|
|
80
|
-
- [ ] `resolveAntExecutable({ env, platform })`: `ANDORRA_ANT_PATH` (absolute path or a name looked up on PATH), else `ant`/`ant.exe` on PATH; skip `.cmd/.bat/.ps1`; a path ending in `.js`/`.mjs` is run with `process.execPath` (used by tests). Missing → `AuthFailure(installMessage, 'unavailable')`.
|
|
81
|
-
- [ ] `AnthropicConsoleAuth` with the spec's state type. `start(attemptId, home)`: refuse a second live attempt for the same home (`busy`); `mkdir(home, { recursive: true })`; spawn `ant auth login --timeout 10m` (`shell: false`, `windowsHide`, `stdio: ['ignore', 'pipe', 'pipe']`, `detached` off-Windows, env = parent minus `ANTHROPIC_*` plus `ANTHROPIC_CONFIG_DIR=home`); drain output up to 1 MiB and discard it; answer `{ state: 'waiting', attemptId }`. On exit 0 with a readable login → `signedIn` with account fields; non-zero → `error` "Claude Console sign-in did not complete. Try again."; timeout of 11 minutes → kill tree, `error` `timeout`. `status(attemptId?, home)`: a live attempt answers its state; otherwise the saved login decides `signedIn`/`signedOut`. `cancel` kills the tree (`taskkill /PID /T /F` via `resolveTrustedTaskkill`, else `process.kill(-pid)`) and answers `cancelled`. `logout(home)`: cancel any attempt, `rm(home, { recursive: true, force: true })`, answer `signedOut`, or `error`/`logoutFailed`. `close()` cancels everything.
|
|
82
|
-
- [ ] `droppedAnthropicAccounts(previous, next): string[]` (ids that were console providers and are not console providers in `next`) and `retireAnthropicAccounts(ids, configHome?)`.
|
|
83
|
-
- [ ] `test/anthropic-console-auth.test.ts` with a fake `ant` (`.mjs` written to a temp dir) whose behaviour is chosen by an env var: writes the two files and exits 0; exits 1; sleeps. Cover signed-in result, error, busy, cancel kills it, logout removes the directory, the child's env has `ANTHROPIC_CONFIG_DIR` and lacks `ANTHROPIC_API_KEY`, missing executable → `unavailable`. Commit.
|
|
84
|
-
|
|
85
|
-
## Task 5: App-server
|
|
86
|
-
|
|
87
|
-
- [ ] `protocol.ts`: add `organization?`, `workspace?` to `AppServerProviderAuth`; `anthropicAuth?: 'console'` to `AppServerProvider`; capability `'providers.anthropicConsole'`.
|
|
88
|
-
- [ ] `app-server.ts`: `providerAuth` accepts `providerType: 'anthropic'` with a required `providerId` naming a stored console provider and routes to an injected `anthropicAuth: AnthropicConsoleAuth` (constructor option for tests); `providerAuthView` projects the two new fields through `text(…, 200)`; errors map to `AppServerError('auth', 'Claude Console sign-in could not be completed. Check the Anthropic CLI (ant) and try again.')`. Provider views include `anthropicAuth`. Upsert: `anthropicAuth` keeps the stored value when omitted on an anthropic entry, `null` removes it. Removal and config writes retire `droppedAnthropicAccounts` after commit, next to `retireSlots`. `close()` closes the manager.
|
|
89
|
-
- [ ] Tests in the app-server provider test file: auth start/status with a stub manager, rejection for a non-console provider, view projection, upsert passthrough, capability listed. Commit.
|
|
90
|
-
|
|
91
|
-
## Task 6: TUI
|
|
92
|
-
|
|
93
|
-
- [ ] `provider-settings.ts`: for `type === 'anthropic'` show `Credential: API key | Claude Console sign-in` (toggling sets/deletes `anthropicAuth`, clears `apiKey`/`apiKeyEnv`, fixes `baseUrl`) and, when console, replace the key rows with `Sign in with Claude Console`. The login runs `AnthropicConsoleAuth.start` then waits for a terminal state inside `ui.loadScreen` (Esc → `cancel`), prints "Opening your browser to sign in to Claude Console…", then lists models through the adapter. Add `anthropicAuth` to the key-reconcile list at the end of the loop. `discard()` retires the account of a new console provider that was never saved.
|
|
94
|
-
- [ ] `command-screens.ts` `save`: after a committed write call `retireAnthropicAccounts(droppedAnthropicAccounts(previousProviders, reconciled.providers))`; after a refused write retire accounts of console ids absent from the saved config.
|
|
95
|
-
- [ ] Extend `test/provider-settings.test.ts`: toggling to console removes key fields and sets the base URL; the sign-in entry calls an injected auth stub. Commit.
|
|
96
|
-
|
|
97
|
-
## Task 7: Desktop
|
|
98
|
-
|
|
99
|
-
- [ ] `engine/protocol.ts`: mirror the protocol additions. `engine/providerEntry.ts`: carry `anthropicAuth`, omit key fields for console entries, refuse a console save without the capability ("Update the Andorra CLI to use Claude Console sign-in.").
|
|
100
|
-
- [ ] `engine/anthropicConsoleAuth.ts` (new): transport over `providers.auth.*` with `providerType: 'anthropic'` and a small controller that starts, polls status every 2 s while waiting, cancels, logs out.
|
|
101
|
-
- [ ] `components/AnthropicConsoleSignIn.tsx` (new): states and buttons per the spec; on an unsaved draft it shows "Save this provider, then sign in from the provider list."
|
|
102
|
-
- [ ] `SettingsView.tsx`: Credential select (API key / Claude Console sign-in) on Anthropic forms; render the panel on saved console providers and in the detail panel; credential row text. Labels: preset `Claude` / "Uses your Claude Code CLI sign-in"; type option "Claude (via Claude Code CLI)"; Anthropic preset model `claude-opus-5-5`.
|
|
103
|
-
- [ ] Vitest: `AnthropicConsoleSignIn.test.tsx` (signed out → waiting → signed in; refusal without capability) and `providerEntry` cases. Run `npm --prefix desktop run test -- <files>`. Commit.
|
|
104
|
-
|
|
105
|
-
## Task 8: Docs, QA plan, verification
|
|
106
|
-
|
|
107
|
-
- [ ] `docs/getting-started/configure-providers.md` and `docs/reference/config.md`: document `anthropicAuth` and the `ant` prerequisite.
|
|
108
|
-
- [ ] `tests/claude-console-sign-in-test-plan.md` per AGENTS.md.
|
|
109
|
-
- [ ] `npm run build`; run the touched test files; `npm --prefix desktop run typecheck`.
|
|
110
|
-
- [ ] Run verification with a throwaway `ANDORRACODE_HOME`: `app-server --stdio` driven over stdin with the fake `ant` (start → status signedIn → provider test against a local stub API), then one real `ant auth login` with the user's approval.
|
|
111
|
-
- [ ] Commit, push, open the PR with the template.
|