refactor: format markdown files using prettier, fix spelling concerns, reduce Taskfile bloat

This commit is contained in:
sam committed 2026-09-25 01:10:28 +10:00
1 parent 2051ca94d2
commit 2e00777f07
608 files changed
+63317 -10219

No files matched your search

+7 -7
View File
@@ -10,11 +10,11 @@ as `templates/repo/actions/list.tmpl`.
## Files → destinations
| file | destination on gitea container | role |
| --- | --- | --- |
| `extra_tabs.tmpl` | `$GITEA_CUSTOM/templates/custom/extra_tabs.tmpl` | adds the "Agent Run" repo tab |
| `body_inner_post.tmpl` | `$GITEA_CUSTOM/templates/custom/body_inner_post.tmpl` | loads the CDN CSS/JS + agent-monitor.js, gated on the sentinel |
| `agent-monitor.js` | `$GITEA_CUSTOM/public/assets/agent-monitor.js` | swaps the runs-list segment's content for the terminal, opens the SSE connection |
| file | destination on gitea container | role |
| ---------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------- |
| `extra_tabs.tmpl` | `$GITEA_CUSTOM/templates/custom/extra_tabs.tmpl` | adds the "Agent Run" repo tab |
| `body_inner_post.tmpl` | `$GITEA_CUSTOM/templates/custom/body_inner_post.tmpl` | loads the CDN CSS/JS + agent-monitor.js, gated on the sentinel |
| `agent-monitor.js` | `$GITEA_CUSTOM/public/assets/agent-monitor.js` | swaps the runs-list segment's content for the terminal, opens the SSE connection |
`$GITEA_CUSTOM` is usually `/data/gitea` in the container — confirm via
Site Administration > Configuration, or `gitea help`.
@@ -44,7 +44,7 @@ then fires on that same page, sees the sentinel, and loads
The sidebar is deliberately left alone — it's real, always-current Gitea
markup (actual workflow files, actual routes). An earlier version tried
hiding it and hardcoding a lookalike sidebar instead; that goes stale the
moment a workflow is added/renamed, so it was dropped in favor of this.
moment a workflow is added/renamed, so it was dropped in favour of this.
Nesting the terminal inside other stock wrapper classes (e.g.
`.ui.top.attached.header`, meant for the slim counter bar) also produced
a tiny clipped box in testing — reason `.ui.attached.segment` specifically
@@ -82,7 +82,7 @@ events over the wire — fine at current volume, revisit if that stream
gets busy.
Note: the `[cors]` section in Gitea's own `app.ini` does NOT help here —
it controls CORS headers Gitea sends to let *other* origins call Gitea's
it controls CORS headers Gitea sends to let _other_ origins call Gitea's
API, not the reverse (the browser, loaded from Gitea's origin, fetching
archie-core's separate `internal/webui` server). The CORS header needs
to live on that webui response, or use the reverse-proxy route instead.
+36 -11
View File
@@ -34,12 +34,20 @@
const found = document.querySelectorAll(sel);
if (found.length) {
segment = found[found.length - 1]; // last match = likely the runs-list one
console.log("[agent-monitor] matched selector:", sel, "(", found.length, "candidate(s))");
console.log(
"[agent-monitor] matched selector:",
sel,
"(",
found.length,
"candidate(s))",
);
break;
}
}
if (!segment) {
console.warn("[agent-monitor] no .ui.attached.segment found on page — markup shape changed, nothing to swap");
console.warn(
"[agent-monitor] no .ui.attached.segment found on page — markup shape changed, nothing to swap",
);
return;
}
@@ -69,10 +77,16 @@
// TODO: point this at wherever internal/webui (archie-core's SSE
// dashboard) is reachable from the browser — reverse-proxy it under
// this same host to avoid CORS. Override per-load with ?webui=.
const WEBUI_BASE = new URLSearchParams(location.search).get("webui")
|| "https://gitea.example.com/agent-events";
const WEBUI_BASE =
new URLSearchParams(location.search).get("webui") ||
"https://gitea.example.com/agent-events";
const term = new Terminal({ convertEol: true, disableStdin: true, cursorBlink: false, fontSize: 13 });
const term = new Terminal({
convertEol: true,
disableStdin: true,
cursorBlink: false,
fontSize: 13,
});
term.open(el);
// FitAddon sizes xterm's internal viewport (rows/cols) to match the
@@ -86,13 +100,18 @@
window.addEventListener("resize", () => fit.fit());
}
term.writeln(`\x1b[90mconnecting to ${WEBUI_BASE} (repo=${repoFilter})...\x1b[0m`);
term.writeln(
`\x1b[90mconnecting to ${WEBUI_BASE} (repo=${repoFilter})...\x1b[0m`,
);
function colorFor(stage) {
switch (stage) {
case "error": return "\x1b[31m";
case "done": return "\x1b[32m";
default: return "\x1b[36m";
case "error":
return "\x1b[31m";
case "done":
return "\x1b[32m";
default:
return "\x1b[36m";
}
}
@@ -100,7 +119,9 @@
if (repoFilter && e.repo && e.repo !== repoFilter) return;
const ts = new Date().toLocaleTimeString();
const tag = [e.workflow, e.stage].filter(Boolean).join(":");
term.writeln(`\x1b[90m${ts}\x1b[0m ${colorFor(e.stage)}[${tag || "event"}]\x1b[0m ${e.detail || ""}`);
term.writeln(
`\x1b[90m${ts}\x1b[0m ${colorFor(e.stage)}[${tag || "event"}]\x1b[0m ${e.detail || ""}`,
);
if (e.data && Object.keys(e.data).length) {
term.writeln(`\x1b[90m ${JSON.stringify(e.data)}\x1b[0m`);
}
@@ -117,7 +138,11 @@
if (retrying) term.writeln("\x1b[32m connected\x1b[0m");
retrying = false;
};
es.onmessage = (msg) => { try { render(JSON.parse(msg.data)); } catch {} };
es.onmessage = (msg) => {
try {
render(JSON.parse(msg.data));
} catch {}
};
es.onerror = () => {
es.close();
if (!retrying) {