Files
vibe-kanban/crates/server/Cargo.toml

56 lines
1.5 KiB
TOML
Raw Normal View History

2025-06-14 15:14:08 -04:00
[package]
Deployments (#414) * init deployment * refactor state * pre executor app state refactor * deployment in app state * clone * fix executors * fix dependencies * command runner via app_state * clippy * remove dependency on ENVIRONMENT from command_runner * remove dependency on ENVIRONMENT from command_runner * build fix * clippy * fmt * featues * vscode lints for cloud * change streaming to SSE (#338) Remove debug logging Cleanup streaming logic feat: add helper function for creating SSE stream responses for stdout/stderr * update vscode guidance * move start * Fix executors * Move command executor to separate file * Fix imports for executors * Partial fix test_remote * Fix * fmt * Clippy * Add back GitHub cloud only routes * cleanup and shared types * Prepare for separate cloud crate * Init backend-common workspace * Update * WIP * WIP * WIP * WIP * WIP * WIP * Projects (and sqlx) * Tasks * WIP * Amp * Backend executor structs * Task attempts outline * Move to crates folder * Cleanup frontend dist * Split out executors into separate crate * Config and sentry * Create deployment method helper * Router * Config endpoints * Projects, analytics * Update analytics paths when keys not provided * Tasks, task context * Middleware, outline task attempts * Delete backend common * WIP container * WIP container * Migrate worktree_path to container_ref (generic) * WIP container service create * Launch container * Fix create task * Create worktree * Move logic into container * Execution outline * Executor selection * Use enum_dispatch to route spawn tree * Update route errors * Implement child calling * Move running executions to container * Add streaming with history * Drop cloud WIP * Logs * Logs * Refactor container logic to execution tracker * Chunk based streaming and cleanup * Alex/mirgate task templates (#350) * Re-enable task templates; migrate routes; migrate args and return types * Refactor task template routes; consolidate list functions into get_templates with query support * Fix get_templates function * Implement amp executor * Gemini WIP * Make streaming the event store reusable * Rewrite mutex to rwlock * Staging for normalised logs impl * Store custom LogMsg instead of event as more flexible * Cleanup * WIP newline stream for amp (tested and working, needs store impl) * refactor: move stranded `git2` logic out of `models` (#352) * remove legacy command_executor; move git2 logic into GitService * remove legacy cloud runner * put back config get route * remove dead logic * WIP amp normalisation * Normalized logs now save to save msg store as raw * Refactor auth endpoints (#355) * Re-enable auth;Change auth to use deployment Add auth service Move auth logic to service Add auth router and service integration to deployment Refactor auth service and routes to use octocrab Refactor auth error handling and improve token validation responses * rename auth_router to router for consistency * refactor: rename auth_service to auth for consistency (#356) * Refactor filesystem endpoints (#357) * feat: implement filesystem service with directory listing and git repo detection * refactor: update filesystem routes; sort repos by last modfied * Gemini executor logs normalization * feat: add sound file serving endpoint and implement sound file loading (#358) * Gemini executor followup (#360) * Sync logs to db (#359) * Exit monitor * Outline stream logs to DB * Outline read from the message store * Add execution_process_logs, store logs in DB * Stream logs from DB * Normalized logs from DB * Remove eronious .sqlx cache * Remove execution process stdout and stderr * Update execution process record on completion * Emit session event for amp * Update session ID when event is emitted * Split local/common spawn fn * Create initial executor session * Move normalized logs into executors * Store executor action * Refactor updated_at to use micro seconds * Follow up executions (#363) * Follow up request handler scaffold Rename coding agent initial / follow up actions * Follow ups * Response for follow up * Simplify execution actions for coding agents * fix executor selection (#362) * refactor: move logic out of `TaskAttempt` (#361) * re-enable /diff /pr /rebase /merge /branch-status /open-editor /delete-file endpoints * address review comments * remove relic * Claude Code (#365) * Use ApiError rather than DeploymentError type in routes (#366) * Fix fe routes (#367) * /api/filesystem/list -> /api/filesystem/directory * /api/projects/:project_id/tasks -> /api/tasks * Remove with-branch * /api/projects/:project_id/tasks/:task_id -> /api/tasks/:task_id * Post tasks * Update template routes * Update BE for github poll endpoint, FE still needs updating * WIP freeze old types * File picker fix * Project types * Solve tsc warna * Remove constants and FE cloud mode * Setup for /api/info refactor * WIP config refactor * Remove custom mapping to coding agents * Update settings to fix code editor * Config fix (will need further changes once attempts types migrated) * Tmp fix types * Config auto deserialisation * Alex/refactor background processes (#369) * feat: add cleanup for orphaned executions at startup * Fix worktree cleanup; re add worktree cleanup queries * refactor worktree cleanup for orphaned and externally deleted worktrees * Fix compile error * refactor: container creation lifecycle (#368) * Consolidate worktree logic in the WorktreeManager * move auxiliary logic into worktree manager * fix compile error * Rename core crate to server * Fix npm run dev * Fix fe routes 2 (#371) * Migrate config paths * Update sounds, refactor lib.rs * Project FE types * Branch * Cleanup sound constants * Template types * Cleanup file search and other unused types * Handle errors * wip: basic mcp config editing (#351) * Re-add notification service, move assets to common dir (#373) add config to containter, add notifications into exit monitor Refctor notification service Refactor notifications * Stderr support (#372) Refactor plain-text log processing and resuse it for gemini, stderr, and potentially other executors. * Fix fe routes 3 (#378) * Task attempts * Task types * Get single task attempt endpoint * Task attempt response * Branch status * More task attempt endpoints * Task attempt children * Events WIP * Stream events when task, task attempt and execution process change status * Fixes * Cleanup logs * Alex/refactor pr monitor (#377) * Refactor task status updates and add PR monitoring functionality * Add PR monitoring service and integrate it into deployment flow Refactor GitHub token retrieval in PR creation and monitoring services Fix github pr regex * Fix types * refactor: dev server logic (#374) * reimplement start dev server logic * robust process group killing * Fix fe routes 4 (#383) * Add endpoint to get execution processes * Update types for execution process * Further execution process type cleanup * Wipe existing logs display * Further process related cleanup * Update get task attempt endpoint * Frozen type removal * Diff types * Display raw logs WIP * fix: extract session id once per execution (#386) * Fix fe routes 5 (#387) * Display normalized logs * Add execution-process info endpoint * WIP load into virtualized * Simplified unified logs * Raw logs also use json patch now (simplifies FE keys) * WIP * Fix FE rendering * Remove timestamps * Fix conversation height * Cleanup entry display * Spacing * Mark the boundaries between different execution processes in the logs * Deduplicate entries * Fix replace * Fmt * put back stop execution process endpoint (#384) * Fix fe routes 6 (#391) * WIP cleanup to remove related tasks and plans * Refactor active tab * Remove existing diff FE logic * Rename tab * WIP stream file events * WIP track FS events * Respect gitignore * Debounced event * Deduplicate events * Refactor git diff * WIP stream diffs * Resolve issue with unstaged changes * Diff filter by files * Stream ongoing changes * Remove entries when reset and json patch safe entry ids * Update the diff tab * Cleanup logs * Cleanup * Error enum * Update create PR attempt URL * Follow up and open in IDE * Fix merge * refactor: introduce `AgentProfiles` (#388) * automatically schedule coding agent execution after setup script * profiles implementation * add next_action field to ExecutorAction type * make start_next_action generic to action type Remove ProfilesManager and DefaultCommandBuilder structs * store executor_action_type in the DB * update shared types * rename structs * fix compile error * Refactor remaining task routes (#389) * Implement deletion functionality for execution processes and task attempts, including recursive deletion of associated logs. refactor: deletion process for task attempts and associated entities feat: Refactor task and task attempt models to remove executor field - Removed the `executor` field from the `task_attempt` model and related queries. - Updated the `CreateTaskAndStart` struct to encapsulate task and attempt creation. - Modified the task creation and starting logic to accommodate the new structure. - Adjusted SQL queries and migration scripts to reflect the removal of the executor. - Enhanced notification service to handle executor types dynamically. - Updated TypeScript types to align with the changes in the Rust models. refactor: remove CreateTaskAndStart type and update related code Add TaskAttemptWithLatestProfile and alias in frontend Fix silent failure of sqlx builder Remove db migration Fix rebase errors * Remove unneeded delete logic; move common container logic to service * Profiles fe (#398) * Get things compiling * Refactor the config * WIP fix task attempt creation * Further config fixes * Sounds and executors in settings * Fix sounds * Display profile config * Onboarding * Remove hardcoded agents * Move follow up attempt params to shared * Remove further shared types * Remove comment (#400) * Codex (#380) * only trigger error message when RunReason is SetupScript (#396) * Opencode (#385) * Restore Gemini followups (#392) * fix task killing (#395) * commit changes after successful execution (#403) * Claude-code-router (#410) * Amp tool use (#407) * Config upgrades (#405) * Versioned config * Upgrade fixes * Save config after migration * Scoping * Update Executor types * Theme types fix * Cleanup * Change theme selector to an enum * Rename config schema version field * Diff improve (#412) * Ensure container exists * Safe handling when ExecutorAction isn't valid JSON in DB * Reset data when endpoint changes * refactor: conditional notification (#408) * conditional notification * fix next action run_reason * remove redundant log * Fix GitHub auth frontend (#404) * fix frontend github auth * Add GitHub error handling and update dependencies - Introduced GitHubMagicErrorStrings enum for consistent error messaging related to GitHub authentication and permissions. - Updated the GitHubService to include a check_token method for validating tokens. - Refactored auth and task_attempts routes to utilize the new error handling. - Added strum_macros dependency in Cargo.toml for enum display. * Refactor GitHub error handling and API response structure to use CreateGitHubPRErrorData * Refactor API response handling in CreatePRDialog and update attemptsApi to return structured results * Refactor tasksApi.createAndStart to remove projectId parameter from API call * use SCREAMING_SNAKE_CASE for consistency * Refactor GitHub error handling to replace CreateGitHubPRErrorData with GitHubServiceError across the codebase * Update crates/utils/src/response.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix compile error * Fix types --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix: (#415) - Config location - Serve FE from BE in prod - Create config when doesn't exist - Tmp disable building the MCP * Fix dev server route (#417) * remove legacy logic and unused crates (#418) * update CLAUDE.md for new project structure (#420) * fix mcp settings page (#419) * Fix cards not updating (vibe-kanban) (#416) * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * feat: update task status management in container service * refactor: simplify notification logic and finalize context checks in LocalContainerService * Task attempt fe fixes (#422) * Style tweaks * Refactor * Fix auto scroll * Implement stop endpoint for all execution processed in a task attempt * Weird race condition with amp * Remove log * Fix follow ups * Re-add stop task attempt endpoint (#421) * Re-add stop task attempt endpoint; remove legacy comments for implemented functionality * Fix kill race condition; fix state change when dev server * Ci fixes (#425) * Eslint fix * Remove #[ts(export)] * Fix tests * Clippy * Prettier * Fmt * Version downgrade * Fix API response * Don't treat clippy warnings as errors * Change crate name * Update cargo location * Update further refs * Reset versions * Bump versions * Update binary names * Branch fix * Prettier * Ensure finished event sends data (#434) * use option_env! when reading analytics vars (#435) * remove dead logic (#436) * update crate version across workspace (#437) * add all crates across the workspace * chore: bump version to 0.0.56 --------- Co-authored-by: Alex Netsch <alex@bloop.ai> Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> Co-authored-by: GitHub Action <action@github.com>
2025-08-08 13:53:27 +01:00
name = "server"
2025-10-29 12:14:38 +00:00
version = "0.0.113"
Easier project creation (#600) * Easier project creation (vibe-kanban 71f2ce0b) The current project creation screen is complicated and without any good defaults. We need to make it easier to create projects, offering existing git repos as base. Easier project creation (vibe-kanban 71f2ce0b) The current project creation screen is complicated and without any good defaults. We need to make it easier to create projects, offering existing git repos as base. Easier project creation (vibe-kanban 71f2ce0b) The current project creation screen is complicated and without any good defaults. We need to make it easier to create projects, offering existing git repos as base. Better project creation menu (vibe-kanban 0f35d0be) WHen creating a project from an existing repo, maybe instead of the show more with arrow in the middle we could move that to the right and have a "+ Find" sort of button to the left of it? that would then open the other thing? Better project creation menu (vibe-kanban 0f35d0be) WHen creating a project from an existing repo, maybe instead of the show more with arrow in the middle we could move that to the right and have a "+ Find" sort of button to the left of it? that would then open the other thing? Better project creation menu (vibe-kanban 0f35d0be) WHen creating a project from an existing repo, maybe instead of the show more with arrow in the middle we could move that to the right and have a "+ Find" sort of button to the left of it? that would then open the other thing? Fix branch icon (vibe-kanban 59e0ee6e) We added some stuff to make project creation easier in the last few commits, but now the branch icon for the selected branch goes invisible when selecting one. ![Screenshot 2025-09-01 at 15.55.57.png](.vibe-images/94bc9ba5-b6a8-4ea3-bfb1-60adeed966d7.png) Fix branch icon (vibe-kanban 59e0ee6e) We added some stuff to make project creation easier in the last few commits, but now the branch icon for the selected branch goes invisible when selecting one. ![Screenshot 2025-09-01 at 15.55.57.png](.vibe-images/94bc9ba5-b6a8-4ea3-bfb1-60adeed966d7.png) Fix branch icon (vibe-kanban 59e0ee6e) We added some stuff to make project creation easier in the last few commits, but now the branch icon for the selected branch goes invisible when selecting one. ![Screenshot 2025-09-01 at 15.55.57.png](.vibe-images/94bc9ba5-b6a8-4ea3-bfb1-60adeed966d7.png) Fix branch icon (vibe-kanban 59e0ee6e) We added some stuff to make project creation easier in the last few commits, but now the branch icon for the selected branch goes invisible when selecting one. ![Screenshot 2025-09-01 at 15.55.57.png](.vibe-images/94bc9ba5-b6a8-4ea3-bfb1-60adeed966d7.png) Project creation layout (vibe-kanban 4fbf61c8) atch the \"New Repository\" structure:\n```tsx\n{/* Display selected repository fields */}\n{selectedPath && selectedRepo && (\n <div className=\"space-y-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"base-dir\">Base Directory</Label>\n <div className=\"flex space-x-2\">\n <Input\n id=\"base-dir\"\n type=\"text\"\n value={selectedRepo.path.substring(0, selectedRepo.path.lastIndexOf('/'))}\n disabled\n readOnly\n className=\"flex-1\"\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled\n className=\"opacity-50\"\n >\n <Folder className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"repo-name\">Repository Folder Name</Label>\n <Input\n id=\"repo-name\"\n type=\"text\"\n value={selectedRepo.name}\n disabled\n readOnly\n />\n </div>\n </div>\n)}\n```\n\n### Visual Result\n\n**Existing Repository Mode:**\n```\n[Repository Dropdown ▼] [🔍]\n\nBase Directory\n[/path/to/parent] [📁] (disabled)\n\nRepository Folder Name\n[repo-name] (disabled)\n```\n\n**New Repository Mode:**\n```\nParent Directory\n[/path/to/parent] [📁] (editable)\n\nRepository Folder Name\n[repo-name] (editable)\n```\n\n### Benefits\n\n1. **Visual Consistency**: Both modes show the same fields in the same layout\n2. **Clear Distinction**: Disabled/readonly fields for existing repos vs editable for new\n3. **Better Information**: Users can see the base directory and folder name clearly\n4. **Cleaner Design**: No need for special card styling, uses standard form fields\n5. **Intuitive**: The disabled state clearly indicates these are display-only for existing repos\n\n### Technical Notes\n\n- Use `disabled` and `readOnly` props on Input components for existing repos\n- Extract base directory using `substring` and `lastIndexOf('/')`\n- Keep the folder button disabled with `opacity-50` for visual consistency\n- Remove the help text for existing repos since fields are self-explanatory when read-only Change tabs to align with edit (vibe-kanban 7b589225) For project creation, the tabs for From git and blank project should have the same appearance as the tabs in edit project Cleanup changes (vibe-kanban e498187d) Cleanup the changes made in the last four commits. The changes are good, but there may be unsused things that didnt get cleaned up Review changes (vibe-kanban 9a859f73) Make sure the stuff add in the last 6 commits reuses components instead of duplicating, among others look at the tabs/collapsible stuff Cleanup changes (vibe-kanban e498187d) Cleanup the changes made in the last commit. The changes are good, but there may be unsused things that didnt get cleaned up, there may be things we remove that shouldve stayed, like the tabnavigation Project creation submission (vibe-kanban e8fcfd73) When collapsing things while creating a project, it submits the form instead of collapsing the section fmt, cleanup Default parent path (vibe-kanban 9be78842) For project creation, when creating a blank vk project, we should have a deafault parent path or make it more lear the user has to select one Default parent path (vibe-kanban 9be78842) For project creation, when creating a blank vk project, we should have a deafault parent path or make it more lear the user has to select one Default parent path (vibe-kanban 9be78842) For project creation, when creating a blank vk project, we should have a deafault parent path or make it more lear the user has to select one Default parent path (vibe-kanban 9be78842) For project creation, when creating a blank vk project, we should have a deafault parent path or make it more lear the user has to select one Default parent path (vibe-kanban 9be78842) For project creation, when creating a blank vk project, we should have a deafault parent path or make it more lear the user has to select one Default parent path (vibe-kanban 9be78842) For project creation, when creating a blank vk project, we should have a deafault parent path or make it more lear the user has to select one * Update Rust edition to 2024 and refactor project routes for improved clarity fmt * Project creation layout (vibe-kanban f726d2e6) When creating a new project, users should see only the repo selection at first, after selecting one the rest of the options appears. Remove script options from project creation screen (vibe-kanban 049226af) Project creation does not need to show script options, these should only be available via edit project. Better add project (vibe-kanban 79e936bc) When no projects are available, we should display project creation options right away Project creation style (vibe-kanban 91bce79b) The styling of the project creation dialog should be unified with the rest of the project Review (vibe-kanban 4f8f8068) Review this PR: https://github.com/BloopAI/vibe-kanban/pull/600 The github cli should work. Just review, no changes! fmt Fix changes lost in rebase fmt remove unused collapsible section, remove duplicate default repo path Re-add detailed script descriptions
2025-09-03 09:27:50 +01:00
edition = "2024"
Deployments (#414) * init deployment * refactor state * pre executor app state refactor * deployment in app state * clone * fix executors * fix dependencies * command runner via app_state * clippy * remove dependency on ENVIRONMENT from command_runner * remove dependency on ENVIRONMENT from command_runner * build fix * clippy * fmt * featues * vscode lints for cloud * change streaming to SSE (#338) Remove debug logging Cleanup streaming logic feat: add helper function for creating SSE stream responses for stdout/stderr * update vscode guidance * move start * Fix executors * Move command executor to separate file * Fix imports for executors * Partial fix test_remote * Fix * fmt * Clippy * Add back GitHub cloud only routes * cleanup and shared types * Prepare for separate cloud crate * Init backend-common workspace * Update * WIP * WIP * WIP * WIP * WIP * WIP * Projects (and sqlx) * Tasks * WIP * Amp * Backend executor structs * Task attempts outline * Move to crates folder * Cleanup frontend dist * Split out executors into separate crate * Config and sentry * Create deployment method helper * Router * Config endpoints * Projects, analytics * Update analytics paths when keys not provided * Tasks, task context * Middleware, outline task attempts * Delete backend common * WIP container * WIP container * Migrate worktree_path to container_ref (generic) * WIP container service create * Launch container * Fix create task * Create worktree * Move logic into container * Execution outline * Executor selection * Use enum_dispatch to route spawn tree * Update route errors * Implement child calling * Move running executions to container * Add streaming with history * Drop cloud WIP * Logs * Logs * Refactor container logic to execution tracker * Chunk based streaming and cleanup * Alex/mirgate task templates (#350) * Re-enable task templates; migrate routes; migrate args and return types * Refactor task template routes; consolidate list functions into get_templates with query support * Fix get_templates function * Implement amp executor * Gemini WIP * Make streaming the event store reusable * Rewrite mutex to rwlock * Staging for normalised logs impl * Store custom LogMsg instead of event as more flexible * Cleanup * WIP newline stream for amp (tested and working, needs store impl) * refactor: move stranded `git2` logic out of `models` (#352) * remove legacy command_executor; move git2 logic into GitService * remove legacy cloud runner * put back config get route * remove dead logic * WIP amp normalisation * Normalized logs now save to save msg store as raw * Refactor auth endpoints (#355) * Re-enable auth;Change auth to use deployment Add auth service Move auth logic to service Add auth router and service integration to deployment Refactor auth service and routes to use octocrab Refactor auth error handling and improve token validation responses * rename auth_router to router for consistency * refactor: rename auth_service to auth for consistency (#356) * Refactor filesystem endpoints (#357) * feat: implement filesystem service with directory listing and git repo detection * refactor: update filesystem routes; sort repos by last modfied * Gemini executor logs normalization * feat: add sound file serving endpoint and implement sound file loading (#358) * Gemini executor followup (#360) * Sync logs to db (#359) * Exit monitor * Outline stream logs to DB * Outline read from the message store * Add execution_process_logs, store logs in DB * Stream logs from DB * Normalized logs from DB * Remove eronious .sqlx cache * Remove execution process stdout and stderr * Update execution process record on completion * Emit session event for amp * Update session ID when event is emitted * Split local/common spawn fn * Create initial executor session * Move normalized logs into executors * Store executor action * Refactor updated_at to use micro seconds * Follow up executions (#363) * Follow up request handler scaffold Rename coding agent initial / follow up actions * Follow ups * Response for follow up * Simplify execution actions for coding agents * fix executor selection (#362) * refactor: move logic out of `TaskAttempt` (#361) * re-enable /diff /pr /rebase /merge /branch-status /open-editor /delete-file endpoints * address review comments * remove relic * Claude Code (#365) * Use ApiError rather than DeploymentError type in routes (#366) * Fix fe routes (#367) * /api/filesystem/list -> /api/filesystem/directory * /api/projects/:project_id/tasks -> /api/tasks * Remove with-branch * /api/projects/:project_id/tasks/:task_id -> /api/tasks/:task_id * Post tasks * Update template routes * Update BE for github poll endpoint, FE still needs updating * WIP freeze old types * File picker fix * Project types * Solve tsc warna * Remove constants and FE cloud mode * Setup for /api/info refactor * WIP config refactor * Remove custom mapping to coding agents * Update settings to fix code editor * Config fix (will need further changes once attempts types migrated) * Tmp fix types * Config auto deserialisation * Alex/refactor background processes (#369) * feat: add cleanup for orphaned executions at startup * Fix worktree cleanup; re add worktree cleanup queries * refactor worktree cleanup for orphaned and externally deleted worktrees * Fix compile error * refactor: container creation lifecycle (#368) * Consolidate worktree logic in the WorktreeManager * move auxiliary logic into worktree manager * fix compile error * Rename core crate to server * Fix npm run dev * Fix fe routes 2 (#371) * Migrate config paths * Update sounds, refactor lib.rs * Project FE types * Branch * Cleanup sound constants * Template types * Cleanup file search and other unused types * Handle errors * wip: basic mcp config editing (#351) * Re-add notification service, move assets to common dir (#373) add config to containter, add notifications into exit monitor Refctor notification service Refactor notifications * Stderr support (#372) Refactor plain-text log processing and resuse it for gemini, stderr, and potentially other executors. * Fix fe routes 3 (#378) * Task attempts * Task types * Get single task attempt endpoint * Task attempt response * Branch status * More task attempt endpoints * Task attempt children * Events WIP * Stream events when task, task attempt and execution process change status * Fixes * Cleanup logs * Alex/refactor pr monitor (#377) * Refactor task status updates and add PR monitoring functionality * Add PR monitoring service and integrate it into deployment flow Refactor GitHub token retrieval in PR creation and monitoring services Fix github pr regex * Fix types * refactor: dev server logic (#374) * reimplement start dev server logic * robust process group killing * Fix fe routes 4 (#383) * Add endpoint to get execution processes * Update types for execution process * Further execution process type cleanup * Wipe existing logs display * Further process related cleanup * Update get task attempt endpoint * Frozen type removal * Diff types * Display raw logs WIP * fix: extract session id once per execution (#386) * Fix fe routes 5 (#387) * Display normalized logs * Add execution-process info endpoint * WIP load into virtualized * Simplified unified logs * Raw logs also use json patch now (simplifies FE keys) * WIP * Fix FE rendering * Remove timestamps * Fix conversation height * Cleanup entry display * Spacing * Mark the boundaries between different execution processes in the logs * Deduplicate entries * Fix replace * Fmt * put back stop execution process endpoint (#384) * Fix fe routes 6 (#391) * WIP cleanup to remove related tasks and plans * Refactor active tab * Remove existing diff FE logic * Rename tab * WIP stream file events * WIP track FS events * Respect gitignore * Debounced event * Deduplicate events * Refactor git diff * WIP stream diffs * Resolve issue with unstaged changes * Diff filter by files * Stream ongoing changes * Remove entries when reset and json patch safe entry ids * Update the diff tab * Cleanup logs * Cleanup * Error enum * Update create PR attempt URL * Follow up and open in IDE * Fix merge * refactor: introduce `AgentProfiles` (#388) * automatically schedule coding agent execution after setup script * profiles implementation * add next_action field to ExecutorAction type * make start_next_action generic to action type Remove ProfilesManager and DefaultCommandBuilder structs * store executor_action_type in the DB * update shared types * rename structs * fix compile error * Refactor remaining task routes (#389) * Implement deletion functionality for execution processes and task attempts, including recursive deletion of associated logs. refactor: deletion process for task attempts and associated entities feat: Refactor task and task attempt models to remove executor field - Removed the `executor` field from the `task_attempt` model and related queries. - Updated the `CreateTaskAndStart` struct to encapsulate task and attempt creation. - Modified the task creation and starting logic to accommodate the new structure. - Adjusted SQL queries and migration scripts to reflect the removal of the executor. - Enhanced notification service to handle executor types dynamically. - Updated TypeScript types to align with the changes in the Rust models. refactor: remove CreateTaskAndStart type and update related code Add TaskAttemptWithLatestProfile and alias in frontend Fix silent failure of sqlx builder Remove db migration Fix rebase errors * Remove unneeded delete logic; move common container logic to service * Profiles fe (#398) * Get things compiling * Refactor the config * WIP fix task attempt creation * Further config fixes * Sounds and executors in settings * Fix sounds * Display profile config * Onboarding * Remove hardcoded agents * Move follow up attempt params to shared * Remove further shared types * Remove comment (#400) * Codex (#380) * only trigger error message when RunReason is SetupScript (#396) * Opencode (#385) * Restore Gemini followups (#392) * fix task killing (#395) * commit changes after successful execution (#403) * Claude-code-router (#410) * Amp tool use (#407) * Config upgrades (#405) * Versioned config * Upgrade fixes * Save config after migration * Scoping * Update Executor types * Theme types fix * Cleanup * Change theme selector to an enum * Rename config schema version field * Diff improve (#412) * Ensure container exists * Safe handling when ExecutorAction isn't valid JSON in DB * Reset data when endpoint changes * refactor: conditional notification (#408) * conditional notification * fix next action run_reason * remove redundant log * Fix GitHub auth frontend (#404) * fix frontend github auth * Add GitHub error handling and update dependencies - Introduced GitHubMagicErrorStrings enum for consistent error messaging related to GitHub authentication and permissions. - Updated the GitHubService to include a check_token method for validating tokens. - Refactored auth and task_attempts routes to utilize the new error handling. - Added strum_macros dependency in Cargo.toml for enum display. * Refactor GitHub error handling and API response structure to use CreateGitHubPRErrorData * Refactor API response handling in CreatePRDialog and update attemptsApi to return structured results * Refactor tasksApi.createAndStart to remove projectId parameter from API call * use SCREAMING_SNAKE_CASE for consistency * Refactor GitHub error handling to replace CreateGitHubPRErrorData with GitHubServiceError across the codebase * Update crates/utils/src/response.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix compile error * Fix types --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix: (#415) - Config location - Serve FE from BE in prod - Create config when doesn't exist - Tmp disable building the MCP * Fix dev server route (#417) * remove legacy logic and unused crates (#418) * update CLAUDE.md for new project structure (#420) * fix mcp settings page (#419) * Fix cards not updating (vibe-kanban) (#416) * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * feat: update task status management in container service * refactor: simplify notification logic and finalize context checks in LocalContainerService * Task attempt fe fixes (#422) * Style tweaks * Refactor * Fix auto scroll * Implement stop endpoint for all execution processed in a task attempt * Weird race condition with amp * Remove log * Fix follow ups * Re-add stop task attempt endpoint (#421) * Re-add stop task attempt endpoint; remove legacy comments for implemented functionality * Fix kill race condition; fix state change when dev server * Ci fixes (#425) * Eslint fix * Remove #[ts(export)] * Fix tests * Clippy * Prettier * Fmt * Version downgrade * Fix API response * Don't treat clippy warnings as errors * Change crate name * Update cargo location * Update further refs * Reset versions * Bump versions * Update binary names * Branch fix * Prettier * Ensure finished event sends data (#434) * use option_env! when reading analytics vars (#435) * remove dead logic (#436) * update crate version across workspace (#437) * add all crates across the workspace * chore: bump version to 0.0.56 --------- Co-authored-by: Alex Netsch <alex@bloop.ai> Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> Co-authored-by: GitHub Action <action@github.com>
2025-08-08 13:53:27 +01:00
default-run = "server"
Alex/refactor command runner (#323) * feat: implement CommandRunner and integrate with executors refactor: replace command_group::AsyncGroupChild with command_runner::CommandProcess in executor and process_service Migrate traits and claude to commandrunner Migrate gemini to command_runner Migrate sst_opencode Migrate ccr Migrate amp Migrate charm opencode Migrate cleanup_script Migrate executor (vibe-kanban 28b4ede6) Ive added an abstract command runner to enable local and remote execution later. I already migrated the amp executor, please go ahead and replace migrate process handling with the new command runner @backend/src/command_runner.rs . If there are any missing functions ask me about them. Migrate backend/src/executors/echo.rs to be compatible. Migrate executor (vibe-kanban 9dc48bc8) Ive added an abstract command runner to enable local and remote execution later. I already migrated the amp executor, please go ahead and replace migrate process handling with the new command runner @backend/src/command_runner.rs . If there are any missing functions ask me about them. Migrate @backend/src/executors/dev_server.rs to be compatible. Migrate executor (vibe-kanban d3ac2aa5) Ive added an abstract command runner to enable local and remote execution later. I already migrated the amp executor, please go ahead and replace migrate process handling with the new command runner @backend/src/command_runner.rs . If there are any missing functions ask me about them. Migrate backend/src/executors/setup_script.rs to be compatible. Fmt + lint * Refactor CommandRunner initialization to use new() method for improved environment handling * Add basic cloud runner and test scripts Enhance cloud runner and command runner for true streaming support - Refactor process management in cloud runner to use ProcessEntry struct for better handling of stdout and stderr streams. - Implement true chunk-based streaming for command output via HTTP in command runner. - Update test_remote to verify streaming functionality with real-time output capture. Clippy and fmt Refactor CommandStream and CommandProcess to remove dead code and improve stream handling Refactor cloud runner and command runner to improve API response handling and streamline process status management Change stream setup to be async * Revert "Change stream setup to be async" This reverts commit 79b5cde12aefafe9e669b93167036c8c6adf9145. Revert "Refactor cloud runner and command runner to improve API response handling and streamline process status management" This reverts commit 3cc03ff82424bd715a6f20f3124bd7bf80bc2d72. Revert "Refactor CommandStream and CommandProcess to remove dead code and improve stream handling" This reverts commit dcab0fcd9622416b7881af4add513b371894e408. * refactor: remove unused imports and update command execution to use CommandProcess * refactor: clean up CommandRunner and CommandProcess by removing dead code and updating initialization logic * Fix improts * refactor commandexecutors into local and remote * refactor: update stream methods to be asynchronous across command execution components * refactor: update command runner references; remove remote test binary; remove debug script * Remove unused stdout alias * Clippy * refactor: consolidate CommandExitStatus implementations for local and remote processes * refactor: replace CreateCommandRequest with CommandRunnerArgs in command execution * refactor: optimize stream creation by using concurrent HTTP requests
2025-07-24 11:44:57 +01:00
[lints.clippy]
uninlined-format-args = "allow"
2025-06-14 15:14:08 -04:00
[dependencies]
Deployments (#414) * init deployment * refactor state * pre executor app state refactor * deployment in app state * clone * fix executors * fix dependencies * command runner via app_state * clippy * remove dependency on ENVIRONMENT from command_runner * remove dependency on ENVIRONMENT from command_runner * build fix * clippy * fmt * featues * vscode lints for cloud * change streaming to SSE (#338) Remove debug logging Cleanup streaming logic feat: add helper function for creating SSE stream responses for stdout/stderr * update vscode guidance * move start * Fix executors * Move command executor to separate file * Fix imports for executors * Partial fix test_remote * Fix * fmt * Clippy * Add back GitHub cloud only routes * cleanup and shared types * Prepare for separate cloud crate * Init backend-common workspace * Update * WIP * WIP * WIP * WIP * WIP * WIP * Projects (and sqlx) * Tasks * WIP * Amp * Backend executor structs * Task attempts outline * Move to crates folder * Cleanup frontend dist * Split out executors into separate crate * Config and sentry * Create deployment method helper * Router * Config endpoints * Projects, analytics * Update analytics paths when keys not provided * Tasks, task context * Middleware, outline task attempts * Delete backend common * WIP container * WIP container * Migrate worktree_path to container_ref (generic) * WIP container service create * Launch container * Fix create task * Create worktree * Move logic into container * Execution outline * Executor selection * Use enum_dispatch to route spawn tree * Update route errors * Implement child calling * Move running executions to container * Add streaming with history * Drop cloud WIP * Logs * Logs * Refactor container logic to execution tracker * Chunk based streaming and cleanup * Alex/mirgate task templates (#350) * Re-enable task templates; migrate routes; migrate args and return types * Refactor task template routes; consolidate list functions into get_templates with query support * Fix get_templates function * Implement amp executor * Gemini WIP * Make streaming the event store reusable * Rewrite mutex to rwlock * Staging for normalised logs impl * Store custom LogMsg instead of event as more flexible * Cleanup * WIP newline stream for amp (tested and working, needs store impl) * refactor: move stranded `git2` logic out of `models` (#352) * remove legacy command_executor; move git2 logic into GitService * remove legacy cloud runner * put back config get route * remove dead logic * WIP amp normalisation * Normalized logs now save to save msg store as raw * Refactor auth endpoints (#355) * Re-enable auth;Change auth to use deployment Add auth service Move auth logic to service Add auth router and service integration to deployment Refactor auth service and routes to use octocrab Refactor auth error handling and improve token validation responses * rename auth_router to router for consistency * refactor: rename auth_service to auth for consistency (#356) * Refactor filesystem endpoints (#357) * feat: implement filesystem service with directory listing and git repo detection * refactor: update filesystem routes; sort repos by last modfied * Gemini executor logs normalization * feat: add sound file serving endpoint and implement sound file loading (#358) * Gemini executor followup (#360) * Sync logs to db (#359) * Exit monitor * Outline stream logs to DB * Outline read from the message store * Add execution_process_logs, store logs in DB * Stream logs from DB * Normalized logs from DB * Remove eronious .sqlx cache * Remove execution process stdout and stderr * Update execution process record on completion * Emit session event for amp * Update session ID when event is emitted * Split local/common spawn fn * Create initial executor session * Move normalized logs into executors * Store executor action * Refactor updated_at to use micro seconds * Follow up executions (#363) * Follow up request handler scaffold Rename coding agent initial / follow up actions * Follow ups * Response for follow up * Simplify execution actions for coding agents * fix executor selection (#362) * refactor: move logic out of `TaskAttempt` (#361) * re-enable /diff /pr /rebase /merge /branch-status /open-editor /delete-file endpoints * address review comments * remove relic * Claude Code (#365) * Use ApiError rather than DeploymentError type in routes (#366) * Fix fe routes (#367) * /api/filesystem/list -> /api/filesystem/directory * /api/projects/:project_id/tasks -> /api/tasks * Remove with-branch * /api/projects/:project_id/tasks/:task_id -> /api/tasks/:task_id * Post tasks * Update template routes * Update BE for github poll endpoint, FE still needs updating * WIP freeze old types * File picker fix * Project types * Solve tsc warna * Remove constants and FE cloud mode * Setup for /api/info refactor * WIP config refactor * Remove custom mapping to coding agents * Update settings to fix code editor * Config fix (will need further changes once attempts types migrated) * Tmp fix types * Config auto deserialisation * Alex/refactor background processes (#369) * feat: add cleanup for orphaned executions at startup * Fix worktree cleanup; re add worktree cleanup queries * refactor worktree cleanup for orphaned and externally deleted worktrees * Fix compile error * refactor: container creation lifecycle (#368) * Consolidate worktree logic in the WorktreeManager * move auxiliary logic into worktree manager * fix compile error * Rename core crate to server * Fix npm run dev * Fix fe routes 2 (#371) * Migrate config paths * Update sounds, refactor lib.rs * Project FE types * Branch * Cleanup sound constants * Template types * Cleanup file search and other unused types * Handle errors * wip: basic mcp config editing (#351) * Re-add notification service, move assets to common dir (#373) add config to containter, add notifications into exit monitor Refctor notification service Refactor notifications * Stderr support (#372) Refactor plain-text log processing and resuse it for gemini, stderr, and potentially other executors. * Fix fe routes 3 (#378) * Task attempts * Task types * Get single task attempt endpoint * Task attempt response * Branch status * More task attempt endpoints * Task attempt children * Events WIP * Stream events when task, task attempt and execution process change status * Fixes * Cleanup logs * Alex/refactor pr monitor (#377) * Refactor task status updates and add PR monitoring functionality * Add PR monitoring service and integrate it into deployment flow Refactor GitHub token retrieval in PR creation and monitoring services Fix github pr regex * Fix types * refactor: dev server logic (#374) * reimplement start dev server logic * robust process group killing * Fix fe routes 4 (#383) * Add endpoint to get execution processes * Update types for execution process * Further execution process type cleanup * Wipe existing logs display * Further process related cleanup * Update get task attempt endpoint * Frozen type removal * Diff types * Display raw logs WIP * fix: extract session id once per execution (#386) * Fix fe routes 5 (#387) * Display normalized logs * Add execution-process info endpoint * WIP load into virtualized * Simplified unified logs * Raw logs also use json patch now (simplifies FE keys) * WIP * Fix FE rendering * Remove timestamps * Fix conversation height * Cleanup entry display * Spacing * Mark the boundaries between different execution processes in the logs * Deduplicate entries * Fix replace * Fmt * put back stop execution process endpoint (#384) * Fix fe routes 6 (#391) * WIP cleanup to remove related tasks and plans * Refactor active tab * Remove existing diff FE logic * Rename tab * WIP stream file events * WIP track FS events * Respect gitignore * Debounced event * Deduplicate events * Refactor git diff * WIP stream diffs * Resolve issue with unstaged changes * Diff filter by files * Stream ongoing changes * Remove entries when reset and json patch safe entry ids * Update the diff tab * Cleanup logs * Cleanup * Error enum * Update create PR attempt URL * Follow up and open in IDE * Fix merge * refactor: introduce `AgentProfiles` (#388) * automatically schedule coding agent execution after setup script * profiles implementation * add next_action field to ExecutorAction type * make start_next_action generic to action type Remove ProfilesManager and DefaultCommandBuilder structs * store executor_action_type in the DB * update shared types * rename structs * fix compile error * Refactor remaining task routes (#389) * Implement deletion functionality for execution processes and task attempts, including recursive deletion of associated logs. refactor: deletion process for task attempts and associated entities feat: Refactor task and task attempt models to remove executor field - Removed the `executor` field from the `task_attempt` model and related queries. - Updated the `CreateTaskAndStart` struct to encapsulate task and attempt creation. - Modified the task creation and starting logic to accommodate the new structure. - Adjusted SQL queries and migration scripts to reflect the removal of the executor. - Enhanced notification service to handle executor types dynamically. - Updated TypeScript types to align with the changes in the Rust models. refactor: remove CreateTaskAndStart type and update related code Add TaskAttemptWithLatestProfile and alias in frontend Fix silent failure of sqlx builder Remove db migration Fix rebase errors * Remove unneeded delete logic; move common container logic to service * Profiles fe (#398) * Get things compiling * Refactor the config * WIP fix task attempt creation * Further config fixes * Sounds and executors in settings * Fix sounds * Display profile config * Onboarding * Remove hardcoded agents * Move follow up attempt params to shared * Remove further shared types * Remove comment (#400) * Codex (#380) * only trigger error message when RunReason is SetupScript (#396) * Opencode (#385) * Restore Gemini followups (#392) * fix task killing (#395) * commit changes after successful execution (#403) * Claude-code-router (#410) * Amp tool use (#407) * Config upgrades (#405) * Versioned config * Upgrade fixes * Save config after migration * Scoping * Update Executor types * Theme types fix * Cleanup * Change theme selector to an enum * Rename config schema version field * Diff improve (#412) * Ensure container exists * Safe handling when ExecutorAction isn't valid JSON in DB * Reset data when endpoint changes * refactor: conditional notification (#408) * conditional notification * fix next action run_reason * remove redundant log * Fix GitHub auth frontend (#404) * fix frontend github auth * Add GitHub error handling and update dependencies - Introduced GitHubMagicErrorStrings enum for consistent error messaging related to GitHub authentication and permissions. - Updated the GitHubService to include a check_token method for validating tokens. - Refactored auth and task_attempts routes to utilize the new error handling. - Added strum_macros dependency in Cargo.toml for enum display. * Refactor GitHub error handling and API response structure to use CreateGitHubPRErrorData * Refactor API response handling in CreatePRDialog and update attemptsApi to return structured results * Refactor tasksApi.createAndStart to remove projectId parameter from API call * use SCREAMING_SNAKE_CASE for consistency * Refactor GitHub error handling to replace CreateGitHubPRErrorData with GitHubServiceError across the codebase * Update crates/utils/src/response.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix compile error * Fix types --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix: (#415) - Config location - Serve FE from BE in prod - Create config when doesn't exist - Tmp disable building the MCP * Fix dev server route (#417) * remove legacy logic and unused crates (#418) * update CLAUDE.md for new project structure (#420) * fix mcp settings page (#419) * Fix cards not updating (vibe-kanban) (#416) * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * feat: update task status management in container service * refactor: simplify notification logic and finalize context checks in LocalContainerService * Task attempt fe fixes (#422) * Style tweaks * Refactor * Fix auto scroll * Implement stop endpoint for all execution processed in a task attempt * Weird race condition with amp * Remove log * Fix follow ups * Re-add stop task attempt endpoint (#421) * Re-add stop task attempt endpoint; remove legacy comments for implemented functionality * Fix kill race condition; fix state change when dev server * Ci fixes (#425) * Eslint fix * Remove #[ts(export)] * Fix tests * Clippy * Prettier * Fmt * Version downgrade * Fix API response * Don't treat clippy warnings as errors * Change crate name * Update cargo location * Update further refs * Reset versions * Bump versions * Update binary names * Branch fix * Prettier * Ensure finished event sends data (#434) * use option_env! when reading analytics vars (#435) * remove dead logic (#436) * update crate version across workspace (#437) * add all crates across the workspace * chore: bump version to 0.0.56 --------- Co-authored-by: Alex Netsch <alex@bloop.ai> Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> Co-authored-by: GitHub Action <action@github.com>
2025-08-08 13:53:27 +01:00
deployment = { path = "../deployment" }
executors = { path = "../executors" }
local-deployment = { path = "../local-deployment" }
utils = { path = "../utils" }
db = { path = "../db" }
services = { path = "../services" }
2025-06-14 15:14:08 -04:00
tokio = { workspace = true }
Alex/refactor command runner (#323) * feat: implement CommandRunner and integrate with executors refactor: replace command_group::AsyncGroupChild with command_runner::CommandProcess in executor and process_service Migrate traits and claude to commandrunner Migrate gemini to command_runner Migrate sst_opencode Migrate ccr Migrate amp Migrate charm opencode Migrate cleanup_script Migrate executor (vibe-kanban 28b4ede6) Ive added an abstract command runner to enable local and remote execution later. I already migrated the amp executor, please go ahead and replace migrate process handling with the new command runner @backend/src/command_runner.rs . If there are any missing functions ask me about them. Migrate backend/src/executors/echo.rs to be compatible. Migrate executor (vibe-kanban 9dc48bc8) Ive added an abstract command runner to enable local and remote execution later. I already migrated the amp executor, please go ahead and replace migrate process handling with the new command runner @backend/src/command_runner.rs . If there are any missing functions ask me about them. Migrate @backend/src/executors/dev_server.rs to be compatible. Migrate executor (vibe-kanban d3ac2aa5) Ive added an abstract command runner to enable local and remote execution later. I already migrated the amp executor, please go ahead and replace migrate process handling with the new command runner @backend/src/command_runner.rs . If there are any missing functions ask me about them. Migrate backend/src/executors/setup_script.rs to be compatible. Fmt + lint * Refactor CommandRunner initialization to use new() method for improved environment handling * Add basic cloud runner and test scripts Enhance cloud runner and command runner for true streaming support - Refactor process management in cloud runner to use ProcessEntry struct for better handling of stdout and stderr streams. - Implement true chunk-based streaming for command output via HTTP in command runner. - Update test_remote to verify streaming functionality with real-time output capture. Clippy and fmt Refactor CommandStream and CommandProcess to remove dead code and improve stream handling Refactor cloud runner and command runner to improve API response handling and streamline process status management Change stream setup to be async * Revert "Change stream setup to be async" This reverts commit 79b5cde12aefafe9e669b93167036c8c6adf9145. Revert "Refactor cloud runner and command runner to improve API response handling and streamline process status management" This reverts commit 3cc03ff82424bd715a6f20f3124bd7bf80bc2d72. Revert "Refactor CommandStream and CommandProcess to remove dead code and improve stream handling" This reverts commit dcab0fcd9622416b7881af4add513b371894e408. * refactor: remove unused imports and update command execution to use CommandProcess * refactor: clean up CommandRunner and CommandProcess by removing dead code and updating initialization logic * Fix improts * refactor commandexecutors into local and remote * refactor: update stream methods to be asynchronous across command execution components * refactor: update command runner references; remove remote test binary; remove debug script * Remove unused stdout alias * Clippy * refactor: consolidate CommandExitStatus implementations for local and remote processes * refactor: replace CreateCommandRequest with CommandRunnerArgs in command execution * refactor: optimize stream creation by using concurrent HTTP requests
2025-07-24 11:44:57 +01:00
tokio-util = { version = "0.7", features = ["io"] }
2025-06-14 15:14:08 -04:00
axum = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
Debug delete issue / refactor event deletion (vibe-kanban) (#854) * Let me check the source code of sqlx to understand the correct API: * Cleanup script changes for task attempt 519bf9e5-6bad-42e1-8e80-cb5f2d7bb99f * ## Implementation Complete! The delete issue has been successfully fixed: ### ✅ Changes Made 1. **Added `sqlite-preupdate-hook` feature** to sqlx dependencies in all crates 2. **Implemented preupdate hook** in [`events.rs`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L252-L270) that: - Detects DELETE operations on the `tasks` table - Captures the task UUID from old column values **before** deletion - Generates and pushes the remove JSON patch immediately 3. **Modified existing DeletedTask handling** to skip duplicate patch generation 4. **Added required import** (`sqlx::ValueRef`) for the API ### 🎯 How It Works - **Before deletion**: Preupdate hook captures task ID and sends remove patch - **After deletion**: Post-update hook skips task deletion (avoiding None issue) - **Result**: Frontend gets proper task remove notifications with correct task_id ### 🧪 Testing - ✅ Code compiles successfully - ✅ Full workspace build passes - ✅ No type errors or missing dependencies The implementation is ready and should resolve the original issue where `RecordTypes::DeletedTask` had `None` values for `project_id` and `task_id` because the task was already deleted. * Cleanup script changes for task attempt 519bf9e5-6bad-42e1-8e80-cb5f2d7bb99f * ## ✅ Implementation Complete! I've successfully extended the delete issue fix to other tables using the same direct approach: ### 🎯 What Was Fixed **ExecutionProcesses** - The critical fix: - **Problem**: `RecordTypes::DeletedExecutionProcess` had `None` for `process_id`, so no remove JSON patch was sent to frontend - **Solution**: Preupdate hook captures `process_id` before deletion and sends `execution_process_patch::remove` immediately - **Result**: Frontend execution process lists stay in sync during deletions ### 🔧 Changes Made 1. **Extended preupdate hook** in [`events.rs`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L255-L296): - Added `execution_processes` table handling - Captures `process_id` from column 0 before deletion - Sends remove patch immediately 2. **Skipped existing DeletedExecutionProcess handling** in [`events.rs`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L532-L536): - Prevents duplicate patches from post-update hook ### 📝 Design Decisions **TaskAttempts & FollowUpDrafts**: Deliberately **not** handled in preupdate hook because: - They don't have direct remove JSON patches (unlike tasks and execution_processes) - Their main purpose is triggering parent updates (task refreshes) - Parent updates require async DB calls that can't be done from synchronous preupdate hooks - The existing post-update mechanism handles these adequately ### 🧪 Testing Results - ✅ Code compiles successfully - ✅ Full workspace build passes - ✅ No breaking changes to existing functionality The implementation follows the same simple, direct pattern used for tasks - no cache complexity, just immediate patch generation where it matters most for frontend consistency. * ## ✅ Cleanup Complete! Successfully removed the dead `DeletedTask` and `DeletedExecutionProcess` variants and all their associated dead code. Here's what was accomplished: ### 🗑️ Removed Dead Code 1. **Enum variants**: Deleted `DeletedTask` and `DeletedExecutionProcess` from [`RecordTypes`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L152-L164) 2. **Update hook construction logic**: - Tasks and ExecutionProcesses now return early on DELETE operations - Removed fallback `Ok(None)` cases that created deleted variants - Added debug logging for missing rows 3. **Dead pattern matching**: - Removed skip/return branches for deleted variants - Cleaned up all `RecordTypes::DeletedTask { .. }` and `RecordTypes::DeletedExecutionProcess { .. }` matches 4. **Dead stream filtering branches**: - Removed project-based filtering for `DeletedTask` - Removed attempt-based filtering for `DeletedExecutionProcess` ### ✅ Results - **Cleaner codebase**: No confusing dead variants or unused logic - **Better performance**: No wasted RecordTypes construction for deleted rows - **Single source of truth**: Preupdate hooks are now the only place handling deletions - **Schema alignment**: TypeScript types now match actual runtime behavior - **All tests pass**: ✅ Compilation successful, ✅ TypeScript generation successful ### 🎯 Current State **Tasks & ExecutionProcesses**: - ✅ **Deletions** → Preupdate hook sends remove patches immediately - ✅ **Insert/Update** → Direct JSON patches via update hook - ✅ **No dead code** → Clean, single-path processing **TaskAttempts & FollowUpDrafts**: - ✅ **Preserved existing logic** → Still use post-update hook patterns - ✅ **Consistent behavior** → No breaking changes to their workflows The cleanup is complete and the codebase is now cleaner and more maintainable! * Cleanup script changes for task attempt 519bf9e5-6bad-42e1-8e80-cb5f2d7bb99f * ## ✅ Option A Implementation Complete! Successfully implemented the full solution with direct remove patches for TaskAttempts and FollowUpDrafts! ### 🎯 What Was Accomplished **1. Created Direct Remove Patch Modules:** - [`task_attempt_patch::remove(attempt_id)`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L129-180) - Removes task attempts from `/task_attempts/{id}` path - [`follow_up_draft_patch::remove(draft_id)`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L182-233) - Removes drafts from `/follow_up_drafts/{id}` path **2. Extended Preupdate Hook:** - TaskAttempts: Captures `attempt_id` and sends immediate remove patch - FollowUpDrafts: Captures `draft_id` and sends immediate remove patch - Uses same proven pattern as Tasks/ExecutionProcesses **3. Preserved Safety Nets:** - TaskAttempts: Post-update hook still refreshes parent task as fallback - FollowUpDrafts: Stream filtering still handles empty draft states - Added clarifying comments about backward compatibility ### ✅ Benefits Achieved - **Fixed "None After Deletion" Issues**: All tables now capture IDs before deletion - **Consistent Deletion Pattern**: All entities (Tasks, ExecutionProcesses, TaskAttempts, FollowUpDrafts) now work the same way - **Better User Experience**: Immediate remove patches vs waiting for parent refreshes - **Backward Compatible**: Kept existing safety mechanisms during migration - **Future-Proof**: Direct patches enable faster, more reliable frontend updates ### 🧪 Testing Results - ✅ **Code compiles successfully** across entire workspace - ✅ **TypeScript generation works** - no schema breaking changes - ✅ **No runtime errors** - all existing functionality preserved - ✅ **Pattern consistency** - follows same structure as Tasks/ExecutionProcesses ### 📊 Current State Summary **All Four Entity Types Now Standardized:** | Entity | Delete Handling | Remove Patch | Parent Updates | |--------|----------------|--------------|----------------| | **Tasks** | ✅ Preupdate | ✅ Direct | ➖ Not needed | | **ExecutionProcesses** | ✅ Preupdate | ✅ Direct | ✅ Via task refresh | | **TaskAttempts** | ✅ Preupdate | ✅ **NEW** Direct | ✅ Parent task refresh | | **FollowUpDrafts** | ✅ Preupdate | ✅ **NEW** Direct | ✅ Draft clearing | **The delete issue has been comprehensively resolved across all affected tables with a consistent, robust approach!** * Cleanup script changes for task attempt 519bf9e5-6bad-42e1-8e80-cb5f2d7bb99f * ## ✅ Complete Cleanup Finished! Successfully removed all dead `DeletedTaskAttempt` and `DeletedFollowUpDraft` variants and their associated dead code. ### 🧹 What Was Removed 1. **Enum variants**: Deleted `DeletedTaskAttempt` and `DeletedFollowUpDraft` from [`RecordTypes`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/519b-debug-delete-iss/crates/services/src/services/events.rs#L254-L259) 2. **Dead construction logic**: - TaskAttempts DELETE → Early return (was creating variant with None task_id) - FollowUpDrafts DELETE → Early return (was creating variant with None task_attempt_id) - Fallback Ok(None) cases → Early return with debug logging 3. **Dead pattern matching branches**: - Removed task attempt parent refresh logic (never executed due to None task_id) - Removed follow-up draft clearing logic (never executed due to None task_attempt_id) - Cleaned up all streaming filter branches ### 🎯 Final State **All deletion handling is now consistent:** ✅ **Tasks** → Preupdate hook sends `task_patch::remove(task_id)` ✅ **TaskAttempts** → Preupdate hook sends `task_attempt_patch::remove(attempt_id)` ✅ **ExecutionProcesses** → Preupdate hook sends `execution_process_patch::remove(process_id)` ✅ **FollowUpDrafts** → Preupdate hook sends `follow_up_draft_patch::remove(draft_id)` ### ✅ Results - **No more None after deletion issues** - All deletions handled before row disappears - **Immediate frontend updates** - Direct remove patches sent instantly - **Clean codebase** - No dead variants or unused logic - **Consistent architecture** - All tables follow same deletion pattern - **Schema alignment** - TypeScript types match runtime behavior The original delete issue has been completely resolved across all tables! * Cleanup script changes for task attempt 519bf9e5-6bad-42e1-8e80-cb5f2d7bb99f * fmt * Improve reusability (vibe-kanban dcf76202) There's a lot of almost identical functionality in: crates/services/src/services/events.rs How could we turn this into a trait, and implement that trait for each table?
2025-09-26 12:31:11 +01:00
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "sqlite", "sqlite-preupdate-hook", "chrono", "uuid"] }
2025-06-14 15:34:24 -04:00
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1.0", features = ["v4", "serde"] }
ts-rs = { workspace = true }
2025-06-16 18:37:19 -04:00
async-trait = "0.1"
command-group = { version = "5.0", features = ["with-tokio"] }
2025-07-01 10:47:28 +01:00
nix = { version = "0.29", features = ["signal", "process"] }
openssl-sys = { workspace = true }
rmcp = { version = "0.5.0", features = ["server", "transport-io"] }
UI form builder for editing executor config (#619) * ## 🎉 Implementation Complete! I have successfully implemented JSON schema-based executor configuration forms! Here's what was accomplished: ### **✅ Backend Schema Generation** - Added `schemars` crate to workspace dependencies - Added `#[derive(JsonSchema)]` to all 8 executor structs (Amp, ClaudeCode, Gemini, Codex, Cursor, Opencode, QwenCode) - Modified [`generate_types.rs`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-4b73-use-the-sc/crates/server/src/bin/generate_types.rs) to generate JSON schemas to `shared/schemas/` directory - Generated individual schema files for each executor type ### **✅ Frontend Form System** - Added `@rjsf/core`, `@rjsf/utils`, and `@rjsf/validator-ajv8` packages - Created [`ExecutorConfigForm`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-4b73-use-the-sc/frontend/src/components/ExecutorConfigForm.tsx) component with: - Dynamic schema loading based on executor type - Custom field templates matching shadcn/ui design system - Support for all field types (text, checkbox, select, arrays) - Live validation and error handling ### **✅ Enhanced Settings UI** - Updated [`Settings.tsx`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-4b73-use-the-sc/frontend/src/pages/Settings.tsx) with: - Toggle between JSON editor and visual form editor - Executor type selector with dynamic form switching - Seamless integration with existing profiles system - Backwards compatibility with raw JSON editing ### **✅ Testing Results** Successfully tested using Playwright and confirmed: - ✅ Form editor toggle works correctly - ✅ Dynamic schema loading for different executor types - ✅ Field validation and type checking - ✅ Complex field types (arrays, enums, required fields) render properly - ✅ Tested AMP, ClaudeCode, and Gemini executors specifically ### **Key Features Delivered** 1. **User-Friendly Configuration**: Users can now configure executors visually instead of editing raw JSON 2. **Type Safety**: Generated schemas ensure configuration validity 3. **Dynamic Forms**: Each executor type shows only relevant fields 4. **Backwards Compatibility**: Users can still switch back to JSON mode 5. **Professional UI**: Custom templates match the existing design system 6. **Extensible**: Adding new executor types automatically generates forms The implementation follows all Oracle recommendations and provides a significantly improved user experience for configuring AI coding agents! * Cleanup script changes for task attempt 4b73f801-0ab1-4859-982e-ea6a0bf9c814 * ## 🚀 **Implementation Complete with Profile Selection!** Your question was perfectly answered! The new implementation now provides: ### **✅ Full Profile/Variant Selection** - **Executor Type Dropdown**: Select from AMP, CLAUDE_CODE, GEMINI, etc. - **Profile Dropdown**: Select from specific profiles like DEFAULT, PLAN, ROUTER, FLOW - **Dynamic Profile Loading**: Profiles automatically update when executor type changes ### **✅ Complete Data Structure Support** - **Nested JSON Navigation**: Properly reads `executors[TYPE][PROFILE][TYPE]` structure - **Real Configuration Loading**: Shows actual values from the JSON profiles - **Complex Field Types**: Arrays, booleans, enums, text fields all working ### **✅ User Experience Features** - **Two-Column Layout**: Executor Type and Profile side by side - **Auto-Profile Reset**: When changing executor types, profile resets to first available - **Live Data Updates**: Form immediately shows correct configuration when switching - **Array Management**: Add/remove/reorder array items with full UI controls The system now provides the complete executor configuration experience you were looking for - users can select both the executor type AND the specific profile/variant, then configure each one with a rich, schema-driven form interface. * Cleanup script changes for task attempt 4b73f801-0ab1-4859-982e-ea6a0bf9c814 * improvements * append_prompt * generate forms * order * settings * amp MCP config update * form styles * textarea * style additional params * validate * menu styles * prevent reload * fmt * add and delete configurations * lint * fmnt * clippy * prettier * copy * remove old MCP * Auto detect schemas on FE * wipe shared before generation * fmt * clippy fmt * fixes * fmt * update shared types check * disable clippy for large enum * copy * tweaks * fmt * fmt
2025-09-04 20:46:26 +01:00
schemars = { workspace = true }
regex = "1.11.1"
2025-08-08 18:24:04 +01:00
toml = "0.8"
Deployments (#414) * init deployment * refactor state * pre executor app state refactor * deployment in app state * clone * fix executors * fix dependencies * command runner via app_state * clippy * remove dependency on ENVIRONMENT from command_runner * remove dependency on ENVIRONMENT from command_runner * build fix * clippy * fmt * featues * vscode lints for cloud * change streaming to SSE (#338) Remove debug logging Cleanup streaming logic feat: add helper function for creating SSE stream responses for stdout/stderr * update vscode guidance * move start * Fix executors * Move command executor to separate file * Fix imports for executors * Partial fix test_remote * Fix * fmt * Clippy * Add back GitHub cloud only routes * cleanup and shared types * Prepare for separate cloud crate * Init backend-common workspace * Update * WIP * WIP * WIP * WIP * WIP * WIP * Projects (and sqlx) * Tasks * WIP * Amp * Backend executor structs * Task attempts outline * Move to crates folder * Cleanup frontend dist * Split out executors into separate crate * Config and sentry * Create deployment method helper * Router * Config endpoints * Projects, analytics * Update analytics paths when keys not provided * Tasks, task context * Middleware, outline task attempts * Delete backend common * WIP container * WIP container * Migrate worktree_path to container_ref (generic) * WIP container service create * Launch container * Fix create task * Create worktree * Move logic into container * Execution outline * Executor selection * Use enum_dispatch to route spawn tree * Update route errors * Implement child calling * Move running executions to container * Add streaming with history * Drop cloud WIP * Logs * Logs * Refactor container logic to execution tracker * Chunk based streaming and cleanup * Alex/mirgate task templates (#350) * Re-enable task templates; migrate routes; migrate args and return types * Refactor task template routes; consolidate list functions into get_templates with query support * Fix get_templates function * Implement amp executor * Gemini WIP * Make streaming the event store reusable * Rewrite mutex to rwlock * Staging for normalised logs impl * Store custom LogMsg instead of event as more flexible * Cleanup * WIP newline stream for amp (tested and working, needs store impl) * refactor: move stranded `git2` logic out of `models` (#352) * remove legacy command_executor; move git2 logic into GitService * remove legacy cloud runner * put back config get route * remove dead logic * WIP amp normalisation * Normalized logs now save to save msg store as raw * Refactor auth endpoints (#355) * Re-enable auth;Change auth to use deployment Add auth service Move auth logic to service Add auth router and service integration to deployment Refactor auth service and routes to use octocrab Refactor auth error handling and improve token validation responses * rename auth_router to router for consistency * refactor: rename auth_service to auth for consistency (#356) * Refactor filesystem endpoints (#357) * feat: implement filesystem service with directory listing and git repo detection * refactor: update filesystem routes; sort repos by last modfied * Gemini executor logs normalization * feat: add sound file serving endpoint and implement sound file loading (#358) * Gemini executor followup (#360) * Sync logs to db (#359) * Exit monitor * Outline stream logs to DB * Outline read from the message store * Add execution_process_logs, store logs in DB * Stream logs from DB * Normalized logs from DB * Remove eronious .sqlx cache * Remove execution process stdout and stderr * Update execution process record on completion * Emit session event for amp * Update session ID when event is emitted * Split local/common spawn fn * Create initial executor session * Move normalized logs into executors * Store executor action * Refactor updated_at to use micro seconds * Follow up executions (#363) * Follow up request handler scaffold Rename coding agent initial / follow up actions * Follow ups * Response for follow up * Simplify execution actions for coding agents * fix executor selection (#362) * refactor: move logic out of `TaskAttempt` (#361) * re-enable /diff /pr /rebase /merge /branch-status /open-editor /delete-file endpoints * address review comments * remove relic * Claude Code (#365) * Use ApiError rather than DeploymentError type in routes (#366) * Fix fe routes (#367) * /api/filesystem/list -> /api/filesystem/directory * /api/projects/:project_id/tasks -> /api/tasks * Remove with-branch * /api/projects/:project_id/tasks/:task_id -> /api/tasks/:task_id * Post tasks * Update template routes * Update BE for github poll endpoint, FE still needs updating * WIP freeze old types * File picker fix * Project types * Solve tsc warna * Remove constants and FE cloud mode * Setup for /api/info refactor * WIP config refactor * Remove custom mapping to coding agents * Update settings to fix code editor * Config fix (will need further changes once attempts types migrated) * Tmp fix types * Config auto deserialisation * Alex/refactor background processes (#369) * feat: add cleanup for orphaned executions at startup * Fix worktree cleanup; re add worktree cleanup queries * refactor worktree cleanup for orphaned and externally deleted worktrees * Fix compile error * refactor: container creation lifecycle (#368) * Consolidate worktree logic in the WorktreeManager * move auxiliary logic into worktree manager * fix compile error * Rename core crate to server * Fix npm run dev * Fix fe routes 2 (#371) * Migrate config paths * Update sounds, refactor lib.rs * Project FE types * Branch * Cleanup sound constants * Template types * Cleanup file search and other unused types * Handle errors * wip: basic mcp config editing (#351) * Re-add notification service, move assets to common dir (#373) add config to containter, add notifications into exit monitor Refctor notification service Refactor notifications * Stderr support (#372) Refactor plain-text log processing and resuse it for gemini, stderr, and potentially other executors. * Fix fe routes 3 (#378) * Task attempts * Task types * Get single task attempt endpoint * Task attempt response * Branch status * More task attempt endpoints * Task attempt children * Events WIP * Stream events when task, task attempt and execution process change status * Fixes * Cleanup logs * Alex/refactor pr monitor (#377) * Refactor task status updates and add PR monitoring functionality * Add PR monitoring service and integrate it into deployment flow Refactor GitHub token retrieval in PR creation and monitoring services Fix github pr regex * Fix types * refactor: dev server logic (#374) * reimplement start dev server logic * robust process group killing * Fix fe routes 4 (#383) * Add endpoint to get execution processes * Update types for execution process * Further execution process type cleanup * Wipe existing logs display * Further process related cleanup * Update get task attempt endpoint * Frozen type removal * Diff types * Display raw logs WIP * fix: extract session id once per execution (#386) * Fix fe routes 5 (#387) * Display normalized logs * Add execution-process info endpoint * WIP load into virtualized * Simplified unified logs * Raw logs also use json patch now (simplifies FE keys) * WIP * Fix FE rendering * Remove timestamps * Fix conversation height * Cleanup entry display * Spacing * Mark the boundaries between different execution processes in the logs * Deduplicate entries * Fix replace * Fmt * put back stop execution process endpoint (#384) * Fix fe routes 6 (#391) * WIP cleanup to remove related tasks and plans * Refactor active tab * Remove existing diff FE logic * Rename tab * WIP stream file events * WIP track FS events * Respect gitignore * Debounced event * Deduplicate events * Refactor git diff * WIP stream diffs * Resolve issue with unstaged changes * Diff filter by files * Stream ongoing changes * Remove entries when reset and json patch safe entry ids * Update the diff tab * Cleanup logs * Cleanup * Error enum * Update create PR attempt URL * Follow up and open in IDE * Fix merge * refactor: introduce `AgentProfiles` (#388) * automatically schedule coding agent execution after setup script * profiles implementation * add next_action field to ExecutorAction type * make start_next_action generic to action type Remove ProfilesManager and DefaultCommandBuilder structs * store executor_action_type in the DB * update shared types * rename structs * fix compile error * Refactor remaining task routes (#389) * Implement deletion functionality for execution processes and task attempts, including recursive deletion of associated logs. refactor: deletion process for task attempts and associated entities feat: Refactor task and task attempt models to remove executor field - Removed the `executor` field from the `task_attempt` model and related queries. - Updated the `CreateTaskAndStart` struct to encapsulate task and attempt creation. - Modified the task creation and starting logic to accommodate the new structure. - Adjusted SQL queries and migration scripts to reflect the removal of the executor. - Enhanced notification service to handle executor types dynamically. - Updated TypeScript types to align with the changes in the Rust models. refactor: remove CreateTaskAndStart type and update related code Add TaskAttemptWithLatestProfile and alias in frontend Fix silent failure of sqlx builder Remove db migration Fix rebase errors * Remove unneeded delete logic; move common container logic to service * Profiles fe (#398) * Get things compiling * Refactor the config * WIP fix task attempt creation * Further config fixes * Sounds and executors in settings * Fix sounds * Display profile config * Onboarding * Remove hardcoded agents * Move follow up attempt params to shared * Remove further shared types * Remove comment (#400) * Codex (#380) * only trigger error message when RunReason is SetupScript (#396) * Opencode (#385) * Restore Gemini followups (#392) * fix task killing (#395) * commit changes after successful execution (#403) * Claude-code-router (#410) * Amp tool use (#407) * Config upgrades (#405) * Versioned config * Upgrade fixes * Save config after migration * Scoping * Update Executor types * Theme types fix * Cleanup * Change theme selector to an enum * Rename config schema version field * Diff improve (#412) * Ensure container exists * Safe handling when ExecutorAction isn't valid JSON in DB * Reset data when endpoint changes * refactor: conditional notification (#408) * conditional notification * fix next action run_reason * remove redundant log * Fix GitHub auth frontend (#404) * fix frontend github auth * Add GitHub error handling and update dependencies - Introduced GitHubMagicErrorStrings enum for consistent error messaging related to GitHub authentication and permissions. - Updated the GitHubService to include a check_token method for validating tokens. - Refactored auth and task_attempts routes to utilize the new error handling. - Added strum_macros dependency in Cargo.toml for enum display. * Refactor GitHub error handling and API response structure to use CreateGitHubPRErrorData * Refactor API response handling in CreatePRDialog and update attemptsApi to return structured results * Refactor tasksApi.createAndStart to remove projectId parameter from API call * use SCREAMING_SNAKE_CASE for consistency * Refactor GitHub error handling to replace CreateGitHubPRErrorData with GitHubServiceError across the codebase * Update crates/utils/src/response.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix compile error * Fix types --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix: (#415) - Config location - Serve FE from BE in prod - Create config when doesn't exist - Tmp disable building the MCP * Fix dev server route (#417) * remove legacy logic and unused crates (#418) * update CLAUDE.md for new project structure (#420) * fix mcp settings page (#419) * Fix cards not updating (vibe-kanban) (#416) * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * feat: update task status management in container service * refactor: simplify notification logic and finalize context checks in LocalContainerService * Task attempt fe fixes (#422) * Style tweaks * Refactor * Fix auto scroll * Implement stop endpoint for all execution processed in a task attempt * Weird race condition with amp * Remove log * Fix follow ups * Re-add stop task attempt endpoint (#421) * Re-add stop task attempt endpoint; remove legacy comments for implemented functionality * Fix kill race condition; fix state change when dev server * Ci fixes (#425) * Eslint fix * Remove #[ts(export)] * Fix tests * Clippy * Prettier * Fmt * Version downgrade * Fix API response * Don't treat clippy warnings as errors * Change crate name * Update cargo location * Update further refs * Reset versions * Bump versions * Update binary names * Branch fix * Prettier * Ensure finished event sends data (#434) * use option_env! when reading analytics vars (#435) * remove dead logic (#436) * update crate version across workspace (#437) * add all crates across the workspace * chore: bump version to 0.0.56 --------- Co-authored-by: Alex Netsch <alex@bloop.ai> Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> Co-authored-by: GitHub Action <action@github.com>
2025-08-08 13:53:27 +01:00
reqwest = { version = "0.12", features = ["json"] }
2025-07-08 11:29:54 +01:00
strip-ansi-escapes = "0.2.1"
Deployments (#414) * init deployment * refactor state * pre executor app state refactor * deployment in app state * clone * fix executors * fix dependencies * command runner via app_state * clippy * remove dependency on ENVIRONMENT from command_runner * remove dependency on ENVIRONMENT from command_runner * build fix * clippy * fmt * featues * vscode lints for cloud * change streaming to SSE (#338) Remove debug logging Cleanup streaming logic feat: add helper function for creating SSE stream responses for stdout/stderr * update vscode guidance * move start * Fix executors * Move command executor to separate file * Fix imports for executors * Partial fix test_remote * Fix * fmt * Clippy * Add back GitHub cloud only routes * cleanup and shared types * Prepare for separate cloud crate * Init backend-common workspace * Update * WIP * WIP * WIP * WIP * WIP * WIP * Projects (and sqlx) * Tasks * WIP * Amp * Backend executor structs * Task attempts outline * Move to crates folder * Cleanup frontend dist * Split out executors into separate crate * Config and sentry * Create deployment method helper * Router * Config endpoints * Projects, analytics * Update analytics paths when keys not provided * Tasks, task context * Middleware, outline task attempts * Delete backend common * WIP container * WIP container * Migrate worktree_path to container_ref (generic) * WIP container service create * Launch container * Fix create task * Create worktree * Move logic into container * Execution outline * Executor selection * Use enum_dispatch to route spawn tree * Update route errors * Implement child calling * Move running executions to container * Add streaming with history * Drop cloud WIP * Logs * Logs * Refactor container logic to execution tracker * Chunk based streaming and cleanup * Alex/mirgate task templates (#350) * Re-enable task templates; migrate routes; migrate args and return types * Refactor task template routes; consolidate list functions into get_templates with query support * Fix get_templates function * Implement amp executor * Gemini WIP * Make streaming the event store reusable * Rewrite mutex to rwlock * Staging for normalised logs impl * Store custom LogMsg instead of event as more flexible * Cleanup * WIP newline stream for amp (tested and working, needs store impl) * refactor: move stranded `git2` logic out of `models` (#352) * remove legacy command_executor; move git2 logic into GitService * remove legacy cloud runner * put back config get route * remove dead logic * WIP amp normalisation * Normalized logs now save to save msg store as raw * Refactor auth endpoints (#355) * Re-enable auth;Change auth to use deployment Add auth service Move auth logic to service Add auth router and service integration to deployment Refactor auth service and routes to use octocrab Refactor auth error handling and improve token validation responses * rename auth_router to router for consistency * refactor: rename auth_service to auth for consistency (#356) * Refactor filesystem endpoints (#357) * feat: implement filesystem service with directory listing and git repo detection * refactor: update filesystem routes; sort repos by last modfied * Gemini executor logs normalization * feat: add sound file serving endpoint and implement sound file loading (#358) * Gemini executor followup (#360) * Sync logs to db (#359) * Exit monitor * Outline stream logs to DB * Outline read from the message store * Add execution_process_logs, store logs in DB * Stream logs from DB * Normalized logs from DB * Remove eronious .sqlx cache * Remove execution process stdout and stderr * Update execution process record on completion * Emit session event for amp * Update session ID when event is emitted * Split local/common spawn fn * Create initial executor session * Move normalized logs into executors * Store executor action * Refactor updated_at to use micro seconds * Follow up executions (#363) * Follow up request handler scaffold Rename coding agent initial / follow up actions * Follow ups * Response for follow up * Simplify execution actions for coding agents * fix executor selection (#362) * refactor: move logic out of `TaskAttempt` (#361) * re-enable /diff /pr /rebase /merge /branch-status /open-editor /delete-file endpoints * address review comments * remove relic * Claude Code (#365) * Use ApiError rather than DeploymentError type in routes (#366) * Fix fe routes (#367) * /api/filesystem/list -> /api/filesystem/directory * /api/projects/:project_id/tasks -> /api/tasks * Remove with-branch * /api/projects/:project_id/tasks/:task_id -> /api/tasks/:task_id * Post tasks * Update template routes * Update BE for github poll endpoint, FE still needs updating * WIP freeze old types * File picker fix * Project types * Solve tsc warna * Remove constants and FE cloud mode * Setup for /api/info refactor * WIP config refactor * Remove custom mapping to coding agents * Update settings to fix code editor * Config fix (will need further changes once attempts types migrated) * Tmp fix types * Config auto deserialisation * Alex/refactor background processes (#369) * feat: add cleanup for orphaned executions at startup * Fix worktree cleanup; re add worktree cleanup queries * refactor worktree cleanup for orphaned and externally deleted worktrees * Fix compile error * refactor: container creation lifecycle (#368) * Consolidate worktree logic in the WorktreeManager * move auxiliary logic into worktree manager * fix compile error * Rename core crate to server * Fix npm run dev * Fix fe routes 2 (#371) * Migrate config paths * Update sounds, refactor lib.rs * Project FE types * Branch * Cleanup sound constants * Template types * Cleanup file search and other unused types * Handle errors * wip: basic mcp config editing (#351) * Re-add notification service, move assets to common dir (#373) add config to containter, add notifications into exit monitor Refctor notification service Refactor notifications * Stderr support (#372) Refactor plain-text log processing and resuse it for gemini, stderr, and potentially other executors. * Fix fe routes 3 (#378) * Task attempts * Task types * Get single task attempt endpoint * Task attempt response * Branch status * More task attempt endpoints * Task attempt children * Events WIP * Stream events when task, task attempt and execution process change status * Fixes * Cleanup logs * Alex/refactor pr monitor (#377) * Refactor task status updates and add PR monitoring functionality * Add PR monitoring service and integrate it into deployment flow Refactor GitHub token retrieval in PR creation and monitoring services Fix github pr regex * Fix types * refactor: dev server logic (#374) * reimplement start dev server logic * robust process group killing * Fix fe routes 4 (#383) * Add endpoint to get execution processes * Update types for execution process * Further execution process type cleanup * Wipe existing logs display * Further process related cleanup * Update get task attempt endpoint * Frozen type removal * Diff types * Display raw logs WIP * fix: extract session id once per execution (#386) * Fix fe routes 5 (#387) * Display normalized logs * Add execution-process info endpoint * WIP load into virtualized * Simplified unified logs * Raw logs also use json patch now (simplifies FE keys) * WIP * Fix FE rendering * Remove timestamps * Fix conversation height * Cleanup entry display * Spacing * Mark the boundaries between different execution processes in the logs * Deduplicate entries * Fix replace * Fmt * put back stop execution process endpoint (#384) * Fix fe routes 6 (#391) * WIP cleanup to remove related tasks and plans * Refactor active tab * Remove existing diff FE logic * Rename tab * WIP stream file events * WIP track FS events * Respect gitignore * Debounced event * Deduplicate events * Refactor git diff * WIP stream diffs * Resolve issue with unstaged changes * Diff filter by files * Stream ongoing changes * Remove entries when reset and json patch safe entry ids * Update the diff tab * Cleanup logs * Cleanup * Error enum * Update create PR attempt URL * Follow up and open in IDE * Fix merge * refactor: introduce `AgentProfiles` (#388) * automatically schedule coding agent execution after setup script * profiles implementation * add next_action field to ExecutorAction type * make start_next_action generic to action type Remove ProfilesManager and DefaultCommandBuilder structs * store executor_action_type in the DB * update shared types * rename structs * fix compile error * Refactor remaining task routes (#389) * Implement deletion functionality for execution processes and task attempts, including recursive deletion of associated logs. refactor: deletion process for task attempts and associated entities feat: Refactor task and task attempt models to remove executor field - Removed the `executor` field from the `task_attempt` model and related queries. - Updated the `CreateTaskAndStart` struct to encapsulate task and attempt creation. - Modified the task creation and starting logic to accommodate the new structure. - Adjusted SQL queries and migration scripts to reflect the removal of the executor. - Enhanced notification service to handle executor types dynamically. - Updated TypeScript types to align with the changes in the Rust models. refactor: remove CreateTaskAndStart type and update related code Add TaskAttemptWithLatestProfile and alias in frontend Fix silent failure of sqlx builder Remove db migration Fix rebase errors * Remove unneeded delete logic; move common container logic to service * Profiles fe (#398) * Get things compiling * Refactor the config * WIP fix task attempt creation * Further config fixes * Sounds and executors in settings * Fix sounds * Display profile config * Onboarding * Remove hardcoded agents * Move follow up attempt params to shared * Remove further shared types * Remove comment (#400) * Codex (#380) * only trigger error message when RunReason is SetupScript (#396) * Opencode (#385) * Restore Gemini followups (#392) * fix task killing (#395) * commit changes after successful execution (#403) * Claude-code-router (#410) * Amp tool use (#407) * Config upgrades (#405) * Versioned config * Upgrade fixes * Save config after migration * Scoping * Update Executor types * Theme types fix * Cleanup * Change theme selector to an enum * Rename config schema version field * Diff improve (#412) * Ensure container exists * Safe handling when ExecutorAction isn't valid JSON in DB * Reset data when endpoint changes * refactor: conditional notification (#408) * conditional notification * fix next action run_reason * remove redundant log * Fix GitHub auth frontend (#404) * fix frontend github auth * Add GitHub error handling and update dependencies - Introduced GitHubMagicErrorStrings enum for consistent error messaging related to GitHub authentication and permissions. - Updated the GitHubService to include a check_token method for validating tokens. - Refactored auth and task_attempts routes to utilize the new error handling. - Added strum_macros dependency in Cargo.toml for enum display. * Refactor GitHub error handling and API response structure to use CreateGitHubPRErrorData * Refactor API response handling in CreatePRDialog and update attemptsApi to return structured results * Refactor tasksApi.createAndStart to remove projectId parameter from API call * use SCREAMING_SNAKE_CASE for consistency * Refactor GitHub error handling to replace CreateGitHubPRErrorData with GitHubServiceError across the codebase * Update crates/utils/src/response.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix compile error * Fix types --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix: (#415) - Config location - Serve FE from BE in prod - Create config when doesn't exist - Tmp disable building the MCP * Fix dev server route (#417) * remove legacy logic and unused crates (#418) * update CLAUDE.md for new project structure (#420) * fix mcp settings page (#419) * Fix cards not updating (vibe-kanban) (#416) * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * feat: update task status management in container service * refactor: simplify notification logic and finalize context checks in LocalContainerService * Task attempt fe fixes (#422) * Style tweaks * Refactor * Fix auto scroll * Implement stop endpoint for all execution processed in a task attempt * Weird race condition with amp * Remove log * Fix follow ups * Re-add stop task attempt endpoint (#421) * Re-add stop task attempt endpoint; remove legacy comments for implemented functionality * Fix kill race condition; fix state change when dev server * Ci fixes (#425) * Eslint fix * Remove #[ts(export)] * Fix tests * Clippy * Prettier * Fmt * Version downgrade * Fix API response * Don't treat clippy warnings as errors * Change crate name * Update cargo location * Update further refs * Reset versions * Bump versions * Update binary names * Branch fix * Prettier * Ensure finished event sends data (#434) * use option_env! when reading analytics vars (#435) * remove dead logic (#436) * update crate version across workspace (#437) * add all crates across the workspace * chore: bump version to 0.0.56 --------- Co-authored-by: Alex Netsch <alex@bloop.ai> Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> Co-authored-by: GitHub Action <action@github.com>
2025-08-08 13:53:27 +01:00
thiserror = { workspace = true }
os_info = "3.12.0"
futures-util = "0.3"
Deployments (#414) * init deployment * refactor state * pre executor app state refactor * deployment in app state * clone * fix executors * fix dependencies * command runner via app_state * clippy * remove dependency on ENVIRONMENT from command_runner * remove dependency on ENVIRONMENT from command_runner * build fix * clippy * fmt * featues * vscode lints for cloud * change streaming to SSE (#338) Remove debug logging Cleanup streaming logic feat: add helper function for creating SSE stream responses for stdout/stderr * update vscode guidance * move start * Fix executors * Move command executor to separate file * Fix imports for executors * Partial fix test_remote * Fix * fmt * Clippy * Add back GitHub cloud only routes * cleanup and shared types * Prepare for separate cloud crate * Init backend-common workspace * Update * WIP * WIP * WIP * WIP * WIP * WIP * Projects (and sqlx) * Tasks * WIP * Amp * Backend executor structs * Task attempts outline * Move to crates folder * Cleanup frontend dist * Split out executors into separate crate * Config and sentry * Create deployment method helper * Router * Config endpoints * Projects, analytics * Update analytics paths when keys not provided * Tasks, task context * Middleware, outline task attempts * Delete backend common * WIP container * WIP container * Migrate worktree_path to container_ref (generic) * WIP container service create * Launch container * Fix create task * Create worktree * Move logic into container * Execution outline * Executor selection * Use enum_dispatch to route spawn tree * Update route errors * Implement child calling * Move running executions to container * Add streaming with history * Drop cloud WIP * Logs * Logs * Refactor container logic to execution tracker * Chunk based streaming and cleanup * Alex/mirgate task templates (#350) * Re-enable task templates; migrate routes; migrate args and return types * Refactor task template routes; consolidate list functions into get_templates with query support * Fix get_templates function * Implement amp executor * Gemini WIP * Make streaming the event store reusable * Rewrite mutex to rwlock * Staging for normalised logs impl * Store custom LogMsg instead of event as more flexible * Cleanup * WIP newline stream for amp (tested and working, needs store impl) * refactor: move stranded `git2` logic out of `models` (#352) * remove legacy command_executor; move git2 logic into GitService * remove legacy cloud runner * put back config get route * remove dead logic * WIP amp normalisation * Normalized logs now save to save msg store as raw * Refactor auth endpoints (#355) * Re-enable auth;Change auth to use deployment Add auth service Move auth logic to service Add auth router and service integration to deployment Refactor auth service and routes to use octocrab Refactor auth error handling and improve token validation responses * rename auth_router to router for consistency * refactor: rename auth_service to auth for consistency (#356) * Refactor filesystem endpoints (#357) * feat: implement filesystem service with directory listing and git repo detection * refactor: update filesystem routes; sort repos by last modfied * Gemini executor logs normalization * feat: add sound file serving endpoint and implement sound file loading (#358) * Gemini executor followup (#360) * Sync logs to db (#359) * Exit monitor * Outline stream logs to DB * Outline read from the message store * Add execution_process_logs, store logs in DB * Stream logs from DB * Normalized logs from DB * Remove eronious .sqlx cache * Remove execution process stdout and stderr * Update execution process record on completion * Emit session event for amp * Update session ID when event is emitted * Split local/common spawn fn * Create initial executor session * Move normalized logs into executors * Store executor action * Refactor updated_at to use micro seconds * Follow up executions (#363) * Follow up request handler scaffold Rename coding agent initial / follow up actions * Follow ups * Response for follow up * Simplify execution actions for coding agents * fix executor selection (#362) * refactor: move logic out of `TaskAttempt` (#361) * re-enable /diff /pr /rebase /merge /branch-status /open-editor /delete-file endpoints * address review comments * remove relic * Claude Code (#365) * Use ApiError rather than DeploymentError type in routes (#366) * Fix fe routes (#367) * /api/filesystem/list -> /api/filesystem/directory * /api/projects/:project_id/tasks -> /api/tasks * Remove with-branch * /api/projects/:project_id/tasks/:task_id -> /api/tasks/:task_id * Post tasks * Update template routes * Update BE for github poll endpoint, FE still needs updating * WIP freeze old types * File picker fix * Project types * Solve tsc warna * Remove constants and FE cloud mode * Setup for /api/info refactor * WIP config refactor * Remove custom mapping to coding agents * Update settings to fix code editor * Config fix (will need further changes once attempts types migrated) * Tmp fix types * Config auto deserialisation * Alex/refactor background processes (#369) * feat: add cleanup for orphaned executions at startup * Fix worktree cleanup; re add worktree cleanup queries * refactor worktree cleanup for orphaned and externally deleted worktrees * Fix compile error * refactor: container creation lifecycle (#368) * Consolidate worktree logic in the WorktreeManager * move auxiliary logic into worktree manager * fix compile error * Rename core crate to server * Fix npm run dev * Fix fe routes 2 (#371) * Migrate config paths * Update sounds, refactor lib.rs * Project FE types * Branch * Cleanup sound constants * Template types * Cleanup file search and other unused types * Handle errors * wip: basic mcp config editing (#351) * Re-add notification service, move assets to common dir (#373) add config to containter, add notifications into exit monitor Refctor notification service Refactor notifications * Stderr support (#372) Refactor plain-text log processing and resuse it for gemini, stderr, and potentially other executors. * Fix fe routes 3 (#378) * Task attempts * Task types * Get single task attempt endpoint * Task attempt response * Branch status * More task attempt endpoints * Task attempt children * Events WIP * Stream events when task, task attempt and execution process change status * Fixes * Cleanup logs * Alex/refactor pr monitor (#377) * Refactor task status updates and add PR monitoring functionality * Add PR monitoring service and integrate it into deployment flow Refactor GitHub token retrieval in PR creation and monitoring services Fix github pr regex * Fix types * refactor: dev server logic (#374) * reimplement start dev server logic * robust process group killing * Fix fe routes 4 (#383) * Add endpoint to get execution processes * Update types for execution process * Further execution process type cleanup * Wipe existing logs display * Further process related cleanup * Update get task attempt endpoint * Frozen type removal * Diff types * Display raw logs WIP * fix: extract session id once per execution (#386) * Fix fe routes 5 (#387) * Display normalized logs * Add execution-process info endpoint * WIP load into virtualized * Simplified unified logs * Raw logs also use json patch now (simplifies FE keys) * WIP * Fix FE rendering * Remove timestamps * Fix conversation height * Cleanup entry display * Spacing * Mark the boundaries between different execution processes in the logs * Deduplicate entries * Fix replace * Fmt * put back stop execution process endpoint (#384) * Fix fe routes 6 (#391) * WIP cleanup to remove related tasks and plans * Refactor active tab * Remove existing diff FE logic * Rename tab * WIP stream file events * WIP track FS events * Respect gitignore * Debounced event * Deduplicate events * Refactor git diff * WIP stream diffs * Resolve issue with unstaged changes * Diff filter by files * Stream ongoing changes * Remove entries when reset and json patch safe entry ids * Update the diff tab * Cleanup logs * Cleanup * Error enum * Update create PR attempt URL * Follow up and open in IDE * Fix merge * refactor: introduce `AgentProfiles` (#388) * automatically schedule coding agent execution after setup script * profiles implementation * add next_action field to ExecutorAction type * make start_next_action generic to action type Remove ProfilesManager and DefaultCommandBuilder structs * store executor_action_type in the DB * update shared types * rename structs * fix compile error * Refactor remaining task routes (#389) * Implement deletion functionality for execution processes and task attempts, including recursive deletion of associated logs. refactor: deletion process for task attempts and associated entities feat: Refactor task and task attempt models to remove executor field - Removed the `executor` field from the `task_attempt` model and related queries. - Updated the `CreateTaskAndStart` struct to encapsulate task and attempt creation. - Modified the task creation and starting logic to accommodate the new structure. - Adjusted SQL queries and migration scripts to reflect the removal of the executor. - Enhanced notification service to handle executor types dynamically. - Updated TypeScript types to align with the changes in the Rust models. refactor: remove CreateTaskAndStart type and update related code Add TaskAttemptWithLatestProfile and alias in frontend Fix silent failure of sqlx builder Remove db migration Fix rebase errors * Remove unneeded delete logic; move common container logic to service * Profiles fe (#398) * Get things compiling * Refactor the config * WIP fix task attempt creation * Further config fixes * Sounds and executors in settings * Fix sounds * Display profile config * Onboarding * Remove hardcoded agents * Move follow up attempt params to shared * Remove further shared types * Remove comment (#400) * Codex (#380) * only trigger error message when RunReason is SetupScript (#396) * Opencode (#385) * Restore Gemini followups (#392) * fix task killing (#395) * commit changes after successful execution (#403) * Claude-code-router (#410) * Amp tool use (#407) * Config upgrades (#405) * Versioned config * Upgrade fixes * Save config after migration * Scoping * Update Executor types * Theme types fix * Cleanup * Change theme selector to an enum * Rename config schema version field * Diff improve (#412) * Ensure container exists * Safe handling when ExecutorAction isn't valid JSON in DB * Reset data when endpoint changes * refactor: conditional notification (#408) * conditional notification * fix next action run_reason * remove redundant log * Fix GitHub auth frontend (#404) * fix frontend github auth * Add GitHub error handling and update dependencies - Introduced GitHubMagicErrorStrings enum for consistent error messaging related to GitHub authentication and permissions. - Updated the GitHubService to include a check_token method for validating tokens. - Refactored auth and task_attempts routes to utilize the new error handling. - Added strum_macros dependency in Cargo.toml for enum display. * Refactor GitHub error handling and API response structure to use CreateGitHubPRErrorData * Refactor API response handling in CreatePRDialog and update attemptsApi to return structured results * Refactor tasksApi.createAndStart to remove projectId parameter from API call * use SCREAMING_SNAKE_CASE for consistency * Refactor GitHub error handling to replace CreateGitHubPRErrorData with GitHubServiceError across the codebase * Update crates/utils/src/response.rs Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix compile error * Fix types --------- Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> * Fix: (#415) - Config location - Serve FE from BE in prod - Create config when doesn't exist - Tmp disable building the MCP * Fix dev server route (#417) * remove legacy logic and unused crates (#418) * update CLAUDE.md for new project structure (#420) * fix mcp settings page (#419) * Fix cards not updating (vibe-kanban) (#416) * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * Commit changes from coding agent for task attempt 774a2cae-a763-4117-af0e-1287a043c462 * feat: update task status management in container service * refactor: simplify notification logic and finalize context checks in LocalContainerService * Task attempt fe fixes (#422) * Style tweaks * Refactor * Fix auto scroll * Implement stop endpoint for all execution processed in a task attempt * Weird race condition with amp * Remove log * Fix follow ups * Re-add stop task attempt endpoint (#421) * Re-add stop task attempt endpoint; remove legacy comments for implemented functionality * Fix kill race condition; fix state change when dev server * Ci fixes (#425) * Eslint fix * Remove #[ts(export)] * Fix tests * Clippy * Prettier * Fmt * Version downgrade * Fix API response * Don't treat clippy warnings as errors * Change crate name * Update cargo location * Update further refs * Reset versions * Bump versions * Update binary names * Branch fix * Prettier * Ensure finished event sends data (#434) * use option_env! when reading analytics vars (#435) * remove dead logic (#436) * update crate version across workspace (#437) * add all crates across the workspace * chore: bump version to 0.0.56 --------- Co-authored-by: Alex Netsch <alex@bloop.ai> Co-authored-by: Gabriel Gordon-Hall <gabriel@bloop.ai> Co-authored-by: Solomon <abcpro11051@disroot.org> Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com> Co-authored-by: GitHub Action <action@github.com>
2025-08-08 13:53:27 +01:00
ignore = "0.4"
git2 = "0.18"
mime_guess = "2.0"
rust-embed = "8.2"
octocrab = "0.44"
2025-08-12 10:35:19 +01:00
dirs = "5.0"
2025-06-14 17:36:54 -04:00
Refactor task attempt model (#109) * ## Task 1 Complete: GitService Extraction I've successfully completed **Task 1: Extract Git Operations to GitService**. Here's what was accomplished: ### ✅ What was implemented: 1. **Created GitService** (`backend/src/services/task_execution/git_service.rs`) with the following methods: - `create_worktree()` - Creates git worktrees with branches - `merge_changes()` - Merges worktree changes back to main repository - `rebase_branch()` - Rebases worktree branch onto new base - `get_diff()` - Gets diff between worktree and base (simplified implementation) - `delete_file()` - Deletes files from repository - `get_branch_status()` - Gets branch status relative to base branch - `get_default_branch_name()` - Gets default branch name - `branch_exists()` - Checks if branch exists - `remove_worktree()` - Cleanup worktrees - `has_uncommitted_changes()` - Checks for uncommitted changes 2. **Extracted Git Operations** from `task_attempt.rs`: - Moved worktree creation logic to GitService - Moved merge operations to GitService - Moved rebase operations to GitService - Updated TaskAttempt to use GitService instead of direct git2 calls 3. **Added Comprehensive Error Handling**: - Created `GitServiceError` enum with proper error types - Added conversion from `GitServiceError` to `TaskAttemptError` - Added extensive logging throughout git operations 4. **Maintained Code Quality**: - All operations pass `cargo check` ✅ - Proper error propagation and handling - Clean separation of concerns - Maintained existing API compatibility ### 🔧 Key Refactoring Benefits: - **Maintainability**: Git operations are now centralized in a dedicated service - **Testability**: GitService can be easily unit tested in isolation - **Reusability**: Other parts of the codebase can now use GitService - **Error Handling**: Comprehensive error handling with proper logging - **Code Organization**: Clear separation between business logic and git operations The TaskAttempt model now uses GitService for all git operations instead of direct git2 calls, making the code much more maintainable and organized. **Ready for your review before continuing to the next endpoint!** 🚀 * ## Migration Complete! ✅ I have successfully completed the Git2 logic migration from `backend/src/models/task_attempt.rs` to `backend/src/services/task_execution/git_service.rs`. Here's a summary of what was accomplished: ### Major Changes: #### 1. **Enhanced Diff Operations** - Moved the complex `get_diff` method logic to GitService as `get_enhanced_diff()` - Migrated all diff processing helpers including `generate_git_diff_chunks` and `process_unstaged_file` - TaskAttempt now uses GitService for all diff operations #### 2. **Worktree Recreation** - Moved `recreate_worktree_from_branch` to GitService - Simplified TaskAttempt to delegate to GitService for worktree recreation #### 3. **File Operations** - Enhanced GitService with `delete_file_and_commit()` method - TaskAttempt now uses GitService for file deletion operations #### 4. **GitHub Operations** - Moved `extract_github_repo_info` and `push_branch_to_github` to GitService - Added `get_github_repo_info()` and `push_to_github()` methods to GitService - Updated TaskAttempt to use GitService for GitHub operations #### 5. **Code Cleanup** - Removed ~300 lines of complex git2 operations from TaskAttempt - Cleaned up unused imports and helper methods - Maintained Repository import for the complex branch status method (which has different logic than GitService) ### Result: - **`cargo check` passes successfully** ✅ - Code maintainability significantly improved through separation of concerns - Database operations remain in TaskAttempt, Git operations centralized in GitService - All original functionality preserved while improving code organization The migration separates concerns cleanly: TaskAttempt focuses on database operations and orchestration, while GitService handles all low-level Git operations. This makes the codebase much more maintainable and easier to test. * Perfect! I have successfully completed the GitHub service extraction refactor. Here's a summary of what was accomplished: ## Task Completed: Extract GitHub Service ### ✅ What was accomplished: 1. **Created `backend/src/services/task_execution/github_service.rs`** with a comprehensive GitHubService 2. **Implemented all required methods:** - `create_pr()` - Creates pull requests on GitHub - `update_pr_status()` - Checks and updates PR status - `extract_repo_info()` - Parses GitHub repository URLs - `push_branch()` - Verifies branch existence on GitHub 3. **Added robust error handling** with custom GitHubServiceError enum 4. **Implemented retry logic** with exponential backoff for API calls 5. **Added proper authentication handling** through Octocrab client 6. **Updated existing code** to use the new service: - Modified `TaskAttempt::create_github_pr()` to use GitHubService - Updated `PrMonitorService` to use GitHubService for status checks - Removed duplicate GitHub operations from TaskAttempt model ### 🔧 Key Features: - **Retry mechanism**: Configurable exponential backoff for failed API calls - **Comprehensive error handling**: Specific error types for different failure modes - **Repository validation**: Checks branch existence and repository access - **Merge tracking**: Includes merge commit SHA in PR information - **Test coverage**: Unit tests for URL parsing functionality ### ✅ Compilation Success: - `cargo check` passes successfully - All GitHub operations are now centralized in the GitHubService - Proper separation of concerns between Git operations (GitService) and GitHub API operations (GitHubService) The refactor improves maintainability by centralizing all GitHub API operations into a dedicated service with proper error handling, retry logic, and a clean interface. * Perfect! The fix has been applied successfully and the code compiles without errors. ## ✅ Fix Applied The issue has been resolved by updating the `TaskAttempt::create_github_pr()` method to: 1. **Use GitService to read the remote URL** from the local git repository at `project.git_repo_path` 2. **Extract owner/repo info** using the existing `GitService::get_github_repo_info()` method 3. **Create GitHubRepoInfo struct** from the extracted data 4. **Pass the GitHubRepoInfo** to the GitHubService methods This maintains proper separation of concerns: - **GitService**: Handles local git operations (reading remote URLs from `.git/config`) - **GitHubService**: Handles GitHub API operations and URL parsing The fix should now correctly handle local repository paths like `/Users/louisknight-webb/Documents/GitHub/mission-control` by reading the GitHub remote URL from the git configuration, then using that URL for GitHub API operations. You can now test creating a PR again - it should work correctly! * Perfect! I have successfully completed the refactoring task. Let me create a summary of what was accomplished: ## ✅ Task Completed: Extract Process Service I have successfully extracted the process execution logic from the TaskAttempt model into a dedicated ProcessService. Here's what was accomplished: ### **What was refactored:** 1. **Created ProcessService** (`backend/src/services/task_execution/process_service.rs`) - Extracted all process execution logic from TaskAttempt model - Implemented methods: `start_execution()`, `start_coding_agent()`, `start_dev_server()`, `start_followup_execution()`, `start_process_execution()` - Moved helper methods: process spawning, monitoring, record creation, executor resolution - Handles process lifecycle management and monitoring integration 2. **Updated TaskAttempt model** (`backend/src/models/task_attempt.rs`) - Removed ~350+ lines of process execution logic - Replaced complex process methods with simple delegation to ProcessService - Made utility methods `ensure_worktree_exists()` and `recreate_worktree_from_branch()` public for ProcessService access - Cleaned up unused imports 3. **Updated service integration** - Added ProcessService to task_execution module exports - Updated execution_monitor.rs to use ProcessService instead of TaskAttempt - Fixed all imports and dependencies across the codebase ### **Benefits achieved:** - **Separation of concerns**: Process execution logic is now separated from data model logic - **Code maintainability**: TaskAttempt model is much cleaner and focused on data operations - **Better organization**: Process execution functionality is centralized in ProcessService - **Reduced complexity**: TaskAttempt went from 1800+ lines to ~1450 lines - **Backward compatibility**: Public API remains unchanged - TaskAttempt methods delegate to ProcessService ### **Verification:** - ✅ `cargo check` passes successfully - ✅ `cargo build` completes without errors - ✅ All existing functionality preserved through delegation pattern - ✅ Only expected warnings about unused code (normal during refactoring) The refactoring successfully extracted the ProcessService while maintaining all existing functionality and ensuring the codebase remains in a buildable state. * Perfect! I have successfully completed the task of extracting notification functionality from `execution_monitor.rs` into a separate `NotificationService`. Here's a summary of what was accomplished: ## ✅ Task Completed: Extract Notification Service ### **Created NotificationService** - **Location**: `backend/src/services/task_execution/notification_service.rs` - **Methods**: - `send_push_notification()` - Cross-platform push notifications - `play_sound_notification()` - Cross-platform sound alerts - `notify()` - Unified method for both sound and push notifications ### **Cross-Platform Support** - **macOS**: Uses `osascript` for notifications and `afplay` for sounds - **Linux**: Uses `notify-rust` crate for notifications, `paplay`/`aplay` for sounds - **Windows**: Uses PowerShell toast notifications and Media.SoundPlayer - **WSL**: Properly converts paths and uses Windows notification systems ### **Configuration & Non-Blocking Design** - **NotificationConfig**: Configurable sound/push notification settings - **Non-blocking**: All notifications are fire-and-forget using `spawn()` - **Sound file support**: Integrates with existing SoundFile enum and caching ### **Refactored execution_monitor.rs** - **Removed duplicate code**: 195+ lines of notification logic moved to service - **Clean integration**: Updated to use NotificationService with config - **Maintained functionality**: All existing notification behavior preserved ### **Code Quality** - **Tested**: Includes unit tests for service functionality - **Documentation**: Comprehensive documentation and error handling - **Modular**: Clean separation of concerns with proper service interface - **Cargo check passes**: All code compiles successfully The notification system is now properly encapsulated, reusable, and maintainable while supporting all the cross-platform requirements and configuration options. * Perfect! The implementation compiles successfully. The refactor helper has been implemented with: ## Summary ✅ **TaskAttemptContext struct** - Contains `task_attempt`, `task`, and `project` for consolidated access ✅ **TaskAttempt::load_context method** - Performs JOIN validation and loads all three entities in one operation ✅ **Compilation verified** - Code compiles without errors The `load_context` method provides a single function to replace the repetitive validation pattern used throughout methods like `merge_changes`, `get_diff`, `get_branch_status`, and `rebase_attempt`. It ensures proper relationships between attempt→task→project with a single JOIN query, then loads the complete context. * Perfect! The TaskAttempt refactor is complete and the project builds successfully. ## Summary ✅ **Successfully refactored 7 methods** to use the new `TaskAttempt::load_context` helper: - `merge_changes` - Reduced from 47 lines to 11 lines - `get_diff` - Reduced from 41 lines to 11 lines - `get_branch_status` - Reduced from 45 lines to 11 lines - `rebase_attempt` - Reduced from 41 lines to 11 lines - `delete_file` - Reduced from 35 lines to 10 lines - `create_github_pr` - Reduced from 41 lines to 11 lines - `get_execution_state` - Reduced from 41 lines to 11 lines ✅ **Eliminated repetitive validation code** - Each method previously had its own complex SQL query with JOINs and separate `find_by_id` calls ✅ **Maintained exact same functionality** - All methods work identically but with much cleaner, more maintainable code ✅ **Full project builds successfully** - Both frontend and backend compile without errors The refactor replaces **~300 lines of repetitive validation code** with a single, well-tested helper method, making the codebase significantly more maintainable and reducing the chance of bugs from inconsistent validation patterns. * Successfully moved all services from `backend/src/services/task_execution` to `backend/src/services`. Updated all imports and references, and the backend compiles without errors. * fmt * Clippy * Clippy * Clippy * fmt * Fix git path error * Update task running calculation * fmt * Remove unused * Prettier
2025-07-09 16:49:24 +01:00
[dev-dependencies]
tempfile = "3.8"
tower = { version = "0.4", features = ["util"] }
Refactor task attempt model (#109) * ## Task 1 Complete: GitService Extraction I've successfully completed **Task 1: Extract Git Operations to GitService**. Here's what was accomplished: ### ✅ What was implemented: 1. **Created GitService** (`backend/src/services/task_execution/git_service.rs`) with the following methods: - `create_worktree()` - Creates git worktrees with branches - `merge_changes()` - Merges worktree changes back to main repository - `rebase_branch()` - Rebases worktree branch onto new base - `get_diff()` - Gets diff between worktree and base (simplified implementation) - `delete_file()` - Deletes files from repository - `get_branch_status()` - Gets branch status relative to base branch - `get_default_branch_name()` - Gets default branch name - `branch_exists()` - Checks if branch exists - `remove_worktree()` - Cleanup worktrees - `has_uncommitted_changes()` - Checks for uncommitted changes 2. **Extracted Git Operations** from `task_attempt.rs`: - Moved worktree creation logic to GitService - Moved merge operations to GitService - Moved rebase operations to GitService - Updated TaskAttempt to use GitService instead of direct git2 calls 3. **Added Comprehensive Error Handling**: - Created `GitServiceError` enum with proper error types - Added conversion from `GitServiceError` to `TaskAttemptError` - Added extensive logging throughout git operations 4. **Maintained Code Quality**: - All operations pass `cargo check` ✅ - Proper error propagation and handling - Clean separation of concerns - Maintained existing API compatibility ### 🔧 Key Refactoring Benefits: - **Maintainability**: Git operations are now centralized in a dedicated service - **Testability**: GitService can be easily unit tested in isolation - **Reusability**: Other parts of the codebase can now use GitService - **Error Handling**: Comprehensive error handling with proper logging - **Code Organization**: Clear separation between business logic and git operations The TaskAttempt model now uses GitService for all git operations instead of direct git2 calls, making the code much more maintainable and organized. **Ready for your review before continuing to the next endpoint!** 🚀 * ## Migration Complete! ✅ I have successfully completed the Git2 logic migration from `backend/src/models/task_attempt.rs` to `backend/src/services/task_execution/git_service.rs`. Here's a summary of what was accomplished: ### Major Changes: #### 1. **Enhanced Diff Operations** - Moved the complex `get_diff` method logic to GitService as `get_enhanced_diff()` - Migrated all diff processing helpers including `generate_git_diff_chunks` and `process_unstaged_file` - TaskAttempt now uses GitService for all diff operations #### 2. **Worktree Recreation** - Moved `recreate_worktree_from_branch` to GitService - Simplified TaskAttempt to delegate to GitService for worktree recreation #### 3. **File Operations** - Enhanced GitService with `delete_file_and_commit()` method - TaskAttempt now uses GitService for file deletion operations #### 4. **GitHub Operations** - Moved `extract_github_repo_info` and `push_branch_to_github` to GitService - Added `get_github_repo_info()` and `push_to_github()` methods to GitService - Updated TaskAttempt to use GitService for GitHub operations #### 5. **Code Cleanup** - Removed ~300 lines of complex git2 operations from TaskAttempt - Cleaned up unused imports and helper methods - Maintained Repository import for the complex branch status method (which has different logic than GitService) ### Result: - **`cargo check` passes successfully** ✅ - Code maintainability significantly improved through separation of concerns - Database operations remain in TaskAttempt, Git operations centralized in GitService - All original functionality preserved while improving code organization The migration separates concerns cleanly: TaskAttempt focuses on database operations and orchestration, while GitService handles all low-level Git operations. This makes the codebase much more maintainable and easier to test. * Perfect! I have successfully completed the GitHub service extraction refactor. Here's a summary of what was accomplished: ## Task Completed: Extract GitHub Service ### ✅ What was accomplished: 1. **Created `backend/src/services/task_execution/github_service.rs`** with a comprehensive GitHubService 2. **Implemented all required methods:** - `create_pr()` - Creates pull requests on GitHub - `update_pr_status()` - Checks and updates PR status - `extract_repo_info()` - Parses GitHub repository URLs - `push_branch()` - Verifies branch existence on GitHub 3. **Added robust error handling** with custom GitHubServiceError enum 4. **Implemented retry logic** with exponential backoff for API calls 5. **Added proper authentication handling** through Octocrab client 6. **Updated existing code** to use the new service: - Modified `TaskAttempt::create_github_pr()` to use GitHubService - Updated `PrMonitorService` to use GitHubService for status checks - Removed duplicate GitHub operations from TaskAttempt model ### 🔧 Key Features: - **Retry mechanism**: Configurable exponential backoff for failed API calls - **Comprehensive error handling**: Specific error types for different failure modes - **Repository validation**: Checks branch existence and repository access - **Merge tracking**: Includes merge commit SHA in PR information - **Test coverage**: Unit tests for URL parsing functionality ### ✅ Compilation Success: - `cargo check` passes successfully - All GitHub operations are now centralized in the GitHubService - Proper separation of concerns between Git operations (GitService) and GitHub API operations (GitHubService) The refactor improves maintainability by centralizing all GitHub API operations into a dedicated service with proper error handling, retry logic, and a clean interface. * Perfect! The fix has been applied successfully and the code compiles without errors. ## ✅ Fix Applied The issue has been resolved by updating the `TaskAttempt::create_github_pr()` method to: 1. **Use GitService to read the remote URL** from the local git repository at `project.git_repo_path` 2. **Extract owner/repo info** using the existing `GitService::get_github_repo_info()` method 3. **Create GitHubRepoInfo struct** from the extracted data 4. **Pass the GitHubRepoInfo** to the GitHubService methods This maintains proper separation of concerns: - **GitService**: Handles local git operations (reading remote URLs from `.git/config`) - **GitHubService**: Handles GitHub API operations and URL parsing The fix should now correctly handle local repository paths like `/Users/louisknight-webb/Documents/GitHub/mission-control` by reading the GitHub remote URL from the git configuration, then using that URL for GitHub API operations. You can now test creating a PR again - it should work correctly! * Perfect! I have successfully completed the refactoring task. Let me create a summary of what was accomplished: ## ✅ Task Completed: Extract Process Service I have successfully extracted the process execution logic from the TaskAttempt model into a dedicated ProcessService. Here's what was accomplished: ### **What was refactored:** 1. **Created ProcessService** (`backend/src/services/task_execution/process_service.rs`) - Extracted all process execution logic from TaskAttempt model - Implemented methods: `start_execution()`, `start_coding_agent()`, `start_dev_server()`, `start_followup_execution()`, `start_process_execution()` - Moved helper methods: process spawning, monitoring, record creation, executor resolution - Handles process lifecycle management and monitoring integration 2. **Updated TaskAttempt model** (`backend/src/models/task_attempt.rs`) - Removed ~350+ lines of process execution logic - Replaced complex process methods with simple delegation to ProcessService - Made utility methods `ensure_worktree_exists()` and `recreate_worktree_from_branch()` public for ProcessService access - Cleaned up unused imports 3. **Updated service integration** - Added ProcessService to task_execution module exports - Updated execution_monitor.rs to use ProcessService instead of TaskAttempt - Fixed all imports and dependencies across the codebase ### **Benefits achieved:** - **Separation of concerns**: Process execution logic is now separated from data model logic - **Code maintainability**: TaskAttempt model is much cleaner and focused on data operations - **Better organization**: Process execution functionality is centralized in ProcessService - **Reduced complexity**: TaskAttempt went from 1800+ lines to ~1450 lines - **Backward compatibility**: Public API remains unchanged - TaskAttempt methods delegate to ProcessService ### **Verification:** - ✅ `cargo check` passes successfully - ✅ `cargo build` completes without errors - ✅ All existing functionality preserved through delegation pattern - ✅ Only expected warnings about unused code (normal during refactoring) The refactoring successfully extracted the ProcessService while maintaining all existing functionality and ensuring the codebase remains in a buildable state. * Perfect! I have successfully completed the task of extracting notification functionality from `execution_monitor.rs` into a separate `NotificationService`. Here's a summary of what was accomplished: ## ✅ Task Completed: Extract Notification Service ### **Created NotificationService** - **Location**: `backend/src/services/task_execution/notification_service.rs` - **Methods**: - `send_push_notification()` - Cross-platform push notifications - `play_sound_notification()` - Cross-platform sound alerts - `notify()` - Unified method for both sound and push notifications ### **Cross-Platform Support** - **macOS**: Uses `osascript` for notifications and `afplay` for sounds - **Linux**: Uses `notify-rust` crate for notifications, `paplay`/`aplay` for sounds - **Windows**: Uses PowerShell toast notifications and Media.SoundPlayer - **WSL**: Properly converts paths and uses Windows notification systems ### **Configuration & Non-Blocking Design** - **NotificationConfig**: Configurable sound/push notification settings - **Non-blocking**: All notifications are fire-and-forget using `spawn()` - **Sound file support**: Integrates with existing SoundFile enum and caching ### **Refactored execution_monitor.rs** - **Removed duplicate code**: 195+ lines of notification logic moved to service - **Clean integration**: Updated to use NotificationService with config - **Maintained functionality**: All existing notification behavior preserved ### **Code Quality** - **Tested**: Includes unit tests for service functionality - **Documentation**: Comprehensive documentation and error handling - **Modular**: Clean separation of concerns with proper service interface - **Cargo check passes**: All code compiles successfully The notification system is now properly encapsulated, reusable, and maintainable while supporting all the cross-platform requirements and configuration options. * Perfect! The implementation compiles successfully. The refactor helper has been implemented with: ## Summary ✅ **TaskAttemptContext struct** - Contains `task_attempt`, `task`, and `project` for consolidated access ✅ **TaskAttempt::load_context method** - Performs JOIN validation and loads all three entities in one operation ✅ **Compilation verified** - Code compiles without errors The `load_context` method provides a single function to replace the repetitive validation pattern used throughout methods like `merge_changes`, `get_diff`, `get_branch_status`, and `rebase_attempt`. It ensures proper relationships between attempt→task→project with a single JOIN query, then loads the complete context. * Perfect! The TaskAttempt refactor is complete and the project builds successfully. ## Summary ✅ **Successfully refactored 7 methods** to use the new `TaskAttempt::load_context` helper: - `merge_changes` - Reduced from 47 lines to 11 lines - `get_diff` - Reduced from 41 lines to 11 lines - `get_branch_status` - Reduced from 45 lines to 11 lines - `rebase_attempt` - Reduced from 41 lines to 11 lines - `delete_file` - Reduced from 35 lines to 10 lines - `create_github_pr` - Reduced from 41 lines to 11 lines - `get_execution_state` - Reduced from 41 lines to 11 lines ✅ **Eliminated repetitive validation code** - Each method previously had its own complex SQL query with JOINs and separate `find_by_id` calls ✅ **Maintained exact same functionality** - All methods work identically but with much cleaner, more maintainable code ✅ **Full project builds successfully** - Both frontend and backend compile without errors The refactor replaces **~300 lines of repetitive validation code** with a single, well-tested helper method, making the codebase significantly more maintainable and reducing the chance of bugs from inconsistent validation patterns. * Successfully moved all services from `backend/src/services/task_execution` to `backend/src/services`. Updated all imports and references, and the backend compiles without errors. * fmt * Clippy * Clippy * Clippy * fmt * Fix git path error * Update task running calculation * fmt * Remove unused * Prettier
2025-07-09 16:49:24 +01:00
2025-06-14 17:36:54 -04:00
[build-dependencies]
dotenv = "0.15"