palmier 0.7.8 → 0.8.0
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 +1 -1
- package/dist/commands/run.js +55 -0
- package/dist/commands/serve.js +22 -2
- package/dist/event-queues.d.ts +36 -0
- package/dist/event-queues.js +53 -0
- package/dist/mcp-tools.d.ts +2 -0
- package/dist/mcp-tools.js +4 -2
- package/dist/platform/linux.js +11 -8
- package/dist/platform/windows.d.ts +5 -6
- package/dist/platform/windows.js +19 -13
- package/dist/pwa/assets/index-FP1Mipr6.js +120 -0
- package/dist/pwa/assets/index-bLTn8zBj.css +1 -0
- package/dist/pwa/assets/{web-BNr628AV.js → web-BpM3fNCn.js} +1 -1
- package/dist/pwa/assets/{web-DyQPewAi.js → web-CF-N8Di6.js} +1 -1
- package/dist/pwa/index.html +2 -2
- package/dist/pwa/service-worker.js +1 -1
- package/dist/rpc-handler.js +25 -9
- package/dist/task.js +1 -1
- package/dist/transports/http-transport.js +18 -5
- package/dist/types.d.ts +10 -6
- package/package.json +1 -1
- package/palmier-server/README.md +3 -3
- package/palmier-server/pwa/src/App.css +117 -36
- package/palmier-server/pwa/src/components/PullToRefreshIndicator.tsx +46 -0
- package/palmier-server/pwa/src/components/RunDetailView.tsx +58 -15
- package/palmier-server/pwa/src/components/SessionComposer.tsx +20 -10
- package/palmier-server/pwa/src/components/{RunsView.tsx → SessionsView.tsx} +33 -25
- package/palmier-server/pwa/src/components/TaskCard.tsx +33 -35
- package/palmier-server/pwa/src/components/TaskForm.tsx +274 -293
- package/palmier-server/pwa/src/components/{TaskListView.tsx → TasksView.tsx} +20 -13
- package/palmier-server/pwa/src/contexts/HostStoreContext.tsx +16 -8
- package/palmier-server/pwa/src/hooks/usePullToRefresh.ts +102 -0
- package/palmier-server/pwa/src/pages/Dashboard.tsx +9 -26
- package/palmier-server/pwa/src/types.ts +5 -9
- package/palmier-server/spec.md +23 -23
- package/src/commands/run.ts +61 -0
- package/src/commands/serve.ts +22 -2
- package/src/event-queues.ts +56 -0
- package/src/mcp-tools.ts +6 -2
- package/src/platform/linux.ts +10 -8
- package/src/platform/windows.ts +19 -13
- package/src/rpc-handler.ts +28 -11
- package/src/task.ts +1 -1
- package/src/transports/http-transport.ts +17 -5
- package/src/types.ts +10 -7
- package/dist/pwa/assets/index-8cTctVnD.js +0 -120
- package/dist/pwa/assets/index-CSUkBBsQ.css +0 -1
|
@@ -23,8 +23,9 @@ export default function TaskCard({ task, lastEvent, onEdit, onDelete, onViewRun
|
|
|
23
23
|
const menuRef = useRef<HTMLDivElement>(null);
|
|
24
24
|
|
|
25
25
|
const isRunning = lastEvent?.running_state === "started";
|
|
26
|
+
const scheduleActive = !!task.schedule_enabled && !!task.schedule_type && (task.schedule_values?.length ?? 0) > 0;
|
|
26
27
|
const stateColor =
|
|
27
|
-
!
|
|
28
|
+
!scheduleActive
|
|
28
29
|
? "var(--color-text-secondary)"
|
|
29
30
|
: isRunning
|
|
30
31
|
? "var(--color-success)"
|
|
@@ -99,34 +100,14 @@ export default function TaskCard({ task, lastEvent, onEdit, onDelete, onViewRun
|
|
|
99
100
|
};
|
|
100
101
|
|
|
101
102
|
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const classified = triggers.map(classifyTrigger);
|
|
108
|
-
const types = new Set(classified.map((c) => c.kind));
|
|
109
|
-
|
|
110
|
-
// If all the same type, group them
|
|
111
|
-
if (types.size === 1) {
|
|
112
|
-
const kind = classified[0].kind;
|
|
113
|
-
if (kind === "hourly") return "Every hour";
|
|
114
|
-
const details = classified.map((c) => c.detail);
|
|
115
|
-
return `${kind.charAt(0).toUpperCase() + kind.slice(1)}: ${details.join(", ")}`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Mixed types — fall back to listing each
|
|
119
|
-
return triggers.map(formatSingleTrigger).join(", ");
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function classifyTrigger(t: { type: string; value: string }): { kind: string; detail: string } {
|
|
123
|
-
if (t.type === "once") {
|
|
124
|
-
const d = new Date(t.value);
|
|
125
|
-
const label = isNaN(d.getTime()) ? t.value : `${d.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })} at ${d.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" })}`;
|
|
126
|
-
return { kind: "once", detail: label };
|
|
103
|
+
function classifyValue(scheduleType: "crons" | "specific_times", value: string): { kind: string; detail: string } {
|
|
104
|
+
if (scheduleType === "specific_times") {
|
|
105
|
+
const d = new Date(value);
|
|
106
|
+
const label = isNaN(d.getTime()) ? value : `${d.toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })} at ${d.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" })}`;
|
|
107
|
+
return { kind: "specific_times", detail: label };
|
|
127
108
|
}
|
|
128
|
-
const parts =
|
|
129
|
-
if (parts.length !== 5) return { kind: "unknown", detail:
|
|
109
|
+
const parts = value.split(" ");
|
|
110
|
+
if (parts.length !== 5) return { kind: "unknown", detail: value };
|
|
130
111
|
const [min, hour, dom, , dow] = parts;
|
|
131
112
|
const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
132
113
|
if (hour === "*") return { kind: "hourly", detail: "" };
|
|
@@ -138,14 +119,31 @@ export default function TaskCard({ task, lastEvent, onEdit, onDelete, onViewRun
|
|
|
138
119
|
return { kind: "daily", detail: time };
|
|
139
120
|
}
|
|
140
121
|
|
|
141
|
-
function
|
|
142
|
-
const c =
|
|
122
|
+
function formatSingleValue(scheduleType: "crons" | "specific_times", value: string): string {
|
|
123
|
+
const c = classifyValue(scheduleType, value);
|
|
143
124
|
if (c.kind === "hourly") return "Every hour";
|
|
144
|
-
if (c.kind === "
|
|
125
|
+
if (c.kind === "specific_times") return `Once on ${c.detail}`;
|
|
145
126
|
return `${c.kind.charAt(0).toUpperCase() + c.kind.slice(1)}: ${c.detail}`;
|
|
146
127
|
}
|
|
147
128
|
|
|
148
|
-
|
|
129
|
+
function formatScheduleGrouped(scheduleType: "crons" | "specific_times" | undefined, values: string[] | undefined): string {
|
|
130
|
+
if (!scheduleType || !values || values.length === 0) return "";
|
|
131
|
+
if (values.length === 1) return formatSingleValue(scheduleType, values[0]);
|
|
132
|
+
|
|
133
|
+
const classified = values.map((v) => classifyValue(scheduleType, v));
|
|
134
|
+
const kinds = new Set(classified.map((c) => c.kind));
|
|
135
|
+
|
|
136
|
+
if (kinds.size === 1) {
|
|
137
|
+
const kind = classified[0].kind;
|
|
138
|
+
if (kind === "hourly") return "Every hour";
|
|
139
|
+
const details = classified.map((c) => c.detail);
|
|
140
|
+
return `${kind.charAt(0).toUpperCase() + kind.slice(1)}: ${details.join(", ")}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return values.map((v) => formatSingleValue(scheduleType, v)).join(", ");
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const scheduleText = formatScheduleGrouped(task.schedule_type, task.schedule_values);
|
|
149
147
|
|
|
150
148
|
const actionItems = (
|
|
151
149
|
<>
|
|
@@ -174,7 +172,7 @@ export default function TaskCard({ task, lastEvent, onEdit, onDelete, onViewRun
|
|
|
174
172
|
|
|
175
173
|
return (
|
|
176
174
|
<>
|
|
177
|
-
<div className="task-card" onClick={() =>
|
|
175
|
+
<div className="task-card" onClick={() => onViewRun(task.id, "latest")}>
|
|
178
176
|
<div className="task-card-header">
|
|
179
177
|
<div className="task-card-title-row">
|
|
180
178
|
{isRunning ? (
|
|
@@ -216,9 +214,9 @@ export default function TaskCard({ task, lastEvent, onEdit, onDelete, onViewRun
|
|
|
216
214
|
{" "}{formatTime(lastEvent.time_stamp)}
|
|
217
215
|
</span>
|
|
218
216
|
)}
|
|
219
|
-
{task.
|
|
217
|
+
{task.schedule_type && (task.schedule_values?.length ?? 0) > 0 && (
|
|
220
218
|
<span className="task-card-triggers">
|
|
221
|
-
{task.
|
|
219
|
+
{task.schedule_enabled ? scheduleText : "Schedule disabled"}
|
|
222
220
|
</span>
|
|
223
221
|
)}
|
|
224
222
|
</div>
|