|
| 1 | +# Agentic Workspace Phase 2 Provider Registry 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 | +> **Spec:** `docs/superpowers/specs/2026-05-17-agentic-workspace-platform-design.md` |
| 6 | +
|
| 7 | +**Goal:** Productize the existing provider registry so Coder Studio can present itself as an agent-agnostic platform without replacing the current Claude Code and Codex implementation. |
| 8 | + |
| 9 | +**Architecture:** Extend the existing `ProviderDefinition` shape with platform-facing metadata and capabilities. Add a provider listing command that exposes safe provider metadata to the web app without leaking executable internals. |
| 10 | + |
| 11 | +**Tech Stack:** TypeScript, Zod, Vitest, existing websocket command dispatch. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Scope |
| 16 | + |
| 17 | +Includes: |
| 18 | + |
| 19 | +- Capability metadata on `ProviderDefinition`. |
| 20 | +- Safe DTO for frontend provider listing. |
| 21 | +- `provider.list` server command. |
| 22 | +- Tests for Claude/Codex provider metadata. |
| 23 | +- Frontend hook to consume provider list. |
| 24 | + |
| 25 | +Excludes: |
| 26 | + |
| 27 | +- Custom provider persistence. |
| 28 | +- New provider presets. |
| 29 | +- Install diagnosis redesign. |
| 30 | +- Provider marketplace. |
| 31 | + |
| 32 | +## Files |
| 33 | + |
| 34 | +- Modify: `packages/core/src/provider/definition.ts` |
| 35 | +- Modify: `packages/core/src/domain/types.ts` |
| 36 | +- Modify: `packages/providers/src/claude/definition.ts` |
| 37 | +- Modify: `packages/providers/src/codex/definition.ts` |
| 38 | +- Modify: `packages/providers/src/registry.ts` |
| 39 | +- Modify: `packages/providers/src/registry.test.ts` |
| 40 | +- Modify: `packages/server/src/commands/provider.ts` |
| 41 | +- Create: `packages/server/src/__tests__/provider-list.test.ts` |
| 42 | +- Create: `packages/web/src/features/agent-providers/actions/use-agent-providers.ts` |
| 43 | +- Create: `packages/web/src/features/agent-providers/actions/use-agent-providers.test.tsx` |
| 44 | + |
| 45 | +## Data Model |
| 46 | + |
| 47 | +Add: |
| 48 | + |
| 49 | +```ts |
| 50 | +export type ProviderKind = "built_in" | "preset" | "custom"; |
| 51 | + |
| 52 | +export type ProviderCapabilityKey = |
| 53 | + | "interactive_session" |
| 54 | + | "supervisor_eval" |
| 55 | + | "idle_detection" |
| 56 | + | "context_attach" |
| 57 | + | "review"; |
| 58 | + |
| 59 | +export interface ProviderCapabilityDescriptor { |
| 60 | + key: ProviderCapabilityKey; |
| 61 | + supported: boolean; |
| 62 | + label: string; |
| 63 | +} |
| 64 | + |
| 65 | +export interface ProviderListItem { |
| 66 | + id: string; |
| 67 | + displayName: string; |
| 68 | + badge: string; |
| 69 | + kind: ProviderKind; |
| 70 | + capability: "full" | "limited" | "unsupported"; |
| 71 | + capabilities: ProviderCapabilityDescriptor[]; |
| 72 | + requiredCommands: string[]; |
| 73 | +} |
| 74 | +``` |
| 75 | + |
| 76 | +Extend `ProviderDefinition` with: |
| 77 | + |
| 78 | +```ts |
| 79 | +kind: ProviderKind; |
| 80 | +capabilities: ProviderCapabilityDescriptor[]; |
| 81 | +``` |
| 82 | + |
| 83 | +## Tasks |
| 84 | + |
| 85 | +- [ ] Add provider platform types to `packages/core/src/provider/definition.ts` or `packages/core/src/domain/types.ts`. |
| 86 | +- [ ] Set `kind: "built_in"` for Claude Code and Codex definitions. |
| 87 | +- [ ] Add explicit capabilities for Claude Code and Codex: |
| 88 | + |
| 89 | +```ts |
| 90 | +[ |
| 91 | + { key: "interactive_session", supported: true, label: "Interactive session" }, |
| 92 | + { key: "supervisor_eval", supported: true, label: "Supervisor evaluation" }, |
| 93 | + { key: "idle_detection", supported: true, label: "Idle detection" }, |
| 94 | + { key: "context_attach", supported: false, label: "Context attach" }, |
| 95 | + { key: "review", supported: false, label: "Review" }, |
| 96 | +] |
| 97 | +``` |
| 98 | + |
| 99 | +- [ ] Add `toProviderListItem(provider)` helper in `packages/providers/src/registry.ts`. |
| 100 | +- [ ] Add tests proving Claude and Codex return safe DTOs. |
| 101 | +- [ ] Register `provider.list` in `packages/server/src/commands/provider.ts`. |
| 102 | +- [ ] Add server command test asserting `provider.list` returns built-in provider DTOs. |
| 103 | +- [ ] Create frontend hook `useAgentProviders()` that calls `provider.list`. |
| 104 | +- [ ] Add hook test with mocked websocket dispatch. |
| 105 | + |
| 106 | +## Acceptance Criteria |
| 107 | + |
| 108 | +- The frontend has a provider-agnostic list API. |
| 109 | +- Provider executable construction remains server-only. |
| 110 | +- Claude Code and Codex appear as built-in providers. |
| 111 | +- No custom provider functionality is introduced yet. |
| 112 | + |
| 113 | +## Verification |
| 114 | + |
| 115 | +```bash |
| 116 | +pnpm exec vitest run \ |
| 117 | + packages/providers/src/registry.test.ts \ |
| 118 | + packages/server/src/__tests__/provider-list.test.ts \ |
| 119 | + packages/web/src/features/agent-providers/actions/use-agent-providers.test.tsx |
| 120 | +``` |
| 121 | + |
| 122 | +Expected: all tests pass. |
| 123 | + |
| 124 | +## Suggested Commit |
| 125 | + |
| 126 | +```bash |
| 127 | +git add packages/core packages/providers packages/server packages/web/src/features/agent-providers |
| 128 | +git commit -m "feat: expose agent provider registry" |
| 129 | +``` |
| 130 | + |
0 commit comments