forge-cw 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/modules/mod-today/dist/banner.js +95 -19
- package/modules/mod-today/dist/server.js +49 -18
- package/modules/mod-today/dist/view.js +87 -19
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8656,7 +8656,7 @@ function runAgent(input, o) {
|
|
|
8656
8656
|
const cwd = mkdtempSync2(join19(tmpdir2(), "forge-agent-"));
|
|
8657
8657
|
const cleanup = () => rmSync4(cwd, { recursive: true, force: true });
|
|
8658
8658
|
return new Promise((resolve11, reject) => {
|
|
8659
|
-
const child = spawn9("claude", args, { cwd, env: { ...envWithoutHarness(), CLAUDE_CONFIG_DIR: configDir }, stdio: ["pipe", "pipe", "pipe"] });
|
|
8659
|
+
const child = spawn9("claude", args, { cwd, env: { ...envWithoutHarness(), CLAUDE_CONFIG_DIR: configDir, ...CONNECTOR_ENV }, stdio: ["pipe", "pipe", "pipe"] });
|
|
8660
8660
|
child.stdin?.on("error", () => {
|
|
8661
8661
|
});
|
|
8662
8662
|
child.stdin?.end(input.prompt);
|
|
@@ -8698,7 +8698,7 @@ function runAgent(input, o) {
|
|
|
8698
8698
|
}));
|
|
8699
8699
|
}).finally(cleanup);
|
|
8700
8700
|
}
|
|
8701
|
-
var DEFAULT_TIMEOUT_MS;
|
|
8701
|
+
var DEFAULT_TIMEOUT_MS, CONNECTOR_ENV;
|
|
8702
8702
|
var init_agent_runner = __esm({
|
|
8703
8703
|
"../core/dist/agent-runner.js"() {
|
|
8704
8704
|
"use strict";
|
|
@@ -8706,6 +8706,7 @@ var init_agent_runner = __esm({
|
|
|
8706
8706
|
init_cw_types();
|
|
8707
8707
|
init_cw_doctor();
|
|
8708
8708
|
DEFAULT_TIMEOUT_MS = 18e4;
|
|
8709
|
+
CONNECTOR_ENV = { MCP_CONNECTION_NONBLOCKING: "false", MCP_TIMEOUT: "60000" };
|
|
8709
8710
|
}
|
|
8710
8711
|
});
|
|
8711
8712
|
|
|
@@ -19,7 +19,18 @@ var failedLine = (error) => `Last reading failed: ${error}`;
|
|
|
19
19
|
var loadFailedLine = (error) => `Can't load Today: ${error}`;
|
|
20
20
|
var notesLine = (notes) => notes?.length ? notes.join(" \xB7 ") : null;
|
|
21
21
|
var SOURCE_NAME = { slack: "Slack", linear: "Linear", reader: "Reader" };
|
|
22
|
-
|
|
22
|
+
function sourcesLabel(sources) {
|
|
23
|
+
const names = ["slack", "linear", "reader"].filter((s) => sources.includes(s)).map((s) => SOURCE_NAME[s]);
|
|
24
|
+
return names.join(" and ");
|
|
25
|
+
}
|
|
26
|
+
function groupProblems(problems) {
|
|
27
|
+
const accounts = [...new Set(problems.map((p) => p.account))];
|
|
28
|
+
return accounts.map((account) => {
|
|
29
|
+
const mine = problems.filter((p) => p.account === account);
|
|
30
|
+
return { account, label: sourcesLabel(mine.map((p) => p.source)), reasons: mine.map((p) => `${SOURCE_NAME[p.source]}: ${p.reason}`) };
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var groupLine = (g) => `${g.account} \xB7 ${g.label} did not respond`;
|
|
23
34
|
var problemsLabel = (n) => `\u26A0 ${n} account problem${n === 1 ? "" : "s"}`;
|
|
24
35
|
var accountsOf = (items) => [...new Set(items.flatMap((i) => i.account ? [i.account] : []))];
|
|
25
36
|
|
|
@@ -61,6 +72,7 @@ function useAccountFilter() {
|
|
|
61
72
|
function useDigest(forge, path = "/digest") {
|
|
62
73
|
const [reply, setReply] = useState(null);
|
|
63
74
|
const [error, setError] = useState(null);
|
|
75
|
+
const [hurried, hurry] = useState(false);
|
|
64
76
|
const latest = useRef(0);
|
|
65
77
|
const load = useCallback(async () => {
|
|
66
78
|
const mine = ++latest.current;
|
|
@@ -73,19 +85,20 @@ function useDigest(forge, path = "/digest") {
|
|
|
73
85
|
if (mine === latest.current) setError(errorMessage(e));
|
|
74
86
|
}
|
|
75
87
|
}, [forge, path]);
|
|
88
|
+
const fast = hurried || !!reply?.reading;
|
|
76
89
|
useEffect(() => {
|
|
77
90
|
void load();
|
|
78
91
|
const poll = () => {
|
|
79
92
|
if (!document.hidden) void load();
|
|
80
93
|
};
|
|
81
|
-
const t = setInterval(poll, 6e4);
|
|
94
|
+
const t = setInterval(poll, fast ? 3e3 : 6e4);
|
|
82
95
|
document.addEventListener("visibilitychange", poll);
|
|
83
96
|
return () => {
|
|
84
97
|
clearInterval(t);
|
|
85
98
|
document.removeEventListener("visibilitychange", poll);
|
|
86
99
|
};
|
|
87
|
-
}, [load]);
|
|
88
|
-
return { reply, error, reload: load };
|
|
100
|
+
}, [load, fast]);
|
|
101
|
+
return { reply, error, reload: load, hurry };
|
|
89
102
|
}
|
|
90
103
|
function useProjects(forge) {
|
|
91
104
|
const [projects, setProjects] = useState(EMPTY_PROJECTS);
|
|
@@ -95,7 +108,8 @@ function useProjects(forge) {
|
|
|
95
108
|
}, [forge]);
|
|
96
109
|
return projects;
|
|
97
110
|
}
|
|
98
|
-
function useActing(forge, date, reload) {
|
|
111
|
+
function useActing(forge, date, reload, hurry = () => {
|
|
112
|
+
}) {
|
|
99
113
|
const [busy, setBusy] = useState(false);
|
|
100
114
|
const [refreshing, setRefreshing] = useState(false);
|
|
101
115
|
const [retrying, setRetrying] = useState(null);
|
|
@@ -121,7 +135,9 @@ function useActing(forge, date, reload) {
|
|
|
121
135
|
if (reading.current) return;
|
|
122
136
|
reading.current = true;
|
|
123
137
|
setRefreshing(true);
|
|
138
|
+
hurry(true);
|
|
124
139
|
await guarded(() => forge.action("refresh"));
|
|
140
|
+
hurry(false);
|
|
125
141
|
reading.current = false;
|
|
126
142
|
setRefreshing(false);
|
|
127
143
|
};
|
|
@@ -129,7 +145,9 @@ function useActing(forge, date, reload) {
|
|
|
129
145
|
if (busy) return;
|
|
130
146
|
setBusy(true);
|
|
131
147
|
setRetrying(account);
|
|
148
|
+
hurry(true);
|
|
132
149
|
await guarded(() => forge.action("retry-account", { account }));
|
|
150
|
+
hurry(false);
|
|
133
151
|
setRetrying(null);
|
|
134
152
|
setBusy(false);
|
|
135
153
|
};
|
|
@@ -293,15 +311,58 @@ var Row = ({ item, projects = EMPTY_PROJECTS, acting, forge }) => {
|
|
|
293
311
|
] })
|
|
294
312
|
] });
|
|
295
313
|
};
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
314
|
+
var READING_CSS = `
|
|
315
|
+
@keyframes today-spin { to { transform: rotate(360deg) } }
|
|
316
|
+
@keyframes today-pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
|
|
317
|
+
.today-spin { animation: today-spin .8s linear infinite }
|
|
318
|
+
.today-pulse { animation: today-pulse 1.4s ease-in-out infinite }
|
|
319
|
+
@media (prefers-reduced-motion: reduce) { .today-spin, .today-pulse { animation: none } }`;
|
|
320
|
+
function useReadingStyles() {
|
|
321
|
+
if (typeof document !== "undefined" && !document.getElementById("today-reading-css")) {
|
|
322
|
+
const el = document.createElement("style");
|
|
323
|
+
el.id = "today-reading-css";
|
|
324
|
+
el.textContent = READING_CSS;
|
|
325
|
+
document.head.appendChild(el);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
function Spinner() {
|
|
329
|
+
return /* @__PURE__ */ jsx("i", { class: "today-spin", style: { display: "inline-block", width: "10px", height: "10px", borderRadius: "50%", border: "2px solid var(--hair-2)", borderTopColor: "var(--blue)", boxSizing: "border-box" } });
|
|
330
|
+
}
|
|
331
|
+
function ReadingLine({ reading }) {
|
|
332
|
+
useReadingStyles();
|
|
333
|
+
const accounts = Object.entries(reading?.accounts ?? {});
|
|
334
|
+
return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", style: { display: "inline-flex", alignItems: "center", gap: "6px", fontSize: "12px", color: "var(--ink-2)", flexWrap: "wrap" }, children: [
|
|
335
|
+
/* @__PURE__ */ jsx("b", { class: "today-pulse", style: { fontWeight: 600, color: "var(--ink)" }, children: accounts.length ? "Reading" : "Reading\u2026" }),
|
|
336
|
+
accounts.map(([account, state], n) => /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "5px" }, children: [
|
|
337
|
+
n > 0 && /* @__PURE__ */ jsx("span", { style: { color: "var(--ink-3)" }, children: "\xB7" }),
|
|
338
|
+
state === "reading" ? /* @__PURE__ */ jsx(Spinner, {}) : state === "done" ? /* @__PURE__ */ jsx("span", { style: { color: "var(--green)" }, children: "\u2713" }) : /* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
339
|
+
account
|
|
340
|
+
] }, account)),
|
|
341
|
+
accounts.length > 0 && /* @__PURE__ */ jsx("span", { children: "\u2026" })
|
|
342
|
+
] });
|
|
343
|
+
}
|
|
344
|
+
function SkeletonRows() {
|
|
345
|
+
useReadingStyles();
|
|
346
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [0, 1, 2].map((n) => /* @__PURE__ */ jsxs("div", { class: "today-pulse", style: { display: "flex", alignItems: "center", gap: "12px", padding: "10px 12px", borderRadius: "10px", background: "var(--elev)", border: "1px solid var(--hair)", animationDelay: `${n * 0.15}s` }, children: [
|
|
347
|
+
/* @__PURE__ */ jsx("div", { style: { width: "30px", height: "30px", borderRadius: "8px", background: "var(--hair)" } }),
|
|
348
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
349
|
+
/* @__PURE__ */ jsx("div", { style: { height: "9px", width: `${70 - n * 12}%`, borderRadius: "5px", background: "var(--hair)" } }),
|
|
350
|
+
/* @__PURE__ */ jsx("div", { style: { height: "8px", width: "35%", borderRadius: "5px", background: "var(--hair)" } })
|
|
304
351
|
] })
|
|
352
|
+
] }, n)) });
|
|
353
|
+
}
|
|
354
|
+
function ProblemRow({ group, acting, details = false }) {
|
|
355
|
+
const mine = acting.retrying === group.account;
|
|
356
|
+
return /* @__PURE__ */ jsxs("div", { role: "alert", title: group.reasons.join("\n"), style: { padding: "7px 10px", borderRadius: "10px", fontSize: "12px", color: "var(--ink-2)", background: soft("--orange", 10), border: `1px solid ${soft("--orange", 35)}` }, children: [
|
|
357
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
358
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
359
|
+
/* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: groupLine(group) }),
|
|
360
|
+
/* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "flex", gap: "8px", flexShrink: 0 }, children: [
|
|
361
|
+
/* @__PURE__ */ jsx(Btn, { label: mine ? "Reading\u2026" : "Retry", disabled: acting.busy, onClick: () => acting.retry(group.account) }),
|
|
362
|
+
/* @__PURE__ */ jsx(Btn, { label: "Reconnect", style: ghostStyle, disabled: acting.busy, onClick: () => acting.reconnect(group.account) })
|
|
363
|
+
] })
|
|
364
|
+
] }),
|
|
365
|
+
details && /* @__PURE__ */ jsx("ul", { style: { margin: "6px 0 0 22px", padding: 0, color: "var(--ink-3)", fontSize: "11.5px" }, children: group.reasons.map((r) => /* @__PURE__ */ jsx("li", { children: r }, r)) })
|
|
305
366
|
] });
|
|
306
367
|
}
|
|
307
368
|
|
|
@@ -342,12 +403,14 @@ function Strip({ title, children, actions }) {
|
|
|
342
403
|
);
|
|
343
404
|
}
|
|
344
405
|
function Banner({ forge }) {
|
|
345
|
-
const { reply, error, reload } = useDigest(forge);
|
|
406
|
+
const { reply, error, reload, hurry } = useDigest(forge);
|
|
346
407
|
const projects = useProjects(forge);
|
|
347
408
|
const [chosen, choose] = useAccountFilter();
|
|
348
409
|
const digest = reply?.digest;
|
|
349
|
-
const acting = useActing(forge, digest?.date, reload);
|
|
350
|
-
const
|
|
410
|
+
const acting = useActing(forge, digest?.date, reload, hurry);
|
|
411
|
+
const reading = reply?.reading;
|
|
412
|
+
const isReading = acting.refreshing || !!reading;
|
|
413
|
+
const refreshBtn = /* @__PURE__ */ jsx2(Btn, { label: isReading ? "Reading\u2026" : "Refresh", style: ghostStyle, disabled: isReading, onClick: acting.refresh });
|
|
351
414
|
const failure = (text) => /* @__PURE__ */ jsxs2("span", { style: { color: "var(--red)" }, children: [
|
|
352
415
|
"\xB7 ",
|
|
353
416
|
text
|
|
@@ -357,8 +420,8 @@ function Banner({ forge }) {
|
|
|
357
420
|
"\xB7 ",
|
|
358
421
|
notes
|
|
359
422
|
] });
|
|
360
|
-
const problems = digest?.problems ?? [];
|
|
361
|
-
const problemRows = problems.length > 0 && /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginBottom: "8px" }, children: problems.map((
|
|
423
|
+
const problems = groupProblems(digest?.problems ?? []);
|
|
424
|
+
const problemRows = problems.length > 0 && /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginBottom: "8px" }, children: problems.map((g) => /* @__PURE__ */ jsx2(ProblemRow, { group: g, acting }, g.account)) });
|
|
362
425
|
const problemsLink = problems.length > 0 && /* @__PURE__ */ jsxs2("button", { type: "button", onClick: () => forge.openPage(), style: { font: "inherit", fontSize: "inherit", padding: 0, border: 0, background: "none", cursor: "pointer", color: "var(--orange)" }, children: [
|
|
363
426
|
"\xB7 ",
|
|
364
427
|
problemsLabel(problems.length)
|
|
@@ -367,6 +430,19 @@ function Banner({ forge }) {
|
|
|
367
430
|
if (reply && !reply.enabled) {
|
|
368
431
|
return /* @__PURE__ */ jsx2(Strip, { title: "Today", actions: /* @__PURE__ */ jsx2(Btn, { label: "Turn on", style: primaryStyle, disabled: acting.busy, onClick: () => acting.run(() => forge.action("enable")) }), children: /* @__PURE__ */ jsx2("span", { children: "\xB7 Linear, Slack and GitHub each morning" }) });
|
|
369
432
|
}
|
|
433
|
+
if (reply && isReading && (!digest || digest.items.length === 0)) {
|
|
434
|
+
return shell(
|
|
435
|
+
/* @__PURE__ */ jsxs2("div", { style: { padding: "14px 18px", display: "flex", flexDirection: "column", gap: "12px" }, children: [
|
|
436
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
437
|
+
/* @__PURE__ */ jsx2("span", { style: { color: "var(--orange)" }, children: "\u2600\uFE0E" }),
|
|
438
|
+
/* @__PURE__ */ jsx2(ReadingLine, { reading }),
|
|
439
|
+
/* @__PURE__ */ jsx2("span", { style: { marginLeft: "auto" }, children: refreshBtn })
|
|
440
|
+
] }),
|
|
441
|
+
!digest && /* @__PURE__ */ jsx2(SkeletonRows, {}),
|
|
442
|
+
problemRows
|
|
443
|
+
] })
|
|
444
|
+
);
|
|
445
|
+
}
|
|
370
446
|
if (!reply || !digest || digest.items.length === 0) {
|
|
371
447
|
return /* @__PURE__ */ jsxs2(Strip, { title: reply && !digest ? "Not read yet" : shortDay(/* @__PURE__ */ new Date(), digest?.date), actions: refreshBtn, children: [
|
|
372
448
|
!reply ? failure(loadFailedLine(error)) : digest?.error ? failure(failedLine(digest.error)) : digest && /* @__PURE__ */ jsxs2("span", { children: [
|
|
@@ -412,7 +488,7 @@ function Banner({ forge }) {
|
|
|
412
488
|
/* @__PURE__ */ jsx2("div", { style: { width: "34px", height: "34px", borderRadius: "10px", display: "grid", placeItems: "center", background: "linear-gradient(160deg, #ffb340, #ff7a1a)", boxShadow: "0 4px 14px rgba(255, 140, 30, .35)", fontSize: "17px" }, children: "\u2600\uFE0E" }),
|
|
413
489
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
414
490
|
/* @__PURE__ */ jsx2("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 650, letterSpacing: "-.01em" }, children: dayLabel(/* @__PURE__ */ new Date(), digest.date) }),
|
|
415
|
-
/* @__PURE__ */ jsx2("div", { style: { color: "var(--ink-2)", fontSize: "12px", marginTop: "1px" }, children: readLine(digest) })
|
|
491
|
+
/* @__PURE__ */ jsx2("div", { style: { color: "var(--ink-2)", fontSize: "12px", marginTop: "1px" }, children: isReading ? /* @__PURE__ */ jsx2(ReadingLine, { reading }) : readLine(digest) })
|
|
416
492
|
] }),
|
|
417
493
|
/* @__PURE__ */ jsxs2("div", { style: { marginLeft: "auto", display: "flex", gap: "8px" }, children: [
|
|
418
494
|
refreshBtn,
|
|
@@ -95,11 +95,13 @@ function parseReaderProblems(out) {
|
|
|
95
95
|
return [];
|
|
96
96
|
}
|
|
97
97
|
if (!isRecord(root) || !Array.isArray(root.problems)) return [];
|
|
98
|
-
return root.problems.filter((p) => typeof p === "string" &&
|
|
98
|
+
return root.problems.filter((p) => typeof p === "string" && /\b(slack|linear)\b/i.test(p) && !/^\s*github/i.test(p)).slice(0, 5).map((p) => p.replace(/\s+/g, " ").trim().slice(0, 160));
|
|
99
99
|
}
|
|
100
100
|
function toProblem(account, text2) {
|
|
101
101
|
const m = /^(slack|linear|reader)\s*:\s*(.+)$/i.exec(text2);
|
|
102
|
-
|
|
102
|
+
if (m) return { account, source: m[1].toLowerCase(), reason: m[2] };
|
|
103
|
+
const named = /\b(slack|linear)\b/i.exec(text2);
|
|
104
|
+
return { account, source: named ? named[1].toLowerCase() : "reader", reason: text2 };
|
|
103
105
|
}
|
|
104
106
|
function parseReaderOutput(out, known) {
|
|
105
107
|
const root = extractJson(out);
|
|
@@ -214,7 +216,7 @@ Item kinds (to-task | issue | request | research | review), exactly one per item
|
|
|
214
216
|
Answer with ONLY a JSON object, no prose and no code fence:
|
|
215
217
|
{ "items": [ { "source": "linear" | "slack" | "github", "kind": "to-task" | "issue" | "request" | "research" | "review", "title": string, "who": string, "where": string, "when": ISO time of the latest activity, "quote"?: string, "link": string (permalink, issue URL or pull request URL), "issueKey"?: string, "targetSession"?: { "project": string, "sessionDir": string }, "project"?: string } ], "problems"?: [ string ] }
|
|
216
218
|
Every item needs a link. Use an empty items array when there is nothing new.
|
|
217
|
-
|
|
219
|
+
Problems are only for the Slack and Linear tools: if one is missing, still connecting or fails, do not report "nothing new" for it, add "slack: <short reason>" or "linear: <short reason>" to problems. Never put anything else in problems (GitHub is given to you as data, not a tool).`;
|
|
218
220
|
}
|
|
219
221
|
|
|
220
222
|
// src/github.ts
|
|
@@ -314,7 +316,8 @@ async function fetchGithub(ctx, since, deadlineMs = DEADLINE_MS) {
|
|
|
314
316
|
items.push({ type: "mention", repo: n.repository.full_name, number: page.number, title: n.subject.title, url: page.url, pr: page.url, when: n.updated_at });
|
|
315
317
|
}
|
|
316
318
|
}
|
|
317
|
-
|
|
319
|
+
const requested = asked.length >= MAX_PRS ? void 0 : asked.map((pr) => pr.url);
|
|
320
|
+
return unread ? { items, requested, error: `${unread} pull request${unread === 1 ? "" : "s"} could not be read` } : { items, requested };
|
|
318
321
|
} catch (e) {
|
|
319
322
|
return { items: [], error: errorMessage(e) };
|
|
320
323
|
}
|
|
@@ -327,6 +330,9 @@ function localDate(d) {
|
|
|
327
330
|
const p = (n) => String(n).padStart(2, "0");
|
|
328
331
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}`;
|
|
329
332
|
}
|
|
333
|
+
var timing = { retryMs: 15e3 };
|
|
334
|
+
var progress;
|
|
335
|
+
var readingNow = () => progress ? { startedAt: progress.startedAt, accounts: { ...progress.accounts } } : void 0;
|
|
330
336
|
var chain = Promise.resolve();
|
|
331
337
|
function locked(fn) {
|
|
332
338
|
const next = chain.then(fn, fn);
|
|
@@ -385,7 +391,10 @@ async function readAccount(ctx, account, o) {
|
|
|
385
391
|
const model = typeof ctx.settings.model === "string" && ctx.settings.model ? ctx.settings.model : void 0;
|
|
386
392
|
const ask = () => ctx.agent.run({ account, prompt, model, allowedTools: READER_TOOLS, timeoutMs: 10 * 60 * 1e3 });
|
|
387
393
|
let out = await ask();
|
|
388
|
-
if (parseReaderProblems(out.text).length)
|
|
394
|
+
if (parseReaderProblems(out.text).length) {
|
|
395
|
+
await new Promise((r) => setTimeout(r, timing.retryMs));
|
|
396
|
+
out = await ask();
|
|
397
|
+
}
|
|
389
398
|
const problems = parseReaderProblems(out.text).map((p) => toProblem(account, p));
|
|
390
399
|
const fetched = new Set(github.map((e) => e.pr));
|
|
391
400
|
const toReview = new Set(github.filter((e) => e.type === "review-request").map((e) => e.pr));
|
|
@@ -395,11 +404,15 @@ async function readAccount(ctx, account, o) {
|
|
|
395
404
|
return { items: github.length ? fresh.map((i) => ({ ...i, manual: true })) : fresh, problems };
|
|
396
405
|
}
|
|
397
406
|
async function readOne(ctx, account, o) {
|
|
407
|
+
const finish = (r) => {
|
|
408
|
+
if (progress) progress.accounts[account] = r.problems.length ? "problem" : "done";
|
|
409
|
+
return r;
|
|
410
|
+
};
|
|
398
411
|
try {
|
|
399
|
-
return { account, ...await readAccount(ctx, account, o) };
|
|
412
|
+
return finish({ account, ...await readAccount(ctx, account, o) });
|
|
400
413
|
} catch (e) {
|
|
401
414
|
const error = errorMessage(e);
|
|
402
|
-
return { account, items: [], problems: [{ account, source: "reader", reason: error.replace(/\s+/g, " ").trim().slice(0, 160) }], error };
|
|
415
|
+
return finish({ account, items: [], problems: [{ account, source: "reader", reason: error.replace(/\s+/g, " ").trim().slice(0, 160) }], error });
|
|
403
416
|
}
|
|
404
417
|
}
|
|
405
418
|
async function reread(ctx, now, notes) {
|
|
@@ -413,13 +426,15 @@ async function reread(ctx, now, notes) {
|
|
|
413
426
|
readAccounts(ctx)
|
|
414
427
|
]);
|
|
415
428
|
const owners = ownersOf(projects);
|
|
429
|
+
if (progress) progress.accounts = Object.fromEntries(accounts.map((a) => [a, "reading"]));
|
|
416
430
|
const results = await Promise.all(accounts.map((account, n) => readOne(ctx, account, { since, sessions, projects, owners, github: n === 0 ? github : void 0, handled: handled ?? {} })));
|
|
417
431
|
const gh2 = await github;
|
|
418
432
|
if (gh2.error) notes.push(`GitHub: ${gh2.error}`);
|
|
419
433
|
if (results[0].error && gh2.items.length) notes.push("GitHub: not read");
|
|
420
434
|
const failed = results.filter((r) => r.error);
|
|
421
435
|
if (failed.length === results.length) throw new Error(failed.length === 1 ? failed[0].error : failed.map((f) => `${f.account}: ${f.error}`).join("; "));
|
|
422
|
-
|
|
436
|
+
const requested = gh2.error ? void 0 : new Set(gh2.requested ?? gh2.items.filter((e) => e.type === "review-request").map((e) => e.pr));
|
|
437
|
+
return { items: collapse(results.flatMap((r) => r.items)), problems: results.flatMap((r) => r.problems), requested };
|
|
423
438
|
}
|
|
424
439
|
async function rememberHandled(ctx, items, now) {
|
|
425
440
|
const old = await ctx.storage.get("handled") ?? {};
|
|
@@ -428,6 +443,10 @@ async function rememberHandled(ctx, items, now) {
|
|
|
428
443
|
for (const i of items) next[i.id] = i.when;
|
|
429
444
|
await ctx.storage.set("handled", next);
|
|
430
445
|
}
|
|
446
|
+
function dropStaleReviews(items, requested) {
|
|
447
|
+
if (!requested) return items;
|
|
448
|
+
return items.filter((i) => !(i.kind === "review" && i.state === "proposed" && !requested.has(githubPage(i.link) ?? i.link)));
|
|
449
|
+
}
|
|
431
450
|
function merge(existing, fresh) {
|
|
432
451
|
const byId = new Map(existing.map((i) => [i.id, i]));
|
|
433
452
|
const out = [...existing];
|
|
@@ -446,20 +465,24 @@ var reading;
|
|
|
446
465
|
var OFF_MESSAGE = "Today is off";
|
|
447
466
|
async function readNow(ctx, now) {
|
|
448
467
|
if (!await isEnabled(ctx)) throw new ModuleError("bad_request", OFF_MESSAGE);
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
468
|
+
if (!reading) {
|
|
469
|
+
progress = { startedAt: (/* @__PURE__ */ new Date()).toISOString(), accounts: {} };
|
|
470
|
+
reading = doRead(ctx, now).finally(() => {
|
|
471
|
+
reading = void 0;
|
|
472
|
+
progress = void 0;
|
|
473
|
+
});
|
|
474
|
+
}
|
|
452
475
|
return reading;
|
|
453
476
|
}
|
|
454
477
|
async function doRead(ctx, now) {
|
|
455
478
|
const date = localDate(now);
|
|
456
479
|
const notes = [];
|
|
457
480
|
try {
|
|
458
|
-
const { items: fresh, problems } = await reread(ctx, now, notes);
|
|
481
|
+
const { items: fresh, problems, requested } = await reread(ctx, now, notes);
|
|
459
482
|
const lastReadAt = await ctx.storage.get("lastReadAt");
|
|
460
483
|
await locked(async () => {
|
|
461
484
|
const prev = await loadDigest(ctx, date);
|
|
462
|
-
const items = merge(prev?.items ?? [], fresh);
|
|
485
|
+
const items = dropStaleReviews(merge(prev?.items ?? [], fresh), requested);
|
|
463
486
|
const known = new Set((prev?.items ?? []).map((i) => i.id));
|
|
464
487
|
if (items.some((i) => i.state === "proposed" && !known.has(i.id))) await ctx.storage.delete(`folded/${date}`);
|
|
465
488
|
await saveDigest(ctx, {
|
|
@@ -484,13 +507,20 @@ async function doRead(ctx, now) {
|
|
|
484
507
|
async function retryAccount(ctx, account, now) {
|
|
485
508
|
if (!await isEnabled(ctx)) throw new ModuleError("bad_request", OFF_MESSAGE);
|
|
486
509
|
if (!(await readAccounts(ctx)).includes(account)) throw new ModuleError("bad_request", `${account} is not an account Today reads`);
|
|
487
|
-
|
|
488
|
-
});
|
|
510
|
+
if (reading) throw new ModuleError("bad_request", "a reading is running");
|
|
489
511
|
const date = localDate(now);
|
|
490
512
|
const prev = await loadDigest(ctx, date);
|
|
491
513
|
if (!prev) throw new ModuleError("not_found", `no digest for ${date}`);
|
|
492
|
-
|
|
493
|
-
|
|
514
|
+
progress ??= { startedAt: (/* @__PURE__ */ new Date()).toISOString(), accounts: {} };
|
|
515
|
+
progress.accounts[account] = "reading";
|
|
516
|
+
const mine = progress;
|
|
517
|
+
let result;
|
|
518
|
+
try {
|
|
519
|
+
const [sessions, projects, handled] = await Promise.all([ctx.sessions.list(), ctx.projects.list(), ctx.storage.get("handled")]);
|
|
520
|
+
result = await readOne(ctx, account, { since: prev.since, sessions, projects, owners: ownersOf(projects), handled: handled ?? {} });
|
|
521
|
+
} finally {
|
|
522
|
+
if (progress === mine && !Object.values(mine.accounts).includes("reading")) progress = void 0;
|
|
523
|
+
}
|
|
494
524
|
await locked(async () => {
|
|
495
525
|
const digest = await loadDigest(ctx, date) ?? prev;
|
|
496
526
|
const items = merge(digest.items, result.items);
|
|
@@ -723,7 +753,8 @@ async function digestFor(ctx, date) {
|
|
|
723
753
|
if (latest) [digest, folded] = await read(wanted = latest);
|
|
724
754
|
}
|
|
725
755
|
const enabled = await isEnabled(ctx);
|
|
726
|
-
|
|
756
|
+
const reading2 = readingNow();
|
|
757
|
+
return { ...digest ? { digest, folded, enabled } : { digest: null, folded: false, enabled }, ...reading2 ? { reading: reading2 } : {} };
|
|
727
758
|
}
|
|
728
759
|
var server_default = defineModule({
|
|
729
760
|
routes: [
|
|
@@ -21,7 +21,18 @@ var failedLine = (error) => `Last reading failed: ${error}`;
|
|
|
21
21
|
var loadFailedLine = (error) => `Can't load Today: ${error}`;
|
|
22
22
|
var notesLine = (notes) => notes?.length ? notes.join(" \xB7 ") : null;
|
|
23
23
|
var SOURCE_NAME = { slack: "Slack", linear: "Linear", reader: "Reader" };
|
|
24
|
-
|
|
24
|
+
function sourcesLabel(sources) {
|
|
25
|
+
const names = ["slack", "linear", "reader"].filter((s) => sources.includes(s)).map((s) => SOURCE_NAME[s]);
|
|
26
|
+
return names.join(" and ");
|
|
27
|
+
}
|
|
28
|
+
function groupProblems(problems) {
|
|
29
|
+
const accounts = [...new Set(problems.map((p) => p.account))];
|
|
30
|
+
return accounts.map((account) => {
|
|
31
|
+
const mine = problems.filter((p) => p.account === account);
|
|
32
|
+
return { account, label: sourcesLabel(mine.map((p) => p.source)), reasons: mine.map((p) => `${SOURCE_NAME[p.source]}: ${p.reason}`) };
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var groupLine = (g) => `${g.account} \xB7 ${g.label} did not respond`;
|
|
25
36
|
var GROUPS = [
|
|
26
37
|
{ title: "In open tasks", pick: (i) => i.kind === "to-task" },
|
|
27
38
|
{ title: "New", pick: (i) => i.kind === "issue" || i.kind === "request" },
|
|
@@ -61,6 +72,7 @@ function AccountChip({ account }) {
|
|
|
61
72
|
function useDigest(forge, path = "/digest") {
|
|
62
73
|
const [reply, setReply] = useState(null);
|
|
63
74
|
const [error, setError] = useState(null);
|
|
75
|
+
const [hurried, hurry] = useState(false);
|
|
64
76
|
const latest = useRef(0);
|
|
65
77
|
const load = useCallback(async () => {
|
|
66
78
|
const mine = ++latest.current;
|
|
@@ -73,19 +85,20 @@ function useDigest(forge, path = "/digest") {
|
|
|
73
85
|
if (mine === latest.current) setError(errorMessage(e));
|
|
74
86
|
}
|
|
75
87
|
}, [forge, path]);
|
|
88
|
+
const fast = hurried || !!reply?.reading;
|
|
76
89
|
useEffect(() => {
|
|
77
90
|
void load();
|
|
78
91
|
const poll = () => {
|
|
79
92
|
if (!document.hidden) void load();
|
|
80
93
|
};
|
|
81
|
-
const t = setInterval(poll, 6e4);
|
|
94
|
+
const t = setInterval(poll, fast ? 3e3 : 6e4);
|
|
82
95
|
document.addEventListener("visibilitychange", poll);
|
|
83
96
|
return () => {
|
|
84
97
|
clearInterval(t);
|
|
85
98
|
document.removeEventListener("visibilitychange", poll);
|
|
86
99
|
};
|
|
87
|
-
}, [load]);
|
|
88
|
-
return { reply, error, reload: load };
|
|
100
|
+
}, [load, fast]);
|
|
101
|
+
return { reply, error, reload: load, hurry };
|
|
89
102
|
}
|
|
90
103
|
function useProjects(forge) {
|
|
91
104
|
const [projects, setProjects] = useState(EMPTY_PROJECTS);
|
|
@@ -95,7 +108,8 @@ function useProjects(forge) {
|
|
|
95
108
|
}, [forge]);
|
|
96
109
|
return projects;
|
|
97
110
|
}
|
|
98
|
-
function useActing(forge, date, reload) {
|
|
111
|
+
function useActing(forge, date, reload, hurry = () => {
|
|
112
|
+
}) {
|
|
99
113
|
const [busy, setBusy] = useState(false);
|
|
100
114
|
const [refreshing, setRefreshing] = useState(false);
|
|
101
115
|
const [retrying, setRetrying] = useState(null);
|
|
@@ -121,7 +135,9 @@ function useActing(forge, date, reload) {
|
|
|
121
135
|
if (reading.current) return;
|
|
122
136
|
reading.current = true;
|
|
123
137
|
setRefreshing(true);
|
|
138
|
+
hurry(true);
|
|
124
139
|
await guarded(() => forge.action("refresh"));
|
|
140
|
+
hurry(false);
|
|
125
141
|
reading.current = false;
|
|
126
142
|
setRefreshing(false);
|
|
127
143
|
};
|
|
@@ -129,7 +145,9 @@ function useActing(forge, date, reload) {
|
|
|
129
145
|
if (busy) return;
|
|
130
146
|
setBusy(true);
|
|
131
147
|
setRetrying(account);
|
|
148
|
+
hurry(true);
|
|
132
149
|
await guarded(() => forge.action("retry-account", { account }));
|
|
150
|
+
hurry(false);
|
|
133
151
|
setRetrying(null);
|
|
134
152
|
setBusy(false);
|
|
135
153
|
};
|
|
@@ -289,15 +307,58 @@ var Row = ({ item, projects = EMPTY_PROJECTS, acting, forge }) => {
|
|
|
289
307
|
] })
|
|
290
308
|
] });
|
|
291
309
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
310
|
+
var READING_CSS = `
|
|
311
|
+
@keyframes today-spin { to { transform: rotate(360deg) } }
|
|
312
|
+
@keyframes today-pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
|
|
313
|
+
.today-spin { animation: today-spin .8s linear infinite }
|
|
314
|
+
.today-pulse { animation: today-pulse 1.4s ease-in-out infinite }
|
|
315
|
+
@media (prefers-reduced-motion: reduce) { .today-spin, .today-pulse { animation: none } }`;
|
|
316
|
+
function useReadingStyles() {
|
|
317
|
+
if (typeof document !== "undefined" && !document.getElementById("today-reading-css")) {
|
|
318
|
+
const el = document.createElement("style");
|
|
319
|
+
el.id = "today-reading-css";
|
|
320
|
+
el.textContent = READING_CSS;
|
|
321
|
+
document.head.appendChild(el);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function Spinner() {
|
|
325
|
+
return /* @__PURE__ */ jsx("i", { class: "today-spin", style: { display: "inline-block", width: "10px", height: "10px", borderRadius: "50%", border: "2px solid var(--hair-2)", borderTopColor: "var(--blue)", boxSizing: "border-box" } });
|
|
326
|
+
}
|
|
327
|
+
function ReadingLine({ reading }) {
|
|
328
|
+
useReadingStyles();
|
|
329
|
+
const accounts = Object.entries(reading?.accounts ?? {});
|
|
330
|
+
return /* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", style: { display: "inline-flex", alignItems: "center", gap: "6px", fontSize: "12px", color: "var(--ink-2)", flexWrap: "wrap" }, children: [
|
|
331
|
+
/* @__PURE__ */ jsx("b", { class: "today-pulse", style: { fontWeight: 600, color: "var(--ink)" }, children: accounts.length ? "Reading" : "Reading\u2026" }),
|
|
332
|
+
accounts.map(([account, state], n) => /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "5px" }, children: [
|
|
333
|
+
n > 0 && /* @__PURE__ */ jsx("span", { style: { color: "var(--ink-3)" }, children: "\xB7" }),
|
|
334
|
+
state === "reading" ? /* @__PURE__ */ jsx(Spinner, {}) : state === "done" ? /* @__PURE__ */ jsx("span", { style: { color: "var(--green)" }, children: "\u2713" }) : /* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
335
|
+
account
|
|
336
|
+
] }, account)),
|
|
337
|
+
accounts.length > 0 && /* @__PURE__ */ jsx("span", { children: "\u2026" })
|
|
338
|
+
] });
|
|
339
|
+
}
|
|
340
|
+
function SkeletonRows() {
|
|
341
|
+
useReadingStyles();
|
|
342
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [0, 1, 2].map((n) => /* @__PURE__ */ jsxs("div", { class: "today-pulse", style: { display: "flex", alignItems: "center", gap: "12px", padding: "10px 12px", borderRadius: "10px", background: "var(--elev)", border: "1px solid var(--hair)", animationDelay: `${n * 0.15}s` }, children: [
|
|
343
|
+
/* @__PURE__ */ jsx("div", { style: { width: "30px", height: "30px", borderRadius: "8px", background: "var(--hair)" } }),
|
|
344
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
345
|
+
/* @__PURE__ */ jsx("div", { style: { height: "9px", width: `${70 - n * 12}%`, borderRadius: "5px", background: "var(--hair)" } }),
|
|
346
|
+
/* @__PURE__ */ jsx("div", { style: { height: "8px", width: "35%", borderRadius: "5px", background: "var(--hair)" } })
|
|
300
347
|
] })
|
|
348
|
+
] }, n)) });
|
|
349
|
+
}
|
|
350
|
+
function ProblemRow({ group, acting, details = false }) {
|
|
351
|
+
const mine = acting.retrying === group.account;
|
|
352
|
+
return /* @__PURE__ */ jsxs("div", { role: "alert", title: group.reasons.join("\n"), style: { padding: "7px 10px", borderRadius: "10px", fontSize: "12px", color: "var(--ink-2)", background: soft("--orange", 10), border: `1px solid ${soft("--orange", 35)}` }, children: [
|
|
353
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
354
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
355
|
+
/* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: groupLine(group) }),
|
|
356
|
+
/* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "flex", gap: "8px", flexShrink: 0 }, children: [
|
|
357
|
+
/* @__PURE__ */ jsx(Btn, { label: mine ? "Reading\u2026" : "Retry", disabled: acting.busy, onClick: () => acting.retry(group.account) }),
|
|
358
|
+
/* @__PURE__ */ jsx(Btn, { label: "Reconnect", style: ghostStyle, disabled: acting.busy, onClick: () => acting.reconnect(group.account) })
|
|
359
|
+
] })
|
|
360
|
+
] }),
|
|
361
|
+
details && /* @__PURE__ */ jsx("ul", { style: { margin: "6px 0 0 22px", padding: 0, color: "var(--ink-3)", fontSize: "11.5px" }, children: group.reasons.map((r) => /* @__PURE__ */ jsx("li", { children: r }, r)) })
|
|
301
362
|
] });
|
|
302
363
|
}
|
|
303
364
|
|
|
@@ -306,10 +367,14 @@ import { jsx as jsx2, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
|
306
367
|
function View({ forge }) {
|
|
307
368
|
const [days, setDays] = useState2([]);
|
|
308
369
|
const [day, setDay] = useState2(null);
|
|
309
|
-
const { reply, error, reload } = useDigest(forge, day ? `/digest/${day}` : "/digest");
|
|
370
|
+
const { reply, error, reload, hurry } = useDigest(forge, day ? `/digest/${day}` : "/digest");
|
|
310
371
|
const projects = useProjects(forge);
|
|
311
372
|
const digest = reply?.digest;
|
|
312
|
-
const acting = useActing(forge, digest?.date, reload);
|
|
373
|
+
const acting = useActing(forge, digest?.date, reload, hurry);
|
|
374
|
+
const reading = reply?.reading;
|
|
375
|
+
const isReading = acting.refreshing || !!reading;
|
|
376
|
+
const [details, setDetails] = useState2(false);
|
|
377
|
+
const problems = groupProblems(digest?.problems ?? []);
|
|
313
378
|
const notes = notesLine(digest?.notes);
|
|
314
379
|
const enabled = reply?.enabled === true;
|
|
315
380
|
useEffect2(() => {
|
|
@@ -320,17 +385,20 @@ function View({ forge }) {
|
|
|
320
385
|
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: "12px", flexWrap: "wrap" }, children: [
|
|
321
386
|
days.length > 0 && /* @__PURE__ */ jsx2("select", { "aria-label": "Day", value: digest?.date ?? "", onChange: (e) => setDay(e.target.value), style: { font: "inherit", fontSize: "12.5px", padding: "5px 8px", borderRadius: "8px", border: "1px solid var(--hair-2)", background: "var(--card)", color: "var(--ink)" }, children: days.map((d) => /* @__PURE__ */ jsx2("option", { value: d, children: d }, d)) }),
|
|
322
387
|
digest && /* @__PURE__ */ jsx2("b", { style: { fontSize: "13px", fontWeight: 600 }, children: dayLabel(/* @__PURE__ */ new Date(), digest.date) }),
|
|
323
|
-
/* @__PURE__ */ jsx2("span", { style: { fontSize: "12px", color: "var(--ink-2)" }, children: digest ? readLine(digest) : "Not read yet" }),
|
|
388
|
+
isReading ? /* @__PURE__ */ jsx2(ReadingLine, { reading }) : /* @__PURE__ */ jsx2("span", { style: { fontSize: "12px", color: "var(--ink-2)" }, children: digest ? readLine(digest) : "Not read yet" }),
|
|
324
389
|
/* @__PURE__ */ jsxs2("span", { style: { marginLeft: "auto", display: "flex", gap: "8px" }, children: [
|
|
325
|
-
enabled && /* @__PURE__ */ jsx2(ActionButton, { label: "Read now", variant: "primary", size: "sm", loading:
|
|
390
|
+
enabled && /* @__PURE__ */ jsx2(ActionButton, { label: isReading ? "Reading\u2026" : "Read now", variant: "primary", size: "sm", disabled: isReading, loading: isReading, onClick: acting.refresh }),
|
|
326
391
|
reply && /* @__PURE__ */ jsx2(ActionButton, { label: enabled ? "Turn off" : "Turn on", variant: enabled ? "secondary" : "primary", size: "sm", disabled: acting.busy, onClick: () => acting.run(() => forge.action(enabled ? "disable" : "enable")) })
|
|
327
392
|
] })
|
|
328
393
|
] }),
|
|
329
394
|
reply && !enabled && /* @__PURE__ */ jsx2("div", { style: { padding: "12px 14px", borderRadius: "10px", fontSize: "12.5px", lineHeight: 1.5, color: "var(--ink-2)", background: "var(--card)", border: "1px solid var(--hair)", maxWidth: "640px" }, children: "Today is off. Turned on, it reads your Linear, Slack and GitHub each morning and whenever you press Read now. Each reading spends your account's usage. Research it proposes can start sessions on its own, a few a day." }),
|
|
330
395
|
(error || digest?.error) && /* @__PURE__ */ jsx2("div", { style: { padding: "10px 12px", borderRadius: "10px", fontSize: "12px", color: "var(--red)", background: "var(--card)", border: "1px solid color-mix(in srgb, var(--red) 45%, var(--hair))" }, children: error ? loadFailedLine(error) : failedLine(digest.error) }),
|
|
331
|
-
|
|
396
|
+
problems.length > 0 && /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
397
|
+
problems.map((g) => /* @__PURE__ */ jsx2(ProblemRow, { group: g, acting, details }, g.account)),
|
|
398
|
+
/* @__PURE__ */ jsx2("button", { type: "button", "aria-expanded": details, onClick: () => setDetails(!details), style: { alignSelf: "flex-start", font: "inherit", fontSize: "11.5px", padding: 0, border: 0, background: "none", cursor: "pointer", color: "var(--ink-3)" }, children: details ? "Hide details" : "Details" })
|
|
399
|
+
] }),
|
|
332
400
|
notes && /* @__PURE__ */ jsx2("div", { style: { fontSize: "12px", color: "var(--ink-3)" }, children: notes }),
|
|
333
|
-
!digest || digest.items.length === 0 ? /* @__PURE__ */ jsx2(EmptyState, { title: "Nothing to show", description: enabled ? "Today reads your Linear, Slack and GitHub once a day. Use Read now to read them now." : "Turn Today on to read your Linear, Slack and GitHub." }) : byAccount(digest.items).map(({ account, sections: sections2 }) => /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
|
|
401
|
+
!digest && isReading ? /* @__PURE__ */ jsx2(SkeletonRows, {}) : !digest || digest.items.length === 0 ? /* @__PURE__ */ jsx2(EmptyState, { title: "Nothing to show", description: enabled ? "Today reads your Linear, Slack and GitHub once a day. Use Read now to read them now." : "Turn Today on to read your Linear, Slack and GitHub." }) : byAccount(digest.items).map(({ account, sections: sections2 }) => /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: [
|
|
334
402
|
account && /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsx2(AccountChip, { account }) }),
|
|
335
403
|
sections2.map(({ title, items }) => /* @__PURE__ */ jsxs2("section", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
336
404
|
/* @__PURE__ */ jsxs2("h4", { style: { margin: "4px 0", fontSize: "11px", fontWeight: 600, letterSpacing: ".06em", textTransform: "uppercase", color: "var(--ink-3)" }, children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-cw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "A visual dashboard for your coding agents on Claude Code, Codex, Pi or OpenCode. Installs CW for you.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@types/node": "^22.0.0",
|
|
41
41
|
"esbuild": "^0.25.0",
|
|
42
42
|
"typescript": "^5.8.0",
|
|
43
|
-
"@forge-dev/
|
|
44
|
-
"@forge-dev/
|
|
43
|
+
"@forge-dev/console": "0.1.0",
|
|
44
|
+
"@forge-dev/core": "0.1.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsc",
|