palmier 0.9.6 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -13
- package/dist/agents/agent.d.ts +0 -1
- package/dist/agents/agent.js +0 -1
- package/dist/agents/aider.d.ts +0 -1
- package/dist/agents/aider.js +0 -1
- package/dist/agents/claude.d.ts +0 -1
- package/dist/agents/claude.js +0 -1
- package/dist/agents/cline.d.ts +0 -1
- package/dist/agents/cline.js +0 -1
- package/dist/agents/codex.d.ts +0 -1
- package/dist/agents/codex.js +0 -1
- package/dist/agents/copilot.d.ts +0 -1
- package/dist/agents/copilot.js +0 -1
- package/dist/agents/cursor.d.ts +0 -1
- package/dist/agents/cursor.js +0 -1
- package/dist/agents/deepagents.d.ts +0 -1
- package/dist/agents/deepagents.js +0 -1
- package/dist/agents/droid.d.ts +0 -1
- package/dist/agents/droid.js +0 -1
- package/dist/agents/gemini.d.ts +0 -1
- package/dist/agents/gemini.js +0 -1
- package/dist/agents/goose.d.ts +0 -1
- package/dist/agents/goose.js +0 -1
- package/dist/agents/hermes.d.ts +0 -1
- package/dist/agents/hermes.js +0 -1
- package/dist/agents/kimi.d.ts +0 -1
- package/dist/agents/kimi.js +0 -1
- package/dist/agents/kiro.d.ts +0 -1
- package/dist/agents/kiro.js +0 -1
- package/dist/agents/openclaw.d.ts +0 -1
- package/dist/agents/openclaw.js +0 -1
- package/dist/agents/opencode.d.ts +0 -1
- package/dist/agents/opencode.js +0 -1
- package/dist/agents/qoder.d.ts +0 -1
- package/dist/agents/qoder.js +0 -1
- package/dist/agents/qwen.d.ts +0 -1
- package/dist/agents/qwen.js +0 -1
- package/dist/agents/shared-prompt.d.ts +0 -1
- package/dist/agents/shared-prompt.js +0 -1
- package/dist/client-store.d.ts +0 -1
- package/dist/client-store.js +0 -1
- package/dist/commands/clients.d.ts +0 -1
- package/dist/commands/clients.js +0 -1
- package/dist/commands/info.d.ts +0 -1
- package/dist/commands/info.js +0 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +1 -2
- package/dist/commands/pair.d.ts +0 -1
- package/dist/commands/pair.js +0 -1
- package/dist/commands/restart.d.ts +0 -1
- package/dist/commands/restart.js +0 -1
- package/dist/commands/run.d.ts +0 -1
- package/dist/commands/run.js +19 -3
- package/dist/commands/serve.d.ts +0 -1
- package/dist/commands/serve.js +0 -1
- package/dist/commands/uninstall.d.ts +0 -1
- package/dist/commands/uninstall.js +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/event-queues.d.ts +0 -1
- package/dist/event-queues.js +0 -1
- package/dist/events.d.ts +0 -1
- package/dist/events.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/linked-device.d.ts +0 -1
- package/dist/linked-device.js +0 -1
- package/dist/mcp-handler.d.ts +0 -1
- package/dist/mcp-handler.js +0 -1
- package/dist/mcp-tools.d.ts +0 -1
- package/dist/mcp-tools.js +0 -1
- package/dist/nats-client.d.ts +0 -1
- package/dist/nats-client.js +0 -1
- package/dist/network.d.ts +0 -1
- package/dist/network.js +0 -1
- package/dist/notification-store.d.ts +0 -1
- package/dist/notification-store.js +0 -1
- package/dist/pending-requests.d.ts +0 -1
- package/dist/pending-requests.js +0 -1
- package/dist/platform/index.d.ts +0 -1
- package/dist/platform/index.js +0 -1
- package/dist/platform/linux.d.ts +0 -1
- package/dist/platform/linux.js +0 -1
- package/dist/platform/macos.d.ts +0 -1
- package/dist/platform/macos.js +0 -1
- package/dist/platform/platform.d.ts +0 -1
- package/dist/platform/platform.js +0 -1
- package/dist/platform/windows.d.ts +0 -1
- package/dist/platform/windows.js +0 -1
- package/dist/pwa/assets/{index-MLEFUP3r.js → index-DWvRAUiy.js} +31 -31
- package/dist/pwa/assets/{web-B1sKCc7e.js → web-C4iZbqTC.js} +1 -1
- package/dist/pwa/assets/{web-ETD-8ZHd.js → web-CBFqJGX6.js} +1 -1
- package/dist/pwa/assets/{web-B4xEa6WO.js → web-DL4uXOpS.js} +1 -1
- package/dist/pwa/index.html +2 -2
- package/dist/rpc-handler.d.ts +0 -1
- package/dist/rpc-handler.js +0 -1
- package/dist/sms-store.d.ts +0 -1
- package/dist/sms-store.js +0 -1
- package/dist/spawn-command.d.ts +0 -1
- package/dist/spawn-command.js +0 -1
- package/dist/task.d.ts +0 -1
- package/dist/task.js +0 -1
- package/dist/transports/http-transport.d.ts +0 -1
- package/dist/transports/http-transport.js +0 -1
- package/dist/transports/nats-transport.d.ts +0 -1
- package/dist/transports/nats-transport.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/dist/update-checker.d.ts +0 -1
- package/dist/update-checker.js +0 -1
- package/package.json +11 -1
- package/.github/workflows/ci.yml +0 -16
- package/.github/workflows/publish.yml +0 -37
- package/CLAUDE.md +0 -22
- package/dist/pwa/apple-touch-icon.png +0 -0
- package/dist/pwa/manifest.webmanifest +0 -1
- package/dist/pwa/pwa-192x192.png +0 -0
- package/dist/pwa/pwa-512x512.png +0 -0
- package/dist/pwa/registerSW.js +0 -1
- package/dist/pwa/service-worker.js +0 -2
- package/palmier-server/.github/workflows/ci.yml +0 -21
- package/palmier-server/.github/workflows/deploy.yml +0 -38
- package/palmier-server/CLAUDE.md +0 -17
- package/palmier-server/PRODUCTION.md +0 -358
- package/palmier-server/README.md +0 -231
- package/palmier-server/nats.conf +0 -19
- package/palmier-server/package.json +0 -15
- package/palmier-server/pnpm-lock.yaml +0 -7639
- package/palmier-server/pnpm-workspace.yaml +0 -3
- package/palmier-server/pwa/index.html +0 -16
- package/palmier-server/pwa/logo/logo_20260421.png +0 -0
- package/palmier-server/pwa/package.json +0 -34
- package/palmier-server/pwa/public/apple-touch-icon.png +0 -0
- package/palmier-server/pwa/public/favicon.ico +0 -0
- package/palmier-server/pwa/public/pwa-192x192.png +0 -0
- package/palmier-server/pwa/public/pwa-512x512.png +0 -0
- package/palmier-server/pwa/src/App.css +0 -3012
- package/palmier-server/pwa/src/App.tsx +0 -59
- package/palmier-server/pwa/src/agentLabels.ts +0 -11
- package/palmier-server/pwa/src/api.ts +0 -67
- package/palmier-server/pwa/src/components/CapabilityToggles.tsx +0 -170
- package/palmier-server/pwa/src/components/ConnectionStatusIcon.tsx +0 -113
- package/palmier-server/pwa/src/components/HostMenu.tsx +0 -429
- package/palmier-server/pwa/src/components/PermissionsDialog.tsx +0 -34
- package/palmier-server/pwa/src/components/PullToRefreshIndicator.tsx +0 -46
- package/palmier-server/pwa/src/components/RunDetailView.tsx +0 -343
- package/palmier-server/pwa/src/components/SessionComposer.tsx +0 -157
- package/palmier-server/pwa/src/components/SessionsView.tsx +0 -326
- package/palmier-server/pwa/src/components/SwipeToDeleteRow.tsx +0 -170
- package/palmier-server/pwa/src/components/TabBar.tsx +0 -40
- package/palmier-server/pwa/src/components/TaskCard.tsx +0 -255
- package/palmier-server/pwa/src/components/TaskForm.tsx +0 -766
- package/palmier-server/pwa/src/components/TasksView.tsx +0 -179
- package/palmier-server/pwa/src/constants.ts +0 -2
- package/palmier-server/pwa/src/contexts/HostConnectionContext.tsx +0 -432
- package/palmier-server/pwa/src/contexts/HostStoreContext.tsx +0 -124
- package/palmier-server/pwa/src/draftGuard.ts +0 -24
- package/palmier-server/pwa/src/formatTime.ts +0 -44
- package/palmier-server/pwa/src/hooks/useBackClose.ts +0 -75
- package/palmier-server/pwa/src/hooks/useMediaQuery.ts +0 -17
- package/palmier-server/pwa/src/hooks/usePullToRefresh.ts +0 -102
- package/palmier-server/pwa/src/hooks/usePushSubscription.ts +0 -77
- package/palmier-server/pwa/src/main.tsx +0 -14
- package/palmier-server/pwa/src/native/Device.ts +0 -49
- package/palmier-server/pwa/src/pages/Dashboard.tsx +0 -542
- package/palmier-server/pwa/src/pages/PairHost.tsx +0 -232
- package/palmier-server/pwa/src/pages/PairSetup.tsx +0 -134
- package/palmier-server/pwa/src/service-worker.ts +0 -142
- package/palmier-server/pwa/src/types.ts +0 -75
- package/palmier-server/pwa/src/vite-env.d.ts +0 -11
- package/palmier-server/pwa/tsconfig.json +0 -21
- package/palmier-server/pwa/tsconfig.node.json +0 -19
- package/palmier-server/pwa/vite.config.ts +0 -47
- package/palmier-server/server/.env.example +0 -20
- package/palmier-server/server/package.json +0 -36
- package/palmier-server/server/src/db.ts +0 -44
- package/palmier-server/server/src/fcm.ts +0 -74
- package/palmier-server/server/src/index.ts +0 -688
- package/palmier-server/server/src/nats-jwt.ts +0 -299
- package/palmier-server/server/src/nats-setup.ts +0 -48
- package/palmier-server/server/src/nats.ts +0 -33
- package/palmier-server/server/src/notify.ts +0 -34
- package/palmier-server/server/src/push.ts +0 -68
- package/palmier-server/server/src/routes/device.ts +0 -224
- package/palmier-server/server/src/routes/fcm.ts +0 -64
- package/palmier-server/server/src/routes/hosts.ts +0 -56
- package/palmier-server/server/src/routes/push.ts +0 -101
- package/palmier-server/server/tsconfig.json +0 -20
- package/palmier-server/spec.md +0 -533
- package/src/agents/agent-instructions.md +0 -28
- package/src/agents/agent.ts +0 -114
- package/src/agents/aider.ts +0 -35
- package/src/agents/claude.ts +0 -39
- package/src/agents/cline.ts +0 -35
- package/src/agents/codex.ts +0 -40
- package/src/agents/copilot.ts +0 -37
- package/src/agents/cursor.ts +0 -36
- package/src/agents/deepagents.ts +0 -36
- package/src/agents/droid.ts +0 -35
- package/src/agents/gemini.ts +0 -43
- package/src/agents/goose.ts +0 -33
- package/src/agents/hermes.ts +0 -36
- package/src/agents/kimi.ts +0 -35
- package/src/agents/kiro.ts +0 -36
- package/src/agents/openclaw.ts +0 -29
- package/src/agents/opencode.ts +0 -36
- package/src/agents/qoder.ts +0 -36
- package/src/agents/qwen.ts +0 -32
- package/src/agents/shared-prompt.ts +0 -30
- package/src/client-store.ts +0 -68
- package/src/commands/clients.ts +0 -29
- package/src/commands/info.ts +0 -29
- package/src/commands/init.ts +0 -165
- package/src/commands/pair.ts +0 -137
- package/src/commands/restart.ts +0 -6
- package/src/commands/run.ts +0 -608
- package/src/commands/serve.ts +0 -211
- package/src/commands/uninstall.ts +0 -9
- package/src/config.ts +0 -36
- package/src/cross-spawn.d.ts +0 -5
- package/src/event-queues.ts +0 -41
- package/src/events.ts +0 -29
- package/src/index.ts +0 -111
- package/src/linked-device.ts +0 -52
- package/src/mcp-handler.ts +0 -200
- package/src/mcp-tools.ts +0 -839
- package/src/nats-client.ts +0 -19
- package/src/network.ts +0 -96
- package/src/notification-store.ts +0 -30
- package/src/pending-requests.ts +0 -73
- package/src/platform/index.ts +0 -20
- package/src/platform/linux.ts +0 -296
- package/src/platform/macos.ts +0 -329
- package/src/platform/platform.ts +0 -31
- package/src/platform/windows.ts +0 -299
- package/src/rpc-handler.ts +0 -691
- package/src/sms-store.ts +0 -28
- package/src/spawn-command.ts +0 -123
- package/src/task.ts +0 -343
- package/src/transports/http-transport.ts +0 -478
- package/src/transports/nats-transport.ts +0 -76
- package/src/types.ts +0 -89
- package/src/update-checker.ts +0 -40
- package/test/agent-instructions.test.ts +0 -209
- package/test/agent-output-parsing.test.ts +0 -74
- package/test/linux-cron.test.ts +0 -41
- package/test/macos-plist.test.ts +0 -112
- package/test/notification-store.test.ts +0 -57
- package/test/pairing.test.ts +0 -35
- package/test/result-state.test.ts +0 -110
- package/test/task-parsing.test.ts +0 -82
- package/test/taskrun-messages.test.ts +0 -224
- package/test/tsconfig.json +0 -9
- package/test/windows-xml.test.ts +0 -89
- package/tsconfig.json +0 -19
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, useEffect } from "react";
|
|
2
|
-
import { createPortal } from "react-dom";
|
|
3
|
-
import { useHostConnection } from "../contexts/HostConnectionContext";
|
|
4
|
-
import { useFormatTime } from "../formatTime";
|
|
5
|
-
import { getAgentLabel } from "../agentLabels";
|
|
6
|
-
import type { Task, TaskStatus } from "../types";
|
|
7
|
-
|
|
8
|
-
const isMobile = () => window.matchMedia("(max-width: 600px)").matches;
|
|
9
|
-
|
|
10
|
-
interface TaskCardProps {
|
|
11
|
-
task: Task;
|
|
12
|
-
lastEvent?: TaskStatus;
|
|
13
|
-
onEdit(task: Task): void;
|
|
14
|
-
onDelete(taskId: string): void;
|
|
15
|
-
onViewRun(taskId: string, runId?: string): void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default function TaskCard({ task, lastEvent, onEdit, onDelete, onViewRun }: TaskCardProps) {
|
|
19
|
-
const { request, activeHost } = useHostConnection();
|
|
20
|
-
const formatTime = useFormatTime();
|
|
21
|
-
const timeZone = activeHost.timezone;
|
|
22
|
-
const [aborting, setAborting] = useState(false);
|
|
23
|
-
const [menuOpen, setMenuOpen] = useState(false);
|
|
24
|
-
const [sheetOpen, setSheetOpen] = useState(false);
|
|
25
|
-
const menuRef = useRef<HTMLDivElement>(null);
|
|
26
|
-
|
|
27
|
-
const isRunning = lastEvent?.running_state === "started";
|
|
28
|
-
const hasScheduleValues = (task.schedule_values?.length ?? 0) > 0;
|
|
29
|
-
const isEventSchedule = task.schedule_type === "on_new_notification" || task.schedule_type === "on_new_sms";
|
|
30
|
-
const scheduleActive = !!task.schedule_enabled && !!task.schedule_type && (hasScheduleValues || isEventSchedule);
|
|
31
|
-
const stateColor =
|
|
32
|
-
!scheduleActive
|
|
33
|
-
? "var(--color-text-secondary)"
|
|
34
|
-
: isRunning
|
|
35
|
-
? "var(--color-success)"
|
|
36
|
-
: lastEvent?.running_state === "failed"
|
|
37
|
-
? "var(--color-error)"
|
|
38
|
-
: "var(--color-success)";
|
|
39
|
-
|
|
40
|
-
// Close dropdown on outside click
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
if (!menuOpen) return;
|
|
43
|
-
function handleClick(e: MouseEvent) {
|
|
44
|
-
if (menuRef.current && !menuRef.current.contains(e.target as Node)) {
|
|
45
|
-
setMenuOpen(false);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
document.addEventListener("mousedown", handleClick);
|
|
49
|
-
return () => document.removeEventListener("mousedown", handleClick);
|
|
50
|
-
}, [menuOpen]);
|
|
51
|
-
|
|
52
|
-
function openMenu() {
|
|
53
|
-
if (isMobile()) {
|
|
54
|
-
setSheetOpen(true);
|
|
55
|
-
} else {
|
|
56
|
-
setMenuOpen((v) => !v);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function closeMenu() {
|
|
61
|
-
setMenuOpen(false);
|
|
62
|
-
setSheetOpen(false);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async function handleAbort() {
|
|
66
|
-
closeMenu();
|
|
67
|
-
if (!confirm("Abort this task?")) return;
|
|
68
|
-
setAborting(true);
|
|
69
|
-
try {
|
|
70
|
-
await request("task.abort", { id: task.id });
|
|
71
|
-
} catch (err) {
|
|
72
|
-
console.error("Abort failed:", err);
|
|
73
|
-
} finally {
|
|
74
|
-
setAborting(false);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async function handleRunNow() {
|
|
79
|
-
closeMenu();
|
|
80
|
-
try {
|
|
81
|
-
const result = await request<{ ok?: boolean; task_id?: string; run_id?: string }>("task.run", { id: task.id });
|
|
82
|
-
onViewRun(task.id, result.run_id);
|
|
83
|
-
} catch (err) {
|
|
84
|
-
console.error("Run failed:", err);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async function handleDelete() {
|
|
89
|
-
closeMenu();
|
|
90
|
-
if (!confirm("Delete this task? Results and reports will be kept.")) return;
|
|
91
|
-
try {
|
|
92
|
-
await request("task.delete", { id: task.id });
|
|
93
|
-
onDelete(task.id);
|
|
94
|
-
} catch (err) {
|
|
95
|
-
console.error("Delete failed:", err);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const eventLabel: Record<string, string> = {
|
|
100
|
-
started: "Started",
|
|
101
|
-
finished: "Finished",
|
|
102
|
-
aborted: "Aborted",
|
|
103
|
-
failed: "Failed",
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
function classifyValue(scheduleType: "crons" | "specific_times", value: string): { kind: string; detail: string } {
|
|
108
|
-
if (scheduleType === "specific_times") {
|
|
109
|
-
const d = new Date(value);
|
|
110
|
-
const label = isNaN(d.getTime())
|
|
111
|
-
? value
|
|
112
|
-
: `${d.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric", timeZone })} at ${d.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit", timeZone })}`;
|
|
113
|
-
return { kind: "specific_times", detail: label };
|
|
114
|
-
}
|
|
115
|
-
const parts = value.split(" ");
|
|
116
|
-
if (parts.length !== 5) return { kind: "unknown", detail: value };
|
|
117
|
-
const [min, hour, dom, , dow] = parts;
|
|
118
|
-
const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
119
|
-
if (hour === "*") return { kind: "hourly", detail: "" };
|
|
120
|
-
// Cron HH:MM is in the host's wall clock. Format directly — no Date
|
|
121
|
-
// conversion — to avoid implicit shifting through the viewer's local zone.
|
|
122
|
-
const h = Number(hour);
|
|
123
|
-
const m = Number(min);
|
|
124
|
-
const hour12 = h === 0 ? 12 : h > 12 ? h - 12 : h;
|
|
125
|
-
const ampm = h >= 12 ? "PM" : "AM";
|
|
126
|
-
const time = `${hour12}:${String(m).padStart(2, "0")} ${ampm}`;
|
|
127
|
-
if (dow !== "*") return { kind: "weekly", detail: `${DAYS[Number(dow)] ?? dow} at ${time}` };
|
|
128
|
-
if (dom !== "*") return { kind: "monthly", detail: `day ${dom} at ${time}` };
|
|
129
|
-
return { kind: "daily", detail: time };
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function formatSingleValue(scheduleType: "crons" | "specific_times", value: string): string {
|
|
133
|
-
const c = classifyValue(scheduleType, value);
|
|
134
|
-
if (c.kind === "hourly") return "Every hour";
|
|
135
|
-
if (c.kind === "specific_times") return `Once on ${c.detail}`;
|
|
136
|
-
return `${c.kind.charAt(0).toUpperCase() + c.kind.slice(1)}: ${c.detail}`;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function formatScheduleGrouped(
|
|
140
|
-
scheduleType: "crons" | "specific_times" | "on_new_notification" | "on_new_sms" | undefined,
|
|
141
|
-
values: string[] | undefined,
|
|
142
|
-
): string {
|
|
143
|
-
if (!scheduleType) return "";
|
|
144
|
-
if (scheduleType === "on_new_notification") return "On new notification";
|
|
145
|
-
if (scheduleType === "on_new_sms") return "On new SMS";
|
|
146
|
-
if (!values || values.length === 0) return "";
|
|
147
|
-
if (values.length === 1) return formatSingleValue(scheduleType, values[0]);
|
|
148
|
-
|
|
149
|
-
const classified = values.map((v) => classifyValue(scheduleType, v));
|
|
150
|
-
const kinds = new Set(classified.map((c) => c.kind));
|
|
151
|
-
|
|
152
|
-
if (kinds.size === 1) {
|
|
153
|
-
const kind = classified[0].kind;
|
|
154
|
-
if (kind === "hourly") return "Every hour";
|
|
155
|
-
const details = classified.map((c) => c.detail);
|
|
156
|
-
return `${kind.charAt(0).toUpperCase() + kind.slice(1)}: ${details.join(", ")}`;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return values.map((v) => formatSingleValue(scheduleType, v)).join(", ");
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const scheduleText = formatScheduleGrouped(task.schedule_type, task.schedule_values);
|
|
163
|
-
|
|
164
|
-
const actionItems = (
|
|
165
|
-
<>
|
|
166
|
-
<button onClick={() => { closeMenu(); onEdit(task); }}>
|
|
167
|
-
<span className="menu-icon">✎</span>Edit
|
|
168
|
-
</button>
|
|
169
|
-
<button onClick={() => { closeMenu(); onViewRun(task.id); }}>
|
|
170
|
-
<span className="menu-icon">📄</span>View All Runs
|
|
171
|
-
</button>
|
|
172
|
-
{isRunning ? (
|
|
173
|
-
<button className="menu-item-danger" onClick={handleAbort} disabled={aborting}>
|
|
174
|
-
<span className="menu-icon">◼</span>Abort
|
|
175
|
-
</button>
|
|
176
|
-
) : (
|
|
177
|
-
<>
|
|
178
|
-
<button onClick={handleRunNow}>
|
|
179
|
-
<span className="menu-icon">▶</span>Run Now
|
|
180
|
-
</button>
|
|
181
|
-
<button className="menu-item-danger" onClick={handleDelete}>
|
|
182
|
-
<span className="menu-icon">🗑</span>Delete
|
|
183
|
-
</button>
|
|
184
|
-
</>
|
|
185
|
-
)}
|
|
186
|
-
</>
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<>
|
|
191
|
-
<div className="task-card" onClick={() => onViewRun(task.id, "latest")}>
|
|
192
|
-
<div className="task-card-header">
|
|
193
|
-
<div className="task-card-title-row">
|
|
194
|
-
{isRunning ? (
|
|
195
|
-
<span className="status-spinner">
|
|
196
|
-
<span />
|
|
197
|
-
</span>
|
|
198
|
-
) : (
|
|
199
|
-
<span
|
|
200
|
-
className="status-dot"
|
|
201
|
-
style={{ backgroundColor: stateColor }}
|
|
202
|
-
/>
|
|
203
|
-
)}
|
|
204
|
-
<h3 className="task-card-name">{task.name || task.user_prompt}</h3>
|
|
205
|
-
</div>
|
|
206
|
-
<div className="task-card-actions" onClick={(e) => e.stopPropagation()}>
|
|
207
|
-
<div className="task-card-menu" ref={menuRef}>
|
|
208
|
-
<button
|
|
209
|
-
className="task-card-menu-btn"
|
|
210
|
-
onClick={openMenu}
|
|
211
|
-
aria-label="Task actions"
|
|
212
|
-
>
|
|
213
|
-
⋮
|
|
214
|
-
</button>
|
|
215
|
-
{menuOpen && (
|
|
216
|
-
<div className="task-card-menu-dropdown">
|
|
217
|
-
{actionItems}
|
|
218
|
-
</div>
|
|
219
|
-
)}
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
<div className="task-card-meta">
|
|
224
|
-
{task.agent && (
|
|
225
|
-
<span className="task-card-agent">{getAgentLabel(task.agent)}</span>
|
|
226
|
-
)}
|
|
227
|
-
{lastEvent && eventLabel[lastEvent.running_state] && (
|
|
228
|
-
<span className="task-card-last-event">
|
|
229
|
-
{eventLabel[lastEvent.running_state]}
|
|
230
|
-
{" "}{formatTime(lastEvent.time_stamp)}
|
|
231
|
-
</span>
|
|
232
|
-
)}
|
|
233
|
-
{task.schedule_type && (hasScheduleValues || isEventSchedule) && (
|
|
234
|
-
<span className="task-card-triggers">
|
|
235
|
-
{task.schedule_enabled ? scheduleText : "Schedule disabled"}
|
|
236
|
-
</span>
|
|
237
|
-
)}
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
|
|
241
|
-
{sheetOpen && createPortal(
|
|
242
|
-
<div className="bottom-sheet-overlay" onClick={() => setSheetOpen(false)}>
|
|
243
|
-
<div className="bottom-sheet" onClick={(e) => e.stopPropagation()}>
|
|
244
|
-
<div className="bottom-sheet-handle" />
|
|
245
|
-
<div className="bottom-sheet-title">{task.name || task.user_prompt}</div>
|
|
246
|
-
<div className="bottom-sheet-actions">
|
|
247
|
-
{actionItems}
|
|
248
|
-
</div>
|
|
249
|
-
</div>
|
|
250
|
-
</div>,
|
|
251
|
-
document.body,
|
|
252
|
-
)}
|
|
253
|
-
</>
|
|
254
|
-
);
|
|
255
|
-
}
|