feat: show config status in TUI and VS Code extension#74
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds visibility into whether agentrc.config.json is present, surfacing that status in both the Ink-based TUI and the VS Code extension, and refactors config scaffolding into a shared core service so multiple frontends can reuse the same logic.
Changes:
- Extracts
scaffoldAgentrcConfig()into@agentrc/coreso CLI/TUI can share config scaffolding logic. - Updates the TUI to detect
agentrc.config.json, display its status, and add a[C]shortcut to scaffold it. - Adds a new VS Code “Workspace” view with status items for Config and Evals, including click-to-create actions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| vscode-extension/src/views/providers.ts | Registers the new workspace status tree provider singleton. |
| vscode-extension/src/views/WorkspaceStatusTreeProvider.ts | Implements the new “Workspace” status tree items for Config/Evals presence. |
| vscode-extension/src/extension.ts | Registers the new tree view and refreshes status after init/evalInit. |
| vscode-extension/package.json | Adds the agentrc.workspace view and welcome content. |
| src/ui/tui.tsx | Detects config presence, displays it in the Context section, and scaffolds config via [C]. |
| src/commands/init.ts | Refactors CLI init to use the shared scaffoldAgentrcConfig() service. |
| packages/core/src/services/configScaffold.ts | Introduces shared config scaffolding service used by CLI/TUI. |
| item.description = "not found — click to create"; | ||
| item.tooltip = | ||
| "No agentrc.config.json found. Click to run agentrc init and scaffold one."; | ||
| item.command = { | ||
| command: "agentrc.init", | ||
| title: "Create agentrc.config.json" | ||
| }; |
There was a problem hiding this comment.
The Config tree item’s click action runs agentrc.init, but the extension’s initCommand() doesn’t scaffold/write agentrc.config.json, so clicking this will not actually create the config and the status will stay “not found”. Either update the extension init flow to call the new shared scaffoldAgentrcConfig() (and write the file) or wire this item to a dedicated command that creates agentrc.config.json.
| item.description = "not found — click to create"; | |
| item.tooltip = | |
| "No agentrc.config.json found. Click to run agentrc init and scaffold one."; | |
| item.command = { | |
| command: "agentrc.init", | |
| title: "Create agentrc.config.json" | |
| }; | |
| item.description = "not found"; | |
| item.tooltip = | |
| "No agentrc.config.json found in this workspace. Run agentrc init to create one."; |
- Fix Prettier formatting in init.ts, tui.tsx, extension.ts, WorkspaceStatusTreeProvider.ts - Use node: prefix for built-in imports in WorkspaceStatusTreeProvider.ts - Gate [C] Create config KeyHint on hasAgentrcConfig === false (not null) - Add scaffoldAgentrcConfig to extension services and call it from initCommand so clicking the Config tree item actually creates agentrc.config.json - Support multi-root workspaces in WorkspaceStatusTreeProvider: flat items for single folder, per-folder collapsible groups for multi-root - Add unit tests for scaffoldAgentrcConfig (empty areas, standalone areas, workspace grouping, skip/force overwrite, description preservation) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
When opening the TUI, eval presence was already displayed but
agentrc.config.jsonstatus was not. This PR surfaces config detection in both the TUI and VS Code extension, with quick shortcuts to scaffold one.Changes
Shared service
packages/core/src/services/configScaffold.ts— ExtractedscaffoldAgentrcConfig()from the init command so both TUI and CLI share the same logic.TUI (
src/ui/tui.tsx)agentrc.config.jsonat root and.github/on mount[C]keybinding in idle state scaffolds the config from detected areas[C] Create configKeyHint appears when no config existsrepoAreasto[]ifanalyzeRepofails (prevents stale areas)VS Code extension
WorkspaceStatusTreeProvider— New tree provider showing Config and Evals items with green/yellow status indicators. Missing items are clickable and triggeragentrc.init/agentrc.evalInit.agentrc.workspaceview registered above Analysis/Readiness in the sidebarRefactored
src/commands/init.tsnow uses the sharedscaffoldAgentrcConfig()serviceVerification