co-maintainer 0.7.2-beta.1 → 0.7.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/dist/package.json +2 -1
- package/dist/src/ai/anthropic.d.ts +1 -1
- package/dist/src/ai/anthropic.js +1 -1
- package/dist/src/ai/batch.d.ts +1 -1
- package/dist/src/ai/batch.js +3 -3
- package/dist/src/ai/copy_rule.d.ts +7 -0
- package/dist/src/ai/copy_rule.js +23 -0
- package/dist/src/ai/estimate.js +3 -3
- package/dist/src/ai/fake.js +2 -1
- package/dist/src/ai/mermaid.js +1 -0
- package/dist/src/ai/oauth/registry.d.ts +1 -1
- package/dist/src/ai/oauth/sign-in-with-chatgpt.d.ts +4 -4
- package/dist/src/ai/oauth/sign-in-with-chatgpt.js +6 -6
- package/dist/src/ai/openai.d.ts +3 -3
- package/dist/src/ai/openai.js +4 -4
- package/dist/src/ai/openrouter.d.ts +1 -1
- package/dist/src/ai/openrouter.js +1 -1
- package/dist/src/ai/pricing.js +1 -1
- package/dist/src/ai/provider.d.ts +2 -0
- package/dist/src/ai/provider.js +8 -2
- package/dist/src/ai/verify.d.ts +1 -1
- package/dist/src/ai/verify.js +1 -1
- package/dist/src/cli/args.js +1 -1
- package/dist/src/cli/command_json.d.ts +4 -2
- package/dist/src/cli/command_json.js +1 -0
- package/dist/src/cli/commands/config.d.ts +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/oauth.js +1 -1
- package/dist/src/cli/commands/probe.js +1 -1
- package/dist/src/cli/commands/review.js +2 -0
- package/dist/src/cli/commands/serve.d.ts +1 -1
- package/dist/src/cli/commands/serve.js +1 -1
- package/dist/src/cli/commands/set.d.ts +1 -1
- package/dist/src/cli/commands/set.js +23 -6
- package/dist/src/cli/commands/view.js +2 -2
- package/dist/src/cli/error.d.ts +1 -1
- package/dist/src/cli/error.js +1 -1
- package/dist/src/cli/pr_carry.d.ts +2 -0
- package/dist/src/cli/pr_carry.js +2 -2
- package/dist/src/cli/prompt.d.ts +2 -2
- package/dist/src/cli/prompt.js +3 -3
- package/dist/src/cli/review_args.js +2 -2
- package/dist/src/cli/review_carry.d.ts +3 -1
- package/dist/src/cli/review_carry.js +5 -3
- package/dist/src/cli/review_result.d.ts +13 -5
- package/dist/src/cli/review_result.js +19 -9
- package/dist/src/config.d.ts +20 -11
- package/dist/src/config.js +3 -3
- package/dist/src/github/app.d.ts +1 -1
- package/dist/src/github/app.js +1 -1
- package/dist/src/github/app_manifest.d.ts +1 -1
- package/dist/src/github/app_manifest.js +1 -1
- package/dist/src/github/client.d.ts +1 -1
- package/dist/src/github/client.js +1 -1
- package/dist/src/github/collect.d.ts +7 -1
- package/dist/src/github/collect.js +41 -16
- package/dist/src/github/gh.js +2 -2
- package/dist/src/github/jwt.d.ts +1 -1
- package/dist/src/github/jwt.js +1 -1
- package/dist/src/github/oauth.js +2 -2
- package/dist/src/knowledge/facts.js +3 -3
- package/dist/src/knowledge/guide.d.ts +24 -1
- package/dist/src/knowledge/guide.js +46 -16
- package/dist/src/knowledge/guide_ids.d.ts +9 -0
- package/dist/src/knowledge/guide_ids.js +26 -7
- package/dist/src/knowledge/probe.js +1 -1
- package/dist/src/knowledge/rule_changes.d.ts +18 -0
- package/dist/src/knowledge/rule_changes.js +41 -0
- package/dist/src/knowledge/rules.d.ts +11 -0
- package/dist/src/knowledge/rules.js +10 -1
- package/dist/src/knowledge/skill.js +1 -1
- package/dist/src/knowledge/stable_ids.d.ts +29 -0
- package/dist/src/knowledge/stable_ids.js +90 -0
- package/dist/src/knowledge/synthesis.d.ts +13 -1
- package/dist/src/knowledge/synthesis.js +94 -26
- package/dist/src/knowledge/types.d.ts +16 -0
- package/dist/src/local/carry_over_store.d.ts +1 -1
- package/dist/src/local/carry_over_store.js +1 -1
- package/dist/src/local/codegraph_prepare.js +1 -1
- package/dist/src/local/git_ops.js +1 -1
- package/dist/src/local/review_local.js +6 -5
- package/dist/src/local/review_lock.d.ts +1 -1
- package/dist/src/pr/checkout.d.ts +3 -3
- package/dist/src/pr/checkout.js +7 -7
- package/dist/src/pr/codegraph_tool_args.d.ts +1 -1
- package/dist/src/pr/codegraph_tool_args.js +1 -1
- package/dist/src/pr/findings.d.ts +3 -0
- package/dist/src/pr/findings.js +29 -10
- package/dist/src/pr/findings_json.d.ts +2 -2
- package/dist/src/pr/findings_json.js +15 -2
- package/dist/src/pr/github_revision.js +1 -1
- package/dist/src/pr/review_copy.d.ts +2 -3
- package/dist/src/pr/review_copy.js +2 -3
- package/dist/src/pr/reviewer.d.ts +7 -3
- package/dist/src/pr/reviewer.js +26 -26
- package/dist/src/pr/scope.d.ts +8 -8
- package/dist/src/pr/scope.js +4 -4
- package/dist/src/pr/snapshot.d.ts +2 -2
- package/dist/src/remote/client.js +4 -3
- package/dist/src/remote/schema.d.ts +1 -1
- package/dist/src/remote/schema.js +1 -1
- package/dist/src/remote/server/body.d.ts +1 -1
- package/dist/src/remote/server/body.js +1 -1
- package/dist/src/remote/server/guides.js +1 -1
- package/dist/src/remote/validate.js +1 -1
- package/dist/src/review/blocking.d.ts +3 -3
- package/dist/src/review/blocking.js +2 -2
- package/dist/src/review/carry_over.d.ts +9 -1
- package/dist/src/review/carry_over.js +10 -2
- package/dist/src/review/diagram.js +7 -6
- package/dist/src/review/engine.d.ts +1 -1
- package/dist/src/review/guides.js +1 -1
- package/dist/src/review/references.d.ts +68 -0
- package/dist/src/review/references.js +176 -0
- package/dist/src/review/system_prompt.d.ts +1 -1
- package/dist/src/review/system_prompt.js +1 -1
- package/dist/src/server/api/jobs.js +2 -2
- package/dist/src/server/api/repos.js +1 -1
- package/dist/src/server/app.js +1 -1
- package/dist/src/server/auth.d.ts +3 -3
- package/dist/src/server/auth.js +9 -4
- package/dist/src/server/http.js +5 -5
- package/dist/src/server/pages/activity.js +1 -1
- package/dist/src/server/pages/add_repo.js +1 -0
- package/dist/src/server/pages/client.d.ts +2 -2
- package/dist/src/server/pages/client.js +2 -2
- package/dist/src/server/pages/home.d.ts +1 -1
- package/dist/src/server/pages/home.js +1 -1
- package/dist/src/server/pages/icons.d.ts +1 -1
- package/dist/src/server/pages/icons.js +1 -1
- package/dist/src/server/pages/layout.d.ts +2 -2
- package/dist/src/server/pages/layout.js +3 -3
- package/dist/src/server/pages/pr.js +4 -0
- package/dist/src/server/pages/rate_limit_waits.js +2 -2
- package/dist/src/server/pages/references.d.ts +2 -0
- package/dist/src/server/pages/references.js +55 -0
- package/dist/src/server/pages/repo.js +26 -0
- package/dist/src/server/pages/repo_settings.js +1 -0
- package/dist/src/server/pages/router.js +3 -2
- package/dist/src/server/pages/styles.d.ts +2 -2
- package/dist/src/server/pages/styles.js +2 -2
- package/dist/src/server/pages/ui.d.ts +1 -1
- package/dist/src/server/pages/ui.js +2 -2
- package/dist/src/server/webhook/index.js +1 -1
- package/dist/src/services/clear.d.ts +2 -2
- package/dist/src/services/clear.js +2 -2
- package/dist/src/services/dashboard.d.ts +2 -0
- package/dist/src/services/dashboard.js +2 -0
- package/dist/src/services/probe.js +1 -1
- package/dist/src/services/push_review.js +4 -1
- package/dist/src/services/remote_review.js +5 -2
- package/dist/src/services/remote_review_abort.d.ts +1 -1
- package/dist/src/services/remote_review_abort.js +1 -1
- package/dist/src/services/remote_tokens.js +1 -1
- package/dist/src/services/replies.js +0 -2
- package/dist/src/services/review.d.ts +3 -5
- package/dist/src/services/review.js +43 -18
- package/dist/src/services/rules_build.d.ts +20 -1
- package/dist/src/services/rules_build.js +85 -6
- package/dist/src/services/setup.d.ts +2 -2
- package/dist/src/services/setup.js +36 -11
- package/dist/src/services/watch_comments.js +1 -2
- package/dist/src/services/watch_notes.js +1 -3
- package/dist/src/store/app_db.d.ts +1 -1
- package/dist/src/store/app_db.js +2 -2
- package/dist/src/store/findings.d.ts +2 -0
- package/dist/src/store/findings.js +3 -3
- package/dist/src/store/jobs.d.ts +2 -2
- package/dist/src/store/jobs.js +3 -3
- package/dist/src/store/migrations.d.ts +2 -2
- package/dist/src/store/migrations.js +35 -18
- package/dist/src/store/rows.d.ts +4 -2
- package/dist/src/store/rows.js +1 -1
- package/dist/src/store/rule_events.d.ts +15 -0
- package/dist/src/store/rule_events.js +20 -0
- package/dist/src/store/sessions.d.ts +1 -1
- package/dist/src/store/sessions.js +2 -2
- package/dist/src/store/sqlite.js +2 -2
- package/dist/src/tools/codegraph.d.ts +1 -1
- package/dist/src/tools/codegraph.js +3 -3
- package/dist/src/tools/codegraph_exec.d.ts +1 -1
- package/dist/src/tools/codegraph_exec.js +1 -1
- package/dist/src/types.d.ts +6 -2
- package/dist/src/util/keyed_lock.d.ts +1 -1
- package/dist/src/util/keyed_lock.js +1 -1
- package/dist/src/util/log.js +1 -1
- package/dist/src/util/redact.js +2 -1
- package/dist/src/util/run_summary.d.ts +3 -3
- package/dist/src/util/run_summary.js +3 -3
- package/dist/src/util/runtime.d.ts +4 -4
- package/dist/src/util/runtime.js +5 -5
- package/dist/src/util/time.d.ts +1 -1
- package/dist/src/util/time.js +1 -1
- package/package.json +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Generated from src/server/pages/client.js by scripts/embed_assets.mjs
|
|
2
|
-
export const client = "function toast(message) {\n const host = document.getElementById(\"toasts\");\n if (!host) return;\n const el = document.createElement(\"div\");\n el.className = \"toast\";\n el.setAttribute(\"role\", \"status\");\n el.textContent = message;\n host.appendChild(el);\n setTimeout(function () {\n el.remove();\n }, 5000);\n}\n\nfunction fail(card, message, retry) {\n toast(message);\n if (!card) return;\n let box = card.querySelector(\"[data-fail]\");\n if (!box) {\n box = document.createElement(\"div\");\n box.setAttribute(\"data-fail\", \"1\");\n box.className = \"fail\";\n card.appendChild(box);\n }\n box.replaceChildren();\n const p = document.createElement(\"p\");\n p.textContent = message;\n const btn = document.createElement(\"button\");\n btn.className = \"btn sm\";\n btn.type = \"button\";\n btn.textContent = \"Retry\";\n btn.addEventListener(\"click\", retry);\n box.appendChild(p);\n box.appendChild(btn);\n}\n\nfunction clearFail(card) {\n const box = card && card.querySelector(\"[data-fail]\");\n if (box) box.remove();\n}\n\n/** Copy text for the `codeBlock` copy button. `navigator.clipboard` needs a\n * secure context, so the hidden-textarea path keeps Copy working on plain\n * http://localhost too. `done` runs only when one of the two paths worked. */\nfunction copyText(value, done, failed) {\n function fallback() {\n if (legacyCopy(value)) done();\n else if (failed) failed();\n }\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(value).then(done, fallback);\n return;\n }\n fallback();\n}\n\nfunction legacyCopy(value) {\n const area = document.createElement(\"textarea\");\n area.value = value;\n area.setAttribute(\"readonly\", \"\");\n area.style.position = \"fixed\";\n area.style.opacity = \"0\";\n document.body.appendChild(area);\n area.select();\n let copied = false;\n try {\n copied = document.execCommand(\"copy\") === true;\n } catch {\n copied = false;\n }\n area.remove();\n return copied;\n}\n\nfunction skeleton(card, on) {\n if (!card) return;\n card.classList.toggle(\"busy\", on);\n}\n\nasync function api(method, url, body) {\n const res = await fetch(url, {\n method: method,\n headers: {\n \"content-type\": \"application/json\",\n \"x-requested-with\": \"co-maintainer\",\n },\n body: body === undefined ? undefined : JSON.stringify(body),\n });\n if (!res.ok) {\n let message = \"Request failed\";\n let code = \"\";\n let detail;\n try {\n const data = await res.json();\n if (data.error && data.error.message) message = data.error.message;\n if (data.error && data.error.code) code = data.error.code;\n if (data.error) detail = data.error.detail;\n } catch {\n // body was not JSON; keep the generic message\n }\n const error = new Error(message);\n if (code) error.code = code;\n error.detail = detail;\n throw error;\n }\n if (res.status === 204) return null;\n return await res.json();\n}\n\nasync function run(btn, card, fn) {\n if (btn) btn.disabled = true;\n skeleton(card, true);\n clearFail(card);\n try {\n await fn();\n } catch (err) {\n fail(card, err.message, function () {\n run(btn, card, fn);\n });\n } finally {\n if (btn) btn.disabled = false;\n skeleton(card, false);\n }\n}\n\nfunction saved(btn, card) {\n if (card) {\n let state = card.querySelector(\".save-state\");\n if (!state) {\n state = document.createElement(\"span\");\n state.className = \"save-state\";\n state.setAttribute(\"role\", \"status\");\n if (btn && btn.parentNode) {\n btn.parentNode.insertBefore(state, btn.nextSibling);\n }\n }\n state.textContent = \"Saved\";\n }\n toast(\"Saved\");\n}\nglobalThis.saved = saved;\n\n/** Polls one job until it reaches a terminal status. A running `init`/`remake`\n * ignores the abort signal, so \"wait for the sync\" is the only honest option\n * the clear pages can offer for it. */\nfunction waitForJob(id) {\n return new Promise(function (resolve, reject) {\n let attempts = 0;\n async function tick() {\n attempts++;\n try {\n const res = await fetch(\"/api/jobs/\" + encodeURIComponent(id), {\n headers: { \"x-requested-with\": \"co-maintainer\" },\n });\n if (!res.ok) throw new Error(\"Could not check the running job.\");\n const job = await res.json();\n if (job.status !== \"running\" && job.status !== \"queued\") {\n resolve();\n return;\n }\n if (attempts > 1200) {\n reject(new Error(\"The sync did not finish.\"));\n return;\n }\n setTimeout(tick, 3000);\n } catch (err) {\n reject(err);\n }\n }\n tick();\n });\n}\n\n/** Clears knowledge, asking about pending jobs when the server refuses.\n * Returns false when the user backed out, so the caller does not reload.\n * A running review is abortable and a running setup is not, which is the\n * difference between the two questions. Called from the inline scripts on the\n * knowledge pages, so it looks unused from inside this file. */\n// oxlint-disable-next-line no-unused-vars\nasync function clearKnowledge(url, includeCache) {\n const target = includeCache ? url + \"?includeCache=1\" : url;\n const retry = target.indexOf(\"?\") >= 0 ? \"&\" : \"?\";\n try {\n await api(\"DELETE\", target);\n } catch (err) {\n if (err.code !== \"jobs_running\") throw err;\n const detail = err.detail || { queued: 0, running: [] };\n const running = detail.running || [];\n const setup = running.find(function (job) {\n return job.abortable === false;\n });\n if (setup) {\n if (\n !confirm(\n \"A sync is running and cannot be stopped. Wait for it to finish and then clear?\",\n )\n ) {\n return false;\n }\n await waitForJob(setup.id);\n await api(\"DELETE\", target);\n return;\n }\n const parts = [];\n if (running.length) parts.push(running.length + \" running review(s)\");\n if (detail.queued) parts.push(detail.queued + \" queued job(s)\");\n if (!confirm(\"Stop \" + parts.join(\" and \") + \" and clear?\")) return false;\n try {\n await api(\"DELETE\", target + retry + \"onRunning=abort\");\n } catch (retryError) {\n // A setup job was claimed between the first 409 and this retry. It\n // cannot be aborted, so wait it out like the branch above.\n if (retryError.code !== \"job_not_abortable\") throw retryError;\n const jobId = retryError.detail && retryError.detail.id;\n if (jobId) await waitForJob(jobId);\n await api(\"DELETE\", target);\n }\n }\n}\n\nasync function postAndGo(url, body, next, btn) {\n const card = btn && btn.closest(\"[data-async]\");\n await run(btn, card, async function () {\n await api(\"POST\", url, body);\n location.href = next;\n });\n}\n\n// Called from the inline scripts on the repo list and repo pages, which deno lint\n// cannot see, so it looks unused from inside this file.\n// deno-lint-ignore no-unused-vars\n// oxlint-disable-next-line no-unused-vars\nfunction bindToggle(btn, url, field) {\n btn.addEventListener(\"click\", async function () {\n if (btn.disabled) return;\n const on = !btn.classList.contains(\"on\");\n btn.classList.toggle(\"on\", on);\n btn.setAttribute(\"data-on\", on ? \"1\" : \"0\");\n btn.disabled = true;\n const card = btn.closest(\"[data-async]\");\n try {\n const payload = {};\n payload[field] = on;\n await api(\"PATCH\", url, payload);\n } catch (err) {\n btn.classList.toggle(\"on\", !on);\n btn.setAttribute(\"data-on\", on ? \"0\" : \"1\");\n fail(card, err.message, function () {\n btn.click();\n });\n } finally {\n btn.disabled = false;\n }\n });\n}\n\nfunction logLevelClass(level) {\n return [\"info\", \"dim\", \"ok\", \"warn\", \"error\"].indexOf(level) >= 0\n ? level\n : \"info\";\n}\n\nfunction logClock(at) {\n const date = new Date(at);\n if (isNaN(date.getTime())) return \"--:--:--\";\n return date.toTimeString().slice(0, 8);\n}\n\n/** One append-only log panel. The rendered lines are the starting point, the\n * SSE stream resumes after their last seq, and a slow poll catches lines\n * written by another process (the CLI or a direct database write). */\nfunction startLogPanel(panel) {\n if (panel.getAttribute(\"data-started\") === \"1\") return;\n panel.setAttribute(\"data-started\", \"1\");\n const log = panel.querySelector(\".log\");\n if (!log) return;\n const jump = panel.querySelector(\"[data-log-jump]\");\n const jumpN = jump && jump.querySelector(\"span\");\n const count = panel.querySelector(\".cnt\");\n const pause = panel.querySelector(\"[data-log-pause]\");\n const clear = panel.querySelector(\"[data-log-clear]\");\n const status = panel.querySelector(\".st\");\n const errorBox = panel.querySelector(\"[data-log-error]\");\n const id = panel.getAttribute(\"data-job\") || panel.getAttribute(\"data-log\");\n let live = panel.getAttribute(\"data-live\") === \"1\";\n let baseStatus = live\n ? \"Running\"\n : panel.getAttribute(\"data-status\") || \"Done\";\n let baseClass = live\n ? \"run\"\n : baseStatus === \"Failed\"\n ? \"failed\"\n : baseStatus === \"Not posted\" || baseStatus === \"Canceled\"\n ? \"warn\"\n : \"done\";\n let lines = log.querySelectorAll(\".line\").length;\n let empty = log.querySelector(\".log-empty\");\n let pending = 0;\n let paused = false;\n let buffered = [];\n let lastSeq = Number(panel.getAttribute(\"data-seq\") || 0);\n if (!isFinite(lastSeq)) lastSeq = 0;\n const timers = [];\n let stream = null;\n\n function showEmpty() {\n if (empty) return;\n empty = document.createElement(\"p\");\n empty.className = \"log-empty\";\n empty.textContent =\n \"No log lines yet. New lines appear here as the job runs.\";\n log.appendChild(empty);\n }\n\n function hideEmpty() {\n if (!empty) return;\n empty.remove();\n empty = null;\n }\n\n function setError(message) {\n if (!errorBox) return;\n errorBox.textContent = message;\n errorBox.hidden = false;\n }\n\n function clearError() {\n if (!errorBox) return;\n errorBox.textContent = \"\";\n errorBox.hidden = true;\n }\n\n function atBottom() {\n return log.scrollTop + log.clientHeight >= log.scrollHeight - 4;\n }\n\n function setCount() {\n if (!count) return;\n count.textContent = lines + (lines === 1 ? \" line\" : \" lines\");\n }\n\n function setJump() {\n if (!jump) return;\n if (pending > 0) {\n if (jumpN) jumpN.textContent = \"(\" + pending + \")\";\n jump.hidden = false;\n } else {\n if (jumpN) jumpN.textContent = \"\";\n jump.hidden = true;\n }\n }\n\n function add(line) {\n if (!line || typeof line.seq !== \"number\" || line.seq <= lastSeq) return;\n const wasAtBottom = atBottom();\n const el = document.createElement(\"div\");\n el.className = \"line lv-\" + logLevelClass(line.level);\n el.setAttribute(\"data-seq\", String(line.seq));\n const t = document.createElement(\"span\");\n t.className = \"t\";\n t.textContent = logClock(line.at);\n const m = document.createElement(\"span\");\n m.className = \"msg\";\n m.textContent = String(line.message || \"\");\n el.appendChild(t);\n el.appendChild(m);\n log.appendChild(el);\n lines += 1;\n lastSeq = line.seq;\n hideEmpty();\n clearError();\n setCount();\n if (wasAtBottom) {\n log.scrollTop = log.scrollHeight;\n pending = 0;\n setJump();\n } else {\n pending += 1;\n setJump();\n }\n }\n\n function receive(line) {\n if (!line || typeof line.seq !== \"number\" || line.seq <= lastSeq) return;\n if (paused) {\n for (let index = 0; index < buffered.length; index++) {\n if (buffered[index].seq === line.seq) return;\n }\n buffered.push(line);\n return;\n }\n add(line);\n }\n\n function flush() {\n buffered.sort(function (a, b) {\n return a.seq - b.seq;\n });\n for (let index = 0; index < buffered.length; index++) add(buffered[index]);\n buffered = [];\n }\n\n function stopLive() {\n if (stream) {\n const current = stream;\n stream = null;\n try {\n current.abort();\n } catch {\n // the stream was already closed\n }\n }\n for (let index = 0; index < timers.length; index++) {\n clearInterval(timers[index]);\n }\n timers.length = 0;\n }\n\n function setLiveStatus(next) {\n live = false;\n panel.setAttribute(\"data-live\", \"0\");\n baseStatus =\n next === \"failed\" ? \"Failed\" : next === \"canceled\" ? \"Canceled\" : \"Done\";\n baseClass =\n next === \"failed\" ? \"failed\" : next === \"canceled\" ? \"warn\" : \"done\";\n panel.setAttribute(\"data-status\", baseStatus);\n if (!paused && status) {\n status.className = \"st \" + baseClass;\n status.textContent = baseStatus;\n }\n clearError();\n stopLive();\n }\n\n function poll() {\n if (!id) return;\n fetch(\"/api/jobs/\" + encodeURIComponent(id), {\n headers: { \"x-requested-with\": \"co-maintainer\" },\n })\n .then(function (res) {\n if (!res.ok) throw new Error(\"could not poll the job log\");\n return res.json();\n })\n .then(function (job) {\n if (!job) return;\n clearError();\n (job.logs || []).forEach(receive);\n if (job.status !== \"running\" && job.status !== \"queued\") {\n setLiveStatus(job.status);\n }\n })\n .catch(function () {\n if (live) setError(\"Log connection lost. Reconnecting...\");\n });\n }\n\n function connect() {\n if (!id || typeof fetch !== \"function\") return;\n const controller =\n typeof AbortController === \"function\" ? new AbortController() : null;\n stream = controller;\n fetch(\n \"/api/jobs/\" +\n encodeURIComponent(id) +\n \"/logs/stream?from=\" +\n encodeURIComponent(String(lastSeq)),\n {\n headers: {\n accept: \"text/event-stream\",\n \"x-requested-with\": \"co-maintainer\",\n },\n signal: controller ? controller.signal : undefined,\n },\n )\n .then(function (res) {\n if (!res.ok || !res.body || typeof res.body.getReader !== \"function\") {\n setError(\"Log connection lost. Reconnecting...\");\n return;\n }\n const reader = res.body.getReader();\n const decoder = new TextDecoder();\n let buffer = \"\";\n function pump() {\n return reader.read().then(function (chunk) {\n if (chunk.done) return;\n buffer += decoder.decode(chunk.value, { stream: true });\n const frames = buffer.split(\"\\n\\n\");\n buffer = frames.pop() || \"\";\n frames.forEach(function (frame) {\n const data = [];\n frame.split(\"\\n\").forEach(function (line) {\n if (line.indexOf(\"data:\") === 0) {\n data.push(line.slice(5).replace(/^ /, \"\"));\n }\n });\n if (!data.length) return;\n try {\n receive(JSON.parse(data.join(\"\\n\")));\n } catch {\n // a malformed frame is skipped, not fatal\n }\n });\n return pump();\n });\n }\n return pump();\n })\n .catch(function () {\n if (stream === controller) {\n setError(\"Log connection lost. Reconnecting...\");\n }\n });\n }\n\n if (jump) {\n jump.addEventListener(\"click\", function () {\n log.scrollTop = log.scrollHeight;\n pending = 0;\n setJump();\n });\n }\n log.addEventListener(\"scroll\", function () {\n if (atBottom()) {\n pending = 0;\n setJump();\n }\n });\n if (pause) {\n pause.addEventListener(\"click\", function () {\n paused = !paused;\n pause.textContent = paused ? \"Resume\" : \"Pause\";\n if (status) {\n status.className = \"st \" + (paused ? \"paused\" : baseClass);\n status.textContent = paused ? \"Paused\" : baseStatus;\n }\n if (!paused) flush();\n });\n }\n if (clear) {\n clear.addEventListener(\"click\", function () {\n for (let index = 0; index < buffered.length; index++) {\n if (buffered[index].seq > lastSeq) lastSeq = buffered[index].seq;\n }\n log.replaceChildren();\n lines = 0;\n pending = 0;\n buffered = [];\n showEmpty();\n setCount();\n setJump();\n });\n }\n setCount();\n setJump();\n if (live) {\n connect();\n timers.push(setInterval(poll, 1000));\n }\n}\n\n/** The Ctrl K palette. Every query gets a sequence number and only the\n * newest answer is drawn, so a slow reply to an older query never replaces\n * the results of the newer one. The highlighted row is the one Enter opens. */\nfunction startPalette() {\n const pal = document.getElementById(\"pal\");\n const overlay = document.getElementById(\"pal-ov\");\n const input = document.getElementById(\"pal-q\");\n const list = document.getElementById(\"pal-list\");\n if (!pal || !overlay || !input || !list) return;\n let returnFocus = null;\n let seq = 0;\n let timer = 0;\n let index = 0;\n\n function items() {\n return list.querySelectorAll(\"[data-href]\");\n }\n function highlight(next) {\n const rows = items();\n if (rows.length === 0) return;\n index = (next + rows.length) % rows.length;\n rows.forEach(function (row, i) {\n row.classList.toggle(\"on\", i === index);\n row.setAttribute(\"aria-selected\", i === index ? \"true\" : \"false\");\n });\n input.setAttribute(\"aria-activedescendant\", rows[index].id);\n rows[index].scrollIntoView({ block: \"nearest\" });\n }\n function draw(result) {\n list.textContent = \"\";\n if (result.groups.length === 0) {\n const empty = document.createElement(\"div\");\n empty.className = \"none\";\n empty.textContent = \"No results\";\n list.appendChild(empty);\n input.removeAttribute(\"aria-activedescendant\");\n return;\n }\n let n = 0;\n result.groups.forEach(function (group) {\n const label = document.createElement(\"div\");\n label.className = \"gl\";\n label.textContent = group.label;\n list.appendChild(label);\n group.items.forEach(function (item) {\n const row = document.createElement(\"a\");\n row.className = \"it\";\n row.id = \"pal-it-\" + n++;\n row.href = item.href;\n row.setAttribute(\"data-href\", item.href);\n row.setAttribute(\"role\", \"option\");\n row.setAttribute(\"aria-selected\", \"false\");\n const name = document.createElement(\"span\");\n name.className = \"lbl\";\n name.textContent = item.label;\n row.innerHTML =\n '<svg class=\"ic\" aria-hidden=\"true\"><use href=\"#i-' +\n String(item.icon).replace(/[^a-z0-9-]/g, \"\") +\n '\"></use></svg>';\n row.appendChild(name);\n list.appendChild(row);\n });\n });\n highlight(0);\n }\n async function search() {\n const mine = ++seq;\n pal.setAttribute(\"data-loading\", \"\");\n try {\n const res = await fetch(\n \"/api/search?q=\" + encodeURIComponent(input.value),\n { headers: { \"x-requested-with\": \"co-maintainer\" } },\n );\n const result = await res.json();\n if (mine !== seq) return;\n draw(res.ok ? result : { groups: [] });\n } catch {\n if (mine === seq) draw({ groups: [] });\n } finally {\n if (mine === seq) pal.removeAttribute(\"data-loading\");\n }\n }\n function open() {\n if (!pal.hidden) return;\n returnFocus = document.activeElement;\n pal.hidden = false;\n overlay.hidden = false;\n input.value = \"\";\n input.focus();\n search();\n }\n function close() {\n if (pal.hidden) return;\n pal.hidden = true;\n overlay.hidden = true;\n seq++;\n pal.removeAttribute(\"data-loading\");\n if (returnFocus && returnFocus.focus) returnFocus.focus();\n }\n\n document.addEventListener(\"click\", function (ev) {\n if (ev.target && ev.target.closest && ev.target.closest(\"[data-palette]\")) {\n ev.preventDefault();\n open();\n }\n });\n overlay.addEventListener(\"click\", close);\n document.addEventListener(\"keydown\", function (ev) {\n if ((ev.ctrlKey || ev.metaKey) && ev.key.toLowerCase() === \"k\") {\n ev.preventDefault();\n if (pal.hidden) open();\n else close();\n return;\n }\n if (pal.hidden) return;\n if (ev.key === \"Escape\") {\n ev.preventDefault();\n close();\n } else if (ev.key === \"ArrowDown\") {\n ev.preventDefault();\n highlight(index + 1);\n } else if (ev.key === \"ArrowUp\") {\n ev.preventDefault();\n highlight(index - 1);\n } else if (ev.key === \"Enter\" && ev.target === input) {\n const row = items()[index];\n if (row && !pal.hasAttribute(\"data-loading\")) {\n ev.preventDefault();\n location.href = row.getAttribute(\"data-href\");\n }\n }\n });\n input.addEventListener(\"input\", function () {\n clearTimeout(timer);\n pal.setAttribute(\"data-loading\", \"\");\n timer = setTimeout(search, 120);\n });\n}\n\nfunction startLogPanels() {\n const panels = document.querySelectorAll(\"[data-log]\");\n for (let index = 0; index < panels.length; index++) {\n startLogPanel(panels[index]);\n }\n}\n\n// The helper is inlined into `<head>` by `layout.ts`, before any page script\n// runs, so this is the one place that can close over both `toast()` and\n// `bindToggle` without depending on point-in-time globals.\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n // Client errors bubble to `window` from `document`.\n addEventListener(\"error\", function (ev) {\n toast((ev.error && ev.error.message) || \"Something broke\");\n });\n addEventListener(\"unhandledrejection\", function (ev) {\n toast((ev.reason && ev.reason.message) || \"Something broke\");\n });\n\n // Theme: the head bootstrap already applied the remembered choice; this only\n // flips it and stores the new one.\n const themeButton = document.getElementById(\"theme\");\n if (themeButton) {\n themeButton.addEventListener(\"click\", function () {\n const dark = document.documentElement.classList.toggle(\"dark\");\n try {\n localStorage.setItem(\"theme\", dark ? \"dark\" : \"light\");\n } catch {\n // storage may be unavailable; the class still applies for this page\n }\n });\n }\n\n // Mobile drawer. `open` on the aside slides it in; the overlay closes it and\n // choosing a link closes it before navigating.\n const drawer = document.querySelector(\"aside.side\");\n const overlay = document.getElementById(\"overlay\");\n const menuButton = document.getElementById(\"menu\");\n function setDrawer(open) {\n if (drawer) drawer.classList.toggle(\"open\", open);\n if (overlay) overlay.classList.toggle(\"on\", open);\n }\n if (menuButton) {\n menuButton.addEventListener(\"click\", function () {\n setDrawer(!(drawer && drawer.classList.contains(\"open\")));\n });\n }\n if (overlay) {\n overlay.addEventListener(\"click\", function () {\n setDrawer(false);\n });\n }\n if (drawer) {\n drawer.addEventListener(\"click\", function (ev) {\n if (ev.target && ev.target.closest && ev.target.closest(\"a\")) {\n setDrawer(false);\n }\n });\n }\n\n startPalette();\n\n document.addEventListener(\"click\", function (ev) {\n const btn =\n ev.target && ev.target.closest ? ev.target.closest(\"[data-copy]\") : null;\n if (!btn) return;\n const box = btn.closest(\".code\");\n const span = box && box.querySelector(\"span:not(.lbl)\");\n if (!span) return;\n ev.preventDefault();\n copyText(\n span.textContent || \"\",\n function () {\n toast(\"Copied\");\n },\n function () {\n toast(\"Copy failed. Select the text and copy it by hand.\");\n },\n );\n });\n\n document.addEventListener(\"click\", function (ev) {\n const btn =\n ev.target && ev.target.closest\n ? ev.target.closest(\"[data-copy-doc]\")\n : null;\n if (!btn) return;\n ev.preventDefault();\n const id = btn.getAttribute(\"data-copy-doc\");\n const sources = document.querySelectorAll(\"[data-doc-source]\");\n let source = null;\n for (let index = 0; index < sources.length; index++) {\n if (sources[index].getAttribute(\"data-doc-source\") === id) {\n source = sources[index];\n break;\n }\n }\n if (!source) return;\n copyText(\n source.textContent || \"\",\n function () {\n toast(\"Copied\");\n },\n function () {\n toast(\"Copy failed. Select the text and copy it by hand.\");\n },\n );\n });\n\n document.addEventListener(\"click\", function (ev) {\n const btn =\n ev.target && ev.target.closest\n ? ev.target.closest(\"[data-cancel], [data-post]\")\n : null;\n if (!btn) return;\n ev.preventDefault();\n if (btn.hasAttribute(\"data-cancel\")) {\n postAndGo(\n \"/api/jobs/\" + btn.getAttribute(\"data-cancel\") + \"/cancel\",\n {},\n \"/activity\",\n btn,\n );\n return;\n }\n const body = btn.getAttribute(\"data-body\");\n postAndGo(\n btn.getAttribute(\"data-post\"),\n body ? JSON.parse(body) : {},\n \"/activity\",\n btn,\n );\n });\n\n // Reads `activity-root` at call time, so it has to wait for the body even\n // though this file itself is already parsed.\n startLogPanels();\n if (!document.getElementById(\"activity-root\")) return;\n const jobPanel = document.querySelector(\"[data-log]\");\n if (jobPanel) {\n if (jobPanel.getAttribute(\"data-live\") !== \"1\") return;\n const progress = document.querySelector(\"[data-job-progress]\");\n if (!progress) return;\n const refreshError = document.querySelector(\"[data-job-refresh-error]\");\n let refreshing = false;\n const refreshJob = async function () {\n if (document.hidden || refreshing) return;\n refreshing = true;\n try {\n const res = await fetch(location.pathname + location.search, {\n headers: { accept: \"text/html\" },\n cache: \"no-store\",\n });\n if (!res.ok) throw new Error(\"refresh failed\");\n const doc = new DOMParser().parseFromString(\n await res.text(),\n \"text/html\",\n );\n const next = doc.querySelector(\"[data-job-progress]\");\n // A finished job renders its result page, which has no progress\n // block: load it rather than keep the running stages and Stop.\n if (!next) {\n location.reload();\n return;\n }\n progress.innerHTML = next.innerHTML;\n if (refreshError) {\n refreshError.textContent = \"\";\n refreshError.hidden = true;\n }\n } catch {\n if (refreshError) {\n refreshError.textContent =\n \"Connection lost. Could not refresh this job. Reconnecting...\";\n refreshError.hidden = false;\n }\n } finally {\n refreshing = false;\n }\n };\n setInterval(refreshJob, 2000);\n return;\n }\n setInterval(async function () {\n if (document.hidden) return;\n if (document.querySelector(\"[data-async].busy\")) return;\n const root = document.getElementById(\"activity-root\");\n if (!root) return;\n try {\n const res = await fetch(location.pathname + location.search, {\n headers: { accept: \"text/html\" },\n });\n if (!res.ok) return;\n const doc = new DOMParser().parseFromString(\n await res.text(),\n \"text/html\",\n );\n const next = doc.getElementById(\"activity-root\");\n if (!next || next.innerHTML === root.innerHTML) return;\n root.replaceWith(next);\n } catch {\n // a failed poll just waits for the next tick\n }\n }, 5000);\n});\n";
|
|
1
|
+
/** Generated from src/server/pages/client.js by scripts/embed_assets.mjs, do not edit. */
|
|
2
|
+
export const client = "function toast(message) {\n const host = document.getElementById(\"toasts\");\n if (!host) return;\n const el = document.createElement(\"div\");\n el.className = \"toast\";\n el.setAttribute(\"role\", \"status\");\n el.textContent = message;\n host.appendChild(el);\n setTimeout(function () {\n el.remove();\n }, 5000);\n}\n\nfunction fail(card, message, retry) {\n toast(message);\n if (!card) return;\n let box = card.querySelector(\"[data-fail]\");\n if (!box) {\n box = document.createElement(\"div\");\n box.setAttribute(\"data-fail\", \"1\");\n box.className = \"fail\";\n card.appendChild(box);\n }\n box.replaceChildren();\n const p = document.createElement(\"p\");\n p.textContent = message;\n const btn = document.createElement(\"button\");\n btn.className = \"btn sm\";\n btn.type = \"button\";\n btn.textContent = \"Retry\";\n btn.addEventListener(\"click\", retry);\n box.appendChild(p);\n box.appendChild(btn);\n}\n\nfunction clearFail(card) {\n const box = card && card.querySelector(\"[data-fail]\");\n if (box) box.remove();\n}\n\n/** Copy text for the `codeBlock` copy button. `navigator.clipboard` needs a\n * secure context, so the hidden-textarea path keeps Copy working on plain\n * http://localhost too. `done` runs only when one of the two paths worked. */\nfunction copyText(value, done, failed) {\n function fallback() {\n if (legacyCopy(value)) done();\n else if (failed) failed();\n }\n if (navigator.clipboard && navigator.clipboard.writeText) {\n navigator.clipboard.writeText(value).then(done, fallback);\n return;\n }\n fallback();\n}\n\nfunction legacyCopy(value) {\n const area = document.createElement(\"textarea\");\n area.value = value;\n area.setAttribute(\"readonly\", \"\");\n area.style.position = \"fixed\";\n area.style.opacity = \"0\";\n document.body.appendChild(area);\n area.select();\n let copied = false;\n try {\n copied = document.execCommand(\"copy\") === true;\n } catch {\n copied = false;\n }\n area.remove();\n return copied;\n}\n\nfunction skeleton(card, on) {\n if (!card) return;\n card.classList.toggle(\"busy\", on);\n}\n\nasync function api(method, url, body) {\n const res = await fetch(url, {\n method: method,\n headers: {\n \"content-type\": \"application/json\",\n \"x-requested-with\": \"co-maintainer\",\n },\n body: body === undefined ? undefined : JSON.stringify(body),\n });\n if (!res.ok) {\n let message = \"Request failed\";\n let code = \"\";\n let detail;\n try {\n const data = await res.json();\n if (data.error && data.error.message) message = data.error.message;\n if (data.error && data.error.code) code = data.error.code;\n if (data.error) detail = data.error.detail;\n } catch {\n // body was not JSON. Keep the generic message\n }\n const error = new Error(message);\n if (code) error.code = code;\n error.detail = detail;\n throw error;\n }\n if (res.status === 204) return null;\n return await res.json();\n}\n\nasync function run(btn, card, fn) {\n if (btn) btn.disabled = true;\n skeleton(card, true);\n clearFail(card);\n try {\n await fn();\n } catch (err) {\n fail(card, err.message, function () {\n run(btn, card, fn);\n });\n } finally {\n if (btn) btn.disabled = false;\n skeleton(card, false);\n }\n}\n\nfunction saved(btn, card) {\n if (card) {\n let state = card.querySelector(\".save-state\");\n if (!state) {\n state = document.createElement(\"span\");\n state.className = \"save-state\";\n state.setAttribute(\"role\", \"status\");\n if (btn && btn.parentNode) {\n btn.parentNode.insertBefore(state, btn.nextSibling);\n }\n }\n state.textContent = \"Saved\";\n }\n toast(\"Saved\");\n}\nglobalThis.saved = saved;\n\n/** Polls one job until it reaches a terminal status. A running `init`/`remake`\n * ignores the abort signal, so \"wait for the sync\" is the only honest option\n * the clear pages can offer for it. */\nfunction waitForJob(id) {\n return new Promise(function (resolve, reject) {\n let attempts = 0;\n async function tick() {\n attempts++;\n try {\n const res = await fetch(\"/api/jobs/\" + encodeURIComponent(id), {\n headers: { \"x-requested-with\": \"co-maintainer\" },\n });\n if (!res.ok) throw new Error(\"Could not check the running job.\");\n const job = await res.json();\n if (job.status !== \"running\" && job.status !== \"queued\") {\n resolve();\n return;\n }\n if (attempts > 1200) {\n reject(new Error(\"The sync did not finish.\"));\n return;\n }\n setTimeout(tick, 3000);\n } catch (err) {\n reject(err);\n }\n }\n tick();\n });\n}\n\n/** Clears knowledge, asking about pending jobs when the server refuses.\n * Returns false when the user backed out, so the caller does not reload.\n * A running review is abortable and a running setup is not, which is the\n * difference between the two questions. Called from the inline scripts on the\n * knowledge pages, so it looks unused from inside this file. */\n// oxlint-disable-next-line no-unused-vars\nasync function clearKnowledge(url, includeCache) {\n const target = includeCache ? url + \"?includeCache=1\" : url;\n const retry = target.indexOf(\"?\") >= 0 ? \"&\" : \"?\";\n try {\n await api(\"DELETE\", target);\n } catch (err) {\n if (err.code !== \"jobs_running\") throw err;\n const detail = err.detail || { queued: 0, running: [] };\n const running = detail.running || [];\n const setup = running.find(function (job) {\n return job.abortable === false;\n });\n if (setup) {\n if (\n !confirm(\n \"A sync is running and cannot be stopped. Wait for it to finish and then clear?\",\n )\n ) {\n return false;\n }\n await waitForJob(setup.id);\n await api(\"DELETE\", target);\n return;\n }\n const parts = [];\n if (running.length) parts.push(running.length + \" running review(s)\");\n if (detail.queued) parts.push(detail.queued + \" queued job(s)\");\n if (!confirm(\"Stop \" + parts.join(\" and \") + \" and clear?\")) return false;\n try {\n await api(\"DELETE\", target + retry + \"onRunning=abort\");\n } catch (retryError) {\n // A setup job was claimed between the first 409 and this retry. It\n // cannot be aborted, so wait it out like the branch above.\n if (retryError.code !== \"job_not_abortable\") throw retryError;\n const jobId = retryError.detail && retryError.detail.id;\n if (jobId) await waitForJob(jobId);\n await api(\"DELETE\", target);\n }\n }\n}\n\nasync function postAndGo(url, body, next, btn) {\n const card = btn && btn.closest(\"[data-async]\");\n await run(btn, card, async function () {\n await api(\"POST\", url, body);\n location.href = next;\n });\n}\n\n// Called from the inline scripts on the repo list and repo pages, which deno lint\n// cannot see, so it looks unused from inside this file.\n// deno-lint-ignore no-unused-vars\n// oxlint-disable-next-line no-unused-vars\nfunction bindToggle(btn, url, field) {\n btn.addEventListener(\"click\", async function () {\n if (btn.disabled) return;\n const on = !btn.classList.contains(\"on\");\n btn.classList.toggle(\"on\", on);\n btn.setAttribute(\"data-on\", on ? \"1\" : \"0\");\n btn.disabled = true;\n const card = btn.closest(\"[data-async]\");\n try {\n const payload = {};\n payload[field] = on;\n await api(\"PATCH\", url, payload);\n } catch (err) {\n btn.classList.toggle(\"on\", !on);\n btn.setAttribute(\"data-on\", on ? \"0\" : \"1\");\n fail(card, err.message, function () {\n btn.click();\n });\n } finally {\n btn.disabled = false;\n }\n });\n}\n\nfunction logLevelClass(level) {\n return [\"info\", \"dim\", \"ok\", \"warn\", \"error\"].indexOf(level) >= 0\n ? level\n : \"info\";\n}\n\nfunction logClock(at) {\n const date = new Date(at);\n if (isNaN(date.getTime())) return \"--:--:--\";\n return date.toTimeString().slice(0, 8);\n}\n\n/** One append-only log panel. The rendered lines are the starting point, the\n * SSE stream resumes after their last seq, and a slow poll catches lines\n * written by another process (the CLI or a direct database write). */\nfunction startLogPanel(panel) {\n if (panel.getAttribute(\"data-started\") === \"1\") return;\n panel.setAttribute(\"data-started\", \"1\");\n const log = panel.querySelector(\".log\");\n if (!log) return;\n const jump = panel.querySelector(\"[data-log-jump]\");\n const jumpN = jump && jump.querySelector(\"span\");\n const count = panel.querySelector(\".cnt\");\n const pause = panel.querySelector(\"[data-log-pause]\");\n const clear = panel.querySelector(\"[data-log-clear]\");\n const status = panel.querySelector(\".st\");\n const errorBox = panel.querySelector(\"[data-log-error]\");\n const id = panel.getAttribute(\"data-job\") || panel.getAttribute(\"data-log\");\n let live = panel.getAttribute(\"data-live\") === \"1\";\n let baseStatus = live\n ? \"Running\"\n : panel.getAttribute(\"data-status\") || \"Done\";\n let baseClass = live\n ? \"run\"\n : baseStatus === \"Failed\"\n ? \"failed\"\n : baseStatus === \"Not posted\" || baseStatus === \"Canceled\"\n ? \"warn\"\n : \"done\";\n let lines = log.querySelectorAll(\".line\").length;\n let empty = log.querySelector(\".log-empty\");\n let pending = 0;\n let paused = false;\n let buffered = [];\n let lastSeq = Number(panel.getAttribute(\"data-seq\") || 0);\n if (!isFinite(lastSeq)) lastSeq = 0;\n const timers = [];\n let stream = null;\n\n function showEmpty() {\n if (empty) return;\n empty = document.createElement(\"p\");\n empty.className = \"log-empty\";\n empty.textContent =\n \"No log lines yet. New lines appear here as the job runs.\";\n log.appendChild(empty);\n }\n\n function hideEmpty() {\n if (!empty) return;\n empty.remove();\n empty = null;\n }\n\n function setError(message) {\n if (!errorBox) return;\n errorBox.textContent = message;\n errorBox.hidden = false;\n }\n\n function clearError() {\n if (!errorBox) return;\n errorBox.textContent = \"\";\n errorBox.hidden = true;\n }\n\n function atBottom() {\n return log.scrollTop + log.clientHeight >= log.scrollHeight - 4;\n }\n\n function setCount() {\n if (!count) return;\n count.textContent = lines + (lines === 1 ? \" line\" : \" lines\");\n }\n\n function setJump() {\n if (!jump) return;\n if (pending > 0) {\n if (jumpN) jumpN.textContent = \"(\" + pending + \")\";\n jump.hidden = false;\n } else {\n if (jumpN) jumpN.textContent = \"\";\n jump.hidden = true;\n }\n }\n\n function add(line) {\n if (!line || typeof line.seq !== \"number\" || line.seq <= lastSeq) return;\n const wasAtBottom = atBottom();\n const el = document.createElement(\"div\");\n el.className = \"line lv-\" + logLevelClass(line.level);\n el.setAttribute(\"data-seq\", String(line.seq));\n const t = document.createElement(\"span\");\n t.className = \"t\";\n t.textContent = logClock(line.at);\n const m = document.createElement(\"span\");\n m.className = \"msg\";\n m.textContent = String(line.message || \"\");\n el.appendChild(t);\n el.appendChild(m);\n log.appendChild(el);\n lines += 1;\n lastSeq = line.seq;\n hideEmpty();\n clearError();\n setCount();\n if (wasAtBottom) {\n log.scrollTop = log.scrollHeight;\n pending = 0;\n setJump();\n } else {\n pending += 1;\n setJump();\n }\n }\n\n function receive(line) {\n if (!line || typeof line.seq !== \"number\" || line.seq <= lastSeq) return;\n if (paused) {\n for (let index = 0; index < buffered.length; index++) {\n if (buffered[index].seq === line.seq) return;\n }\n buffered.push(line);\n return;\n }\n add(line);\n }\n\n function flush() {\n buffered.sort(function (a, b) {\n return a.seq - b.seq;\n });\n for (let index = 0; index < buffered.length; index++) add(buffered[index]);\n buffered = [];\n }\n\n function stopLive() {\n if (stream) {\n const current = stream;\n stream = null;\n try {\n current.abort();\n } catch {\n // the stream was already closed\n }\n }\n for (let index = 0; index < timers.length; index++) {\n clearInterval(timers[index]);\n }\n timers.length = 0;\n }\n\n function setLiveStatus(next) {\n live = false;\n panel.setAttribute(\"data-live\", \"0\");\n baseStatus =\n next === \"failed\" ? \"Failed\" : next === \"canceled\" ? \"Canceled\" : \"Done\";\n baseClass =\n next === \"failed\" ? \"failed\" : next === \"canceled\" ? \"warn\" : \"done\";\n panel.setAttribute(\"data-status\", baseStatus);\n if (!paused && status) {\n status.className = \"st \" + baseClass;\n status.textContent = baseStatus;\n }\n clearError();\n stopLive();\n }\n\n function poll() {\n if (!id) return;\n fetch(\"/api/jobs/\" + encodeURIComponent(id), {\n headers: { \"x-requested-with\": \"co-maintainer\" },\n })\n .then(function (res) {\n if (!res.ok) throw new Error(\"could not poll the job log\");\n return res.json();\n })\n .then(function (job) {\n if (!job) return;\n clearError();\n (job.logs || []).forEach(receive);\n if (job.status !== \"running\" && job.status !== \"queued\") {\n setLiveStatus(job.status);\n }\n })\n .catch(function () {\n if (live) setError(\"Log connection lost. Reconnecting...\");\n });\n }\n\n function connect() {\n if (!id || typeof fetch !== \"function\") return;\n const controller =\n typeof AbortController === \"function\" ? new AbortController() : null;\n stream = controller;\n fetch(\n \"/api/jobs/\" +\n encodeURIComponent(id) +\n \"/logs/stream?from=\" +\n encodeURIComponent(String(lastSeq)),\n {\n headers: {\n accept: \"text/event-stream\",\n \"x-requested-with\": \"co-maintainer\",\n },\n signal: controller ? controller.signal : undefined,\n },\n )\n .then(function (res) {\n if (!res.ok || !res.body || typeof res.body.getReader !== \"function\") {\n setError(\"Log connection lost. Reconnecting...\");\n return;\n }\n const reader = res.body.getReader();\n const decoder = new TextDecoder();\n let buffer = \"\";\n function pump() {\n return reader.read().then(function (chunk) {\n if (chunk.done) return;\n buffer += decoder.decode(chunk.value, { stream: true });\n const frames = buffer.split(\"\\n\\n\");\n buffer = frames.pop() || \"\";\n frames.forEach(function (frame) {\n const data = [];\n frame.split(\"\\n\").forEach(function (line) {\n if (line.indexOf(\"data:\") === 0) {\n data.push(line.slice(5).replace(/^ /, \"\"));\n }\n });\n if (!data.length) return;\n try {\n receive(JSON.parse(data.join(\"\\n\")));\n } catch {\n // a malformed frame is skipped, not fatal\n }\n });\n return pump();\n });\n }\n return pump();\n })\n .catch(function () {\n if (stream === controller) {\n setError(\"Log connection lost. Reconnecting...\");\n }\n });\n }\n\n if (jump) {\n jump.addEventListener(\"click\", function () {\n log.scrollTop = log.scrollHeight;\n pending = 0;\n setJump();\n });\n }\n log.addEventListener(\"scroll\", function () {\n if (atBottom()) {\n pending = 0;\n setJump();\n }\n });\n if (pause) {\n pause.addEventListener(\"click\", function () {\n paused = !paused;\n pause.textContent = paused ? \"Resume\" : \"Pause\";\n if (status) {\n status.className = \"st \" + (paused ? \"paused\" : baseClass);\n status.textContent = paused ? \"Paused\" : baseStatus;\n }\n if (!paused) flush();\n });\n }\n if (clear) {\n clear.addEventListener(\"click\", function () {\n for (let index = 0; index < buffered.length; index++) {\n if (buffered[index].seq > lastSeq) lastSeq = buffered[index].seq;\n }\n log.replaceChildren();\n lines = 0;\n pending = 0;\n buffered = [];\n showEmpty();\n setCount();\n setJump();\n });\n }\n setCount();\n setJump();\n if (live) {\n connect();\n timers.push(setInterval(poll, 1000));\n }\n}\n\n/** The Ctrl K palette. Every query gets a sequence number and only the\n * newest answer is drawn, so a slow reply to an older query never replaces\n * the results of the newer one. The highlighted row is the one Enter opens. */\nfunction startPalette() {\n const pal = document.getElementById(\"pal\");\n const overlay = document.getElementById(\"pal-ov\");\n const input = document.getElementById(\"pal-q\");\n const list = document.getElementById(\"pal-list\");\n if (!pal || !overlay || !input || !list) return;\n let returnFocus = null;\n let seq = 0;\n let timer = 0;\n let index = 0;\n\n function items() {\n return list.querySelectorAll(\"[data-href]\");\n }\n function highlight(next) {\n const rows = items();\n if (rows.length === 0) return;\n index = (next + rows.length) % rows.length;\n rows.forEach(function (row, i) {\n row.classList.toggle(\"on\", i === index);\n row.setAttribute(\"aria-selected\", i === index ? \"true\" : \"false\");\n });\n input.setAttribute(\"aria-activedescendant\", rows[index].id);\n rows[index].scrollIntoView({ block: \"nearest\" });\n }\n function draw(result) {\n list.textContent = \"\";\n if (result.groups.length === 0) {\n const empty = document.createElement(\"div\");\n empty.className = \"none\";\n empty.textContent = \"No results\";\n list.appendChild(empty);\n input.removeAttribute(\"aria-activedescendant\");\n return;\n }\n let n = 0;\n result.groups.forEach(function (group) {\n const label = document.createElement(\"div\");\n label.className = \"gl\";\n label.textContent = group.label;\n list.appendChild(label);\n group.items.forEach(function (item) {\n const row = document.createElement(\"a\");\n row.className = \"it\";\n row.id = \"pal-it-\" + n++;\n row.href = item.href;\n row.setAttribute(\"data-href\", item.href);\n row.setAttribute(\"role\", \"option\");\n row.setAttribute(\"aria-selected\", \"false\");\n const name = document.createElement(\"span\");\n name.className = \"lbl\";\n name.textContent = item.label;\n row.innerHTML =\n '<svg class=\"ic\" aria-hidden=\"true\"><use href=\"#i-' +\n String(item.icon).replace(/[^a-z0-9-]/g, \"\") +\n '\"></use></svg>';\n row.appendChild(name);\n list.appendChild(row);\n });\n });\n highlight(0);\n }\n async function search() {\n const mine = ++seq;\n pal.setAttribute(\"data-loading\", \"\");\n try {\n const res = await fetch(\n \"/api/search?q=\" + encodeURIComponent(input.value),\n { headers: { \"x-requested-with\": \"co-maintainer\" } },\n );\n const result = await res.json();\n if (mine !== seq) return;\n draw(res.ok ? result : { groups: [] });\n } catch {\n if (mine === seq) draw({ groups: [] });\n } finally {\n if (mine === seq) pal.removeAttribute(\"data-loading\");\n }\n }\n function open() {\n if (!pal.hidden) return;\n returnFocus = document.activeElement;\n pal.hidden = false;\n overlay.hidden = false;\n input.value = \"\";\n input.focus();\n search();\n }\n function close() {\n if (pal.hidden) return;\n pal.hidden = true;\n overlay.hidden = true;\n seq++;\n pal.removeAttribute(\"data-loading\");\n if (returnFocus && returnFocus.focus) returnFocus.focus();\n }\n\n document.addEventListener(\"click\", function (ev) {\n if (ev.target && ev.target.closest && ev.target.closest(\"[data-palette]\")) {\n ev.preventDefault();\n open();\n }\n });\n overlay.addEventListener(\"click\", close);\n document.addEventListener(\"keydown\", function (ev) {\n if ((ev.ctrlKey || ev.metaKey) && ev.key.toLowerCase() === \"k\") {\n ev.preventDefault();\n if (pal.hidden) open();\n else close();\n return;\n }\n if (pal.hidden) return;\n if (ev.key === \"Escape\") {\n ev.preventDefault();\n close();\n } else if (ev.key === \"ArrowDown\") {\n ev.preventDefault();\n highlight(index + 1);\n } else if (ev.key === \"ArrowUp\") {\n ev.preventDefault();\n highlight(index - 1);\n } else if (ev.key === \"Enter\" && ev.target === input) {\n const row = items()[index];\n if (row && !pal.hasAttribute(\"data-loading\")) {\n ev.preventDefault();\n location.href = row.getAttribute(\"data-href\");\n }\n }\n });\n input.addEventListener(\"input\", function () {\n clearTimeout(timer);\n pal.setAttribute(\"data-loading\", \"\");\n timer = setTimeout(search, 120);\n });\n}\n\nfunction startLogPanels() {\n const panels = document.querySelectorAll(\"[data-log]\");\n for (let index = 0; index < panels.length; index++) {\n startLogPanel(panels[index]);\n }\n}\n\n// The helper is inlined into `<head>` by `layout.ts`, before any page script\n// runs, so this is the one place that can close over both `toast()` and\n// `bindToggle` without depending on point-in-time globals.\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n // Client errors bubble to `window` from `document`.\n addEventListener(\"error\", function (ev) {\n toast((ev.error && ev.error.message) || \"Something broke\");\n });\n addEventListener(\"unhandledrejection\", function (ev) {\n toast((ev.reason && ev.reason.message) || \"Something broke\");\n });\n\n // Theme: the head bootstrap already applied the remembered choice. This only\n // flips it and stores the new one.\n const themeButton = document.getElementById(\"theme\");\n if (themeButton) {\n themeButton.addEventListener(\"click\", function () {\n const dark = document.documentElement.classList.toggle(\"dark\");\n try {\n localStorage.setItem(\"theme\", dark ? \"dark\" : \"light\");\n } catch {\n // storage may be unavailable. The class still applies for this page\n }\n });\n }\n\n // Mobile drawer. `open` on the aside slides it in. The overlay closes it and\n // choosing a link closes it before navigating.\n const drawer = document.querySelector(\"aside.side\");\n const overlay = document.getElementById(\"overlay\");\n const menuButton = document.getElementById(\"menu\");\n function setDrawer(open) {\n if (drawer) drawer.classList.toggle(\"open\", open);\n if (overlay) overlay.classList.toggle(\"on\", open);\n }\n if (menuButton) {\n menuButton.addEventListener(\"click\", function () {\n setDrawer(!(drawer && drawer.classList.contains(\"open\")));\n });\n }\n if (overlay) {\n overlay.addEventListener(\"click\", function () {\n setDrawer(false);\n });\n }\n if (drawer) {\n drawer.addEventListener(\"click\", function (ev) {\n if (ev.target && ev.target.closest && ev.target.closest(\"a\")) {\n setDrawer(false);\n }\n });\n }\n\n startPalette();\n\n document.addEventListener(\"click\", function (ev) {\n const btn =\n ev.target && ev.target.closest ? ev.target.closest(\"[data-copy]\") : null;\n if (!btn) return;\n const box = btn.closest(\".code\");\n const span = box && box.querySelector(\"span:not(.lbl)\");\n if (!span) return;\n ev.preventDefault();\n copyText(\n span.textContent || \"\",\n function () {\n toast(\"Copied\");\n },\n function () {\n toast(\"Copy failed. Select the text and copy it by hand.\");\n },\n );\n });\n\n document.addEventListener(\"click\", function (ev) {\n const btn =\n ev.target && ev.target.closest\n ? ev.target.closest(\"[data-copy-doc]\")\n : null;\n if (!btn) return;\n ev.preventDefault();\n const id = btn.getAttribute(\"data-copy-doc\");\n const sources = document.querySelectorAll(\"[data-doc-source]\");\n let source = null;\n for (let index = 0; index < sources.length; index++) {\n if (sources[index].getAttribute(\"data-doc-source\") === id) {\n source = sources[index];\n break;\n }\n }\n if (!source) return;\n copyText(\n source.textContent || \"\",\n function () {\n toast(\"Copied\");\n },\n function () {\n toast(\"Copy failed. Select the text and copy it by hand.\");\n },\n );\n });\n\n document.addEventListener(\"click\", function (ev) {\n const btn =\n ev.target && ev.target.closest\n ? ev.target.closest(\"[data-cancel], [data-post]\")\n : null;\n if (!btn) return;\n ev.preventDefault();\n if (btn.hasAttribute(\"data-cancel\")) {\n postAndGo(\n \"/api/jobs/\" + btn.getAttribute(\"data-cancel\") + \"/cancel\",\n {},\n \"/activity\",\n btn,\n );\n return;\n }\n const body = btn.getAttribute(\"data-body\");\n postAndGo(\n btn.getAttribute(\"data-post\"),\n body ? JSON.parse(body) : {},\n \"/activity\",\n btn,\n );\n });\n\n // Reads `activity-root` at call time, so it has to wait for the body even\n // though this file itself is already parsed.\n startLogPanels();\n if (!document.getElementById(\"activity-root\")) return;\n const jobPanel = document.querySelector(\"[data-log]\");\n if (jobPanel) {\n if (jobPanel.getAttribute(\"data-live\") !== \"1\") return;\n const progress = document.querySelector(\"[data-job-progress]\");\n if (!progress) return;\n const refreshError = document.querySelector(\"[data-job-refresh-error]\");\n let refreshing = false;\n const refreshJob = async function () {\n if (document.hidden || refreshing) return;\n refreshing = true;\n try {\n const res = await fetch(location.pathname + location.search, {\n headers: { accept: \"text/html\" },\n cache: \"no-store\",\n });\n if (!res.ok) throw new Error(\"refresh failed\");\n const doc = new DOMParser().parseFromString(\n await res.text(),\n \"text/html\",\n );\n const next = doc.querySelector(\"[data-job-progress]\");\n // A finished job renders its result page, which has no progress\n // block: load it rather than keep the running stages and Stop.\n if (!next) {\n location.reload();\n return;\n }\n progress.innerHTML = next.innerHTML;\n if (refreshError) {\n refreshError.textContent = \"\";\n refreshError.hidden = true;\n }\n } catch {\n if (refreshError) {\n refreshError.textContent =\n \"Connection lost. Could not refresh this job. Reconnecting...\";\n refreshError.hidden = false;\n }\n } finally {\n refreshing = false;\n }\n };\n setInterval(refreshJob, 2000);\n return;\n }\n setInterval(async function () {\n if (document.hidden) return;\n if (document.querySelector(\"[data-async].busy\")) return;\n const root = document.getElementById(\"activity-root\");\n if (!root) return;\n try {\n const res = await fetch(location.pathname + location.search, {\n headers: { accept: \"text/html\" },\n });\n if (!res.ok) return;\n const doc = new DOMParser().parseFromString(\n await res.text(),\n \"text/html\",\n );\n const next = doc.getElementById(\"activity-root\");\n if (!next || next.innerHTML === root.innerHTML) return;\n root.replaceWith(next);\n } catch {\n // a failed poll just waits for the next tick\n }\n }, 5000);\n});\n";
|
|
@@ -21,7 +21,7 @@ export declare function renderHome(username: string, rows: {
|
|
|
21
21
|
failed: number;
|
|
22
22
|
cost: string;
|
|
23
23
|
}[], checklist: SetupItem[],
|
|
24
|
-
/** `rows` is already filtered
|
|
24
|
+
/** `rows` is already filtered, `total` and `reviewing` count every
|
|
25
25
|
* repository so the lead and the tabs do not shrink with the filter. */
|
|
26
26
|
filter: {
|
|
27
27
|
q: string;
|
|
@@ -40,7 +40,7 @@ export function renderLogin(opts) {
|
|
|
40
40
|
}));
|
|
41
41
|
}
|
|
42
42
|
export function renderHome(username, rows, checklist,
|
|
43
|
-
/** `rows` is already filtered
|
|
43
|
+
/** `rows` is already filtered, `total` and `reviewing` count every
|
|
44
44
|
* repository so the lead and the tabs do not shrink with the filter. */
|
|
45
45
|
filter) {
|
|
46
46
|
const lead = filter.total === 0
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** Generated from src/server/pages/icons/*.svg by scripts/embed_assets.mjs
|
|
1
|
+
/** Generated from src/server/pages/icons/*.svg by scripts/embed_assets.mjs, do not edit. */
|
|
2
2
|
export declare const iconNames: readonly string[];
|
|
3
3
|
export declare const sprite = "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"position:absolute;width:0;height:0;overflow:hidden\" aria-hidden=\"true\"><symbol id=\"i-activity\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" /></symbol><symbol id=\"i-arrow-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" /></symbol><symbol id=\"i-book-open\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 5v16\" />\n <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" /></symbol><symbol id=\"i-calendar-clock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" /></symbol><symbol id=\"i-chart-no-axes-column\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" /></symbol><symbol id=\"i-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\" /></symbol><symbol id=\"i-chevron-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m9 18 6-6-6-6\" /></symbol><symbol id=\"i-circle\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" /></symbol><symbol id=\"i-circle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" /></symbol><symbol id=\"i-circle-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" /></symbol><symbol id=\"i-circle-pause\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"10\" x2=\"10\" y1=\"15\" y2=\"9\" />\n <line x1=\"14\" x2=\"14\" y1=\"15\" y2=\"9\" /></symbol><symbol id=\"i-circle-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" /></symbol><symbol id=\"i-coins\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13.744 17.736a6 6 0 1 1-7.48-7.48\" />\n <path d=\"M15 6h1v4\" />\n <path d=\"m6.134 14.768.866-.5 2 3.464\" />\n <circle cx=\"16\" cy=\"8\" r=\"6\" /></symbol><symbol id=\"i-copy\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" /></symbol><symbol id=\"i-cpu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 20v2\" />\n <path d=\"M12 2v2\" />\n <path d=\"M17 20v2\" />\n <path d=\"M17 2v2\" />\n <path d=\"M2 12h2\" />\n <path d=\"M2 17h2\" />\n <path d=\"M2 7h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"M20 17h2\" />\n <path d=\"M20 7h2\" />\n <path d=\"M7 20v2\" />\n <path d=\"M7 2v2\" />\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <rect x=\"8\" y=\"8\" width=\"8\" height=\"8\" rx=\"1\" /></symbol><symbol id=\"i-download\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" /></symbol><symbol id=\"i-external-link\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" /></symbol><symbol id=\"i-file-pen\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z\" /></symbol><symbol id=\"i-flag\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528\" /></symbol><symbol id=\"i-flask-conical\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\" />\n <path d=\"M6.453 15h11.094\" />\n <path d=\"M8.5 2h7\" /></symbol><symbol id=\"i-git-branch\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 6a9 9 0 0 0-9 9V3\" />\n <circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" /></symbol><symbol id=\"i-git-pull-request\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M13 6h3a2 2 0 0 1 2 2v7\" />\n <line x1=\"6\" x2=\"6\" y1=\"9\" y2=\"21\" /></symbol><symbol id=\"i-git-pull-request-arrow\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"5\" cy=\"6\" r=\"3\" />\n <path d=\"M5 9v12\" />\n <circle cx=\"19\" cy=\"18\" r=\"3\" />\n <path d=\"m15 9-3-3 3-3\" />\n <path d=\"M12 6h5a2 2 0 0 1 2 2v7\" /></symbol><symbol id=\"i-github\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\" />\n <path d=\"M9 18c-4.51 2-5-2-7-2\" /></symbol><symbol id=\"i-history\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" /></symbol><symbol id=\"i-inbox\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" /></symbol><symbol id=\"i-info\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" /></symbol><symbol id=\"i-key-round\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\" />\n <circle cx=\"16.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" /></symbol><symbol id=\"i-laptop\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z\" />\n <path d=\"M20.054 15.987H3.946\" /></symbol><symbol id=\"i-layers\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" /></symbol><symbol id=\"i-layout-grid\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" /></symbol><symbol id=\"i-list\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 5h.01\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M3 19h.01\" />\n <path d=\"M8 5h13\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 19h13\" /></symbol><symbol id=\"i-list-checks\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13 5h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 19h8\" />\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" /></symbol><symbol id=\"i-list-ordered\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11 5h10\" />\n <path d=\"M11 12h10\" />\n <path d=\"M11 19h10\" />\n <path d=\"M4 4h1v5\" />\n <path d=\"M4 9h2\" />\n <path d=\"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02\" /></symbol><symbol id=\"i-loader\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2v4\" />\n <path d=\"m16.2 7.8 2.9-2.9\" />\n <path d=\"M18 12h4\" />\n <path d=\"m16.2 16.2 2.9 2.9\" />\n <path d=\"M12 18v4\" />\n <path d=\"m4.9 19.1 2.9-2.9\" />\n <path d=\"M2 12h4\" />\n <path d=\"m4.9 4.9 2.9 2.9\" /></symbol><symbol id=\"i-lock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" /></symbol><symbol id=\"i-log-out\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" /></symbol><symbol id=\"i-menu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 5h16\" />\n <path d=\"M4 12h16\" />\n <path d=\"M4 19h16\" /></symbol><symbol id=\"i-message-square-text\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M7 11h10\" />\n <path d=\"M7 15h6\" />\n <path d=\"M7 7h8\" /></symbol><symbol id=\"i-moon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\" /></symbol><symbol id=\"i-octagon-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 16h.01\" />\n <path d=\"M12 8v4\" />\n <path d=\"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z\" /></symbol><symbol id=\"i-plus\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" /></symbol><symbol id=\"i-refresh-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" /></symbol><symbol id=\"i-rotate-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" /></symbol><symbol id=\"i-search\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21 21-4.34-4.34\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" /></symbol><symbol id=\"i-search-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m13.5 8.5-5 5\" />\n <path d=\"m8.5 8.5 5 5\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" /></symbol><symbol id=\"i-server\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" /></symbol><symbol id=\"i-settings-2\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 17H5\" />\n <path d=\"M19 7h-9\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" /></symbol><symbol id=\"i-shield-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" /></symbol><symbol id=\"i-sliders-horizontal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" /></symbol><symbol id=\"i-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" /></symbol><symbol id=\"i-square\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" /></symbol><symbol id=\"i-terminal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" /></symbol><symbol id=\"i-timer\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" /></symbol><symbol id=\"i-triangle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" /></symbol><symbol id=\"i-users\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" /></symbol><symbol id=\"i-wallet\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\" />\n <path d=\"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\" /></symbol><symbol id=\"i-wand-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\" />\n <path d=\"m14 7 3 3\" />\n <path d=\"M5 6v4\" />\n <path d=\"M19 14v4\" />\n <path d=\"M10 2v2\" />\n <path d=\"M7 8H3\" />\n <path d=\"M21 16h-4\" />\n <path d=\"M11 3H9\" /></symbol><symbol id=\"i-webhook\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" /></symbol></svg>";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/** Generated from src/server/pages/icons/*.svg by scripts/embed_assets.mjs
|
|
1
|
+
/** Generated from src/server/pages/icons/*.svg by scripts/embed_assets.mjs, do not edit. */
|
|
2
2
|
export const iconNames = JSON.parse("[\"activity\",\"arrow-right\",\"book-open\",\"calendar-clock\",\"chart-no-axes-column\",\"check\",\"chevron-right\",\"circle\",\"circle-alert\",\"circle-check\",\"circle-pause\",\"circle-x\",\"coins\",\"copy\",\"cpu\",\"download\",\"external-link\",\"file-pen\",\"flag\",\"flask-conical\",\"git-branch\",\"git-pull-request\",\"git-pull-request-arrow\",\"github\",\"history\",\"inbox\",\"info\",\"key-round\",\"laptop\",\"layers\",\"layout-grid\",\"list\",\"list-checks\",\"list-ordered\",\"loader\",\"lock\",\"log-out\",\"menu\",\"message-square-text\",\"moon\",\"octagon-alert\",\"plus\",\"refresh-cw\",\"rotate-cw\",\"search\",\"search-x\",\"server\",\"settings-2\",\"shield-check\",\"sliders-horizontal\",\"sparkles\",\"square\",\"terminal\",\"timer\",\"triangle-alert\",\"users\",\"wallet\",\"wand-sparkles\",\"webhook\"]");
|
|
3
3
|
export const sprite = "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"position:absolute;width:0;height:0;overflow:hidden\" aria-hidden=\"true\"><symbol id=\"i-activity\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" /></symbol><symbol id=\"i-arrow-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" /></symbol><symbol id=\"i-book-open\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 5v16\" />\n <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" /></symbol><symbol id=\"i-calendar-clock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" /></symbol><symbol id=\"i-chart-no-axes-column\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" /></symbol><symbol id=\"i-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\" /></symbol><symbol id=\"i-chevron-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m9 18 6-6-6-6\" /></symbol><symbol id=\"i-circle\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" /></symbol><symbol id=\"i-circle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" /></symbol><symbol id=\"i-circle-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" /></symbol><symbol id=\"i-circle-pause\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"10\" x2=\"10\" y1=\"15\" y2=\"9\" />\n <line x1=\"14\" x2=\"14\" y1=\"15\" y2=\"9\" /></symbol><symbol id=\"i-circle-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" /></symbol><symbol id=\"i-coins\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13.744 17.736a6 6 0 1 1-7.48-7.48\" />\n <path d=\"M15 6h1v4\" />\n <path d=\"m6.134 14.768.866-.5 2 3.464\" />\n <circle cx=\"16\" cy=\"8\" r=\"6\" /></symbol><symbol id=\"i-copy\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" /></symbol><symbol id=\"i-cpu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 20v2\" />\n <path d=\"M12 2v2\" />\n <path d=\"M17 20v2\" />\n <path d=\"M17 2v2\" />\n <path d=\"M2 12h2\" />\n <path d=\"M2 17h2\" />\n <path d=\"M2 7h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"M20 17h2\" />\n <path d=\"M20 7h2\" />\n <path d=\"M7 20v2\" />\n <path d=\"M7 2v2\" />\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <rect x=\"8\" y=\"8\" width=\"8\" height=\"8\" rx=\"1\" /></symbol><symbol id=\"i-download\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" /></symbol><symbol id=\"i-external-link\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" /></symbol><symbol id=\"i-file-pen\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z\" /></symbol><symbol id=\"i-flag\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528\" /></symbol><symbol id=\"i-flask-conical\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\" />\n <path d=\"M6.453 15h11.094\" />\n <path d=\"M8.5 2h7\" /></symbol><symbol id=\"i-git-branch\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 6a9 9 0 0 0-9 9V3\" />\n <circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" /></symbol><symbol id=\"i-git-pull-request\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M13 6h3a2 2 0 0 1 2 2v7\" />\n <line x1=\"6\" x2=\"6\" y1=\"9\" y2=\"21\" /></symbol><symbol id=\"i-git-pull-request-arrow\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"5\" cy=\"6\" r=\"3\" />\n <path d=\"M5 9v12\" />\n <circle cx=\"19\" cy=\"18\" r=\"3\" />\n <path d=\"m15 9-3-3 3-3\" />\n <path d=\"M12 6h5a2 2 0 0 1 2 2v7\" /></symbol><symbol id=\"i-github\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\" />\n <path d=\"M9 18c-4.51 2-5-2-7-2\" /></symbol><symbol id=\"i-history\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" /></symbol><symbol id=\"i-inbox\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" /></symbol><symbol id=\"i-info\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" /></symbol><symbol id=\"i-key-round\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\" />\n <circle cx=\"16.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" /></symbol><symbol id=\"i-laptop\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z\" />\n <path d=\"M20.054 15.987H3.946\" /></symbol><symbol id=\"i-layers\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" /></symbol><symbol id=\"i-layout-grid\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" /></symbol><symbol id=\"i-list\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 5h.01\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M3 19h.01\" />\n <path d=\"M8 5h13\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 19h13\" /></symbol><symbol id=\"i-list-checks\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13 5h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 19h8\" />\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" /></symbol><symbol id=\"i-list-ordered\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11 5h10\" />\n <path d=\"M11 12h10\" />\n <path d=\"M11 19h10\" />\n <path d=\"M4 4h1v5\" />\n <path d=\"M4 9h2\" />\n <path d=\"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02\" /></symbol><symbol id=\"i-loader\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2v4\" />\n <path d=\"m16.2 7.8 2.9-2.9\" />\n <path d=\"M18 12h4\" />\n <path d=\"m16.2 16.2 2.9 2.9\" />\n <path d=\"M12 18v4\" />\n <path d=\"m4.9 19.1 2.9-2.9\" />\n <path d=\"M2 12h4\" />\n <path d=\"m4.9 4.9 2.9 2.9\" /></symbol><symbol id=\"i-lock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" /></symbol><symbol id=\"i-log-out\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" /></symbol><symbol id=\"i-menu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 5h16\" />\n <path d=\"M4 12h16\" />\n <path d=\"M4 19h16\" /></symbol><symbol id=\"i-message-square-text\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M7 11h10\" />\n <path d=\"M7 15h6\" />\n <path d=\"M7 7h8\" /></symbol><symbol id=\"i-moon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\" /></symbol><symbol id=\"i-octagon-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 16h.01\" />\n <path d=\"M12 8v4\" />\n <path d=\"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z\" /></symbol><symbol id=\"i-plus\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" /></symbol><symbol id=\"i-refresh-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" /></symbol><symbol id=\"i-rotate-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" /></symbol><symbol id=\"i-search\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21 21-4.34-4.34\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" /></symbol><symbol id=\"i-search-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m13.5 8.5-5 5\" />\n <path d=\"m8.5 8.5 5 5\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" /></symbol><symbol id=\"i-server\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" /></symbol><symbol id=\"i-settings-2\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 17H5\" />\n <path d=\"M19 7h-9\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" /></symbol><symbol id=\"i-shield-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" /></symbol><symbol id=\"i-sliders-horizontal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" /></symbol><symbol id=\"i-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" /></symbol><symbol id=\"i-square\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" /></symbol><symbol id=\"i-terminal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" /></symbol><symbol id=\"i-timer\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" /></symbol><symbol id=\"i-triangle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" /></symbol><symbol id=\"i-users\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" /></symbol><symbol id=\"i-wallet\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\" />\n <path d=\"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\" /></symbol><symbol id=\"i-wand-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\" />\n <path d=\"m14 7 3 3\" />\n <path d=\"M5 6v4\" />\n <path d=\"M19 14v4\" />\n <path d=\"M10 2v2\" />\n <path d=\"M7 8H3\" />\n <path d=\"M21 16h-4\" />\n <path d=\"M11 3H9\" /></symbol><symbol id=\"i-webhook\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" /></symbol></svg>";
|
|
@@ -23,7 +23,7 @@ export declare function when(iso: string | null | undefined): string;
|
|
|
23
23
|
export declare function skSlot(kind?: "table" | "block"): string;
|
|
24
24
|
export declare function setNavSource(source: (() => NavCounts) | undefined): void;
|
|
25
25
|
/** The shared shell: left menu, sidefoot user/theme/sign out, mobile topbar and
|
|
26
|
-
* overlay. `active` is the href of the nav item to mark
|
|
26
|
+
* overlay. `active` is the href of the nav item to mark. Pages under Reviews
|
|
27
27
|
* pass `/`. */
|
|
28
28
|
export declare function layout(opts: {
|
|
29
29
|
title: string;
|
|
@@ -42,7 +42,7 @@ export declare function layoutFocus(opts: {
|
|
|
42
42
|
export declare function notFound(username: string, message: string, active?: string): Response;
|
|
43
43
|
export declare function html(body: string, status?: number): Response;
|
|
44
44
|
/** The repository tabs shared by every repo page. They replace the old second
|
|
45
|
-
* sidebar
|
|
45
|
+
* sidebar. The shell owns the only left menu. */
|
|
46
46
|
export declare function repoTabs(fullName: string, on: string): string;
|
|
47
47
|
export declare function empty(title: string, lead: string): string;
|
|
48
48
|
export declare function statusClass(kind: "ok" | "warn" | "err" | "run", label: string): string;
|
|
@@ -219,7 +219,7 @@ const NAV_GROUPS = [
|
|
|
219
219
|
],
|
|
220
220
|
},
|
|
221
221
|
];
|
|
222
|
-
/** Where the menu badges come from. `createApp` registers the real counts
|
|
222
|
+
/** Where the menu badges come from. `createApp` registers the real counts,
|
|
223
223
|
* a page rendered without an app (a unit test of one renderer) has none and
|
|
224
224
|
* shows no badges. */
|
|
225
225
|
let navSource;
|
|
@@ -263,7 +263,7 @@ const PALETTE = `<div class="pal-ov" id="pal-ov" hidden></div>
|
|
|
263
263
|
<div class="list" id="pal-list" role="listbox" aria-label="Results"></div>
|
|
264
264
|
</div>`;
|
|
265
265
|
/** The shared shell: left menu, sidefoot user/theme/sign out, mobile topbar and
|
|
266
|
-
* overlay. `active` is the href of the nav item to mark
|
|
266
|
+
* overlay. `active` is the href of the nav item to mark. Pages under Reviews
|
|
267
267
|
* pass `/`. */
|
|
268
268
|
export function layout(opts) {
|
|
269
269
|
const username = opts.username;
|
|
@@ -327,7 +327,7 @@ export function html(body, status = 200) {
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
/** The repository tabs shared by every repo page. They replace the old second
|
|
330
|
-
* sidebar
|
|
330
|
+
* sidebar. The shell owns the only left menu. */
|
|
331
331
|
export function repoTabs(fullName, on) {
|
|
332
332
|
const href = `/repos/${fullName}`;
|
|
333
333
|
const items = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { empty, html, layout, markdown, repoTabs, skSlot, text, when, } from "./layout.js";
|
|
2
2
|
import { formatCost, formatCostTotal, totalOfRows } from "./cost.js";
|
|
3
3
|
import { extensionCostNote, renderExtensionResults } from "./extensions.js";
|
|
4
|
+
import { referencesHtml } from "./references.js";
|
|
4
5
|
export function renderPr(username, fullName, data) {
|
|
5
6
|
const n = data.prNumber;
|
|
6
7
|
const totalCost = totalOfRows(data.reviews);
|
|
@@ -22,6 +23,7 @@ export function renderPr(username, fullName, data) {
|
|
|
22
23
|
items: findings.filter((f) => (f.state ?? "new") === state),
|
|
23
24
|
}))
|
|
24
25
|
.filter((group) => group.items.length > 0);
|
|
26
|
+
// punctuation: code, a CSS declaration list inside an inline style
|
|
25
27
|
return groups
|
|
26
28
|
.map((group) => `<div style="margin-bottom:20px">
|
|
27
29
|
<div class="muted" style="font-size:13px;font-weight:600;margin-bottom:10px;text-transform:uppercase;letter-spacing:.04em">${text(stateLabel(group.state))}</div>
|
|
@@ -34,11 +36,13 @@ export function renderPr(username, fullName, data) {
|
|
|
34
36
|
: ""}</div>
|
|
35
37
|
<div class="mono muted" style="font-size:13px;margin-bottom:8px">${text(finding.path ? `${finding.path}:${finding.line_from ?? ""}` : "")}</div>
|
|
36
38
|
${markdown(finding.body_md)}
|
|
39
|
+
${referencesHtml(finding.references_json)}
|
|
37
40
|
</div>`)
|
|
38
41
|
.join("")}
|
|
39
42
|
</div>`)
|
|
40
43
|
.join("");
|
|
41
44
|
};
|
|
45
|
+
// punctuation: code, a CSS declaration list inside an inline style
|
|
42
46
|
const findingsBlock = data.reviews.length === 0
|
|
43
47
|
? empty("No findings", "Run a review to post findings on this pull request.")
|
|
44
48
|
: data.reviews
|
|
@@ -35,9 +35,9 @@ function groupSentence(group) {
|
|
|
35
35
|
const times = count === 1 ? "once" : count === 2 ? "twice" : `${count} times`;
|
|
36
36
|
if (group.durations.length === 1) {
|
|
37
37
|
const each = count === 1 ? "" : " each time";
|
|
38
|
-
return `${label} asked to slow down ${times}
|
|
38
|
+
return `${label} asked to slow down ${times}, waited ${secondsLabel(group.durations[0])}${each}`;
|
|
39
39
|
}
|
|
40
|
-
return `${label} asked to slow down ${times}
|
|
40
|
+
return `${label} asked to slow down ${times}, waited ${joinList(group.durations.map(secondsLabel))}`;
|
|
41
41
|
}
|
|
42
42
|
export function rateLimitWaitSummaryLine(summary) {
|
|
43
43
|
const waits = `${summary.count} wait${summary.count === 1 ? "" : "s"}`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** A finding's references on the dashboard: the same collapsed list a review
|
|
2
|
+
* comment shows when the repository turns references on, shown here always. */
|
|
3
|
+
import { parseStoredReferences, } from "../../review/references.js";
|
|
4
|
+
import { text } from "./layout.js";
|
|
5
|
+
/** Only GitHub links are made clickable. Anything else is plain text. */
|
|
6
|
+
function linked(label, url) {
|
|
7
|
+
return url && url.startsWith("https://github.com/")
|
|
8
|
+
? `<a href="${text(url)}" target="_blank" rel="noopener noreferrer">${text(label)}</a>`
|
|
9
|
+
: text(label);
|
|
10
|
+
}
|
|
11
|
+
function sourceLinks(sources) {
|
|
12
|
+
return sources
|
|
13
|
+
.map((source) => "pr" in source
|
|
14
|
+
? linked(`#${source.pr}`, source.url)
|
|
15
|
+
: linked(`${source.path}:${source.line}`, source.url))
|
|
16
|
+
.join(", ");
|
|
17
|
+
}
|
|
18
|
+
function referenceItem(reference) {
|
|
19
|
+
switch (reference.kind) {
|
|
20
|
+
case "system":
|
|
21
|
+
return text("System Prompt");
|
|
22
|
+
case "codebase":
|
|
23
|
+
return text(reference.section ? `Codebase · ${reference.section}` : "Codebase");
|
|
24
|
+
case "rule": {
|
|
25
|
+
const newest = reference.sources
|
|
26
|
+
.flatMap((source) => "pr" in source && source.mergedAt ? [source.mergedAt] : [])
|
|
27
|
+
.sort()
|
|
28
|
+
.at(-1)
|
|
29
|
+
?.slice(0, 7);
|
|
30
|
+
return [
|
|
31
|
+
text(`Rules-${reference.id.slice(1)}`),
|
|
32
|
+
sourceLinks(reference.sources),
|
|
33
|
+
newest ? text(newest) : "",
|
|
34
|
+
]
|
|
35
|
+
.filter(Boolean)
|
|
36
|
+
.join(" · ");
|
|
37
|
+
}
|
|
38
|
+
case "instruction":
|
|
39
|
+
return [
|
|
40
|
+
text(`Instructions-${reference.id.slice(1)}`),
|
|
41
|
+
sourceLinks(reference.sources),
|
|
42
|
+
]
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(" · ");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** The collapsed block, or `""` for a finding stored before references. */
|
|
48
|
+
export function referencesHtml(stored) {
|
|
49
|
+
const references = parseStoredReferences(stored);
|
|
50
|
+
if (references.length === 0)
|
|
51
|
+
return "";
|
|
52
|
+
return `<details style="margin-top:8px"><summary class="muted" style="font-size:13px;cursor:pointer">${text(`References (${references.length})`)}</summary><ul style="margin:6px 0 0 18px;font-size:13px">${references
|
|
53
|
+
.map((reference) => `<li>${referenceItem(reference)}</li>`)
|
|
54
|
+
.join("")}</ul></details>`;
|
|
55
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { capped, empty, html, layout, repoTabs, skSlot, text, when, } from "./layout.js";
|
|
2
|
+
import { contradictionLine } from "../../knowledge/rule_changes.js";
|
|
2
3
|
import { badge, crumb, dl, icon, pageHeader, section, statCard, } from "./ui.js";
|
|
3
4
|
import { formatCostTotal } from "./cost.js";
|
|
4
5
|
import { COMPARE_FILE_CAP, MAX_COMMITS_COUNTED } from "../../services/drift.js";
|
|
@@ -136,6 +137,7 @@ commitWatch = "") {
|
|
|
136
137
|
action: `<a class="btn gh sm" href="/repos/${text(name)}/settings">Change</a>`,
|
|
137
138
|
})}</div>
|
|
138
139
|
</div>
|
|
140
|
+
${ruleEventsCard(data.ruleEvents)}
|
|
139
141
|
${commitWatch}
|
|
140
142
|
</div>
|
|
141
143
|
<script>
|
|
@@ -147,3 +149,27 @@ if (remake) remake.addEventListener("click", function() {
|
|
|
147
149
|
</script>`,
|
|
148
150
|
}));
|
|
149
151
|
}
|
|
152
|
+
/** Guide rules a newer rule went against, newest first, from `sync`. Left
|
|
153
|
+
* out when there are none. */
|
|
154
|
+
function ruleEventsCard(events) {
|
|
155
|
+
if (events.length === 0)
|
|
156
|
+
return "";
|
|
157
|
+
const items = events.map((event) => {
|
|
158
|
+
let detail = {};
|
|
159
|
+
try {
|
|
160
|
+
detail = JSON.parse(event.detail_json);
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
// A bad row still shows its ids.
|
|
164
|
+
}
|
|
165
|
+
const line = contradictionLine({
|
|
166
|
+
id: event.rule_id,
|
|
167
|
+
by: event.by_rule_id ?? "",
|
|
168
|
+
sources: Array.isArray(detail.sources) ? detail.sources : [],
|
|
169
|
+
newest: typeof detail.newest === "string" ? detail.newest : "",
|
|
170
|
+
dropped: detail.dropped === true,
|
|
171
|
+
});
|
|
172
|
+
return `<li>${text(line)} <span class="muted" style="font-size:13px">${when(event.at)}</span></li>`;
|
|
173
|
+
});
|
|
174
|
+
return `<div class="card">${section(`<ul style="margin:0 0 0 18px">${items.join("")}</ul>`, { title: "Guide rules that changed direction" })}</div>`;
|
|
175
|
+
}
|
|
@@ -193,6 +193,7 @@ export function renderRepoSettings(username, repo, config, probeReport) {
|
|
|
193
193
|
title: `Settings · ${name}`,
|
|
194
194
|
username,
|
|
195
195
|
active: "/",
|
|
196
|
+
// punctuation: code, a script the page runs in the browser
|
|
196
197
|
body: `<div class="wrap">
|
|
197
198
|
${repoTabs(name, "settings")}
|
|
198
199
|
<div>
|
|
@@ -229,6 +229,7 @@ export async function handlePageRequest(request, deps, ip) {
|
|
|
229
229
|
status: 200,
|
|
230
230
|
headers: {
|
|
231
231
|
"content-type": "text/markdown; charset=utf-8",
|
|
232
|
+
// punctuation: code, the Content-Disposition header separates its parts with a semicolon
|
|
232
233
|
"content-disposition": `attachment; filename="${doc.file}"`,
|
|
233
234
|
},
|
|
234
235
|
});
|
|
@@ -353,7 +354,7 @@ async function sessionOf(request) {
|
|
|
353
354
|
function safeNext(value) {
|
|
354
355
|
// A path-only redirect. It must start with a single "/", and may not hold a
|
|
355
356
|
// backslash (browsers read "/\host" as "//host") or a control character (a
|
|
356
|
-
// tab or newline is stripped, turning "/\t/host" into "//host")
|
|
357
|
+
// tab or newline is stripped, turning "/\t/host" into "//host"), both would
|
|
357
358
|
// send the browser to another origin.
|
|
358
359
|
if (!value || !value.startsWith("/") || value.startsWith("//"))
|
|
359
360
|
return "/";
|
|
@@ -486,7 +487,7 @@ async function handleLoginForm(request, deps, ip, auth) {
|
|
|
486
487
|
});
|
|
487
488
|
}
|
|
488
489
|
/** `state` round-trips through an HttpOnly cookie set by `/auth/github`
|
|
489
|
-
* (see `oauthStateCookieHeader`), not server memory
|
|
490
|
+
* (see `oauthStateCookieHeader`), not server memory, comparing it against
|
|
490
491
|
* the query param is what stops a forged callback from creating a session. */
|
|
491
492
|
async function handleGithubCallback(request, url, githubOAuth, deps) {
|
|
492
493
|
const clearState = clearOauthStateCookieHeader(Boolean(deps.secureCookie));
|