kaizen-agent 1.87.1 → 1.87.3
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/cli/browser.ts +21 -0
- package/cli/chat.ts +53 -3
- package/cli/chatgpt.ts +1 -1
- package/cli/conpty.ts +7 -4
- package/cli/dashboard.ts +1 -1
- package/cli/models.ts +94 -0
- package/cli/pty.ts +5 -1
- package/cli/sources.ts +84 -20
- package/cli/state.ts +2 -2
- package/cli/task-service.ts +2 -0
- package/cli/web.ts +53 -9
- package/cli/whatsapp-bridge.ts +14 -2
- package/package.json +1 -1
- package/web/components/home/home-window.tsx +0 -36
- package/web/components/icebox/capture-box.tsx +11 -2
- package/web/components/icebox/request-card.tsx +33 -11
- package/web/components/rail/rail-list.tsx +43 -1
- package/web/components/settings/setting-row.tsx +8 -5
- package/web/components/settings/settings-section.tsx +5 -3
- package/web/components/shared/picker.tsx +21 -1
- package/web/dist/annotate.js +1 -1
- package/web/dist/board.css +5 -10
- package/web/dist/board.js +57 -55
- package/web/dist/boot.js +1 -1
- package/web/dist/notebook.css +2 -2
- package/web/dist/notebook.js +34 -34
- package/web/dist/popup.css +1 -1
- package/web/dist/popup.js +1 -1
- package/web/dist/term.js +1 -1
- package/web/dist/ui.css +2 -2
- package/web/dist/video.js +1 -1
- package/web/lib/icebox/icebox-actions.ts +24 -2
- package/web/lib/icebox/icebox-store.ts +7 -1
- package/web/lib/icebox/icebox-view.ts +3 -2
- package/web/lib/icebox/icebox.ts +24 -4
- package/web/lib/icebox/use-ice-keys.ts +5 -0
- package/web/lib/rail/rules.ts +4 -1
- package/web/lib/settings/index.ts +1 -0
- package/web/lib/settings/settings-actions.ts +8 -0
- package/web/lib/settings/settings.ts +0 -3
- package/web/lib/settings/use-model-choices.ts +31 -0
- package/web/pages/board/App.tsx +1 -9
- package/web/pages/icebox-page.tsx +173 -125
- package/web/ui/legacy/board.css +3 -8
package/cli/web.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { attachPty, frames, writePty, submitPty, resizePty, exitPty, killPty, pa
|
|
|
25
25
|
import { conflictPort, holders, inProjects, isKaizenProcess, listeners, stopPort } from "./ports.ts";
|
|
26
26
|
import { snapshot, snapWorker } from "./state-snap.ts";
|
|
27
27
|
import { claudeUsage, claudeUsageAt, codexUsage, codexUsageAt, phonePeers, type Usage } from "./usage.ts";
|
|
28
|
-
import { readSources, addSource, removeSource, moveSource, setCategory, setWriteback, setPaused, readIcebox, applySort, promote, dismiss, restore, capture, editItem, setKind, setTags, setBoard, saveBoard, removeBoard, snooze, unsnooze, readBoards, kindOf, isSnoozed, markDone, markReplied, gatherSource, freshImages, gatherAll, gatherDirs, due, socialUrl, socialOf } from "./sources.ts";
|
|
28
|
+
import { readSources, addSource, removeSource, moveSource, setCategory, setWriteback, setPaused, readIcebox, applySort, setLinkMedia, redditPost, iceDir, promote, dismiss, restore, capture, editItem, setKind, setTags, setBoard, saveBoard, removeBoard, snooze, unsnooze, readBoards, kindOf, isSnoozed, markDone, markReplied, gatherSource, freshImages, gatherAll, gatherDirs, due, socialUrl, socialOf } from "./sources.ts";
|
|
29
29
|
import { projectLogo, LOGO_TYPES } from "./logo.ts";
|
|
30
30
|
import * as chatgpt from "./chatgpt.ts";
|
|
31
31
|
import * as google from "./google.ts";
|
|
@@ -677,7 +677,7 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
677
677
|
const fingerprint = () => {
|
|
678
678
|
let sum = 0;
|
|
679
679
|
for (const dir of states(true)) {
|
|
680
|
-
for (const f of ["inbox.md", "backlog.md", "archive.md", "sources.json", "icebox.json"]) { try { sum += statSync(join(dir, f)).mtimeMs; } catch { /* absent */ } }
|
|
680
|
+
for (const f of ["inbox.md", "backlog.md", "archive.md", "sources.json", "icebox.json", "boards.json"]) { try { sum += statSync(join(f.endsWith(".json") ? iceDir(dir) : dir, f)).mtimeMs; } catch { /* absent */ } }
|
|
681
681
|
const runs = join(dir, "runs");
|
|
682
682
|
if (!existsSync(runs)) continue;
|
|
683
683
|
for (const id of readdirSync(runs)) { try { sum += statSync(join(runs, id, "state.json")).mtimeMs; } catch { /* absent */ } }
|
|
@@ -715,6 +715,19 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
715
715
|
const next = (sorting.get(dir) ?? Promise.resolve()).then(run, run).catch((e) => console.error("[icebox] sort", e));
|
|
716
716
|
sorting.set(dir, next);
|
|
717
717
|
};
|
|
718
|
+
// A Reddit link's own pictures, read by the kaizen browser after the capture is saved (it takes seconds and may
|
|
719
|
+
// be busy gathering). One browser at a time; a failure leaves the card on Reddit's preview picture.
|
|
720
|
+
let reading: Promise<unknown> = Promise.resolve();
|
|
721
|
+
const mediaLater = (dir: string, id: string) => {
|
|
722
|
+
const run = async () => {
|
|
723
|
+
const it = readIcebox(dir).find((x) => x.id === id);
|
|
724
|
+
if (!it?.link || !redditPost(it.link.url)) return;
|
|
725
|
+
const r = await (await import("./browser.ts")).redditMedia(it.link.url);
|
|
726
|
+
if (r.ok && setLinkMedia(dir, id, r)) changed();
|
|
727
|
+
else if (!r.ok) console.error(`[icebox] pictures ${id}: ${r.note}`);
|
|
728
|
+
};
|
|
729
|
+
reading = reading.then(run, run).catch((e) => console.error("[icebox] pictures", e));
|
|
730
|
+
};
|
|
718
731
|
const setting = async (key: string) => {
|
|
719
732
|
const { listSettings } = await import("./settings.ts");
|
|
720
733
|
return listSettings(repoDir).rows.find((r) => r.key === key)?.value ?? "";
|
|
@@ -1093,12 +1106,14 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1093
1106
|
let body: any;
|
|
1094
1107
|
try { body = await req.json(); } catch { return bad("json body expected"); }
|
|
1095
1108
|
// Home: kaizen's own folder, the one place outside a project. No worktree, dev server or run to resume there.
|
|
1109
|
+
// The side menu's Home row is the global queue (~/.kaizen) as a workspace: a shell from it is a Home shell.
|
|
1110
|
+
if (body.home !== true && typeof body.dir === "string" && canonState(body.dir) === join(home, ".kaizen") && body.dev !== true && body.resume !== true) { body.home = true; delete body.ws; }
|
|
1096
1111
|
const homeWs = body.home === true;
|
|
1097
1112
|
if (homeWs && (body.ws != null || body.dev === true || body.resume === true)) return bad("not in the Home workspace", 400);
|
|
1098
1113
|
const dir = homeWs ? HOME_WS : canonState(String(body.dir ?? ""));
|
|
1099
1114
|
if (!homeWs && (!states(true).includes(dir) || dir === join(home, ".kaizen"))) return bad("choose a project", 404);
|
|
1100
1115
|
if (homeWs) mkdirSync(HOME_WS, { recursive: true });
|
|
1101
|
-
let cmd: string[];
|
|
1116
|
+
let cmd: string[] | undefined;
|
|
1102
1117
|
let agent = "";
|
|
1103
1118
|
let bypass = false;
|
|
1104
1119
|
// The run's own agent session, resumed here ("run:<dir>:<id>" names the run; the session
|
|
@@ -1146,7 +1161,7 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1146
1161
|
const first = !signIn && typeof body.prompt === "string" && body.prompt.trim() && body.prompt.length <= 2000 ? body.prompt.trim() : "";
|
|
1147
1162
|
const line = signIn ? [commandOf(a.cmd), ...(a.cmd === "codex" ? ["login"] : [])] : withEnv([commandOf(a.cmd), ...(bypass ? YOLO_FLAGS[a.cmd]! : []), ...argsOf(a.cmd), ...promptArgs(a.cmd, first)], a.cmd);
|
|
1148
1163
|
cmd = acct.dir ? ["env", ...accountEnv(acct), ...line] : line;
|
|
1149
|
-
}
|
|
1164
|
+
}
|
|
1150
1165
|
// A workspace folder: only an exact path from this project's own `git worktree list`.
|
|
1151
1166
|
let cwd = homeWs ? HOME_WS : projectOf(dir);
|
|
1152
1167
|
if (body.ws != null) {
|
|
@@ -1168,6 +1183,12 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1168
1183
|
cmd = process.platform === "win32" ? ["cmd.exe", "/c", ...d] : [process.env.SHELL || "sh", "-lc", d.join(" ")];
|
|
1169
1184
|
dev = true;
|
|
1170
1185
|
}
|
|
1186
|
+
const targetDir = homeWs ? home : cwd;
|
|
1187
|
+
if (!cmd) {
|
|
1188
|
+
cmd = process.platform === "win32"
|
|
1189
|
+
? [powershellExe(), "-NoExit", "-Command", `Set-Location -LiteralPath '${targetDir.replace(/'/g, "''")}'`]
|
|
1190
|
+
: [process.env.SHELL || "sh", "-l"];
|
|
1191
|
+
}
|
|
1171
1192
|
for (const k of shells.keys()) if (!ptyState(k)?.alive) shells.delete(k);
|
|
1172
1193
|
if ([...shells.values()].filter((x) => x.dir === dir).length >= SHELL_CAP) return bad(`at most ${SHELL_CAP} terminals per ${homeWs ? "workspace" : "project"}: close one first`, 429);
|
|
1173
1194
|
const key = "sh-" + crypto.randomUUID().slice(0, 8);
|
|
@@ -1175,7 +1196,7 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1175
1196
|
// A dev server it starts lets a phone in: Vite refuses a host it does not know (the tailnet name).
|
|
1176
1197
|
// Home terminals run in the user's home folder (~); HOME_WS stays their record (dir and ws), which the
|
|
1177
1198
|
// Home window, restart resume and the phone match on.
|
|
1178
|
-
const pid = startPty(key, cmd,
|
|
1199
|
+
const pid = startPty(key, cmd, targetDir, undefined, changed, {
|
|
1179
1200
|
env: {
|
|
1180
1201
|
KAIZEN_TERM: key,
|
|
1181
1202
|
...(process.platform === "win32" ? { AGY_CLI_DISABLE_AUTO_UPDATE: "1", CLAUDE_CODE_DISABLE_AUTO_UPDATER: "1", DISABLE_AUTO_UPDATER: "1" } : {}),
|
|
@@ -1637,7 +1658,8 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1637
1658
|
const inside = fold(root.endsWith(sep) ? root : root + sep);
|
|
1638
1659
|
const picker = states(true).filter((d) => {
|
|
1639
1660
|
const p = dirname(d);
|
|
1640
|
-
|
|
1661
|
+
// Home (the global queue) is always listed: it is your own icebox and tasks, in no project.
|
|
1662
|
+
return !root || d === state || d === join(home, ".kaizen") || (fold(p).startsWith(inside)
|
|
1641
1663
|
&& (!isGroup(p) || filled(d) || fold(dirname(p)) !== fold(root)));
|
|
1642
1664
|
});
|
|
1643
1665
|
// What an agent printed goes only to a viewer on this machine, not to a tailnet host or a phone.
|
|
@@ -1677,12 +1699,13 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1677
1699
|
cards.forEach((c, i) => { for (const k of ptys[i]?.all ?? []) addAgent(k, c.state, c.ws, pty.cmd(k) ?? KNOWN_AGENTS.find((a) => c.tags?.includes(a.cmd))?.cmd, c.kind === "run" ? c.id : undefined); });
|
|
1678
1700
|
// A failed land marks the run's agents, and the terminal that ran it (often the first agent, in another workspace).
|
|
1679
1701
|
for (const c of cards) if (c.land) for (const a of agents) if ((a.dir === c.state && a.run === c.id) || a.key === c.land.term) a.land = c.land.kind;
|
|
1680
|
-
const entry = (d: string) => ({ dir: d, label: label(d), logo: !!projectLogo(d),
|
|
1702
|
+
const entry = (d: string) => ({ dir: d, label: label(d), logo: !!projectLogo(d), ...(d === join(home, ".kaizen") ? { home: true } : {}),
|
|
1681
1703
|
workspaces: d === join(home, ".kaizen") ? [{ path: d, branch: "", main: true }] : workspacesNow(projectOf(d)) });
|
|
1682
1704
|
const body = JSON.stringify({
|
|
1683
1705
|
project, all, dir: state,
|
|
1684
1706
|
// Each project's workspaces (git worktrees, or the one folder); the global queue is its own one.
|
|
1685
|
-
|
|
1707
|
+
// Home first: every picker on the page lists it above the projects.
|
|
1708
|
+
projects: picker.map(entry).sort((a, b) => +!!b.home - +!!a.home),
|
|
1686
1709
|
// Dirs with a card the picker leaves out (the global queue, a project outside the
|
|
1687
1710
|
// Projects folder): the rail still needs their workspaces so a waiting run shows.
|
|
1688
1711
|
rail: [...new Set(cards.map((c) => c.state))].filter((d) => !picker.includes(d)).map(entry),
|
|
@@ -1985,6 +2008,13 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1985
2008
|
});
|
|
1986
2009
|
}
|
|
1987
2010
|
|
|
2011
|
+
// The models one agent tool offers, read from the tool itself (cli/models.ts). Only a KNOWN_AGENTS command is taken.
|
|
2012
|
+
if (req.method === "GET" && path === "/models") {
|
|
2013
|
+
const cmd = url.searchParams.get("agent") ?? "";
|
|
2014
|
+
if (!KNOWN_AGENTS.some((a) => a.cmd === cmd)) return bad("unknown agent", 404);
|
|
2015
|
+
return json({ models: await (await import("./models.ts")).modelsOf(cmd) });
|
|
2016
|
+
}
|
|
2017
|
+
|
|
1988
2018
|
if (req.method === "GET" && path === "/agents") {
|
|
1989
2019
|
if (url.searchParams.get("home") === "1") return json(agentChoices(HOME_WS));
|
|
1990
2020
|
const dir = qdir();
|
|
@@ -2263,6 +2293,19 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
2263
2293
|
return "error" in r ? { error: r.error } : { dir: (r as { dir: string }).dir };
|
|
2264
2294
|
},
|
|
2265
2295
|
agents: KNOWN_AGENTS.filter((a) => agentUsable(a.cmd)).map((a) => a.cmd),
|
|
2296
|
+
// A draft task: saved on the Tasks list, no agent started (the task page starts it).
|
|
2297
|
+
task: (d: string, goal: string) => {
|
|
2298
|
+
try { tasks.createTask(d, { goal, project: dirname(d) }, `chat:${Date.now()}:${Math.random().toString(36).slice(2, 8)}`); changed(); return { ok: true as const }; }
|
|
2299
|
+
catch (e) { return { error: (e as Error).message }; }
|
|
2300
|
+
},
|
|
2301
|
+
taskAdd: (d: string, taskId: string, text: string) => {
|
|
2302
|
+
try {
|
|
2303
|
+
const found = tasks.resolveTask(d, taskId);
|
|
2304
|
+
if (!found || !states(true).includes(found.state)) return { error: "unknown task" };
|
|
2305
|
+
taskService.taskAction(found.state, { op: "message", id: found.task.id, text, revision: found.task.revision, operationId: `chat:${Date.now()}:${Math.random().toString(36).slice(2, 8)}` }, taskHooks);
|
|
2306
|
+
changed(); return { ok: true as const };
|
|
2307
|
+
} catch (e) { return { error: (e as Error).message }; }
|
|
2308
|
+
},
|
|
2266
2309
|
// As POST /run starts a task, without one on the inbox.
|
|
2267
2310
|
run: async (d: string, runner: "lite" | "full", agent: string, text: string) => {
|
|
2268
2311
|
const r = launchRun(parseItem(`${runner} ${text}`), d, undefined, { agent, ...inCard });
|
|
@@ -2560,13 +2603,14 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
2560
2603
|
: body.op === "board" ? setBoard(body.dir, ids, str(body.board))
|
|
2561
2604
|
: body.op === "snooze" ? snooze(body.dir, ids, str(body.until))
|
|
2562
2605
|
: body.op === "unsnooze" ? unsnooze(body.dir, ids)
|
|
2563
|
-
// A board on its own, for the page's "+ Board": make it (a client's or not), mark it a client's, or remove
|
|
2606
|
+
// A board on its own, for the page's "+ Board": make it (a client's or not), mark it a client's, or remove it (its items go to the Inbox).
|
|
2564
2607
|
: body.op === "boards" ? (body.act === "add" ? saveBoard(body.dir, str(body.name), body.client === true) : body.act === "client" ? saveBoard(body.dir, str(body.name), true) : body.act === "remove" ? removeBoard(body.dir, str(body.name)) : "act is one of: add, client, remove")
|
|
2565
2608
|
: body.op === "dismiss" ? dismiss(body.dir, ids) : body.op === "restore" ? restore(body.dir, ids) : "unknown op";
|
|
2566
2609
|
if (why) return bad(why, why === "no such item" ? 404 : why === "unknown op" ? 400 : 409);
|
|
2567
2610
|
// A capture with no kind of its own is sorted by ChatGPT after this answer, never before it.
|
|
2568
2611
|
if (added && "id" in added) addedId = added.id;
|
|
2569
2612
|
if (addedId && !str(body.kind) && chatgpt.status().connected) sortLater(body.dir, addedId);
|
|
2613
|
+
if (addedId) mediaLater(body.dir, addedId);
|
|
2570
2614
|
} catch (e) { return bad((e as Error).message, 500); }
|
|
2571
2615
|
changed();
|
|
2572
2616
|
return json({ ok: true, ...(addedId ? { id: addedId } : {}) });
|
package/cli/whatsapp-bridge.ts
CHANGED
|
@@ -71,7 +71,16 @@ async function start() {
|
|
|
71
71
|
try {
|
|
72
72
|
const { state, saveCreds } = await useMultiFileAuthState(AUTH);
|
|
73
73
|
let version: any;
|
|
74
|
-
|
|
74
|
+
// Baileys' own lookup swallows its errors and returns a stale built-in version (isLatest: false), which WhatsApp
|
|
75
|
+
// refuses; so try its raw version file too before giving up on a fresh one.
|
|
76
|
+
try { const r = await fetchLatestBaileysVersion(); if (r.isLatest !== false) version = r.version; } catch {}
|
|
77
|
+
if (!version) {
|
|
78
|
+
try {
|
|
79
|
+
const r = await fetch("https://raw.githubusercontent.com/WhiskeySockets/Baileys/master/src/Defaults/baileys-version.json", { signal: AbortSignal.timeout(8000) });
|
|
80
|
+
const v = (await r.json() as any)?.version;
|
|
81
|
+
if (Array.isArray(v) && v.length === 3) version = v;
|
|
82
|
+
} catch {}
|
|
83
|
+
}
|
|
75
84
|
const s = makeWASocket({ auth: state, version, logger: quiet, browser: Browsers.macOS("Kaizen"), syncFullHistory: false, markOnlineOnConnect: false });
|
|
76
85
|
sock = s;
|
|
77
86
|
s.ev.on("creds.update", saveCreds);
|
|
@@ -104,7 +113,10 @@ async function start() {
|
|
|
104
113
|
wantLink = false; sock = null;
|
|
105
114
|
return;
|
|
106
115
|
}
|
|
107
|
-
// Any other close (network, restart-required after the QR scan): reconnect.
|
|
116
|
+
// Any other close (network, restart-required after the QR scan): reconnect. Say why, so the card is not
|
|
117
|
+
// stuck on "Connecting" with no hint; the next open or QR clears it.
|
|
118
|
+
if (code !== DisconnectReason.restartRequired)
|
|
119
|
+
error = `WhatsApp refused the connection (${code ?? u.lastDisconnect?.error?.message ?? "no answer"}). Check the network and that the computer's clock is right; retrying`;
|
|
108
120
|
starting = false;
|
|
109
121
|
if (wantLink || existsSync(join(AUTH, "creds.json"))) setTimeout(() => void start(), 1500);
|
|
110
122
|
else { error = "WhatsApp closed the link; try again"; sock = null; }
|
package/package.json
CHANGED
|
@@ -215,39 +215,3 @@ export function HomeWsButton() {
|
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
// The minimized window: the first row of the Projects list. It sits beside the list, not in it (board/home-ws.ts mounts
|
|
219
|
-
// it above #plist); the row's classes are the list's own.
|
|
220
|
-
export function HomeWsRow() {
|
|
221
|
-
const s = useHomeWs(),
|
|
222
|
-
shells = useServer((x) => x.shells),
|
|
223
|
-
n = homeTabs(shells, s.ending).length;
|
|
224
|
-
return (
|
|
225
|
-
<div className="plist hwsslot" hidden={s.st !== "min"}>
|
|
226
|
-
<div className="pgrp">
|
|
227
|
-
<button
|
|
228
|
-
type="button"
|
|
229
|
-
className="proj"
|
|
230
|
-
title="Home workspace: agents outside any project (Ctrl+Alt+A)"
|
|
231
|
-
onClick={() => showHomeWs("open")}
|
|
232
|
-
>
|
|
233
|
-
<svg className="plogo hwsico" aria-hidden="true">
|
|
234
|
-
<use href="#i-home" />
|
|
235
|
-
</svg>
|
|
236
|
-
<span className="pname">Home</span>
|
|
237
|
-
<span className="c">{n || ""}</span>
|
|
238
|
-
</button>
|
|
239
|
-
<button
|
|
240
|
-
type="button"
|
|
241
|
-
className="wadd hwsrx"
|
|
242
|
-
title="Close the Home workspace"
|
|
243
|
-
aria-label="Close the Home workspace"
|
|
244
|
-
onClick={() => void closeAllHome()}
|
|
245
|
-
>
|
|
246
|
-
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
247
|
-
<path d="M7 7l10 10M17 7 7 17" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
|
|
248
|
-
</svg>
|
|
249
|
-
</button>
|
|
250
|
-
</div>
|
|
251
|
-
</div>
|
|
252
|
-
);
|
|
253
|
-
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef } from "react";
|
|
2
|
-
import { sameName, short, type Board, pickCaptureBoard, saveCapture, patchCap, useIce } from "@lib/icebox";
|
|
2
|
+
import { sameName, short, type Board, pickCaptureBoard, removeCollection, saveCapture, patchCap, useIce } from "@lib/icebox";
|
|
3
3
|
import { useNarrow } from "@lib/shared";
|
|
4
4
|
import { Button, Icon, Textarea } from "@web/ui";
|
|
5
5
|
import { ClientMark, IconButton, MicButton, Picker, ProjectMark } from "@components/shared";
|
|
@@ -126,12 +126,21 @@ export function CaptureBox({
|
|
|
126
126
|
value={board}
|
|
127
127
|
options={[
|
|
128
128
|
{ value: "", label: "Inbox" },
|
|
129
|
-
...boards.map((b) => ({
|
|
129
|
+
...boards.map((b) => ({
|
|
130
|
+
value: b.name,
|
|
131
|
+
label: b.name,
|
|
132
|
+
icon: b.client ? <ClientMark /> : undefined,
|
|
133
|
+
removable: true,
|
|
134
|
+
})),
|
|
130
135
|
...(board && !boards.some((b) => sameName(b.name, board))
|
|
131
136
|
? [{ value: board, label: `${board} (new)` }]
|
|
132
137
|
: []),
|
|
133
138
|
{ value: NEW, label: "New collection…", icon: <Icon name="plus" className="size-3.5" /> },
|
|
134
139
|
]}
|
|
140
|
+
onRemove={(name) => {
|
|
141
|
+
const b = boards.find((x) => sameName(x.name, name));
|
|
142
|
+
if (b) void removeCollection(b.dir, b.name, (useIce.getState().data?.icebox ?? []).filter((it) => it.dir === b.dir && sameName(it.board, b.name)).length);
|
|
143
|
+
}}
|
|
135
144
|
onChange={async (v) => {
|
|
136
145
|
await pickCaptureBoard(v, to);
|
|
137
146
|
focus();
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
hostOf,
|
|
4
4
|
hue,
|
|
5
5
|
iceKey,
|
|
6
|
+
linkImage,
|
|
6
7
|
isLive,
|
|
7
8
|
short,
|
|
8
9
|
srcName,
|
|
@@ -20,12 +21,14 @@ import { RequestBadges } from "./request-badges.tsx";
|
|
|
20
21
|
import { RequestImages } from "./request-images.tsx";
|
|
21
22
|
|
|
22
23
|
// A card: what it is, the words, where it sits, how old. A link leads with its title and summary, coloured from the
|
|
23
|
-
// site's name
|
|
24
|
+
// site's name, over the page's own preview picture when it named one (the browser loads that from the site's server,
|
|
25
|
+
// without a referrer). Opening it shows it in the Sort list.
|
|
24
26
|
export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
|
|
25
27
|
const k = iceKey(item),
|
|
26
28
|
cur = ctx.cur === k,
|
|
27
29
|
lk = item.link && /^https?:\/\//i.test(item.link.url) ? item.link : null,
|
|
28
|
-
site = lk ? hostOf(lk.url).replace(/^www\./, "") : ""
|
|
30
|
+
site = lk ? hostOf(lk.url).replace(/^www\./, "") : "",
|
|
31
|
+
img = lk ? linkImage(lk) : "";
|
|
29
32
|
return (
|
|
30
33
|
<article
|
|
31
34
|
data-cur={cur || undefined}
|
|
@@ -38,12 +41,26 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
|
|
|
38
41
|
href={webUrl(lk.url)}
|
|
39
42
|
target="_blank"
|
|
40
43
|
rel="noopener noreferrer"
|
|
44
|
+
data-img={img || undefined}
|
|
41
45
|
style={{ "--h": hue(site) } as React.CSSProperties}
|
|
42
|
-
className="group/lk flex min-h-[88px] flex-col justify-end gap-[3px] rounded-t-lg bg-[hsl(var(--h)_42%_40%)] px-3 pb-2.5 pt-3.5 text-white"
|
|
46
|
+
className="group/lk relative flex min-h-[88px] data-[img]:min-h-[160px] flex-col justify-end gap-[3px] overflow-hidden rounded-t-lg bg-[hsl(var(--h)_42%_40%)] px-3 pb-2.5 pt-3.5 text-white"
|
|
43
47
|
>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
{img && (
|
|
49
|
+
<>
|
|
50
|
+
<img
|
|
51
|
+
src={img}
|
|
52
|
+
alt=""
|
|
53
|
+
loading="lazy"
|
|
54
|
+
referrerPolicy="no-referrer"
|
|
55
|
+
onError={(e) => (e.currentTarget.hidden = true)}
|
|
56
|
+
className="absolute inset-0 h-full w-full object-cover"
|
|
57
|
+
/>
|
|
58
|
+
<span aria-hidden className="absolute inset-0 bg-gradient-to-t from-black/75 via-black/25 to-transparent" />
|
|
59
|
+
</>
|
|
60
|
+
)}
|
|
61
|
+
<b className="relative break-words text-base leading-[1.35] group-hover/lk:underline">{lk.title || site}</b>
|
|
62
|
+
{lk.summary && <span className="relative line-clamp-2 text-sm leading-[1.4] opacity-90">{lk.summary}</span>}
|
|
63
|
+
<small className="relative text-xs opacity-85">{site}</small>
|
|
47
64
|
</a>
|
|
48
65
|
)}
|
|
49
66
|
<div className="flex flex-col gap-2 px-3 pb-2.5 pt-3">
|
|
@@ -67,7 +84,7 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
|
|
|
67
84
|
>
|
|
68
85
|
{item.text}
|
|
69
86
|
</button>
|
|
70
|
-
<RequestImages item={item} card />
|
|
87
|
+
{!img && <RequestImages item={item} card />}
|
|
71
88
|
<div className="flex flex-wrap items-center gap-1.5 text-sm text-muted-foreground">
|
|
72
89
|
{item.board && <span className="text-foreground">{item.board}</span>}
|
|
73
90
|
{(item.tags || []).map((t) => (
|
|
@@ -82,9 +99,14 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
|
|
|
82
99
|
</span>
|
|
83
100
|
)}
|
|
84
101
|
<span className="flex-1" />
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
102
|
+
{/* A long source name (a search's words) is cut to the card; its age always shows. */}
|
|
103
|
+
<span className="flex min-w-0 max-w-full items-center gap-1 tabular-nums">
|
|
104
|
+
{item.source !== "manual" && (
|
|
105
|
+
<span className="min-w-0 truncate" title={srcName(ctx.list, item)}>
|
|
106
|
+
{srcName(ctx.list, item)} ·
|
|
107
|
+
</span>
|
|
108
|
+
)}
|
|
109
|
+
<span className="shrink-0 whitespace-nowrap">{ago(item.at)}</span>
|
|
88
110
|
</span>
|
|
89
111
|
</div>
|
|
90
112
|
</div>
|
|
@@ -92,7 +114,7 @@ export function RequestCard({ item, ctx }: { item: IceItem; ctx: RowCtx }) {
|
|
|
92
114
|
item={item}
|
|
93
115
|
boards={ctx.boards}
|
|
94
116
|
variant="card"
|
|
95
|
-
className="hidden border-t border-[color:color-mix(in_srgb,var(--line)_50%,transparent)] px-1.5 pb-1.5 pt-1 group-focus-within/card:flex group-hover/card:flex
|
|
117
|
+
className="hidden border-t border-[color:color-mix(in_srgb,var(--line)_50%,transparent)] px-1.5 pb-1.5 pt-1 group-focus-within/card:flex group-hover/card:flex [@media(hover:none)]:flex"
|
|
96
118
|
/>
|
|
97
119
|
</article>
|
|
98
120
|
);
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
type RailTask,
|
|
22
22
|
} from "@lib/rail";
|
|
23
23
|
import { useRoute } from "@lib/router";
|
|
24
|
+
import { closeAllHome, homeTabs, showHomeWs, useHomeWs } from "@lib/home";
|
|
24
25
|
import { useRailData, useServer } from "@lib/server";
|
|
25
26
|
import { AgentChips } from "./agent-chips.tsx";
|
|
26
27
|
|
|
@@ -137,6 +138,40 @@ function WsRow({ dir, r, now, current }: { dir: string; r: RailRow; now: number;
|
|
|
137
138
|
);
|
|
138
139
|
}
|
|
139
140
|
|
|
141
|
+
// Home's own terminals (the Home window) while it is minimized: how many are open, a click brings the window back,
|
|
142
|
+
// × closes them all. Open or closed, the window speaks for itself; it opens with Ctrl+Alt+A or a Home row's +.
|
|
143
|
+
function HomeTerms() {
|
|
144
|
+
const h = useHomeWs(),
|
|
145
|
+
n = homeTabs(useServer((x) => x.shells), h.ending).length;
|
|
146
|
+
if (!n || h.st !== "min") return null;
|
|
147
|
+
return (
|
|
148
|
+
<span className="hterm">
|
|
149
|
+
<button
|
|
150
|
+
type="button"
|
|
151
|
+
title={`Home terminals: ${n} open (Ctrl+Alt+A)`}
|
|
152
|
+
aria-label={`Open the Home window, ${n} terminals`}
|
|
153
|
+
onClick={() => showHomeWs("open")}
|
|
154
|
+
>
|
|
155
|
+
<svg aria-hidden="true">
|
|
156
|
+
<use href="#i-term" />
|
|
157
|
+
</svg>
|
|
158
|
+
{n}
|
|
159
|
+
</button>
|
|
160
|
+
<button
|
|
161
|
+
type="button"
|
|
162
|
+
className="hx"
|
|
163
|
+
title="Close the Home terminals"
|
|
164
|
+
aria-label="Close the Home terminals"
|
|
165
|
+
onClick={() => void closeAllHome()}
|
|
166
|
+
>
|
|
167
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
168
|
+
<path d="M7 7l10 10M17 7 7 17" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
|
|
169
|
+
</svg>
|
|
170
|
+
</button>
|
|
171
|
+
</span>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
140
175
|
function Group({
|
|
141
176
|
g,
|
|
142
177
|
logo,
|
|
@@ -171,7 +206,13 @@ function Group({
|
|
|
171
206
|
aria-expanded={!g.shut}
|
|
172
207
|
onClick={fold}
|
|
173
208
|
>
|
|
174
|
-
|
|
209
|
+
{g.home ? (
|
|
210
|
+
<svg className="plogo hwsico" aria-hidden="true">
|
|
211
|
+
<use href="#i-home" />
|
|
212
|
+
</svg>
|
|
213
|
+
) : (
|
|
214
|
+
<RailLogo dir={g.dir} name={g.name} logo={logo} />
|
|
215
|
+
)}
|
|
175
216
|
<span className="pname">{g.name}</span>
|
|
176
217
|
<svg className="fchev" viewBox="0 0 24 24" aria-hidden="true">
|
|
177
218
|
<path
|
|
@@ -184,6 +225,7 @@ function Group({
|
|
|
184
225
|
/>
|
|
185
226
|
</svg>
|
|
186
227
|
</button>
|
|
228
|
+
{g.home && <HomeTerms />}
|
|
187
229
|
{g.git && (
|
|
188
230
|
<button
|
|
189
231
|
type="button"
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
saveSetting,
|
|
7
7
|
useSettings,
|
|
8
8
|
controlOf,
|
|
9
|
-
|
|
9
|
+
useModelChoices,
|
|
10
10
|
modelName,
|
|
11
11
|
modelTool,
|
|
12
12
|
rowHint,
|
|
@@ -29,7 +29,8 @@ export function SettingRow({ row, off }: { row: Row; off?: boolean }) {
|
|
|
29
29
|
shown = useSettings((s) => s.local[row.key] ?? row.value),
|
|
30
30
|
id = settingId(row.key),
|
|
31
31
|
kind = controlOf(row),
|
|
32
|
-
model = kind === "model"
|
|
32
|
+
model = kind === "model",
|
|
33
|
+
choices = useModelChoices(modelTool(row.key), model);
|
|
33
34
|
const text = rowHint(row);
|
|
34
35
|
const help: ReactNode =
|
|
35
36
|
row.own && scoped ? (
|
|
@@ -115,10 +116,12 @@ export function SettingRow({ row, off }: { row: Row; off?: boolean }) {
|
|
|
115
116
|
return (
|
|
116
117
|
<span>
|
|
117
118
|
{field}
|
|
118
|
-
{
|
|
119
|
+
{choices.length > 0 && (
|
|
119
120
|
<datalist id={`${id}-dl`}>
|
|
120
|
-
{
|
|
121
|
-
<option key={m} value={m}
|
|
121
|
+
{choices.map((m) => (
|
|
122
|
+
<option key={m.id} value={m.id}>
|
|
123
|
+
{m.name}
|
|
124
|
+
</option>
|
|
122
125
|
))}
|
|
123
126
|
</datalist>
|
|
124
127
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { recheck, useSettings } from "@lib/settings";
|
|
2
2
|
import type { Section } from "@lib/settings";
|
|
3
3
|
import { Button } from "@web/ui";
|
|
4
4
|
import { SettingsItem } from "./settings-item.tsx";
|
|
@@ -6,6 +6,7 @@ import { SettingsItem } from "./settings-item.tsx";
|
|
|
6
6
|
// A subsection: its name over a rounded box with hairline dividers between rows. A section with no name (Orchestration's
|
|
7
7
|
// picture) draws its rows with no box. Refresh and Re-check read the page again.
|
|
8
8
|
export function SettingsSection({ section }: { section: Section }) {
|
|
9
|
+
const busy = useSettings((s) => s.busy);
|
|
9
10
|
if (!section.title) return section.items.map((i) => <SettingsItem key={i.id} item={i} />);
|
|
10
11
|
return (
|
|
11
12
|
<section className="mt-6 first:mt-0">
|
|
@@ -17,9 +18,10 @@ export function SettingsSection({ section }: { section: Section }) {
|
|
|
17
18
|
variant="ghost"
|
|
18
19
|
size="sm"
|
|
19
20
|
className="text-primary"
|
|
20
|
-
|
|
21
|
+
disabled={busy === section.extra}
|
|
22
|
+
onClick={() => void recheck(section.extra!, section.extra === "refresh" ? "Refreshed" : "Checked again")}
|
|
21
23
|
>
|
|
22
|
-
{section.extra === "refresh" ? "Refresh" : "Re-check"}
|
|
24
|
+
{busy === section.extra ? "Checking…" : section.extra === "refresh" ? "Refresh" : "Re-check"}
|
|
23
25
|
</Button>
|
|
24
26
|
)}
|
|
25
27
|
</h3>
|
|
@@ -2,7 +2,8 @@ import { useState, type ReactNode } from "react";
|
|
|
2
2
|
import { cn } from "@lib/core";
|
|
3
3
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, Icon, Popover, PopoverContent, PopoverTrigger } from "@web/ui";
|
|
4
4
|
|
|
5
|
-
// `group` heads a run of rows (sources under their platform); `icon` leads the row and the button; `count` trails it
|
|
5
|
+
// `group` heads a run of rows (sources under their platform); `icon` leads the row and the button; `count` trails it;
|
|
6
|
+
// `removable` puts a remove button on the row, which calls the Picker's `onRemove`.
|
|
6
7
|
export type PickerOption = {
|
|
7
8
|
value: string;
|
|
8
9
|
label: string;
|
|
@@ -10,6 +11,7 @@ export type PickerOption = {
|
|
|
10
11
|
icon?: ReactNode;
|
|
11
12
|
count?: number;
|
|
12
13
|
search?: string;
|
|
14
|
+
removable?: boolean;
|
|
13
15
|
};
|
|
14
16
|
// A searchable choice (project, source, category, agent): a button showing the choice that opens a list with a
|
|
15
17
|
// search box. The search matches a row's words and its group's; Enter picks the first row left.
|
|
@@ -23,6 +25,7 @@ export function Picker({
|
|
|
23
25
|
groupIcons,
|
|
24
26
|
open: openProp,
|
|
25
27
|
onOpenChange,
|
|
28
|
+
onRemove,
|
|
26
29
|
}: {
|
|
27
30
|
options: PickerOption[];
|
|
28
31
|
value: string;
|
|
@@ -34,6 +37,7 @@ export function Picker({
|
|
|
34
37
|
// Opened from outside (a form that needs a choice before it can send).
|
|
35
38
|
open?: boolean;
|
|
36
39
|
onOpenChange?: (o: boolean) => void;
|
|
40
|
+
onRemove?: (v: string) => void;
|
|
37
41
|
}) {
|
|
38
42
|
const [own, setOwn] = useState(false),
|
|
39
43
|
open = openProp ?? own,
|
|
@@ -55,6 +59,22 @@ export function Picker({
|
|
|
55
59
|
<span className="min-w-0 flex-1 truncate">{o.label}</span>
|
|
56
60
|
{o.count != null && <i className="text-xs not-italic tabular-nums text-muted-foreground">{o.count}</i>}
|
|
57
61
|
{o.value === value && <Icon name="check" className="size-3.5 text-primary" />}
|
|
62
|
+
{o.removable && onRemove && (
|
|
63
|
+
<button
|
|
64
|
+
type="button"
|
|
65
|
+
aria-label={`Remove ${o.label}`}
|
|
66
|
+
title={`Remove ${o.label}`}
|
|
67
|
+
onPointerDown={(e) => e.stopPropagation()}
|
|
68
|
+
onClick={(e) => {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
setOpen(false);
|
|
71
|
+
onRemove(o.value);
|
|
72
|
+
}}
|
|
73
|
+
className="-mr-1 grid size-5 place-items-center rounded-xs text-muted-foreground opacity-60 hover:bg-muted hover:text-foreground hover:opacity-100"
|
|
74
|
+
>
|
|
75
|
+
<Icon name="x" className="size-3" />
|
|
76
|
+
</button>
|
|
77
|
+
)}
|
|
58
78
|
</CommandItem>
|
|
59
79
|
);
|
|
60
80
|
const groups = [...new Set(options.map((o) => o.group).filter((g): g is string => !!g))];
|
package/web/dist/annotate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* kaizen annotator page script
|
|
1
|
+
/* kaizen annotator page script 5d70282a1fae9198 -- generated by bun run build:web from web/annotate/annotate.ts; do not edit */
|
|
2
2
|
(()=>{var Z=(o)=>o.length<24&&!/\d{3,}|^css-|^_|^sc-|^jsx-/.test(o),dt=(o)=>{let i=Math.min(...o.map((f)=>f.left)),d=Math.min(...o.map((f)=>f.top)),u=Math.max(...o.map((f)=>f.right)),b=Math.max(...o.map((f)=>f.bottom));return{left:i,top:d,right:u,bottom:b,width:u-i,height:b-d}},tt=(o)=>{let i=Math.min(o.x0,o.x1),d=Math.min(o.y0,o.y1),u=Math.abs(o.x1-o.x0),b=Math.abs(o.y1-o.y0);return{left:i,top:d,width:u,height:b,right:i+u,bottom:d+b}},pt=(o)=>o.width>=8&&o.height>=8,ut=(o,i)=>o.width>=4&&o.height>=4&&o.left>=i.left-1&&o.top>=i.top-1&&o.right<=i.right+1&&o.bottom<=i.bottom+1,mt=20,ft=(o,i)=>{let d=o.replace(/\s+/g," ").trim();return d?`"${d.slice(0,60)}${d.length>60?"…":""}"`:i},gt=(o,i)=>`area ${Math.round(o.width)}x${Math.round(o.height)} (${i} elements)`,ht=(o,i,d)=>({left:Math.max(8,Math.min(i-316,o.left)),top:o.bottom+330<d?Math.min(o.bottom+8,d-200):Math.max(8,o.top-190)}),xt=(o,i)=>({left:Math.min(i-12,o.left+o.width),top:Math.max(12,o.top)}),bt=(o,i,d)=>({left:Math.max(8,Math.min(i-268,o.left)),top:Math.min(o.top+o.height+8,d-90)}),yt=(o,i,d,u)=>({kind:o.kind,comment:d.comment,intent:d.intent,severity:d.severity,selector:i.selector,items:o.count>1?i.items:[],path:i.path,text:i.text.slice(0,200),tag:i.tag,url:i.url,box:`${Math.round(o.rect.left+u.x)},${Math.round(o.rect.top+u.y)} ${Math.round(o.rect.width)}x${Math.round(o.rect.height)}`,pb:{x:o.rect.left+u.x,y:o.rect.top+u.y,w:o.rect.width,h:o.rect.height},page:i.page,attrs:i.attrs,styles:i.styles,nearby:i.nearby,selected:o.selected||"",source:i.source,components:i.components});var wt=1500,kt=1300000,et=(o)=>o.width>2400||o.height>2400,vt=(o,i)=>{if(o.width<2||o.height<2||et(o))return null;let d=Math.ceil(o.width),u=Math.ceil(o.height),b=Math.max(0,i.left-o.left),f=Math.max(0,i.top-o.top),l=Math.min(d-b,i.width),C=Math.min(u-f,i.height);return l<2||C<2?null:{w:d,h:u,sx:b,sy:f,sw:l,sh:C}},Et=(o,i,d)=>{let u=[];for(let b=Math.min(2,d||1);b>=0.5;b-=0.5)u.push(Math.min(b,1600/Math.max(o,i)));return u};(()=>{let o=window,i=window.parent!==window||o.__kzHost===!0;if(o.__kzAnnotate||!i)return;o.__kzAnnotate=!0;let d=document.currentScript,u=typeof o.__kzAnnToken==="string"?o.__kzAnnToken:"";if(!u)try{u=new URL(d.src).searchParams.get("t")||""}catch{}let b=window.parent,f=(e)=>b.postMessage({kz:1,t:u,out:1,...e},"*"),l={on:!1,mode:"element",hide:!1,block:!0,color:"#3c82f7",components:!0},C=[],g=null,y=[],E=null,U=!1,j=[],I=[],F=[],nt=window.requestAnimationFrame.bind(window);window.requestAnimationFrame=(e)=>U?(F.push(e),F.length):nt(e);let H=document.createElement("style");H.textContent="*,*::before,*::after{animation-play-state:paused!important;transition:none!important}";function At(e){if(e===U)return;if(U=e,e){document.documentElement.append(H);try{j=document.getAnimations().filter((t)=>t.playState==="running"),j.forEach((t)=>t.pause())}catch{}I=[...document.querySelectorAll("video,audio")].filter((t)=>!t.paused),I.forEach((t)=>t.pause())}else H.remove(),j.forEach((t)=>{try{t.play()}catch{}}),I.forEach((t)=>t.play().catch(()=>{})),j=[],I=[],F.splice(0).forEach((t)=>nt(t))}let z=(e)=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^\w-]/g,"\\$&"),D=(e)=>{try{return document.querySelectorAll(e).length===1}catch{return!1}};function ot(e){if(e.id&&D("#"+z(e.id)))return"#"+z(e.id);let t=e.getAttribute("data-testid");if(t&&D(`[data-testid="${t.replace(/"/g,"\\\"")}"]`))return`[data-testid="${t.replace(/"/g,"\\\"")}"]`;let n=[];for(let r=e;r&&r.nodeType===1&&r!==document.documentElement;r=r.parentElement){let s=r.tagName.toLowerCase();if(r.id){if(n.unshift("#"+z(r.id)),D(n.join(" > ")))break;n.shift()}let c=[...r.classList].filter(Z).slice(0,2);if(c.length)s+=c.map((w)=>"."+z(w)).join("");let p=r.parentElement?[...r.parentElement.children].filter((w)=>w.tagName===r.tagName):[];if(p.length>1&&!(c.length&&r.parentElement.querySelectorAll(":scope > "+s).length===1))s+=`:nth-of-type(${p.indexOf(r)+1})`;if(n.unshift(s),D(n.join(" > ")))break}return n.join(" > ")}let Ct=(e)=>{let t=[];for(let n=e;n&&n.nodeType===1;n=n.parentElement)t.unshift(n.tagName.toLowerCase()+(n.id?"#"+n.id:""));return t.join(" > ")},K=(e)=>e.tagName.toLowerCase()+(e.id?"#"+e.id:"")+[...e.classList].filter(Z).slice(0,2).map((t)=>"."+t).join(""),Y=(e)=>(e.innerText||e.textContent||e.getAttribute("aria-label")||e.getAttribute("alt")||"").replace(/\s+/g," ").trim(),_t=["id","class","role","aria-label","href","type","name","placeholder","alt","data-testid"],St=(e)=>_t.filter((t)=>e.hasAttribute(t)).map((t)=>`${t}="${e.getAttribute(t).slice(0,80)}"`).join(" "),Rt=["color","background-color","font-family","font-size","font-weight","line-height","padding","margin","display","position","border-radius","width","height"],Mt=(e)=>{let t=getComputedStyle(e);return Rt.map((n)=>`${n}: ${t.getPropertyValue(n)}`).join("; ")};function $t(e){let t="",n=[];for(let r=e,s=0;r&&r.nodeType===1&&s<14;r=r.parentElement,s++){let c=r.getAttribute("data-astro-source-file");if(c&&!t)t=c+(r.getAttribute("data-astro-source-loc")?":"+r.getAttribute("data-astro-source-loc").replace(/:/,":"):"");let p=r.__svelte_meta&&r.__svelte_meta.loc;if(p&&!t)t=`${p.file}:${p.line}`;let w=r.__vueParentComponent;for(let a=w,v=0;a&&v<6;a=a.parent,v++){let m=a.type&&(a.type.name||a.type.__name);if(m&&!n.includes(m))n.push(m);if(a.type&&a.type.__file&&!t)t=a.type.__file}if(r.__vue__&&r.__vue__.$options){let a=r.__vue__.$options;if(a.name&&!n.includes(a.name))n.push(a.name);if(a.__file&&!t)t=a.__file}let P=Object.keys(r).find((a)=>a.startsWith("__reactFiber$"));if(P)for(let a=r[P],v=0;a&&v<40;a=a.return,v++){if(a._debugSource&&!t)t=`${a._debugSource.fileName}:${a._debugSource.lineNumber}`;let m=a.type;if(typeof m==="function"||m&&typeof m==="object"){let S=m.displayName||m.name||m.render&&m.render.name||"";if(S&&!n.includes(S)&&n.length<8)n.push(S)}}if(t&&n.length)break}return{source:t,components:n.reverse().join(" > ")}}let M=document.createElement("div");M.style.cssText="all:initial;position:fixed;inset:0;z-index:2147483647;pointer-events:none";let Tt=M.attachShadow({mode:"closed"}),rt=document.createElement("style");rt.textContent=`
|
|
3
3
|
*{box-sizing:border-box;font:12px/1.4 system-ui,sans-serif}
|
|
4
4
|
.b{position:fixed;pointer-events:none;border:2px solid var(--c);background:color-mix(in srgb,var(--c) 14%,transparent);border-radius:2px}
|