Keep your coding agent up to date with the latest web best practices
Release v0.0.2
Paul Irish6bb4bc26d6da
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonnew file mode 100644index 0000000..7acdf80--- /dev/null+++ b/.claude-plugin/marketplace.json@@ -0,0 +1,14 @@+{+ "name": "skills-alpha",+ "owner": {+ "name": "Google Chrome"+ },+ "plugins": [+ {+ "name": "googlechrome-skills",+ "source": "./",+ "description": "Google Chrome's agent skills collection",+ "version": "0.0.2"+ }+ ]+}\ No newline at end of filediff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonnew file mode 100644index 0000000..84a05b4--- /dev/null+++ b/.claude-plugin/plugin.json@@ -0,0 +1,8 @@+{+ "name": "googlechrome-skills",+ "description": "Google Chrome's agent skills collection",+ "version": "0.0.2",+ "author": {+ "name": "Google Chrome"+ }+}\ No newline at end of filediff --git a/README.md b/README.mdnew file mode 100644index 0000000..b314f41--- /dev/null+++ b/README.md@@ -0,0 +1,22 @@+# Google Chrome Agent Skills++A curated collection of web development agent skills and tools.++## Installation++### For Claude Code+```bash+/plugin marketplace add GoogleChrome/skills-alpha+/plugin install googlechrome-skills@skills-alpha+/reload-plugins+```++### For Gemini CLI+```bash+gemini extensions install https://github.com/GoogleChrome/skills-alpha --auto-update+```++### For Vanilla Skills Pack+```bash+npx skills add GoogleChrome/skills-alpha+```diff --git a/RELEASING.md b/RELEASING.mdnew file mode 100644index 0000000..bc68e21--- /dev/null+++ b/RELEASING.md@@ -0,0 +1,58 @@+# Releasing Guidance Skills++To release updates to our AI Skills infrastructure (Claude Code, Gemini CLI, vanilla and VS Code Extensions), we leverage the `dist/` bundler that collapses all our source guidance docs and tools into a lightweight distribution pack. This distribution pack is then published directly to our user-facing repository: `GoogleChrome/skills-alpha`.++## The Publishing Pipeline++1. **Make changes** locally or via PR in the `guidance` repo under `serving/`.+2. **Deploy** by running the automated publishing command from the `serving/` folder:+ ```bash+ pnpm run publish-skills+ ```+ *Under the hood, this script:*+ 1. Increments the patch version across all AI extension manifests (`0.0.x`).+ 2. Executes `dist-gen` to bundle all tools, local databases, and new extension metadata.+ 3. Uses the `gh-pages` API to forcefully replicate the entirely newly bundled `dist/` envelope upward to the `main` branch of `[email protected]:GoogleChrome/skills-alpha.git`.++## GitHub Releases (Important for Gemini CLI)++When users run:+```bash+gemini extensions install https://github.com/GoogleChrome/skills-alpha+```+The Gemini CLI attempts to fetch an official GitHub Release by default, not just a git clone. If no releases exist via the API paths, users will see an error:+`Failed to fetch release data for GoogleChrome/skills-alpha at tag undefined: Request failed with status code 404.`+It will then prompt the user to fall back to a "git clone" installation.++**Note on Private Repositories:**+If `GoogleChrome/skills-alpha` is kept private, the Gemini CLI must be able to authenticate. Users must have a `GITHUB_TOKEN` environment variable exported with the `repo` scope. Without this token, the API request will fail (often presenting as a 404 since GitHub hides private repos from unauthenticated requests), and the CLI will again fall back to `git clone`.++### Creating a Release in GoogleChrome/skills-alpha++To provide a seamless, error-free installation experience, we must manage releases formally on the published repository.++1. Update the `version` field in `serving/skills-cli/gemini-extension.json`, `serving/skills-cli/.claude-plugin/plugin.json`, `serving/skills-cli/.claude-plugin/marketplace.json` and `serving/skills-cli/vscode-ext-package.json`.+2. Run the `dist-gen` build and deploy the updated `dist/` to `GoogleChrome/skills-alpha`.+3. Create a **GitHub Release** on `GoogleChrome/skills-alpha` via the UI or using the GitHub CLI:+ ```bash+ gh release create v1.0.1 --title "v1.0.1" --notes "Release notes here..."+ ```++When a GitHub Release is available and marked as "Latest", the Gemini CLI will download the archive corresponding to that release directly, bypassing the `404` error and the fallback prompt. This is significantly faster than a full git clone.++## Branches vs Releases for AI Tooling++- **Gemini CLI (Releases):** GitHub Releases are the primary, most robust way for the Gemini CLI to install extensions.+- **Gemini CLI (Fallback):** If users install directly from a branch (via the fallback), the CLI considers the `HEAD` commit as the latest version and will dynamically prompt them for updates when new commits are pushed to the branch.+- **Claude Code (Git Pull):** Claude Code does not query the GitHub Releases API. Instead, it relies strictly on the `version` field within `.claude-plugin/plugin.json` in the git repository. Bumping that version string in the `dist` bundle and pushing to `main` is the only way Claude Code detects that an update is available to pull.++By maintaining proper GitHub Releases and bumping versions in the JSON manifests, we support the 'happy path' for installation on the Gemini platform while seamlessly ensuring auto-updates function correctly for Claude Code users polling the main branch.++## Why a Single Bundled Plugin?++While Claude supports distributing multiple individual plugins via a `.claude-plugin/marketplace.json` catalog (allowing users to `marketplace add` and then pick and choose), `GoogleChrome/skills-alpha` intentionally operates as a **single bundled plugin** (`googlechrome-skills`) containing multiple agent skills natively underneath it.++This approach was chosen because:++1. **Simplified Installation:** Users only install one plugin (`googlechrome-skills`) to instantly access the entire suite of curated skills, rather than sifting through a catalog and installing them one by one.+2. **Ecosystem Alignment:** The Gemini CLI and VS Code extension systems natively treat repositories as singular bundles. Standardizing the repo as a single Claude plugin ensures 1:1 structural parity across all 3 environments without the overhead of maintaining nested, disconnected manifests for every individual skill folder.diff --git a/gemini-extension.json b/gemini-extension.jsonnew file mode 100644index 0000000..00d7913--- /dev/null+++ b/gemini-extension.json@@ -0,0 +1,8 @@+{+ "name": "googlechrome-skills",+ "description": "Google Chrome's web development agent skills.",+ "version": "0.0.2",+ "author": {+ "name": "Google Chrome"+ }+}\ No newline at end of filediff --git a/package.json b/package.jsonnew file mode 100644index 0000000..f33bf6a--- /dev/null+++ b/package.json@@ -0,0 +1,21 @@+{+ "name": "skills-alpha",+ "displayName": "Chrome Web Development Skills",+ "description": "Curated collection of agent skills for modern web development.",+ "version": "0.0.2",+ "publisher": "GoogleChrome",+ "engines": {+ "vscode": "^1.90.0"+ },+ "categories": [+ "AI",+ "Other"+ ],+ "contributes": {+ "chatSkills": [+ {+ "path": "./skills-cli/modern-web-use-cases/SKILL.md"+ }+ ]+ }+}\ No newline at end of filediff --git a/publish-skills.ts b/publish-skills.tsnew file mode 100644index 0000000..538c12f--- /dev/null+++ b/publish-skills.ts@@ -0,0 +1,76 @@+import fs from 'node:fs/promises';+import path from 'node:path';+import { fileURLToPath } from 'node:url';+import { execSync } from 'node:child_process';+import ghpages from 'gh-pages';+import { promisify } from 'node:util';++const __filename = fileURLToPath(import.meta.url);+const __dirname = path.dirname(__filename);+const ROOT_DIR = path.resolve(__dirname, "../.."); // guidance/+const SERVING_DIR = path.join(ROOT_DIR, "serving");+const DIST_DIR = path.join(ROOT_DIR, "dist");+const SKILLS_CLI_TEMPLATE_DIR = path.join(SERVING_DIR, "skills-cli");++const ghPagesPublish = promisify(ghpages.publish);++function incrementVersion(version: string): string {+ const parts = version.split('.');+ const patch = parseInt(parts[2], 10) + 1;+ return `${parts[0]}.${parts[1]}.${patch}`;+}++async function bumpVersions() {+ console.log("Bumping versions in skills-cli templates...");++ // Gemini+ const geminiPath = path.join(SKILLS_CLI_TEMPLATE_DIR, "gemini-extension.json");+ const geminiData = JSON.parse(await fs.readFile(geminiPath, 'utf8'));+ const newVersion = incrementVersion(geminiData.version);+ geminiData.version = newVersion;+ await fs.writeFile(geminiPath, JSON.stringify(geminiData, null, 2));++ // VSCode+ const vscodePath = path.join(SKILLS_CLI_TEMPLATE_DIR, "vscode-ext-package.json");+ const vscodeData = JSON.parse(await fs.readFile(vscodePath, 'utf8'));+ vscodeData.version = newVersion;+ await fs.writeFile(vscodePath, JSON.stringify(vscodeData, null, 2));++ // Claude Plugin+ const claudePluginPath = path.join(SKILLS_CLI_TEMPLATE_DIR, ".claude-plugin/plugin.json");+ const claudePluginData = JSON.parse(await fs.readFile(claudePluginPath, 'utf8'));+ claudePluginData.version = newVersion;+ await fs.writeFile(claudePluginPath, JSON.stringify(claudePluginData, null, 2));++ // Claude Marketplace+ const marketplacePath = path.join(SKILLS_CLI_TEMPLATE_DIR, ".claude-plugin/marketplace.json");+ const marketplaceData = JSON.parse(await fs.readFile(marketplacePath, 'utf8'));+ marketplaceData.plugins[0].version = newVersion;+ await fs.writeFile(marketplacePath, JSON.stringify(marketplaceData, null, 2));++ console.log(`Successfully bumped to version ${newVersion}`);+ return newVersion;+}++async function main() {+ const newVersion = await bumpVersions();++ console.log(`\nRebuilding distribution with version ${newVersion}...`);+ execSync('npm run dist-gen', { cwd: SERVING_DIR, stdio: 'inherit' });++ console.log(`\nPublishing new dist/ to GoogleChrome/skills-alpha (main branch)...`);++ await ghPagesPublish(DIST_DIR, {+ branch: 'main',+ repo: '[email protected]:GoogleChrome/skills-alpha.git',+ dotfiles: true,+ message: `Release v${newVersion}`+ });++ console.log(`\n✅ Successfully published v${newVersion} to GoogleChrome/skills-alpha!`);+}++main().catch((err) => {+ console.error("Publishing failed!", err);+ process.exit(1);+});\ No newline at end of filediff --git a/skills-cli-dist-gen.ts b/skills-cli-dist-gen.tsnew file mode 100644index 0000000..9d96164--- /dev/null+++ b/skills-cli-dist-gen.ts@@ -0,0 +1,125 @@+import fs from "fs";+import path from "path";+import { execSync } from "child_process";+import { fileURLToPath } from "url";++const __filename = fileURLToPath(import.meta.url);+const __dirname = path.dirname(__filename);++const ROOT_DIR = path.resolve(__dirname, "../.."); // guidance/+const SERVING_DIR = path.resolve(__dirname, ".."); // guidance/serving/+const DIST_DIR = path.join(ROOT_DIR, "dist/skills-cli/modern-web-use-cases");+const CLI_DIR = path.join(DIST_DIR, "cli");++async function main() {+ console.log("Generating guides and updating vector store...");+ // 1. Run build-guides.ts to update .modern-web-data and build/guides+ try {+ execSync("node --experimental-strip-types scripts/build-guides.ts", {+ cwd: SERVING_DIR,+ stdio: "inherit",+ });+ } catch (error) {+ console.error("Failed to build guides:", error);+ process.exit(1);+ }++ console.log(`Creating output directories in ${CLI_DIR}...`);+ // 2. Clear and create output directory+ if (fs.existsSync(CLI_DIR)) {+ fs.rmSync(CLI_DIR, { recursive: true, force: true });+ }+ fs.mkdirSync(CLI_DIR, { recursive: true });++ // Create deeper directory to mimic original path depth for relative path resolution+ const BUNDLE_OUT_DIR = path.join(CLI_DIR, "serving/bin");+ fs.mkdirSync(BUNDLE_OUT_DIR, { recursive: true });++ console.log("Copying data files...");+ // 3. Copy .modern-web-data+ const mcpDataDir = path.join(SERVING_DIR, ".modern-web-data");+ const destMcpDataDir = path.join(CLI_DIR, ".modern-web-data");+ if (fs.existsSync(mcpDataDir)) {+ fs.cpSync(mcpDataDir, destMcpDataDir, { recursive: true });+ console.log(`Copied ${mcpDataDir} to ${destMcpDataDir}`);+ } else {+ console.warn(`Warning: ${mcpDataDir} does not exist.`);+ }++ // 4. Copy build/guides+ const buildGuidesDir = path.join(SERVING_DIR, "build/guides");+ const destBuildGuidesDir = path.join(CLI_DIR, "build/guides");+ if (fs.existsSync(buildGuidesDir)) {+ fs.cpSync(buildGuidesDir, destBuildGuidesDir, { recursive: true });+ console.log(`Copied ${buildGuidesDir} to ${destBuildGuidesDir}`);+ } else {+ console.warn(`Warning: ${buildGuidesDir} does not exist.`);+ }++ console.log("Bundling modern-web.ts with esbuild...");+ // 5. Bundle modern-web.ts+ const entryPoint = path.join(SERVING_DIR, "bin/modern-web.ts");+ const outFile = path.join(BUNDLE_OUT_DIR, "modern-web.cjs");++ try {+ // Try to run npx esbuild or pnpm exec esbuild+ // We assume the user has esbuild accessible or npx works.+ execSync(`pnpm exec esbuild "${entryPoint}" --bundle --platform=node --format=cjs --loader:.node=file --define:import.meta.url="'__import_meta_url_placeholder__'" --external:@lancedb/lancedb --external:@huggingface/transformers --outfile="${outFile}"`, {+ stdio: "inherit",+ });+ console.log(`Bundled ${entryPoint} to ${outFile}`);++ console.log("Replacing import.meta.url placeholder in bundle...");+ let bundleContent = fs.readFileSync(outFile, "utf-8");+ bundleContent = bundleContent.replace(+ /(['"])__import_meta_url_placeholder__\1/g,+ "require('url').pathToFileURL(__filename).toString()"+ );+ fs.writeFileSync(outFile, bundleContent);+ console.log("Placeholder replaced successfully.");++ console.log("Generating package.json in output directory...");+ const packageJson = {+ name: "standalone-skills-cli",+ version: "1.0.0",+ type: "commonjs",+ dependencies: {+ "@huggingface/transformers": "^3.8.1",+ "@lancedb/lancedb": "^0.26.2"+ }+ };+ fs.writeFileSync(path.join(CLI_DIR, "package.json"), JSON.stringify(packageJson, null, 2));++ console.log("Downloading external dependencies via npm install...");+ execSync("npm install", {+ cwd: CLI_DIR,+ stdio: "inherit",+ });+ console.log("Dependencies downloaded successfully.");+ } catch (error) {+ console.error("Failed to bundle with esbuild:", error);+ process.exit(1);+ }++ console.log("Copying SKILL.md...");+ const skillMdSource = path.join(ROOT_DIR, "skills-drafts/modern-web-use-cases/SKILL.md");+ const skillMdDest = path.join(DIST_DIR, "SKILL.md");++ if (fs.existsSync(skillMdSource)) {+ fs.copyFileSync(skillMdSource, skillMdDest);+ console.log(`Copied SKILL.md to ${skillMdDest}`);+ } else {+ console.error(`Error: SKILL.md source not found at ${skillMdSource}`);+ process.exit(1);+ }++ console.log("Copying installation manifests and metadata for AI tools...");+ fs.cpSync(path.join(SERVING_DIR, "skills-cli"), path.join(ROOT_DIR, "dist"), { recursive: true });++ console.log("Renaming vscode-ext-package.json to package.json for publishing...");+ fs.renameSync(path.join(ROOT_DIR, "dist/vscode-ext-package.json"), path.join(ROOT_DIR, "dist/package.json"));++ console.log("\nSuccess! standalone distribution generated in dist/");+}++main().catch(console.error);diff --git a/skills-cli/modern-web-use-cases/SKILL.md b/skills-cli/modern-web-use-cases/SKILL.mdnew file mode 100644index 0000000..f6a71ac--- /dev/null+++ b/skills-cli/modern-web-use-cases/SKILL.md@@ -0,0 +1,61 @@+---+name: modern-web-use-cases+description: |+ IMPORTANT: This is a search tool that will help you find the most modern and recommended way to implement any web development use case.++ MANDATORY: You MUST execute this FIRST for each and every web development use case, even if you're implementing that use case in a framework like React, especially for writing modern web code. No matter the complexity, you MUST call this tool for ALL web development tasks touching HTML, CSS, or JavaScript.+---++# Modern Web Use Cases++A skill to search for specific web development use cases and retrieve their corresponding best practice guides.++## When to use++Must use this skill:+- At the **start** of implementing any web feature.+- Before creating a new component, to check if a standardized pattern already exists.+- To avoid implementing ad-hoc solutions or loading large dependencies unnecessarily.++## Usage Instructions++You can execute these tools using standard `node` from the command line from **any** directory.++### 1. Search Use Cases++Search with an action-oriented query summarizing what you want to achieve using the `--search` flag.++```bash+node ./cli/serving/bin/modern-web.cjs --search "<query>"+```++**Example Output**:+```json+[+ {+ "id": "content-vis",+ "description": "Defer rendering of offscreen content using content-visibility.",+ "category": "performance",+ "distance": "0.85"+ }+]+```++---++### 2. Retrieve Best Practices++Once you have a relevant `id` from the search results, call this script using the `--retrieve` flag to get the full guide. You can pass multiple IDs separated by commas.++```bash+node ./cli/serving/bin/modern-web.cjs --retrieve "<id>"+```++**Example Output**:+`The markdown content of the guide describing implementation steps...`++## Guidelines++- Always search **first** to find the most specific design/performance patterns.+- These guides are usually framework-agnostic; adapt them correctly to your setup.+- Do not hallucinate guides or ignore them; they represent the preferred local standard for the user's project.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/accessibility/accessible-error-announcement.md b/skills-cli/modern-web-use-cases/cli/build/guides/accessibility/accessible-error-announcement.mdnew file mode 100644index 0000000..6d011dc--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/accessibility/accessible-error-announcement.md@@ -0,0 +1,207 @@+# Accessible Error Announcement++## The Problem+Standard HTML5 validation provides visual feedback (via `:invalid` or `:user-invalid`), but it doesn't automatically synchronize with accessibility attributes like `aria-invalid`.++If you use standard `:invalid` styling, screen readers might announce "Invalid entry" the moment a user tabs into a required field that is currently empty. This creates a disruptive experience for users using assistive technologies, as the error is announced before interaction has occurred.++## The Solution+We want the *programmatic* state (`aria-invalid="true"`) to be applied **at the exact same moment** the *visual* state (`:user-invalid`) applies. Since `:user-invalid` relies on the browser's internal "user-interacted" flag, we can use JavaScript to check that this selector matches during standard interaction events.++See [MDN aria-invalid](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-invalid) for more details.++### Implementation Strategy++1. **Visual Layer**: Use CSS `:user-invalid` to show borders/icons.+2. **Accessibility Layer**: Use `aria-invalid` and `aria-errormessage` to communicate state to Assistive Technology (AT).+3. **Bridge Visual & Accessibility Layer**: Create a lightweight JavaScript utility that listens for `blur` and `input` events, checks if the element matches `:user-invalid`, and updates the ARIA attributes accordingly.++## Implementation Guide++### 1. HTML Structure+Link your input to its error message using `aria-errormessage` (or `aria-describedby` for broader support).++```html+<form>+ <div class="field">+ <label for="email">Email</label>+ <input+ type="email"+ id="email"+ required+ aria-errormessage="email-error"+ >+ <span id="email-error" class="error-msg">+ Please enter a valid email address.+ </span>+ </div>+</form>+```++### 2. CSS+Control the visibility of the error message using the native pseudo-class `:user-invalid`.++```css+.error-msg {+ display: none;+ color: #d93025;+}++/* Show error message when input is user-invalid */+input:user-invalid ~ .error-msg {+ display: block;+}++/* Optional: Visual cues on the input itself */+input:user-invalid {+ border-color: #d93025;+}+```++### 3. JavaScript+Since there is no "UserInvalidChanged" event, hook into standard form events to check the state.++```javascript+const updateAriaState = (event) => {+ const input = event.target;+ if (!input.matches?.('input, textarea, select')) return;++ // Check if the browser currently considers this input "user-invalid"+ const isUserInvalid = input.matches(':user-invalid');++ if (isUserInvalid) {+ input.setAttribute('aria-invalid', 'true');+ } else {+ input.removeAttribute('aria-invalid');+ }+};++// Listen on the document to handle dynamically added fields.+// 'blur' and 'focus' do not bubble, so we must use the capture phase (true).+document.addEventListener('blur', updateAriaState, true);+document.addEventListener('focus', updateAriaState, true);++// Also update on input if we've already shown the error,+// so the error clears immediately when fixed.+document.addEventListener('input', (event) => {+ const input = event.target;+ if (!input.matches?.('input, textarea, select')) return;++ const hasAriaInvalid = input.hasAttribute('aria-invalid');+ const ariaInvalid = input.getAttribute('aria-invalid');+ if (hasAriaInvalid && ariaInvalid === 'true') {+ updateAriaState(event);+ }+});+```++## Fallbacking & Browser Support++The `:user-invalid` pseudo-class is widely supported (Baseline 2023), but older browsers need a fallback.++### Feature Detection+You can check for support in CSS and JavaScript.++**JavaScript Check:**+```javascript+if (!CSS.supports('selector(:user-invalid)')) {+ // Fallback logic here+}+```++### CSS for Fallback+To ensure your fallback logic is visually indistinguishable from the native behavior, you must apply your error styles to both the pseudo-class and your fallback class.++```css+/* Apply error styles to both native selector and fallback class */+input:user-invalid,+input.user-invalid-fallback {+ border-color: #d93025;+ background-color: #fce8e6;+}++/* Show error message for both cases */+input:user-invalid ~ .error-msg,+input.user-invalid-fallback ~ .error-msg {+ display: block;+}+```++### Fallback Logic+If `:user-invalid` is missing manually track the interaction state using a `WeakMap`.++```javascript+const UserInvalidFallback = (() => {+ const dirtyState = new WeakMap();++ const updateState = (input) => {+ const isValid = input.checkValidity();++ // Update both visual and ARIA state+ input.classList.toggle('user-invalid-fallback', !isValid);+ input.classList.toggle('user-valid-fallback', isValid);++ if (!isValid) {+ input.setAttribute('aria-invalid', 'true');+ } else {+ input.removeAttribute('aria-invalid');+ }+ };++ const handleEvent = (event) => {+ const input = event.target;++ if (event.type === 'reset' && input.matches?.('form')) {+ const controls = input.elements || [];+ for (const control of controls) {+ dirtyState.delete(control);+ control.classList.remove('user-invalid-fallback');+ control.classList.remove('user-valid-fallback');+ control.removeAttribute('aria-invalid');+ }+ return;+ }++ if (!input.matches?.('input, textarea, select')) return;++ if (event.type === 'input' || event.type === 'change') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasInteracted = true;+ dirtyState.set(input, state);+ if (state.hasBlurred) {+ updateState(input);+ }+ } else if (event.type === 'blur') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasBlurred = true;+ dirtyState.set(input, state);+ if (state.hasInteracted) {+ updateState(input);+ }+ }+ };++ const init = () => {+ if (CSS.supports('selector(:user-invalid)')) return;++ document.addEventListener('blur', handleEvent, true); // Capture phase required+ document.addEventListener('input', handleEvent, true);+ document.addEventListener('change', handleEvent, true);+ document.addEventListener('reset', handleEvent, true); // Capture resets+ };++ return { init };+})();++// Initialize globally+UserInvalidFallback.init();+```++## Other Considerations++1. **`aria-live` vs. `aria-errormessage`**:+ * `aria-errormessage` connects the input to the text, but screen readers might not announce it immediately upon appearance (only when focusing the input).+ * If you need *immediate* announcement when the error appears (e.g., on blur), consider adding `role="alert"` or `aria-live="polite"` to the error message container, but test thoroughly to avoid "double announcement" when the user focuses the field to fix it.++2. **Internationalization**:+ * Ensure the text content of your error message (`#email-error`) is translated. The logic remains the same.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/batch-analytics-events.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/batch-analytics-events.mdnew file mode 100644index 0000000..4607877--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/batch-analytics-events.md@@ -0,0 +1,152 @@+# Debounce and batch multiple analytics events++Most analytics and telemetry data is low priority and you can safely defer sending it until the user leaves the page. The exception to this is if you need to deliver real-time updates, in which case timeliness matters.++The optimal way to provide real-time analytics updates, while still minimizing beacons, is to use `fetchLater()` with the `activateAfter` configuration option. This allows you to effectively debounce and batch all analytics events that occur within a given time window into a single beacon, that is reliably sent even if the user leaves the page before the timeout expires.++## How to implement++1. **Schedule the request:** As soon as any relevant analytics data is available, call `fetchLater()` with your data payload and pass an `activateAfter` value. This queues the data to be sent after that amount of time passes, or if the user leaves the page beforehand.++2. **Batch multiple events together:** If a new analytics event occurs before the `activateAfter` timeout expires, abort the previously scheduled request and call `fetchLater()` again (with the same `activateAfter` value) with the full event queue in a single payload.++3. **Reset the event queue when the timeout expires:** If a new analytics event occurs after the scheduled beacon has successfully sent (i.e. the `fetchLater()` result's `activated` value is `true`), reset the event queue.++3. **Let the browser handle the rest:** If the user navigates away or closes the tab before the `activateAfter` timeout expires, the browser will still reliably send the payload from your most recent `fetchLater()` call.++## Example code++This code tracks all `load` and `click` events on a page, and batches together all events that occur within a 10-second timeout.++```javascript+// Replace with your analytics endpoint.+const ANALYTICS_ENDPOINT = '/path/to/analytics/endpoint';++// Replace with a time window of your choice. All analytics events that+// occur within this time window will be batched together.+const BATCH_WINDOW = 10 * 1000;++// The maximum number of events to batch. Pick a number that is unlikely+// to overflow the fetchLater() quota for the page.+const MAX_QUEUE_SIZE = 100;++const eventQueue = [];+let fetchLaterResult;+let fetchLaterController;++function trackEvent(eventData) {+ // If the previously queued beacon has already been sent, or if the+ // max queue size has been met, reset the queue.+ if (fetchLaterResult?.activated || eventQueue.length > MAX_QUEUE_SIZE) {+ fetchLaterController = null;+ fetchLaterResult = null;+ eventQueue.length = 0;+ }++ eventQueue.push(eventData);++ // Abort any pending beacons before creating a new one.+ if (fetchLaterController) {+ fetchLaterController.abort();+ }+ fetchLaterController = new AbortController();++ // Schedule a fetch for the events to be sent when the batch window expires.+ // IMPORTANT: wrap the call in a try/catch to handle quota errors.+ try {+ fetchLaterResult = fetchLater(ANALYTICS_ENDPOINT, {+ method: 'POST',+ headers: {'content-type': 'application/json'},+ body: JSON.stringify(eventQueue),+ signal: fetchLaterController.signal,+ activateAfter: BATCH_WINDOW,+ });+ } catch (error) {+ // Handle errors as needed.+ }+}++// Track page loads.+window.addEventListener('load', () => {+ trackEvent({type: 'page_load'});+});++// Track click events.+window.addEventListener('click', (event) => {+ trackEvent({type: 'click', target: serializeElement(event.target)});+});+```++## Best Practices++- **DO** use `fetchLater()` with the `activateAfter` option set to batch multiple analytics events that occur within close proximity of each other.+- **DO** use an `AbortController` to cancel the pending fetch in cases where a new analytics event occurs.+- **DO** check to ensure you do not batch too many events together and exceed the `fetchLater()` quota (currently roughly 64KB per origin).+- **DO** wrap calls to `fetchLater()` in a `try/catch` to handle quota errors.+- **DO** feature detect the presence of `fetchLater()` on `globalThis` and implement a fallback strategy for browsers that don't support the API.+- **DO NOT** use a `ReadableStream` object for the request body, as that will error.++## Browser support and fallback strategies++fetchLater is Limited.. Therefore, a fallback strategy is typically required.++However, given the improved reliability and performance benefits of this API, `fetchLater()` should be used if the browser supports it.++### `fetchLater()` polyfill++Use the following minimal `fetchLater()` polyfill, which implements the API as closely as possible in unsupporting browsers.++The only notable behavior difference with this polyfill is instead of sending the payload when the user leaves the page, it sends it whenever the page's `visibilityState` changes to "hidden", since this is the most reliable end-of-session signal that's widely available today.++```js+globalThis.fetchLater ??= function fetchLater(url, init = {}) {+ let timeoutHandle;+ let activated = false;++ function sendNow() {+ if (!(init.signal && init.signal.aborted)) {+ // Use fetch keepalive if the browser supports it or if custom fetch+ // parameters are specified (e.g. custom headers or methods).+ // Otherwise fall back to `navigator.sendBeacon()`.+ if (+ 'keepalive' in Request.prototype ||+ init.method !== 'POST' ||+ init.headers+ ) {+ fetch(url, Object.assign({}, init, {keepalive: true}));+ activated = true;+ } else {+ activated = navigator.sendBeacon(url, init.body);+ }+ }+ destroy();+ }++ function destroy() {+ document.removeEventListener('visibilitychange', sendNow);+ clearTimeout(timeoutHandle);+ }++ if (document.visibilityState === 'hidden') {+ // If the beacon was created while the page is already hidden, send data+ // ASAP but wait until the next microtask to allow all sync code to run.+ queueMicrotask(sendNow);+ } else {+ document.addEventListener('visibilitychange', sendNow);++ if (typeof init.activateAfter === 'number' && init.activateAfter >= 0) {+ timeoutHandle = setTimeout(sendNow, init.activateAfter);+ }+ }++ if (init.signal) {+ init.signal.addEventListener('abort', destroy);+ }++ return {+ get activated() {+ return activated;+ },+ };+};+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/deprioritize-background-fetches.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/deprioritize-background-fetches.mdnew file mode 100644index 0000000..afaa30b--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/deprioritize-background-fetches.md@@ -0,0 +1,36 @@+# Deprioritize background fetches++When a page performs multiple simultaneous network requests, they often compete for the same bandwidth. Non-critical data such as analytics, logging, or background synchronization should be deprioritized so that user-initiated or critical data fetches can complete more quickly.++## How to implement++1. **Identify background requests**: Determine which `fetch()` calls are for non-essential data that doesn't impact the immediate user experience.+2. **Apply fetch priority**: Add the `priority: 'low'` option to the `fetch()` initialization object.++## Example code++```javascript+// Use high priority (default) for critical UI updates+const criticalData = await fetch('/api/data');++// Explicitly deprioritize background analytics+fetch('/api/analytics', {+ method: 'POST',+ body: JSON.stringify(eventData),+ // Lower the priority to prevent network contention+ priority: 'low'+});+```++## Best practices++- **DO** use `priority: 'low'` for analytics, beacons, or telemetry data that isn't required for the current view.+- **DO** use `priority: 'low'` for "prefetching" data that the user *might* need later, ensuring it doesn't slow down what they need *now*.+- **DO NOT** use `priority: 'low'` for fetches that are critical to the user experience.+- **DO NOT** use the deprecated `importance` key in the fetch options object. The correct key is `priority`.++## Fallback strategy++Fetch priority is Newly. It's been Baseline since 2024-10-29.++The `priority` option in the Fetch API is a progressive enhancement. Browsers that do not support it will ignore the option and treat the request with default priority. No explicit feature detection or fallback logic is required for basic usage.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/full-session-analytics.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/full-session-analytics.mdnew file mode 100644index 0000000..9173dcf--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/full-session-analytics.md@@ -0,0 +1,131 @@+# Reliably measure full-session analytics and telemetry++To reliably analytics and telemetry data that covers the entirety of a user's visit to a web page (not just until page load) use the `fetchLater()` API.++The `fetchLater()` API is the most reliably way to send data to a server in cases where a response is not required and delivery timing is not urgent, which applies to data such as user analytics, telemetry, error tracking, and performance metrics like Core Web Vitals.++Older technique like creating an `<img>` pixel in an `unload` event listener are notoriously unreliably (especially on mobile) and can negatively impact performance (by making pages ineligible for bfcache).++## How to implement++1. **Schedule the request:** As soon as relevant data is available, call `fetchLater()` with your data payload. This queues the data to be sent later.++2. **Update the payload as needed:** If the user generates more data or the state changes, abort the previously scheduled request and call `fetchLater()` again with the fully updated snapshot.++3. **Let the browser handle the rest:** When the user navigates away or closes the tab, the browser will reliably send the payload from your most recent `fetchLater()` call.++## Example code++This code measures the session duration of a user's visit to a page using `fetchLater()` to queue a new beacon every 10 seconds with the updated session duration.++```javascript+const ANALYTICS_ENDPOINT = '/path/to/analytics/endpoint';++const sessionData = {+ duration: 0,+ id: crypto.randomUUID(),+};++let fetchLaterController = null;++function queueBeacon() {+ // Abort any pending beacons before creating a new one.+ if (fetchLaterController) {+ fetchLaterController.abort();+ }+ fetchLaterController = new AbortController();++ // Update session duration to the current page time.+ sessionData.duration = performance.now();++ // Schedule a fetch for the data payload to be sent later.+ // IMPORTANT: wrap the call in a try/catch to handle quota errors.+ try {+ fetchLater(ANALYTICS_ENDPOINT, {+ method: 'POST',+ headers: {'content-type': 'application/json'},+ body: JSON.stringify(sessionData),+ signal: fetchLaterController.signal,+ });+ } catch (error) {+ // Handle errors as needed.+ }+}++// Update the session data and queue a new beacon every 10 seconds.+setInterval(queueBeacon, 10000);+```++## Best Practices++- **DO** use `fetchLater()` to send data to a server in any situation where a response is not necessary, and it's not critical that the data is sent immediately.+- **DO** use an `AbortController` to cancel the pending fetch in cases where the data may need to be updated before the user leaves the page+- **DO** minimum the payload size to avoid exceeding the quota (currently roughly 64KB per origin).+- **DO** wrap calls to `fetchLater()` in a `try/catch` to handle quota errors.+- **DO** feature detect the presence of `fetchLater()` on `globalThis` and implement a fallback strategy for browsers that don't support the API.+- **DO NOT** use a `ReadableStream` object for the request body, as that will error.++## Browser support and fallback strategies++fetchLater is Limited.. Therefore, a fallback strategy is typically required.++However, given the improved reliability and performance benefits of this API, `fetchLater()` should be used if the browser supports it.++### `fetchLater()` polyfill++Use the following minimal `fetchLater()` polyfill, which implements the API as closely as possible in unsupporting browsers.++The only notable behavior difference with this polyfill is instead of sending the payload when the user leaves the page, it sends it whenever the page's `visibilityState` changes to "hidden", since this is the most reliable end-of-session signal that's widely available today.++```js+globalThis.fetchLater ??= function fetchLater(url, init = {}) {+ let timeoutHandle;+ let activated = false;++ function sendNow() {+ if (!(init.signal && init.signal.aborted)) {+ // Use fetch keepalive if the browser supports it or if custom fetch+ // parameters are specified (e.g. custom headers or methods).+ // Otherwise fall back to `navigator.sendBeacon()`.+ if (+ 'keepalive' in Request.prototype ||+ init.method !== 'POST' ||+ init.headers+ ) {+ fetch(url, Object.assign({}, init, {keepalive: true}));+ activated = true;+ } else {+ activated = navigator.sendBeacon(url, init.body);+ }+ }+ destroy();+ }++ function destroy() {+ document.removeEventListener('visibilitychange', sendNow);+ clearTimeout(timeoutHandle);+ }++ if (document.visibilityState === 'hidden') {+ // If the beacon was created while the page is already hidden, send data+ // ASAP but wait until the next microtask to allow all sync code to run.+ queueMicrotask(sendNow);+ } else {+ document.addEventListener('visibilitychange', sendNow);++ if (typeof init.activateAfter === 'number' && init.activateAfter >= 0) {+ timeoutHandle = setTimeout(sendNow, init.activateAfter);+ }+ }++ if (init.signal) {+ init.signal.addEventListener('abort', destroy);+ }++ return {+ get activated() {+ return activated;+ },+ };+};+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/improve-next-page-load-performance.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/improve-next-page-load-performance.mdnew file mode 100644index 0000000..08ec9b3--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/improve-next-page-load-performance.md@@ -0,0 +1,119 @@+# Improve next page load performance++One of the most effective ways to improve page load performance for users navigating a site is to initiate loading the next page they're about to visit *before* they visit it. This can be done through a technique called speculative loading using the Speculation Rules API.++## How it works++Speculative loading works by using JSON-based speculation rules to tell the browser about links that can be prefetched or prerendered improving page load performance when user clicks on them.++The rules can either be a hardcoded list of URLs a `urls` key (known as a list rule), or with a `where` key containing a set of href and CSS selectors used to find links on the page (known as a `document` rule).++Rules can also include an optional `eagerness` property that specifies when the page should be prefetched or prerendered. The `eagerness` property can be set to `immediate`, `eager`, `moderate`, or `conservative`. `immediate` speculates as soon as possible, while the others wait for user signals such as hovering for a short period, for a longer period, or starting to click on the page respectively.++Rules can be combined with different eagerness settings to prefetch eagerly and then prerender when the user interacts more.++## When to use it++Speculative loading is especially useful for static pages, where the content is not likely to change often, and where pages are cheaper to produce—especially if cached at the edge. It can also be used for dynamic pages, but it is important to be careful about the potential for stale content.++Speculative loading is typically used for same-origin links, though more advanced options allow for some cross-origin speculation. This guide concentrates on the more-common same-origin use case.++More eager speculative loading is a good choice for pages that are likely to be visited next, such as a headline article or the next page in a stepped process like a learning a course.++Less eager speculative loading is a good choice when it is less obvious what the user will do next, when there are many links on the page, each equally likely to be visited. By waiting for more signals, such as hovering, or starting to click on the page, you can get a head-start on the next page and improve the user experience, even if it is not fully prefetched or prerendered.++Similarly, prefetch is a more conservative choice than prerender, using less resources (on both the client and the server side) but providing less benefit to the user. It is a good choice for initial implementation, expanding to prerender later when the developer explicitly requests it.++## How to use it++Speculation rules have a JSON-based format and can be included in a `<script type="speculationrules">` tag. The rules can be included in the `<head>` or `<body>` of the document, or can be dynamically added using JavaScript.++A `tag` can also be used, either at a global level or on a per-rule basis. When set, this tag will be included in the `Sec-Speculation-Tags` header, and allows you to identify server-side which speculations were made.++### Example of a simple URL list rule for prefetching predefined URLs++```html+<script type="speculationrules">+ {+ "tag": "product-page-speculations",+ "prefetch": [+ {+ "urls": ["/product/1", "/product/2", "/product/3"]+ }+ ]+ }+</script>+```++### Example of a simple document rule for prerendering all same-origin links on a page++```html+<script type="speculationrules">+ {+ "tag": "all-links-speculations",+ "prerender": [{+ "where": { "href_matches": "/*" }+ }]+ }+</script>+```++### Example of a complex document rule for prerendering links with exclusions for interactive sites++```html+<script type="speculationrules">+ {+ "tag": "speculations-with-exclusions",+ "prerender": [{+ "where": {+ "and": [+ { "href_matches": "/*" },+ { "not": {"href_matches": "/wp-admin"}},+ { "not": {"href_matches": "/*\\?*(^|&)add-to-cart=*"}},+ { "not": {"selector_matches": ".do-not-prerender"}},+ { "not": {"selector_matches": "[rel~=nofollow]"}}+ ]+ }+ }]+ }+</script>+```++### Example of a mixed rule set++This example shows a rule set that prefetches all links eagerly, and then goes further than this to prerender those same links when it gets more signals with `moderate` eagerness.++```html+<script type="speculationrules">+ {+ "prefetch": [{+ "tag": "prefetch-speculations",+ "where": { "href_matches": "/*" },+ "eagerness": "eager"+ }],+ "prerender": [{+ "tag": "prerender-speculations",+ "where": { "href_matches": "/*" },+ "eagerness": "moderate"+ }]+ }+</script>+```++## Best Practices++- **DO** use speculation rules to prefetch and prerender pages that the user is likely to visit next.+- **DO** use speculation rules for static sites, where the content is not likely to change often, and where pages are cheaper to produce—especially if cached at the edge.+- **DO** take more care when using speculation rules for dynamic pages, where the content is more likely to change often, may become out of date, and where pages are more expensive to produce.+- **DO** prefer document rules over list rules, as they are more flexible, allow the same rule to be shared across multiple pages, and can be used to prefetch and prerender pages that are not known in advance.+- **DO** consider the trade-offs between prefetch and prerender, and choose the appropriate one for your use case. Prerender is more expensive than prefetch and can cause more unintended side effects in complex applications that display dynamic state, but provides a better user experience. Ask the developer for their preference if unsure.+- **DO** consider the trade-offs between the different `eagerness` levels, and choose the appropriate one for your use case. More eager speculation provides a better user experience but uses more resources and can cause more unintended side effects in complex applications that display dynamic state. Ask the developer for their preference if unsure.+- **DO NOT** overuse speculation rules, for example, to speculate every link on the page. Browsers have limits (2 speculations for non-eager speculations). `immediate` should only be used for a very small number of links.+- **DO NOT** speculate URLs that likely trigger state changes, like `/logout` or `/add-to-cart`, and explicitly exclude them from your speculation rules if they are likely to be included in document rules.+- **DO NOT** use speculation rules on Single Page Applications (SPAs). Speculation rules are designed for multi-page applications (MPAs) where the browser navigates to a new document on each navigation. In SPAs, the browser does not navigate to a new document on each navigation, so speculation rules will not work as expected.++## Browser support and fallback strategies++Speculative loading is a new feature, and as such, is not supported in all modern browsers (Baseline limited availability).++However, speculative loading is a progressive enhancement. It is perfectly safe to use as an enhancement, and is highly recommended given the potential performance benefits. If a browser does not support speculation rules, it will simply ignore them.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-image-priority.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-image-priority.mdnew file mode 100644index 0000000..70bfa7a--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-image-priority.md@@ -0,0 +1,60 @@+# Optimize image priority++Browsers use heuristics to assign loading priorities to images, but these defaults may not always align with your page's Largest Contentful Paint (LCP). Using `fetchpriority` on an `<img>` element allows you to explicitly signal an image's importance to the browser, ensuring critical images load faster while non-essential ones don't compete for bandwidth.++## How to implement++1. **Identify the LCP image**: Determine which image is the most likely candidate for the Largest Contentful Paint (usually the hero image at the top of the page).+2. **Elevate LCP priority**: Add `fetchpriority="high"` to the `<img>` element for the LCP candidate.+3. **Deprioritize non-critical images**: For images that are part of a secondary UI or are only revealed after user interaction (like mega menus, modals, or off-screen carousel slides), add `fetchpriority="low"`.+4. **Optimize lazy loading**: Never use `loading="lazy"` on the LCP image. For standard below-the-fold images, `loading="lazy"` is sufficient to defer the request until the user scrolls near them. Avoid adding `fetchpriority="low"` to these images, as you want them to load at normal priority once the user scrolls to them. Reserve `fetchpriority="low"` for images that are technically "above the fold" but not initially visible (e.g., hidden carousel slides or mega menus). For these hidden images, it is acceptable to use `loading="lazy"` as well; the browser will handle the request timing while respecting the low priority.+5. **Prefer default priorities**: If an image should have normal loading priority, omit the `fetchpriority` attribute entirely rather than setting it to `auto`. This is a stylistic convention to keep your HTML cleaner while relying on the browser's native heuristics.++## Example code++```html+<!-- Elevate priority for the LCP image -->+<img src="/images/hero-lcp.jpg"+ alt="Main Banner"+ fetchpriority="high"+ width="800" height="400">++<!-- Deprioritize initially hidden images above the fold -->+<img src="/images/gallery-alt.jpg"+ alt="Gallery Image"+ fetchpriority="low"+ width="400" height="300">++<!-- Deprioritize images revealed only after user interaction -->+<img src="/images/mega-menu-promo.jpg"+ alt="Special Offer"+ fetchpriority="low"+ width="300" height="150">++<!-- Use lazy loading ALONE for standard below-the-fold images -->+<img src="/images/footer-logo.png"+ alt="Footer Logo"+ loading="lazy"+ width="120" height="60">++<!-- Omit fetchpriority for images with standard priority -->+<img src="/images/standard-image.jpg"+ alt="Standard Image"+ width="400" height="300">+```++## Best practices++- **MANDATORY**: Always apply `fetchpriority="high"` to the LCP image.+- **MANDATORY**: Only use `fetchpriority="high"` on at most 1-2 critical images to avoid network contention and diluting the priority boost.+- **MANDATORY**: Use `fetchpriority="low"` for images that are technically "above the fold" but initially hidden (e.g., hidden carousel slides, mega menu images).+- **MANDATORY**: **Do not** use `fetchpriority="low"` on standard below-the-fold images that are already using `loading="lazy"`. These images should load at normal priority once they enter the viewport.+- **RECOMMENDED**: Avoid using `fetchpriority="auto"`. If you want the default priority, omit the attribute entirely to keep your HTML clean.+- **DO NOT** combine `fetchpriority="high"` with `loading="lazy"` for the LCP image.+- **DO NOT** use the deprecated `importance` attribute. It has been replaced by `fetchpriority` and is not supported by any browser.++## Fallback strategy++Fetch priority is Newly. It's been Baseline since 2024-10-29.++The `fetchpriority` attribute is a progressive enhancement for the `<img>` element. If a browser does not support it, the attribute is ignored, and the browser uses its default priority heuristics.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-preload-priority.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-preload-priority.mdnew file mode 100644index 0000000..bc2f026--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-preload-priority.md@@ -0,0 +1,40 @@+# Optimize preload priority++Preloading resources with `<link rel="preload">` signals to the browser that a resource will be needed soon. However, preloads inherit the default priority for the resource type and for images in particular this is low. Using `fetchpriority` allows you to refine this relative priority, in particular ensuring image preloads are preloaded with a high priority allowing them to start earlier and use get more bandwidth resources.++## How to implement++1. **Identify preload candidates**: Find resources that are not discovered early by the browser (e.g., video poster images or background images in CSS) but are essential for the page's appearance.+2. **Elevate critical image preloads**: For the LCP image or other critical images that are not prioritized by default, use `<link rel="preload" fetchpriority="high">` to ensure they are prioritized above other preloads. Note that fonts are already high priority by default.+3. **Deprioritize non-critical preloads**: For resources that aren't critical for the initial render (e.g., a background video or secondary fonts), use `<link rel="preload" fetchpriority="low">`.+4. **Coordinate with resource types**: Note that different `as` types have different default priorities; use `fetchpriority` to override these defaults when necessary.++## Example code++```html+<!-- Elevate priority for a video poster image that acts as the LCP candidate -->+<link rel="preload" href="/images/video-poster.jpg" as="image" fetchpriority="high">++<!-- Elevate priority for a critical LCP image that is hidden in CSS -->+<link rel="preload" href="/images/hero-background.jpg" as="image" fetchpriority="high">++<!-- Deprioritize a secondary font to avoid network contention -->+<link rel="preload" href="/fonts/secondary-font.woff2" as="font" type="font/woff2" fetchpriority="low" crossorigin>+```++## Best Practices++- **MANDATORY**: Only use `fetchpriority="high"` on at most 1-2 critical image preloads to avoid network contention and diluting the priority boost.+- **MANDATORY**: Use `fetchpriority="high"` on Largest Contentful Paint (LCP) images.+- **DO**: Limit the total number of preloads on a page to at most 2 images and 2-3 essential fonts to prevent bandwidth contention.+- **DO** use `fetchpriority="low"` for preloads that you want the browser to start early but not at the expense of critical resources (especially non-critical fonts).+- **DO** specify the `as` attribute correctly to ensure the preload will be used.+- **DO** prefer making critical resources (like LCP images) statically discoverable in HTML via `<img>` tags rather than relying on preloads for background images.+- **DO** ensure that font preloads always have the `crossorigin` attribute (even if same-origin).+- **DO NOT** use the deprecated `importance` attribute. It has been replaced by `fetchpriority`.++## Fallback strategy++Fetch priority is Newly. It's been Baseline since 2024-10-29.++The `fetchpriority` attribute on `<link rel="preload">` is a progressive enhancement. Browsers that do not support it will still preload the resource using their default priority for that resource type. To ensure compatibility, always provide correct `as` and `type` attributes.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-script-priority.md b/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-script-priority.mdnew file mode 100644index 0000000..4379544--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/performance/optimize-script-priority.md@@ -0,0 +1,37 @@+# Optimize script priority++Browsers assign default priorities to scripts based on where they appear in the document and whether they have attributes like `async` or `defer`. Using `fetchpriority` gives developers explicit control to ensure critical scripts load first, while non-essential scripts stay out of the way.++## How to implement++1. **Identify critical scripts**: Determine which scripts are essential for the page's core functionality or initial user interaction.+2. **Elevate critical async scripts**: For critical scripts loaded with `async` or `defer`, add the `fetchpriority="high"` attribute to ensure they are prioritized during the discovery phase.+3. **Deprioritize non-essential scripts**: For scripts that are not needed immediately (e.g., analytics, ads, or below-the-fold widgets), add `fetchpriority="low"` and ensure they have a `async`, `defer`, or `module` attribute to avoid blocking.+4. **Sequence parser-blocking scripts**: Use `fetchpriority="low"` on parser-blocking scripts at the end of the body to prevent them from contending for bandwidth with more critical resources.++## Example code++```html+<!-- Elevate the priority of the critical app logic -->+<script src="/js/app.js" async fetchpriority="high"></script>++<!-- Deprioritize non-essential tracking scripts -->+<script src="/js/tracker.js" async fetchpriority="low"></script>++<!-- Deprioritize late-body scripts to favor critical images or CSS -->+<script src="/js/legacy-widgets.js" fetchpriority="low"></script>+```++## Best Practices++- **MANDATORY**: Only use `fetchpriority="high"` on at most 1-2 critical scripts to avoid network contention and diluting the priority boost.+- **DO** use `fetchpriority="high"` specifically for `async` scripts that are known to be critical for Interaction to Next Paint (INP).+- **DO** deprioritize scripts that are not required for the initial user experience using `fetchpriority="low"`.+- **DO NOT** use `fetchpriority` on every script tag; it should only be used to change the browser's default heuristic when it is known to be sub-optimal.+- **DO NOT** use the deprecated `importance` attribute. It has been replaced by `fetchpriority`.++## Fallback strategy++Fetch priority is Newly. It's been Baseline since 2024-10-29.++The `fetchpriority` attribute is a progressive enhancement. Browsers that do not support it will ignore the attribute and use their internal scheduling logic without error. No explicit feature detection or fallback logic is required for basic usage.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/adapt-scrollbar-to-contrast-preferences.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/adapt-scrollbar-to-contrast-preferences.mdnew file mode 100644index 0000000..9834160--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/adapt-scrollbar-to-contrast-preferences.md@@ -0,0 +1,59 @@+# Adapt scrollbar to high-contrast preferences++Users who enable high-contrast modes in their operating system or browser expect UI elements (like scrollbars) to be extremely legible, often relying on stark foreground-background separation rather than subtle grays or theme colors.++This guide provides optional instructions on how to use the `@media (prefers-contrast: more)` CSS media feature to enforce high-contrast scrollbar styling.++## Enhance Legibility++When customizing scrollbars with `scrollbar-color` or custom variables, you can provide an explicit override for high-contrast modes. This is especially helpful if your primary application theme uses low-contrast scrollbars for aesthetic reasons.++OPTIONAL: Use a `@media (prefers-contrast: more)` block to define dark, distinct colors for the thumb and track.++```css+/* Define default standard colors as variables */+.scroller {+ --scrollbar-thumb: #bbb;+ --scrollbar-track: #f1f1f1;++ scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);+ scrollbar-width: thin;+ scrollbar-gutter: stable;+}++/* OPTIONAL: Provide clear, high-contrast overrides */+@media (prefers-contrast: more) {+ .scroller {+ /* Use extremely distinct colors like solid black against white */+ --scrollbar-thumb: #000000;+ --scrollbar-track: #ffffff;+ }+}+```++## Fallbacks & Browser Support++scrollbar-color is Newly. It's been Baseline since 2025-12-12.++If you are using legacy WebKit pseudo-elements to ensure custom colored scrollbars on older versions of Safari/Chrome, the variable assignments from the media query above will automatically cascade to the fallback.++OPTIONAL: If the user's Baseline target is "Baseline Widely Available" or earlier, you SHOULD ensure you provide the legacy fallback code block securely isolated behind `@supports not (scrollbar-color: auto)`.++```css+/* Legacy fallback for WebKit/Blink browsers */+@supports not (scrollbar-color: auto) {+ .scroller::-webkit-scrollbar {+ width: 12px;+ height: 12px;+ }+ .scroller::-webkit-scrollbar-thumb {+ /* Will inherit the high-contrast #000000 */+ background: var(--scrollbar-thumb);+ border: 3px solid var(--scrollbar-track);+ }+ .scroller::-webkit-scrollbar-track {+ /* Will inherit the high-contrast #ffffff */+ background: var(--scrollbar-track);+ }+}+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/adapt-scrollbar-to-light-dark-preferences.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/adapt-scrollbar-to-light-dark-preferences.mdnew file mode 100644index 0000000..01c90cb--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/adapt-scrollbar-to-light-dark-preferences.md@@ -0,0 +1,75 @@+# Adapt scrollbar to light/dark preferences++Users expect UI components, including scrollbars, to match the color scheme (light or dark mode) chosen in their operating system settings. The most essential step to achieving this is utilizing the `color-scheme` property. If you choose to apply explicit custom colors, you can use the `@media (prefers-color-scheme: dark)` CSS media feature to modify those colors dynamically.++## 1. System Default Adaptation++The simplest and most robust way to ensure the scrollbar adapts to the user's light/dark mode preference is to let the browser handle it via the `color-scheme` property. When a dark color scheme is enabled, the browser will automatically render its dark-variant scrollbar.++MANDATORY: Define `color-scheme` on the `:root` pseudo-class.++```css+:root {+ /* DO: Declare support for both light and dark systems */+ color-scheme: light dark;+}+```++## 2. Custom Color Adaptation++If you are using `scrollbar-color` or the non-standard `::-webkit-scrollbar` pseudo-elements to explicitly define custom scrollbar colors, you MUST ensure these colors are legible and appropriate in both light and dark modes.++MANDATORY: Use CSS custom properties (variables) to define your colors and update them within a `prefers-color-scheme` media query to avoid repetition.++```css+/* DO: Define light mode colors as variables */+.scroller {+ --scrollbar-thumb: #bbb;+ --scrollbar-track: #f1f1f1;++ /* DO: Apply standard property natively */+ scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);+ /* DO: Must define width to force macOS to apply the custom colors */+ scrollbar-width: thin;+ /* DO: Force the track background to be visible on macOS */+ scrollbar-gutter: stable;+}++/* DO: Override variables for dark mode */+@media (prefers-color-scheme: dark) {+ .scroller {+ --scrollbar-thumb: #555555;+ --scrollbar-track: #222222;+ }+}+```++## Fallbacks & Browser Support++scrollbar-color is Newly. It's been Baseline since 2025-12-12.++MANDATORY: If the user's Baseline target is "Baseline Widely Available" or earlier, you SHOULD include the non-standard `::-webkit-scrollbar` pseudo-elements as fallbacks.+MANDATORY: To prevent conflicts between standard properties and legacy WebKit selectors in browsers that support both natively (like modern Chrome), you MUST wrap legacy WebKit fallbacks in an `@supports not (scrollbar-color: auto)` block.+MANDATORY: On macOS, `scrollbar-color` (standard) and `::-webkit-scrollbar` (legacy) properties are ignored by default because macOS uses native "overlay" scrollbars. You MUST pair custom colors with `scrollbar-width` (e.g., `thin` or `auto`) to force macOS to render them.+MANDATORY: Even with `scrollbar-width` applied, macOS overlay scrollbars render the track (gutter) as transparent by default. If your design requires a visible track background color on MacOS, you MUST apply `scrollbar-gutter: stable;` to the scrollable container, but note that it only appears after the user hovers over the scrollbar.++++```css+/* Legacy fallback for WebKit/Blink browsers */+@supports not (scrollbar-color: auto) {+ .scroller::-webkit-scrollbar {+ /* DO: Must define base size in WebKit for custom colors to be visual */+ width: 12px;+ height: 12px;+ }+ .scroller::-webkit-scrollbar-thumb {+ /* DO: Apply the thumb variable */+ background: var(--scrollbar-thumb);+ }+ .scroller::-webkit-scrollbar-track {+ /* DO: Apply the track variable */+ background: var(--scrollbar-track);+ }+}+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/animate-scrollbar-color-on-scroll.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/animate-scrollbar-color-on-scroll.mdnew file mode 100644index 0000000..56a9b00--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/animate-scrollbar-color-on-scroll.md@@ -0,0 +1,67 @@+# Animate scrollbar color on scroll++Using CSS Scroll-Driven Animations, it is possible to create striking visual effects by dynamically changing the color of the scrollbar thumb based on the user's scroll position.++Because the standard `scrollbar-color` property is mathematically defined as "discrete", it does not smoothly interpolate between two colors by default during a standard `@keyframes` animation. To achieve smooth scrolling transitions, you MUST use the CSS `@property` rule to register an interpolatable `<color>` variable.++MANDATORY: You MUST clarify in your CSS output or documentation that this progressive enhancement strictly relies on browser support for **both** the `registered-custom-properties` and `scroll-driven-animations` Web Features. This technique is **not polyfillable**, even with a fallback. Browsers failing to support these modern standards will gracefully ignore the animation and render the default `initial-value` color state with no adverse layout effects.++## 1. Register a custom Color Property++MANDATORY: You MUST define a CSS `@property` with the `<color>` syntax so the browser knows how to smoothly transition the variable.++```css+/* DO: Register an interpolatable variable */+@property --thumb-color {+ syntax: '<color>';+ inherits: true;+ initial-value: hotpink;+}+```++## 2. Define the Scroll Animation++MANDATORY: Create a standard `@keyframes` animation block that alters the registered custom property, and apply it to the scrollable container using `animation-timeline: scroll(self)`.++```css+/* DO: Animate the custom property */+@keyframes scrollbar-shift {+ 0% { --thumb-color: hotpink; }+ 50% { --thumb-color: purple; }+ 100% { --thumb-color: blue; }+}++.scroller {+ /* DO: Apply the standard colors using the variable, with a solid fallback color */+ scrollbar-color: var(--thumb-color, hotpink) #f1f1f1;+ scrollbar-width: thin;++ /* DO: Bind the animation to the scroll position */+ animation: scrollbar-shift linear;+ animation-timeline: scroll(self);+}+```++## 3. Fallbacks & Browser Support++Scroll-driven animations is Limited.+Registered custom properties is Newly. It's been Baseline since 2024-07-09.++MANDATORY: This feature relies on the `registered-custom-properties` and `scroll-driven-animations` Web Features. These are modern standards without polyfills. If they are not available in the user's Baseline target (e.g., they target "Baseline Widely Available"), you MUST NOT use this animated feature and let the user know it cannot be supported on their target.+MANDATORY: Pass the animated variable into the `::-webkit-scrollbar-thumb` background color securely isolated behind an `@supports not` block. You MUST include a static fallback color inside the `var()` function (e.g., `var(--thumb-color, hotpink)`) so the scrollbar remains visible on legacy WebKit browsers that do not support `@property`.++```css+/* Legacy fallback for WebKit/Blink browsers */+@supports not (scrollbar-color: auto) {+ .scroller::-webkit-scrollbar {+ width: 12px;+ }+ .scroller::-webkit-scrollbar-track {+ background: #f1f1f1;+ }+ .scroller::-webkit-scrollbar-thumb {+ /* DO: Inherit and provide a solid fallback color for browsers without @property support */+ background-color: var(--thumb-color, hotpink);+ }+}+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/customize-scrollbar-color-and-thickness.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/customize-scrollbar-color-and-thickness.mdnew file mode 100644index 0000000..63802b2--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/customize-scrollbar-color-and-thickness.md@@ -0,0 +1,66 @@+# Customize the color or thickness of a scrollbar++You can customize the appearance of scrollbars using the standard CSS properties `scrollbar-color` and `scrollbar-width`.++* **`scrollbar-color`**: Accepts two `<color>` values. The first applies to the thumb (the moving part), and the second to the track (the fixed background).+* **`scrollbar-width`**: Accepts `auto` (default), `thin` (a thinner variant), or `none` (hides the scrollbar completely while maintaining scrollability).++## Apply `scrollbar-color` and `scrollbar-width`++MANDATORY: Use `scrollbar-color` and `scrollbar-width` on the scrollable container.++```css+.scroller {+ /* DO: Specify thumb color first, then track color for modern browsers */+ scrollbar-color: hotpink blue;+ /* DO: Apply standard width property natively */+ scrollbar-width: thin;+}++.scroller-hidden {+ /* DO: Use none to hide scrollbar but keep scrollability */+ scrollbar-width: none;+}+```++## Fallbacks & Browser Support++scrollbar-color is Newly. It's been Baseline since 2025-12-12.++MANDATORY: If the user's Baseline target is "Baseline Widely Available" or earlier, you SHOULD include the non-standard `::-webkit-scrollbar` pseudo-elements as fallbacks.+MANDATORY: To prevent conflicts between standard properties and legacy WebKit selectors in browsers that support both natively (like modern Chrome), you MUST wrap legacy WebKit fallbacks in an `@supports not (scrollbar-color: auto)` block.+MANDATORY: On macOS, `scrollbar-color` (standard) and `::-webkit-scrollbar` (legacy) properties are ignored by default because macOS uses native "overlay" scrollbars. You MUST apply `scrollbar-width` (e.g., `thin` or `auto`) to force macOS to render custom colors.+MANDATORY: Even with `scrollbar-width` applied, macOS overlay scrollbars render the track (gutter) as transparent by default. If your design requires a visible track background color on MacOS, you MUST apply `scrollbar-gutter: stable;` to the scrollable container.++```css+.scroller {+ /* DO: Apply standard properties natively */+ scrollbar-color: hotpink blue;+ scrollbar-width: thin;+ /* DO: Force the track background to be visible on macOS */+ scrollbar-gutter: stable;+}++/* Legacy fallback for WebKit/Blink browsers */+@supports not (scrollbar-color: auto) {+ .scroller::-webkit-scrollbar {+ /* DO: Must define base size in WebKit for custom colors to be visual */+ width: 12px;+ height: 12px;+ }+ .scroller::-webkit-scrollbar-thumb {+ /* DO: Use background to color the thumb */+ background: hotpink;+ border-radius: 6px;+ }+ .scroller::-webkit-scrollbar-track {+ /* DO: Use background to color the track */+ background: blue;+ }++ .scroller-hidden::-webkit-scrollbar {+ display: none;+ width: 0;+ }+}+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/required-field-feedback.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/required-field-feedback.mdnew file mode 100644index 0000000..276c76d--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/required-field-feedback.md@@ -0,0 +1,173 @@+# Required Field Feedback++## The Problem+Marking required fields with an error state immediately upon page load can be confusing. Ideally, a required field should only look "invalid" if the user has attempted to fill it out and failed.++## The Solution+The `:user-invalid` pseudo-class solves this perfectly. For a required field, it will not match on page load. It will only match if:+1. The user interacts with the field (e.g., types a character and deletes it) and then leaves it (blur), leaving it empty.+2. The user attempts to submit the form while the field is empty.++### Implementation Strategy++1. **HTML Constraint**: Add the `required` attribute to your inputs.+2. **Visual Feedback**: Use `:user-invalid` to style the border red and show a "Required" helper text.+3. **Timing**: Rely on the browser's native timing for visual feedback. You don't need `onBlur` handlers to add a `touched` class anymore, though some JavaScript is still needed to sync ARIA attributes (see below).++## Implementation Guide++### 1. HTML Structure+```html+<form>+ <div class="field">+ <label for="full-name">Full Name</label>+ <input+ type="text"+ id="full-name"+ name="full-name"+ required+ aria-errormessage="name-error"+ >+ <div id="name-error" class="error-msg">+ This field is required.+ </div>+ </div>+</form>+```++### 2. CSS+```css+.error-msg {+ display: none;+ color: #d93025;+ font-size: 0.875rem;+ margin-top: 0.25rem;+}++/*+ Only highlight empty required fields AFTER the user visits them.+*/+input:user-invalid {+ border-color: #d93025;+ background-color: #fce8e6;+}++input:user-invalid + .error-msg {+ display: block;+}++/* Optional: Subtle indicator for required fields that are valid */+input:required:user-valid {+ border-color: #188038;+ border-width: 2px;+}+```++## Fallbacking & Browser Support++The `:user-invalid` pseudo-class is widely supported (Baseline 2023), but if you need to support older browsers, you must ensure consistency of the implementation.++### CSS for Fallback+```css+input:user-invalid,+input.user-invalid-fallback {+ border-color: #d93025;+ background-color: #fce8e6;+}++input:user-invalid + .error-msg,+input.user-invalid-fallback + .error-msg {+ display: block;+}+```++### JavaScript Fallback++DO: Use a reusable utility that tracks interaction state using a `WeakMap`. This avoids polluting the DOM with "dirty" classes or data attributes.++```javascript+const UserInvalidFallback = (() => {+ const dirtyState = new WeakMap();++ const updateState = (input) => {+ const isValid = input.checkValidity();++ // Update both visual and ARIA state+ input.classList.toggle('user-invalid-fallback', !isValid);+ input.classList.toggle('user-valid-fallback', isValid);++ if (!isValid) {+ input.setAttribute('aria-invalid', 'true');+ } else {+ input.removeAttribute('aria-invalid');+ }+ };++ const handleEvent = (event) => {+ const input = event.target;++ if (event.type === 'reset') {+ const controls = input.elements || [];+ for (const control of controls) {+ dirtyState.delete(control);+ control.classList.remove('user-invalid-fallback');+ control.classList.remove('user-valid-fallback');+ control.removeAttribute('aria-invalid');+ }+ return;+ }++ if (!input.checkValidity) return;++ if (event.type === 'input' || event.type === 'change') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasInteracted = true;+ dirtyState.set(input, state);+ if (state.hasBlurred) {+ updateState(input);+ }+ } else if (event.type === 'blur') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasBlurred = true;+ dirtyState.set(input, state);+ if (state.hasInteracted) {+ updateState(input);+ }+ }+ };++ const init = (root = document) => {+ if (CSS.supports('selector(:user-invalid)')) return;++ root.addEventListener('blur', handleEvent, true); // Capture phase+ root.addEventListener('input', handleEvent);+ root.addEventListener('change', handleEvent);+ root.addEventListener('reset', handleEvent, true); // Capture resets+ };++ return { init };+})();++// Initialize for a specific form+const form = document.querySelector('#demo-form');+UserInvalidFallback.init(form);+```++## Other Considerations++1. **Asterisks**: It is still best practice to indicate required fields visually (e.g., with an asterisk `*`) in the label, so users know what to expect *before* they interact.+2. **Submit Buttons**: Unlike `disabled` buttons, keep your submit button enabled. If the user clicks it, the browser will automatically trigger `:user-invalid` on all empty required fields and focus the first one. This is excellent for accessibility and UX.+3. **Accessibility**: Native `:user-invalid` does not automatically sync with ARIA attributes. Add the following JavaScript to keep `aria-invalid` in sync with the visual state:++```javascript+// Sync aria-invalid with the CSS :user-invalid state+const syncAria = (el) => {+ el.toggleAttribute?.('aria-invalid', el.matches(':user-invalid'));+};++// Update on blur (to show error) and input (to clear it)+document.addEventListener('blur', (e) => syncAria(e.target), true);+document.addEventListener('input', (e) => {+ if (e.target.hasAttribute('aria-invalid')) syncAria(e.target);+});+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/search-hidden-content.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/search-hidden-content.mdnew file mode 100644index 0000000..9640fc1--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/search-hidden-content.md@@ -0,0 +1,129 @@+# Search hidden content++Web interfaces often hide content from view to improve the user experience, save screen space, or increase page performance. Traditional methods like `display: none` or `visibility: hidden` work to hide content visually, but they also make that content completely inaccessible to screen readers and browser features like "Find in page".++To hide content visually but still allow it to be searchable by users and enable it to be deep linked to via URL fragments and "Scroll to Text Fragment" links, you can use either the HTML `<details>` element or the `hidden="until-found"` attribute. The `<details>` element is generally recommended as it's simpler to implement and maintain, but there are some more complex cases where `<details>` is not sufficient and `hidden="until-found"` is required.++For example:++- If you want full control over the styling of the show/hide mechanism.+- If the UI controls to show/hide the content are in another part of the DOM.+- If you don't want to support hiding the content after it's shown.++## How to implement++The `<details>` element has searchable and accessible text by default, and no special implementation is required. Prefer using `<details>` over `hidden="until-found"` if possible.++If you need to use `hidden="until-found"` instead, follow these instructions:++1. **Apply the attribute:** Add the `hidden="until-found"` HTML attribute directly to the elements containing the content that should be hidden from view.+2. **Synchronize UI state:** If the interface has related states that depend on the content's visibility (e.g., updating ARIA attributes, toggling open/close CSS classes, or rotating accordion icons):+ - You **MUST** add an event listener for the `beforematch` event.+ - Register the `beforematch` event listener directly on the element carrying the `hidden="until-found"` attribute. Since the event bubbles, you may alternatively use event delegation by registering a single listener on a parent element (such as a tab container) to manage multiple hidden sections at once.+ - Inside the event listener, execute the logic to synchronize related UI elements (such as closing other open tabs or changing the state of a toggle button).++## Example code++**Goal:** Render a hidden container where the content remains invisible to the user until they search for a word within that section.++### Using `<details>` element++```html+<details>+ <summary>Click to expand</summary>+ <p>This content is visually hidden.</p>+</details>+```++#### Mutually exclusive content (e.g. tabs)++When handling mutually exclusive regions, like tabs, use the native HTML `<details>` element with a shared `name` attribute.++```html+<div class="tab-container">+ <!-- The name attribute creates an exclusive accordion/tab group -->+ <details class="tab" name="my-tabs">+ <summary>Tab 1 (closed)</summary>+ <p>Tab 1 content</p>+ </details>++ <details class="tab" name="my-tabs" open>+ <summary>Tab 2 (open)</summary>+ <p>Tab 2 content</p>+ </details>++ <details class="tab" name="my-tabs">+ <summary>Tab 3 (closed)</summary>+ <p>Tab 3 content</p>+ </details>+</div>+```++### Using `hidden="until-found"` attribute++```html+<!-- The browser automatically removes hidden="until-found" upon a search match -->+<div class="hidden-container" hidden="until-found">+ <p>This content is visually hidden.</p>+</div>+```++#### Mutually exclusive content (e.g. tabs)++When handling mutually exclusive regions, like tabs, ensure only the matched tab becomes visible. Since the `beforematch` event bubbles, you can listen on a parent container to manage state before the browser reveals the matched content.++```html+<div class="tab-container">+ <div class="tab">+ <p>Tab 1 content (visible)</p>+ </div>++ <div class="tab" hidden="until-found">+ <p>Tab 2 content (hidden)</p>+ </div>++ <div class="tab" hidden="until-found">+ <p>Tab 3 content (hidden)</p>+ </div>+</div>+```++```javascript+const tabContainer = document.querySelector('.tab-container');++tabContainer.addEventListener('beforematch', () => {+ // Hide all tabs before the browser reveals the matched tab+ tabContainer.querySelectorAll('.tab').forEach((tab) => {+ tab.hidden = 'until-found';+ });+});+```++## Best practices for `hidden="until-found"`++- **DO** apply borders, padding, and backgrounds to nested child wrappers rather than directly to the element with the `hidden="until-found"` attribute. This prevents unintended layout shifts or visual remnants while the element is hidden.+- **DO NOT** apply `display: none`, `visibility: hidden`, or any associated `display` or `visibility` CSS properties directly to elements with the `hidden="until-found"` attribute. This breaks the native functionality and permanently hides the content from the search index.+- **DO NOT** use `hidden="until-found"` for sensitive information, internal data tokens, or irrelevant data that should not be exposed via search.+- **DO NOT** use `hidden="until-found"` as a replacement for "screen reader only" (.sr-only) text.++## Browser support and fallback strategies++The `<details>` element is Baseline Widely available, so a fallback strategy is not required.++The `hidden="until-found"` attribute is not yet Baseline Widely available, but it can be safely used with a fallback in unsupporting browsers. **DO NOT** avoid `hidden="until-found"` because of missing browser support, as its accessiblity benefits far outweigh the cost of implementing a fallback.++#### `hidden="until-found"` fallback++For standard UI elements like accordions or "Read more" sections, use JavaScript to feature-detect and show all content if the feature is unsupported.++```javascript+if (!('onbeforematch' in HTMLElement.prototype)) {+ // Expand all hidden content for unsupported browsers+ document.querySelectorAll('[hidden="until-found"]').forEach((el) => {+ el.removeAttribute('hidden');+ // MANDATORY: also update any aria references to this element.+ });+}+```++For mutually exclusive UI paradigms (like tabs where content shares the same visual region), the fallback should extract and display all content linearly below the main interactive area, using URL anchor fragments to allow users to navigate directly to the respective sections.diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/select-menu-interaction.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/select-menu-interaction.mdnew file mode 100644index 0000000..1ab9ba3--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/select-menu-interaction.md@@ -0,0 +1,175 @@+# Select Menu Interaction++## The Problem+For mandatory dropdowns (e.g., "Choose a Country"), standard validation flags the field as invalid immediately if the default option has an empty value. This can create visual noise. We want to show the error only if the user opens the menu and closes it without choosing an option, or attempts to submit the form.++## The Solution+The `:user-invalid` pseudo-class works seamlessly with `<select>` elements. It respects the user's interaction flow: simply loading the page or focusing/blurring without making a change doesn't count as an interaction, so the field stays neutral until they actively attempt a selection.++### Implementation Strategy++1. **HTML Constraint**: Use a `<select>` with `required`. The first option should have `value=""` and ideally be disabled/hidden to force a valid choice.+2. **Visual Feedback**: Use `:user-invalid` to style the select box border.+3. **Timing**: The browser considers the field "interacted" if the user changes the value (even back to the default invalid state) before they blur the control, or upon form submission.++## Implementation Guide++### 1. HTML Structure+The "placeholder" option is key here.++```html+<form>+ <div class="field">+ <label for="country">Country</label>+ <select+ id="country"+ name="country"+ required+ aria-errormessage="country-error"+ >+ <option value="" disabled selected>Select a country...</option>+ <option value="us">United States</option>+ <option value="ca">Canada</option>+ <option value="uk">United Kingdom</option>+ </select>+ <div id="country-error" class="error-msg">+ Please select a country.+ </div>+ </div>+</form>+```++### 2. CSS+```css+.error-msg {+ display: none;+ color: #d93025;+ font-size: 0.875rem;+ margin-top: 0.25rem;+}++/*+ Only show error after the user visits the select menu.+*/+select:user-invalid {+ border-color: #d93025;+ background-color: #fce8e6;+}++select:user-invalid + .error-msg {+ display: block;+}++select:user-valid {+ border-color: #188038;+}+```++## Fallbacking & Browser Support++The `:user-invalid` pseudo-class is widely supported (Baseline 2023), but if you need to support older browsers, you must ensure consistency of the implementation.++### CSS for Fallback+```css+select:user-invalid,+select.user-invalid-fallback {+ border-color: #d93025;+ background-color: #fce8e6;+}++select:user-invalid + .error-msg,+select.user-invalid-fallback + .error-msg {+ display: block;+}+```++### JavaScript Fallback++DO: Use a reusable utility that tracks interaction state using a `WeakMap`. This avoids polluting the DOM with "dirty" classes or data attributes.++```javascript+const UserInvalidFallback = (() => {+ const dirtyState = new WeakMap();++ const updateState = (input) => {+ const isValid = input.checkValidity();++ // Update both visual and ARIA state+ input.classList.toggle('user-invalid-fallback', !isValid);+ input.classList.toggle('user-valid-fallback', isValid);++ if (!isValid) {+ input.setAttribute('aria-invalid', 'true');+ } else {+ input.removeAttribute('aria-invalid');+ }+ };++ const handleEvent = (event) => {+ const input = event.target;++ if (event.type === 'reset') {+ const controls = input.elements || [];+ for (const control of controls) {+ dirtyState.delete(control);+ control.classList.remove('user-invalid-fallback');+ control.classList.remove('user-valid-fallback');+ control.removeAttribute('aria-invalid');+ }+ return;+ }++ if (!input.checkValidity) return;++ if (event.type === 'input' || event.type === 'change') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasInteracted = true;+ dirtyState.set(input, state);+ if (state.hasBlurred) {+ updateState(input);+ }+ } else if (event.type === 'blur') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasBlurred = true;+ dirtyState.set(input, state);+ if (state.hasInteracted) {+ updateState(input);+ }+ }+ };++ const init = (root = document) => {+ if (CSS.supports('selector(:user-invalid)')) return;++ root.addEventListener('blur', handleEvent, true); // Capture phase+ root.addEventListener('input', handleEvent);+ root.addEventListener('change', handleEvent);+ root.addEventListener('reset', handleEvent, true); // Capture resets+ };++ return { init };+})();++// Initialize for a specific form+const form = document.querySelector('#demo-form');+UserInvalidFallback.init(form);+```+++## Other Considerations++1. **Mobile behavior**: On mobile devices, "blur" might happen differently depending on the OS picker. Testing on actual devices is recommended.+2. **Accessibility**: Native `:user-invalid` does not automatically sync with ARIA attributes. Add the following JavaScript to keep `aria-invalid` in sync with the visual state:++```javascript+// Sync aria-invalid with the CSS :user-invalid state+const syncAria = (el) => {+ el.toggleAttribute?.('aria-invalid', el.matches(':user-invalid'));+};++// Update on blur (to show error) and input (to clear it)+document.addEventListener('blur', (e) => syncAria(e.target), true);+document.addEventListener('input', (e) => {+ if (e.target.hasAttribute('aria-invalid')) syncAria(e.target);+});+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/style-parent-with-has.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/style-parent-with-has.mdnew file mode 100644index 0000000..025a2fe--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/style-parent-with-has.md@@ -0,0 +1,193 @@+# Style Parent with :has()++## The Problem+Often, an error state requires styling elements *outside* the input itself—for example, changing the color of a parent `fieldset` border, highlighting the `<label>`, or showing a global error icon in the card header. Historically, this required JavaScript to toggle classes on parent elements.++## The Solution+By combining `:has()` with `:user-invalid`, we can declaratively style any ancestor based on the validity state of a specific descendant. This keeps all presentation logic in CSS.++### Implementation Strategy++1. **Selector**: Use `.parent:has(:user-invalid)` to target the container.+2. **Scope**: Be specific to avoid performance issues. Target `.field-group` rather than `body`.+3. **Fallback**: Requires JS to toggle classes on the parent if `:has()` is not supported.++## Implementation Guide++### 1. HTML Structure+```html+<form>+ <div class="card-section">+ <div class="header">+ <h3>Profile Settings</h3>+ <span class="status-icon"></span>+ </div>++ <div class="field">+ <label for="username">Username</label>+ <input type="text" id="username" required>+ </div>+ </div>+</form>+```++### 2. CSS+```css+/* Default State */+.card-section {+ border: 1px solid #ccc;+ border-left: 4px solid #ccc;+}++/*+ Parent Styling Logic:+ If the card contains ANY user-invalid input, turn the whole card's edge red.+*/+.card-section:has(:user-invalid) {+ border-left-color: #d93025;+ background-color: #fff8f8;+}++/* Change the icon too */+.card-section:has(:user-invalid) .status-icon::after {+ content: "⚠️";+}+```++## Fallbacking & Browser Support++The `:user-invalid` pseudo-class is widely supported (Baseline 2023), but if you need to support older browsers, you must ensure consistency of the implementation.++### CSS for Fallback+We use a class `.has-error` on the parent to mimic the `:has()` behavior.++```css+/* Native */+.card-section:has(:user-invalid) {+ border-left-color: #d93025;+}++/* Fallback */+.card-section.has-error-fallback {+ border-left-color: #d93025;+}+```++### JavaScript Fallback++DO: Use a reusable utility that tracks interaction state using a `WeakMap`. This avoids polluting the DOM with "dirty" classes or data attributes.++```javascript+const UserInvalidFallback = (() => {+ const dirtyState = new WeakMap();++ const updateState = (input) => {+ const isValid = input.checkValidity();++ // Update both visual and ARIA state+ input.classList.toggle('user-invalid-fallback', !isValid);+ input.classList.toggle('user-valid-fallback', isValid);++ if (!isValid) {+ input.setAttribute('aria-invalid', 'true');+ } else {+ input.removeAttribute('aria-invalid');+ }+ };++ const handleEvent = (event) => {+ const input = event.target;++ if (event.type === 'reset') {+ const controls = input.elements || [];+ for (const control of controls) {+ dirtyState.delete(control);+ control.classList.remove('user-invalid-fallback');+ control.classList.remove('user-valid-fallback');+ control.removeAttribute('aria-invalid');+ }+ return;+ }++ if (!input.checkValidity) return;++ if (event.type === 'input' || event.type === 'change') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasInteracted = true;+ dirtyState.set(input, state);+ if (state.hasBlurred) {+ updateState(input);+ }+ } else if (event.type === 'blur') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasBlurred = true;+ dirtyState.set(input, state);+ if (state.hasInteracted) {+ updateState(input);+ }+ }+ };++ const init = (root = document) => {+ if (CSS.supports('selector(:user-invalid)')) return;++ root.addEventListener('blur', handleEvent, true); // Capture phase+ root.addEventListener('input', handleEvent);+ root.addEventListener('change', handleEvent);+ root.addEventListener('reset', handleEvent, true); // Capture resets+ };++ return { init };+})();++// 1. Initialize the generic fallback+const form = document.querySelector('#demo-form');+UserInvalidFallback.init(form);++// 2. Add specialized "parent styling" logic (Separate from fallback)+// Listen for changes to form validity after interaction+form.addEventListener('blur', (e) => {+ if (!e.target.matches('input, select, textarea')) return;++ // Find the container we want to style (sync with CSS)+ const container = e.target.closest('.card-section');+ if (!container) return;++ // Check if ANY fallbacked input in this container is invalid+ const hasError = container.querySelector('.user-invalid-fallback');+ container.classList.toggle('has-error-fallback', !!hasError);+}, true); // Capture phase to ensure we run after the fallback's blur listener++// Also handle input events for immediate cleanup+form.addEventListener('input', (e) => {+ const container = e.target.closest('.card-section');+ if (container) {+ const hasError = container.querySelector('.user-invalid-fallback');+ container.classList.toggle('has-error-fallback', !!hasError);+ }+});++// Handle form resets+form.addEventListener('reset', () => {+ form.querySelectorAll('.has-error-fallback').forEach(el => {+ el.classList.remove('has-error-fallback');+ });+});+```++## Other Considerations++1. **Accessibility**: Native `:user-invalid` does not automatically sync with ARIA attributes. Add the following JavaScript to keep `aria-invalid` in sync with the visual state:++```javascript+// Sync aria-invalid with the CSS :user-invalid state+const syncAria = (el) => {+ el.toggleAttribute?.('aria-invalid', el.matches(':user-invalid'));+};++// Update on blur (to show error) and input (to clear it)+document.addEventListener('blur', (e) => syncAria(e.target), true);+document.addEventListener('input', (e) => {+ if (e.target.hasAttribute('aria-invalid')) syncAria(e.target);+});+```diff --git a/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/validate-input-after-interaction.md b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/validate-input-after-interaction.mdnew file mode 100644index 0000000..424cfa8--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/build/guides/user-experience/validate-input-after-interaction.md@@ -0,0 +1,258 @@+# Validate Input After Interaction++## The Problem++Displaying validation errors the moment a user focuses on a field and starts typing is premature and distracting. For example, as a user types an email address (e.g., "user@gm") or a password with complex requirements, the field is technically invalid until completion. Standard `:invalid` styling results in an error state appearing immediately, frustrating the user.++## The Solution++The `:user-invalid` pseudo-class allows you to defer the error state until the user has "committed" to a value (by blurring the field) or attempted to submit the form. This ensures validation feedback is provided only after the user has finished interacting with the field.++### Implementation Strategy++1. **HTML Constraint**: DO use standard HTML5 attributes like `type="email"`, `pattern`, and `required` to trigger the browser's built-in validation logic.+2. **Visual Feedback**: DO use `:user-invalid` to apply error styling only after interaction.+3. **Positive Reinforcement**: DO optionally use `:user-valid` to give a green "success" indicator once the requirements are met.+4. **Graceful Recovery**: As soon as the user corrects the input to a valid format, `:user-invalid` stops matching, removing the error state immediately.++## Implementation Guide++### Use Case 1: Email Validation++MANDATORY: Rely on standard HTML5 attributes for email fields. The error message is hidden by default and only revealed when the browser determines the user has left the field in an invalid state.++```html+<form>+ <div class="field">+ <label for="email">Email Address</label>+ <!-- DO: Use standard HTML validation attributes like type="email" and required -->+ <input+ type="email"+ id="email"+ name="email"+ required+ autocomplete="email"+ placeholder="[email protected]"+ aria-errormessage="email-error"+ >+ <div id="email-error" class="error-msg">+ Please enter a valid email address (e.g. [email protected]).+ </div>+ </div>+</form>+```++```css+.error-msg {+ display: none;+ color: #d93025;+ font-size: 0.875rem;+ margin-top: 0.25rem;+}++/*+ DO: Only show error styles after user interaction.+ This prevents the "angry red border" on page load.+*/+input:user-invalid {+ border-color: #d93025;+ background-color: #fce8e6;+}++/* DO: Reveal the error message using the adjacent sibling selector */+input:user-invalid + .error-msg {+ display: block;+}++/* DO: Optionally provide a green success state on :user-valid */+input:user-valid {+ border-color: #188038;+}+```++### Use Case 2: Password Complexity++MANDATORY: Define the complexity rule using a Regex Lookahead pattern in the `pattern` attribute. The rules list is shown to guide the user, and highlighted if there's an error.++```html+<form>+ <div class="field">+ <label for="password">New Password</label>+ <!-- DO: Use pattern and minlength for complex password validation+ DO: Match all constraints with lookaheads via pattern attribute+ (?=.*\d) : Must contain at least one digit+ (?=.*[a-z]) : Must contain at least one lowercase letter+ (?=.*[A-Z]) : Must contain at least one uppercase letter+ (?=.*[\W_]) : Must contain at least one special char+ .{8,} : Must be at least 8 chars long+ -->+ <input+ type="password"+ id="password"+ autocomplete="new-password"+ required+ pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,}"+ minlength="8"+ aria-describedby="password-rules"+ >+ <!-- DO NOT: Hide the rules initially. Users need them to know what to type. -->+ <ul id="password-rules" class="rules-list">+ <li>At least 8 characters</li>+ <li>One uppercase letter</li>+ <li>One number</li>+ <li>One special character</li>+ </ul>+ </div>+</form>+```++```css+/* DO: State the default styling as neutral */+.rules-list { color: #5f6368; }++/* DO: Show invalid state (After interaction): Error */+input:user-invalid {+ border-color: #d93025;+ background-color: #fce8e6;+}++/* DO: Highlight rules list when error is shown */+input:user-invalid + .rules-list {+ color: #d93025;+}++/* DO: Add success indications for :user-valid state */+input:user-valid {+ border-color: #188038;+}+/* DO: Hide rules or turn them green once satisfied */+input:user-valid + .rules-list {+ display: none;+}+```++## Fallbacking & Browser Support++The `:user-invalid` pseudo-class is widely supported (Baseline 2023), but if you need to support older browsers, you must ensure consistency of the implementation.++### CSS for Fallback+DO: Ensure your fallback class shares the native styles. Group your selectors to ensure consistent styling.++```css+/* DO: Ensure native and fallback class share the same styles */+input:user-invalid,+input.user-invalid-fallback {+ border-color: #d93025;+ background-color: #fce8e6;+}++/* DO: Ensure the fallback triggers error messages equally */+input:user-invalid + .error-msg,+input.user-invalid-fallback + .error-msg {+ display: block;+}++/* DO: Ensure the fallback highlights rule lists equally */+input:user-invalid + .rules-list,+input.user-invalid-fallback + .rules-list {+ color: #d93025;+}+```++### JavaScript Fallback++DO: Use a reusable utility that tracks interaction state using a `WeakMap`. This avoids polluting the DOM with "dirty" classes or data attributes.++```javascript+/* DO: Keep state in a WeakMap for automatic cleanup */+const UserInvalidFallback = (() => {+ const dirtyState = new WeakMap();++ const updateState = (input) => {+ const isValid = input.checkValidity();++ // DO: Update both visual and ARIA state+ input.classList.toggle('user-invalid-fallback', !isValid);+ input.classList.toggle('user-valid-fallback', isValid);++ if (!isValid) {+ input.setAttribute('aria-invalid', 'true');+ } else {+ input.removeAttribute('aria-invalid');+ }+ };++ const handleEvent = (event) => {+ const input = event.target;++ if (event.type === 'reset') {+ const controls = input.elements || [];+ for (const control of controls) {+ dirtyState.delete(control);+ /* DO: Clean up dirty states whenever the form is reset */+ control.classList.remove('user-invalid-fallback');+ control.classList.remove('user-valid-fallback');+ control.removeAttribute('aria-invalid');+ }+ return;+ }++ if (!input.checkValidity) return;++ if (event.type === 'input' || event.type === 'change') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasInteracted = true;+ dirtyState.set(input, state);+ if (state.hasBlurred) {+ updateState(input);+ }+ } else if (event.type === 'blur') {+ const state = dirtyState.get(input) || { hasInteracted: false, hasBlurred: false };+ state.hasBlurred = true;+ dirtyState.set(input, state);+ if (state.hasInteracted) {+ updateState(input);+ }+ }+ };++ const init = (root = document) => {+ /* DO: Short-circuit initialization if CSS natively supported */+ if (CSS.supports('selector(:user-invalid)')) return;++ root.addEventListener('blur', handleEvent, true); // DO: Use Capture phase for blur+ root.addEventListener('input', handleEvent);+ root.addEventListener('change', handleEvent);+ root.addEventListener('reset', handleEvent, true); // DO: Capture resets+ };++ return { init };+})();++// DO: Initialize for a specific form container+const form = document.querySelector('#demo-form');+UserInvalidFallback.init(form);+```++## Other Considerations++1. **Accessibility**:+ * MANDATORY: Use `aria-describedby` to link the rules list to the input.+ * DO NOT: Hide rules lists entirely until the input is valid; users need to know what to type!+2. **Pattern Attribute Limits**: MANDATORY: The `pattern` attribute performs a full match (implied `^...$`). Ensure your password regex accounts for the entire string.+3. **Validation Strictness**: DO note that the browser's default `type="email"` validation is quite permissive (e.g., `user@localserver` might pass). If you need stricter validation, you may need to use a more robust validation library or a custom validation function alongside `type="email"`.+4. **Focus Management**: MANDATORY: If a user submits the form with an invalid field, the browser will automatically focus the first invalid field. Your `:user-invalid` styles will apply immediately because a submission attempt counts as an interaction.+5. **Consistent ARIA Experience**: Native `:user-invalid` does not automatically sync with ARIA attributes. Add the following JavaScript to keep `aria-invalid` in sync with the visual state:++```javascript+// Sync aria-invalid with the CSS :user-invalid state+const syncAria = (el) => {+ el.toggleAttribute?.('aria-invalid', el.matches(':user-invalid'));+};++// Update on blur (to show error) and input (to clear it)+document.addEventListener('blur', (e) => syncAria(e.target), true);+document.addEventListener('input', (e) => {+ if (e.target.hasAttribute('aria-invalid')) syncAria(e.target);+});+```diff --git a/skills-cli/modern-web-use-cases/cli/package-lock.json b/skills-cli/modern-web-use-cases/cli/package-lock.jsonnew file mode 100644index 0000000..800de3a--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/package-lock.json@@ -0,0 +1,1533 @@+{+ "name": "standalone-skills-cli",+ "version": "1.0.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "standalone-skills-cli",+ "version": "1.0.0",+ "dependencies": {+ "@huggingface/transformers": "^3.8.1",+ "@lancedb/lancedb": "^0.26.2"+ }+ },+ "node_modules/@emnapi/runtime": {+ "version": "1.9.1",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz",+ "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@huggingface/jinja": {+ "version": "0.5.6",+ "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.5.6.tgz",+ "integrity": "sha512-MyMWyLnjqo+KRJYSH7oWNbsOn5onuIvfXYPcc0WOGxU0eHUV7oAYUoQTl2BMdu7ml+ea/bu11UM+EshbeHwtIA==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@huggingface/transformers": {+ "version": "3.8.1",+ "resolved": "https://registry.npmjs.org/@huggingface/transformers/-/transformers-3.8.1.tgz",+ "integrity": "sha512-tsTk4zVjImqdqjS8/AOZg2yNLd1z9S5v+7oUPpXaasDRwEDhB+xnglK1k5cad26lL5/ZIaeREgWWy0bs9y9pPA==",+ "license": "Apache-2.0",+ "dependencies": {+ "@huggingface/jinja": "^0.5.3",+ "onnxruntime-node": "1.21.0",+ "onnxruntime-web": "1.22.0-dev.20250409-89f8206ba4",+ "sharp": "^0.34.1"+ }+ },+ "node_modules/@img/colour": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",+ "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@img/sharp-darwin-arm64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",+ "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-arm64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-darwin-x64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",+ "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-x64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-arm64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",+ "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",+ "cpu": [+ "arm64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-x64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",+ "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",+ "cpu": [+ "x64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",+ "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",+ "cpu": [+ "arm"+ ],+ "libc": [+ "glibc"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",+ "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",+ "cpu": [+ "arm64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-ppc64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",+ "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",+ "cpu": [+ "ppc64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-riscv64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",+ "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",+ "cpu": [+ "riscv64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-s390x": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",+ "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",+ "cpu": [+ "s390x"+ ],+ "libc": [+ "glibc"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-x64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",+ "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",+ "cpu": [+ "x64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",+ "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",+ "cpu": [+ "arm64"+ ],+ "libc": [+ "musl"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {+ "version": "1.2.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",+ "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",+ "cpu": [+ "x64"+ ],+ "libc": [+ "musl"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-linux-arm": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",+ "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",+ "cpu": [+ "arm"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linux-arm64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",+ "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",+ "cpu": [+ "arm64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linux-ppc64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",+ "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",+ "cpu": [+ "ppc64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-ppc64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linux-riscv64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",+ "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",+ "cpu": [+ "riscv64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-riscv64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linux-s390x": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",+ "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",+ "cpu": [+ "s390x"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-s390x": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linux-x64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",+ "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",+ "cpu": [+ "x64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-x64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-arm64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",+ "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",+ "cpu": [+ "arm64"+ ],+ "libc": [+ "musl"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-x64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",+ "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",+ "cpu": [+ "x64"+ ],+ "libc": [+ "musl"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-x64": "1.2.4"+ }+ },+ "node_modules/@img/sharp-wasm32": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",+ "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",+ "cpu": [+ "wasm32"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/runtime": "^1.7.0"+ },+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-arm64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",+ "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-ia32": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",+ "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",+ "cpu": [+ "ia32"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-x64": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",+ "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@isaacs/fs-minipass": {+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",+ "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",+ "license": "ISC",+ "dependencies": {+ "minipass": "^7.0.4"+ },+ "engines": {+ "node": ">=18.0.0"+ }+ },+ "node_modules/@lancedb/lancedb": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb/-/lancedb-0.26.2.tgz",+ "integrity": "sha512-umk4WMCTwJntLquwvUbpqE+TXREolcQVL9MHcxr8EhRjsha88+ATJ4QuS/hpyiE1CG3R/XcgrMgJAGkziPC/gA==",+ "cpu": [+ "x64",+ "arm64"+ ],+ "license": "Apache-2.0",+ "os": [+ "darwin",+ "linux",+ "win32"+ ],+ "dependencies": {+ "reflect-metadata": "^0.2.2"+ },+ "engines": {+ "node": ">= 18"+ },+ "optionalDependencies": {+ "@lancedb/lancedb-darwin-arm64": "0.26.2",+ "@lancedb/lancedb-linux-arm64-gnu": "0.26.2",+ "@lancedb/lancedb-linux-arm64-musl": "0.26.2",+ "@lancedb/lancedb-linux-x64-gnu": "0.26.2",+ "@lancedb/lancedb-linux-x64-musl": "0.26.2",+ "@lancedb/lancedb-win32-arm64-msvc": "0.26.2",+ "@lancedb/lancedb-win32-x64-msvc": "0.26.2"+ },+ "peerDependencies": {+ "apache-arrow": ">=15.0.0 <=18.1.0"+ }+ },+ "node_modules/@lancedb/lancedb-darwin-arm64": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-darwin-arm64/-/lancedb-darwin-arm64-0.26.2.tgz",+ "integrity": "sha512-LAZ/v261eTlv44KoEm+AdqGnohS9IbVVVJkH9+8JTqwhe/k4j4Af8X9cD18tsaJAAtrGxxOCyIJ3wZTiBqrkCw==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@lancedb/lancedb-linux-arm64-gnu": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-arm64-gnu/-/lancedb-linux-arm64-gnu-0.26.2.tgz",+ "integrity": "sha512-guHKm+zvuQB22dgyn6/sYZJvD6IL9lC24cl6ZuzVX/jYgag/gNLHT86HongrcBjgdjI6+YIGmdfD6b/iAKxn3Q==",+ "cpu": [+ "arm64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@lancedb/lancedb-linux-arm64-musl": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-arm64-musl/-/lancedb-linux-arm64-musl-0.26.2.tgz",+ "integrity": "sha512-pR6Hs/0iphItrJYYLf/yrqCC+scPcHpCGl6rHqcU2GHxo5RFpzlMzqW1DiXScGiBRuCcD9HIMec+kBsOgXv4GQ==",+ "cpu": [+ "arm64"+ ],+ "libc": [+ "musl"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@lancedb/lancedb-linux-x64-gnu": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-x64-gnu/-/lancedb-linux-x64-gnu-0.26.2.tgz",+ "integrity": "sha512-u4UUSPwd2YecgGqWjh9W0MHKgsVwB2Ch2ROpF8AY+IA7kpGsbB18R1/t7v2B0q7pahRy20dgsaku5LH1zuzMRQ==",+ "cpu": [+ "x64"+ ],+ "libc": [+ "glibc"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@lancedb/lancedb-linux-x64-musl": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-linux-x64-musl/-/lancedb-linux-x64-musl-0.26.2.tgz",+ "integrity": "sha512-XIS4qkVfGlzmsUPqAG2iKt8ykuz28GfemGC0ijXwu04kC1pYiCFzTpB3UIZjm5oM7OTync1aQ3mGTj1oCciSPA==",+ "cpu": [+ "x64"+ ],+ "libc": [+ "musl"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@lancedb/lancedb-win32-arm64-msvc": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-win32-arm64-msvc/-/lancedb-win32-arm64-msvc-0.26.2.tgz",+ "integrity": "sha512-//tZDPitm2PxNvalHP+m+Pf6VvFAeQgcht1+HJnutjH4gp6xYW6ynQlWWFDBmz9WRkUT+mXu2O4FUIhbdNaJSQ==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@lancedb/lancedb-win32-x64-msvc": {+ "version": "0.26.2",+ "resolved": "https://registry.npmjs.org/@lancedb/lancedb-win32-x64-msvc/-/lancedb-win32-x64-msvc-0.26.2.tgz",+ "integrity": "sha512-GH3pfyzicgPGTb84xMXgujlWDaAnBTmUyjooYiCE2tC24BaehX4hgFhXivamzAEsF5U2eVsA/J60Ppif+skAbA==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/@protobufjs/aspromise": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/base64": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/codegen": {+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/eventemitter": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",+ "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/fetch": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",+ "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.1",+ "@protobufjs/inquire": "^1.1.0"+ }+ },+ "node_modules/@protobufjs/float": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/inquire": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",+ "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/path": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/pool": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@protobufjs/utf8": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",+ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",+ "license": "BSD-3-Clause"+ },+ "node_modules/@swc/helpers": {+ "version": "0.5.19",+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.19.tgz",+ "integrity": "sha512-QamiFeIK3txNjgUTNppE6MiG3p7TdninpZu0E0PbqVh1a9FNLT2FRhisaa4NcaX52XVhA5l7Pk58Ft7Sqi/2sA==",+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "tslib": "^2.8.0"+ }+ },+ "node_modules/@types/command-line-args": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/@types/command-line-args/-/command-line-args-5.2.3.tgz",+ "integrity": "sha512-uv0aG6R0Y8WHZLTamZwtfsDLVRnOa+n+n5rEvFWL5Na5gZ8V2Teab/duDPFzIIIhs9qizDpcavCusCLJZu62Kw==",+ "license": "MIT",+ "peer": true+ },+ "node_modules/@types/command-line-usage": {+ "version": "5.0.4",+ "resolved": "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.4.tgz",+ "integrity": "sha512-BwR5KP3Es/CSht0xqBcUXS3qCAUVXwpRKsV2+arxeb65atasuXG9LykC9Ab10Cw3s2raH92ZqOeILaQbsB2ACg==",+ "license": "MIT",+ "peer": true+ },+ "node_modules/@types/node": {+ "version": "20.19.37",+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.37.tgz",+ "integrity": "sha512-8kzdPJ3FsNsVIurqBs7oodNnCEVbni9yUEkaHbgptDACOPW04jimGagZ51E6+lXUwJjgnBw+hyko/lkFWCldqw==",+ "license": "MIT",+ "dependencies": {+ "undici-types": "~6.21.0"+ }+ },+ "node_modules/ansi-styles": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "color-convert": "^2.0.1"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/apache-arrow": {+ "version": "18.1.0",+ "resolved": "https://registry.npmjs.org/apache-arrow/-/apache-arrow-18.1.0.tgz",+ "integrity": "sha512-v/ShMp57iBnBp4lDgV8Jx3d3Q5/Hac25FWmQ98eMahUiHPXcvwIMKJD0hBIgclm/FCG+LwPkAKtkRO1O/W0YGg==",+ "license": "Apache-2.0",+ "peer": true,+ "dependencies": {+ "@swc/helpers": "^0.5.11",+ "@types/command-line-args": "^5.2.3",+ "@types/command-line-usage": "^5.0.4",+ "@types/node": "^20.13.0",+ "command-line-args": "^5.2.1",+ "command-line-usage": "^7.0.1",+ "flatbuffers": "^24.3.25",+ "json-bignum": "^0.0.3",+ "tslib": "^2.6.2"+ },+ "bin": {+ "arrow2csv": "bin/arrow2csv.js"+ }+ },+ "node_modules/array-back": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz",+ "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/boolean": {+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",+ "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==",+ "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",+ "license": "MIT"+ },+ "node_modules/chalk": {+ "version": "4.1.2",+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "ansi-styles": "^4.1.0",+ "supports-color": "^7.1.0"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/chalk/chalk?sponsor=1"+ }+ },+ "node_modules/chalk-template": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz",+ "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "chalk": "^4.1.2"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/chalk-template?sponsor=1"+ }+ },+ "node_modules/chownr": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",+ "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "license": "MIT",+ "peer": true+ },+ "node_modules/command-line-args": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz",+ "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "array-back": "^3.1.0",+ "find-replace": "^3.0.0",+ "lodash.camelcase": "^4.3.0",+ "typical": "^4.0.0"+ },+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/command-line-usage": {+ "version": "7.0.4",+ "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.4.tgz",+ "integrity": "sha512-85UdvzTNx/+s5CkSgBm/0hzP80RFHAa7PsfeADE5ezZF3uHz3/Tqj9gIKGT9PTtpycc3Ua64T0oVulGfKxzfqg==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "array-back": "^6.2.2",+ "chalk-template": "^0.4.0",+ "table-layout": "^4.1.1",+ "typical": "^7.3.0"+ },+ "engines": {+ "node": ">=12.20.0"+ }+ },+ "node_modules/command-line-usage/node_modules/array-back": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.3.tgz",+ "integrity": "sha512-SGDvmg6QTYiTxCBkYVmThcoa67uLl35pyzRHdpCGBOcqFy6BtwnphoFPk7LhJshD+Yk1Kt35WGWeZPTgwR4Fhw==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12.17"+ }+ },+ "node_modules/command-line-usage/node_modules/typical": {+ "version": "7.3.0",+ "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz",+ "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12.17"+ }+ },+ "node_modules/define-data-property": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",+ "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",+ "license": "MIT",+ "dependencies": {+ "es-define-property": "^1.0.0",+ "es-errors": "^1.3.0",+ "gopd": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/define-properties": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",+ "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",+ "license": "MIT",+ "dependencies": {+ "define-data-property": "^1.0.1",+ "has-property-descriptors": "^1.0.0",+ "object-keys": "^1.1.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/detect-node": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",+ "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==",+ "license": "MIT"+ },+ "node_modules/es-define-property": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es-errors": {+ "version": "1.3.0",+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/es6-error": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",+ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",+ "license": "MIT"+ },+ "node_modules/escape-string-regexp": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",+ "license": "MIT",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/find-replace": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz",+ "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "array-back": "^3.0.1"+ },+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/flatbuffers": {+ "version": "24.12.23",+ "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-24.12.23.tgz",+ "integrity": "sha512-dLVCAISd5mhls514keQzmEG6QHmUUsNuWsb4tFafIUwvvgDjXhtfAYSKOzt5SWOy+qByV5pbsDZ+Vb7HUOBEdA==",+ "license": "Apache-2.0",+ "peer": true+ },+ "node_modules/global-agent": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",+ "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "boolean": "^3.0.1",+ "es6-error": "^4.1.1",+ "matcher": "^3.0.0",+ "roarr": "^2.15.3",+ "semver": "^7.3.2",+ "serialize-error": "^7.0.1"+ },+ "engines": {+ "node": ">=10.0"+ }+ },+ "node_modules/globalthis": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",+ "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",+ "license": "MIT",+ "dependencies": {+ "define-properties": "^1.2.1",+ "gopd": "^1.0.1"+ },+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/gopd": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/guid-typescript": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz",+ "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==",+ "license": "ISC"+ },+ "node_modules/has-flag": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/has-property-descriptors": {+ "version": "1.0.2",+ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",+ "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",+ "license": "MIT",+ "dependencies": {+ "es-define-property": "^1.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/json-bignum": {+ "version": "0.0.3",+ "resolved": "https://registry.npmjs.org/json-bignum/-/json-bignum-0.0.3.tgz",+ "integrity": "sha512-2WHyXj3OfHSgNyuzDbSxI1w2jgw5gkWSWhS7Qg4bWXx1nLk3jnbwfUeS0PSba3IzpTUWdHxBieELUzXRjQB2zg==",+ "peer": true,+ "engines": {+ "node": ">=0.8"+ }+ },+ "node_modules/json-stringify-safe": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",+ "license": "ISC"+ },+ "node_modules/lodash.camelcase": {+ "version": "4.3.0",+ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",+ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",+ "license": "MIT",+ "peer": true+ },+ "node_modules/long": {+ "version": "5.3.2",+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",+ "license": "Apache-2.0"+ },+ "node_modules/matcher": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",+ "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",+ "license": "MIT",+ "dependencies": {+ "escape-string-regexp": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/minipass": {+ "version": "7.1.3",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",+ "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=16 || 14 >=14.17"+ }+ },+ "node_modules/minizlib": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz",+ "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==",+ "license": "MIT",+ "dependencies": {+ "minipass": "^7.1.2"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/object-keys": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",+ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",+ "license": "MIT",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/onnxruntime-common": {+ "version": "1.21.0",+ "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.21.0.tgz",+ "integrity": "sha512-Q632iLLrtCAVOTO65dh2+mNbQir/QNTVBG3h/QdZBpns7mZ0RYbLRBgGABPbpU9351AgYy7SJf1WaeVwMrBFPQ==",+ "license": "MIT"+ },+ "node_modules/onnxruntime-node": {+ "version": "1.21.0",+ "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.21.0.tgz",+ "integrity": "sha512-NeaCX6WW2L8cRCSqy3bInlo5ojjQqu2fD3D+9W5qb5irwxhEyWKXeH2vZ8W9r6VxaMPUan+4/7NDwZMtouZxEw==",+ "hasInstallScript": true,+ "license": "MIT",+ "os": [+ "win32",+ "darwin",+ "linux"+ ],+ "dependencies": {+ "global-agent": "^3.0.0",+ "onnxruntime-common": "1.21.0",+ "tar": "^7.0.1"+ }+ },+ "node_modules/onnxruntime-web": {+ "version": "1.22.0-dev.20250409-89f8206ba4",+ "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.22.0-dev.20250409-89f8206ba4.tgz",+ "integrity": "sha512-0uS76OPgH0hWCPrFKlL8kYVV7ckM7t/36HfbgoFw6Nd0CZVVbQC4PkrR8mBX8LtNUFZO25IQBqV2Hx2ho3FlbQ==",+ "license": "MIT",+ "dependencies": {+ "flatbuffers": "^25.1.24",+ "guid-typescript": "^1.0.9",+ "long": "^5.2.3",+ "onnxruntime-common": "1.22.0-dev.20250409-89f8206ba4",+ "platform": "^1.3.6",+ "protobufjs": "^7.2.4"+ }+ },+ "node_modules/onnxruntime-web/node_modules/flatbuffers": {+ "version": "25.9.23",+ "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-25.9.23.tgz",+ "integrity": "sha512-MI1qs7Lo4Syw0EOzUl0xjs2lsoeqFku44KpngfIduHBYvzm8h2+7K8YMQh1JtVVVrUvhLpNwqVi4DERegUJhPQ==",+ "license": "Apache-2.0"+ },+ "node_modules/onnxruntime-web/node_modules/onnxruntime-common": {+ "version": "1.22.0-dev.20250409-89f8206ba4",+ "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.22.0-dev.20250409-89f8206ba4.tgz",+ "integrity": "sha512-vDJMkfCfb0b1A836rgHj+ORuZf4B4+cc2bASQtpeoJLueuFc5DuYwjIZUBrSvx/fO5IrLjLz+oTrB3pcGlhovQ==",+ "license": "MIT"+ },+ "node_modules/platform": {+ "version": "1.3.6",+ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",+ "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==",+ "license": "MIT"+ },+ "node_modules/protobufjs": {+ "version": "7.5.4",+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",+ "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",+ "hasInstallScript": true,+ "license": "BSD-3-Clause",+ "dependencies": {+ "@protobufjs/aspromise": "^1.1.2",+ "@protobufjs/base64": "^1.1.2",+ "@protobufjs/codegen": "^2.0.4",+ "@protobufjs/eventemitter": "^1.1.0",+ "@protobufjs/fetch": "^1.1.0",+ "@protobufjs/float": "^1.0.2",+ "@protobufjs/inquire": "^1.1.0",+ "@protobufjs/path": "^1.1.2",+ "@protobufjs/pool": "^1.1.0",+ "@protobufjs/utf8": "^1.1.0",+ "@types/node": ">=13.7.0",+ "long": "^5.0.0"+ },+ "engines": {+ "node": ">=12.0.0"+ }+ },+ "node_modules/reflect-metadata": {+ "version": "0.2.2",+ "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",+ "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",+ "license": "Apache-2.0"+ },+ "node_modules/roarr": {+ "version": "2.15.4",+ "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",+ "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==",+ "license": "BSD-3-Clause",+ "dependencies": {+ "boolean": "^3.0.1",+ "detect-node": "^2.0.4",+ "globalthis": "^1.0.1",+ "json-stringify-safe": "^5.0.1",+ "semver-compare": "^1.0.0",+ "sprintf-js": "^1.1.2"+ },+ "engines": {+ "node": ">=8.0"+ }+ },+ "node_modules/semver": {+ "version": "7.7.4",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",+ "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/semver-compare": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",+ "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==",+ "license": "MIT"+ },+ "node_modules/serialize-error": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",+ "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",+ "license": "MIT",+ "dependencies": {+ "type-fest": "^0.13.1"+ },+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/sharp": {+ "version": "0.34.5",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",+ "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@img/colour": "^1.0.0",+ "detect-libc": "^2.1.2",+ "semver": "^7.7.3"+ },+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-darwin-arm64": "0.34.5",+ "@img/sharp-darwin-x64": "0.34.5",+ "@img/sharp-libvips-darwin-arm64": "1.2.4",+ "@img/sharp-libvips-darwin-x64": "1.2.4",+ "@img/sharp-libvips-linux-arm": "1.2.4",+ "@img/sharp-libvips-linux-arm64": "1.2.4",+ "@img/sharp-libvips-linux-ppc64": "1.2.4",+ "@img/sharp-libvips-linux-riscv64": "1.2.4",+ "@img/sharp-libvips-linux-s390x": "1.2.4",+ "@img/sharp-libvips-linux-x64": "1.2.4",+ "@img/sharp-libvips-linuxmusl-arm64": "1.2.4",+ "@img/sharp-libvips-linuxmusl-x64": "1.2.4",+ "@img/sharp-linux-arm": "0.34.5",+ "@img/sharp-linux-arm64": "0.34.5",+ "@img/sharp-linux-ppc64": "0.34.5",+ "@img/sharp-linux-riscv64": "0.34.5",+ "@img/sharp-linux-s390x": "0.34.5",+ "@img/sharp-linux-x64": "0.34.5",+ "@img/sharp-linuxmusl-arm64": "0.34.5",+ "@img/sharp-linuxmusl-x64": "0.34.5",+ "@img/sharp-wasm32": "0.34.5",+ "@img/sharp-win32-arm64": "0.34.5",+ "@img/sharp-win32-ia32": "0.34.5",+ "@img/sharp-win32-x64": "0.34.5"+ }+ },+ "node_modules/sprintf-js": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",+ "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==",+ "license": "BSD-3-Clause"+ },+ "node_modules/supports-color": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "has-flag": "^4.0.0"+ },+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/table-layout": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz",+ "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "array-back": "^6.2.2",+ "wordwrapjs": "^5.1.0"+ },+ "engines": {+ "node": ">=12.17"+ }+ },+ "node_modules/table-layout/node_modules/array-back": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.3.tgz",+ "integrity": "sha512-SGDvmg6QTYiTxCBkYVmThcoa67uLl35pyzRHdpCGBOcqFy6BtwnphoFPk7LhJshD+Yk1Kt35WGWeZPTgwR4Fhw==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12.17"+ }+ },+ "node_modules/tar": {+ "version": "7.5.13",+ "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.13.tgz",+ "integrity": "sha512-tOG/7GyXpFevhXVh8jOPJrmtRpOTsYqUIkVdVooZYJS/z8WhfQUX8RJILmeuJNinGAMSu1veBr4asSHFt5/hng==",+ "license": "BlueOak-1.0.0",+ "dependencies": {+ "@isaacs/fs-minipass": "^4.0.0",+ "chownr": "^3.0.0",+ "minipass": "^7.1.2",+ "minizlib": "^3.1.0",+ "yallist": "^5.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "license": "0BSD"+ },+ "node_modules/type-fest": {+ "version": "0.13.1",+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",+ "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",+ "license": "(MIT OR CC0-1.0)",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/typical": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz",+ "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/undici-types": {+ "version": "6.21.0",+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",+ "license": "MIT"+ },+ "node_modules/wordwrapjs": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz",+ "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==",+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12.17"+ }+ },+ "node_modules/yallist": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",+ "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",+ "license": "BlueOak-1.0.0",+ "engines": {+ "node": ">=18"+ }+ }+ }+}diff --git a/skills-cli/modern-web-use-cases/cli/package.json b/skills-cli/modern-web-use-cases/cli/package.jsonnew file mode 100644index 0000000..7a2331c--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/package.json@@ -0,0 +1,9 @@+{+ "name": "standalone-skills-cli",+ "version": "1.0.0",+ "type": "commonjs",+ "dependencies": {+ "@huggingface/transformers": "^3.8.1",+ "@lancedb/lancedb": "^0.26.2"+ }+}\ No newline at end of filediff --git a/skills-cli/modern-web-use-cases/cli/serving/bin/modern-web.cjs b/skills-cli/modern-web-use-cases/cli/serving/bin/modern-web.cjsnew file mode 100644index 0000000..c384fa2--- /dev/null+++ b/skills-cli/modern-web-use-cases/cli/serving/bin/modern-web.cjs@@ -0,0 +1,395 @@+#!/usr/bin/env node --experimental-strip-types+"use strict";+var __create = Object.create;+var __defProp = Object.defineProperty;+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;+var __getOwnPropNames = Object.getOwnPropertyNames;+var __getProtoOf = Object.getPrototypeOf;+var __hasOwnProp = Object.prototype.hasOwnProperty;+var __copyProps = (to, from, except, desc) => {+ if (from && typeof from === "object" || typeof from === "function") {+ for (let key of __getOwnPropNames(from))+ if (!__hasOwnProp.call(to, key) && key !== except)+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });+ }+ return to;+};+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(+ // If the importer is in node compatibility mode or this is not an ESM+ // file that has been converted to a CommonJS file using a Babel-+ // compatible transform (i.e. "__esModule" has not been set), then set+ // "default" to the CommonJS "module.exports" for node compatibility.+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,+ mod+));++// bin/modern-web.ts+var import_util = require("util");++// mcp-server/lib/store.ts+var import_lancedb = __toESM(require("@lancedb/lancedb"), 1);+var import_path = __toESM(require("path"), 1);+var import_fs = __toESM(require("fs"), 1);+var import_url = require("url");+var __filename = (0, import_url.fileURLToPath)(require('url').pathToFileURL(__filename).toString());+var __dirname = import_path.default.dirname(__filename);+var DATA_DIR = import_path.default.resolve(__dirname, "../../.modern-web-data");+var Store = class {+ dbUrl;+ constructor() {+ this.dbUrl = DATA_DIR;+ if (!import_fs.default.existsSync(this.dbUrl)) {+ import_fs.default.mkdirSync(this.dbUrl, { recursive: true });+ }+ }+ async getTable() {+ const db = await import_lancedb.default.connect(this.dbUrl);+ try {+ return await db.openTable("use_cases");+ } catch {+ return null;+ }+ }+ async upsert(data) {+ const db = await import_lancedb.default.connect(this.dbUrl);+ const tableNames = await db.tableNames();+ if (tableNames.includes("use_cases")) {+ await db.dropTable("use_cases");+ }+ await db.createTable("use_cases", data);+ }+ async search(queryVector, limit = 5, maxDistance = 1.5) {+ const table = await this.getTable();+ if (!table) {+ return [];+ }+ const fetchLimit = limit * 3;+ const results = await table.vectorSearch(queryVector).limit(fetchLimit).toArray();+ const seenIds = /* @__PURE__ */ new Set();+ const uniqueResults = [];+ for (const r of results) {+ const dist = r._distance;+ if (dist === void 0 || dist > maxDistance) continue;+ if (seenIds.has(r.id)) continue;+ seenIds.add(r.id);+ uniqueResults.push({+ id: r.id,+ description: r.description,+ category: r.category,+ featuresUsed: Array.from(r.featuresUsed),+ distance: dist.toFixed(2)+ });+ if (uniqueResults.length >= limit) break;+ }+ return uniqueResults;+ }+};++// mcp-server/lib/embedder.ts+var import_transformers = require("@huggingface/transformers");+var Embedder = class _Embedder {+ static instance;+ pipe = null;+ modelName = "Xenova/all-MiniLM-L6-v2";+ constructor() {+ }+ static getInstance() {+ if (!_Embedder.instance) {+ _Embedder.instance = new _Embedder();+ }+ return _Embedder.instance;+ }+ async init() {+ if (this.pipe) return;+ this.pipe = await (0, import_transformers.pipeline)("feature-extraction", this.modelName, { dtype: "q8" });+ }+ async embed(text) {+ if (!this.pipe) {+ await this.init();+ }+ if (!this.pipe) {+ throw new Error("Failed to initialize embedding pipeline");+ }+ const output = await this.pipe(text, { pooling: "mean", normalize: true });+ return Array.from(output.data);+ }+};++// lib/logger.ts+var import_fs2 = require("fs");+var import_path2 = __toESM(require("path"), 1);++// ../constants.ts+var MODERN_WEB_LOG_FILE = "modern-web.log";++// lib/logger.ts+function logToolResult(toolName, result) {+ try {+ const logDir = process.env.MODERN_WEB_LOG_DIR || process.cwd();+ const logPath = import_path2.default.join(logDir, MODERN_WEB_LOG_FILE);+ const logEntry = {+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),+ tool: toolName,+ result+ };+ (0, import_fs2.appendFileSync)(logPath, JSON.stringify(logEntry) + "\n", "utf8");+ } catch (err) {+ console.error("Failed to log tool result:", err);+ }+}++// lib/search.ts+async function searchUseCases(query) {+ const store = new Store();+ const embedder = Embedder.getInstance();+ const vector = await embedder.embed(query);+ const results = await store.search(vector);+ logToolResult("search_use_cases", results.map((r) => ({ id: r.id, distance: r.distance })));+ return results;+}++// mcp-server/data/modern-practices.ts+var import_fs3 = require("fs");+var import_path3 = __toESM(require("path"), 1);+var import_url2 = require("url");++// mcp-server/data/use-cases.gen.ts+var USE_CASES = [+ {+ "id": "accessible-error-announcement",+ "description": "Synchronize programmatic accessibility states (like aria-invalid) with the visual :user-invalid state to ensure screen reader users receive error feedback only after interaction, mirroring the visual experience.",+ "category": "accessibility",+ "featuresUsed": [+ ":user-valid and :user-invalid"+ ]+ },+ {+ "id": "batch-analytics-events",+ "description": "Debounce and batch multiple analytics events together in a single beacon to minimize network contention and reduce server load, while still delivering real-time updates.",+ "category": "performance",+ "featuresUsed": [+ "fetchLater",+ "AbortController and AbortSignal"+ ]+ },+ {+ "id": "deprioritize-background-fetches",+ "description": "Deprioritize background data fetches made with the Fetch API to prevent network contention with user-initiated requests.",+ "category": "performance",+ "featuresUsed": [+ "Fetch priority",+ "Fetch"+ ]+ },+ {+ "id": "full-session-analytics",+ "description": "Reliably track analytics, errors, and telemetry data across the user's entire page visit, and defer sending of the data until the user leaves the page.",+ "category": "performance",+ "featuresUsed": [+ "fetchLater",+ "AbortController and AbortSignal"+ ]+ },+ {+ "id": "improve-next-page-load-performance",+ "description": "Improve page load performance by prefetching or prerendering pages that the user is likely to visit next.",+ "category": "performance",+ "featuresUsed": [+ "Speculation rules"+ ]+ },+ {+ "id": "optimize-image-priority",+ "description": "Optimize the loading priority of Largest Contentful Paint (LCP) candidate images and deprioritize non-critical images to reduce critical resource load delays.",+ "category": "performance",+ "featuresUsed": [+ "Fetch priority"+ ]+ },+ {+ "id": "optimize-preload-priority",+ "description": "Optimize the relative priority of preloaded content to reduce critical resource load delays.",+ "category": "performance",+ "featuresUsed": [+ "Fetch priority",+ '<link rel="preload">'+ ]+ },+ {+ "id": "optimize-script-priority",+ "description": "Optimize the loading priority of scripts by boosting critical asynchronous scripts and deprioritizing non-essential or late-body scripts to improve sequencing and reduce delays.",+ "category": "performance",+ "featuresUsed": [+ "Fetch priority"+ ]+ },+ {+ "id": "adapt-scrollbar-to-contrast-preferences",+ "description": "Enhance scrollbar visibility for users who prefer high-contrast interfaces",+ "category": "user-experience",+ "featuresUsed": [+ "scrollbar-color",+ "prefers-contrast media query"+ ]+ },+ {+ "id": "adapt-scrollbar-to-light-dark-preferences",+ "description": "Ensure the scrollbar visually matches the user's operating system light/dark mode preference",+ "category": "user-experience",+ "featuresUsed": [+ "scrollbar-color",+ "color-scheme",+ "prefers-color-scheme media query"+ ]+ },+ {+ "id": "animate-scrollbar-color-on-scroll",+ "description": "Animate the scrollbar color dynamically as the user scrolls down the page",+ "category": "user-experience",+ "featuresUsed": [+ "scrollbar-color",+ "Scroll-driven animations",+ "Registered custom properties"+ ]+ },+ {+ "id": "customize-scrollbar-color-and-thickness",+ "description": "Customize the color or thickness of a scrollbar",+ "category": "user-experience",+ "featuresUsed": [+ "scrollbar-color",+ "scrollbar-width"+ ]+ },+ {+ "id": "required-field-feedback",+ "description": "Provide error message for required form fields that were skipped or left empty *only* after user interaction, to avoid preemptive errors and ensure feedback is timely and contextually relevant to the user's flow.",+ "category": "user-experience",+ "featuresUsed": [+ ":user-valid and :user-invalid"+ ]+ },+ {+ "id": "search-hidden-content",+ "description": 'Hide content from view using patterns such as accordions, tabs, and "Read more" sections, while ensuring the hidden text reveals itself during native "Find in page" searches, allows search engine indexing, supports URL fragment deep links, and maintains ARIA accessibility.',+ "category": "user-experience",+ "featuresUsed": [+ "<details>",+ "Mutually exclusive <details> elements",+ 'hidden="until-found"'+ ]+ },+ {+ "id": "select-menu-interaction",+ "description": "Validate that a non-default option has been chosen in a select menu only after the user has interacted with the control.",+ "category": "user-experience",+ "featuresUsed": [+ ":user-valid and :user-invalid"+ ]+ },+ {+ "id": "style-parent-with-has",+ "description": "Style parent elements of a form field (e.g. labels or fieldsets) when the field is invalid.",+ "category": "user-experience",+ "featuresUsed": [+ ":user-valid and :user-invalid"+ ]+ },+ {+ "id": "validate-input-after-interaction",+ "description": "Show form field validation feedback (e.g. password complexity or email format requirements) only after the user has finished their initial interaction, avoiding premature errors on page load or while the user is typing.",+ "category": "user-experience",+ "featuresUsed": [+ ":user-valid and :user-invalid"+ ]+ }+];++// mcp-server/data/modern-practices.ts+var __filename2 = (0, import_url2.fileURLToPath)(require('url').pathToFileURL(__filename).toString());+var __dirname2 = import_path3.default.dirname(__filename2);+async function getGuide(useCaseId) {+ const useCase = USE_CASES.find((u) => u.id === useCaseId);+ if (!useCase) return null;+ const guidesDir = import_path3.default.resolve(__dirname2, "../../build/guides");+ const filePath = import_path3.default.join(guidesDir, useCase.category, `${useCaseId}.md`);+ try {+ const content = await import_fs3.promises.readFile(filePath, "utf-8");+ return content;+ } catch (error) {+ if (error.code === "ENOENT") {+ return null;+ }+ throw error;+ }+}++// lib/retrieve.ts+async function retrieveUseCase(useCaseId) {+ const guide = await getGuide(useCaseId);+ if (!guide) {+ throw new Error(`No guide found for use case: ${useCaseId}`);+ }+ logToolResult("get_best_practices", [{ id: useCaseId }]);+ return guide;+}++// bin/modern-web.ts+var { values } = (0, import_util.parseArgs)({+ args: process.argv.slice(2),+ options: {+ search: { type: "string", short: "s" },+ retrieve: { type: "string", short: "r" },+ help: { type: "boolean", short: "h" }+ },+ allowPositionals: false+});+function printUsage() {+ console.log(`+Usage: modern-web [options]++Options:+ -s, --search <query> Search use cases by query+ -r, --retrieve <ids> Retrieve use case(s) by ID(s), comma-separated+ -h, --help Show this help+`);+}+async function main() {+ if (values.help) {+ printUsage();+ process.exit(0);+ }+ if (values.search) {+ try {+ const results = await searchUseCases(values.search);+ console.log(JSON.stringify(results, null, 2));+ } catch (error) {+ console.error("Search failed:", error);+ process.exit(1);+ }+ } else if (values.retrieve) {+ const ids = values.retrieve.split(",").map((id) => id.trim()).filter(Boolean);+ if (ids.length === 0) {+ console.error("No IDs provided for retrieve.");+ process.exit(1);+ }+ for (const id of ids) {+ try {+ const guide = await retrieveUseCase(id);+ console.log(`+--- Guide for ${id} ---`);+ console.log(guide);+ } catch (error) {+ console.error(`Retrieve failed for ${id}:`, error);+ process.exit(1);+ }+ }+ } else {+ printUsage();+ process.exit(1);+ }+}+main().catch((err) => {+ console.error("Execution failed:", err);+ process.exit(1);+});diff --git a/skills-cli/modern-web-use-cases/plugin.json b/skills-cli/modern-web-use-cases/plugin.jsonnew file mode 100644index 0000000..f30305e--- /dev/null+++ b/skills-cli/modern-web-use-cases/plugin.json@@ -0,0 +1,8 @@+{+ "name": "modern-web-use-cases",+ "description": "Modern Web Use Cases guidance tool",+ "version": "1.0.0",+ "author": {+ "name": "Paul Irish"+ }+}\ No newline at end of filediff --git a/test-dist.ts b/test-dist.tsnew file mode 100644index 0000000..fb8b64d--- /dev/null+++ b/test-dist.ts@@ -0,0 +1,79 @@+import test from 'node:test';+import assert from 'node:assert';+import fs from 'node:fs/promises';+import path from 'node:path';+import { fileURLToPath } from 'node:url';+import { execSync } from 'node:child_process';++const __filename = fileURLToPath(import.meta.url);+const __dirname = path.dirname(__filename);+const ROOT_DIR = path.resolve(__dirname, "../.."); // guidance/+const DIST_DIR = path.join(ROOT_DIR, "dist");++console.log("Running dist-gen to ensure fresh build...");+execSync('npm run dist-gen', {+ cwd: path.resolve(__dirname, '..'),+ stdio: 'inherit'+});++test('Claude Plugin Config in Dist', async () => {+ const marketplaceJsonRaw = await fs.readFile(path.join(DIST_DIR, '.claude-plugin/marketplace.json'), 'utf8');+ const marketplaceJson = JSON.parse(marketplaceJsonRaw);+ assert.strictEqual(marketplaceJson.name, 'skills-alpha', 'marketplace.json name should be skills-alpha');+ assert.strictEqual(marketplaceJson.owner.name, 'Google Chrome', 'marketplace.json owner should be Google Chrome');++ assert.ok(Array.isArray(marketplaceJson.plugins) && marketplaceJson.plugins.length > 0, 'should have plugins');+ assert.strictEqual(marketplaceJson.plugins[0].name, 'googlechrome-skills');+ assert.strictEqual(marketplaceJson.plugins[0].source, './');++ const pluginJsonRaw = await fs.readFile(path.join(DIST_DIR, '.claude-plugin/plugin.json'), 'utf8');+ const pluginJson = JSON.parse(pluginJsonRaw);+ assert.strictEqual(pluginJson.name, 'googlechrome-skills', 'plugin.json name should match');+ assert.strictEqual(pluginJson.author.name, 'Google Chrome', 'plugin.json author should be Google Chrome');+});++test('Gemini and VS Code manifests', async () => {+ const geminiJson = JSON.parse(await fs.readFile(path.join(DIST_DIR, 'gemini-extension.json'), 'utf8'));+ assert.strictEqual(geminiJson.name, 'googlechrome-skills');+ assert.strictEqual(geminiJson.author.name, 'Google Chrome');++ const pkgJsonRaw = await fs.readFile(path.join(DIST_DIR, 'package.json'), 'utf8');+ const pkgJson = JSON.parse(pkgJsonRaw);+ assert.strictEqual(pkgJson.publisher, 'GoogleChrome');+ assert.ok(pkgJson.contributes?.chatSkills, 'Must contribute chatSkills');+ assert.strictEqual(pkgJson.contributes.chatSkills[0].path, './skills-cli/modern-web-use-cases/SKILL.md');+});++test('SKILL.md validations', async () => {+ const skillPath = path.join(DIST_DIR, 'skills-cli/modern-web-use-cases/SKILL.md');+ await assert.doesNotReject(fs.access(skillPath), `Missing SKILL.md in modern-web-use-cases`);++ const content = await fs.readFile(skillPath, 'utf8');+ const match = content.match(/^---\r?\n([\s\S]+?)\r?\n---/);+ assert.ok(match, `Missing YAML frontmatter`);++ const nameMatch = match[1].match(/^name:\s*(.+)$/m);+ assert.ok(nameMatch, `Missing 'name' field in frontmatter`);+ assert.strictEqual(nameMatch[1].trim(), 'modern-web-use-cases', `Frontmatter name must match folder name`);+});++test('Manifest source paths resolve relative to dist directory', async () => {+ // Claude Code source+ const marketplaceJsonRaw = await fs.readFile(path.join(DIST_DIR, '.claude-plugin/marketplace.json'), 'utf8');+ const marketplaceJson = JSON.parse(marketplaceJsonRaw);+ const claudeSourcePath = marketplaceJson.plugins[0].source;+ const resolvedClaudePath = path.join(DIST_DIR, claudeSourcePath);+ await assert.doesNotReject(fs.access(resolvedClaudePath), `Claude source path ${claudeSourcePath} must resolve to a valid directory`);++ // Claude plugin resolution logic mapping+ // If source is './', the plugin resides precisely at DIST_DIR/.claude-plugin/plugin.json+ const expectedPluginJsonPath = path.join(resolvedClaudePath, '.claude-plugin/plugin.json');+ await assert.doesNotReject(fs.access(expectedPluginJsonPath), `Claude Plugin must be resolving from the source pointer`);++ // VS Code Extension source+ const pkgJsonRaw = await fs.readFile(path.join(DIST_DIR, 'package.json'), 'utf8');+ const pkgJson = JSON.parse(pkgJsonRaw);+ const vscodePath = pkgJson.contributes.chatSkills[0].path;+ const resolvedVsCodePath = path.join(DIST_DIR, vscodePath);+ await assert.doesNotReject(fs.access(resolvedVsCodePath), `VS Code skill path ${vscodePath} must resolve to an existing SKILL.md`);+});