@openagt/skill-scheduler 0.1.10 → 0.1.12
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/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -10
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/dashboard.js +552 -551
- package/dist/names.d.ts +2 -0
- package/dist/names.d.ts.map +1 -1
- package/dist/names.js +2 -0
- package/dist/names.js.map +1 -1
- package/dist/schedule.d.ts +30 -15
- package/dist/schedule.d.ts.map +1 -1
- package/dist/schedule.js +33 -22
- package/dist/schedule.js.map +1 -1
- package/dist/scheduler.js +1 -1
- package/dist/scheduler.js.map +1 -1
- package/dist/state.d.ts +2 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/tick.d.ts +11 -8
- package/dist/tick.d.ts.map +1 -1
- package/dist/tick.js +59 -36
- package/dist/tick.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createElement as e, forwardRef as t, useEffect as n, useId as r, useRef as i, useState as a } from "react";
|
|
2
|
-
import { Button as o, Card as s, CardContent as c, CardHeader as l, CardTitleLink as u, Input as d, Label as f, MAX_SPEND_OFFSET as p, RadioGroup as m, RadioGroupItem as h, RadioGroupOption as g, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as b, SelectValue as x, SettingsRow as S, SettingsSection as C, Switch as w, Textarea as T, Tooltip as E, TooltipContent as D, TooltipTrigger as O, buttonVariants as k, cn as A, defineModule as j, formatAge as ee, formatDateTime as te, useCodingAgents as ne, useModuleHost as
|
|
3
|
-
import { Fragment as
|
|
2
|
+
import { Button as o, Card as s, CardContent as c, CardHeader as l, CardTitleLink as u, Input as d, Label as f, MAX_SPEND_OFFSET as p, RadioGroup as m, RadioGroupItem as h, RadioGroupOption as g, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as b, SelectValue as x, SettingsRow as S, SettingsSection as C, Switch as w, Textarea as T, Tooltip as E, TooltipContent as D, TooltipTrigger as O, buttonVariants as k, cn as A, defineModule as j, formatAge as ee, formatDateTime as te, useCodingAgents as ne, useModuleHost as M, usePolled as re } from "@openagt/dashboard/module";
|
|
3
|
+
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
4
4
|
//#region ../../node_modules/.pnpm/lucide-react@0.469.0_react@19.2.7/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
5
|
-
var
|
|
5
|
+
var I = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), L = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), R = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: 24,
|
|
8
8
|
height: 24,
|
|
@@ -12,20 +12,20 @@ var F = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), I = (...e
|
|
|
12
12
|
strokeWidth: 2,
|
|
13
13
|
strokeLinecap: "round",
|
|
14
14
|
strokeLinejoin: "round"
|
|
15
|
-
},
|
|
15
|
+
}, ie = t(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: i, className: a = "", children: o, iconNode: s, ...c }, l) => e("svg", {
|
|
16
16
|
ref: l,
|
|
17
|
-
...
|
|
17
|
+
...R,
|
|
18
18
|
width: n,
|
|
19
19
|
height: n,
|
|
20
20
|
stroke: t,
|
|
21
21
|
strokeWidth: i ? Number(r) * 24 / Number(n) : r,
|
|
22
|
-
className:
|
|
22
|
+
className: L("lucide", a),
|
|
23
23
|
...c
|
|
24
|
-
}, [...s.map(([t, n]) => e(t, n)), ...Array.isArray(o) ? o : [o]])),
|
|
25
|
-
let i = t(({ className: t, ...i }, a) => e(
|
|
24
|
+
}, [...s.map(([t, n]) => e(t, n)), ...Array.isArray(o) ? o : [o]])), z = ((n, r) => {
|
|
25
|
+
let i = t(({ className: t, ...i }, a) => e(ie, {
|
|
26
26
|
ref: a,
|
|
27
27
|
iconNode: r,
|
|
28
|
-
className:
|
|
28
|
+
className: L(`lucide-${I(n)}`, t),
|
|
29
29
|
...i
|
|
30
30
|
}));
|
|
31
31
|
return i.displayName = `${n}`, i;
|
|
@@ -56,37 +56,37 @@ var F = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), I = (...e
|
|
|
56
56
|
r: "6",
|
|
57
57
|
key: "qoo3c4"
|
|
58
58
|
}]
|
|
59
|
-
]),
|
|
60
|
-
function
|
|
61
|
-
return
|
|
59
|
+
]), ae = ".scheduler/automations", B = ["claude-code", "codex"];
|
|
60
|
+
function V(e) {
|
|
61
|
+
return B.includes(e);
|
|
62
62
|
}
|
|
63
|
-
var
|
|
63
|
+
var H = {
|
|
64
64
|
"claude-code": "Claude Code",
|
|
65
65
|
codex: "Codex"
|
|
66
|
-
},
|
|
66
|
+
}, U = {
|
|
67
67
|
"claude-code": ".claude/skills",
|
|
68
68
|
codex: ".agents/skills"
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
function
|
|
69
|
+
}, W = "claude-code";
|
|
70
|
+
U[W];
|
|
71
|
+
var G = "commit";
|
|
72
|
+
function oe(e) {
|
|
73
73
|
return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 99;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function se(e) {
|
|
76
76
|
return typeof e == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(e) && !Number.isNaN(Date.parse(e));
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ce(e) {
|
|
79
79
|
return /^[a-z0-9][a-z0-9-]*$/.test(e) && !e.includes("---");
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/pace.ts
|
|
83
|
-
var
|
|
83
|
+
var le = [
|
|
84
84
|
"m",
|
|
85
85
|
"h",
|
|
86
86
|
"d",
|
|
87
87
|
"w",
|
|
88
88
|
"mo"
|
|
89
|
-
],
|
|
89
|
+
], ue = {
|
|
90
90
|
d: 1,
|
|
91
91
|
w: 7,
|
|
92
92
|
mo: 30
|
|
@@ -109,7 +109,7 @@ function q(e) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
function pe(e) {
|
|
112
|
-
return
|
|
112
|
+
return ue[e.unit] !== void 0;
|
|
113
113
|
}
|
|
114
114
|
function me(e) {
|
|
115
115
|
let t = /^(\d{1,2}):(\d{2})$/.exec(e), n = Number(t?.[1]), r = Number(t?.[2]);
|
|
@@ -138,7 +138,7 @@ function ge(e, t, n) {
|
|
|
138
138
|
if (!e.at) return t ? new Date(t.getTime() + e.every.ms) : /* @__PURE__ */ new Date(0);
|
|
139
139
|
let { hour: r, minute: i } = e.at, a = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t, r, i), o = e.since !== void 0 && !Number.isNaN(Date.parse(e.since)) ? new Date(e.since) : void 0, s = o && (a(o, 0).getTime() >= o.getTime() ? a(o, 0) : a(o, 1));
|
|
140
140
|
if (!t) return s ?? a(n, 0);
|
|
141
|
-
let c = a(t, e.every.count *
|
|
141
|
+
let c = a(t, e.every.count * ue[e.every.unit]);
|
|
142
142
|
return s && s.getTime() > c.getTime() ? s : c;
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
@@ -163,15 +163,13 @@ function be(e, t, n = J(e)) {
|
|
|
163
163
|
function xe(e, t, n) {
|
|
164
164
|
return e.find((e) => e.value === t)?.models.find((e) => e.value === n)?.label ?? n;
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
function Ce(e, t, n) {
|
|
168
|
-
if (e.resumes) return Se;
|
|
166
|
+
function Se(e, t, n) {
|
|
169
167
|
let r = J(e), i = be(e, t, r);
|
|
170
|
-
return i === void 0 ?
|
|
168
|
+
return i === void 0 ? H[r] : `${H[r]}, ${xe(n, r, i)}`;
|
|
171
169
|
}
|
|
172
|
-
function
|
|
170
|
+
function Ce(e) {
|
|
173
171
|
let t = X(e);
|
|
174
|
-
if (!(typeof t.id != "string" || t.id === "" || !
|
|
172
|
+
if (!(typeof t.id != "string" || t.id === "" || !se(t.at))) return {
|
|
175
173
|
id: t.id,
|
|
176
174
|
at: t.at,
|
|
177
175
|
...t.failed === !0 ? { failed: !0 } : {}
|
|
@@ -180,24 +178,24 @@ function we(e) {
|
|
|
180
178
|
function Y(e) {
|
|
181
179
|
return e.editable === !0 || e.onThisMachine === !0;
|
|
182
180
|
}
|
|
183
|
-
function
|
|
181
|
+
function we(e) {
|
|
184
182
|
return e.onThisMachine ? e.command : `/${e.command}`;
|
|
185
183
|
}
|
|
186
|
-
function
|
|
184
|
+
function Te(e) {
|
|
187
185
|
return e.own ? `The automation ${e.skill}, kept on this machine, is not listed: ${e.reason}` : `The schedule of the ${e.skill} skill cannot be read, so it is not listed: ${e.reason}`;
|
|
188
186
|
}
|
|
189
|
-
function
|
|
187
|
+
function Ee(e) {
|
|
190
188
|
return ye.includes(e);
|
|
191
189
|
}
|
|
192
|
-
function
|
|
190
|
+
function De(e) {
|
|
193
191
|
let t = X(e);
|
|
194
192
|
return t.work === !0 || typeof t.every == "string" && q(t.every) !== void 0;
|
|
195
193
|
}
|
|
196
194
|
function X(e) {
|
|
197
195
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
198
196
|
}
|
|
199
|
-
var
|
|
200
|
-
function
|
|
197
|
+
var Oe = "unreadable schedule: ", ke = "unlisted automation: ";
|
|
198
|
+
function Ae(e, t) {
|
|
201
199
|
let n = X(t), r = X(n.lastTick), i = X(n.switches), a = X(n.publishes), o = X(n.paces), s = X(n.agents), c = X(n.runsOn), l = X(n.models), u = [];
|
|
202
200
|
for (let e of Array.isArray(r.decisions) ? r.decisions : []) {
|
|
203
201
|
let t = X(e);
|
|
@@ -211,31 +209,31 @@ function je(e, t) {
|
|
|
211
209
|
for (let e of Array.isArray(n.schedule) ? n.schedule : []) {
|
|
212
210
|
let t = X(e), n = t.command;
|
|
213
211
|
if (typeof n != "string") continue;
|
|
214
|
-
let r = a[n], f =
|
|
212
|
+
let r = a[n], f = V(t.agent) ? t.agent : W, p = V(c[n]) ? c[n] : f, m = X(l[n]), h = u.find((e) => e.command === n && !e.outcome.startsWith(Oe) && !e.outcome.startsWith(ke));
|
|
215
213
|
d.push({
|
|
216
214
|
command: n,
|
|
217
215
|
...typeof t.every == "string" ? { every: t.every } : {},
|
|
218
216
|
...typeof t.when == "string" ? { when: t.when } : {},
|
|
219
217
|
...typeof t.waitsFor == "string" ? { waitsFor: t.waitsFor } : {},
|
|
220
218
|
...typeof t.checkEvery == "string" ? { checkEvery: t.checkEvery } : {},
|
|
221
|
-
on:
|
|
222
|
-
publish:
|
|
223
|
-
...
|
|
224
|
-
...
|
|
225
|
-
...
|
|
219
|
+
on: se(i[n]),
|
|
220
|
+
publish: Ee(r) ? r : G,
|
|
221
|
+
...De(o[n]) ? { pace: o[n] } : {},
|
|
222
|
+
...oe(t.agents) && t.agents > 1 ? { skillAgents: t.agents } : {},
|
|
223
|
+
...oe(s[n]) ? { agents: s[n] } : {},
|
|
226
224
|
home: f,
|
|
227
225
|
...typeof t.model == "string" && t.model !== "" ? {
|
|
228
226
|
skillModel: t.model,
|
|
229
|
-
skillModelAgent:
|
|
227
|
+
skillModelAgent: V(t.modelAgent) ? t.modelAgent : W
|
|
230
228
|
} : {},
|
|
231
|
-
able: Array.isArray(t.able) ?
|
|
229
|
+
able: Array.isArray(t.able) ? B.filter((e) => t.able.includes(e)) : B,
|
|
232
230
|
...p === f ? {} : { runsOn: p },
|
|
233
231
|
...m.agent === p && typeof m.model == "string" && m.model.trim() !== "" ? { model: m.model } : {},
|
|
234
232
|
...typeof t.description == "string" ? { description: t.description } : {},
|
|
235
|
-
...t.
|
|
233
|
+
...t.each === !0 ? { each: !0 } : {},
|
|
236
234
|
...t.onThisMachine === !0 ? { onThisMachine: !0 } : {},
|
|
237
235
|
...t.editable === !0 ? { editable: !0 } : {},
|
|
238
|
-
...
|
|
236
|
+
...Ce(t.lastRun) ? { lastRun: Ce(t.lastRun) } : {},
|
|
239
237
|
...h ? { decision: h } : {}
|
|
240
238
|
});
|
|
241
239
|
}
|
|
@@ -263,10 +261,10 @@ function je(e, t) {
|
|
|
263
261
|
})
|
|
264
262
|
};
|
|
265
263
|
}
|
|
266
|
-
function
|
|
264
|
+
function je(e, t) {
|
|
267
265
|
return Promise.all(t.map(async (t) => {
|
|
268
266
|
let n = await e.runCommand(t.id, ["status"]);
|
|
269
|
-
return n.ok ?
|
|
267
|
+
return n.ok ? Ae(t, n.output) : {
|
|
270
268
|
project: t,
|
|
271
269
|
error: n.error,
|
|
272
270
|
on: !1,
|
|
@@ -277,21 +275,21 @@ function Me(e, t) {
|
|
|
277
275
|
};
|
|
278
276
|
}));
|
|
279
277
|
}
|
|
280
|
-
function
|
|
278
|
+
function Me(e) {
|
|
281
279
|
let t = e.flatMap((e) => e.spendOffset === void 0 ? [] : [e.spendOffset]);
|
|
282
280
|
return t.length ? Math.max(...t) : void 0;
|
|
283
281
|
}
|
|
284
|
-
function
|
|
285
|
-
let t =
|
|
282
|
+
function Ne(e) {
|
|
283
|
+
let t = Me(e);
|
|
286
284
|
return e.flatMap((e) => e.spendOffset !== void 0 && e.spendOffset !== t ? [{
|
|
287
285
|
name: e.project.name,
|
|
288
286
|
offset: Math.round(e.spendOffset * 10) / 10
|
|
289
287
|
}] : []);
|
|
290
288
|
}
|
|
291
|
-
function
|
|
289
|
+
function Pe(e) {
|
|
292
290
|
if (!(e.trim() === "" || !Number.isFinite(Number(e)))) return Math.min(Math.max(Math.round(Number(e)), -p), p);
|
|
293
291
|
}
|
|
294
|
-
async function
|
|
292
|
+
async function Fe(e, t, n) {
|
|
295
293
|
let r = (await Promise.all(t.map(async (t) => ({
|
|
296
294
|
project: t,
|
|
297
295
|
answer: await e.runCommand(t.id, [
|
|
@@ -305,7 +303,7 @@ async function Ie(e, t, n) {
|
|
|
305
303
|
error: r.join("; ")
|
|
306
304
|
} : { ok: !0 };
|
|
307
305
|
}
|
|
308
|
-
function
|
|
306
|
+
function Ie(e, t) {
|
|
309
307
|
let n = e ? ye : [
|
|
310
308
|
"nothing",
|
|
311
309
|
"commit",
|
|
@@ -313,29 +311,29 @@ function Le(e, t) {
|
|
|
313
311
|
];
|
|
314
312
|
return n.includes(t) ? n : [...n, t];
|
|
315
313
|
}
|
|
316
|
-
var
|
|
314
|
+
var Le = {
|
|
317
315
|
m: "minute",
|
|
318
316
|
h: "hour",
|
|
319
317
|
d: "day",
|
|
320
318
|
w: "week",
|
|
321
319
|
mo: "month"
|
|
322
320
|
};
|
|
323
|
-
function
|
|
321
|
+
function Re(e) {
|
|
324
322
|
let t = q(e);
|
|
325
|
-
return t ? `${t.count} ${
|
|
323
|
+
return t ? `${t.count} ${Le[t.unit]}${t.count === 1 ? "" : "s"}` : e;
|
|
326
324
|
}
|
|
327
|
-
var
|
|
328
|
-
function
|
|
325
|
+
var ze = (e) => e.charAt(0).toUpperCase() + e.slice(1);
|
|
326
|
+
function Be(e) {
|
|
329
327
|
let t = e.waitsFor ?? "when its shell line prints something", n = e.every === void 0 ? void 0 : q(e.every), r = he(e.pace, {
|
|
330
328
|
...n ? { every: n } : {},
|
|
331
329
|
...e.when === void 0 ? {} : { when: e.when }
|
|
332
|
-
}), i = r ?
|
|
333
|
-
return i === void 0 ?
|
|
330
|
+
}), i = r ? Re(r.every.text) : e.pace === void 0 && e.every !== void 0 ? e.every : void 0;
|
|
331
|
+
return i === void 0 ? ze(t) : e.when === void 0 ? r?.at ? `Every ${i} at ${r.at.text}` : `Every ${i}` : r?.at ? `Every ${i} from ${r.at.text}, ${t}` : `Every ${i} at most, ${t}`;
|
|
334
332
|
}
|
|
335
|
-
function
|
|
336
|
-
return
|
|
333
|
+
function Ve(e) {
|
|
334
|
+
return He(e).kind !== "skill";
|
|
337
335
|
}
|
|
338
|
-
function
|
|
336
|
+
function He(e) {
|
|
339
337
|
let t = e.pace;
|
|
340
338
|
if (t === void 0) return { kind: "skill" };
|
|
341
339
|
if ("work" in t && t.work === !0) return e.when !== void 0 && e.every !== void 0 ? { kind: "work" } : { kind: "skill" };
|
|
@@ -359,10 +357,10 @@ function Z(e) {
|
|
|
359
357
|
let n = me(e.at.trim());
|
|
360
358
|
return n ? [t.text, n.text] : void 0;
|
|
361
359
|
}
|
|
362
|
-
function
|
|
360
|
+
function Ue(e) {
|
|
363
361
|
if (!Z(e)) return e.kind === "every" && !(/^\d+$/.test(e.count.trim()) && q(`${e.count.trim()}${e.unit}`)) ? `Type a whole number, from 1 to ${fe}.` : "Finish the time, like 10:00, or clear it.";
|
|
364
362
|
}
|
|
365
|
-
function
|
|
363
|
+
function We(e, t) {
|
|
366
364
|
let n = Z(t);
|
|
367
365
|
if (!n) return e;
|
|
368
366
|
let { pace: r, ...i } = e;
|
|
@@ -375,84 +373,83 @@ function Ge(e, t) {
|
|
|
375
373
|
}
|
|
376
374
|
};
|
|
377
375
|
}
|
|
378
|
-
function
|
|
376
|
+
function Ge(e) {
|
|
379
377
|
return e.agents ?? e.skillAgents ?? 1;
|
|
380
378
|
}
|
|
381
|
-
function
|
|
382
|
-
return
|
|
379
|
+
function Ke(e) {
|
|
380
|
+
return Ge(e) > 1 || e.agents !== void 0;
|
|
383
381
|
}
|
|
384
|
-
function
|
|
382
|
+
function qe(e) {
|
|
385
383
|
return e === 1 ? "One at a time" : `Up to ${e} at once`;
|
|
386
384
|
}
|
|
387
|
-
function
|
|
385
|
+
function Je(e) {
|
|
388
386
|
return e.agents === void 0 ? { kind: "skill" } : {
|
|
389
387
|
kind: "own",
|
|
390
388
|
count: String(e.agents)
|
|
391
389
|
};
|
|
392
390
|
}
|
|
393
|
-
function
|
|
391
|
+
function Ye(e) {
|
|
394
392
|
if (e.kind === "skill") return ["skill"];
|
|
395
393
|
let t = e.count.trim();
|
|
396
|
-
return /^\d+$/.test(t) &&
|
|
394
|
+
return /^\d+$/.test(t) && oe(Number(t)) ? [String(Number(t))] : void 0;
|
|
397
395
|
}
|
|
398
|
-
function
|
|
396
|
+
function Xe(e) {
|
|
399
397
|
return e.publish === "commit" ? "May commit, pushes nothing" : e.publish === "branch" ? "May publish its branch" : e.publish === "pr" ? "May open a pull request" : e.publish === "merge" ? "May open a pull request that merges on green" : Y(e) ? "As its prompt says" : "As its skill says";
|
|
400
398
|
}
|
|
401
|
-
function
|
|
402
|
-
let n =
|
|
399
|
+
function Ze(e, t = /* @__PURE__ */ new Date()) {
|
|
400
|
+
let n = $e(e);
|
|
403
401
|
if (n) return n;
|
|
404
|
-
if (!(!e.on || e.decision?.outcome.startsWith("not a command of "))) return
|
|
402
|
+
if (!(!e.on || e.decision?.outcome.startsWith("not a command of "))) return Qe(e, t) ?? tt(e.decision?.outcome);
|
|
405
403
|
}
|
|
406
|
-
function
|
|
404
|
+
function Qe(e, t) {
|
|
407
405
|
let n = e.decision?.outcome;
|
|
408
406
|
if (n === void 0 || !/^not due \((last start|next start from) /.test(n)) return;
|
|
409
407
|
let r = /^not due \(next start from (\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d),/.exec(n), i = r && new Date(Number(r[1]), Number(r[2]) - 1, Number(r[3]), Number(r[4]), Number(r[5]));
|
|
410
|
-
return i && i.getTime() > t.getTime() ? `Next start ${
|
|
408
|
+
return i && i.getTime() > t.getTime() ? `Next start ${ct(i, t)}${e.when === void 0 ? "" : ", if there is work"}` : rt(e, t);
|
|
411
409
|
}
|
|
412
|
-
function
|
|
413
|
-
if (e.resumes) return;
|
|
410
|
+
function $e(e) {
|
|
414
411
|
let t = J(e);
|
|
415
|
-
return e.able.includes(t) ? void 0 :
|
|
412
|
+
return e.able.includes(t) ? void 0 : et(H[t], U[t]);
|
|
416
413
|
}
|
|
417
|
-
var
|
|
418
|
-
function
|
|
414
|
+
var et = (e, t) => `Cannot start on ${e}: its skill is not in ${t}`;
|
|
415
|
+
function tt(e) {
|
|
419
416
|
if (e === void 0 || e === "switched off on this machine" || e.startsWith("started ") || e.startsWith("resumed ")) return;
|
|
420
|
-
let t = /^run \S+ not resumed: (.*)$/.exec(e);
|
|
421
|
-
if (t) return
|
|
417
|
+
let t = /^(?:run \S+ not resumed|no run for \S+): (.*)$/.exec(e);
|
|
418
|
+
if (t) return tt(t[1]);
|
|
422
419
|
let n = /^not a command of (.+?): its skill is only under .+, not (\S+)$/.exec(e);
|
|
423
|
-
if (n) return
|
|
420
|
+
if (n) return et(n[1], n[2]);
|
|
424
421
|
if (e === "not due") return "No work";
|
|
425
422
|
let r = /^not on (\S+?)( as this clone last saw it)?: /.exec(e);
|
|
426
423
|
if (r) return r[1] === "HEAD" ? "Cannot start yet: its skill is not committed" : `Cannot start yet: its skill is not on ${r[1]}${r[2] ? ", as this machine last saw it" : ""}`;
|
|
427
424
|
let i = /^cap reached \((\d+) in flight/.exec(e);
|
|
428
|
-
return i ? i[1] === "1" ? "One is already running" : `${i[1]} are already running` :
|
|
425
|
+
return i ? i[1] === "1" ? "One is already running" : `${i[1]} are already running` : ze(e);
|
|
429
426
|
}
|
|
430
|
-
function
|
|
427
|
+
function nt(e) {
|
|
431
428
|
let t = Math.max(1, Math.ceil(e / 6e4));
|
|
432
429
|
if (t < 60) return `${t} min`;
|
|
433
430
|
let n = Math.round(t / 60);
|
|
434
431
|
return n < 48 ? `${n}h` : `${Math.round(n / 24)} days`;
|
|
435
432
|
}
|
|
436
|
-
function
|
|
433
|
+
function rt(e, t = /* @__PURE__ */ new Date()) {
|
|
437
434
|
let n = e.when !== void 0, r = n ? "Starts when there is work" : "Starts at the scheduler's next look", i = e.every === void 0 ? void 0 : q(e.every), a = he(e.pace, {
|
|
438
435
|
...i ? { every: i } : {},
|
|
439
436
|
...e.when === void 0 ? {} : { when: e.when }
|
|
440
437
|
});
|
|
441
438
|
if (!a) return r;
|
|
442
439
|
let o = ge(a, e.lastRun === void 0 ? void 0 : new Date(e.lastRun.at), t);
|
|
443
|
-
return o.getTime() <= t.getTime() ? r : `Next start ${a.at ?
|
|
440
|
+
return o.getTime() <= t.getTime() ? r : `Next start ${a.at ? ct(o, t) : `in ${nt(o.getTime() - t.getTime())}`}${n ? ", if there is work" : ""}`;
|
|
444
441
|
}
|
|
445
|
-
function
|
|
446
|
-
let n =
|
|
442
|
+
function it(e, t = /* @__PURE__ */ new Date()) {
|
|
443
|
+
let n = $e(e);
|
|
447
444
|
if (n) return n;
|
|
448
445
|
let r = e.decision?.outcome;
|
|
449
|
-
return (r === void 0 || r === "not due" || r.startsWith("not due (") || r.startsWith("started ") || r === "switched off on this machine" ? void 0 :
|
|
446
|
+
return (r === void 0 || r === "not due" || r.startsWith("not due (") || r.startsWith("started ") || r === "switched off on this machine" ? void 0 : Ze(e, t)) ?? rt(e, t);
|
|
450
447
|
}
|
|
451
|
-
function
|
|
448
|
+
function at(e) {
|
|
452
449
|
if (!e.on) return "The scheduler is off";
|
|
453
450
|
if (!e.running) return "The scheduler is on, but not running";
|
|
454
451
|
}
|
|
455
|
-
var
|
|
452
|
+
var ot = [
|
|
456
453
|
"Sunday",
|
|
457
454
|
"Monday",
|
|
458
455
|
"Tuesday",
|
|
@@ -460,7 +457,7 @@ var st = [
|
|
|
460
457
|
"Thursday",
|
|
461
458
|
"Friday",
|
|
462
459
|
"Saturday"
|
|
463
|
-
],
|
|
460
|
+
], st = [
|
|
464
461
|
"Jan",
|
|
465
462
|
"Feb",
|
|
466
463
|
"Mar",
|
|
@@ -474,13 +471,13 @@ var st = [
|
|
|
474
471
|
"Nov",
|
|
475
472
|
"Dec"
|
|
476
473
|
];
|
|
477
|
-
function
|
|
474
|
+
function ct(e, t) {
|
|
478
475
|
let n = (e) => String(e).padStart(2, "0");
|
|
479
476
|
if (e.getTime() <= t.getTime()) return "as soon as the scheduler looks";
|
|
480
477
|
let r = `${n(e.getHours())}:${n(e.getMinutes())}`, i = Math.round((new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime() - new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime()) / 864e5);
|
|
481
|
-
return i === 0 ? `today ${r}` : i === 1 ? `tomorrow ${r}` : i > 1 && i < 7 ? `${
|
|
478
|
+
return i === 0 ? `today ${r}` : i === 1 ? `tomorrow ${r}` : i > 1 && i < 7 ? `${ot[e.getDay()]} ${r}` : `${e.getDate()} ${st[e.getMonth()]} ${r}`;
|
|
482
479
|
}
|
|
483
|
-
function
|
|
480
|
+
function lt(e) {
|
|
484
481
|
return e.error === void 0 ? e.on ? e.running ? {
|
|
485
482
|
label: "on",
|
|
486
483
|
tone: "text-success"
|
|
@@ -497,7 +494,7 @@ function ut(e) {
|
|
|
497
494
|
}
|
|
498
495
|
//#endregion
|
|
499
496
|
//#region dashboard/automation-form.ts
|
|
500
|
-
var
|
|
497
|
+
var ut = 4e3, dt = {
|
|
501
498
|
name: "",
|
|
502
499
|
prompt: "",
|
|
503
500
|
when: "",
|
|
@@ -510,10 +507,10 @@ var dt = 4e3, ft = {
|
|
|
510
507
|
},
|
|
511
508
|
onThisMachine: !1
|
|
512
509
|
};
|
|
513
|
-
function
|
|
510
|
+
function ft(e) {
|
|
514
511
|
return e.pace.kind === "every" ? Z(e.pace)?.[0] : void 0;
|
|
515
512
|
}
|
|
516
|
-
function
|
|
513
|
+
function pt(e) {
|
|
517
514
|
let t = typeof e == "object" && e ? e : {}, { name: n, prompt: r, every: i, when: a, waitsFor: o, file: s } = t;
|
|
518
515
|
if (typeof n != "string" || typeof r != "string" || typeof s != "string") return;
|
|
519
516
|
let c = i === void 0 ? void 0 : typeof i == "string" ? q(i) : void 0;
|
|
@@ -535,42 +532,42 @@ function mt(e) {
|
|
|
535
532
|
...typeof t.version == "string" ? { version: t.version } : {}
|
|
536
533
|
};
|
|
537
534
|
}
|
|
538
|
-
function
|
|
539
|
-
let n =
|
|
535
|
+
function mt(e, t) {
|
|
536
|
+
let n = He(t);
|
|
540
537
|
return n.kind === "skill" ? e : {
|
|
541
538
|
...e,
|
|
542
539
|
pace: n
|
|
543
540
|
};
|
|
544
541
|
}
|
|
545
|
-
function
|
|
542
|
+
function ht(e, t) {
|
|
546
543
|
let n = e.name.trim();
|
|
547
|
-
return n === "" ? e.onThisMachine ? "Give it a name, like answer-comments." : "Give it a name. It becomes the command, like /answer-comments." :
|
|
544
|
+
return n === "" ? e.onThisMachine ? "Give it a name, like answer-comments." : "Give it a name. It becomes the command, like /answer-comments." : ce(n) ? n.length > 64 ? "A name is 64 characters at most." : e.prompt.trim() === "" ? "Write what the agent is told." : e.prompt.trim().length > 4e3 ? `What the agent is told is ${e.prompt.trim().length} characters, and this form takes ${ut} at most. ${t === void 0 ? "Save a shorter one, then write the rest into the file." : `Change it in its file, ${t}.`}` : e.when.trim().length > 4e3 ? `The shell line is ${e.when.trim().length} characters, and this form takes ${ut} at most.` : e.when.trim() !== "" && e.waitsFor.trim().length > 4e3 ? `What the line waits for is ${e.waitsFor.trim().length} characters, and this form takes ${ut} at most.` : e.pace.kind === "work" && e.when.trim() === "" ? "Say when it runs: on a pace, by a shell line, or both." : Ue(e.pace) : "A name is lower-case letters, digits and dashes, never three dashes in a row, like answer-comments.";
|
|
548
545
|
}
|
|
549
|
-
function
|
|
550
|
-
if (
|
|
546
|
+
function gt(e) {
|
|
547
|
+
if (ht(e) === void 0) return [
|
|
551
548
|
"add",
|
|
552
|
-
...
|
|
549
|
+
...yt(e),
|
|
553
550
|
...e.onThisMachine ? ["--private"] : []
|
|
554
551
|
];
|
|
555
552
|
}
|
|
556
|
-
function
|
|
557
|
-
if (
|
|
553
|
+
function _t(e, t) {
|
|
554
|
+
if (ht(e, t) !== void 0) return;
|
|
558
555
|
let n = e.when.trim();
|
|
559
556
|
return [
|
|
560
557
|
"edit",
|
|
561
558
|
e.name.trim(),
|
|
562
559
|
`--prompt=${e.prompt.trim()}`,
|
|
563
|
-
`--every=${
|
|
560
|
+
`--every=${ft(e) ?? ""}`,
|
|
564
561
|
`--when=${n}`,
|
|
565
562
|
`--waits-for=${n === "" ? "" : e.waitsFor.trim()}`
|
|
566
563
|
];
|
|
567
564
|
}
|
|
568
|
-
function
|
|
565
|
+
function vt(e) {
|
|
569
566
|
let t = Z(e.pace);
|
|
570
567
|
if (t) return e.pace.kind === "every" && t[1] !== void 0 ? t : ["skill"];
|
|
571
568
|
}
|
|
572
|
-
function
|
|
573
|
-
let t =
|
|
569
|
+
function yt(e) {
|
|
570
|
+
let t = ft(e), n = e.when.trim(), r = e.waitsFor.trim();
|
|
574
571
|
return [
|
|
575
572
|
e.name.trim(),
|
|
576
573
|
`--prompt=${e.prompt.trim()}`,
|
|
@@ -579,19 +576,19 @@ function bt(e) {
|
|
|
579
576
|
...n !== "" && r !== "" ? [`--waits-for=${r}`] : []
|
|
580
577
|
];
|
|
581
578
|
}
|
|
582
|
-
function
|
|
583
|
-
return
|
|
579
|
+
function bt(e, t) {
|
|
580
|
+
return yt(e).join("\0") === yt(t).join("\0");
|
|
584
581
|
}
|
|
585
|
-
function
|
|
586
|
-
let t = Z(e.pace), n =
|
|
582
|
+
function xt(e) {
|
|
583
|
+
let t = Z(e.pace), n = ft(e), r = e.when.trim();
|
|
587
584
|
if (!t || n === void 0 && r === "") return;
|
|
588
585
|
let i = e.waitsFor.trim();
|
|
589
586
|
return {
|
|
590
587
|
command: e.name.trim(),
|
|
591
588
|
on: !1,
|
|
592
589
|
publish: "commit",
|
|
593
|
-
home:
|
|
594
|
-
able:
|
|
590
|
+
home: W,
|
|
591
|
+
able: B,
|
|
595
592
|
...n === void 0 ? {} : { every: n },
|
|
596
593
|
...r === "" ? {} : {
|
|
597
594
|
when: r,
|
|
@@ -604,14 +601,14 @@ function St(e) {
|
|
|
604
601
|
} } : {}
|
|
605
602
|
};
|
|
606
603
|
}
|
|
607
|
-
function
|
|
608
|
-
let t =
|
|
609
|
-
return t &&
|
|
604
|
+
function St(e) {
|
|
605
|
+
let t = xt(e);
|
|
606
|
+
return t && Be(t);
|
|
610
607
|
}
|
|
611
|
-
function
|
|
608
|
+
function Ct(e) {
|
|
612
609
|
return e.name === "" && e.prompt === "" && e.when === "" && e.waitsFor === "";
|
|
613
610
|
}
|
|
614
|
-
function
|
|
611
|
+
function wt(e) {
|
|
615
612
|
let t = typeof e == "object" && e ? e : {}, n = typeof t.printed == "string" ? t.printed : "", r = typeof t.lastRun == "string" ? { lastRun: t.lastRun } : {};
|
|
616
613
|
return t.ran === !0 ? t.due === !0 ? {
|
|
617
614
|
...r,
|
|
@@ -630,11 +627,11 @@ function Tt(e) {
|
|
|
630
627
|
tone: "failed"
|
|
631
628
|
};
|
|
632
629
|
}
|
|
633
|
-
function
|
|
630
|
+
function Tt(e) {
|
|
634
631
|
let t = typeof e == "object" && e ? e : {};
|
|
635
632
|
return typeof t.line == "string" && t.line !== "" ? { line: t.line } : { said: typeof t.none == "string" ? `No line can do that: ${t.none}` : "The line was not written." };
|
|
636
633
|
}
|
|
637
|
-
function
|
|
634
|
+
function Et(e) {
|
|
638
635
|
let t = typeof e == "object" && e ? e : {};
|
|
639
636
|
return {
|
|
640
637
|
file: typeof t.file == "string" ? t.file : "a skill file",
|
|
@@ -643,44 +640,44 @@ function Dt(e) {
|
|
|
643
640
|
...typeof t.version == "string" ? { version: t.version } : {}
|
|
644
641
|
};
|
|
645
642
|
}
|
|
646
|
-
function
|
|
647
|
-
return e.onThisMachine ? "It is kept on this machine alone: nothing to commit, and nobody else gets the row. Its row can start as soon as you switch it on. Its prompt is in the record of each run, which is shared where this project shares its records." : `It is a file of yours, in this project, and nothing was committed for you. ${
|
|
643
|
+
function Dt(e) {
|
|
644
|
+
return e.onThisMachine ? "It is kept on this machine alone: nothing to commit, and nobody else gets the row. Its row can start as soon as you switch it on. Its prompt is in the record of each run, which is shared where this project shares its records." : `It is a file of yours, in this project, and nothing was committed for you. ${Nt(e.startsFrom)}`;
|
|
648
645
|
}
|
|
649
|
-
function
|
|
646
|
+
function Ot(e) {
|
|
650
647
|
return `It is a change to a file of yours, in this project, and nothing was committed for you. An agent is told the new words only ${e.startsFrom === "HEAD" ? "once you commit the change" : `once the change is on ${e.startsFrom}: commit it and bring it there`}. The pace and the shell line are read from your file, so the scheduler uses the new ones from its next look. Its past runs, its switch and your picks for it stay.`;
|
|
651
648
|
}
|
|
652
|
-
function
|
|
649
|
+
function kt(e) {
|
|
653
650
|
return e ? e.draft.onThisMachine ? `Kept on this machine alone, outside git: ${e.file}.` : `Its words and its pace are in a skill file of this project, ${e.file}: a change to them is yours to commit. The rest is saved on this machine.` : "Saved for you, in this project, on this machine. No tracked file changes.";
|
|
654
651
|
}
|
|
655
|
-
function
|
|
652
|
+
function At(e) {
|
|
656
653
|
let t = "Its switch and your picks for it go with it. The records of its past runs stay.";
|
|
657
654
|
return e.onThisMachine ? `Its file is deleted. It is kept on this machine alone, outside git, so it cannot be brought back. ${t}` : `Its skill file is deleted from your files in this project, and nothing is committed for you. Git can bring back only what you committed of it: a file never committed, or your last changes to it, cannot be brought back. Everyone else who has the project keeps the row until your deletion reaches them. ${t}`;
|
|
658
655
|
}
|
|
659
|
-
function
|
|
656
|
+
function jt(e, t) {
|
|
660
657
|
let n = typeof t == "object" && t ? t : {}, r = typeof n.file == "string" ? n.file : "its file", i = typeof n.startsFrom == "string" ? n.startsFrom : "HEAD";
|
|
661
658
|
return n.onThisMachine === !0 ? `Removed ${e}: ${r} is deleted. Nothing is to commit.` : n.git === "committed" ? `Removed ${e}: ${r} is deleted, and nothing was committed for you. ${i === "HEAD" ? "Commit the deletion." : `Commit the deletion and bring it to ${i}: until then everyone else who has the project keeps the row.`}` : n.git === "staged" ? `Removed ${e}: ${r} is deleted. It was staged and never committed, so a commit made now would still add it: take it out of the next commit with "git rm --cached ${r}".` : n.git === "nothing" ? `Removed ${e}: ${r} is deleted. Git never had the file, so nothing is to commit.` : `Removed ${e}: ${r} is deleted. What git holds of it could not be read: look with "git status".`;
|
|
662
659
|
}
|
|
663
|
-
function
|
|
660
|
+
function Mt(e) {
|
|
664
661
|
return e.onThisMachine ? "Kept on this machine alone, outside git. The row starts switched off, and can start as soon as you switch it on." : "Saved as a skill file in this project, which you commit. The row starts switched off.";
|
|
665
662
|
}
|
|
666
|
-
function
|
|
663
|
+
function Nt(e) {
|
|
667
664
|
return e === "HEAD" ? "Its row cannot start before you commit the file." : `Its row cannot start before the file is on ${e}: commit it and bring it there.`;
|
|
668
665
|
}
|
|
669
666
|
//#endregion
|
|
670
667
|
//#region dashboard/fields.tsx
|
|
671
|
-
var Q = "text-xs text-muted-foreground",
|
|
668
|
+
var Q = "text-xs text-muted-foreground", Pt = (e) => /[.!?]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`;
|
|
672
669
|
function $({ title: e, children: t }) {
|
|
673
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ F("section", {
|
|
674
671
|
"aria-label": e,
|
|
675
672
|
className: "space-y-2",
|
|
676
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
677
674
|
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
678
675
|
children: e
|
|
679
676
|
}), t]
|
|
680
677
|
});
|
|
681
678
|
}
|
|
682
|
-
function
|
|
683
|
-
let c =
|
|
679
|
+
function Ft({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
680
|
+
let c = M(), [l, u] = a(), [p, m] = a(), h = i(0), g = i(0), _ = t.when.trim(), v = t.waitsFor.trim(), y = (e) => {
|
|
684
681
|
s({ when: e }), h.current++, u(void 0);
|
|
685
682
|
}, b = async () => {
|
|
686
683
|
let t = ++h.current;
|
|
@@ -689,7 +686,7 @@ function It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
|
689
686
|
ok: !1,
|
|
690
687
|
error: e instanceof Error ? e.message : String(e)
|
|
691
688
|
}));
|
|
692
|
-
h.current === t && u(n.ok ?
|
|
689
|
+
h.current === t && u(n.ok ? wt(n.output) : {
|
|
693
690
|
printed: "",
|
|
694
691
|
verdict: `The line could not be tried: ${n.error}`,
|
|
695
692
|
tone: "failed"
|
|
@@ -706,15 +703,15 @@ function It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
|
706
703
|
error: e instanceof Error ? e.message : String(e)
|
|
707
704
|
}));
|
|
708
705
|
if (g.current !== t) return;
|
|
709
|
-
let i = r.ok ?
|
|
706
|
+
let i = r.ok ? Tt(r.output) : { said: `The line was not written: ${r.error}` };
|
|
710
707
|
"line" in i && y(i.line), m("said" in i ? i.said : void 0);
|
|
711
708
|
};
|
|
712
|
-
return /* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ F(N, { children: [
|
|
710
|
+
/* @__PURE__ */ P(f, {
|
|
714
711
|
htmlFor: "automation-prompt",
|
|
715
712
|
children: "What the agent is told"
|
|
716
713
|
}),
|
|
717
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ P(T, {
|
|
718
715
|
id: "automation-prompt",
|
|
719
716
|
rows: 4,
|
|
720
717
|
autoFocus: r,
|
|
@@ -722,15 +719,15 @@ function It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
|
722
719
|
onChange: (e) => s({ prompt: e.target.value }),
|
|
723
720
|
placeholder: "Answer each new comment below."
|
|
724
721
|
}),
|
|
725
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ F(f, {
|
|
726
723
|
htmlFor: "automation-waits-for",
|
|
727
724
|
className: "pt-1",
|
|
728
|
-
children: ["What the line waits for, in plain words ", /* @__PURE__ */
|
|
725
|
+
children: ["What the line waits for, in plain words ", /* @__PURE__ */ P("span", {
|
|
729
726
|
className: Q,
|
|
730
727
|
children: "optional, said on the row"
|
|
731
728
|
})]
|
|
732
729
|
}),
|
|
733
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ P(d, {
|
|
734
731
|
id: "automation-waits-for",
|
|
735
732
|
type: "text",
|
|
736
733
|
value: t.waitsFor,
|
|
@@ -740,38 +737,38 @@ function It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
|
740
737
|
placeholder: "when someone commented",
|
|
741
738
|
className: "bg-background"
|
|
742
739
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
740
|
+
/* @__PURE__ */ F("div", {
|
|
744
741
|
className: "flex flex-wrap items-center gap-3",
|
|
745
|
-
children: [/* @__PURE__ */
|
|
742
|
+
children: [/* @__PURE__ */ P(o, {
|
|
746
743
|
variant: "outline",
|
|
747
744
|
size: "sm",
|
|
748
745
|
disabled: v === "" || p === "writing",
|
|
749
746
|
onClick: () => void x(),
|
|
750
747
|
children: p === "writing" ? "Writing…" : "Write the line"
|
|
751
|
-
}), /* @__PURE__ */
|
|
748
|
+
}), /* @__PURE__ */ F("span", {
|
|
752
749
|
className: Q,
|
|
753
750
|
children: [
|
|
754
751
|
"Asks ",
|
|
755
|
-
|
|
752
|
+
H[n],
|
|
756
753
|
" once for a shell line from these words, and puts it below; costs a fraction of a cent. Nothing is run or saved."
|
|
757
754
|
]
|
|
758
755
|
})]
|
|
759
756
|
}),
|
|
760
|
-
p !== void 0 && p !== "writing" && /* @__PURE__ */
|
|
757
|
+
p !== void 0 && p !== "writing" && /* @__PURE__ */ P("p", {
|
|
761
758
|
role: "status",
|
|
762
759
|
"aria-label": "What the agent answered",
|
|
763
760
|
className: "text-sm text-danger",
|
|
764
761
|
children: p
|
|
765
762
|
}),
|
|
766
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ F(f, {
|
|
767
764
|
htmlFor: "automation-when",
|
|
768
765
|
className: "pt-1",
|
|
769
|
-
children: ["A shell line that prints what is new ", /* @__PURE__ */
|
|
766
|
+
children: ["A shell line that prints what is new ", /* @__PURE__ */ P("span", {
|
|
770
767
|
className: Q,
|
|
771
768
|
children: "optional"
|
|
772
769
|
})]
|
|
773
770
|
}),
|
|
774
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ P(T, {
|
|
775
772
|
id: "automation-when",
|
|
776
773
|
rows: 2,
|
|
777
774
|
value: t.when,
|
|
@@ -782,45 +779,45 @@ function It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
|
782
779
|
spellCheck: !1,
|
|
783
780
|
className: "min-h-12 font-mono text-xs"
|
|
784
781
|
}),
|
|
785
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ F("p", {
|
|
786
783
|
className: Q,
|
|
787
784
|
children: [
|
|
788
785
|
"Run in this project while the row is on: every minute, or once its wait is over. When it prints something, an agent starts and is handed what it printed; when it prints nothing, or an empty list, nothing starts.",
|
|
789
786
|
" ",
|
|
790
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ P("span", {
|
|
791
788
|
className: "font-mono",
|
|
792
789
|
children: "$LAST_RUN"
|
|
793
790
|
}),
|
|
794
791
|
" is the time the row last started an agent, or was switched on when that is later."
|
|
795
792
|
]
|
|
796
793
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ F("div", {
|
|
798
795
|
className: "flex flex-wrap items-center gap-3",
|
|
799
|
-
children: [/* @__PURE__ */
|
|
796
|
+
children: [/* @__PURE__ */ P(o, {
|
|
800
797
|
variant: "outline",
|
|
801
798
|
size: "sm",
|
|
802
799
|
disabled: _ === "" || l === "trying",
|
|
803
800
|
onClick: () => void b(),
|
|
804
801
|
children: l === "trying" ? "Trying…" : "Try it"
|
|
805
|
-
}), /* @__PURE__ */
|
|
802
|
+
}), /* @__PURE__ */ P("span", {
|
|
806
803
|
className: Q,
|
|
807
804
|
children: "Runs the line once, now, on this machine, for 20 seconds at most. Nothing is saved and no agent starts."
|
|
808
805
|
})]
|
|
809
806
|
}),
|
|
810
|
-
l !== void 0 && l !== "trying" && /* @__PURE__ */
|
|
807
|
+
l !== void 0 && l !== "trying" && /* @__PURE__ */ F("div", {
|
|
811
808
|
role: "status",
|
|
812
809
|
"aria-label": "What the line answered",
|
|
813
810
|
className: "rounded-md border border-border bg-background px-3 py-2 text-sm",
|
|
814
811
|
children: [
|
|
815
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ P("p", {
|
|
816
813
|
className: A(l.tone === "start" && "text-success", l.tone === "failed" && "text-danger"),
|
|
817
814
|
children: l.verdict
|
|
818
815
|
}),
|
|
819
|
-
l.printed !== "" && /* @__PURE__ */
|
|
816
|
+
l.printed !== "" && /* @__PURE__ */ P("pre", {
|
|
820
817
|
className: "mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-xs",
|
|
821
818
|
children: l.printed
|
|
822
819
|
}),
|
|
823
|
-
l.lastRun !== void 0 && /* @__PURE__ */
|
|
820
|
+
l.lastRun !== void 0 && /* @__PURE__ */ F("p", {
|
|
824
821
|
className: "mt-2 text-xs text-muted-foreground",
|
|
825
822
|
children: [
|
|
826
823
|
"Tried as if the row had last started a day ago: $LAST_RUN was ",
|
|
@@ -832,32 +829,32 @@ function It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
|
|
|
832
829
|
})
|
|
833
830
|
] });
|
|
834
831
|
}
|
|
835
|
-
function
|
|
836
|
-
return /* @__PURE__ */
|
|
832
|
+
function It({ description: e, when: t, waitsFor: n, where: r }) {
|
|
833
|
+
return /* @__PURE__ */ F("div", {
|
|
837
834
|
className: "space-y-2 opacity-70",
|
|
838
835
|
children: [
|
|
839
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ P("p", {
|
|
840
837
|
className: "rounded-md border border-border bg-muted px-3 py-2 text-sm",
|
|
841
838
|
children: e ?? "It does not say."
|
|
842
839
|
}),
|
|
843
|
-
t !== void 0 && /* @__PURE__ */
|
|
840
|
+
t !== void 0 && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F("p", {
|
|
844
841
|
className: "text-sm",
|
|
845
|
-
children: ["Its shell line", n !== void 0 && /* @__PURE__ */
|
|
842
|
+
children: ["Its shell line", n !== void 0 && /* @__PURE__ */ F("span", {
|
|
846
843
|
className: "text-xs text-muted-foreground",
|
|
847
844
|
children: [" ", n]
|
|
848
845
|
})]
|
|
849
|
-
}), /* @__PURE__ */
|
|
846
|
+
}), /* @__PURE__ */ P("pre", {
|
|
850
847
|
className: "max-h-32 overflow-auto whitespace-pre-wrap break-words rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs",
|
|
851
848
|
children: t
|
|
852
849
|
})] }),
|
|
853
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ P("p", {
|
|
854
851
|
className: "text-xs text-muted-foreground",
|
|
855
852
|
children: r
|
|
856
853
|
})
|
|
857
854
|
]
|
|
858
855
|
});
|
|
859
856
|
}
|
|
860
|
-
function
|
|
857
|
+
function Lt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counted: l, disabled: u, autoFocus: f, onChange: p }) {
|
|
861
858
|
let S = t.kind === "every" ? t : {
|
|
862
859
|
kind: "every",
|
|
863
860
|
count: String(c.count),
|
|
@@ -872,10 +869,10 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
872
869
|
n(() => {
|
|
873
870
|
f && O.current?.querySelector("[role=\"radio\"][aria-checked=\"true\"]")?.focus();
|
|
874
871
|
}, []);
|
|
875
|
-
let k = (e) => p(e === "every" ? S : e === "work" ? { kind: "work" } : { kind: "skill" }), j = /* @__PURE__ */
|
|
872
|
+
let k = (e) => p(e === "every" ? S : e === "work" ? { kind: "work" } : { kind: "skill" }), j = /* @__PURE__ */ F("div", {
|
|
876
873
|
className: A("flex flex-wrap items-center gap-2 text-sm", !E && "opacity-60"),
|
|
877
874
|
children: [
|
|
878
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ P(d, {
|
|
879
876
|
type: "number",
|
|
880
877
|
min: 1,
|
|
881
878
|
max: fe,
|
|
@@ -888,10 +885,10 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
888
885
|
"aria-label": "How long",
|
|
889
886
|
className: "h-8 w-20 bg-background px-2"
|
|
890
887
|
}),
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
items:
|
|
888
|
+
/* @__PURE__ */ F(_, {
|
|
889
|
+
items: le.map((e) => ({
|
|
893
890
|
value: e,
|
|
894
|
-
label:
|
|
891
|
+
label: Rt(e, S.count)
|
|
895
892
|
})),
|
|
896
893
|
value: S.unit,
|
|
897
894
|
disabled: u,
|
|
@@ -899,19 +896,19 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
899
896
|
...S,
|
|
900
897
|
unit: e
|
|
901
898
|
}),
|
|
902
|
-
children: [/* @__PURE__ */
|
|
899
|
+
children: [/* @__PURE__ */ P(b, {
|
|
903
900
|
size: "sm",
|
|
904
901
|
"aria-label": "Unit",
|
|
905
902
|
className: "w-28",
|
|
906
|
-
children: /* @__PURE__ */
|
|
907
|
-
}), /* @__PURE__ */
|
|
903
|
+
children: /* @__PURE__ */ P(x, {})
|
|
904
|
+
}), /* @__PURE__ */ P(v, { children: le.map((e) => /* @__PURE__ */ P(y, {
|
|
908
905
|
value: e,
|
|
909
|
-
children:
|
|
906
|
+
children: Rt(e, S.count)
|
|
910
907
|
}, e)) })]
|
|
911
908
|
}),
|
|
912
|
-
C && /* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
909
|
+
C && /* @__PURE__ */ F(N, { children: [
|
|
910
|
+
/* @__PURE__ */ P("span", { children: a ? "not before" : "at" }),
|
|
911
|
+
/* @__PURE__ */ P(d, {
|
|
915
912
|
type: "time",
|
|
916
913
|
value: S.at,
|
|
917
914
|
disabled: u,
|
|
@@ -925,22 +922,22 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
925
922
|
"aria-label": a ? "Not before this time of day" : "Time of day",
|
|
926
923
|
className: "h-8 w-auto bg-background px-2"
|
|
927
924
|
}),
|
|
928
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ F("span", {
|
|
929
926
|
className: Q,
|
|
930
927
|
children: ["optional, this machine's time", S.unit === "mo" ? "; a month counts as 30 days" : ""]
|
|
931
928
|
})
|
|
932
929
|
] })
|
|
933
930
|
]
|
|
934
931
|
});
|
|
935
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ F("div", {
|
|
936
933
|
className: "space-y-3",
|
|
937
|
-
children: [/* @__PURE__ */
|
|
934
|
+
children: [/* @__PURE__ */ P("p", {
|
|
938
935
|
className: "text-sm",
|
|
939
|
-
children: a ? /* @__PURE__ */
|
|
936
|
+
children: a ? /* @__PURE__ */ F(N, { children: [
|
|
940
937
|
"Only when there is work: ",
|
|
941
|
-
|
|
938
|
+
Pt(a.waitsFor ?? "when its shell line prints something"),
|
|
942
939
|
" ",
|
|
943
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ F("span", {
|
|
944
941
|
className: "text-muted-foreground",
|
|
945
942
|
children: [
|
|
946
943
|
"The scheduler looks every ",
|
|
@@ -948,32 +945,32 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
948
945
|
"."
|
|
949
946
|
]
|
|
950
947
|
})
|
|
951
|
-
] }) : /* @__PURE__ */
|
|
948
|
+
] }) : /* @__PURE__ */ F(N, { children: ["By time alone. ", /* @__PURE__ */ P("span", {
|
|
952
949
|
className: "text-muted-foreground",
|
|
953
950
|
children: "It starts again once the wait is over."
|
|
954
951
|
})] })
|
|
955
|
-
}), /* @__PURE__ */
|
|
952
|
+
}), /* @__PURE__ */ F("div", {
|
|
956
953
|
...T ? {} : {
|
|
957
954
|
role: "group",
|
|
958
955
|
"aria-labelledby": D
|
|
959
956
|
},
|
|
960
957
|
className: "space-y-2",
|
|
961
958
|
children: [
|
|
962
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ P("p", {
|
|
963
960
|
id: D,
|
|
964
961
|
className: "text-sm font-medium",
|
|
965
962
|
children: "Wait after a start"
|
|
966
963
|
}),
|
|
967
|
-
T ? /* @__PURE__ */
|
|
964
|
+
T ? /* @__PURE__ */ F(m, {
|
|
968
965
|
ref: O,
|
|
969
966
|
"aria-label": e,
|
|
970
967
|
value: t.kind,
|
|
971
968
|
onValueChange: k,
|
|
972
969
|
disabled: u,
|
|
973
970
|
children: [
|
|
974
|
-
o && /* @__PURE__ */
|
|
971
|
+
o && /* @__PURE__ */ F(g, {
|
|
975
972
|
value: "skill",
|
|
976
|
-
children: [o.label, /* @__PURE__ */
|
|
973
|
+
children: [o.label, /* @__PURE__ */ F("span", {
|
|
977
974
|
className: Q,
|
|
978
975
|
children: [
|
|
979
976
|
"(",
|
|
@@ -982,24 +979,24 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
982
979
|
]
|
|
983
980
|
})]
|
|
984
981
|
}),
|
|
985
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ F("div", {
|
|
986
983
|
className: "flex items-start gap-2",
|
|
987
|
-
children: [/* @__PURE__ */
|
|
984
|
+
children: [/* @__PURE__ */ P(h, {
|
|
988
985
|
value: "every",
|
|
989
986
|
"aria-label": "A wait you set",
|
|
990
987
|
className: "mt-2"
|
|
991
988
|
}), j]
|
|
992
989
|
}),
|
|
993
|
-
w && /* @__PURE__ */
|
|
990
|
+
w && /* @__PURE__ */ F(g, {
|
|
994
991
|
value: "work",
|
|
995
|
-
children: ["No wait", /* @__PURE__ */
|
|
992
|
+
children: ["No wait", /* @__PURE__ */ P("span", {
|
|
996
993
|
className: Q,
|
|
997
994
|
children: s ? "it starts as soon as there is work" : "needs a shell line: without one nothing says when"
|
|
998
995
|
})]
|
|
999
996
|
})
|
|
1000
997
|
]
|
|
1001
998
|
}) : j,
|
|
1002
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ P("p", {
|
|
1003
1000
|
className: Q,
|
|
1004
1001
|
children: l
|
|
1005
1002
|
})
|
|
@@ -1007,18 +1004,18 @@ function Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counte
|
|
|
1007
1004
|
})]
|
|
1008
1005
|
});
|
|
1009
1006
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return Number(t) === 1 ?
|
|
1007
|
+
function Rt(e, t) {
|
|
1008
|
+
return Number(t) === 1 ? Le[e] : `${Le[e]}s`;
|
|
1012
1009
|
}
|
|
1013
|
-
function
|
|
1010
|
+
function zt({ name: e, draft: t, asSaid: n, start: r, where: i, disabled: a, onChange: o }) {
|
|
1014
1011
|
let s = t.kind === "own" ? t : {
|
|
1015
1012
|
kind: "own",
|
|
1016
1013
|
count: String(r)
|
|
1017
|
-
}, c = /* @__PURE__ */
|
|
1014
|
+
}, c = /* @__PURE__ */ F("div", {
|
|
1018
1015
|
className: A("flex flex-wrap items-center gap-2 text-sm", t.kind !== "own" && "opacity-60"),
|
|
1019
1016
|
children: [
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ P("span", { children: "Up to" }),
|
|
1018
|
+
/* @__PURE__ */ P(d, {
|
|
1022
1019
|
type: "number",
|
|
1023
1020
|
min: 1,
|
|
1024
1021
|
max: 99,
|
|
@@ -1031,20 +1028,20 @@ function Bt({ name: e, draft: t, asSaid: n, start: r, where: i, disabled: a, onC
|
|
|
1031
1028
|
"aria-label": "How many agents",
|
|
1032
1029
|
className: "h-8 w-20 bg-background px-2"
|
|
1033
1030
|
}),
|
|
1034
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ F("span", { children: [Number(s.count) === 1 ? "agent" : "agents", " at once"] })
|
|
1035
1032
|
]
|
|
1036
1033
|
});
|
|
1037
|
-
return /* @__PURE__ */
|
|
1034
|
+
return /* @__PURE__ */ F("fieldset", {
|
|
1038
1035
|
disabled: a,
|
|
1039
1036
|
className: "space-y-2",
|
|
1040
|
-
children: [n ? /* @__PURE__ */
|
|
1037
|
+
children: [n ? /* @__PURE__ */ F(m, {
|
|
1041
1038
|
"aria-label": e,
|
|
1042
1039
|
value: t.kind,
|
|
1043
1040
|
onValueChange: (e) => o(e === "own" ? s : { kind: "skill" }),
|
|
1044
1041
|
disabled: a,
|
|
1045
|
-
children: [/* @__PURE__ */
|
|
1042
|
+
children: [/* @__PURE__ */ F(g, {
|
|
1046
1043
|
value: "skill",
|
|
1047
|
-
children: [n.label, /* @__PURE__ */
|
|
1044
|
+
children: [n.label, /* @__PURE__ */ F("span", {
|
|
1048
1045
|
className: Q,
|
|
1049
1046
|
children: [
|
|
1050
1047
|
"(",
|
|
@@ -1052,15 +1049,15 @@ function Bt({ name: e, draft: t, asSaid: n, start: r, where: i, disabled: a, onC
|
|
|
1052
1049
|
")"
|
|
1053
1050
|
]
|
|
1054
1051
|
})]
|
|
1055
|
-
}), /* @__PURE__ */
|
|
1052
|
+
}), /* @__PURE__ */ F("div", {
|
|
1056
1053
|
className: "flex items-start gap-2",
|
|
1057
|
-
children: [/* @__PURE__ */
|
|
1054
|
+
children: [/* @__PURE__ */ P(h, {
|
|
1058
1055
|
value: "own",
|
|
1059
1056
|
"aria-label": "A number you set",
|
|
1060
1057
|
className: "mt-2"
|
|
1061
1058
|
}), c]
|
|
1062
1059
|
})]
|
|
1063
|
-
}) : c, /* @__PURE__ */
|
|
1060
|
+
}) : c, /* @__PURE__ */ F("p", {
|
|
1064
1061
|
className: Q,
|
|
1065
1062
|
children: [
|
|
1066
1063
|
"A new one starts only when the row is due, and only while fewer than this are working ",
|
|
@@ -1070,29 +1067,29 @@ function Bt({ name: e, draft: t, asSaid: n, start: r, where: i, disabled: a, onC
|
|
|
1070
1067
|
})]
|
|
1071
1068
|
});
|
|
1072
1069
|
}
|
|
1073
|
-
function
|
|
1074
|
-
let a =
|
|
1070
|
+
function Bt({ gitHost: e, own: t, pick: n, disabled: r, onChange: i }) {
|
|
1071
|
+
let a = Ie(e, n).map((e) => ({
|
|
1075
1072
|
value: e,
|
|
1076
1073
|
label: ve(e, t)
|
|
1077
1074
|
}));
|
|
1078
|
-
return /* @__PURE__ */
|
|
1075
|
+
return /* @__PURE__ */ F(_, {
|
|
1079
1076
|
items: a,
|
|
1080
1077
|
value: n,
|
|
1081
1078
|
disabled: r,
|
|
1082
1079
|
onValueChange: (e) => i(e),
|
|
1083
|
-
children: [/* @__PURE__ */
|
|
1080
|
+
children: [/* @__PURE__ */ P(b, {
|
|
1084
1081
|
size: "sm",
|
|
1085
1082
|
"aria-label": "What its runs publish",
|
|
1086
1083
|
className: "w-56",
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1088
|
-
}), /* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ P(x, {})
|
|
1085
|
+
}), /* @__PURE__ */ P(v, { children: a.map((e) => /* @__PURE__ */ P(y, {
|
|
1089
1086
|
value: e.value,
|
|
1090
1087
|
children: e.label
|
|
1091
1088
|
}, e.value)) })]
|
|
1092
1089
|
});
|
|
1093
1090
|
}
|
|
1094
|
-
function
|
|
1095
|
-
let s = n.find((e) => e.value === r), c = s?.models ?? [], l = r === e.skillModelAgent && e.skillModel !== void 0 ? `As the skill says (${xe(n, r, e.skillModel)})` : r === "claude-code" ? `The scheduler's model${t === void 0 ? "" : ` (${xe(n, r, t)})`}` : `${
|
|
1091
|
+
function Vt({ command: e, schedulerModel: t, agents: n, agent: r, model: i, disabled: a, onChange: o }) {
|
|
1092
|
+
let s = n.find((e) => e.value === r), c = s?.models ?? [], l = r === e.skillModelAgent && e.skillModel !== void 0 ? `As the skill says (${xe(n, r, e.skillModel)})` : r === "claude-code" ? `The scheduler's model${t === void 0 ? "" : ` (${xe(n, r, t)})`}` : `${H[r]}'s own default`, u = B.filter((t) => !e.able.includes(t)), d = [
|
|
1096
1093
|
{
|
|
1097
1094
|
value: "skill",
|
|
1098
1095
|
label: l
|
|
@@ -1103,20 +1100,20 @@ function Ht({ command: e, schedulerModel: t, agents: n, agent: r, model: i, disa
|
|
|
1103
1100
|
label: i
|
|
1104
1101
|
}] : []
|
|
1105
1102
|
];
|
|
1106
|
-
return /* @__PURE__ */
|
|
1103
|
+
return /* @__PURE__ */ F("fieldset", {
|
|
1107
1104
|
disabled: a,
|
|
1108
1105
|
className: "space-y-2",
|
|
1109
1106
|
children: [
|
|
1110
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ F("div", {
|
|
1111
1108
|
className: "flex flex-wrap items-center gap-2 text-sm",
|
|
1112
|
-
children: [/* @__PURE__ */
|
|
1109
|
+
children: [/* @__PURE__ */ P(f, {
|
|
1113
1110
|
htmlFor: "automation-agent",
|
|
1114
1111
|
className: "w-14",
|
|
1115
1112
|
children: "Agent"
|
|
1116
|
-
}), /* @__PURE__ */
|
|
1117
|
-
items:
|
|
1113
|
+
}), /* @__PURE__ */ F(_, {
|
|
1114
|
+
items: B.map((e) => ({
|
|
1118
1115
|
value: e,
|
|
1119
|
-
label:
|
|
1116
|
+
label: H[e]
|
|
1120
1117
|
})),
|
|
1121
1118
|
value: r,
|
|
1122
1119
|
disabled: a,
|
|
@@ -1124,25 +1121,25 @@ function Ht({ command: e, schedulerModel: t, agents: n, agent: r, model: i, disa
|
|
|
1124
1121
|
agent: e,
|
|
1125
1122
|
model: "skill"
|
|
1126
1123
|
}),
|
|
1127
|
-
children: [/* @__PURE__ */
|
|
1124
|
+
children: [/* @__PURE__ */ P(b, {
|
|
1128
1125
|
id: "automation-agent",
|
|
1129
1126
|
size: "sm",
|
|
1130
1127
|
className: "w-44",
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1132
|
-
}), /* @__PURE__ */
|
|
1128
|
+
children: /* @__PURE__ */ P(x, {})
|
|
1129
|
+
}), /* @__PURE__ */ P(v, { children: B.map((t) => /* @__PURE__ */ P(y, {
|
|
1133
1130
|
value: t,
|
|
1134
1131
|
disabled: !e.able.includes(t) && t !== r,
|
|
1135
|
-
children:
|
|
1132
|
+
children: H[t]
|
|
1136
1133
|
}, t)) })]
|
|
1137
1134
|
})]
|
|
1138
1135
|
}),
|
|
1139
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ F("div", {
|
|
1140
1137
|
className: "flex flex-wrap items-center gap-2 text-sm",
|
|
1141
|
-
children: [/* @__PURE__ */
|
|
1138
|
+
children: [/* @__PURE__ */ P(f, {
|
|
1142
1139
|
htmlFor: "automation-model",
|
|
1143
1140
|
className: "w-14",
|
|
1144
1141
|
children: "Model"
|
|
1145
|
-
}), /* @__PURE__ */
|
|
1142
|
+
}), /* @__PURE__ */ F(_, {
|
|
1146
1143
|
items: d,
|
|
1147
1144
|
value: i,
|
|
1148
1145
|
disabled: a,
|
|
@@ -1150,38 +1147,38 @@ function Ht({ command: e, schedulerModel: t, agents: n, agent: r, model: i, disa
|
|
|
1150
1147
|
agent: r,
|
|
1151
1148
|
model: e
|
|
1152
1149
|
}),
|
|
1153
|
-
children: [/* @__PURE__ */
|
|
1150
|
+
children: [/* @__PURE__ */ P(b, {
|
|
1154
1151
|
id: "automation-model",
|
|
1155
1152
|
size: "sm",
|
|
1156
1153
|
className: "w-72",
|
|
1157
|
-
children: /* @__PURE__ */
|
|
1158
|
-
}), /* @__PURE__ */
|
|
1154
|
+
children: /* @__PURE__ */ P(x, {})
|
|
1155
|
+
}), /* @__PURE__ */ P(v, { children: d.map((e) => /* @__PURE__ */ P(y, {
|
|
1159
1156
|
value: e.value,
|
|
1160
1157
|
children: e.label
|
|
1161
1158
|
}, e.value)) })]
|
|
1162
1159
|
})]
|
|
1163
1160
|
}),
|
|
1164
|
-
c.length === 0 && s?.modelsNote !== void 0 && /* @__PURE__ */
|
|
1161
|
+
c.length === 0 && s?.modelsNote !== void 0 && /* @__PURE__ */ P("p", {
|
|
1165
1162
|
className: "text-xs text-muted-foreground",
|
|
1166
1163
|
children: s.modelsNote
|
|
1167
1164
|
}),
|
|
1168
|
-
u.map((e) => /* @__PURE__ */
|
|
1165
|
+
u.map((e) => /* @__PURE__ */ F("p", {
|
|
1169
1166
|
className: "text-xs text-muted-foreground",
|
|
1170
1167
|
children: [
|
|
1171
|
-
|
|
1168
|
+
H[e],
|
|
1172
1169
|
" cannot run this row: it reads the project's skills from ",
|
|
1173
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ P("span", {
|
|
1174
1171
|
className: "font-mono",
|
|
1175
|
-
children:
|
|
1172
|
+
children: U[e]
|
|
1176
1173
|
}),
|
|
1177
1174
|
", and this row's skill is not there."
|
|
1178
1175
|
]
|
|
1179
1176
|
}, e)),
|
|
1180
|
-
r !== "claude-code" && /* @__PURE__ */
|
|
1177
|
+
r !== "claude-code" && /* @__PURE__ */ F("p", {
|
|
1181
1178
|
className: "text-xs text-muted-foreground",
|
|
1182
1179
|
children: [
|
|
1183
1180
|
"How much of ",
|
|
1184
|
-
|
|
1181
|
+
H[r],
|
|
1185
1182
|
"'s quota is left cannot be read, so its runs start without that check, and their cost is not recorded."
|
|
1186
1183
|
]
|
|
1187
1184
|
})
|
|
@@ -1190,16 +1187,16 @@ function Ht({ command: e, schedulerModel: t, agents: n, agent: r, model: i, disa
|
|
|
1190
1187
|
}
|
|
1191
1188
|
//#endregion
|
|
1192
1189
|
//#region dashboard/AutomationForm.tsx
|
|
1193
|
-
function
|
|
1194
|
-
let [c, l] = a(
|
|
1190
|
+
function Ht({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
1191
|
+
let [c, l] = a(dt), [u, f] = a(!1), [p, h] = a(), [_, v] = a(), y = (e) => {
|
|
1195
1192
|
l((t) => ({
|
|
1196
1193
|
...t,
|
|
1197
1194
|
...e
|
|
1198
1195
|
})), h(void 0);
|
|
1199
|
-
}, b =
|
|
1196
|
+
}, b = ht(c), x = St(c), S = !Ct(c) && !_;
|
|
1200
1197
|
n(() => r(S), [S]), n(() => () => r(!1), []);
|
|
1201
1198
|
let C = async () => {
|
|
1202
|
-
let e =
|
|
1199
|
+
let e = gt(c), n = vt(c);
|
|
1203
1200
|
if (!e || !n) return;
|
|
1204
1201
|
f(!0), h(void 0);
|
|
1205
1202
|
let r = await t(e);
|
|
@@ -1211,33 +1208,33 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1211
1208
|
]);
|
|
1212
1209
|
f(!1), v({
|
|
1213
1210
|
command: c.name.trim(),
|
|
1214
|
-
...
|
|
1211
|
+
...Et(r.output),
|
|
1215
1212
|
...i && !i.ok ? { timeNotKept: i.error } : {}
|
|
1216
1213
|
}), s();
|
|
1217
1214
|
}, w = "mt-3 rounded-md border border-border bg-muted/40 p-4";
|
|
1218
|
-
return _ ? /* @__PURE__ */
|
|
1215
|
+
return _ ? /* @__PURE__ */ F("div", {
|
|
1219
1216
|
role: "group",
|
|
1220
1217
|
"aria-label": "New automation",
|
|
1221
1218
|
className: `${w} text-sm`,
|
|
1222
1219
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ F("p", { children: [
|
|
1224
1221
|
"Saved ",
|
|
1225
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ P("span", {
|
|
1226
1223
|
className: "font-mono",
|
|
1227
1224
|
children: _.onThisMachine ? _.command : `/${_.command}`
|
|
1228
1225
|
}),
|
|
1229
1226
|
" as ",
|
|
1230
|
-
/* @__PURE__ */
|
|
1227
|
+
/* @__PURE__ */ P("span", {
|
|
1231
1228
|
className: "font-mono",
|
|
1232
1229
|
children: _.file
|
|
1233
1230
|
}),
|
|
1234
1231
|
"."
|
|
1235
1232
|
] }),
|
|
1236
|
-
/* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ P("p", {
|
|
1237
1234
|
className: "mt-2",
|
|
1238
|
-
children:
|
|
1235
|
+
children: Dt(_)
|
|
1239
1236
|
}),
|
|
1240
|
-
_.timeNotKept !== void 0 && /* @__PURE__ */
|
|
1237
|
+
_.timeNotKept !== void 0 && /* @__PURE__ */ F("p", {
|
|
1241
1238
|
role: "alert",
|
|
1242
1239
|
className: "mt-2 text-danger",
|
|
1243
1240
|
children: [
|
|
@@ -1246,13 +1243,13 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1246
1243
|
". Its row's Edit sets it."
|
|
1247
1244
|
]
|
|
1248
1245
|
}),
|
|
1249
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ P("p", {
|
|
1250
1247
|
className: "mt-2 text-muted-foreground",
|
|
1251
1248
|
children: "Its row is in the list now, switched off."
|
|
1252
1249
|
}),
|
|
1253
|
-
/* @__PURE__ */
|
|
1250
|
+
/* @__PURE__ */ P("div", {
|
|
1254
1251
|
className: "mt-3 flex justify-end",
|
|
1255
|
-
children: /* @__PURE__ */
|
|
1252
|
+
children: /* @__PURE__ */ P(o, {
|
|
1256
1253
|
size: "sm",
|
|
1257
1254
|
autoFocus: !0,
|
|
1258
1255
|
onClick: i,
|
|
@@ -1260,26 +1257,26 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1260
1257
|
})
|
|
1261
1258
|
})
|
|
1262
1259
|
]
|
|
1263
|
-
}) : /* @__PURE__ */
|
|
1260
|
+
}) : /* @__PURE__ */ F("div", {
|
|
1264
1261
|
role: "group",
|
|
1265
1262
|
"aria-label": "New automation",
|
|
1266
1263
|
onKeyDown: (e) => {
|
|
1267
|
-
e.key === "Escape" && !u &&
|
|
1264
|
+
e.key === "Escape" && !u && Ct(c) && i();
|
|
1268
1265
|
},
|
|
1269
1266
|
className: `${w} space-y-5`,
|
|
1270
1267
|
children: [
|
|
1271
|
-
/* @__PURE__ */
|
|
1268
|
+
/* @__PURE__ */ F("fieldset", {
|
|
1272
1269
|
disabled: u,
|
|
1273
1270
|
className: "space-y-5",
|
|
1274
1271
|
children: [
|
|
1275
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ P($, {
|
|
1276
1273
|
title: "Name",
|
|
1277
|
-
children: /* @__PURE__ */
|
|
1274
|
+
children: /* @__PURE__ */ F("div", {
|
|
1278
1275
|
className: "flex items-center gap-1 text-sm",
|
|
1279
|
-
children: [!c.onThisMachine && /* @__PURE__ */
|
|
1276
|
+
children: [!c.onThisMachine && /* @__PURE__ */ P("span", {
|
|
1280
1277
|
className: "font-mono text-muted-foreground",
|
|
1281
1278
|
children: "/"
|
|
1282
|
-
}), /* @__PURE__ */
|
|
1279
|
+
}), /* @__PURE__ */ P(d, {
|
|
1283
1280
|
type: "text",
|
|
1284
1281
|
autoFocus: !0,
|
|
1285
1282
|
value: c.name,
|
|
@@ -1290,19 +1287,19 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1290
1287
|
})]
|
|
1291
1288
|
})
|
|
1292
1289
|
}),
|
|
1293
|
-
/* @__PURE__ */
|
|
1290
|
+
/* @__PURE__ */ P($, {
|
|
1294
1291
|
title: "What it does",
|
|
1295
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ P(Ft, {
|
|
1296
1293
|
project: e,
|
|
1297
1294
|
said: c,
|
|
1298
|
-
agent:
|
|
1295
|
+
agent: W,
|
|
1299
1296
|
autoFocus: !1,
|
|
1300
1297
|
onChange: y
|
|
1301
1298
|
})
|
|
1302
1299
|
}),
|
|
1303
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ P($, {
|
|
1304
1301
|
title: "When it runs",
|
|
1305
|
-
children: /* @__PURE__ */
|
|
1302
|
+
children: /* @__PURE__ */ P(Lt, {
|
|
1306
1303
|
name: "How long the new automation waits after a start",
|
|
1307
1304
|
draft: c.pace,
|
|
1308
1305
|
work: c.when.trim() === "" ? void 0 : { waitsFor: c.waitsFor.trim() || void 0 },
|
|
@@ -1317,22 +1314,22 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1317
1314
|
onChange: (e) => y({ pace: e })
|
|
1318
1315
|
})
|
|
1319
1316
|
}),
|
|
1320
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ P($, {
|
|
1321
1318
|
title: "Who gets it",
|
|
1322
|
-
children: /* @__PURE__ */
|
|
1319
|
+
children: /* @__PURE__ */ F(m, {
|
|
1323
1320
|
"aria-label": "Who gets the automation",
|
|
1324
1321
|
value: c.onThisMachine ? "machine" : "project",
|
|
1325
1322
|
onValueChange: (e) => y({ onThisMachine: e === "machine" }),
|
|
1326
1323
|
disabled: u,
|
|
1327
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ F(g, {
|
|
1328
1325
|
value: "project",
|
|
1329
|
-
children: ["Shared with the project", /* @__PURE__ */
|
|
1326
|
+
children: ["Shared with the project", /* @__PURE__ */ P("span", {
|
|
1330
1327
|
className: "text-xs text-muted-foreground",
|
|
1331
1328
|
children: "a file you commit; everyone who has the project gets the row, switched off"
|
|
1332
1329
|
})]
|
|
1333
|
-
}), /* @__PURE__ */
|
|
1330
|
+
}), /* @__PURE__ */ F(g, {
|
|
1334
1331
|
value: "machine",
|
|
1335
|
-
children: ["Only on this machine", /* @__PURE__ */
|
|
1332
|
+
children: ["Only on this machine", /* @__PURE__ */ P("span", {
|
|
1336
1333
|
className: "text-xs text-muted-foreground",
|
|
1337
1334
|
children: "nothing to commit; nobody else gets the row"
|
|
1338
1335
|
})]
|
|
@@ -1341,29 +1338,29 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1341
1338
|
})
|
|
1342
1339
|
]
|
|
1343
1340
|
}),
|
|
1344
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ P("p", {
|
|
1345
1342
|
className: "rounded-md border border-border bg-background px-3 py-2 text-sm",
|
|
1346
1343
|
children: b ?? `${x}.`
|
|
1347
1344
|
}),
|
|
1348
|
-
p !== void 0 && /* @__PURE__ */
|
|
1345
|
+
p !== void 0 && /* @__PURE__ */ P("p", {
|
|
1349
1346
|
role: "alert",
|
|
1350
1347
|
className: "text-xs text-danger",
|
|
1351
1348
|
children: p
|
|
1352
1349
|
}),
|
|
1353
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ F("div", {
|
|
1354
1351
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
1355
|
-
children: [/* @__PURE__ */
|
|
1352
|
+
children: [/* @__PURE__ */ P("p", {
|
|
1356
1353
|
className: "min-w-0 flex-1 text-xs text-muted-foreground",
|
|
1357
|
-
children:
|
|
1358
|
-
}), /* @__PURE__ */
|
|
1354
|
+
children: Mt(c)
|
|
1355
|
+
}), /* @__PURE__ */ F("div", {
|
|
1359
1356
|
className: "flex gap-2",
|
|
1360
|
-
children: [/* @__PURE__ */
|
|
1357
|
+
children: [/* @__PURE__ */ P(o, {
|
|
1361
1358
|
variant: "outline",
|
|
1362
1359
|
size: "sm",
|
|
1363
1360
|
disabled: u,
|
|
1364
1361
|
onClick: i,
|
|
1365
1362
|
children: "Cancel"
|
|
1366
|
-
}), /* @__PURE__ */
|
|
1363
|
+
}), /* @__PURE__ */ P(o, {
|
|
1367
1364
|
size: "sm",
|
|
1368
1365
|
disabled: u || b !== void 0,
|
|
1369
1366
|
onClick: () => void C(),
|
|
@@ -1376,35 +1373,35 @@ function Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
|
|
|
1376
1373
|
}
|
|
1377
1374
|
//#endregion
|
|
1378
1375
|
//#region dashboard/EditPanel.tsx
|
|
1379
|
-
var
|
|
1380
|
-
function
|
|
1376
|
+
var Ut = (e) => e.charAt(0).toLowerCase() + e.slice(1), Wt = (e) => /[.!?]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`;
|
|
1377
|
+
function Gt(e) {
|
|
1381
1378
|
let t = e.pace;
|
|
1382
1379
|
if (t === void 0) return ["skill"];
|
|
1383
1380
|
if ("work" in t) return ["work"];
|
|
1384
1381
|
let n = t.at === void 0 ? void 0 : me(t.at)?.text ?? t.at;
|
|
1385
1382
|
return [q(t.every)?.text ?? t.every, ...n === void 0 ? [] : [n]];
|
|
1386
1383
|
}
|
|
1387
|
-
function
|
|
1388
|
-
let m =
|
|
1384
|
+
function Kt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s, agents: c, run: l, reload: u, onDirty: d, onClose: f, onRemoved: p }) {
|
|
1385
|
+
let m = we(t), [h, g] = a(r?.draft), [_] = a(() => r ? mt(r.draft, t) : void 0), [v, y] = a(_), [b, x] = a(() => He(t)), [S, C] = a(() => r ? {
|
|
1389
1386
|
kind: "own",
|
|
1390
|
-
count: String(
|
|
1391
|
-
} :
|
|
1387
|
+
count: String(Ge(t))
|
|
1388
|
+
} : Je(t)), [w, T] = a(() => ({
|
|
1392
1389
|
agent: J(t),
|
|
1393
1390
|
model: t.model ?? "skill"
|
|
1394
|
-
})), [E, D] = a(t.publish), [O, k] = a(!1), [A, j] = a(), [ee, te] = a(!1), [ne,
|
|
1395
|
-
file:
|
|
1396
|
-
pace:
|
|
1397
|
-
agents:
|
|
1391
|
+
})), [E, D] = a(t.publish), [O, k] = a(!1), [A, j] = a(), [ee, te] = a(!1), [ne, M] = a(r?.version), [re, N] = a(), [I, L] = a(), R = Ye(S), ie = (e) => v && e === String(t.skillAgents ?? 1) ? "skill" : e, z = R === void 0 ? void 0 : ie(R[0]), B = v ? vt(v) : Z(b), V = v !== void 0 && _ !== void 0 && (!bt(v, _) || vt(v)?.join(" ") !== vt(_)?.join(" ")), H = {
|
|
1392
|
+
file: V && v !== void 0 && h !== void 0 && !bt(v, h),
|
|
1393
|
+
pace: B !== void 0 && (v ? V && B.join(" ") !== Gt(t).join(" ") : B.join(" ") !== Z(He(t)).join(" ")),
|
|
1394
|
+
agents: z !== void 0 && z !== ie(Ye(Je(t))[0]),
|
|
1398
1395
|
agent: w.agent !== J(t),
|
|
1399
1396
|
model: w.model !== (t.model ?? "skill") || w.agent !== J(t) && w.model !== "skill",
|
|
1400
1397
|
publish: E !== t.publish
|
|
1401
|
-
},
|
|
1402
|
-
n(() => d(
|
|
1403
|
-
let
|
|
1404
|
-
if (
|
|
1398
|
+
}, U = V || H.pace || H.agents || H.agent || H.model || H.publish, W = (v && r ? H.file ? ht(v, r.file) : Ue(v.pace) : Ue(b)) ?? (R ? void 0 : "Type a whole number of agents, from 1 to 99.");
|
|
1399
|
+
n(() => d(U && !I), [U, I]), n(() => () => d(!1), []);
|
|
1400
|
+
let G = (() => {
|
|
1401
|
+
if (z === void 0) return;
|
|
1405
1402
|
let e;
|
|
1406
1403
|
if (v) {
|
|
1407
|
-
let n =
|
|
1404
|
+
let n = xt(v);
|
|
1408
1405
|
if (!n) return;
|
|
1409
1406
|
let { pace: r, every: i, when: a, waitsFor: o, ...s } = t, { command: c, on: l, publish: u, ...d } = n;
|
|
1410
1407
|
e = {
|
|
@@ -1413,11 +1410,11 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1413
1410
|
};
|
|
1414
1411
|
} else {
|
|
1415
1412
|
if (!Z(b)) return;
|
|
1416
|
-
e =
|
|
1413
|
+
e = We(t, b);
|
|
1417
1414
|
}
|
|
1418
1415
|
let { agents: n, ...r } = e, { runsOn: i, model: a, ...o } = {
|
|
1419
1416
|
...r,
|
|
1420
|
-
...
|
|
1417
|
+
...z === "skill" ? {} : { agents: Number(z) },
|
|
1421
1418
|
publish: E
|
|
1422
1419
|
};
|
|
1423
1420
|
return {
|
|
@@ -1425,71 +1422,71 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1425
1422
|
...w.agent === t.home ? {} : { runsOn: w.agent },
|
|
1426
1423
|
...w.model === "skill" ? {} : { model: w.model }
|
|
1427
1424
|
};
|
|
1428
|
-
})(),
|
|
1429
|
-
if (
|
|
1425
|
+
})(), oe = G && `${Be(G)}. ${Ke(G) ? `${qe(Ge(G))}. ` : ""}${Se(G, s, c)}. ${Xe(G)}.`, se = async () => {
|
|
1426
|
+
if (W !== void 0 || B === void 0 || z === void 0) return;
|
|
1430
1427
|
let e = [];
|
|
1431
|
-
|
|
1428
|
+
H.file && v && r && e.push(["It", [..._t(v, r.file), ...ne === void 0 ? [] : [`--was=${ne}`]]]), H.pace && e.push(["The pace", [
|
|
1432
1429
|
"pace",
|
|
1433
1430
|
t.command,
|
|
1434
|
-
...
|
|
1435
|
-
]]),
|
|
1431
|
+
...B
|
|
1432
|
+
]]), H.agents && e.push(["The number of agents", [
|
|
1436
1433
|
"agents",
|
|
1437
1434
|
t.command,
|
|
1438
|
-
|
|
1439
|
-
]]),
|
|
1435
|
+
z
|
|
1436
|
+
]]), H.agent && e.push(["The agent", [
|
|
1440
1437
|
"agent",
|
|
1441
1438
|
t.command,
|
|
1442
1439
|
w.agent === t.home ? "skill" : w.agent
|
|
1443
|
-
]]),
|
|
1440
|
+
]]), H.model && !(H.agent && w.model === "skill") && e.push(["The model", [
|
|
1444
1441
|
"model",
|
|
1445
1442
|
t.command,
|
|
1446
1443
|
w.model
|
|
1447
|
-
]]),
|
|
1444
|
+
]]), H.publish && e.push(["The publish pick", [
|
|
1448
1445
|
"publish",
|
|
1449
1446
|
t.command,
|
|
1450
1447
|
E
|
|
1451
1448
|
]]), k(!0), j(void 0);
|
|
1452
|
-
let n =
|
|
1449
|
+
let n = re;
|
|
1453
1450
|
for (let [t, r] of e) {
|
|
1454
1451
|
let e = await l(r);
|
|
1455
1452
|
if (!e.ok) {
|
|
1456
1453
|
await u().catch(() => {}), k(!1);
|
|
1457
1454
|
let r = `${t} was not saved: ${e.error}`;
|
|
1458
|
-
return j(n ? `${
|
|
1455
|
+
return j(n ? `${Wt(r)} Its words and its pace are saved, in ${n.file}${n.onThisMachine ? "" : ": a change of yours to commit"}.` : r);
|
|
1459
1456
|
}
|
|
1460
|
-
r[0] === "edit" && (n =
|
|
1457
|
+
r[0] === "edit" && (n = Et(e.output), N(n), g(v), M(n.version));
|
|
1461
1458
|
}
|
|
1462
|
-
await u().catch(() => {}), k(!1), n && !n.onThisMachine ?
|
|
1463
|
-
},
|
|
1459
|
+
await u().catch(() => {}), k(!1), n && !n.onThisMachine ? L(n) : f();
|
|
1460
|
+
}, ce = async () => {
|
|
1464
1461
|
k(!0), j(void 0);
|
|
1465
1462
|
let e = await l(["remove", t.command]);
|
|
1466
|
-
e.ok && p(
|
|
1467
|
-
},
|
|
1468
|
-
if (
|
|
1463
|
+
e.ok && p(jt(m, e.output)), await u().catch(() => {}), k(!1), e.ok || j(`It was not removed: ${e.error}`);
|
|
1464
|
+
}, le = () => (te(!1), j(void 0)), ue = "mt-3 rounded-md border border-border bg-muted/40 p-4";
|
|
1465
|
+
if (I) return /* @__PURE__ */ F("div", {
|
|
1469
1466
|
role: "group",
|
|
1470
1467
|
"aria-label": `Editing ${m}`,
|
|
1471
|
-
className: `${
|
|
1468
|
+
className: `${ue} text-sm`,
|
|
1472
1469
|
children: [
|
|
1473
|
-
/* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ F("p", { children: [
|
|
1474
1471
|
"Saved ",
|
|
1475
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ P("span", {
|
|
1476
1473
|
className: "font-mono",
|
|
1477
1474
|
children: m
|
|
1478
1475
|
}),
|
|
1479
1476
|
" again, in ",
|
|
1480
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ P("span", {
|
|
1481
1478
|
className: "font-mono",
|
|
1482
|
-
children:
|
|
1479
|
+
children: I.file
|
|
1483
1480
|
}),
|
|
1484
1481
|
"."
|
|
1485
1482
|
] }),
|
|
1486
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ P("p", {
|
|
1487
1484
|
className: "mt-2",
|
|
1488
|
-
children:
|
|
1485
|
+
children: Ot(I)
|
|
1489
1486
|
}),
|
|
1490
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ P("div", {
|
|
1491
1488
|
className: "mt-3 flex justify-end",
|
|
1492
|
-
children: /* @__PURE__ */
|
|
1489
|
+
children: /* @__PURE__ */ P(o, {
|
|
1493
1490
|
size: "sm",
|
|
1494
1491
|
autoFocus: !0,
|
|
1495
1492
|
onClick: f,
|
|
@@ -1498,65 +1495,65 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1498
1495
|
})
|
|
1499
1496
|
]
|
|
1500
1497
|
});
|
|
1501
|
-
if (ee) return /* @__PURE__ */
|
|
1498
|
+
if (ee) return /* @__PURE__ */ F("div", {
|
|
1502
1499
|
role: "group",
|
|
1503
1500
|
"aria-label": `Removing ${m}`,
|
|
1504
1501
|
onKeyDown: (e) => {
|
|
1505
|
-
e.key === "Escape" && !O &&
|
|
1502
|
+
e.key === "Escape" && !O && le();
|
|
1506
1503
|
},
|
|
1507
|
-
className: `${
|
|
1504
|
+
className: `${ue} text-sm`,
|
|
1508
1505
|
children: [
|
|
1509
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ F("p", { children: [
|
|
1510
1507
|
"Remove ",
|
|
1511
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ P("span", {
|
|
1512
1509
|
className: "font-mono",
|
|
1513
1510
|
children: m
|
|
1514
1511
|
}),
|
|
1515
1512
|
"?"
|
|
1516
1513
|
] }),
|
|
1517
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ P("p", {
|
|
1518
1515
|
className: "mt-2",
|
|
1519
|
-
children:
|
|
1516
|
+
children: At(t)
|
|
1520
1517
|
}),
|
|
1521
|
-
A !== void 0 && /* @__PURE__ */
|
|
1518
|
+
A !== void 0 && /* @__PURE__ */ P("p", {
|
|
1522
1519
|
role: "alert",
|
|
1523
1520
|
className: "mt-2 text-xs text-danger",
|
|
1524
1521
|
children: A
|
|
1525
1522
|
}),
|
|
1526
|
-
/* @__PURE__ */
|
|
1523
|
+
/* @__PURE__ */ F("div", {
|
|
1527
1524
|
className: "mt-3 flex justify-end gap-2",
|
|
1528
|
-
children: [/* @__PURE__ */
|
|
1525
|
+
children: [/* @__PURE__ */ P(o, {
|
|
1529
1526
|
variant: "outline",
|
|
1530
1527
|
size: "sm",
|
|
1531
1528
|
autoFocus: !0,
|
|
1532
1529
|
disabled: O,
|
|
1533
|
-
onClick:
|
|
1530
|
+
onClick: le,
|
|
1534
1531
|
children: "Cancel"
|
|
1535
|
-
}), /* @__PURE__ */
|
|
1532
|
+
}), /* @__PURE__ */ P(o, {
|
|
1536
1533
|
variant: "destructive",
|
|
1537
1534
|
size: "sm",
|
|
1538
1535
|
disabled: O,
|
|
1539
|
-
onClick: () => void
|
|
1536
|
+
onClick: () => void ce(),
|
|
1540
1537
|
children: "Remove"
|
|
1541
1538
|
})]
|
|
1542
1539
|
})
|
|
1543
1540
|
]
|
|
1544
1541
|
});
|
|
1545
1542
|
let K = t.onThisMachine ? "on this machine" : "on any machine that shares this repository", de = t.every === void 0 ? void 0 : q(t.every), fe = t.onThisMachine || t.editable ? "As it was saved" : "As the skill says";
|
|
1546
|
-
return /* @__PURE__ */
|
|
1543
|
+
return /* @__PURE__ */ F("div", {
|
|
1547
1544
|
role: "group",
|
|
1548
1545
|
"aria-label": `Editing ${m}`,
|
|
1549
1546
|
onKeyDown: (e) => {
|
|
1550
|
-
e.key === "Escape" && !O && !
|
|
1547
|
+
e.key === "Escape" && !O && !U && f();
|
|
1551
1548
|
},
|
|
1552
|
-
className: `${
|
|
1549
|
+
className: `${ue} space-y-5`,
|
|
1553
1550
|
children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ P($, {
|
|
1555
1552
|
title: "What it does",
|
|
1556
|
-
children: v ? /* @__PURE__ */
|
|
1553
|
+
children: v ? /* @__PURE__ */ P("fieldset", {
|
|
1557
1554
|
disabled: O,
|
|
1558
1555
|
className: "space-y-2",
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1556
|
+
children: /* @__PURE__ */ P(Ft, {
|
|
1560
1557
|
project: e,
|
|
1561
1558
|
said: v,
|
|
1562
1559
|
agent: w.agent,
|
|
@@ -1566,16 +1563,16 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1566
1563
|
...e
|
|
1567
1564
|
}), j(void 0))
|
|
1568
1565
|
})
|
|
1569
|
-
}) : /* @__PURE__ */
|
|
1566
|
+
}) : /* @__PURE__ */ P(It, {
|
|
1570
1567
|
description: t.description,
|
|
1571
1568
|
when: t.when,
|
|
1572
1569
|
waitsFor: t.waitsFor,
|
|
1573
|
-
where: i === void 0 ? t.onThisMachine ? `Its words cannot be changed here: its file was changed by hand since it was saved. They are changed in the file itself, ${
|
|
1570
|
+
where: i === void 0 ? t.onThisMachine ? `Its words cannot be changed here: its file was changed by hand since it was saved. They are changed in the file itself, ${ae}/${t.command}.md.` : `Its words are its skill's, ${m}: they are changed in the skill's file, by whoever writes the skill.` : `Its words cannot be changed here: ${i}`
|
|
1574
1571
|
})
|
|
1575
1572
|
}),
|
|
1576
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ P($, {
|
|
1577
1574
|
title: "When it runs",
|
|
1578
|
-
children: v ? /* @__PURE__ */
|
|
1575
|
+
children: v ? /* @__PURE__ */ P(Lt, {
|
|
1579
1576
|
name: `How long ${m} waits after a start`,
|
|
1580
1577
|
draft: v.pace,
|
|
1581
1578
|
work: v.when.trim() === "" ? void 0 : { waitsFor: v.waitsFor.trim() || void 0 },
|
|
@@ -1591,7 +1588,7 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1591
1588
|
...v,
|
|
1592
1589
|
pace: e
|
|
1593
1590
|
}), j(void 0))
|
|
1594
|
-
}) : /* @__PURE__ */
|
|
1591
|
+
}) : /* @__PURE__ */ P(Lt, {
|
|
1595
1592
|
name: `How long ${m} waits after a start`,
|
|
1596
1593
|
draft: b,
|
|
1597
1594
|
work: t.when === void 0 ? void 0 : {
|
|
@@ -1600,7 +1597,7 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1600
1597
|
},
|
|
1601
1598
|
asSaid: {
|
|
1602
1599
|
label: fe,
|
|
1603
|
-
says: t.every === void 0 ? "no wait" :
|
|
1600
|
+
says: t.every === void 0 ? "no wait" : Re(t.every)
|
|
1604
1601
|
},
|
|
1605
1602
|
noWait: t.when !== void 0 && t.every !== void 0,
|
|
1606
1603
|
start: {
|
|
@@ -1613,14 +1610,14 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1613
1610
|
onChange: (e) => (x(e), j(void 0))
|
|
1614
1611
|
})
|
|
1615
1612
|
}),
|
|
1616
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ P($, {
|
|
1617
1614
|
title: "How many at once",
|
|
1618
|
-
children: /* @__PURE__ */
|
|
1615
|
+
children: /* @__PURE__ */ P(zt, {
|
|
1619
1616
|
name: `How many of ${m} at once`,
|
|
1620
1617
|
draft: S,
|
|
1621
1618
|
asSaid: v ? void 0 : {
|
|
1622
1619
|
label: fe,
|
|
1623
|
-
says:
|
|
1620
|
+
says: Ut(qe(t.skillAgents ?? 1))
|
|
1624
1621
|
},
|
|
1625
1622
|
start: t.skillAgents ?? 1,
|
|
1626
1623
|
where: K,
|
|
@@ -1628,12 +1625,9 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1628
1625
|
onChange: (e) => (C(e), j(void 0))
|
|
1629
1626
|
})
|
|
1630
1627
|
}),
|
|
1631
|
-
/* @__PURE__ */
|
|
1628
|
+
/* @__PURE__ */ P($, {
|
|
1632
1629
|
title: "What it runs on",
|
|
1633
|
-
children:
|
|
1634
|
-
className: "text-sm text-muted-foreground",
|
|
1635
|
-
children: [Se, "."]
|
|
1636
|
-
}) : /* @__PURE__ */ N(Ht, {
|
|
1630
|
+
children: /* @__PURE__ */ P(Vt, {
|
|
1637
1631
|
command: t,
|
|
1638
1632
|
schedulerModel: s,
|
|
1639
1633
|
agents: c,
|
|
@@ -1643,34 +1637,37 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1643
1637
|
onChange: (e) => (T(e), j(void 0))
|
|
1644
1638
|
})
|
|
1645
1639
|
}),
|
|
1646
|
-
|
|
1640
|
+
/* @__PURE__ */ F($, {
|
|
1647
1641
|
title: "What its runs publish",
|
|
1648
|
-
children: /* @__PURE__ */
|
|
1642
|
+
children: [/* @__PURE__ */ P(Bt, {
|
|
1649
1643
|
gitHost: e.gitHost,
|
|
1650
1644
|
own: Y(t),
|
|
1651
1645
|
pick: E,
|
|
1652
1646
|
disabled: O,
|
|
1653
1647
|
onChange: (e) => (D(e), j(void 0))
|
|
1654
|
-
})
|
|
1648
|
+
}), t.each && /* @__PURE__ */ F("p", {
|
|
1649
|
+
className: "text-sm text-muted-foreground",
|
|
1650
|
+
children: ["A run it continues goes on with the coding agent, model and publish level that started it", "."]
|
|
1651
|
+
})]
|
|
1655
1652
|
}),
|
|
1656
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ P("p", {
|
|
1657
1654
|
className: "rounded-md border border-border bg-background px-3 py-2 text-sm",
|
|
1658
|
-
children:
|
|
1655
|
+
children: W ?? (U ? oe : `${oe} Nothing is changed yet.`)
|
|
1659
1656
|
}),
|
|
1660
|
-
A !== void 0 && /* @__PURE__ */
|
|
1657
|
+
A !== void 0 && /* @__PURE__ */ P("p", {
|
|
1661
1658
|
role: "alert",
|
|
1662
1659
|
className: "text-xs text-danger",
|
|
1663
1660
|
children: A
|
|
1664
1661
|
}),
|
|
1665
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ F("div", {
|
|
1666
1663
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
1667
|
-
children: [/* @__PURE__ */
|
|
1664
|
+
children: [/* @__PURE__ */ P("p", {
|
|
1668
1665
|
className: "min-w-0 flex-1 text-xs text-muted-foreground",
|
|
1669
|
-
children:
|
|
1670
|
-
}), /* @__PURE__ */
|
|
1666
|
+
children: kt(r)
|
|
1667
|
+
}), /* @__PURE__ */ F("div", {
|
|
1671
1668
|
className: "flex gap-2",
|
|
1672
1669
|
children: [
|
|
1673
|
-
t.editable && r && /* @__PURE__ */
|
|
1670
|
+
t.editable && r && /* @__PURE__ */ P(o, {
|
|
1674
1671
|
variant: "outline",
|
|
1675
1672
|
size: "sm",
|
|
1676
1673
|
disabled: O,
|
|
@@ -1678,17 +1675,17 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1678
1675
|
className: "text-danger",
|
|
1679
1676
|
children: "Remove"
|
|
1680
1677
|
}),
|
|
1681
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ P(o, {
|
|
1682
1679
|
variant: "outline",
|
|
1683
1680
|
size: "sm",
|
|
1684
1681
|
disabled: O,
|
|
1685
1682
|
onClick: f,
|
|
1686
1683
|
children: "Cancel"
|
|
1687
1684
|
}),
|
|
1688
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ P(o, {
|
|
1689
1686
|
size: "sm",
|
|
1690
|
-
disabled: O ||
|
|
1691
|
-
onClick: () => void
|
|
1687
|
+
disabled: O || W !== void 0 || !U,
|
|
1688
|
+
onClick: () => void se(),
|
|
1692
1689
|
children: "Save"
|
|
1693
1690
|
})
|
|
1694
1691
|
]
|
|
@@ -1699,9 +1696,9 @@ function qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s
|
|
|
1699
1696
|
}
|
|
1700
1697
|
//#endregion
|
|
1701
1698
|
//#region dashboard/AutomationsPage.tsx
|
|
1702
|
-
var
|
|
1703
|
-
function
|
|
1704
|
-
let t =
|
|
1699
|
+
var qt = [], Jt = "no skill of this project schedules a command";
|
|
1700
|
+
function Yt({ projects: e }) {
|
|
1701
|
+
let t = M(), r = ne(), { value: s, loaded: c, reload: l } = re(() => je(t, e), qt, 1e4, [e.map((e) => e.id).join(",")]), u = i(/* @__PURE__ */ new Map()), d = s.map((e) => {
|
|
1705
1702
|
e.error === void 0 && u.current.set(e.project.id, e);
|
|
1706
1703
|
let t = u.current.get(e.project.id);
|
|
1707
1704
|
return e.error !== void 0 && t ? {
|
|
@@ -1710,7 +1707,7 @@ function Xt({ projects: e }) {
|
|
|
1710
1707
|
} : e;
|
|
1711
1708
|
}), [f, p] = a([]), [m, h] = a(), [g, _] = a(), [v, y] = a(), [b, x] = a(!1), S = i(!1), C = (e) => {
|
|
1712
1709
|
S.current = e, x(e);
|
|
1713
|
-
}, [T, j] = a(),
|
|
1710
|
+
}, [T, j] = a(), N = i(0), I = b && (g !== void 0 || v !== void 0);
|
|
1714
1711
|
n(() => {
|
|
1715
1712
|
c && (g && !d.some((e) => e.commands.some((t) => `${e.project.id}/${t.command}` === g.id)) && _(void 0), v !== void 0 && !d.some((e) => e.project.id === v) && y(void 0));
|
|
1716
1713
|
}, [
|
|
@@ -1719,18 +1716,18 @@ function Xt({ projects: e }) {
|
|
|
1719
1716
|
g,
|
|
1720
1717
|
v
|
|
1721
1718
|
]);
|
|
1722
|
-
let
|
|
1723
|
-
_((t) => t?.id === e ? void 0 : t), setTimeout(() =>
|
|
1724
|
-
},
|
|
1725
|
-
let r =
|
|
1719
|
+
let L = i(/* @__PURE__ */ new Map()), R = (e) => {
|
|
1720
|
+
_((t) => t?.id === e ? void 0 : t), setTimeout(() => L.current.get(e)?.focus());
|
|
1721
|
+
}, ie = i(Promise.resolve()), z = (e, n) => {
|
|
1722
|
+
let r = ie.current.then(() => t.runCommand(e.id, n).catch((e) => ({
|
|
1726
1723
|
ok: !1,
|
|
1727
1724
|
error: e instanceof Error ? e.message : String(e)
|
|
1728
1725
|
})));
|
|
1729
|
-
return
|
|
1730
|
-
},
|
|
1726
|
+
return ie.current = r, r;
|
|
1727
|
+
}, ae = (e, n) => t.runCommand(e.id, n).catch((e) => ({
|
|
1731
1728
|
ok: !1,
|
|
1732
1729
|
error: e instanceof Error ? e.message : String(e)
|
|
1733
|
-
})),
|
|
1730
|
+
})), B = async (e, t, n, r) => {
|
|
1734
1731
|
p((t) => [...t, e]), h((t) => t?.id === e ? void 0 : t);
|
|
1735
1732
|
let i = await n;
|
|
1736
1733
|
await l().catch(() => {}), p((t) => t.filter((n, r) => r !== t.indexOf(e)));
|
|
@@ -1739,72 +1736,72 @@ function Xt({ projects: e }) {
|
|
|
1739
1736
|
id: e,
|
|
1740
1737
|
...a
|
|
1741
1738
|
});
|
|
1742
|
-
},
|
|
1743
|
-
let r = ++
|
|
1739
|
+
}, V = async (e, t, n) => {
|
|
1740
|
+
let r = ++N.current;
|
|
1744
1741
|
if (h((t) => t?.id === e ? void 0 : t), !n.editable) return y(void 0), _({ id: e });
|
|
1745
1742
|
p((t) => [...t, e]);
|
|
1746
|
-
let i = await
|
|
1747
|
-
if (p((t) => t.filter((n, r) => r !== t.indexOf(e))),
|
|
1748
|
-
let a = i.ok ?
|
|
1743
|
+
let i = await ae(t, ["show", n.command]);
|
|
1744
|
+
if (p((t) => t.filter((n, r) => r !== t.indexOf(e))), N.current !== r || S.current) return;
|
|
1745
|
+
let a = i.ok ? pt(i.output) : void 0;
|
|
1749
1746
|
y(void 0), _({
|
|
1750
1747
|
id: e,
|
|
1751
1748
|
...a ? { opened: a } : { refused: i.ok ? "its file holds something this panel cannot show" : i.error }
|
|
1752
1749
|
});
|
|
1753
1750
|
};
|
|
1754
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ F("div", {
|
|
1755
1752
|
className: "flex min-h-0 flex-1 flex-col overflow-y-auto p-6 max-md:p-4",
|
|
1756
1753
|
children: [
|
|
1757
|
-
/* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ P("h1", {
|
|
1758
1755
|
className: "text-lg font-semibold",
|
|
1759
1756
|
children: "Automations"
|
|
1760
1757
|
}),
|
|
1761
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ P("p", {
|
|
1762
1759
|
className: "mt-1 text-sm text-muted-foreground",
|
|
1763
1760
|
children: "What starts by itself while nobody is at the keyboard. Every row starts switched off: it runs on this machine only once you switch it on here."
|
|
1764
1761
|
}),
|
|
1765
|
-
!c && /* @__PURE__ */
|
|
1762
|
+
!c && /* @__PURE__ */ P("p", {
|
|
1766
1763
|
className: "mt-6 text-sm text-muted-foreground",
|
|
1767
1764
|
children: "Loading…"
|
|
1768
1765
|
}),
|
|
1769
1766
|
d.map((e) => {
|
|
1770
|
-
let n =
|
|
1771
|
-
return /* @__PURE__ */
|
|
1767
|
+
let n = lt(e), i = e.lastTick?.note, a = [["Your automations", e.commands.filter(Y)], ["From the project's skills", e.commands.filter((e) => !Y(e))]];
|
|
1768
|
+
return /* @__PURE__ */ F("section", {
|
|
1772
1769
|
"aria-label": e.project.name,
|
|
1773
1770
|
className: "mt-6",
|
|
1774
1771
|
children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1772
|
+
/* @__PURE__ */ F("div", {
|
|
1776
1773
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1 border-b border-border pb-2",
|
|
1777
1774
|
children: [
|
|
1778
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ P("h2", {
|
|
1779
1776
|
className: "text-sm font-semibold",
|
|
1780
1777
|
children: e.project.name
|
|
1781
1778
|
}),
|
|
1782
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ F("span", {
|
|
1783
1780
|
className: A("text-xs font-medium", n.tone),
|
|
1784
1781
|
children: ["Scheduler ", n.label]
|
|
1785
1782
|
}),
|
|
1786
|
-
e.model && /* @__PURE__ */
|
|
1783
|
+
e.model && /* @__PURE__ */ P("span", {
|
|
1787
1784
|
className: "text-xs text-muted-foreground",
|
|
1788
1785
|
children: e.model
|
|
1789
1786
|
}),
|
|
1790
|
-
e.lastTick && /* @__PURE__ */
|
|
1787
|
+
e.lastTick && /* @__PURE__ */ F("span", {
|
|
1791
1788
|
className: "text-xs text-muted-foreground",
|
|
1792
1789
|
children: [
|
|
1793
1790
|
"last tick",
|
|
1794
1791
|
" ",
|
|
1795
|
-
/* @__PURE__ */
|
|
1796
|
-
render: /* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ F(E, { children: [/* @__PURE__ */ P(O, {
|
|
1793
|
+
render: /* @__PURE__ */ P("span", { className: "tabular-nums" }),
|
|
1797
1794
|
children: ee(e.lastTick.at)
|
|
1798
|
-
}), /* @__PURE__ */
|
|
1799
|
-
i !== void 0 && i !== "off" && i !==
|
|
1795
|
+
}), /* @__PURE__ */ P(D, { children: te(e.lastTick.at) })] }),
|
|
1796
|
+
i !== void 0 && i !== "off" && i !== Jt && `: ${i}`
|
|
1800
1797
|
]
|
|
1801
1798
|
}),
|
|
1802
|
-
e.error === void 0 && v !== e.project.id && /* @__PURE__ */
|
|
1799
|
+
e.error === void 0 && v !== e.project.id && /* @__PURE__ */ P(o, {
|
|
1803
1800
|
variant: "outline",
|
|
1804
1801
|
size: "xs",
|
|
1805
|
-
disabled:
|
|
1802
|
+
disabled: I,
|
|
1806
1803
|
onClick: () => {
|
|
1807
|
-
|
|
1804
|
+
N.current++, _(void 0), y(e.project.id);
|
|
1808
1805
|
},
|
|
1809
1806
|
"aria-label": `New automation in ${e.project.name}`,
|
|
1810
1807
|
className: "ml-auto",
|
|
@@ -1812,109 +1809,109 @@ function Xt({ projects: e }) {
|
|
|
1812
1809
|
})
|
|
1813
1810
|
]
|
|
1814
1811
|
}),
|
|
1815
|
-
v === e.project.id && /* @__PURE__ */
|
|
1812
|
+
v === e.project.id && /* @__PURE__ */ P(Ht, {
|
|
1816
1813
|
project: e.project,
|
|
1817
|
-
run: (t) =>
|
|
1814
|
+
run: (t) => z(e.project, t),
|
|
1818
1815
|
onDirty: C,
|
|
1819
1816
|
onClose: () => y(void 0),
|
|
1820
1817
|
onSaved: () => void l().catch(() => {})
|
|
1821
1818
|
}),
|
|
1822
|
-
T?.project === e.project.id && /* @__PURE__ */
|
|
1819
|
+
T?.project === e.project.id && /* @__PURE__ */ F("div", {
|
|
1823
1820
|
role: "status",
|
|
1824
1821
|
"aria-label": "Removed",
|
|
1825
1822
|
className: "mt-3 flex items-start justify-between gap-3 rounded-md border border-border bg-muted/40 p-3 text-sm",
|
|
1826
|
-
children: [/* @__PURE__ */
|
|
1823
|
+
children: [/* @__PURE__ */ P("p", { children: T.text }), /* @__PURE__ */ P(o, {
|
|
1827
1824
|
variant: "outline",
|
|
1828
1825
|
size: "sm",
|
|
1829
1826
|
onClick: () => j(void 0),
|
|
1830
1827
|
children: "Done"
|
|
1831
1828
|
})]
|
|
1832
1829
|
}),
|
|
1833
|
-
e.error !== void 0 && /* @__PURE__ */
|
|
1830
|
+
e.error !== void 0 && /* @__PURE__ */ P("p", {
|
|
1834
1831
|
role: "alert",
|
|
1835
1832
|
className: "py-3 text-sm text-danger",
|
|
1836
1833
|
children: `The scheduler could not be read: ${e.error}`
|
|
1837
1834
|
}),
|
|
1838
|
-
e.error === void 0 && !e.on && /* @__PURE__ */
|
|
1835
|
+
e.error === void 0 && !e.on && /* @__PURE__ */ P("p", {
|
|
1839
1836
|
className: "py-3 text-sm text-muted-foreground",
|
|
1840
1837
|
children: "The scheduler is off in this project, so nothing here starts by itself. It starts with the dashboard once the project has run `npx @openagt/skill-scheduler@0.1 init`, or by hand with `npx @openagt/skill-scheduler@0.1 start`."
|
|
1841
1838
|
}),
|
|
1842
|
-
e.error === void 0 && e.on && !e.running && /* @__PURE__ */
|
|
1839
|
+
e.error === void 0 && e.on && !e.running && /* @__PURE__ */ P("p", {
|
|
1843
1840
|
className: "py-3 text-sm text-warning",
|
|
1844
1841
|
children: "The scheduler is on but its process is not running, so nothing here starts by itself. `npx @openagt/skill-scheduler@0.1 start`, run in the project, starts it."
|
|
1845
1842
|
}),
|
|
1846
|
-
e.unreadable.map((e, t) => /* @__PURE__ */
|
|
1843
|
+
e.unreadable.map((e, t) => /* @__PURE__ */ P("p", {
|
|
1847
1844
|
role: "alert",
|
|
1848
1845
|
className: "py-3 text-sm text-danger",
|
|
1849
|
-
children:
|
|
1846
|
+
children: Te(e)
|
|
1850
1847
|
}, `${t}/${e.skill}`)),
|
|
1851
|
-
e.error === void 0 && e.commands.length === 0 && e.unreadable.length === 0 && /* @__PURE__ */
|
|
1848
|
+
e.error === void 0 && e.commands.length === 0 && e.unreadable.length === 0 && /* @__PURE__ */ P("p", {
|
|
1852
1849
|
className: "py-3 text-sm text-muted-foreground",
|
|
1853
1850
|
children: "Nothing here: no skill of this project says it can be scheduled."
|
|
1854
1851
|
}),
|
|
1855
|
-
a.map(([n, i]) => i.length > 0 && /* @__PURE__ */
|
|
1852
|
+
a.map(([n, i]) => i.length > 0 && /* @__PURE__ */ F("div", {
|
|
1856
1853
|
role: "group",
|
|
1857
1854
|
"aria-label": n,
|
|
1858
1855
|
className: "mt-4",
|
|
1859
|
-
children: [/* @__PURE__ */
|
|
1856
|
+
children: [/* @__PURE__ */ P("h3", {
|
|
1860
1857
|
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
1861
1858
|
children: n
|
|
1862
|
-
}), /* @__PURE__ */
|
|
1859
|
+
}), /* @__PURE__ */ P("ul", {
|
|
1863
1860
|
className: "mt-2 divide-y divide-border rounded-lg border border-border",
|
|
1864
1861
|
children: i.map((n) => {
|
|
1865
|
-
let i = `${e.project.id}/${n.command}`, a =
|
|
1866
|
-
return /* @__PURE__ */
|
|
1862
|
+
let i = `${e.project.id}/${n.command}`, a = we(n), s = f.includes(i), c = g?.id === i ? g : void 0, d = m?.id === i ? m : void 0;
|
|
1863
|
+
return /* @__PURE__ */ F("li", {
|
|
1867
1864
|
"aria-label": a,
|
|
1868
1865
|
className: A("p-4", s && "opacity-60"),
|
|
1869
1866
|
children: [
|
|
1870
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ F("div", {
|
|
1871
1868
|
className: "flex items-start justify-between gap-4 max-md:flex-col",
|
|
1872
|
-
children: [/* @__PURE__ */
|
|
1869
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1873
1870
|
className: "min-w-0",
|
|
1874
1871
|
children: [
|
|
1875
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ F("p", {
|
|
1876
1873
|
className: "flex flex-wrap items-baseline gap-x-2 text-sm",
|
|
1877
|
-
children: [/* @__PURE__ */
|
|
1874
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1878
1875
|
className: "font-mono font-medium",
|
|
1879
1876
|
children: a
|
|
1880
|
-
}), Y(n) && /* @__PURE__ */
|
|
1877
|
+
}), Y(n) && /* @__PURE__ */ P("span", {
|
|
1881
1878
|
className: "text-xs text-info",
|
|
1882
1879
|
children: n.onThisMachine ? "only on this machine" : "shared with the project"
|
|
1883
1880
|
})]
|
|
1884
1881
|
}),
|
|
1885
|
-
n.description && /* @__PURE__ */
|
|
1882
|
+
n.description && /* @__PURE__ */ P("p", {
|
|
1886
1883
|
className: "line-clamp-2 text-sm text-muted-foreground",
|
|
1887
1884
|
children: n.description
|
|
1888
1885
|
}),
|
|
1889
|
-
/* @__PURE__ */
|
|
1886
|
+
/* @__PURE__ */ P(Zt, {
|
|
1890
1887
|
host: t,
|
|
1891
1888
|
project: e.project,
|
|
1892
1889
|
scheduled: n
|
|
1893
1890
|
}),
|
|
1894
|
-
!c && /* @__PURE__ */
|
|
1891
|
+
!c && /* @__PURE__ */ P(Qt, {
|
|
1895
1892
|
scheduled: n,
|
|
1896
1893
|
schedulerModel: e.model,
|
|
1897
1894
|
agents: r
|
|
1898
1895
|
})
|
|
1899
1896
|
]
|
|
1900
|
-
}), /* @__PURE__ */
|
|
1897
|
+
}), /* @__PURE__ */ F("div", {
|
|
1901
1898
|
className: "flex shrink-0 items-center gap-2",
|
|
1902
1899
|
children: [
|
|
1903
|
-
/* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ P(o, {
|
|
1904
1901
|
variant: "outline",
|
|
1905
1902
|
size: "xs",
|
|
1906
|
-
disabled: s ||
|
|
1907
|
-
onClick: () => void
|
|
1903
|
+
disabled: s || $e(n) !== void 0,
|
|
1904
|
+
onClick: () => void B(i, e.project, ae(e.project, ["now", n.command]), Xt),
|
|
1908
1905
|
"aria-label": `Run ${a} now`,
|
|
1909
1906
|
children: "Run now"
|
|
1910
1907
|
}),
|
|
1911
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ P("button", {
|
|
1912
1909
|
type: "button",
|
|
1913
1910
|
ref: (e) => {
|
|
1914
|
-
e ?
|
|
1911
|
+
e ? L.current.set(i, e) : L.current.delete(i);
|
|
1915
1912
|
},
|
|
1916
|
-
disabled: s || c !== void 0 ||
|
|
1917
|
-
onClick: () => void
|
|
1913
|
+
disabled: s || c !== void 0 || I,
|
|
1914
|
+
onClick: () => void V(i, e.project, n),
|
|
1918
1915
|
"aria-label": `Edit ${a}`,
|
|
1919
1916
|
className: k({
|
|
1920
1917
|
variant: "outline",
|
|
@@ -1922,10 +1919,10 @@ function Xt({ projects: e }) {
|
|
|
1922
1919
|
}),
|
|
1923
1920
|
children: "Edit"
|
|
1924
1921
|
}),
|
|
1925
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ P(w, {
|
|
1926
1923
|
checked: n.on,
|
|
1927
1924
|
disabled: s,
|
|
1928
|
-
onCheckedChange: (t) => void
|
|
1925
|
+
onCheckedChange: (t) => void B(i, e.project, z(e.project, [
|
|
1929
1926
|
"switch",
|
|
1930
1927
|
n.command,
|
|
1931
1928
|
t ? "on" : "off"
|
|
@@ -1935,17 +1932,17 @@ function Xt({ projects: e }) {
|
|
|
1935
1932
|
]
|
|
1936
1933
|
})]
|
|
1937
1934
|
}),
|
|
1938
|
-
c && /* @__PURE__ */
|
|
1935
|
+
c && /* @__PURE__ */ P(Kt, {
|
|
1939
1936
|
project: e.project,
|
|
1940
1937
|
scheduled: n,
|
|
1941
1938
|
opened: c.opened,
|
|
1942
1939
|
refused: c.refused,
|
|
1943
1940
|
schedulerModel: e.model,
|
|
1944
1941
|
agents: r,
|
|
1945
|
-
run: (t) =>
|
|
1942
|
+
run: (t) => z(e.project, t),
|
|
1946
1943
|
reload: l,
|
|
1947
1944
|
onDirty: C,
|
|
1948
|
-
onClose: () =>
|
|
1945
|
+
onClose: () => R(i),
|
|
1949
1946
|
onRemoved: (t) => {
|
|
1950
1947
|
_(void 0), j({
|
|
1951
1948
|
project: e.project.id,
|
|
@@ -1958,13 +1955,13 @@ function Xt({ projects: e }) {
|
|
|
1958
1955
|
});
|
|
1959
1956
|
}
|
|
1960
1957
|
}),
|
|
1961
|
-
d?.started !== void 0 && /* @__PURE__ */
|
|
1958
|
+
d?.started !== void 0 && /* @__PURE__ */ F("p", {
|
|
1962
1959
|
role: "status",
|
|
1963
1960
|
className: "mt-2 text-xs text-success",
|
|
1964
1961
|
children: [
|
|
1965
|
-
|
|
1962
|
+
d.resumed ? "Resumed a run." : "Started a run.",
|
|
1966
1963
|
" ",
|
|
1967
|
-
d.started !== "" && /* @__PURE__ */
|
|
1964
|
+
d.started !== "" && /* @__PURE__ */ P("button", {
|
|
1968
1965
|
type: "button",
|
|
1969
1966
|
onClick: () => t.openAgent(e.project.id, d.started),
|
|
1970
1967
|
className: "underline",
|
|
@@ -1972,12 +1969,12 @@ function Xt({ projects: e }) {
|
|
|
1972
1969
|
})
|
|
1973
1970
|
]
|
|
1974
1971
|
}),
|
|
1975
|
-
d?.note !== void 0 && /* @__PURE__ */
|
|
1972
|
+
d?.note !== void 0 && /* @__PURE__ */ P("p", {
|
|
1976
1973
|
role: "status",
|
|
1977
1974
|
className: "mt-2 text-xs text-muted-foreground",
|
|
1978
1975
|
children: d.note
|
|
1979
1976
|
}),
|
|
1980
|
-
d?.failed !== void 0 && /* @__PURE__ */
|
|
1977
|
+
d?.failed !== void 0 && /* @__PURE__ */ P("p", {
|
|
1981
1978
|
role: "alert",
|
|
1982
1979
|
className: "mt-2 text-xs text-danger",
|
|
1983
1980
|
children: d.failed
|
|
@@ -1993,39 +1990,42 @@ function Xt({ projects: e }) {
|
|
|
1993
1990
|
]
|
|
1994
1991
|
});
|
|
1995
1992
|
}
|
|
1996
|
-
function
|
|
1993
|
+
function Xt(e) {
|
|
1997
1994
|
if (e.ok) {
|
|
1998
|
-
let t = typeof e.output == "object" && e.output !== null ? e.output
|
|
1999
|
-
return {
|
|
1995
|
+
let t = typeof e.output == "object" && e.output !== null ? e.output : {};
|
|
1996
|
+
return {
|
|
1997
|
+
started: typeof t.run == "string" ? t.run : "",
|
|
1998
|
+
...t.resumed === !0 ? { resumed: !0 } : {}
|
|
1999
|
+
};
|
|
2000
2000
|
}
|
|
2001
2001
|
if (e.error === "not due") return { note: "Nothing started. No work: its shell line printed nothing." };
|
|
2002
|
-
if (e.error.startsWith("cap reached ")) return { note: `Nothing started. ${
|
|
2002
|
+
if (e.error.startsWith("cap reached ")) return { note: `Nothing started. ${tt(e.error)}.` };
|
|
2003
2003
|
if (e.error.endsWith(" took too long")) return { failed: "No answer in time. A run may have started all the same: if one did, the row says when it last ran." };
|
|
2004
|
-
let t =
|
|
2004
|
+
let t = tt(e.error) ?? e.error;
|
|
2005
2005
|
return { failed: `Nothing started. ${/[.!?]$/.test(t) ? t : `${t}.`}` };
|
|
2006
2006
|
}
|
|
2007
|
-
function
|
|
2008
|
-
let r = n.lastRun, i =
|
|
2009
|
-
return /* @__PURE__ */
|
|
2007
|
+
function Zt({ host: e, project: t, scheduled: n }) {
|
|
2008
|
+
let r = n.lastRun, i = Ze(n);
|
|
2009
|
+
return /* @__PURE__ */ F("p", {
|
|
2010
2010
|
className: "mt-1 flex flex-wrap items-center gap-x-2 text-xs",
|
|
2011
2011
|
children: [
|
|
2012
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ F("span", {
|
|
2013
2013
|
className: A("inline-flex items-center gap-1.5 font-medium", n.on ? "text-success" : "text-muted-foreground"),
|
|
2014
|
-
children: [/* @__PURE__ */
|
|
2014
|
+
children: [/* @__PURE__ */ P("span", {
|
|
2015
2015
|
"aria-hidden": !0,
|
|
2016
2016
|
className: A("h-1.5 w-1.5 rounded-full", n.on ? "bg-success" : "bg-muted-foreground/50")
|
|
2017
2017
|
}), n.on ? "On" : "Off"]
|
|
2018
2018
|
}),
|
|
2019
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ P("span", {
|
|
2020
2020
|
"aria-hidden": !0,
|
|
2021
2021
|
className: "text-muted-foreground",
|
|
2022
2022
|
children: "·"
|
|
2023
2023
|
}),
|
|
2024
|
-
r === void 0 ? /* @__PURE__ */
|
|
2024
|
+
r === void 0 ? /* @__PURE__ */ P("span", {
|
|
2025
2025
|
className: "text-muted-foreground",
|
|
2026
2026
|
children: "Never ran"
|
|
2027
|
-
}) : /* @__PURE__ */
|
|
2028
|
-
render: /* @__PURE__ */
|
|
2027
|
+
}) : /* @__PURE__ */ F(E, { children: [/* @__PURE__ */ F(O, {
|
|
2028
|
+
render: /* @__PURE__ */ P("button", {
|
|
2029
2029
|
type: "button",
|
|
2030
2030
|
onClick: () => e.openAgent(t.id, r.id),
|
|
2031
2031
|
className: A("underline", r.failed ? "text-danger" : "text-muted-foreground hover:text-foreground")
|
|
@@ -2033,155 +2033,156 @@ function Qt({ host: e, project: t, scheduled: n }) {
|
|
|
2033
2033
|
children: [
|
|
2034
2034
|
r.failed ? "Last run failed" : "Last ran",
|
|
2035
2035
|
" ",
|
|
2036
|
-
/* @__PURE__ */
|
|
2036
|
+
/* @__PURE__ */ P("span", {
|
|
2037
2037
|
className: "tabular-nums",
|
|
2038
2038
|
children: ee(r.at)
|
|
2039
2039
|
})
|
|
2040
2040
|
]
|
|
2041
|
-
}), /* @__PURE__ */
|
|
2042
|
-
i !== void 0 && /* @__PURE__ */
|
|
2041
|
+
}), /* @__PURE__ */ P(D, { children: te(r.at) })] }),
|
|
2042
|
+
i !== void 0 && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
|
|
2043
2043
|
"aria-hidden": !0,
|
|
2044
2044
|
className: "text-muted-foreground",
|
|
2045
2045
|
children: "·"
|
|
2046
|
-
}), /* @__PURE__ */
|
|
2047
|
-
className:
|
|
2046
|
+
}), /* @__PURE__ */ P("span", {
|
|
2047
|
+
className: $e(n) ? "text-warning" : "text-muted-foreground",
|
|
2048
2048
|
children: i
|
|
2049
2049
|
})] })
|
|
2050
2050
|
]
|
|
2051
2051
|
});
|
|
2052
2052
|
}
|
|
2053
|
-
function
|
|
2053
|
+
function Qt({ scheduled: e, schedulerModel: t, agents: n }) {
|
|
2054
2054
|
let r = !Y(e);
|
|
2055
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ F("p", {
|
|
2056
2056
|
className: "mt-1 flex flex-wrap gap-x-2 text-xs text-muted-foreground",
|
|
2057
2057
|
children: [
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
r &&
|
|
2058
|
+
/* @__PURE__ */ P("span", { children: Be(e) }),
|
|
2059
|
+
r && Ve(e) && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
|
|
2060
2060
|
"aria-hidden": !0,
|
|
2061
2061
|
children: "·"
|
|
2062
|
-
}), /* @__PURE__ */
|
|
2062
|
+
}), /* @__PURE__ */ P("span", {
|
|
2063
2063
|
className: "text-info",
|
|
2064
2064
|
children: "your pick"
|
|
2065
2065
|
})] }),
|
|
2066
|
-
|
|
2067
|
-
/* @__PURE__ */
|
|
2066
|
+
Ke(e) && /* @__PURE__ */ F(N, { children: [
|
|
2067
|
+
/* @__PURE__ */ P("span", {
|
|
2068
2068
|
"aria-hidden": !0,
|
|
2069
2069
|
children: "·"
|
|
2070
2070
|
}),
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
r && e.agents !== void 0 && /* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ P("span", { children: qe(Ge(e)) }),
|
|
2072
|
+
r && e.agents !== void 0 && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
|
|
2073
2073
|
"aria-hidden": !0,
|
|
2074
2074
|
children: "·"
|
|
2075
|
-
}), /* @__PURE__ */
|
|
2075
|
+
}), /* @__PURE__ */ P("span", {
|
|
2076
2076
|
className: "text-info",
|
|
2077
2077
|
children: "your pick"
|
|
2078
2078
|
})] })
|
|
2079
2079
|
] }),
|
|
2080
|
-
/* @__PURE__ */
|
|
2080
|
+
/* @__PURE__ */ P("span", {
|
|
2081
2081
|
"aria-hidden": !0,
|
|
2082
2082
|
children: "·"
|
|
2083
2083
|
}),
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
r &&
|
|
2084
|
+
/* @__PURE__ */ P("span", { children: Se(e, t, n) }),
|
|
2085
|
+
r && (e.runsOn !== void 0 || e.model !== void 0) && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
|
|
2086
2086
|
"aria-hidden": !0,
|
|
2087
2087
|
children: "·"
|
|
2088
|
-
}), /* @__PURE__ */
|
|
2088
|
+
}), /* @__PURE__ */ P("span", {
|
|
2089
2089
|
className: "text-info",
|
|
2090
2090
|
children: "your pick"
|
|
2091
2091
|
})] }),
|
|
2092
|
-
|
|
2092
|
+
/* @__PURE__ */ P("span", {
|
|
2093
2093
|
"aria-hidden": !0,
|
|
2094
2094
|
children: "·"
|
|
2095
|
-
}),
|
|
2095
|
+
}),
|
|
2096
|
+
/* @__PURE__ */ P("span", { children: Xe(e) })
|
|
2096
2097
|
]
|
|
2097
2098
|
});
|
|
2098
2099
|
}
|
|
2099
2100
|
//#endregion
|
|
2100
2101
|
//#region dashboard/SchedulerCard.tsx
|
|
2101
|
-
var
|
|
2102
|
-
function
|
|
2102
|
+
var $t = [];
|
|
2103
|
+
function en(e, t) {
|
|
2103
2104
|
if (e !== 0) return t === 0 ? e === 1 ? "Its one automation is switched off" : `All ${e} are switched off` : e === 1 ? "1 more is switched off" : `${e} more are switched off`;
|
|
2104
2105
|
}
|
|
2105
|
-
function
|
|
2106
|
-
let t =
|
|
2107
|
-
return /* @__PURE__ */
|
|
2108
|
-
icon: /* @__PURE__ */
|
|
2106
|
+
function tn({ projects: e }) {
|
|
2107
|
+
let t = M(), { value: n, loaded: r } = re(() => je(t, e), $t, 1e4, [e.map((e) => e.id).join(",")]), i = () => t.openPage("automations");
|
|
2108
|
+
return /* @__PURE__ */ F(s, { children: [/* @__PURE__ */ F(l, { children: [/* @__PURE__ */ P(u, {
|
|
2109
|
+
icon: /* @__PURE__ */ P(z, {
|
|
2109
2110
|
className: "h-4 w-4 text-muted-foreground",
|
|
2110
2111
|
"aria-hidden": !0
|
|
2111
2112
|
}),
|
|
2112
2113
|
segment: "automations",
|
|
2113
2114
|
onOpen: i,
|
|
2114
2115
|
children: "Automations"
|
|
2115
|
-
}), /* @__PURE__ */
|
|
2116
|
+
}), /* @__PURE__ */ P("p", {
|
|
2116
2117
|
className: "text-xs text-muted-foreground",
|
|
2117
2118
|
children: "What starts by itself while nobody is at the keyboard"
|
|
2118
|
-
})] }), /* @__PURE__ */
|
|
2119
|
+
})] }), /* @__PURE__ */ P(c, { children: r ? /* @__PURE__ */ P("ul", {
|
|
2119
2120
|
className: "space-y-4",
|
|
2120
2121
|
children: n.map((n) => {
|
|
2121
|
-
let r =
|
|
2122
|
-
return /* @__PURE__ */
|
|
2122
|
+
let r = lt(n), a = at(n), o = n.commands.filter((e) => e.on), s = en(n.commands.length - o.length, o.length);
|
|
2123
|
+
return /* @__PURE__ */ F("li", {
|
|
2123
2124
|
"aria-label": n.project.name,
|
|
2124
2125
|
children: [
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
+
/* @__PURE__ */ F("div", {
|
|
2126
2127
|
className: "flex items-center gap-2",
|
|
2127
2128
|
children: [
|
|
2128
|
-
e.length > 1 && /* @__PURE__ */
|
|
2129
|
+
e.length > 1 && /* @__PURE__ */ P("span", {
|
|
2129
2130
|
className: "truncate text-sm font-medium",
|
|
2130
2131
|
children: n.project.name
|
|
2131
2132
|
}),
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ F("span", {
|
|
2133
2134
|
className: A("shrink-0 text-xs font-medium", r.tone),
|
|
2134
2135
|
children: ["Scheduler ", r.label]
|
|
2135
2136
|
}),
|
|
2136
|
-
n.keepAlive && /* @__PURE__ */
|
|
2137
|
+
n.keepAlive && /* @__PURE__ */ P("span", {
|
|
2137
2138
|
className: "shrink-0 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",
|
|
2138
2139
|
children: "keep-alive"
|
|
2139
2140
|
}),
|
|
2140
|
-
n.lastTick && /* @__PURE__ */
|
|
2141
|
+
n.lastTick && /* @__PURE__ */ F("span", {
|
|
2141
2142
|
className: "ml-auto shrink-0 text-xs text-muted-foreground",
|
|
2142
2143
|
children: [
|
|
2143
2144
|
"looked",
|
|
2144
2145
|
" ",
|
|
2145
|
-
/* @__PURE__ */
|
|
2146
|
-
render: /* @__PURE__ */
|
|
2146
|
+
/* @__PURE__ */ F(E, { children: [/* @__PURE__ */ P(O, {
|
|
2147
|
+
render: /* @__PURE__ */ P("span", { className: "tabular-nums" }),
|
|
2147
2148
|
children: ee(n.lastTick.at)
|
|
2148
|
-
}), /* @__PURE__ */
|
|
2149
|
+
}), /* @__PURE__ */ F(D, { children: ["The scheduler last looked ", te(n.lastTick.at)] })] })
|
|
2149
2150
|
]
|
|
2150
2151
|
})
|
|
2151
2152
|
]
|
|
2152
2153
|
}),
|
|
2153
|
-
n.error !== void 0 && /* @__PURE__ */
|
|
2154
|
+
n.error !== void 0 && /* @__PURE__ */ P("p", {
|
|
2154
2155
|
className: "mt-1 text-xs text-muted-foreground",
|
|
2155
2156
|
children: n.error
|
|
2156
2157
|
}),
|
|
2157
|
-
n.lastTick?.note && a === void 0 && /* @__PURE__ */
|
|
2158
|
+
n.lastTick?.note && a === void 0 && /* @__PURE__ */ F("p", {
|
|
2158
2159
|
className: "mt-1 text-xs text-muted-foreground",
|
|
2159
2160
|
children: ["Its last look: ", n.lastTick.note]
|
|
2160
2161
|
}),
|
|
2161
|
-
a !== void 0 && n.error === void 0 && o.length > 0 && /* @__PURE__ */
|
|
2162
|
+
a !== void 0 && n.error === void 0 && o.length > 0 && /* @__PURE__ */ F("p", {
|
|
2162
2163
|
className: "mt-1 text-xs text-warning",
|
|
2163
2164
|
children: [a, ": nothing starts by itself."]
|
|
2164
2165
|
}),
|
|
2165
|
-
o.length > 0 && /* @__PURE__ */
|
|
2166
|
+
o.length > 0 && /* @__PURE__ */ P("ul", {
|
|
2166
2167
|
className: "mt-2 space-y-1.5",
|
|
2167
|
-
children: o.map((e) => /* @__PURE__ */
|
|
2168
|
+
children: o.map((e) => /* @__PURE__ */ P(nn, {
|
|
2168
2169
|
command: e,
|
|
2169
2170
|
stopped: a !== void 0,
|
|
2170
2171
|
lookedAt: n.lastTick?.at,
|
|
2171
2172
|
onOpenRun: (e) => t.openAgent(n.project.id, e)
|
|
2172
2173
|
}, e.command))
|
|
2173
2174
|
}),
|
|
2174
|
-
n.unreadable.map((e) => /* @__PURE__ */
|
|
2175
|
+
n.unreadable.map((e) => /* @__PURE__ */ P("p", {
|
|
2175
2176
|
className: "mt-1.5 text-xs text-warning",
|
|
2176
|
-
children:
|
|
2177
|
+
children: Te(e)
|
|
2177
2178
|
}, e.skill)),
|
|
2178
|
-
s !== void 0 && /* @__PURE__ */
|
|
2179
|
+
s !== void 0 && /* @__PURE__ */ F("p", {
|
|
2179
2180
|
className: "mt-2 text-xs text-muted-foreground",
|
|
2180
2181
|
children: [
|
|
2181
2182
|
s,
|
|
2182
2183
|
".",
|
|
2183
2184
|
" ",
|
|
2184
|
-
o.length === 0 && /* @__PURE__ */
|
|
2185
|
+
o.length === 0 && /* @__PURE__ */ P("a", {
|
|
2185
2186
|
href: t.pageHref("automations"),
|
|
2186
2187
|
onClick: (e) => {
|
|
2187
2188
|
e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || (e.preventDefault(), i());
|
|
@@ -2194,25 +2195,25 @@ function nn({ projects: e }) {
|
|
|
2194
2195
|
]
|
|
2195
2196
|
}, n.project.id);
|
|
2196
2197
|
})
|
|
2197
|
-
}) : /* @__PURE__ */
|
|
2198
|
+
}) : /* @__PURE__ */ P("p", {
|
|
2198
2199
|
className: "py-2 text-sm text-muted-foreground",
|
|
2199
2200
|
children: "Loading…"
|
|
2200
2201
|
}) })] });
|
|
2201
2202
|
}
|
|
2202
|
-
function
|
|
2203
|
+
function nn({ command: e, stopped: t, lookedAt: n, onOpenRun: r }) {
|
|
2203
2204
|
let i = e.decision?.run;
|
|
2204
|
-
return /* @__PURE__ */
|
|
2205
|
+
return /* @__PURE__ */ F("li", {
|
|
2205
2206
|
className: "flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-sm",
|
|
2206
2207
|
children: [
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ P("span", {
|
|
2208
2209
|
className: "min-w-0 truncate font-mono text-[13px]",
|
|
2209
|
-
children:
|
|
2210
|
+
children: we(e)
|
|
2210
2211
|
}),
|
|
2211
|
-
!t && /* @__PURE__ */
|
|
2212
|
+
!t && /* @__PURE__ */ P("span", {
|
|
2212
2213
|
className: "text-xs text-muted-foreground",
|
|
2213
|
-
children:
|
|
2214
|
+
children: it(e)
|
|
2214
2215
|
}),
|
|
2215
|
-
i !== void 0 && /* @__PURE__ */
|
|
2216
|
+
i !== void 0 && /* @__PURE__ */ F("button", {
|
|
2216
2217
|
type: "button",
|
|
2217
2218
|
onClick: () => r(i),
|
|
2218
2219
|
className: "text-xs text-info hover:underline",
|
|
@@ -2227,30 +2228,30 @@ function rn({ command: e, stopped: t, lookedAt: n, onOpenRun: r }) {
|
|
|
2227
2228
|
}
|
|
2228
2229
|
//#endregion
|
|
2229
2230
|
//#region dashboard/SchedulerSettings.tsx
|
|
2230
|
-
var
|
|
2231
|
-
function
|
|
2232
|
-
let t =
|
|
2231
|
+
var rn = [], an = 500;
|
|
2232
|
+
function on({ projects: e }) {
|
|
2233
|
+
let t = M(), { value: r, reload: o } = re(() => je(t, e), rn, 1e4, [e.map((e) => e.id).join(",")]), [s, c] = a(), l = Me(r), [u, f] = a(), [m, h] = a(), g = i(void 0), _ = i(Promise.resolve());
|
|
2233
2234
|
n(() => {
|
|
2234
2235
|
u !== void 0 && l === u && f(void 0);
|
|
2235
2236
|
}, [l, u]), n(() => () => clearTimeout(g.current), []);
|
|
2236
2237
|
let v = u ?? l, y = (n) => {
|
|
2237
2238
|
f(n), clearTimeout(g.current), g.current = setTimeout(() => {
|
|
2238
2239
|
c(void 0), _.current = _.current.then(async () => {
|
|
2239
|
-
let r = await
|
|
2240
|
+
let r = await Fe(t, e, n).catch((e) => ({
|
|
2240
2241
|
ok: !1,
|
|
2241
2242
|
error: e instanceof Error ? e.message : String(e)
|
|
2242
2243
|
}));
|
|
2243
2244
|
r.ok || (f(void 0), c(`The spend offset was not saved: ${r.error}`)), await o().catch(() => {});
|
|
2244
2245
|
});
|
|
2245
|
-
},
|
|
2246
|
-
}, b =
|
|
2247
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
2246
|
+
}, an);
|
|
2247
|
+
}, b = Ne(r), x = r.filter((e) => e.error !== void 0);
|
|
2248
|
+
return e.length === 0 ? null : /* @__PURE__ */ F(C, {
|
|
2248
2249
|
description: "How far past the quota scheduled work may go, on this machine. What a project starts by itself is on the Automations page.",
|
|
2249
2250
|
children: [
|
|
2250
|
-
v !== void 0 && /* @__PURE__ */
|
|
2251
|
+
v !== void 0 && /* @__PURE__ */ P(S, {
|
|
2251
2252
|
label: "Spend offset",
|
|
2252
2253
|
description: `How far the scheduler may start work past the quota boundary, in percentage points (max ${p}). Negative holds it back; positive lets it borrow from the days ahead. The handle on the usage bar moves the same number.${b.length > 0 ? ` Shown: the loosest. ${b.map((e) => `${e.name} is at ${e.offset}`).join(", ")}; saving sets each of them to the same number.` : ""}`,
|
|
2253
|
-
control: /* @__PURE__ */
|
|
2254
|
+
control: /* @__PURE__ */ P(d, {
|
|
2254
2255
|
type: "number",
|
|
2255
2256
|
value: m ?? String(Math.round(v * 10) / 10),
|
|
2256
2257
|
min: -p,
|
|
@@ -2258,7 +2259,7 @@ function sn({ projects: e }) {
|
|
|
2258
2259
|
onChange: (e) => {
|
|
2259
2260
|
let t = e.target.value;
|
|
2260
2261
|
h(t);
|
|
2261
|
-
let n =
|
|
2262
|
+
let n = Pe(t);
|
|
2262
2263
|
n !== void 0 && y(n);
|
|
2263
2264
|
},
|
|
2264
2265
|
onBlur: () => h(void 0),
|
|
@@ -2266,12 +2267,12 @@ function sn({ projects: e }) {
|
|
|
2266
2267
|
className: "h-8 w-24 bg-background px-2"
|
|
2267
2268
|
})
|
|
2268
2269
|
}),
|
|
2269
|
-
x.map((e) => /* @__PURE__ */
|
|
2270
|
+
x.map((e) => /* @__PURE__ */ P("p", {
|
|
2270
2271
|
role: "alert",
|
|
2271
2272
|
className: "py-2 text-xs text-danger",
|
|
2272
2273
|
children: `The scheduler of ${e.project.name} could not be read: ${e.error}`
|
|
2273
2274
|
}, e.project.id)),
|
|
2274
|
-
s !== void 0 && /* @__PURE__ */
|
|
2275
|
+
s !== void 0 && /* @__PURE__ */ P("p", {
|
|
2275
2276
|
role: "alert",
|
|
2276
2277
|
className: "py-2 text-xs text-danger",
|
|
2277
2278
|
children: s
|
|
@@ -2281,43 +2282,43 @@ function sn({ projects: e }) {
|
|
|
2281
2282
|
}
|
|
2282
2283
|
//#endregion
|
|
2283
2284
|
//#region dashboard/index.tsx
|
|
2284
|
-
var
|
|
2285
|
+
var sn = j({
|
|
2285
2286
|
pages: [{
|
|
2286
2287
|
segment: "automations",
|
|
2287
2288
|
label: "Automations",
|
|
2288
|
-
icon:
|
|
2289
|
-
Page:
|
|
2289
|
+
icon: z,
|
|
2290
|
+
Page: Yt
|
|
2290
2291
|
}],
|
|
2291
2292
|
cards: [{
|
|
2292
2293
|
id: "scheduler",
|
|
2293
2294
|
order: 90,
|
|
2294
|
-
Card:
|
|
2295
|
+
Card: tn
|
|
2295
2296
|
}],
|
|
2296
2297
|
settings: [{
|
|
2297
2298
|
id: "scheduler",
|
|
2298
2299
|
title: "Scheduler",
|
|
2299
|
-
icon:
|
|
2300
|
+
icon: z,
|
|
2300
2301
|
order: 20,
|
|
2301
|
-
Section:
|
|
2302
|
+
Section: on
|
|
2302
2303
|
}],
|
|
2303
2304
|
usageLimit: {
|
|
2304
|
-
read: async (e, t) =>
|
|
2305
|
-
save:
|
|
2305
|
+
read: async (e, t) => Me(await je(e, t)),
|
|
2306
|
+
save: Fe
|
|
2306
2307
|
},
|
|
2307
2308
|
schedule: {
|
|
2308
2309
|
page: "automations",
|
|
2309
2310
|
read: async (e, t) => {
|
|
2310
|
-
let [n] = await
|
|
2311
|
+
let [n] = await je(e, [t]);
|
|
2311
2312
|
if (!n || n.error !== void 0) throw Error(n?.error ?? "the scheduler did not answer");
|
|
2312
|
-
let r =
|
|
2313
|
+
let r = at(n);
|
|
2313
2314
|
return n.commands.map((e) => ({
|
|
2314
2315
|
command: e.command,
|
|
2315
|
-
on: e.on && r === void 0 &&
|
|
2316
|
-
...e.on ? { note: r ??
|
|
2316
|
+
on: e.on && r === void 0 && $e(e) === void 0,
|
|
2317
|
+
...e.on ? { note: r ?? it(e) } : {}
|
|
2317
2318
|
}));
|
|
2318
2319
|
}
|
|
2319
2320
|
},
|
|
2320
2321
|
stylesheet: "dashboard.css"
|
|
2321
2322
|
});
|
|
2322
2323
|
//#endregion
|
|
2323
|
-
export {
|
|
2324
|
+
export { sn as default };
|