The Firewall page becomes Controls with three tabs: Tools lists every MCP server, plugin and feature switch of ~/.claude/settings.json with each other settings file that sets it differently, Rules keeps the settings lists and the hub rule form, Groups the groups and sets. A flip stages a change in one shared Apply bar; Apply shows the diff and signs it with the passkey as before. The signer writes deniedMcpServers rules, enabledPlugins entries and switches only in the own file and refuses wrong types and no-op flips; switching, the capability views and the per-item checks are one function each. 🎯 Fix: 88 % 💥 Break: 6 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 83 🚦 Gate: ⛔ fix 88 % < 90, break 6 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
74 lines
3.7 KiB
JavaScript
74 lines
3.7 KiB
JavaScript
const Nav = (() => {
|
|
"use strict";
|
|
const TABS = [["home", "Home"], ["stream", "Stream"], ["agents", "Agents"], ["artifacts", "Artifacts"], ["tasks", "Tasks"], ["resources", "Resources"]];
|
|
const SUBS = {stream: [["rules", "Controls"]]};
|
|
const PANES = {inbox: ["tasks", "operator"], match: ["tasks", "match"]};
|
|
const VIEWS = [["orbit", "Orbit"], ["chord", "Chord"], ["swimlane", "Swimlane"], ["tree", "Tree"], ["3d", "3D"]];
|
|
const TASK_VIEWS = [["list", "List"], ["board", "Board"], ["rasci", "RASCI"], ["gantt", "Gantt"], ["burn", "Burndown and burnup"], ["3d", "3D"]];
|
|
const OWN = {agents: [["hierarchy", "Hierarchy"]]};
|
|
const ICONS = {
|
|
home: "bi-house-door", stream: "bi-activity", inbox: "bi-inbox", rules: "bi-card-checklist", agents: "bi-people", artifacts: "bi-git", tasks: "bi-list-check",
|
|
orbit: "bi-globe2", chord: "bi-bezier2", swimlane: "bi-bar-chart-steps", tree: "bi-diagram-3", "3d": "bi-badge-3d", hierarchy: "bi-diagram-2",
|
|
list: "bi-list-task", board: "bi-kanban", rasci: "bi-grid-3x3", gantt: "bi-calendar-range", burn: "bi-graph-down-arrow",
|
|
resources: "bi-speedometer2", match: "bi-stack",
|
|
};
|
|
const OLD = {graph: ["agents", "orbit"], tree: ["artifacts", "tree"]};
|
|
const viewsOf = (screen) => (screen === "tasks" ? TASK_VIEWS : [...VIEWS, ...(OWN[screen] || [])]);
|
|
const known = (screen, view) => viewsOf(screen).some(([id]) => id === view);
|
|
|
|
function tabOf(screen) {
|
|
return Object.hasOwn(PANES, screen) ? PANES[screen][0] : Object.keys(SUBS).find((tab) => SUBS[tab].some(([id]) => id === screen)) || screen;
|
|
}
|
|
|
|
function hashOf(screen, view) {
|
|
if (Object.hasOwn(PANES, screen)) {
|
|
return `#${PANES[screen].join("/")}`;
|
|
}
|
|
return tabOf(screen) === screen ? (view ? `#${screen}/${view}` : `#${screen}`) : `#${tabOf(screen)}/${screen}`;
|
|
}
|
|
|
|
/**
|
|
* @param hash - the location hash, optionally ending in ?open=<kind>:<id>, a Home pin key the screen opens.
|
|
* @param pinned - how many pins Home holds; an empty hash opens Home once it holds one, else Stream.
|
|
* @returns {screen, view, redirect, spot}, plus open, the pin key, when the hash names one; a hash with open
|
|
* redirects to itself without it.
|
|
*/
|
|
function route(hash, pinned) {
|
|
const [path, query] = String(hash).replace(/^#/, "").split("?");
|
|
const found = place(path, pinned);
|
|
const open = new URLSearchParams(query || "").get("open");
|
|
return open ? {...found, open, redirect: found.redirect || `#${path}`} : found;
|
|
}
|
|
|
|
function place(path, pinned) {
|
|
const [head, sub] = decodeURIComponent(path).split("/");
|
|
if (!head && pinned > 0) {
|
|
return {screen: "home", view: null, redirect: "#home"};
|
|
}
|
|
if (head === "stream" && sub === "radio") {
|
|
return {screen: "stream", view: null, redirect: "#stream", spot: true};
|
|
}
|
|
const pane = Object.keys(PANES).find((screen) => PANES[screen][0] === head && PANES[screen][1] === sub);
|
|
if (pane || (head === "stream" && sub === "inbox")) {
|
|
return {screen: pane || "inbox", view: null, redirect: pane ? null : hashOf("inbox", null)};
|
|
}
|
|
if (Object.hasOwn(OLD, head)) {
|
|
const [screen, fallback] = OLD[head];
|
|
const view = known(screen, sub) ? sub : fallback;
|
|
return {screen, view, redirect: hashOf(screen, view)};
|
|
}
|
|
if (Object.hasOwn(SUBS, head) && SUBS[head].some(([id]) => id === sub)) {
|
|
return {screen: sub, view: null, redirect: null};
|
|
}
|
|
if (TABS.some(([id]) => id === head) && head !== "stream") {
|
|
return {screen: head, view: known(head, sub) ? sub : null, redirect: null};
|
|
}
|
|
return {screen: "stream", view: null, redirect: null};
|
|
}
|
|
|
|
return {TABS, SUBS, PANES, VIEWS, TASK_VIEWS, ICONS, viewsOf, route, hashOf, tabOf};
|
|
})();
|
|
if (typeof module === "object" && module.exports) {
|
|
module.exports = Nav;
|
|
}
|