mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-20 00:03:21 +00:00
feat: add agent-yolo profile and hide worktrees without tmux window
Add "Agent (skip permissions)" profile that runs claude with --dangerously-skip-permissions. Filter worktrees without a tmux window from the sidebar list instead of showing a disabled entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d6d4d85d8f
commit
4ab08cb6a1
@@ -6,6 +6,7 @@ import {
|
||||
openWorktree,
|
||||
closeWorktree,
|
||||
sendPrompt,
|
||||
type Profile,
|
||||
} from "./workmux";
|
||||
import {
|
||||
attach,
|
||||
@@ -143,7 +144,8 @@ async function handleApi(req: Request, url: URL): Promise<Response> {
|
||||
if (!body.branch) {
|
||||
return errorResponse("branch is required", 400);
|
||||
}
|
||||
const profile = (body.profile === "full" || body.profile === "agent-only") ? body.profile : "agent-only";
|
||||
const validProfiles = ["full", "agent-only", "agent-yolo"] as const;
|
||||
const profile = validProfiles.includes(body.profile as any) ? body.profile as Profile : "agent-only";
|
||||
const result = await addWorktree(body.branch, { prompt: body.prompt, profile });
|
||||
return jsonResponse({ message: result }, 201);
|
||||
}
|
||||
|
||||
@@ -75,11 +75,12 @@ async function runChecked(args: string[]): Promise<string> {
|
||||
return stdout.trim();
|
||||
}
|
||||
|
||||
export type Profile = "full" | "agent-only";
|
||||
export type Profile = "full" | "agent-only" | "agent-yolo";
|
||||
|
||||
const PROFILE_PANE_CMDS: Record<Profile, string[]> = {
|
||||
"full": [], // Use default workmux pane commands from .workmux.yaml
|
||||
"agent-only": ["claude"], // Only start agent in pane 0
|
||||
"agent-yolo": ["claude --dangerously-skip-permissions"],
|
||||
};
|
||||
|
||||
export async function addWorktree(
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
const PROFILES: { value: Profile; label: string }[] = [
|
||||
{ value: "agent-only", label: "Agent only" },
|
||||
{ value: "agent-yolo", label: "Agent (skip permissions)" },
|
||||
{ value: "full", label: "Full (agent + backend + frontend)" },
|
||||
];
|
||||
|
||||
@@ -21,10 +22,12 @@
|
||||
let removing = $state(false);
|
||||
let createProfile = $state<Profile>("agent-only");
|
||||
|
||||
let selectedWorktree = $derived(worktrees.find((w) => w.branch === selectedBranch));
|
||||
let hasMux = $derived(selectedWorktree?.mux === "✓");
|
||||
let visibleWorktrees = $derived(
|
||||
worktrees.filter((w) => w.path === "(here)" || w.branch === "main" || w.mux === "✓")
|
||||
);
|
||||
let selectedWorktree = $derived(visibleWorktrees.find((w) => w.branch === selectedBranch));
|
||||
let isMain = $derived(selectedWorktree?.path === "(here)" || selectedBranch === "main");
|
||||
let canConnect = $derived(!!selectedBranch && !isMain && hasMux);
|
||||
let canConnect = $derived(!!selectedBranch && !isMain);
|
||||
|
||||
async function refresh() {
|
||||
try {
|
||||
@@ -92,7 +95,7 @@
|
||||
title="New Worktree"
|
||||
><span class="text-lg leading-none">+</span> New</button>
|
||||
</div>
|
||||
<WorktreeList {worktrees} selected={selectedBranch} onselect={(b) => (selectedBranch = b)} />
|
||||
<WorktreeList worktrees={visibleWorktrees} selected={selectedBranch} onselect={(b) => (selectedBranch = b)} />
|
||||
</aside>
|
||||
|
||||
<main class="flex-1 min-w-0 flex flex-col overflow-hidden">
|
||||
@@ -111,8 +114,6 @@
|
||||
<p>
|
||||
{#if isMain}
|
||||
Main worktree — use workmux to manage
|
||||
{:else if selectedBranch && !hasMux}
|
||||
No tmux window for this worktree
|
||||
{:else}
|
||||
Select a worktree from the sidebar to connect
|
||||
{/if}
|
||||
|
||||
@@ -14,7 +14,7 @@ export function fetchWorktrees(): Promise<WorktreeInfo[]> {
|
||||
return api<WorktreeInfo[]>("worktrees");
|
||||
}
|
||||
|
||||
export type Profile = "full" | "agent-only";
|
||||
export type Profile = "full" | "agent-only" | "agent-yolo";
|
||||
|
||||
export function createWorktree(
|
||||
branch: string,
|
||||
|
||||
Reference in New Issue
Block a user