Files
cleveragents-core/docs/javascripts/adr-page.js
T
HAL9000 18d00c04c4
CI / lint (pull_request) Failing after 1m15s
CI / quality (pull_request) Successful in 1m21s
CI / typecheck (pull_request) Successful in 1m34s
CI / security (pull_request) Successful in 1m37s
CI / coverage (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 1m37s
CI / docker (pull_request) Has been skipped
CI / build (pull_request) Successful in 33s
CI / helm (pull_request) Successful in 26s
CI / push-validation (pull_request) Successful in 19s
CI / e2e_tests (pull_request) Successful in 3m20s
CI / integration_tests (pull_request) Successful in 4m32s
CI / status-check (pull_request) Failing after 3s
fix(skills): implement multi-scope agent skill discovery for global, project, and local tiers
Implements AgentSkillDiscovery class to support discovering Agent Skills from
multiple configured directories across three scopes (global, project, local).
Handles name collisions with precedence: local > project > global.

Adds comprehensive BDD test coverage for multi-scope discovery scenarios including:
- Global-only, project-only, and local-only discovery
- Combined discovery from all scopes
- Name collision resolution with proper precedence
- Non-existent and empty scope directory handling
- Multiple skills in same scope discovery

ISSUES CLOSED: #9369
2026-05-06 19:55:22 +00:00

85 lines
2.5 KiB
JavaScript

/**
* ADR Page — timeline placement
*
* On ADR pages the build hook embeds a hidden `.adr-timeline` element in the
* page content.
*
* Desktop (>= 76.25em) — move the timeline into the left sidebar, replacing
* the integrated Table of Contents.
* Mobile (< 76.25em) — leave the navigation drawer alone; instead show
* the timeline at the end of the article body.
*
* Compatible with Material for MkDocs instant-loading (SPA navigation).
*/
var _adrDesktopQuery = window.matchMedia("(min-width: 76.25em)");
document$.subscribe(function () {
var timeline = document.querySelector(".md-content .adr-timeline");
if (!timeline) {
// Not an ADR page — clean up any leftover state from a previous page.
document.body.classList.remove("adr-page");
return;
}
document.body.classList.add("adr-page");
if (_adrDesktopQuery.matches) {
_placeInSidebar(timeline);
} else {
_placeInContent(timeline);
}
});
/* ── Desktop: replace the sidebar TOC with the timeline ──────────────── */
function _placeInSidebar(timeline) {
var sidebarInner = document.querySelector(
".md-sidebar--primary .md-sidebar__inner"
);
if (!sidebarInner) return;
var nav = document.createElement("nav");
nav.className = "md-nav md-nav--primary adr-sidebar-timeline";
nav.setAttribute("data-md-level", "0");
var title = document.createElement("label");
title.className = "md-nav__title adr-timeline-title";
title.textContent = "Status History";
var clone = timeline.cloneNode(true);
clone.style.display = "";
nav.appendChild(title);
nav.appendChild(clone);
sidebarInner.innerHTML = "";
sidebarInner.appendChild(nav);
// Remove the hidden source element from the content area.
timeline.parentNode.removeChild(timeline);
}
/* ── Mobile: append the timeline at the end of the article ───────────── */
function _placeInContent(timeline) {
var article = document.querySelector(".md-content__inner");
if (!article) return;
// Build a wrapper with a heading so it reads as a distinct section.
var wrapper = document.createElement("div");
wrapper.className = "adr-timeline-mobile";
var heading = document.createElement("h2");
heading.textContent = "Status History";
heading.id = "status-history";
wrapper.appendChild(heading);
// Move (not clone) the timeline into the wrapper and make it visible.
timeline.style.display = "";
wrapper.appendChild(timeline);
article.appendChild(wrapper);
}