feat: register projects on init and delete from UI - #145
Conversation
capa init now upserts the project and configures the server so it appears in the UI before install/wrap. UI delete runs shared clean (stops wrap sessions, prunes workspaces, clears DB) while keeping the capabilities file. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by QodoRegister projects during
AI Description
Diagram
High-Level Assessment
Files changed (17)
|
Code Review by Qodo
1.
|
Use argv token path equality so /proj cannot kill /proj2 wraps; roll back newly inserted projects when configure fails; make wrap-session writes non-fatal; use async rm in clean/prune paths. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the Qodo review comments:
|
Summary
capa initnow registers the project in the capa DB and configures the server so it appears in the UI beforeinstall/wrap; existing capabilities files are left unchangedcapa cleanviaDELETE /api/projects/:id, including stopping wrap sessions for that project and pruning its wrap workspaces, while keeping the capabilities filecleanProjectis used by both CLI clean and the API; wrap sessions writewrap-session.jsonfor reliable project-scoped stopTest plan
capa initin a new directory — capabilities file created and project appears in UIcapa initagain (or after deleting from UI) — file not recreated, project re-registeredcapa wraprunning for a project, delete that project from the UI — wrap process is stoppedcapa cleanstill works from the CLI on an installed projectbun test src/cli/commands/__tests__/init-command.test.ts src/cli/utils/wrap/__tests__/sessions.test.tsMade with Cursor