дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
Порівняти коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
5d18087356 |
No files matched your search
@@ -442,15 +442,13 @@ test("creates, validates cron, runs, inspects provenance, exports/imports .autom
|
||||
await page.setViewportSize({ width: 1320, height: 860 });
|
||||
await installAutomationDesktopHarness(page);
|
||||
|
||||
// Open Agents tool window and click the pinned Automations hub row
|
||||
// Open Agents tool window and click the Automations header button
|
||||
await page.evaluate(async () => {
|
||||
const actionsModule = "/src/platform/actions.ts";
|
||||
const { executeAction } = await import(/* @vite-ignore */ actionsModule);
|
||||
await executeAction("agents.showToolWindow");
|
||||
});
|
||||
const hub = page.getByTestId("agents-automations-hub");
|
||||
await expect(hub).toBeVisible();
|
||||
await hub.getByRole("button", { name: /Automations/ }).click();
|
||||
await page.getByRole("button", { name: "Agent Automations" }).click();
|
||||
|
||||
const editor = page.getByTestId("automations-editor");
|
||||
await expect(editor).toBeVisible();
|
||||
@@ -477,6 +475,7 @@ test("creates, validates cron, runs, inspects provenance, exports/imports .autom
|
||||
await expect(dialog.getByTestId("automation-schedule-preview")).toContainText("Upcoming runs:");
|
||||
await expect(dialog.getByRole("button", { name: "Create Automation" })).toBeEnabled();
|
||||
|
||||
await dialog.getByRole("button", { name: /Advanced/ }).click();
|
||||
await dialog.getByLabel("Stop After Runs (optional)").fill("25");
|
||||
await dialog.getByRole("button", { name: "Create Automation" }).click();
|
||||
await expect(dialog).toHaveCount(0);
|
||||
@@ -516,7 +515,8 @@ test("creates, validates cron, runs, inspects provenance, exports/imports .autom
|
||||
const exportedMd = await exportDialog.getByLabel("Exported Automation Markdown").inputValue();
|
||||
await exportDialog.getByRole("button", { name: "Close" }).click();
|
||||
|
||||
await editor.getByRole("button", { name: "Import .automation.md" }).click();
|
||||
await editor.getByRole("button", { name: "Options" }).click();
|
||||
await page.getByRole("menuitem", { name: "Import .automation.md" }).click();
|
||||
const importDialog = page.getByRole("dialog", { name: "Import .automation.md" });
|
||||
await importDialog
|
||||
.getByLabel("Automation Markdown")
|
||||
@@ -570,6 +570,7 @@ test("supports SameTask rolling continuity, NeedsInput approval flow, and sideba
|
||||
dialog = page.getByRole("dialog", { name: "New Automation" });
|
||||
await dialog.getByLabel("Name").fill("Rolling PR Labeler");
|
||||
await dialog.getByLabel("Prompt Instructions").fill("NEEDS_APPROVAL label triaged PRs");
|
||||
await dialog.getByRole("button", { name: /Advanced/ }).click();
|
||||
await dialog.getByRole("button", { name: "Session Continuity" }).click();
|
||||
await page.getByRole("option", { name: "Reuse rolling session" }).click();
|
||||
await dialog.getByRole("button", { name: "Create Automation" }).click();
|
||||
@@ -776,8 +777,9 @@ test("supports Weekly day picker, Local Autonomous warning, ChatOnly workspace,
|
||||
|
||||
await dialog.getByRole("button", { name: "Checkout Isolation" }).click();
|
||||
await page.getByRole("option", { name: "Local checkout" }).click();
|
||||
await dialog.getByRole("button", { name: /Advanced/ }).click();
|
||||
await dialog.getByRole("button", { name: "Unattended Permissions" }).click();
|
||||
await page.getByRole("option", { name: "Allow all (capped by your interactive approval setting)" }).click();
|
||||
await page.getByRole("option", { name: /Allow all/ }).click();
|
||||
await expect(dialog).toContainText(
|
||||
"Warning: Autonomous mode on a local checkout can modify your working files directly.",
|
||||
);
|
||||
|
||||
@@ -62,13 +62,7 @@ import { setFocusedTaskList } from "./taskListFocus";
|
||||
import { matchTask } from "./taskSearch";
|
||||
import { SessionEditor } from "./SessionEditor";
|
||||
import { HomeEditor } from "./HomeEditor";
|
||||
import {
|
||||
automatedTaskVisible,
|
||||
openAutomationDialog,
|
||||
openAutomations,
|
||||
useAutomations,
|
||||
useAutomationsSync,
|
||||
} from "./automationsModel";
|
||||
import { automatedTaskVisible, useAutomations, useAutomationsSync } from "./automationsModel";
|
||||
import styles from "./Agents.module.css";
|
||||
import autoStyles from "./Automations.module.css";
|
||||
import { basename, useProject } from "@/platform/project";
|
||||
@@ -76,10 +70,15 @@ import { useTx } from "@/platform/i18n";
|
||||
import { executeAction } from "@/platform/actions";
|
||||
|
||||
export function AgentsHeaderActions() {
|
||||
const host = useAutomations((s) => s.snapshot.host);
|
||||
const hasAttention = host.unreadRuns > 0 || host.needsInputRuns > 0;
|
||||
return (
|
||||
<>
|
||||
<IconButton icon="plus" action="agents.newTask" />
|
||||
<IconButton icon="clock" action="agents.automations" />
|
||||
<span className={autoStyles.headerBadgeWrap}>
|
||||
<IconButton icon="clock" action="agents.automations" />
|
||||
{hasAttention && <span className={autoStyles.headerBadgeDot} aria-hidden="true" />}
|
||||
</span>
|
||||
<IconButton icon="settings" action="agents.mcpServers" />
|
||||
</>
|
||||
);
|
||||
@@ -179,8 +178,6 @@ export function AgentsView() {
|
||||
const providers = useAgents((s) => s.providers);
|
||||
const docked = useAgents((s) => s.docked);
|
||||
const homeOpen = useAgents((s) => s.homeOpen);
|
||||
const automationHost = useAutomations((s) => s.snapshot.host);
|
||||
const automationCount = useAutomations((s) => s.snapshot.automations.length);
|
||||
const automatedRunFilter = useAutomations((s) => s.automatedRunFilter);
|
||||
const inline = docked !== null || homeOpen;
|
||||
const historyRef = useRef<HTMLButtonElement>(null);
|
||||
@@ -535,42 +532,6 @@ export function AgentsView() {
|
||||
setFocusedTaskList(null);
|
||||
}}
|
||||
>
|
||||
<div className={autoStyles.hubBar} data-testid="agents-automations-hub">
|
||||
<button
|
||||
type="button"
|
||||
className={autoStyles.hubBtn}
|
||||
onClick={() => {
|
||||
setHistoryOpen(false);
|
||||
openAutomations();
|
||||
}}
|
||||
>
|
||||
<Icon name="clock" size={14} />
|
||||
<span>
|
||||
<T>Automations</T>
|
||||
</span>
|
||||
<span className={autoStyles.hubMeta}>
|
||||
{automationHost.activeSchedules > 0 ? (
|
||||
<span>
|
||||
{automationHost.activeSchedules === 1 ? tx("1 active") : tx`${automationHost.activeSchedules} active`}
|
||||
</span>
|
||||
) : automationCount > 0 ? (
|
||||
<span>{automationCount}</span>
|
||||
) : null}
|
||||
{automationHost.unreadRuns > 0 && (
|
||||
<span className={clsx(autoStyles.tag, autoStyles.tagUnread)}>{automationHost.unreadRuns}</span>
|
||||
)}
|
||||
</span>
|
||||
</button>
|
||||
<IconButton
|
||||
icon="plus"
|
||||
size="small"
|
||||
title="New Automation"
|
||||
onClick={() => {
|
||||
setHistoryOpen(false);
|
||||
openAutomationDialog();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
{tasks.size > 0 && (
|
||||
<SearchField
|
||||
className={styles.taskSearch}
|
||||
|
||||
@@ -49,9 +49,21 @@ const SCHEDULE_KIND_OPTIONS: ReadonlyArray<SelectOption<TriggerKind>> = [
|
||||
];
|
||||
|
||||
const PERMISSION_OPTIONS: ReadonlyArray<SelectOption<AutomationPermissionMode>> = [
|
||||
{ value: "assisted", label: "Accept edits (edit workspace files without asking; ask before commands)" },
|
||||
{ value: "allowAll", label: "Allow all (capped by your interactive approval setting)" },
|
||||
{ value: "default", label: "Ask for approval (ask before edits and commands)" },
|
||||
{
|
||||
value: "assisted",
|
||||
label: "Accept edits",
|
||||
detail: "Edit workspace files without asking; ask before commands",
|
||||
},
|
||||
{
|
||||
value: "allowAll",
|
||||
label: "Allow all",
|
||||
detail: "Capped by your interactive approval setting",
|
||||
},
|
||||
{
|
||||
value: "default",
|
||||
label: "Ask for approval",
|
||||
detail: "Ask before edits and commands",
|
||||
},
|
||||
];
|
||||
|
||||
const CONTINUITY_OPTIONS: ReadonlyArray<SelectOption<AutomationContinuity>> = [
|
||||
@@ -178,6 +190,18 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
const [disableAfterStr, setDisableAfterStr] = useState(() =>
|
||||
editing?.disableAfterMs ? toDatetimeLocalValue(editing.disableAfterMs).slice(0, 10) : "",
|
||||
);
|
||||
// Expand Advanced automatically when editing a schedule with non-default advanced options.
|
||||
const [advancedOpen, setAdvancedOpen] = useState(() =>
|
||||
Boolean(
|
||||
editing &&
|
||||
(editing.permissions !== "assisted" ||
|
||||
editing.continuity !== "newTask" ||
|
||||
editing.misfirePolicy != null ||
|
||||
editing.maxRuns != null ||
|
||||
editing.disableAfterMs != null ||
|
||||
(editing.workspace.kind === "project" && !editing.workspace.autoCleanWorktree)),
|
||||
),
|
||||
);
|
||||
|
||||
const [fetchedBranches, setFetchedBranches] = useState<{ root: string; list: Branch[] }>({ root: "", list: [] });
|
||||
const [previewState, setPreviewState] = useState<{ runs: number[]; error: string | null }>({
|
||||
@@ -249,12 +273,15 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
const previewError = currentTrigger.kind === "manual" ? null : previewState.error;
|
||||
|
||||
const selectedProvider = providers.find((p) => p.id === providerId) ?? providers[0];
|
||||
// Exclude interactive permission/approval controls here so they don't conflict with Unattended Permissions.
|
||||
const providerConfig = useMemo(
|
||||
() =>
|
||||
(selectedProvider?.config ?? []).map((opt) => ({
|
||||
...opt,
|
||||
current: configMap[opt.id] ?? opt.current,
|
||||
})),
|
||||
(selectedProvider?.config ?? [])
|
||||
.filter((opt) => opt.category !== "permissions" && opt.category !== "approval" && opt.category !== "mode")
|
||||
.map((opt) => ({
|
||||
...opt,
|
||||
current: configMap[opt.id] ?? opt.current,
|
||||
})),
|
||||
[selectedProvider, configMap],
|
||||
);
|
||||
|
||||
@@ -275,6 +302,9 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
[branches, tx],
|
||||
);
|
||||
|
||||
const permissionSummary = tx(PERMISSION_OPTIONS.find((o) => o.value === permissions)?.label ?? "Accept edits");
|
||||
const continuitySummary = continuity === "sameTask" ? tx("Rolling session") : tx("Fresh session");
|
||||
|
||||
const toggleWeekday = (day: number) => {
|
||||
setWeeklyDays((cur) =>
|
||||
cur.includes(day) ? (cur.length > 1 ? cur.filter((d) => d !== day) : cur) : [...cur, day].sort(),
|
||||
@@ -343,7 +373,7 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
open={dialog.open}
|
||||
onClose={closeAutomationDialog}
|
||||
title={editing ? tx("Edit Automation") : tx("New Automation")}
|
||||
width={620}
|
||||
width={560}
|
||||
maxHeight={760}
|
||||
resizable="both"
|
||||
footerStart={<Checkbox checked={enabled} onChange={setEnabled} label="Active schedule" />}
|
||||
@@ -395,107 +425,25 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
<label className={styles.fieldLabel} htmlFor="automation-prompt-input">
|
||||
<T>Prompt Instructions</T>
|
||||
</label>
|
||||
<textarea
|
||||
id="automation-prompt-input"
|
||||
className={styles.promptTextarea}
|
||||
value={promptText}
|
||||
onChange={(e) => setPromptText(e.target.value)}
|
||||
placeholder={tx("Describe what the agent should inspect, verify, or report on each run…")}
|
||||
/>
|
||||
<div className={styles.pickerBar}>
|
||||
<ConfigPickers
|
||||
config={providerConfig}
|
||||
onChange={(id, val) => setConfigMap((prev) => ({ ...prev, [id]: val }))}
|
||||
<div className={styles.promptBox}>
|
||||
<textarea
|
||||
id="automation-prompt-input"
|
||||
className={styles.promptTextarea}
|
||||
value={promptText}
|
||||
onChange={(e) => setPromptText(e.target.value)}
|
||||
placeholder={tx("Describe what the agent should inspect, verify, or report on each run…")}
|
||||
/>
|
||||
<McpPicker provider={providerId} overrides={mcpOverrides} onChange={setMcpOverrides} />
|
||||
<SkillsPicker provider={providerId} overrides={skillOverrides} onChange={setSkillOverrides} />
|
||||
<MemoryPicker provider={providerId} overrides={memoryOverrides} onChange={setMemoryOverrides} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Workspace Target</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Workspace Target")}
|
||||
value={workspaceMode}
|
||||
options={[
|
||||
...(projectRoot ? [{ value: "project", label: tx("Project workspace") }] : []),
|
||||
{ value: "chatOnly", label: tx("No workspace (chat only)") },
|
||||
]}
|
||||
onChange={(v) => setWorkspaceMode(v as "project" | "chatOnly")}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Session Continuity</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Session Continuity")}
|
||||
value={continuity}
|
||||
options={CONTINUITY_OPTIONS}
|
||||
onChange={(v) => setContinuity(v)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{workspaceMode === "project" && projectRoot && (
|
||||
<div className={styles.fieldRow}>
|
||||
{workspaceProjects.length > 1 ? (
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Repository</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Repository")}
|
||||
value={projectRoot}
|
||||
options={workspaceProjects.map((p) => ({ value: p, label: basename(p) }))}
|
||||
onChange={setProjectRoot}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Checkout Isolation</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Checkout Isolation")}
|
||||
value={isolation}
|
||||
options={[
|
||||
{ value: "worktree", label: tx("Isolated Git worktree (Recommended)") },
|
||||
{ value: "local", label: tx("Local checkout") },
|
||||
]}
|
||||
onChange={(v) => setIsolation(v as Isolation)}
|
||||
<div className={styles.promptBar}>
|
||||
<ConfigPickers
|
||||
config={providerConfig}
|
||||
onChange={(id, val) => setConfigMap((prev) => ({ ...prev, [id]: val }))}
|
||||
/>
|
||||
<McpPicker provider={providerId} overrides={mcpOverrides} onChange={setMcpOverrides} />
|
||||
<SkillsPicker provider={providerId} overrides={skillOverrides} onChange={setSkillOverrides} />
|
||||
<MemoryPicker provider={providerId} overrides={memoryOverrides} onChange={setMemoryOverrides} />
|
||||
</div>
|
||||
|
||||
{isolation === "worktree" && (
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Base Branch</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Base Branch")}
|
||||
value={baseBranch}
|
||||
options={branchOptions}
|
||||
onChange={setBaseBranch}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{workspaceMode === "project" && isolation === "worktree" && continuity === "newTask" && (
|
||||
<Checkbox
|
||||
checked={autoCleanWorktree}
|
||||
onChange={setAutoCleanWorktree}
|
||||
label="Auto-delete temporary worktree when the run makes zero file changes"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
@@ -604,15 +552,15 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
)}
|
||||
|
||||
{triggerKind !== "manual" && (
|
||||
<div className={styles.previewBox} data-testid="automation-schedule-preview">
|
||||
<div className={styles.previewLine} data-testid="automation-schedule-preview">
|
||||
{previewError ? (
|
||||
<span style={{ color: "var(--danger)" }}>{previewError}</span>
|
||||
<span className={styles.previewError}>{previewError}</span>
|
||||
) : previewRuns.length > 0 ? (
|
||||
<>
|
||||
<strong>
|
||||
<span className={styles.previewLabel}>
|
||||
<T>Upcoming runs:</T>
|
||||
</strong>
|
||||
<span>{previewRuns.map((ms) => formatShortTimestamp(ms)).join(" · ")}</span>
|
||||
</span>
|
||||
<span>{previewRuns.map((ms) => formatShortTimestamp(ms)).join(" · ")}</span>
|
||||
</>
|
||||
) : (
|
||||
<span>
|
||||
@@ -622,76 +570,183 @@ function AutomationDialogBody({ backend }: { backend: AutomationsBackend }) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.workspaceRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Unattended Permissions</T>
|
||||
<T>Workspace Target</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Unattended Permissions")}
|
||||
value={permissions}
|
||||
options={PERMISSION_OPTIONS}
|
||||
onChange={(v) => setPermissions(v)}
|
||||
aria-label={tx("Workspace Target")}
|
||||
value={workspaceMode}
|
||||
options={[
|
||||
...(projectRoot ? [{ value: "project", label: tx("Project workspace") }] : []),
|
||||
{ value: "chatOnly", label: tx("No workspace (chat only)") },
|
||||
]}
|
||||
onChange={(v) => setWorkspaceMode(v as "project" | "chatOnly")}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Missed Schedule Policy</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Missed Schedule Policy")}
|
||||
value={misfirePolicy}
|
||||
options={MISFIRE_OPTIONS}
|
||||
onChange={setMisfirePolicy}
|
||||
/>
|
||||
</div>
|
||||
{workspaceMode === "project" && projectRoot && workspaceProjects.length > 1 && (
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Repository</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Repository")}
|
||||
value={projectRoot}
|
||||
options={workspaceProjects.map((p) => ({ value: p, label: basename(p) }))}
|
||||
onChange={setProjectRoot}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{workspaceMode === "project" && projectRoot && (
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Checkout Isolation</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Checkout Isolation")}
|
||||
value={isolation}
|
||||
options={[
|
||||
{ value: "worktree", label: tx("Isolated Git worktree"), detail: tx("Recommended") },
|
||||
{ value: "local", label: tx("Local checkout") },
|
||||
]}
|
||||
onChange={(v) => setIsolation(v as Isolation)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{workspaceMode === "project" && projectRoot && isolation === "worktree" && (
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Base Branch</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Base Branch")}
|
||||
value={baseBranch}
|
||||
options={branchOptions}
|
||||
onChange={setBaseBranch}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{agentSettings.newTaskApprovals === "ask" && permissions !== "default" && (
|
||||
<div className={styles.fieldHint}>
|
||||
<T>
|
||||
Your interactive New Tasks setting is Asking for approval, so scheduled turns are capped to ask before
|
||||
edits and commands.
|
||||
</T>
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.advancedSection}>
|
||||
<button
|
||||
type="button"
|
||||
className={styles.advancedToggle}
|
||||
aria-expanded={advancedOpen}
|
||||
onClick={() => setAdvancedOpen((v) => !v)}
|
||||
>
|
||||
<span className={styles.advancedTitle}>
|
||||
<Icon name={advancedOpen ? "chevron-down" : "chevron-right"} size={13} />
|
||||
<T>Advanced</T>
|
||||
</span>
|
||||
{!advancedOpen && (
|
||||
<span className={styles.advancedSummary}>
|
||||
{permissionSummary} · {continuitySummary}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
|
||||
{permissions === "allowAll" && workspaceMode === "project" && isolation === "local" && (
|
||||
<div className={styles.fieldHint} style={{ color: "var(--warning)" }}>
|
||||
<T>
|
||||
Warning: Autonomous mode on a local checkout can modify your working files directly. Prefer an isolated
|
||||
Git worktree.
|
||||
</T>
|
||||
</div>
|
||||
)}
|
||||
{advancedOpen && (
|
||||
<div className={styles.advancedBody}>
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Unattended Permissions</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Unattended Permissions")}
|
||||
value={permissions}
|
||||
options={PERMISSION_OPTIONS}
|
||||
onChange={(v) => setPermissions(v)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
<label className={styles.fieldLabel} htmlFor="automation-max-runs-input">
|
||||
<T>Stop After Runs (optional)</T>
|
||||
</label>
|
||||
<Input
|
||||
id="automation-max-runs-input"
|
||||
type="number"
|
||||
min={1}
|
||||
value={maxRunsStr}
|
||||
onChange={(e) => setMaxRunsStr(e.target.value)}
|
||||
placeholder="50"
|
||||
/>
|
||||
</div>
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Session Continuity</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Session Continuity")}
|
||||
value={continuity}
|
||||
options={CONTINUITY_OPTIONS}
|
||||
onChange={(v) => setContinuity(v)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldGroup}>
|
||||
<label className={styles.fieldLabel} htmlFor="automation-disable-after-input">
|
||||
<T>Disable After Date (optional)</T>
|
||||
</label>
|
||||
<Input
|
||||
id="automation-disable-after-input"
|
||||
type="date"
|
||||
value={disableAfterStr}
|
||||
onChange={(e) => setDisableAfterStr(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
{agentSettings.newTaskApprovals === "ask" && permissions !== "default" && (
|
||||
<div className={styles.fieldHint}>
|
||||
<T>
|
||||
Your interactive New Tasks setting is Asking for approval, so scheduled turns are capped to ask
|
||||
before edits and commands.
|
||||
</T>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{permissions === "allowAll" && workspaceMode === "project" && isolation === "local" && (
|
||||
<div className={styles.fieldHint} style={{ color: "var(--warning)" }}>
|
||||
<T>
|
||||
Warning: Autonomous mode on a local checkout can modify your working files directly. Prefer an
|
||||
isolated Git worktree.
|
||||
</T>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{workspaceMode === "project" && isolation === "worktree" && continuity === "newTask" && (
|
||||
<Checkbox
|
||||
checked={autoCleanWorktree}
|
||||
onChange={setAutoCleanWorktree}
|
||||
label="Auto-delete temporary worktree when the run makes zero file changes"
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
<span className={styles.fieldLabel}>
|
||||
<T>Missed Schedule Policy</T>
|
||||
</span>
|
||||
<Select
|
||||
aria-label={tx("Missed Schedule Policy")}
|
||||
value={misfirePolicy}
|
||||
options={MISFIRE_OPTIONS}
|
||||
onChange={setMisfirePolicy}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldGroup}>
|
||||
<label className={styles.fieldLabel} htmlFor="automation-max-runs-input">
|
||||
<T>Stop After Runs (optional)</T>
|
||||
</label>
|
||||
<Input
|
||||
id="automation-max-runs-input"
|
||||
type="number"
|
||||
min={1}
|
||||
value={maxRunsStr}
|
||||
onChange={(e) => setMaxRunsStr(e.target.value)}
|
||||
placeholder="50"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.fieldRow}>
|
||||
<div className={styles.fieldGroup}>
|
||||
<label className={styles.fieldLabel} htmlFor="automation-disable-after-input">
|
||||
<T>Disable After Date (optional)</T>
|
||||
</label>
|
||||
<Input
|
||||
id="automation-disable-after-input"
|
||||
type="date"
|
||||
value={disableAfterStr}
|
||||
onChange={(e) => setDisableAfterStr(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Dialog>
|
||||
|
||||
@@ -1,61 +1,67 @@
|
||||
/* Agent Automations editor tab, creation dialog, and status widgets (Islands style). */
|
||||
|
||||
.editor {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
background: var(--bg-app);
|
||||
overflow-y: auto;
|
||||
background: var(--bg-editor);
|
||||
color: var(--fg);
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
max-width: 820px;
|
||||
margin: 0 auto;
|
||||
padding: 20px 28px 24px;
|
||||
box-sizing: border-box;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
padding: 12px 18px 10px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--bg-elev);
|
||||
gap: var(--space-3);
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
|
||||
.headerMain {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.headerTitle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1-5);
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.3;
|
||||
color: var(--fg-strong);
|
||||
}
|
||||
|
||||
.headerActions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1-5);
|
||||
flex-shrink: 0;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.hostPill {
|
||||
.hostMeta {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
height: 22px;
|
||||
padding: 0 8px;
|
||||
border-radius: var(--radius-small);
|
||||
background: var(--bg-floating-toolbar);
|
||||
box-shadow: inset 0 0 0 1px var(--border);
|
||||
color: var(--fg-secondary);
|
||||
font-size: var(--fs-tiny);
|
||||
white-space: nowrap;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1-5);
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-small);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.statusDot {
|
||||
@@ -78,35 +84,42 @@
|
||||
background: var(--danger);
|
||||
}
|
||||
|
||||
.tabBar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 14px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--bg-elev);
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.filterRow {
|
||||
/* Compact navigation tabs and inline search/filter on one hairline row. */
|
||||
.navRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
padding: 10px 18px 6px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.navControls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1-5);
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.searchWrap {
|
||||
flex: 1;
|
||||
min-width: 180px;
|
||||
max-width: 360px;
|
||||
width: 220px;
|
||||
max-width: 100%;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.filterRight {
|
||||
display: flex;
|
||||
.tabBadge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1-5);
|
||||
justify-content: center;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-tiny);
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.bannerWarn {
|
||||
@@ -114,10 +127,10 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
margin: 10px 18px 0;
|
||||
margin-bottom: 12px;
|
||||
padding: 8px 12px;
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-floating-toolbar);
|
||||
background: var(--bg-elev);
|
||||
box-shadow: inset 0 0 0 1px var(--warning);
|
||||
color: var(--fg-strong);
|
||||
font-size: var(--fs-small);
|
||||
@@ -132,19 +145,19 @@
|
||||
|
||||
.body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 8px 18px 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
gap: var(--space-3);
|
||||
padding: 16px 0 20px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* Framed list with hairline dividers, matching Settings > Agents > Skills. */
|
||||
.listFrame {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-elev);
|
||||
background: var(--bg-editor);
|
||||
box-shadow: inset 0 0 0 1px var(--border);
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -167,7 +180,7 @@
|
||||
|
||||
.rowFocused {
|
||||
background: var(--bg-hover);
|
||||
box-shadow: inset 2px 0 0 var(--link);
|
||||
box-shadow: inset 2px 0 0 var(--accent);
|
||||
}
|
||||
|
||||
.rowLeft {
|
||||
@@ -201,6 +214,12 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.rowSchedule {
|
||||
color: var(--fg-secondary);
|
||||
font-size: var(--fs-small);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rowPrompt {
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-small);
|
||||
@@ -215,7 +234,7 @@
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1-5);
|
||||
font-size: var(--fs-tiny);
|
||||
color: var(--fg-secondary);
|
||||
color: var(--fg-subtle);
|
||||
}
|
||||
|
||||
.tag {
|
||||
@@ -225,7 +244,7 @@
|
||||
height: 18px;
|
||||
padding: 0 6px;
|
||||
border-radius: var(--radius-small);
|
||||
background: var(--bg-floating-toolbar);
|
||||
background: var(--bg-elev);
|
||||
color: var(--fg-secondary);
|
||||
font-size: var(--fs-tiny);
|
||||
white-space: nowrap;
|
||||
@@ -236,7 +255,7 @@
|
||||
}
|
||||
|
||||
.tagUnread {
|
||||
background: var(--link);
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -262,15 +281,18 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.emptyCard {
|
||||
/* Open, cardless empty state with a single-column hairline template list. */
|
||||
.emptySection {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-3);
|
||||
padding: 18px;
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-elev);
|
||||
box-shadow: inset 0 0 0 1px var(--border);
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.emptyHeader {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.emptyTitle {
|
||||
@@ -284,40 +306,42 @@
|
||||
margin: 0;
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-small);
|
||||
line-height: 1.45;
|
||||
max-width: 620px;
|
||||
line-height: 1.5;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.templatesGrid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
|
||||
gap: var(--space-2);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.templateBtn {
|
||||
.templateRow {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-1);
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-3);
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
border-radius: var(--radius-control);
|
||||
border: none;
|
||||
background: var(--bg-app);
|
||||
box-shadow: inset 0 0 0 1px var(--border);
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: var(--fg);
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.templateBtn:hover {
|
||||
.templateRow + .templateRow {
|
||||
box-shadow: inset 0 1px 0 var(--border);
|
||||
}
|
||||
|
||||
.templateRow:hover {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.templateMain {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-0-5);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.templateTitle {
|
||||
font-weight: 600;
|
||||
font-size: var(--fs-small);
|
||||
font-weight: 500;
|
||||
font-size: var(--fs-ui);
|
||||
color: var(--fg-strong);
|
||||
}
|
||||
|
||||
@@ -326,12 +350,28 @@
|
||||
color: var(--fg-muted);
|
||||
}
|
||||
|
||||
/* Dialog form */
|
||||
.templatePlus {
|
||||
flex-shrink: 0;
|
||||
color: var(--fg-muted);
|
||||
}
|
||||
|
||||
.footerBar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--border);
|
||||
color: var(--fg-secondary);
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
/* Dialog form (aligned to Dialog's 16px titlebar / footer insets). */
|
||||
.dialogForm {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
padding: 4px 0;
|
||||
padding: 4px 16px 12px;
|
||||
font-size: var(--fs-ui);
|
||||
}
|
||||
|
||||
@@ -339,58 +379,109 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.fieldRow {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.workspaceRow {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.fieldLabel {
|
||||
font-size: var(--fs-small);
|
||||
font-weight: 600;
|
||||
color: var(--fg-strong);
|
||||
font-weight: 500;
|
||||
color: var(--fg-secondary);
|
||||
}
|
||||
|
||||
.fieldHint {
|
||||
font-size: var(--fs-tiny);
|
||||
color: var(--fg-muted);
|
||||
line-height: 1.4;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
/* Unified prompt surface matching the HomeEditor composer frame. */
|
||||
.promptBox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-field, var(--bg-app));
|
||||
box-shadow: inset 0 0 0 1px var(--border-button);
|
||||
transition: box-shadow var(--dur-fast) var(--ease);
|
||||
}
|
||||
|
||||
.promptBox:focus-within {
|
||||
box-shadow:
|
||||
inset 0 0 0 1px var(--focus-ring),
|
||||
0 0 0 1px var(--focus-ring);
|
||||
}
|
||||
|
||||
.promptTextarea {
|
||||
width: 100%;
|
||||
min-height: 92px;
|
||||
padding: 8px 10px;
|
||||
border-radius: var(--radius-control);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-app);
|
||||
min-height: 84px;
|
||||
padding: 8px 10px 6px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: var(--fg-strong);
|
||||
font-family: var(--font-ui, inherit);
|
||||
font-size: var(--fs-ui);
|
||||
line-height: 1.45;
|
||||
line-height: 1.5;
|
||||
resize: vertical;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.promptTextarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--link);
|
||||
}
|
||||
|
||||
.pickerBar {
|
||||
.promptTextarea::placeholder {
|
||||
color: var(--fg-faint);
|
||||
}
|
||||
|
||||
/* Standalone monospace textarea used in Import / Export markdown dialogs. */
|
||||
.codeTextarea {
|
||||
width: 100%;
|
||||
min-height: 168px;
|
||||
padding: 8px 10px;
|
||||
border: 0;
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-field, var(--bg-app));
|
||||
box-shadow: inset 0 0 0 1px var(--border-button);
|
||||
color: var(--fg-strong);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-small);
|
||||
line-height: 1.5;
|
||||
resize: vertical;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.codeTextarea:focus {
|
||||
outline: none;
|
||||
box-shadow:
|
||||
inset 0 0 0 1px var(--focus-ring),
|
||||
0 0 0 1px var(--focus-ring);
|
||||
}
|
||||
|
||||
.promptBar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1-5);
|
||||
gap: var(--space-1);
|
||||
padding: 4px 6px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.weekdayRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1-5);
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.dayBtn {
|
||||
@@ -398,30 +489,87 @@
|
||||
min-width: 34px;
|
||||
padding: 0 8px;
|
||||
border-radius: var(--radius-small);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-app);
|
||||
box-shadow: inset 0 0 0 1px var(--border-button);
|
||||
background: var(--bg-field, var(--bg-app));
|
||||
color: var(--fg-secondary);
|
||||
font-size: var(--fs-tiny);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dayBtn:hover {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.dayBtnActive {
|
||||
border-color: var(--link);
|
||||
background: var(--bg-hover);
|
||||
box-shadow: inset 0 0 0 1px var(--accent);
|
||||
background: var(--bg-selected);
|
||||
color: var(--fg-strong);
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.previewBox {
|
||||
.previewLine {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1);
|
||||
font-size: var(--fs-tiny);
|
||||
color: var(--fg-muted);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.previewLabel {
|
||||
color: var(--fg-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.previewError {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.advancedSection {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-0-5);
|
||||
padding: 7px 10px;
|
||||
border-radius: var(--radius-control);
|
||||
background: var(--bg-floating-toolbar);
|
||||
box-shadow: inset 0 0 0 1px var(--border);
|
||||
font-size: var(--fs-tiny);
|
||||
border-top: 1px solid var(--border);
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.advancedToggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
width: 100%;
|
||||
padding: 4px 2px;
|
||||
border-radius: var(--radius-small);
|
||||
color: var(--fg-secondary);
|
||||
font-size: var(--fs-small);
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.advancedToggle:hover {
|
||||
color: var(--fg-strong);
|
||||
}
|
||||
|
||||
.advancedTitle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.advancedSummary {
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-tiny);
|
||||
font-weight: 400;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.advancedBody {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.errorBox {
|
||||
@@ -436,45 +584,21 @@
|
||||
font-size: var(--fs-small);
|
||||
}
|
||||
|
||||
/* Sidebar hub row */
|
||||
.hubBar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-1-5);
|
||||
padding: 4px 8px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.hubBtn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1-5);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 3px 6px;
|
||||
border: none;
|
||||
border-radius: var(--radius-small);
|
||||
background: none;
|
||||
color: var(--fg-strong);
|
||||
font: inherit;
|
||||
font-size: var(--fs-small);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hubBtn:hover {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.hubMeta {
|
||||
margin-left: auto;
|
||||
/* Sidebar tool window header badge dot for unread/attention runs. */
|
||||
.headerBadgeWrap {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--space-1-5);
|
||||
color: var(--fg-muted);
|
||||
font-size: var(--fs-tiny);
|
||||
}
|
||||
|
||||
.headerBadgeDot {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Session provenance banner & schedule strip */
|
||||
|
||||
@@ -293,6 +293,35 @@ export function AutomationsEditor({
|
||||
}
|
||||
};
|
||||
|
||||
const { host } = snapshot;
|
||||
const projectActiveSchedules = useMemo(
|
||||
() => snapshot.automations.filter((a) => a.enabled && a.trigger.kind !== "manual").length,
|
||||
[snapshot.automations],
|
||||
);
|
||||
|
||||
const headerMoreMenu = (): MenuItem[] => [
|
||||
{
|
||||
kind: "item",
|
||||
id: "import",
|
||||
label: "Import .automation.md",
|
||||
icon: "download",
|
||||
disabled: untrustedProject,
|
||||
run: () => setImportOpen(true),
|
||||
},
|
||||
...(projectActiveSchedules > 0
|
||||
? [
|
||||
{
|
||||
kind: "item" as const,
|
||||
id: "pause-all",
|
||||
label: "Pause All",
|
||||
icon: "pause",
|
||||
disabled: untrustedProject,
|
||||
run: () => void handlePauseAll(),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
];
|
||||
|
||||
const automationMenu = (auto: AgentAutomation_Serialize): MenuItem[] => [
|
||||
{
|
||||
kind: "item",
|
||||
@@ -340,394 +369,394 @@ export function AutomationsEditor({
|
||||
},
|
||||
];
|
||||
|
||||
const { host } = snapshot;
|
||||
const projectActiveSchedules = useMemo(
|
||||
() => snapshot.automations.filter((a) => a.enabled && a.trigger.kind !== "manual").length,
|
||||
[snapshot.automations],
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={styles.editor} data-testid="automations-editor">
|
||||
<div className={styles.header}>
|
||||
<div className={styles.headerMain}>
|
||||
<h2 className={styles.headerTitle}>
|
||||
<Icon name="clock" size={16} />
|
||||
<T>Agent Automations</T>
|
||||
</h2>
|
||||
<span className={styles.hostPill} data-testid="scheduler-host-pill">
|
||||
<span
|
||||
className={clsx(styles.statusDot, host.activeSchedules > 0 && styles.statusDotOn)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<Icon name={host.remote ? "remote" : "server"} size={12} />
|
||||
<span>{host.remote ? tx("Remote Daemon") : tx("Local Host")}</span>
|
||||
<span>·</span>
|
||||
<span>
|
||||
{host.activeSchedules === 1 ? tx("1 active schedule") : tx`${host.activeSchedules} active schedules`}
|
||||
</span>
|
||||
{host.bootServiceRegistered && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
<T>Auto-starts on login</T>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className={styles.headerActions}>
|
||||
<Button size="small" icon="download" disabled={untrustedProject} onClick={() => setImportOpen(true)}>
|
||||
<T>Import .automation.md</T>
|
||||
</Button>
|
||||
{projectActiveSchedules > 0 && (
|
||||
<Button size="small" icon="pause" disabled={untrustedProject} onClick={() => void handlePauseAll()}>
|
||||
<T>Pause All</T>
|
||||
</Button>
|
||||
)}
|
||||
<IconButton
|
||||
icon="settings"
|
||||
title="Automation Settings"
|
||||
onClick={() => void executeAction("file.settings", AUTOMATIONS_PAGE)}
|
||||
/>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="small"
|
||||
icon="plus"
|
||||
disabled={untrustedProject}
|
||||
onClick={() => openAutomationDialog()}
|
||||
>
|
||||
<T>New Automation</T>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{loadError && (
|
||||
<div className={styles.errorBox} style={{ margin: "10px 18px 0" }} role="alert">
|
||||
<Icon name="error" size={14} />
|
||||
<span>{loadError}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{host.bootServiceError && (
|
||||
<div className={styles.errorBox} style={{ margin: "10px 18px 0" }} role="alert">
|
||||
<Icon name="warning" size={14} />
|
||||
<span>{host.bootServiceError}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{untrustedProject && (
|
||||
<div className={styles.bannerWarn} role="status">
|
||||
<div className={styles.bannerLeft}>
|
||||
<Icon name="warning" size={14} />
|
||||
<span>
|
||||
<T>This project is untrusted. Workspace automations stay paused until you trust the project.</T>
|
||||
<div className={styles.column}>
|
||||
<header className={styles.header}>
|
||||
<div className={styles.headerMain}>
|
||||
<h2 className={styles.headerTitle}>
|
||||
<T>Agent Automations</T>
|
||||
</h2>
|
||||
<span className={styles.hostMeta} data-testid="scheduler-host-pill">
|
||||
<span
|
||||
className={clsx(styles.statusDot, host.activeSchedules > 0 && styles.statusDotOn)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{host.remote && <Icon name="remote" size={12} />}
|
||||
<span>{host.remote ? tx("Remote Daemon") : tx("Local Host")}</span>
|
||||
<span>·</span>
|
||||
<span>
|
||||
{host.activeSchedules === 1 ? tx("1 active schedule") : tx`${host.activeSchedules} active schedules`}
|
||||
</span>
|
||||
{host.bootServiceRegistered && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
<T>Auto-starts on login</T>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={styles.tabBar}>
|
||||
<Tabs
|
||||
activeId={activeTab}
|
||||
onSelect={(id) => setAutomationsTab(id as "schedules" | "runs")}
|
||||
items={[
|
||||
{
|
||||
id: "schedules",
|
||||
label: <T>Schedules</T>,
|
||||
text: "Schedules",
|
||||
trailing: snapshot.automations.length ? <span>{snapshot.automations.length}</span> : undefined,
|
||||
},
|
||||
{
|
||||
id: "runs",
|
||||
label: <T>Run History</T>,
|
||||
text: "Run History",
|
||||
trailing:
|
||||
host.unreadRuns > 0 ? (
|
||||
<span className={clsx(styles.tag, styles.tagUnread)}>{host.unreadRuns}</span>
|
||||
) : snapshot.runs.length ? (
|
||||
<span>{snapshot.runs.length}</span>
|
||||
<div className={styles.headerActions}>
|
||||
<Button
|
||||
variant="primary"
|
||||
size="small"
|
||||
icon="plus"
|
||||
disabled={untrustedProject}
|
||||
onClick={() => openAutomationDialog()}
|
||||
>
|
||||
<T>New Automation</T>
|
||||
</Button>
|
||||
<IconButton
|
||||
icon="settings"
|
||||
title="Automation Settings"
|
||||
onClick={() => void executeAction("file.settings", AUTOMATIONS_PAGE)}
|
||||
/>
|
||||
<IconButton icon="more" title="Options" onClick={(e) => showContextMenu(e, headerMoreMenu())} />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{loadError && (
|
||||
<div className={styles.errorBox} style={{ marginBottom: 12 }} role="alert">
|
||||
<Icon name="error" size={14} />
|
||||
<span>{loadError}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{host.bootServiceError && (
|
||||
<div className={styles.errorBox} style={{ marginBottom: 12 }} role="alert">
|
||||
<Icon name="warning" size={14} />
|
||||
<span>{host.bootServiceError}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{untrustedProject && (
|
||||
<div className={styles.bannerWarn} role="status">
|
||||
<div className={styles.bannerLeft}>
|
||||
<Icon name="warning" size={14} />
|
||||
<span>
|
||||
<T>This project is untrusted. Workspace automations stay paused until you trust the project.</T>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={styles.navRow}>
|
||||
<Tabs
|
||||
variant="compact"
|
||||
activeId={activeTab}
|
||||
onSelect={(id) => setAutomationsTab(id as "schedules" | "runs")}
|
||||
items={[
|
||||
{
|
||||
id: "schedules",
|
||||
label: <T>Schedules</T>,
|
||||
text: "Schedules",
|
||||
trailing: snapshot.automations.length ? (
|
||||
<span className={styles.tabBadge}>{snapshot.automations.length}</span>
|
||||
) : undefined,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.filterRow}>
|
||||
<div className={styles.searchWrap}>
|
||||
<SearchField
|
||||
value={query}
|
||||
onChange={setQuery}
|
||||
clearable
|
||||
placeholder={tx("Filter automations and runs")}
|
||||
aria-label={tx("Filter automations and runs")}
|
||||
},
|
||||
{
|
||||
id: "runs",
|
||||
label: <T>Run History</T>,
|
||||
text: "Run History",
|
||||
trailing:
|
||||
host.unreadRuns > 0 ? (
|
||||
<span className={clsx(styles.tag, styles.tagUnread)}>{host.unreadRuns}</span>
|
||||
) : snapshot.runs.length ? (
|
||||
<span className={styles.tabBadge}>{snapshot.runs.length}</span>
|
||||
) : undefined,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
<div className={styles.navControls}>
|
||||
<div className={styles.searchWrap}>
|
||||
<SearchField
|
||||
value={query}
|
||||
onChange={setQuery}
|
||||
clearable
|
||||
placeholder={tx("Filter automations and runs")}
|
||||
aria-label={tx("Filter automations and runs")}
|
||||
/>
|
||||
</div>
|
||||
{activeTab === "runs" && (
|
||||
<>
|
||||
<Select
|
||||
variant="ghost"
|
||||
aria-label={tx("Run filter")}
|
||||
value={runFilter}
|
||||
options={[
|
||||
{ value: "all", label: tx("All runs") },
|
||||
{ value: "unread", label: tx("Unread only") },
|
||||
{ value: "needsInput", label: tx("Waiting for input") },
|
||||
]}
|
||||
onChange={(v) => setRunFilter(v as "all" | "unread" | "needsInput")}
|
||||
/>
|
||||
{host.unreadRuns > 0 && (
|
||||
<Button size="small" icon="check" onClick={() => void handleMarkAllRead()}>
|
||||
<T>Mark All as Read</T>
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{activeTab === "schedules" ? (
|
||||
<div className={styles.filterRight}>
|
||||
|
||||
<div className={styles.body}>
|
||||
{activeTab === "schedules" ? (
|
||||
filteredAutomations.length === 0 ? (
|
||||
<div className={styles.emptySection}>
|
||||
<div className={styles.emptyHeader}>
|
||||
<h3 className={styles.emptyTitle}>
|
||||
{query ? <T>No matching automations</T> : <T>Automate recurring agent workflows</T>}
|
||||
</h3>
|
||||
{!query && (
|
||||
<p className={styles.emptyDesc}>
|
||||
<T>
|
||||
Schedules run directly on your local host or remote daemon—even when editor windows are closed
|
||||
or after an OS reboot—using isolated Git worktrees so your working tree stays clean.
|
||||
</T>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
{!query && (
|
||||
<div className={styles.listFrame}>
|
||||
{STARTER_TEMPLATES.map((tpl) => (
|
||||
<button
|
||||
key={tpl.name}
|
||||
type="button"
|
||||
className={styles.templateRow}
|
||||
onClick={() => openAutomationDialog({ prefillName: tpl.name, prefillPrompt: tpl.prompt })}
|
||||
>
|
||||
<span className={styles.templateMain}>
|
||||
<span className={styles.templateTitle}>{tx(tpl.name)}</span>
|
||||
<span className={styles.templateSub}>{tx(tpl.sub)}</span>
|
||||
</span>
|
||||
<Icon name="plus" size={14} className={styles.templatePlus} />
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.listFrame}>
|
||||
{filteredAutomations.map((auto) => (
|
||||
<div
|
||||
key={auto.id}
|
||||
data-testid={`automation-row-${auto.id}`}
|
||||
className={clsx(styles.row, focusAutomationId === auto.id && styles.rowFocused)}
|
||||
onContextMenu={(e) => showContextMenu(e, automationMenu(auto))}
|
||||
>
|
||||
<div className={styles.rowLeft}>
|
||||
<span
|
||||
className={clsx(styles.statusDot, auto.enabled && styles.statusDotOn)}
|
||||
style={{ marginTop: 6 }}
|
||||
title={auto.enabled ? tx("Active") : tx("Paused")}
|
||||
/>
|
||||
<Icon name={providerIcon(auto.provider)} size={16} label={providerName(auto.provider)} />
|
||||
<div className={styles.rowContent}>
|
||||
<div className={styles.rowTitleLine}>
|
||||
<span className={styles.rowTitle}>{auto.name}</span>
|
||||
<span className={styles.rowSchedule}>{describeTrigger(auto.trigger, tx)}</span>
|
||||
{!auto.enabled && (
|
||||
<span className={styles.tag}>
|
||||
<T>Paused</T>
|
||||
</span>
|
||||
)}
|
||||
{auto.unreadRuns > 0 && (
|
||||
<span className={clsx(styles.tag, styles.tagUnread)}>
|
||||
{auto.unreadRuns === 1 ? tx("1 unread") : tx`${auto.unreadRuns} unread`}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.rowPrompt}>{auto.prompt.text}</div>
|
||||
{auto.pausedReason && (
|
||||
<div className={styles.fieldHint} style={{ color: "var(--warning)" }}>
|
||||
{auto.pausedReason}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.rowMeta}>
|
||||
<span>{providerName(auto.provider)}</span>
|
||||
<span>·</span>
|
||||
<span>
|
||||
{auto.workspace.kind === "chatOnly"
|
||||
? tx("Chat only")
|
||||
: auto.workspace.isolation === "worktree"
|
||||
? `${basename(auto.workspace.root)} · ${tx("Worktree")}`
|
||||
: `${basename(auto.workspace.root)} · ${tx("Local checkout")}`}
|
||||
</span>
|
||||
<span>·</span>
|
||||
<span>{auto.continuity === "sameTask" ? tx("Rolling session") : tx("Fresh session")}</span>
|
||||
{auto.enabled && auto.nextRunMs ? (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
<T>Next:</T> {formatShortTimestamp(auto.nextRunMs)}
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
{auto.maxRuns ? (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
{auto.runCount}/{auto.maxRuns} <T>runs</T>
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.rowActions}>
|
||||
<Button
|
||||
size="small"
|
||||
icon="run"
|
||||
disabled={busyId === auto.id || untrustedProject}
|
||||
onClick={() => void handleRunNow(auto)}
|
||||
>
|
||||
<T>Run Now</T>
|
||||
</Button>
|
||||
<IconButton
|
||||
icon={auto.enabled ? "pause" : "resume"}
|
||||
title={auto.enabled ? "Pause Schedule" : "Resume Schedule"}
|
||||
disabled={busyId === auto.id || untrustedProject}
|
||||
onClick={() => void handleToggleEnabled(auto)}
|
||||
/>
|
||||
<IconButton
|
||||
icon="edit"
|
||||
title="Edit Automation"
|
||||
disabled={untrustedProject}
|
||||
onClick={() => openAutomationDialog({ editing: auto })}
|
||||
/>
|
||||
<IconButton
|
||||
icon="more"
|
||||
title="More Actions"
|
||||
disabled={untrustedProject}
|
||||
onClick={(e) => showContextMenu(e, automationMenu(auto))}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
) : filteredRuns.length === 0 ? (
|
||||
<div className={styles.emptySection}>
|
||||
<div className={styles.emptyHeader}>
|
||||
<h3 className={styles.emptyTitle}>
|
||||
<T>No automation runs yet</T>
|
||||
</h3>
|
||||
<p className={styles.emptyDesc}>
|
||||
<T>
|
||||
Scheduled and manual runs appear here with diff summaries, approval badges, and one-click session
|
||||
transcripts.
|
||||
</T>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.listFrame}>
|
||||
{filteredRuns.map((run) => (
|
||||
<div
|
||||
key={run.id}
|
||||
data-testid={`automation-run-${run.id}`}
|
||||
className={styles.row}
|
||||
onClick={() => void handleOpenRun(run)}
|
||||
>
|
||||
<div className={styles.rowLeft}>
|
||||
<RunStatusGlyph status={run.status} />
|
||||
<div className={styles.rowContent}>
|
||||
<div className={styles.rowTitleLine}>
|
||||
<span className={styles.rowTitle}>
|
||||
{run.automationName} <span className={styles.mono}>#{run.runNumber}</span>
|
||||
</span>
|
||||
{run.status === "needsInput" && (
|
||||
<span className={clsx(styles.tag, styles.tagWarn)}>
|
||||
<Icon name="warning" size={11} />
|
||||
<T>Needs approval</T>
|
||||
</span>
|
||||
)}
|
||||
{run.unread && (
|
||||
<span className={clsx(styles.tag, styles.tagUnread)}>
|
||||
<T>Unread</T>
|
||||
</span>
|
||||
)}
|
||||
{run.origin.kind === "scheduled" && run.origin.catchUp && (
|
||||
<span className={styles.tag}>
|
||||
<T>Catch-up</T>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{run.error && (
|
||||
<div className={styles.rowPrompt} style={{ color: "var(--danger)" }}>
|
||||
{run.error}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.rowMeta}>
|
||||
<span>{formatShortTimestamp(run.startedMs)}</span>
|
||||
<span>·</span>
|
||||
<span>{run.origin.kind === "manual" ? tx("Manual run") : tx("Scheduled run")}</span>
|
||||
{run.branch && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span className={styles.mono}>{run.branch}</span>
|
||||
</>
|
||||
)}
|
||||
{(run.added > 0 || run.removed > 0) && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span className={styles.diffAdded}>+{run.added}</span>
|
||||
<span className={styles.diffRemoved}>-{run.removed}</span>
|
||||
</>
|
||||
)}
|
||||
{run.worktreeCleaned && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
<T>Zero-diff worktree cleaned</T>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.rowActions} onClick={(e) => e.stopPropagation()}>
|
||||
{run.unread && (
|
||||
<IconButton
|
||||
icon="check"
|
||||
title="Mark as Read"
|
||||
onClick={() => void backend.markRead(run.id, null).then(() => refreshAutomations(backend))}
|
||||
/>
|
||||
)}
|
||||
{run.taskId && (
|
||||
<Button size="small" onClick={() => void handleOpenRun(run)}>
|
||||
<T>Open Session</T>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{snapshot.runsNextCursor != null && (
|
||||
<div className={styles.row} style={{ justifyContent: "center" }}>
|
||||
<Button size="small" onClick={() => void loadMoreRuns(backend)}>
|
||||
<T>Show more</T>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{activeTab === "schedules" && (
|
||||
<div className={styles.footerBar}>
|
||||
<Checkbox
|
||||
checked={autoStartEnabled}
|
||||
onChange={(v) => void handleToggleAutoStart(v)}
|
||||
label="Keep automations running when OpenIDEA is closed"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.filterRight}>
|
||||
<Select
|
||||
aria-label={tx("Run filter")}
|
||||
value={runFilter}
|
||||
options={[
|
||||
{ value: "all", label: tx("All runs") },
|
||||
{ value: "unread", label: tx("Unread only") },
|
||||
{ value: "needsInput", label: tx("Waiting for input") },
|
||||
]}
|
||||
onChange={(v) => setRunFilter(v as "all" | "unread" | "needsInput")}
|
||||
/>
|
||||
{host.unreadRuns > 0 && (
|
||||
<Button size="small" icon="check" onClick={() => void handleMarkAllRead()}>
|
||||
<T>Mark All as Read</T>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={styles.body}>
|
||||
{activeTab === "schedules" ? (
|
||||
filteredAutomations.length === 0 ? (
|
||||
<div className={styles.emptyCard}>
|
||||
<h3 className={styles.emptyTitle}>
|
||||
{query ? <T>No matching automations</T> : <T>Automate recurring agent workflows</T>}
|
||||
</h3>
|
||||
{!query && (
|
||||
<>
|
||||
<p className={styles.emptyDesc}>
|
||||
<T>
|
||||
Schedules run directly on your local host or remote daemon—even when editor windows are closed or
|
||||
after an OS reboot—using isolated Git worktrees so your working tree stays clean.
|
||||
</T>
|
||||
</p>
|
||||
<div className={styles.templatesGrid}>
|
||||
{STARTER_TEMPLATES.map((tpl) => (
|
||||
<button
|
||||
key={tpl.name}
|
||||
type="button"
|
||||
className={styles.templateBtn}
|
||||
onClick={() => openAutomationDialog({ prefillName: tpl.name, prefillPrompt: tpl.prompt })}
|
||||
>
|
||||
<span className={styles.templateTitle}>{tx(tpl.name)}</span>
|
||||
<span className={styles.templateSub}>{tx(tpl.sub)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.listFrame}>
|
||||
{filteredAutomations.map((auto) => (
|
||||
<div
|
||||
key={auto.id}
|
||||
data-testid={`automation-row-${auto.id}`}
|
||||
className={clsx(styles.row, focusAutomationId === auto.id && styles.rowFocused)}
|
||||
onContextMenu={(e) => showContextMenu(e, automationMenu(auto))}
|
||||
>
|
||||
<div className={styles.rowLeft}>
|
||||
<span
|
||||
className={clsx(styles.statusDot, auto.enabled && styles.statusDotOn)}
|
||||
style={{ marginTop: 6 }}
|
||||
title={auto.enabled ? tx("Active") : tx("Paused")}
|
||||
/>
|
||||
<Icon name={providerIcon(auto.provider)} size={16} label={providerName(auto.provider)} />
|
||||
<div className={styles.rowContent}>
|
||||
<div className={styles.rowTitleLine}>
|
||||
<span className={styles.rowTitle}>{auto.name}</span>
|
||||
<span className={styles.tag}>{describeTrigger(auto.trigger, tx)}</span>
|
||||
{!auto.enabled && (
|
||||
<span className={styles.tag}>
|
||||
<T>Paused</T>
|
||||
</span>
|
||||
)}
|
||||
{auto.unreadRuns > 0 && (
|
||||
<span className={clsx(styles.tag, styles.tagUnread)}>
|
||||
{auto.unreadRuns === 1 ? tx("1 unread") : tx`${auto.unreadRuns} unread`}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.rowPrompt}>{auto.prompt.text}</div>
|
||||
{auto.pausedReason && (
|
||||
<div className={styles.fieldHint} style={{ color: "var(--warning)" }}>
|
||||
{auto.pausedReason}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.rowMeta}>
|
||||
<span>{providerName(auto.provider)}</span>
|
||||
<span>·</span>
|
||||
<span>
|
||||
{auto.workspace.kind === "chatOnly"
|
||||
? tx("Chat only")
|
||||
: auto.workspace.isolation === "worktree"
|
||||
? `${basename(auto.workspace.root)} · ${tx("Worktree")}`
|
||||
: `${basename(auto.workspace.root)} · ${tx("Local checkout")}`}
|
||||
</span>
|
||||
<span>·</span>
|
||||
<span>{auto.continuity === "sameTask" ? tx("Rolling session") : tx("Fresh session")}</span>
|
||||
{auto.enabled && auto.nextRunMs ? (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
<T>Next:</T> {formatShortTimestamp(auto.nextRunMs)}
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
{auto.maxRuns ? (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
{auto.runCount}/{auto.maxRuns} <T>runs</T>
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.rowActions}>
|
||||
<Button
|
||||
size="small"
|
||||
icon="run"
|
||||
disabled={busyId === auto.id || untrustedProject}
|
||||
onClick={() => void handleRunNow(auto)}
|
||||
>
|
||||
<T>Run Now</T>
|
||||
</Button>
|
||||
<IconButton
|
||||
icon={auto.enabled ? "pause" : "resume"}
|
||||
title={auto.enabled ? "Pause Schedule" : "Resume Schedule"}
|
||||
disabled={busyId === auto.id || untrustedProject}
|
||||
onClick={() => void handleToggleEnabled(auto)}
|
||||
/>
|
||||
<IconButton
|
||||
icon="edit"
|
||||
title="Edit Automation"
|
||||
disabled={untrustedProject}
|
||||
onClick={() => openAutomationDialog({ editing: auto })}
|
||||
/>
|
||||
<IconButton
|
||||
icon="more"
|
||||
title="More Actions"
|
||||
disabled={untrustedProject}
|
||||
onClick={(e) => showContextMenu(e, automationMenu(auto))}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
) : filteredRuns.length === 0 ? (
|
||||
<div className={styles.emptyCard}>
|
||||
<h3 className={styles.emptyTitle}>
|
||||
<T>No automation runs yet</T>
|
||||
</h3>
|
||||
<p className={styles.emptyDesc}>
|
||||
<T>
|
||||
Scheduled and manual runs appear here with diff summaries, approval badges, and one-click session
|
||||
transcripts.
|
||||
</T>
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.listFrame}>
|
||||
{filteredRuns.map((run) => (
|
||||
<div
|
||||
key={run.id}
|
||||
data-testid={`automation-run-${run.id}`}
|
||||
className={styles.row}
|
||||
onClick={() => void handleOpenRun(run)}
|
||||
style={{ cursor: run.taskId ? "pointer" : "default" }}
|
||||
>
|
||||
<div className={styles.rowLeft}>
|
||||
<RunStatusGlyph status={run.status} />
|
||||
<div className={styles.rowContent}>
|
||||
<div className={styles.rowTitleLine}>
|
||||
<span className={styles.rowTitle}>
|
||||
{run.automationName} <span className={styles.mono}>#{run.runNumber}</span>
|
||||
</span>
|
||||
{run.status === "needsInput" && (
|
||||
<span className={clsx(styles.tag, styles.tagWarn)}>
|
||||
<Icon name="warning" size={11} />
|
||||
<T>Needs approval</T>
|
||||
</span>
|
||||
)}
|
||||
{run.unread && (
|
||||
<span className={clsx(styles.tag, styles.tagUnread)}>
|
||||
<T>Unread</T>
|
||||
</span>
|
||||
)}
|
||||
{run.origin.kind === "scheduled" && run.origin.catchUp && (
|
||||
<span className={styles.tag}>
|
||||
<T>Catch-up</T>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{run.error && (
|
||||
<div className={styles.rowPrompt} style={{ color: "var(--danger)" }}>
|
||||
{run.error}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.rowMeta}>
|
||||
<span>{formatShortTimestamp(run.startedMs)}</span>
|
||||
<span>·</span>
|
||||
<span>{run.origin.kind === "manual" ? tx("Manual run") : tx("Scheduled run")}</span>
|
||||
{run.branch && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span className={styles.mono}>{run.branch}</span>
|
||||
</>
|
||||
)}
|
||||
{(run.added > 0 || run.removed > 0) && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span className={styles.diffAdded}>+{run.added}</span>
|
||||
<span className={styles.diffRemoved}>-{run.removed}</span>
|
||||
</>
|
||||
)}
|
||||
{run.worktreeCleaned && (
|
||||
<>
|
||||
<span>·</span>
|
||||
<span>
|
||||
<T>Zero-diff worktree cleaned</T>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles.rowActions} onClick={(e) => e.stopPropagation()}>
|
||||
{run.unread && (
|
||||
<IconButton
|
||||
icon="check"
|
||||
title="Mark as Read"
|
||||
onClick={() => void backend.markRead(run.id, null).then(() => refreshAutomations(backend))}
|
||||
/>
|
||||
)}
|
||||
{run.taskId && (
|
||||
<Button size="small" onClick={() => void handleOpenRun(run)}>
|
||||
<T>Open Session</T>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{snapshot.runsNextCursor != null && (
|
||||
<div className={styles.row} style={{ justifyContent: "center" }}>
|
||||
<Button size="small" onClick={() => void loadMoreRuns(backend)}>
|
||||
<T>Show more</T>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -770,8 +799,7 @@ export function AutomationsEditor({
|
||||
</span>
|
||||
<textarea
|
||||
aria-label={tx("Automation Markdown")}
|
||||
className={styles.promptTextarea}
|
||||
style={{ minHeight: 160, fontFamily: "var(--font-mono)" }}
|
||||
className={styles.codeTextarea}
|
||||
value={importText}
|
||||
onChange={(e) => setImportText(e.target.value)}
|
||||
placeholder={
|
||||
@@ -802,8 +830,7 @@ export function AutomationsEditor({
|
||||
<textarea
|
||||
readOnly
|
||||
aria-label={tx("Exported Automation Markdown")}
|
||||
className={styles.promptTextarea}
|
||||
style={{ minHeight: 180, fontFamily: "var(--font-mono)" }}
|
||||
className={styles.codeTextarea}
|
||||
value={exportState?.markdown ?? ""}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -4841,9 +4841,12 @@
|
||||
"Cron expression": "Cron expression",
|
||||
"One-shot": "One-shot",
|
||||
"Manual only": "Manual only",
|
||||
"Accept edits (edit workspace files without asking; ask before commands)": "Accept edits (edit workspace files without asking; ask before commands)",
|
||||
"Allow all (capped by your interactive approval setting)": "Allow all (capped by your interactive approval setting)",
|
||||
"Ask for approval (ask before edits and commands)": "Ask for approval (ask before edits and commands)",
|
||||
"Accept edits": "Accept edits",
|
||||
"Edit workspace files without asking; ask before commands": "Edit workspace files without asking; ask before commands",
|
||||
"Allow all": "Allow all",
|
||||
"Capped by your interactive approval setting": "Capped by your interactive approval setting",
|
||||
"Ask for approval": "Ask for approval",
|
||||
"Ask before edits and commands": "Ask before edits and commands",
|
||||
"Your interactive New Tasks setting is Asking for approval, so scheduled turns are capped to ask before edits and commands.": "Your interactive New Tasks setting is Asking for approval, so scheduled turns are capped to ask before edits and commands.",
|
||||
"Fresh session on each run": "Fresh session on each run",
|
||||
"Reuse rolling session": "Reuse rolling session",
|
||||
@@ -4879,7 +4882,7 @@
|
||||
"No workspace (chat only)": "No workspace (chat only)",
|
||||
"Session Continuity": "Session Continuity",
|
||||
"Checkout Isolation": "Checkout Isolation",
|
||||
"Isolated Git worktree (Recommended)": "Isolated Git worktree (Recommended)",
|
||||
"Isolated Git worktree": "Isolated Git worktree",
|
||||
"Base Branch": "Base Branch",
|
||||
"Auto-delete temporary worktree when the run makes zero file changes": "Auto-delete temporary worktree when the run makes zero file changes",
|
||||
"Schedule": "Schedule",
|
||||
|
||||
@@ -11564,9 +11564,12 @@
|
||||
"Cron expression": "Cron 表达式",
|
||||
"One-shot": "单次执行",
|
||||
"Manual only": "仅手动触发",
|
||||
"Accept edits (edit workspace files without asking; ask before commands)": "接受编辑(自动允许工作区文件编辑,执行命令前询问)",
|
||||
"Allow all (capped by your interactive approval setting)": "全部允许(上限受交互式审批设置约束)",
|
||||
"Ask for approval (ask before edits and commands)": "每次询问(编辑文件与执行命令前均询问)",
|
||||
"Accept edits": "接受编辑",
|
||||
"Edit workspace files without asking; ask before commands": "自动允许工作区文件编辑,执行命令前询问",
|
||||
"Allow all": "全部允许",
|
||||
"Capped by your interactive approval setting": "上限受交互式审批设置约束",
|
||||
"Ask for approval": "每次询问",
|
||||
"Ask before edits and commands": "编辑文件与执行命令前均询问",
|
||||
"Your interactive New Tasks setting is Asking for approval, so scheduled turns are capped to ask before edits and commands.": "当前交互式“新建任务”设置为“请求批准”,因此定时运行的权限上限也会在编辑与执行命令前询问。",
|
||||
"Fresh session on each run": "每次运行新建会话",
|
||||
"Reuse rolling session": "复用滚动会话",
|
||||
@@ -11602,7 +11605,7 @@
|
||||
"No workspace (chat only)": "无工作区(仅聊天)",
|
||||
"Session Continuity": "会话延续方式",
|
||||
"Checkout Isolation": "工作区隔离",
|
||||
"Isolated Git worktree (Recommended)": "独立 Git worktree(推荐)",
|
||||
"Isolated Git worktree": "独立 Git worktree",
|
||||
"Base Branch": "基础分支",
|
||||
"Auto-delete temporary worktree when the run makes zero file changes": "运行未产生文件改动时自动删除临时 worktree",
|
||||
"Schedule": "运行计划",
|
||||
|
||||
Reference in new issue
Заблокувати користувача