forge-cw 0.1.24 → 0.1.25
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.
|
@@ -18,6 +18,9 @@ function projectsFor({ names, owners }, account) {
|
|
|
18
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
|
+
var SOURCE_NAME = { slack: "Slack", linear: "Linear", reader: "Reader" };
|
|
22
|
+
var problemLine = (p) => `${p.account} \xB7 ${SOURCE_NAME[p.source]} could not be read (${p.reason})`;
|
|
23
|
+
var problemsLabel = (n) => `\u26A0 ${n} account problem${n === 1 ? "" : "s"}`;
|
|
21
24
|
var accountsOf = (items) => [...new Set(items.flatMap((i) => i.account ? [i.account] : []))];
|
|
22
25
|
|
|
23
26
|
// src/rows.tsx
|
|
@@ -95,6 +98,7 @@ function useProjects(forge) {
|
|
|
95
98
|
function useActing(forge, date, reload) {
|
|
96
99
|
const [busy, setBusy] = useState(false);
|
|
97
100
|
const [refreshing, setRefreshing] = useState(false);
|
|
101
|
+
const [retrying, setRetrying] = useState(null);
|
|
98
102
|
const reading = useRef(false);
|
|
99
103
|
const guarded = async (fn) => {
|
|
100
104
|
try {
|
|
@@ -121,7 +125,19 @@ function useActing(forge, date, reload) {
|
|
|
121
125
|
reading.current = false;
|
|
122
126
|
setRefreshing(false);
|
|
123
127
|
};
|
|
124
|
-
|
|
128
|
+
const retry = async (account) => {
|
|
129
|
+
if (busy) return;
|
|
130
|
+
setBusy(true);
|
|
131
|
+
setRetrying(account);
|
|
132
|
+
await guarded(() => forge.action("retry-account", { account }));
|
|
133
|
+
setRetrying(null);
|
|
134
|
+
setBusy(false);
|
|
135
|
+
};
|
|
136
|
+
const reconnect = (account) => run(async () => {
|
|
137
|
+
const s = await forge.action("reconnect", { account });
|
|
138
|
+
if (s) forge.openSession(s.project, s.sessionDir);
|
|
139
|
+
});
|
|
140
|
+
return { busy, refreshing, retrying, retry, reconnect, run, act, refresh };
|
|
125
141
|
}
|
|
126
142
|
function dayOf(date) {
|
|
127
143
|
const [y, m, d] = date.split("-").map(Number);
|
|
@@ -277,6 +293,17 @@ var Row = ({ item, projects = EMPTY_PROJECTS, acting, forge }) => {
|
|
|
277
293
|
] })
|
|
278
294
|
] });
|
|
279
295
|
};
|
|
296
|
+
function ProblemRow({ problem, acting }) {
|
|
297
|
+
const mine = acting.retrying === problem.account;
|
|
298
|
+
return /* @__PURE__ */ jsxs("div", { role: "alert", style: { display: "flex", alignItems: "center", gap: "10px", padding: "7px 10px", borderRadius: "10px", fontSize: "12px", color: "var(--ink-2)", background: soft("--orange", 10), border: `1px solid ${soft("--orange", 35)}` }, children: [
|
|
299
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
300
|
+
/* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: problemLine(problem) }),
|
|
301
|
+
/* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "flex", gap: "8px", flexShrink: 0 }, children: [
|
|
302
|
+
/* @__PURE__ */ jsx(Btn, { label: mine ? "Reading\u2026" : "Retry", disabled: acting.busy, onClick: () => acting.retry(problem.account) }),
|
|
303
|
+
/* @__PURE__ */ jsx(Btn, { label: "Reconnect", style: ghostStyle, disabled: acting.busy, onClick: () => acting.reconnect(problem.account) })
|
|
304
|
+
] })
|
|
305
|
+
] });
|
|
306
|
+
}
|
|
280
307
|
|
|
281
308
|
// src/banner.tsx
|
|
282
309
|
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
@@ -330,6 +357,12 @@ function Banner({ forge }) {
|
|
|
330
357
|
"\xB7 ",
|
|
331
358
|
notes
|
|
332
359
|
] });
|
|
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((p, i) => /* @__PURE__ */ jsx2(ProblemRow, { problem: p, acting }, `${p.account}/${p.source}/${i}`)) });
|
|
362
|
+
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
|
+
"\xB7 ",
|
|
364
|
+
problemsLabel(problems.length)
|
|
365
|
+
] });
|
|
333
366
|
if (!reply && !error) return null;
|
|
334
367
|
if (reply && !reply.enabled) {
|
|
335
368
|
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" }) });
|
|
@@ -340,6 +373,7 @@ function Banner({ forge }) {
|
|
|
340
373
|
"\xB7 nothing new since ",
|
|
341
374
|
clock(new Date(digest.readAt))
|
|
342
375
|
] }),
|
|
376
|
+
problemsLink,
|
|
343
377
|
note
|
|
344
378
|
] });
|
|
345
379
|
}
|
|
@@ -365,6 +399,7 @@ function Banner({ forge }) {
|
|
|
365
399
|
" sent"
|
|
366
400
|
] }),
|
|
367
401
|
digest.error && failure(failedLine(digest.error)),
|
|
402
|
+
problemsLink,
|
|
368
403
|
note
|
|
369
404
|
] });
|
|
370
405
|
}
|
|
@@ -403,6 +438,7 @@ function Banner({ forge }) {
|
|
|
403
438
|
] }),
|
|
404
439
|
digest.error && /* @__PURE__ */ jsx2("div", { style: { marginBottom: "8px", fontSize: "11.5px", color: "var(--red)" }, children: failedLine(digest.error) }),
|
|
405
440
|
notes && /* @__PURE__ */ jsx2("div", { style: { marginBottom: "8px", fontSize: "11.5px", color: "var(--ink-3)" }, children: notes }),
|
|
441
|
+
problemRows,
|
|
406
442
|
/* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: shown.map((i) => /* @__PURE__ */ jsx2(Row, { item: i, projects, acting, forge }, i.id)) }),
|
|
407
443
|
/* @__PURE__ */ jsx2("div", { style: { marginTop: "10px", fontSize: "11.5px", color: "var(--ink-3)" }, children: "Research starts on its own (limited per day). The rest waits for your ok." })
|
|
408
444
|
] })
|
|
@@ -87,6 +87,20 @@ function extractJson(out) {
|
|
|
87
87
|
throw new Error("reader output is not valid JSON");
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
function parseReaderProblems(out) {
|
|
91
|
+
let root;
|
|
92
|
+
try {
|
|
93
|
+
root = extractJson(out);
|
|
94
|
+
} catch {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
if (!isRecord(root) || !Array.isArray(root.problems)) return [];
|
|
98
|
+
return root.problems.filter((p) => typeof p === "string" && p.trim() !== "").slice(0, 5).map((p) => p.replace(/\s+/g, " ").trim().slice(0, 160));
|
|
99
|
+
}
|
|
100
|
+
function toProblem(account, text2) {
|
|
101
|
+
const m = /^(slack|linear|reader)\s*:\s*(.+)$/i.exec(text2);
|
|
102
|
+
return m ? { account, source: m[1].toLowerCase(), reason: m[2] } : { account, source: "reader", reason: text2 };
|
|
103
|
+
}
|
|
90
104
|
function parseReaderOutput(out, known) {
|
|
91
105
|
const root = extractJson(out);
|
|
92
106
|
if (!isRecord(root) || !Array.isArray(root.items)) throw new Error("reader output needs an items array");
|
|
@@ -198,8 +212,9 @@ Item kinds (to-task | issue | request | research | review), exactly one per item
|
|
|
198
212
|
- GitHub events with no matching session: a ci-failure becomes an issue (link is the pull request url, quote lists the failing checks); a mention or assigned event becomes a request or an issue; a comment or review on my pull request with no session becomes a request. Skip events that need nothing from me.
|
|
199
213
|
|
|
200
214
|
Answer with ONLY a JSON object, no prose and no code fence:
|
|
201
|
-
{ "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 } ] }
|
|
202
|
-
Every item needs a link. Use an empty items array when there is nothing new
|
|
215
|
+
{ "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
|
+
Every item needs a link. Use an empty items array when there is nothing new.
|
|
217
|
+
If a Slack or Linear tool is missing, still connecting or fails, do not report "nothing new" for it: add "<source>: <short reason>" to problems.`;
|
|
203
218
|
}
|
|
204
219
|
|
|
205
220
|
// src/github.ts
|
|
@@ -259,7 +274,8 @@ async function fetchGithub(ctx, since, deadlineMs = DEADLINE_MS) {
|
|
|
259
274
|
const [user, mine, asked, issues, notes] = await Promise.all([
|
|
260
275
|
gh(ctx, ["api", "user"]),
|
|
261
276
|
search("--author=@me"),
|
|
262
|
-
|
|
277
|
+
// reviews asked of me, not of a team I belong to
|
|
278
|
+
search("user-review-requested:@me"),
|
|
263
279
|
search("--assignee=@me", "issues"),
|
|
264
280
|
gh(ctx, ["api", `notifications?since=${encodeURIComponent(since)}`, "--paginate"])
|
|
265
281
|
]);
|
|
@@ -342,7 +358,7 @@ async function readAccounts(ctx) {
|
|
|
342
358
|
const set = typeof ctx.settings.accounts === "string" ? ctx.settings.accounts : "";
|
|
343
359
|
const wanted = set.split(",").map((n) => n.trim()).filter(Boolean);
|
|
344
360
|
const names = wanted.length ? claude.filter((n) => wanted.includes(n)) : claude;
|
|
345
|
-
if (!names.length) throw new
|
|
361
|
+
if (!names.length) throw new ModuleError("bad_request", wanted.length ? `none of ${wanted.join(", ")} is a Claude account` : "no CW account to read with");
|
|
346
362
|
return names;
|
|
347
363
|
}
|
|
348
364
|
function checkGithub(items, fetched, toReview) {
|
|
@@ -367,13 +383,24 @@ async function readAccount(ctx, account, o) {
|
|
|
367
383
|
const github = (await o.github)?.items ?? [];
|
|
368
384
|
const prompt = buildPrompt({ since: o.since, sessions, projects, github });
|
|
369
385
|
const model = typeof ctx.settings.model === "string" && ctx.settings.model ? ctx.settings.model : void 0;
|
|
370
|
-
const
|
|
386
|
+
const ask = () => ctx.agent.run({ account, prompt, model, allowedTools: READER_TOOLS, timeoutMs: 10 * 60 * 1e3 });
|
|
387
|
+
let out = await ask();
|
|
388
|
+
if (parseReaderProblems(out.text).length) out = await ask();
|
|
389
|
+
const problems = parseReaderProblems(out.text).map((p) => toProblem(account, p));
|
|
371
390
|
const fetched = new Set(github.map((e) => e.pr));
|
|
372
391
|
const toReview = new Set(github.filter((e) => e.type === "review-request").map((e) => e.pr));
|
|
373
392
|
const items = parseReaderOutput(out.text, { projects, sessions: sessions.map((s) => `${s.project}::${s.sessionDir}`), account });
|
|
374
393
|
const placed = checkGithub(items, fetched, toReview).map((i) => i.source === "github" ? { ...i, account: o.owners[i.project ?? i.targetSession?.project ?? ""] } : i);
|
|
375
394
|
const fresh = dedupe(collapse(placed), o.handled);
|
|
376
|
-
return github.length ? fresh.map((i) => ({ ...i, manual: true })) : fresh;
|
|
395
|
+
return { items: github.length ? fresh.map((i) => ({ ...i, manual: true })) : fresh, problems };
|
|
396
|
+
}
|
|
397
|
+
async function readOne(ctx, account, o) {
|
|
398
|
+
try {
|
|
399
|
+
return { account, ...await readAccount(ctx, account, o) };
|
|
400
|
+
} catch (e) {
|
|
401
|
+
const error = errorMessage(e);
|
|
402
|
+
return { account, items: [], problems: [{ account, source: "reader", reason: error.replace(/\s+/g, " ").trim().slice(0, 160) }], error };
|
|
403
|
+
}
|
|
377
404
|
}
|
|
378
405
|
async function reread(ctx, now, notes) {
|
|
379
406
|
const lastReadAt = await ctx.storage.get("lastReadAt");
|
|
@@ -386,20 +413,13 @@ async function reread(ctx, now, notes) {
|
|
|
386
413
|
readAccounts(ctx)
|
|
387
414
|
]);
|
|
388
415
|
const owners = ownersOf(projects);
|
|
389
|
-
const results = await Promise.all(accounts.map(
|
|
390
|
-
try {
|
|
391
|
-
return { account, items: await readAccount(ctx, account, { since, sessions, projects, owners, github: n === 0 ? github : void 0, handled: handled ?? {} }) };
|
|
392
|
-
} catch (e) {
|
|
393
|
-
return { account, items: [], error: errorMessage(e) };
|
|
394
|
-
}
|
|
395
|
-
}));
|
|
416
|
+
const results = await Promise.all(accounts.map((account, n) => readOne(ctx, account, { since, sessions, projects, owners, github: n === 0 ? github : void 0, handled: handled ?? {} })));
|
|
396
417
|
const gh2 = await github;
|
|
397
418
|
if (gh2.error) notes.push(`GitHub: ${gh2.error}`);
|
|
398
419
|
if (results[0].error && gh2.items.length) notes.push("GitHub: not read");
|
|
399
420
|
const failed = results.filter((r) => r.error);
|
|
400
421
|
if (failed.length === results.length) throw new Error(failed.length === 1 ? failed[0].error : failed.map((f) => `${f.account}: ${f.error}`).join("; "));
|
|
401
|
-
|
|
402
|
-
return collapse(results.flatMap((r) => r.items));
|
|
422
|
+
return { items: collapse(results.flatMap((r) => r.items)), problems: results.flatMap((r) => r.problems) };
|
|
403
423
|
}
|
|
404
424
|
async function rememberHandled(ctx, items, now) {
|
|
405
425
|
const old = await ctx.storage.get("handled") ?? {};
|
|
@@ -435,7 +455,7 @@ async function doRead(ctx, now) {
|
|
|
435
455
|
const date = localDate(now);
|
|
436
456
|
const notes = [];
|
|
437
457
|
try {
|
|
438
|
-
const fresh = await reread(ctx, now, notes);
|
|
458
|
+
const { items: fresh, problems } = await reread(ctx, now, notes);
|
|
439
459
|
const lastReadAt = await ctx.storage.get("lastReadAt");
|
|
440
460
|
await locked(async () => {
|
|
441
461
|
const prev = await loadDigest(ctx, date);
|
|
@@ -448,7 +468,8 @@ async function doRead(ctx, now) {
|
|
|
448
468
|
since: prev?.since ?? lastReadAt ?? new Date(now.getTime() - DAY).toISOString(),
|
|
449
469
|
items,
|
|
450
470
|
autoStarted: prev?.autoStarted ?? {},
|
|
451
|
-
...notes.length ? { notes } : {}
|
|
471
|
+
...notes.length ? { notes } : {},
|
|
472
|
+
...problems.length ? { problems } : {}
|
|
452
473
|
});
|
|
453
474
|
await rememberHandled(ctx, fresh, now);
|
|
454
475
|
await ctx.storage.set("lastReadAt", now.toISOString());
|
|
@@ -460,6 +481,35 @@ async function doRead(ctx, now) {
|
|
|
460
481
|
return keepWithError(ctx, now, errorMessage(e), notes);
|
|
461
482
|
}
|
|
462
483
|
}
|
|
484
|
+
async function retryAccount(ctx, account, now) {
|
|
485
|
+
if (!await isEnabled(ctx)) throw new ModuleError("bad_request", OFF_MESSAGE);
|
|
486
|
+
if (!(await readAccounts(ctx)).includes(account)) throw new ModuleError("bad_request", `${account} is not an account Today reads`);
|
|
487
|
+
await reading?.catch(() => {
|
|
488
|
+
});
|
|
489
|
+
const date = localDate(now);
|
|
490
|
+
const prev = await loadDigest(ctx, date);
|
|
491
|
+
if (!prev) throw new ModuleError("not_found", `no digest for ${date}`);
|
|
492
|
+
const [sessions, projects, handled] = await Promise.all([ctx.sessions.list(), ctx.projects.list(), ctx.storage.get("handled")]);
|
|
493
|
+
const result = await readOne(ctx, account, { since: prev.since, sessions, projects, owners: ownersOf(projects), handled: handled ?? {} });
|
|
494
|
+
await locked(async () => {
|
|
495
|
+
const digest = await loadDigest(ctx, date) ?? prev;
|
|
496
|
+
const items = merge(digest.items, result.items);
|
|
497
|
+
const known = new Set(digest.items.map((i) => i.id));
|
|
498
|
+
if (items.some((i) => i.state === "proposed" && !known.has(i.id))) await ctx.storage.delete(`folded/${date}`);
|
|
499
|
+
const problems = [...(digest.problems ?? []).filter((p) => p.account !== account), ...result.problems];
|
|
500
|
+
const next = { ...digest, items };
|
|
501
|
+
if (problems.length) next.problems = problems;
|
|
502
|
+
else delete next.problems;
|
|
503
|
+
await saveDigest(ctx, next);
|
|
504
|
+
await rememberHandled(ctx, result.items, now);
|
|
505
|
+
});
|
|
506
|
+
await autoResearch(ctx, date);
|
|
507
|
+
return await loadDigest(ctx, date);
|
|
508
|
+
}
|
|
509
|
+
async function reconnectAccount(ctx, account) {
|
|
510
|
+
if (!(await readAccounts(ctx)).includes(account)) throw new ModuleError("bad_request", `${account} is not an account Today reads`);
|
|
511
|
+
return ctx.cw.start({ type: "general", account, task: `Reconnect connectors (${account})`, prompt: "/mcp" });
|
|
512
|
+
}
|
|
463
513
|
function keepWithError(ctx, now, error, notes) {
|
|
464
514
|
return locked(async () => {
|
|
465
515
|
const date = localDate(now);
|
|
@@ -703,6 +753,20 @@ var server_default = defineModule({
|
|
|
703
753
|
effect: "local",
|
|
704
754
|
run: (_input, ctx) => readNow(ctx, /* @__PURE__ */ new Date())
|
|
705
755
|
}),
|
|
756
|
+
defineAction({
|
|
757
|
+
id: "retry-account",
|
|
758
|
+
label: "Retry",
|
|
759
|
+
effect: "local",
|
|
760
|
+
input: { account: { type: "string", required: true } },
|
|
761
|
+
run: (input, ctx) => retryAccount(ctx, input.account, /* @__PURE__ */ new Date())
|
|
762
|
+
}),
|
|
763
|
+
defineAction({
|
|
764
|
+
id: "reconnect",
|
|
765
|
+
label: "Reconnect",
|
|
766
|
+
effect: "local",
|
|
767
|
+
input: { account: { type: "string", required: true } },
|
|
768
|
+
run: (input, ctx) => reconnectAccount(ctx, input.account)
|
|
769
|
+
}),
|
|
706
770
|
defineAction({
|
|
707
771
|
id: "enable",
|
|
708
772
|
label: "Turn on",
|
|
@@ -20,6 +20,8 @@ function projectsFor({ names, owners }, account) {
|
|
|
20
20
|
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
|
+
var SOURCE_NAME = { slack: "Slack", linear: "Linear", reader: "Reader" };
|
|
24
|
+
var problemLine = (p) => `${p.account} \xB7 ${SOURCE_NAME[p.source]} could not be read (${p.reason})`;
|
|
23
25
|
var GROUPS = [
|
|
24
26
|
{ title: "In open tasks", pick: (i) => i.kind === "to-task" },
|
|
25
27
|
{ title: "New", pick: (i) => i.kind === "issue" || i.kind === "request" },
|
|
@@ -96,6 +98,7 @@ function useProjects(forge) {
|
|
|
96
98
|
function useActing(forge, date, reload) {
|
|
97
99
|
const [busy, setBusy] = useState(false);
|
|
98
100
|
const [refreshing, setRefreshing] = useState(false);
|
|
101
|
+
const [retrying, setRetrying] = useState(null);
|
|
99
102
|
const reading = useRef(false);
|
|
100
103
|
const guarded = async (fn) => {
|
|
101
104
|
try {
|
|
@@ -122,7 +125,19 @@ function useActing(forge, date, reload) {
|
|
|
122
125
|
reading.current = false;
|
|
123
126
|
setRefreshing(false);
|
|
124
127
|
};
|
|
125
|
-
|
|
128
|
+
const retry = async (account) => {
|
|
129
|
+
if (busy) return;
|
|
130
|
+
setBusy(true);
|
|
131
|
+
setRetrying(account);
|
|
132
|
+
await guarded(() => forge.action("retry-account", { account }));
|
|
133
|
+
setRetrying(null);
|
|
134
|
+
setBusy(false);
|
|
135
|
+
};
|
|
136
|
+
const reconnect = (account) => run(async () => {
|
|
137
|
+
const s = await forge.action("reconnect", { account });
|
|
138
|
+
if (s) forge.openSession(s.project, s.sessionDir);
|
|
139
|
+
});
|
|
140
|
+
return { busy, refreshing, retrying, retry, reconnect, run, act, refresh };
|
|
126
141
|
}
|
|
127
142
|
function dayOf(date) {
|
|
128
143
|
const [y, m, d] = date.split("-").map(Number);
|
|
@@ -274,6 +289,17 @@ var Row = ({ item, projects = EMPTY_PROJECTS, acting, forge }) => {
|
|
|
274
289
|
] })
|
|
275
290
|
] });
|
|
276
291
|
};
|
|
292
|
+
function ProblemRow({ problem, acting }) {
|
|
293
|
+
const mine = acting.retrying === problem.account;
|
|
294
|
+
return /* @__PURE__ */ jsxs("div", { role: "alert", style: { display: "flex", alignItems: "center", gap: "10px", padding: "7px 10px", borderRadius: "10px", fontSize: "12px", color: "var(--ink-2)", background: soft("--orange", 10), border: `1px solid ${soft("--orange", 35)}` }, children: [
|
|
295
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
296
|
+
/* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: problemLine(problem) }),
|
|
297
|
+
/* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "flex", gap: "8px", flexShrink: 0 }, children: [
|
|
298
|
+
/* @__PURE__ */ jsx(Btn, { label: mine ? "Reading\u2026" : "Retry", disabled: acting.busy, onClick: () => acting.retry(problem.account) }),
|
|
299
|
+
/* @__PURE__ */ jsx(Btn, { label: "Reconnect", style: ghostStyle, disabled: acting.busy, onClick: () => acting.reconnect(problem.account) })
|
|
300
|
+
] })
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
277
303
|
|
|
278
304
|
// src/view.tsx
|
|
279
305
|
import { jsx as jsx2, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
@@ -302,6 +328,7 @@ function View({ forge }) {
|
|
|
302
328
|
] }),
|
|
303
329
|
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." }),
|
|
304
330
|
(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
|
+
(digest?.problems ?? []).map((p, i) => /* @__PURE__ */ jsx2(ProblemRow, { problem: p, acting }, `${p.account}/${p.source}/${i}`)),
|
|
305
332
|
notes && /* @__PURE__ */ jsx2("div", { style: { fontSize: "12px", color: "var(--ink-3)" }, children: notes }),
|
|
306
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: [
|
|
307
334
|
account && /* @__PURE__ */ jsx2("div", { children: /* @__PURE__ */ jsx2(AccountChip, { account }) }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-cw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
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/core": "0.1.0",
|
|
44
|
+
"@forge-dev/console": "0.1.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsc",
|