@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.
@@ -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 re, usePolled as ie } from "@openagt/dashboard/module";
3
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
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 F = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), I = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), ae = {
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
- }, oe = t(({ color: t = "currentColor", size: n = 24, strokeWidth: r = 2, absoluteStrokeWidth: i, className: a = "", children: o, iconNode: s, ...c }, l) => e("svg", {
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
- ...ae,
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: I("lucide", a),
22
+ className: L("lucide", a),
23
23
  ...c
24
- }, [...s.map(([t, n]) => e(t, n)), ...Array.isArray(o) ? o : [o]])), L = ((n, r) => {
25
- let i = t(({ className: t, ...i }, a) => e(oe, {
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: I(`lucide-${F(n)}`, t),
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
- ]), se = ".scheduler/automations", R = ["claude-code", "codex"];
60
- function z(e) {
61
- return R.includes(e);
59
+ ]), ae = ".scheduler/automations", B = ["claude-code", "codex"];
60
+ function V(e) {
61
+ return B.includes(e);
62
62
  }
63
- var B = {
63
+ var H = {
64
64
  "claude-code": "Claude Code",
65
65
  codex: "Codex"
66
- }, V = {
66
+ }, U = {
67
67
  "claude-code": ".claude/skills",
68
68
  codex: ".agents/skills"
69
- }, H = "claude-code";
70
- V[H];
71
- var U = "commit";
72
- function W(e) {
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 ce(e) {
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 le(e) {
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 ue = [
83
+ var le = [
84
84
  "m",
85
85
  "h",
86
86
  "d",
87
87
  "w",
88
88
  "mo"
89
- ], G = {
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 G[e.unit] !== void 0;
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 * G[e.every.unit]);
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
- var Se = "Answers on the coding agent and model that opened the pull request";
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 ? B[r] : `${B[r]}, ${xe(n, r, i)}`;
168
+ return i === void 0 ? H[r] : `${H[r]}, ${xe(n, r, i)}`;
171
169
  }
172
- function we(e) {
170
+ function Ce(e) {
173
171
  let t = X(e);
174
- if (!(typeof t.id != "string" || t.id === "" || !ce(t.at))) return {
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 Te(e) {
181
+ function we(e) {
184
182
  return e.onThisMachine ? e.command : `/${e.command}`;
185
183
  }
186
- function Ee(e) {
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 De(e) {
187
+ function Ee(e) {
190
188
  return ye.includes(e);
191
189
  }
192
- function Oe(e) {
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 ke = "unreadable schedule: ", Ae = "unlisted automation: ";
200
- function je(e, t) {
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 = z(t.agent) ? t.agent : H, p = z(c[n]) ? c[n] : f, m = X(l[n]), h = u.find((e) => e.command === n && !e.outcome.startsWith(ke) && !e.outcome.startsWith(Ae));
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: ce(i[n]),
222
- publish: De(r) ? r : U,
223
- ...Oe(o[n]) ? { pace: o[n] } : {},
224
- ...W(t.agents) && t.agents > 1 ? { skillAgents: t.agents } : {},
225
- ...W(s[n]) ? { agents: s[n] } : {},
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: z(t.modelAgent) ? t.modelAgent : H
227
+ skillModelAgent: V(t.modelAgent) ? t.modelAgent : W
230
228
  } : {},
231
- able: Array.isArray(t.able) ? R.filter((e) => t.able.includes(e)) : R,
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.resumes === !0 ? { resumes: !0 } : {},
233
+ ...t.each === !0 ? { each: !0 } : {},
236
234
  ...t.onThisMachine === !0 ? { onThisMachine: !0 } : {},
237
235
  ...t.editable === !0 ? { editable: !0 } : {},
238
- ...we(t.lastRun) ? { lastRun: we(t.lastRun) } : {},
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 Me(e, t) {
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 ? je(t, n.output) : {
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 Ne(e) {
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 Pe(e) {
285
- let t = Ne(e);
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 Fe(e) {
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 Ie(e, t, n) {
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 Le(e, t) {
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 Re = {
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 ze(e) {
321
+ function Re(e) {
324
322
  let t = q(e);
325
- return t ? `${t.count} ${Re[t.unit]}${t.count === 1 ? "" : "s"}` : e;
323
+ return t ? `${t.count} ${Le[t.unit]}${t.count === 1 ? "" : "s"}` : e;
326
324
  }
327
- var Be = (e) => e.charAt(0).toUpperCase() + e.slice(1);
328
- function Ve(e) {
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 ? ze(r.every.text) : e.pace === void 0 && e.every !== void 0 ? e.every : void 0;
333
- return i === void 0 ? Be(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}`;
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 He(e) {
336
- return Ue(e).kind !== "skill";
333
+ function Ve(e) {
334
+ return He(e).kind !== "skill";
337
335
  }
338
- function Ue(e) {
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 We(e) {
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 Ge(e, t) {
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 Ke(e) {
376
+ function Ge(e) {
379
377
  return e.agents ?? e.skillAgents ?? 1;
380
378
  }
381
- function qe(e) {
382
- return Ke(e) > 1 || e.agents !== void 0;
379
+ function Ke(e) {
380
+ return Ge(e) > 1 || e.agents !== void 0;
383
381
  }
384
- function Je(e) {
382
+ function qe(e) {
385
383
  return e === 1 ? "One at a time" : `Up to ${e} at once`;
386
384
  }
387
- function Ye(e) {
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 Xe(e) {
391
+ function Ye(e) {
394
392
  if (e.kind === "skill") return ["skill"];
395
393
  let t = e.count.trim();
396
- return /^\d+$/.test(t) && W(Number(t)) ? [String(Number(t))] : void 0;
394
+ return /^\d+$/.test(t) && oe(Number(t)) ? [String(Number(t))] : void 0;
397
395
  }
398
- function Ze(e) {
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 Qe(e, t = /* @__PURE__ */ new Date()) {
402
- let n = et(e);
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 $e(e, t) ?? nt(e.decision?.outcome);
402
+ if (!(!e.on || e.decision?.outcome.startsWith("not a command of "))) return Qe(e, t) ?? tt(e.decision?.outcome);
405
403
  }
406
- function $e(e, t) {
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 ${lt(i, t)}${e.when === void 0 ? "" : ", if there is work"}` : it(e, t);
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 et(e) {
413
- if (e.resumes) return;
410
+ function $e(e) {
414
411
  let t = J(e);
415
- return e.able.includes(t) ? void 0 : tt(B[t], V[t]);
412
+ return e.able.includes(t) ? void 0 : et(H[t], U[t]);
416
413
  }
417
- var tt = (e, t) => `Cannot start on ${e}: its skill is not in ${t}`;
418
- function nt(e) {
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 nt(t[1]);
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 tt(n[1], n[2]);
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` : Be(e);
425
+ return i ? i[1] === "1" ? "One is already running" : `${i[1]} are already running` : ze(e);
429
426
  }
430
- function rt(e) {
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 it(e, t = /* @__PURE__ */ new Date()) {
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 ? lt(o, t) : `in ${rt(o.getTime() - t.getTime())}`}${n ? ", if there is work" : ""}`;
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 at(e, t = /* @__PURE__ */ new Date()) {
446
- let n = et(e);
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 : Qe(e, t)) ?? it(e, t);
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 ot(e) {
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 st = [
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
- ], ct = [
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 lt(e, t) {
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 ? `${st[e.getDay()]} ${r}` : `${e.getDate()} ${ct[e.getMonth()]} ${r}`;
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 ut(e) {
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 dt = 4e3, ft = {
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 pt(e) {
510
+ function ft(e) {
514
511
  return e.pace.kind === "every" ? Z(e.pace)?.[0] : void 0;
515
512
  }
516
- function mt(e) {
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 ht(e, t) {
539
- let n = Ue(t);
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 gt(e, t) {
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." : le(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 ${dt} 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 ${dt} 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 ${dt} at most.` : e.pace.kind === "work" && e.when.trim() === "" ? "Say when it runs: on a pace, by a shell line, or both." : We(e.pace) : "A name is lower-case letters, digits and dashes, never three dashes in a row, 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 _t(e) {
550
- if (gt(e) === void 0) return [
546
+ function gt(e) {
547
+ if (ht(e) === void 0) return [
551
548
  "add",
552
- ...bt(e),
549
+ ...yt(e),
553
550
  ...e.onThisMachine ? ["--private"] : []
554
551
  ];
555
552
  }
556
- function vt(e, t) {
557
- if (gt(e, t) !== void 0) return;
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=${pt(e) ?? ""}`,
560
+ `--every=${ft(e) ?? ""}`,
564
561
  `--when=${n}`,
565
562
  `--waits-for=${n === "" ? "" : e.waitsFor.trim()}`
566
563
  ];
567
564
  }
568
- function yt(e) {
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 bt(e) {
573
- let t = pt(e), n = e.when.trim(), r = e.waitsFor.trim();
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 xt(e, t) {
583
- return bt(e).join("\0") === bt(t).join("\0");
579
+ function bt(e, t) {
580
+ return yt(e).join("\0") === yt(t).join("\0");
584
581
  }
585
- function St(e) {
586
- let t = Z(e.pace), n = pt(e), r = e.when.trim();
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: H,
594
- able: R,
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 Ct(e) {
608
- let t = St(e);
609
- return t && Ve(t);
604
+ function St(e) {
605
+ let t = xt(e);
606
+ return t && Be(t);
610
607
  }
611
- function wt(e) {
608
+ function Ct(e) {
612
609
  return e.name === "" && e.prompt === "" && e.when === "" && e.waitsFor === "";
613
610
  }
614
- function Tt(e) {
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 Et(e) {
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 Dt(e) {
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 Ot(e) {
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. ${Pt(e.startsFrom)}`;
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 kt(e) {
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 At(e) {
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 jt(e) {
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 Mt(e, t) {
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 Nt(e) {
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 Pt(e) {
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", Ft = (e) => /[.!?]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`;
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__ */ P("section", {
670
+ return /* @__PURE__ */ F("section", {
674
671
  "aria-label": e,
675
672
  className: "space-y-2",
676
- children: [/* @__PURE__ */ N("h4", {
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 It({ project: e, said: t, agent: n, autoFocus: r, onChange: s }) {
683
- let c = re(), [l, u] = a(), [p, m] = a(), h = i(0), g = i(0), _ = t.when.trim(), v = t.waitsFor.trim(), y = (e) => {
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 ? Tt(n.output) : {
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 ? Et(r.output) : { said: `The line was not written: ${r.error}` };
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__ */ P(M, { children: [
713
- /* @__PURE__ */ N(f, {
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__ */ N(T, {
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__ */ P(f, {
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__ */ N("span", {
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__ */ N(d, {
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__ */ P("div", {
740
+ /* @__PURE__ */ F("div", {
744
741
  className: "flex flex-wrap items-center gap-3",
745
- children: [/* @__PURE__ */ N(o, {
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__ */ P("span", {
748
+ }), /* @__PURE__ */ F("span", {
752
749
  className: Q,
753
750
  children: [
754
751
  "Asks ",
755
- B[n],
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__ */ N("p", {
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__ */ P(f, {
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__ */ N("span", {
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__ */ N(T, {
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__ */ P("p", {
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__ */ N("span", {
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__ */ P("div", {
794
+ /* @__PURE__ */ F("div", {
798
795
  className: "flex flex-wrap items-center gap-3",
799
- children: [/* @__PURE__ */ N(o, {
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__ */ N("span", {
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__ */ P("div", {
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__ */ N("p", {
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__ */ N("pre", {
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__ */ P("p", {
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 Lt({ description: e, when: t, waitsFor: n, where: r }) {
836
- return /* @__PURE__ */ P("div", {
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__ */ N("p", {
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__ */ P(M, { children: [/* @__PURE__ */ P("p", {
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__ */ P("span", {
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__ */ N("pre", {
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__ */ N("p", {
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 Rt({ name: e, draft: t, work: a, asSaid: o, noWait: s, start: c, counted: l, disabled: u, autoFocus: f, onChange: p }) {
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__ */ P("div", {
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__ */ N(d, {
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__ */ P(_, {
892
- items: ue.map((e) => ({
888
+ /* @__PURE__ */ F(_, {
889
+ items: le.map((e) => ({
893
890
  value: e,
894
- label: zt(e, S.count)
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__ */ N(b, {
899
+ children: [/* @__PURE__ */ P(b, {
903
900
  size: "sm",
904
901
  "aria-label": "Unit",
905
902
  className: "w-28",
906
- children: /* @__PURE__ */ N(x, {})
907
- }), /* @__PURE__ */ N(v, { children: ue.map((e) => /* @__PURE__ */ N(y, {
903
+ children: /* @__PURE__ */ P(x, {})
904
+ }), /* @__PURE__ */ P(v, { children: le.map((e) => /* @__PURE__ */ P(y, {
908
905
  value: e,
909
- children: zt(e, S.count)
906
+ children: Rt(e, S.count)
910
907
  }, e)) })]
911
908
  }),
912
- C && /* @__PURE__ */ P(M, { children: [
913
- /* @__PURE__ */ N("span", { children: a ? "not before" : "at" }),
914
- /* @__PURE__ */ N(d, {
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__ */ P("span", {
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__ */ P("div", {
932
+ return /* @__PURE__ */ F("div", {
936
933
  className: "space-y-3",
937
- children: [/* @__PURE__ */ N("p", {
934
+ children: [/* @__PURE__ */ P("p", {
938
935
  className: "text-sm",
939
- children: a ? /* @__PURE__ */ P(M, { children: [
936
+ children: a ? /* @__PURE__ */ F(N, { children: [
940
937
  "Only when there is work: ",
941
- Ft(a.waitsFor ?? "when its shell line prints something"),
938
+ Pt(a.waitsFor ?? "when its shell line prints something"),
942
939
  " ",
943
- /* @__PURE__ */ P("span", {
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__ */ P(M, { children: ["By time alone. ", /* @__PURE__ */ N("span", {
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__ */ P("div", {
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__ */ N("p", {
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__ */ P(m, {
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__ */ P(g, {
971
+ o && /* @__PURE__ */ F(g, {
975
972
  value: "skill",
976
- children: [o.label, /* @__PURE__ */ P("span", {
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__ */ P("div", {
982
+ /* @__PURE__ */ F("div", {
986
983
  className: "flex items-start gap-2",
987
- children: [/* @__PURE__ */ N(h, {
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__ */ P(g, {
990
+ w && /* @__PURE__ */ F(g, {
994
991
  value: "work",
995
- children: ["No wait", /* @__PURE__ */ N("span", {
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__ */ N("p", {
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 zt(e, t) {
1011
- return Number(t) === 1 ? Re[e] : `${Re[e]}s`;
1007
+ function Rt(e, t) {
1008
+ return Number(t) === 1 ? Le[e] : `${Le[e]}s`;
1012
1009
  }
1013
- function Bt({ name: e, draft: t, asSaid: n, start: r, where: i, disabled: a, onChange: o }) {
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__ */ P("div", {
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__ */ N("span", { children: "Up to" }),
1021
- /* @__PURE__ */ N(d, {
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__ */ P("span", { children: [Number(s.count) === 1 ? "agent" : "agents", " at once"] })
1031
+ /* @__PURE__ */ F("span", { children: [Number(s.count) === 1 ? "agent" : "agents", " at once"] })
1035
1032
  ]
1036
1033
  });
1037
- return /* @__PURE__ */ P("fieldset", {
1034
+ return /* @__PURE__ */ F("fieldset", {
1038
1035
  disabled: a,
1039
1036
  className: "space-y-2",
1040
- children: [n ? /* @__PURE__ */ P(m, {
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__ */ P(g, {
1042
+ children: [/* @__PURE__ */ F(g, {
1046
1043
  value: "skill",
1047
- children: [n.label, /* @__PURE__ */ P("span", {
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__ */ P("div", {
1052
+ }), /* @__PURE__ */ F("div", {
1056
1053
  className: "flex items-start gap-2",
1057
- children: [/* @__PURE__ */ N(h, {
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__ */ P("p", {
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 Vt({ gitHost: e, own: t, pick: n, disabled: r, onChange: i }) {
1074
- let a = Le(e, n).map((e) => ({
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__ */ P(_, {
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__ */ N(b, {
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__ */ N(x, {})
1088
- }), /* @__PURE__ */ N(v, { children: a.map((e) => /* @__PURE__ */ N(y, {
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 Ht({ command: e, schedulerModel: t, agents: n, agent: r, model: i, disabled: a, onChange: o }) {
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)})`}` : `${B[r]}'s own default`, u = R.filter((t) => !e.able.includes(t)), d = [
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__ */ P("fieldset", {
1103
+ return /* @__PURE__ */ F("fieldset", {
1107
1104
  disabled: a,
1108
1105
  className: "space-y-2",
1109
1106
  children: [
1110
- /* @__PURE__ */ P("div", {
1107
+ /* @__PURE__ */ F("div", {
1111
1108
  className: "flex flex-wrap items-center gap-2 text-sm",
1112
- children: [/* @__PURE__ */ N(f, {
1109
+ children: [/* @__PURE__ */ P(f, {
1113
1110
  htmlFor: "automation-agent",
1114
1111
  className: "w-14",
1115
1112
  children: "Agent"
1116
- }), /* @__PURE__ */ P(_, {
1117
- items: R.map((e) => ({
1113
+ }), /* @__PURE__ */ F(_, {
1114
+ items: B.map((e) => ({
1118
1115
  value: e,
1119
- label: B[e]
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__ */ N(b, {
1124
+ children: [/* @__PURE__ */ P(b, {
1128
1125
  id: "automation-agent",
1129
1126
  size: "sm",
1130
1127
  className: "w-44",
1131
- children: /* @__PURE__ */ N(x, {})
1132
- }), /* @__PURE__ */ N(v, { children: R.map((t) => /* @__PURE__ */ N(y, {
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: B[t]
1132
+ children: H[t]
1136
1133
  }, t)) })]
1137
1134
  })]
1138
1135
  }),
1139
- /* @__PURE__ */ P("div", {
1136
+ /* @__PURE__ */ F("div", {
1140
1137
  className: "flex flex-wrap items-center gap-2 text-sm",
1141
- children: [/* @__PURE__ */ N(f, {
1138
+ children: [/* @__PURE__ */ P(f, {
1142
1139
  htmlFor: "automation-model",
1143
1140
  className: "w-14",
1144
1141
  children: "Model"
1145
- }), /* @__PURE__ */ P(_, {
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__ */ N(b, {
1150
+ children: [/* @__PURE__ */ P(b, {
1154
1151
  id: "automation-model",
1155
1152
  size: "sm",
1156
1153
  className: "w-72",
1157
- children: /* @__PURE__ */ N(x, {})
1158
- }), /* @__PURE__ */ N(v, { children: d.map((e) => /* @__PURE__ */ N(y, {
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__ */ N("p", {
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__ */ P("p", {
1165
+ u.map((e) => /* @__PURE__ */ F("p", {
1169
1166
  className: "text-xs text-muted-foreground",
1170
1167
  children: [
1171
- B[e],
1168
+ H[e],
1172
1169
  " cannot run this row: it reads the project's skills from ",
1173
- /* @__PURE__ */ N("span", {
1170
+ /* @__PURE__ */ P("span", {
1174
1171
  className: "font-mono",
1175
- children: V[e]
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__ */ P("p", {
1177
+ r !== "claude-code" && /* @__PURE__ */ F("p", {
1181
1178
  className: "text-xs text-muted-foreground",
1182
1179
  children: [
1183
1180
  "How much of ",
1184
- B[r],
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 Ut({ project: e, run: t, onDirty: r, onClose: i, onSaved: s }) {
1194
- let [c, l] = a(ft), [u, f] = a(!1), [p, h] = a(), [_, v] = a(), y = (e) => {
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 = gt(c), x = Ct(c), S = !wt(c) && !_;
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 = _t(c), n = yt(c);
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
- ...Dt(r.output),
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__ */ P("div", {
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__ */ P("p", { children: [
1220
+ /* @__PURE__ */ F("p", { children: [
1224
1221
  "Saved ",
1225
- /* @__PURE__ */ N("span", {
1222
+ /* @__PURE__ */ P("span", {
1226
1223
  className: "font-mono",
1227
1224
  children: _.onThisMachine ? _.command : `/${_.command}`
1228
1225
  }),
1229
1226
  " as ",
1230
- /* @__PURE__ */ N("span", {
1227
+ /* @__PURE__ */ P("span", {
1231
1228
  className: "font-mono",
1232
1229
  children: _.file
1233
1230
  }),
1234
1231
  "."
1235
1232
  ] }),
1236
- /* @__PURE__ */ N("p", {
1233
+ /* @__PURE__ */ P("p", {
1237
1234
  className: "mt-2",
1238
- children: Ot(_)
1235
+ children: Dt(_)
1239
1236
  }),
1240
- _.timeNotKept !== void 0 && /* @__PURE__ */ P("p", {
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__ */ N("p", {
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__ */ N("div", {
1250
+ /* @__PURE__ */ P("div", {
1254
1251
  className: "mt-3 flex justify-end",
1255
- children: /* @__PURE__ */ N(o, {
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__ */ P("div", {
1260
+ }) : /* @__PURE__ */ F("div", {
1264
1261
  role: "group",
1265
1262
  "aria-label": "New automation",
1266
1263
  onKeyDown: (e) => {
1267
- e.key === "Escape" && !u && wt(c) && i();
1264
+ e.key === "Escape" && !u && Ct(c) && i();
1268
1265
  },
1269
1266
  className: `${w} space-y-5`,
1270
1267
  children: [
1271
- /* @__PURE__ */ P("fieldset", {
1268
+ /* @__PURE__ */ F("fieldset", {
1272
1269
  disabled: u,
1273
1270
  className: "space-y-5",
1274
1271
  children: [
1275
- /* @__PURE__ */ N($, {
1272
+ /* @__PURE__ */ P($, {
1276
1273
  title: "Name",
1277
- children: /* @__PURE__ */ P("div", {
1274
+ children: /* @__PURE__ */ F("div", {
1278
1275
  className: "flex items-center gap-1 text-sm",
1279
- children: [!c.onThisMachine && /* @__PURE__ */ N("span", {
1276
+ children: [!c.onThisMachine && /* @__PURE__ */ P("span", {
1280
1277
  className: "font-mono text-muted-foreground",
1281
1278
  children: "/"
1282
- }), /* @__PURE__ */ N(d, {
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__ */ N($, {
1290
+ /* @__PURE__ */ P($, {
1294
1291
  title: "What it does",
1295
- children: /* @__PURE__ */ N(It, {
1292
+ children: /* @__PURE__ */ P(Ft, {
1296
1293
  project: e,
1297
1294
  said: c,
1298
- agent: H,
1295
+ agent: W,
1299
1296
  autoFocus: !1,
1300
1297
  onChange: y
1301
1298
  })
1302
1299
  }),
1303
- /* @__PURE__ */ N($, {
1300
+ /* @__PURE__ */ P($, {
1304
1301
  title: "When it runs",
1305
- children: /* @__PURE__ */ N(Rt, {
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__ */ N($, {
1317
+ /* @__PURE__ */ P($, {
1321
1318
  title: "Who gets it",
1322
- children: /* @__PURE__ */ P(m, {
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__ */ P(g, {
1324
+ children: [/* @__PURE__ */ F(g, {
1328
1325
  value: "project",
1329
- children: ["Shared with the project", /* @__PURE__ */ N("span", {
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__ */ P(g, {
1330
+ }), /* @__PURE__ */ F(g, {
1334
1331
  value: "machine",
1335
- children: ["Only on this machine", /* @__PURE__ */ N("span", {
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__ */ N("p", {
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__ */ N("p", {
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__ */ P("div", {
1350
+ /* @__PURE__ */ F("div", {
1354
1351
  className: "flex flex-wrap items-center justify-between gap-3",
1355
- children: [/* @__PURE__ */ N("p", {
1352
+ children: [/* @__PURE__ */ P("p", {
1356
1353
  className: "min-w-0 flex-1 text-xs text-muted-foreground",
1357
- children: Nt(c)
1358
- }), /* @__PURE__ */ P("div", {
1354
+ children: Mt(c)
1355
+ }), /* @__PURE__ */ F("div", {
1359
1356
  className: "flex gap-2",
1360
- children: [/* @__PURE__ */ N(o, {
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__ */ N(o, {
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 Wt = (e) => e.charAt(0).toLowerCase() + e.slice(1), Gt = (e) => /[.!?]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`;
1380
- function Kt(e) {
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 qt({ project: e, scheduled: t, opened: r, refused: i, schedulerModel: s, agents: c, run: l, reload: u, onDirty: d, onClose: f, onRemoved: p }) {
1388
- let m = Te(t), [h, g] = a(r?.draft), [_] = a(() => r ? ht(r.draft, t) : void 0), [v, y] = a(_), [b, x] = a(() => Ue(t)), [S, C] = a(() => r ? {
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(Ke(t))
1391
- } : Ye(t)), [w, T] = a(() => ({
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, re] = a(r?.version), [ie, M] = a(), [F, I] = a(), ae = Xe(S), oe = (e) => v && e === String(t.skillAgents ?? 1) ? "skill" : e, L = ae === void 0 ? void 0 : oe(ae[0]), R = v ? yt(v) : Z(b), z = v !== void 0 && _ !== void 0 && (!xt(v, _) || yt(v)?.join(" ") !== yt(_)?.join(" ")), B = {
1395
- file: z && v !== void 0 && h !== void 0 && !xt(v, h),
1396
- pace: R !== void 0 && (v ? z && R.join(" ") !== Kt(t).join(" ") : R.join(" ") !== Z(Ue(t)).join(" ")),
1397
- agents: L !== void 0 && L !== oe(Xe(Ye(t))[0]),
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
- }, V = z || B.pace || B.agents || B.agent || B.model || B.publish, H = (v && r ? B.file ? gt(v, r.file) : We(v.pace) : We(b)) ?? (ae ? void 0 : "Type a whole number of agents, from 1 to 99.");
1402
- n(() => d(V && !F), [V, F]), n(() => () => d(!1), []);
1403
- let U = (() => {
1404
- if (L === void 0) return;
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 = St(v);
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 = Ge(t, b);
1413
+ e = We(t, b);
1417
1414
  }
1418
1415
  let { agents: n, ...r } = e, { runsOn: i, model: a, ...o } = {
1419
1416
  ...r,
1420
- ...L === "skill" ? {} : { agents: Number(L) },
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
- })(), W = U && `${Ve(U)}. ${qe(U) ? `${Je(Ke(U))}. ` : ""}${Ce(U, s, c)}.${U.resumes ? "" : ` ${Ze(U)}.`}`, ce = async () => {
1429
- if (H !== void 0 || R === void 0 || L === void 0) return;
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
- B.file && v && r && e.push(["It", [...vt(v, r.file), ...ne === void 0 ? [] : [`--was=${ne}`]]]), B.pace && e.push(["The pace", [
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
- ...R
1435
- ]]), B.agents && e.push(["The number of agents", [
1431
+ ...B
1432
+ ]]), H.agents && e.push(["The number of agents", [
1436
1433
  "agents",
1437
1434
  t.command,
1438
- L
1439
- ]]), B.agent && e.push(["The agent", [
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
- ]]), B.model && !(B.agent && w.model === "skill") && e.push(["The model", [
1440
+ ]]), H.model && !(H.agent && w.model === "skill") && e.push(["The model", [
1444
1441
  "model",
1445
1442
  t.command,
1446
1443
  w.model
1447
- ]]), B.publish && e.push(["The publish pick", [
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 = ie;
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 ? `${Gt(r)} Its words and its pace are saved, in ${n.file}${n.onThisMachine ? "" : ": a change of yours to commit"}.` : r);
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 = Dt(e.output), M(n), g(v), re(n.version));
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 ? I(n) : f();
1463
- }, le = async () => {
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(Mt(m, e.output)), await u().catch(() => {}), k(!1), e.ok || j(`It was not removed: ${e.error}`);
1467
- }, ue = () => (te(!1), j(void 0)), G = "mt-3 rounded-md border border-border bg-muted/40 p-4";
1468
- if (F) return /* @__PURE__ */ P("div", {
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: `${G} text-sm`,
1468
+ className: `${ue} text-sm`,
1472
1469
  children: [
1473
- /* @__PURE__ */ P("p", { children: [
1470
+ /* @__PURE__ */ F("p", { children: [
1474
1471
  "Saved ",
1475
- /* @__PURE__ */ N("span", {
1472
+ /* @__PURE__ */ P("span", {
1476
1473
  className: "font-mono",
1477
1474
  children: m
1478
1475
  }),
1479
1476
  " again, in ",
1480
- /* @__PURE__ */ N("span", {
1477
+ /* @__PURE__ */ P("span", {
1481
1478
  className: "font-mono",
1482
- children: F.file
1479
+ children: I.file
1483
1480
  }),
1484
1481
  "."
1485
1482
  ] }),
1486
- /* @__PURE__ */ N("p", {
1483
+ /* @__PURE__ */ P("p", {
1487
1484
  className: "mt-2",
1488
- children: kt(F)
1485
+ children: Ot(I)
1489
1486
  }),
1490
- /* @__PURE__ */ N("div", {
1487
+ /* @__PURE__ */ P("div", {
1491
1488
  className: "mt-3 flex justify-end",
1492
- children: /* @__PURE__ */ N(o, {
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__ */ P("div", {
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 && ue();
1502
+ e.key === "Escape" && !O && le();
1506
1503
  },
1507
- className: `${G} text-sm`,
1504
+ className: `${ue} text-sm`,
1508
1505
  children: [
1509
- /* @__PURE__ */ P("p", { children: [
1506
+ /* @__PURE__ */ F("p", { children: [
1510
1507
  "Remove ",
1511
- /* @__PURE__ */ N("span", {
1508
+ /* @__PURE__ */ P("span", {
1512
1509
  className: "font-mono",
1513
1510
  children: m
1514
1511
  }),
1515
1512
  "?"
1516
1513
  ] }),
1517
- /* @__PURE__ */ N("p", {
1514
+ /* @__PURE__ */ P("p", {
1518
1515
  className: "mt-2",
1519
- children: jt(t)
1516
+ children: At(t)
1520
1517
  }),
1521
- A !== void 0 && /* @__PURE__ */ N("p", {
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__ */ P("div", {
1523
+ /* @__PURE__ */ F("div", {
1527
1524
  className: "mt-3 flex justify-end gap-2",
1528
- children: [/* @__PURE__ */ N(o, {
1525
+ children: [/* @__PURE__ */ P(o, {
1529
1526
  variant: "outline",
1530
1527
  size: "sm",
1531
1528
  autoFocus: !0,
1532
1529
  disabled: O,
1533
- onClick: ue,
1530
+ onClick: le,
1534
1531
  children: "Cancel"
1535
- }), /* @__PURE__ */ N(o, {
1532
+ }), /* @__PURE__ */ P(o, {
1536
1533
  variant: "destructive",
1537
1534
  size: "sm",
1538
1535
  disabled: O,
1539
- onClick: () => void le(),
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__ */ P("div", {
1543
+ return /* @__PURE__ */ F("div", {
1547
1544
  role: "group",
1548
1545
  "aria-label": `Editing ${m}`,
1549
1546
  onKeyDown: (e) => {
1550
- e.key === "Escape" && !O && !V && f();
1547
+ e.key === "Escape" && !O && !U && f();
1551
1548
  },
1552
- className: `${G} space-y-5`,
1549
+ className: `${ue} space-y-5`,
1553
1550
  children: [
1554
- /* @__PURE__ */ N($, {
1551
+ /* @__PURE__ */ P($, {
1555
1552
  title: "What it does",
1556
- children: v ? /* @__PURE__ */ N("fieldset", {
1553
+ children: v ? /* @__PURE__ */ P("fieldset", {
1557
1554
  disabled: O,
1558
1555
  className: "space-y-2",
1559
- children: /* @__PURE__ */ N(It, {
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__ */ N(Lt, {
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, ${se}/${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}`
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__ */ N($, {
1573
+ /* @__PURE__ */ P($, {
1577
1574
  title: "When it runs",
1578
- children: v ? /* @__PURE__ */ N(Rt, {
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__ */ N(Rt, {
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" : ze(t.every)
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__ */ N($, {
1613
+ /* @__PURE__ */ P($, {
1617
1614
  title: "How many at once",
1618
- children: /* @__PURE__ */ N(Bt, {
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: Wt(Je(t.skillAgents ?? 1))
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__ */ N($, {
1628
+ /* @__PURE__ */ P($, {
1632
1629
  title: "What it runs on",
1633
- children: t.resumes ? /* @__PURE__ */ P("p", {
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
- !t.resumes && /* @__PURE__ */ N($, {
1640
+ /* @__PURE__ */ F($, {
1647
1641
  title: "What its runs publish",
1648
- children: /* @__PURE__ */ N(Vt, {
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__ */ N("p", {
1653
+ /* @__PURE__ */ P("p", {
1657
1654
  className: "rounded-md border border-border bg-background px-3 py-2 text-sm",
1658
- children: H ?? (V ? W : `${W} Nothing is changed yet.`)
1655
+ children: W ?? (U ? oe : `${oe} Nothing is changed yet.`)
1659
1656
  }),
1660
- A !== void 0 && /* @__PURE__ */ N("p", {
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__ */ P("div", {
1662
+ /* @__PURE__ */ F("div", {
1666
1663
  className: "flex flex-wrap items-center justify-between gap-3",
1667
- children: [/* @__PURE__ */ N("p", {
1664
+ children: [/* @__PURE__ */ P("p", {
1668
1665
  className: "min-w-0 flex-1 text-xs text-muted-foreground",
1669
- children: At(r)
1670
- }), /* @__PURE__ */ P("div", {
1666
+ children: kt(r)
1667
+ }), /* @__PURE__ */ F("div", {
1671
1668
  className: "flex gap-2",
1672
1669
  children: [
1673
- t.editable && r && /* @__PURE__ */ N(o, {
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__ */ N(o, {
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__ */ N(o, {
1685
+ /* @__PURE__ */ P(o, {
1689
1686
  size: "sm",
1690
- disabled: O || H !== void 0 || !V,
1691
- onClick: () => void ce(),
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 Jt = [], Yt = "no skill of this project schedules a command";
1703
- function Xt({ projects: e }) {
1704
- let t = re(), r = ne(), { value: s, loaded: c, reload: l } = ie(() => Me(t, e), Jt, 1e4, [e.map((e) => e.id).join(",")]), u = i(/* @__PURE__ */ new Map()), d = s.map((e) => {
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(), M = i(0), F = b && (g !== void 0 || v !== void 0);
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 I = i(/* @__PURE__ */ new Map()), ae = (e) => {
1723
- _((t) => t?.id === e ? void 0 : t), setTimeout(() => I.current.get(e)?.focus());
1724
- }, oe = i(Promise.resolve()), L = (e, n) => {
1725
- let r = oe.current.then(() => t.runCommand(e.id, n).catch((e) => ({
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 oe.current = r, r;
1730
- }, se = (e, n) => t.runCommand(e.id, n).catch((e) => ({
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
- })), R = async (e, t, n, r) => {
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
- }, z = async (e, t, n) => {
1743
- let r = ++M.current;
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 se(t, ["show", n.command]);
1747
- if (p((t) => t.filter((n, r) => r !== t.indexOf(e))), M.current !== r || S.current) return;
1748
- let a = i.ok ? mt(i.output) : void 0;
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__ */ P("div", {
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__ */ N("h1", {
1754
+ /* @__PURE__ */ P("h1", {
1758
1755
  className: "text-lg font-semibold",
1759
1756
  children: "Automations"
1760
1757
  }),
1761
- /* @__PURE__ */ N("p", {
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__ */ N("p", {
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 = ut(e), i = e.lastTick?.note, a = [["Your automations", e.commands.filter(Y)], ["From the project's skills", e.commands.filter((e) => !Y(e))]];
1771
- return /* @__PURE__ */ P("section", {
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__ */ P("div", {
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__ */ N("h2", {
1775
+ /* @__PURE__ */ P("h2", {
1779
1776
  className: "text-sm font-semibold",
1780
1777
  children: e.project.name
1781
1778
  }),
1782
- /* @__PURE__ */ P("span", {
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__ */ N("span", {
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__ */ P("span", {
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__ */ P(E, { children: [/* @__PURE__ */ N(O, {
1796
- render: /* @__PURE__ */ N("span", { className: "tabular-nums" }),
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__ */ N(D, { children: te(e.lastTick.at) })] }),
1799
- i !== void 0 && i !== "off" && i !== Yt && `: ${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__ */ N(o, {
1799
+ e.error === void 0 && v !== e.project.id && /* @__PURE__ */ P(o, {
1803
1800
  variant: "outline",
1804
1801
  size: "xs",
1805
- disabled: F,
1802
+ disabled: I,
1806
1803
  onClick: () => {
1807
- M.current++, _(void 0), y(e.project.id);
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__ */ N(Ut, {
1812
+ v === e.project.id && /* @__PURE__ */ P(Ht, {
1816
1813
  project: e.project,
1817
- run: (t) => L(e.project, 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__ */ P("div", {
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__ */ N("p", { children: T.text }), /* @__PURE__ */ N(o, {
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__ */ N("p", {
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__ */ N("p", {
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__ */ N("p", {
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__ */ N("p", {
1843
+ e.unreadable.map((e, t) => /* @__PURE__ */ P("p", {
1847
1844
  role: "alert",
1848
1845
  className: "py-3 text-sm text-danger",
1849
- children: Ee(e)
1846
+ children: Te(e)
1850
1847
  }, `${t}/${e.skill}`)),
1851
- e.error === void 0 && e.commands.length === 0 && e.unreadable.length === 0 && /* @__PURE__ */ N("p", {
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__ */ P("div", {
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__ */ N("h3", {
1856
+ children: [/* @__PURE__ */ P("h3", {
1860
1857
  className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
1861
1858
  children: n
1862
- }), /* @__PURE__ */ N("ul", {
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 = Te(n), s = f.includes(i), c = g?.id === i ? g : void 0, d = m?.id === i ? m : void 0;
1866
- return /* @__PURE__ */ P("li", {
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__ */ P("div", {
1867
+ /* @__PURE__ */ F("div", {
1871
1868
  className: "flex items-start justify-between gap-4 max-md:flex-col",
1872
- children: [/* @__PURE__ */ P("div", {
1869
+ children: [/* @__PURE__ */ F("div", {
1873
1870
  className: "min-w-0",
1874
1871
  children: [
1875
- /* @__PURE__ */ P("p", {
1872
+ /* @__PURE__ */ F("p", {
1876
1873
  className: "flex flex-wrap items-baseline gap-x-2 text-sm",
1877
- children: [/* @__PURE__ */ N("span", {
1874
+ children: [/* @__PURE__ */ P("span", {
1878
1875
  className: "font-mono font-medium",
1879
1876
  children: a
1880
- }), Y(n) && /* @__PURE__ */ N("span", {
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__ */ N("p", {
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__ */ N(Qt, {
1886
+ /* @__PURE__ */ P(Zt, {
1890
1887
  host: t,
1891
1888
  project: e.project,
1892
1889
  scheduled: n
1893
1890
  }),
1894
- !c && /* @__PURE__ */ N($t, {
1891
+ !c && /* @__PURE__ */ P(Qt, {
1895
1892
  scheduled: n,
1896
1893
  schedulerModel: e.model,
1897
1894
  agents: r
1898
1895
  })
1899
1896
  ]
1900
- }), /* @__PURE__ */ P("div", {
1897
+ }), /* @__PURE__ */ F("div", {
1901
1898
  className: "flex shrink-0 items-center gap-2",
1902
1899
  children: [
1903
- /* @__PURE__ */ N(o, {
1900
+ /* @__PURE__ */ P(o, {
1904
1901
  variant: "outline",
1905
1902
  size: "xs",
1906
- disabled: s || et(n) !== void 0,
1907
- onClick: () => void R(i, e.project, se(e.project, ["now", n.command]), Zt),
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__ */ N("button", {
1908
+ /* @__PURE__ */ P("button", {
1912
1909
  type: "button",
1913
1910
  ref: (e) => {
1914
- e ? I.current.set(i, e) : I.current.delete(i);
1911
+ e ? L.current.set(i, e) : L.current.delete(i);
1915
1912
  },
1916
- disabled: s || c !== void 0 || F,
1917
- onClick: () => void z(i, e.project, n),
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__ */ N(w, {
1922
+ /* @__PURE__ */ P(w, {
1926
1923
  checked: n.on,
1927
1924
  disabled: s,
1928
- onCheckedChange: (t) => void R(i, e.project, L(e.project, [
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__ */ N(qt, {
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) => L(e.project, t),
1942
+ run: (t) => z(e.project, t),
1946
1943
  reload: l,
1947
1944
  onDirty: C,
1948
- onClose: () => ae(i),
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__ */ P("p", {
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
- n.resumes ? "Resumed a run." : "Started a run.",
1962
+ d.resumed ? "Resumed a run." : "Started a run.",
1966
1963
  " ",
1967
- d.started !== "" && /* @__PURE__ */ N("button", {
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__ */ N("p", {
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__ */ N("p", {
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 Zt(e) {
1993
+ function Xt(e) {
1997
1994
  if (e.ok) {
1998
- let t = typeof e.output == "object" && e.output !== null ? e.output.run : void 0;
1999
- return { started: typeof t == "string" ? t : "" };
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. ${nt(e.error)}.` };
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 = nt(e.error) ?? e.error;
2004
+ let t = tt(e.error) ?? e.error;
2005
2005
  return { failed: `Nothing started. ${/[.!?]$/.test(t) ? t : `${t}.`}` };
2006
2006
  }
2007
- function Qt({ host: e, project: t, scheduled: n }) {
2008
- let r = n.lastRun, i = Qe(n);
2009
- return /* @__PURE__ */ P("p", {
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__ */ P("span", {
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__ */ N("span", {
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__ */ N("span", {
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__ */ N("span", {
2024
+ r === void 0 ? /* @__PURE__ */ P("span", {
2025
2025
  className: "text-muted-foreground",
2026
2026
  children: "Never ran"
2027
- }) : /* @__PURE__ */ P(E, { children: [/* @__PURE__ */ P(O, {
2028
- render: /* @__PURE__ */ N("button", {
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__ */ N("span", {
2036
+ /* @__PURE__ */ P("span", {
2037
2037
  className: "tabular-nums",
2038
2038
  children: ee(r.at)
2039
2039
  })
2040
2040
  ]
2041
- }), /* @__PURE__ */ N(D, { children: te(r.at) })] }),
2042
- i !== void 0 && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
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__ */ N("span", {
2047
- className: et(n) ? "text-warning" : "text-muted-foreground",
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 $t({ scheduled: e, schedulerModel: t, agents: n }) {
2053
+ function Qt({ scheduled: e, schedulerModel: t, agents: n }) {
2054
2054
  let r = !Y(e);
2055
- return /* @__PURE__ */ P("p", {
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__ */ N("span", { children: Ve(e) }),
2059
- r && He(e) && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
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__ */ N("span", {
2062
+ }), /* @__PURE__ */ P("span", {
2063
2063
  className: "text-info",
2064
2064
  children: "your pick"
2065
2065
  })] }),
2066
- qe(e) && /* @__PURE__ */ P(M, { children: [
2067
- /* @__PURE__ */ N("span", {
2066
+ Ke(e) && /* @__PURE__ */ F(N, { children: [
2067
+ /* @__PURE__ */ P("span", {
2068
2068
  "aria-hidden": !0,
2069
2069
  children: "·"
2070
2070
  }),
2071
- /* @__PURE__ */ N("span", { children: Je(Ke(e)) }),
2072
- r && e.agents !== void 0 && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
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__ */ N("span", {
2075
+ }), /* @__PURE__ */ P("span", {
2076
2076
  className: "text-info",
2077
2077
  children: "your pick"
2078
2078
  })] })
2079
2079
  ] }),
2080
- /* @__PURE__ */ N("span", {
2080
+ /* @__PURE__ */ P("span", {
2081
2081
  "aria-hidden": !0,
2082
2082
  children: "·"
2083
2083
  }),
2084
- /* @__PURE__ */ N("span", { children: Ce(e, t, n) }),
2085
- r && !e.resumes && (e.runsOn !== void 0 || e.model !== void 0) && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
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__ */ N("span", {
2088
+ }), /* @__PURE__ */ P("span", {
2089
2089
  className: "text-info",
2090
2090
  children: "your pick"
2091
2091
  })] }),
2092
- !e.resumes && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("span", {
2092
+ /* @__PURE__ */ P("span", {
2093
2093
  "aria-hidden": !0,
2094
2094
  children: "·"
2095
- }), /* @__PURE__ */ N("span", { children: Ze(e) })] })
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 en = [];
2102
- function tn(e, t) {
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 nn({ projects: e }) {
2106
- let t = re(), { value: n, loaded: r } = ie(() => Me(t, e), en, 1e4, [e.map((e) => e.id).join(",")]), i = () => t.openPage("automations");
2107
- return /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ P(l, { children: [/* @__PURE__ */ N(u, {
2108
- icon: /* @__PURE__ */ N(L, {
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__ */ N("p", {
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__ */ N(c, { children: r ? /* @__PURE__ */ N("ul", {
2119
+ })] }), /* @__PURE__ */ P(c, { children: r ? /* @__PURE__ */ P("ul", {
2119
2120
  className: "space-y-4",
2120
2121
  children: n.map((n) => {
2121
- let r = ut(n), a = ot(n), o = n.commands.filter((e) => e.on), s = tn(n.commands.length - o.length, o.length);
2122
- return /* @__PURE__ */ P("li", {
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__ */ P("div", {
2126
+ /* @__PURE__ */ F("div", {
2126
2127
  className: "flex items-center gap-2",
2127
2128
  children: [
2128
- e.length > 1 && /* @__PURE__ */ N("span", {
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__ */ P("span", {
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__ */ N("span", {
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__ */ P("span", {
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__ */ P(E, { children: [/* @__PURE__ */ N(O, {
2146
- render: /* @__PURE__ */ N("span", { className: "tabular-nums" }),
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__ */ P(D, { children: ["The scheduler last looked ", te(n.lastTick.at)] })] })
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__ */ N("p", {
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__ */ P("p", {
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__ */ P("p", {
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__ */ N("ul", {
2166
+ o.length > 0 && /* @__PURE__ */ P("ul", {
2166
2167
  className: "mt-2 space-y-1.5",
2167
- children: o.map((e) => /* @__PURE__ */ N(rn, {
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__ */ N("p", {
2175
+ n.unreadable.map((e) => /* @__PURE__ */ P("p", {
2175
2176
  className: "mt-1.5 text-xs text-warning",
2176
- children: Ee(e)
2177
+ children: Te(e)
2177
2178
  }, e.skill)),
2178
- s !== void 0 && /* @__PURE__ */ P("p", {
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__ */ N("a", {
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__ */ N("p", {
2198
+ }) : /* @__PURE__ */ P("p", {
2198
2199
  className: "py-2 text-sm text-muted-foreground",
2199
2200
  children: "Loading…"
2200
2201
  }) })] });
2201
2202
  }
2202
- function rn({ command: e, stopped: t, lookedAt: n, onOpenRun: r }) {
2203
+ function nn({ command: e, stopped: t, lookedAt: n, onOpenRun: r }) {
2203
2204
  let i = e.decision?.run;
2204
- return /* @__PURE__ */ P("li", {
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__ */ N("span", {
2208
+ /* @__PURE__ */ P("span", {
2208
2209
  className: "min-w-0 truncate font-mono text-[13px]",
2209
- children: Te(e)
2210
+ children: we(e)
2210
2211
  }),
2211
- !t && /* @__PURE__ */ N("span", {
2212
+ !t && /* @__PURE__ */ P("span", {
2212
2213
  className: "text-xs text-muted-foreground",
2213
- children: at(e)
2214
+ children: it(e)
2214
2215
  }),
2215
- i !== void 0 && /* @__PURE__ */ P("button", {
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 an = [], on = 500;
2231
- function sn({ projects: e }) {
2232
- let t = re(), { value: r, reload: o } = ie(() => Me(t, e), an, 1e4, [e.map((e) => e.id).join(",")]), [s, c] = a(), l = Ne(r), [u, f] = a(), [m, h] = a(), g = i(void 0), _ = i(Promise.resolve());
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 Ie(t, e, n).catch((e) => ({
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
- }, on);
2246
- }, b = Pe(r), x = r.filter((e) => e.error !== void 0);
2247
- return e.length === 0 ? null : /* @__PURE__ */ P(C, {
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__ */ N(S, {
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__ */ N(d, {
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 = Fe(t);
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__ */ N("p", {
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__ */ N("p", {
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 cn = j({
2285
+ var sn = j({
2285
2286
  pages: [{
2286
2287
  segment: "automations",
2287
2288
  label: "Automations",
2288
- icon: L,
2289
- Page: Xt
2289
+ icon: z,
2290
+ Page: Yt
2290
2291
  }],
2291
2292
  cards: [{
2292
2293
  id: "scheduler",
2293
2294
  order: 90,
2294
- Card: nn
2295
+ Card: tn
2295
2296
  }],
2296
2297
  settings: [{
2297
2298
  id: "scheduler",
2298
2299
  title: "Scheduler",
2299
- icon: L,
2300
+ icon: z,
2300
2301
  order: 20,
2301
- Section: sn
2302
+ Section: on
2302
2303
  }],
2303
2304
  usageLimit: {
2304
- read: async (e, t) => Ne(await Me(e, t)),
2305
- save: Ie
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 Me(e, [t]);
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 = ot(n);
2313
+ let r = at(n);
2313
2314
  return n.commands.map((e) => ({
2314
2315
  command: e.command,
2315
- on: e.on && r === void 0 && et(e) === void 0,
2316
- ...e.on ? { note: r ?? at(e) } : {}
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 { cn as default };
2324
+ export { sn as default };