diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index deae9b50..87c8b5fe 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -129,6 +129,61 @@ jobs: path: ${{ steps.dmg.outputs.path }} retention-days: 1 + # AC-60. tauri-driver has no macOS WebKit driver, so the app cannot be driven by + # WebDriver here. Two checks stand in: (1) the real tauri.conf.json, capability file + # and ACL manifest on Tauri's mock runtime, which runs the same ACL resolver the + # packaged app does; (2) the built .app is launched on a macOS runner and must stay + # alive for 20 seconds. (2) proves the bundle starts (database init, plugin setup, + # window creation); it does not click through the UI, which the Playwright suites + # cover against a mocked bridge. + real-app-smoke: + needs: [build-desktop] + runs-on: macos-15 + steps: + - uses: actions/checkout@v7 + + - uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: apps/desktop/src-tauri + + - name: Capability and IPC contract tests on the real config (mock runtime) + working-directory: apps/desktop/src-tauri + run: | + cargo test --test capability_smoke + cargo test --lib -- ipc_contract surface_write + + - name: Download the built desktop app + uses: actions/download-artifact@v8 + with: + name: desktop-darwin-arm64 + + - name: Launch the built app + run: | + set -euo pipefail + MOUNT="$(mktemp -d)" + hdiutil attach HarnessKit-nightly-darwin-arm64.dmg -mountpoint "$MOUNT" -nobrowse -quiet + APP="$(find "$MOUNT" -maxdepth 1 -name '*.app' | head -1)" + if [[ -z "$APP" ]]; then + echo "::error::No .app inside the DMG" + exit 1 + fi + EXE="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info.plist")" + # A throwaway HOME keeps the app off the runner's real config directories. + export HOME="$(mktemp -d)" + "$APP/Contents/MacOS/$EXE" > "$RUNNER_TEMP/app.log" 2>&1 & + PID=$! + sleep 20 + if ! kill -0 "$PID" 2>/dev/null; then + echo "::error::The app exited within 20 seconds of launch" + cat "$RUNNER_TEMP/app.log" + exit 1 + fi + echo "App still running after 20 seconds (pid $PID)" + kill "$PID" || true + cat "$RUNNER_TEMP/app.log" + publish: needs: [build-cli-standalone, build-desktop] runs-on: ubuntu-latest @@ -226,7 +281,7 @@ jobs: # A scheduled workflow fails where nobody is looking β€” this one was red for # four nights before anyone noticed. Surface it as an issue instead. report-failure: - needs: [build-cli-standalone, build-desktop, publish] + needs: [build-cli-standalone, build-desktop, real-app-smoke, publish] if: failure() && github.event_name == 'schedule' runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 0daffb34..71299dd8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -256,6 +256,30 @@ jobs: - name: Production-build smoke (blank-screen guard) run: pnpm --filter harness-kit-desktop test:e2e:preview + # smoke.spec (route content, Machine/Drift views) and console-hunt (no console + # errors on any route) run against the dev server with the mocked Tauri bridge. + - name: Smoke and console-hunt e2e (dev server) + run: pnpm --filter harness-kit-desktop test:e2e + + # AC-60: the surface_write guard and the IPC contract also run on macOS, where + # is_declared_store picks the macOS write scope and paths are case-insensitive. + desktop-macos-rust: + runs-on: macos-15 + steps: + - uses: actions/checkout@v7 + + - uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + with: + workspaces: apps/desktop/src-tauri + + - name: Rust test (surface_write, IPC contract, capability smoke) + working-directory: apps/desktop/src-tauri + run: | + cargo test --lib -- surface_write ipc_contract + cargo test --test capability_smoke + docs-build: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 05eb167c..2b7418b3 100644 --- a/README.md +++ b/README.md @@ -194,19 +194,24 @@ See the [Secrets Management guide](website/content/docs/guides/secrets-managemen ## πŸ–₯️ Desktop App -A Tauri desktop control plane for your AI coding harnesses β€” config console with reverse-import and drift-repair. No external services required for any core path. - -- **Sync engine** β€” compiles `harness.yaml` to platform configs -- **Plugin explorer** β€” browse and manage installed plugins -- **Marketplace** β€” embedded plugin browser for discovering and installing from the marketplace -- **Observatory** β€” live session dashboard with stats and transcripts, reading local `~/.claude` data -- **Comparator** β€” structured evaluation workbench: configure harnesses, run side-by-side comparisons, review file diffs, and judge results across a 4-phase workflow, local-only -- **Harness editor** β€” inline editing with custom profiles -- **Parity** β€” cross-platform feature parity tracking across AI coding tools -- **Fleet and Drift** β€” layered capture/apply previews, capability losses, reconciliation conflicts, governed rollout status, and local rollback history -- **Security** β€” permissions editor, secrets management, and audit logging - -See [`apps/desktop/`](apps/desktop/) for build instructions. The desktop app is a separate product from the plugin marketplace. +A Tauri desktop app that shows what each AI coding tool on your machine has configured, and lets you copy a missing piece from one tool to another. It reads local files. No external service is needed. + +- **Machine** is the home screen. A grid lists every MCP server, skill, instruction file and plugin across the tools it finds, with one column per tool. Click a cell to open a drawer that shows where the resource lives, how copies differ, and a copy action from one tool to another. Tools that are not installed are hidden until you choose "Show all". +- **Drift** is a view inside Machine. It compares your `harness.yaml` with the files compiled from it, shows a diff for each item, and previews a fix before writing anything. +- **Profile** edits `harness.yaml` and compiles it into a project. With no project chosen, Profile and Compile use your personal `~/.claude/harness.yaml`. With a project chosen in the title bar, they use that project's committed `harness.yaml` as the team baseline. +- **Claude Code** holds the editors for that tool: Instructions, MCP servers, Plugins, Hooks, Permissions, and Usage (sessions, tool calls and tokens read from `~/.claude`). +- **Marketplace** browses the plugin catalog. +- **Settings** holds preferences, secrets and the activity log. +- **Comparator** runs the same prompt across tools side by side. It is off until you turn it on in Settings under Labs. + +How it handles your files: + +- Copies, Compile and Drift fixes show a preview before they write. Backups and rollback points for files in your home folder go to `~/.harness/backups/`, and for a project to that project's `.harness/backups/`. +- The app has no shell access. Folder choices, plugin imports and exports use native dialogs. +- Security presets merge into your permissions and list any deny rule they would remove before writing. +- Dialogs trap focus and return it on close, menus work from the keyboard, and text colors meet WCAG AA contrast. + +To build or run it, see [CONTRIBUTING.md](CONTRIBUTING.md) (`pnpm dev:desktop`). Design rules are in [`apps/desktop/DESIGN.md`](apps/desktop/DESIGN.md). The desktop app is a separate product from the plugin marketplace. ## 🌐 Cross-Platform diff --git a/apps/desktop/DESIGN.md b/apps/desktop/DESIGN.md index 21204117..19651b71 100644 --- a/apps/desktop/DESIGN.md +++ b/apps/desktop/DESIGN.md @@ -19,10 +19,10 @@ Reject any UI that contains: - Cool blue-grey **slate** neutrals (this direction is warm graphite β€” `#131215`, not `#0f172a`). Purple/indigo/violet accents. Purpleβ†’blue gradients. - Glassmorphism, gradient hero text, glow-on-everything, floating 3D blobs. - **Emoji as icons.** Icons are Lucide only, `viewBox="0 0 24 24"`, stroke 1.7, `w:16` default (20 for headers). One set, consistent stroke. -- Visible 1px neutral borders as the default separator. **Borderless is a core principle** β€” separate with background elevation steps + spacing + soft shadow. `--border-*` alphas are deliberately near-invisible; use them only as hairline reinforcement, never as the primary divider. +- Visible 1px neutral borders as the default separator. **Borderless is a core principle** β€” separate with background elevation steps + spacing + soft shadow. `--border-*` alphas are deliberately near-invisible; use them only as hairline reinforcement, never as the primary divider. Not yet true everywhere: many pages still draw 1px borders as separators. New and touched code follows the rule; do not copy the old pattern. - Marketing aesthetics inside the app: oversized type, 48px section gaps, centered hero layouts. - Four-stat-cards-in-a-row as decoration. Show data the user acts on, or nothing. -- **Inline hex or spacing literals in page code.** Every themed property comes from a token var through a `packages/ui` component. (Lint-enforced in `apps/desktop/src/pages`.) +- **Inline hex or spacing literals in page code.** Every themed property comes from a token var through a `packages/ui` component. No lint enforces this yet: reviewers check it, and some pages still hold hex literals and hand-drawn SVG icons that predate the rule. - Exclamation marks in app copy. Vague errors. System-jargon labels. - **A raw error as the message.** No page renders `String(err)` or an error's text inline. A failed scan, load, or write is an `ErrorNotice` (Β§7): what failed in plain words, one action, the raw text behind "Details" (ux-consolidation AC-20). @@ -40,8 +40,8 @@ Status colors are **shared across themes** and are NOT the accent. Only azure is --bg-sidebar: rgba(27,25,30,0.85) --fg-base: #EDEAE6 /* warm off-white */ --fg-muted: #A29C95 ---fg-subtle: #6C665F ---fg-placeholder: #514C46 +--fg-subtle: #968F88 /* 5.9:1 on --bg-base, AA on surface and elevated */ +--fg-placeholder: #8A847D /* 5.1:1 on --bg-base */ --border-base: rgba(255,255,255,0.05) --border-strong: rgba(255,255,255,0.09) --border-subtle: rgba(255,255,255,0.03) @@ -61,14 +61,15 @@ Status colors are **shared across themes** and are NOT the accent. Only azure is --bg-sidebar: rgba(244,242,239,0.85) --fg-base: #1A1714 --fg-muted: #57514A ---fg-subtle: #8B8479 ---fg-placeholder: #A8A199 +--fg-subtle: #655F55 /* 5.7:1 on --bg-base, AA on surface and elevated */ +--fg-placeholder: #716A60 /* 4.8:1 on --bg-base */ --border-base: rgba(20,15,10,0.06) --border-strong: rgba(20,15,10,0.10) --border-subtle: rgba(20,15,10,0.03) --accent: #2E9BE6 /* icons / large accents / fills */ --accent-light: rgba(46,155,230,0.10) --accent-text: #1668A6 /* azure TEXT on light must use this (AA on white); #2E9BE6 fails small-text contrast */ +--accent-fill: #1D6FB0 /* fill behind white text (primary button), both themes; #2E9BE6 gives 3.0:1 */ --accent-glow: rgba(46,155,230,0.25) --hover-bg: rgba(20,15,10,0.04) --active-bg: rgba(20,15,10,0.07) @@ -80,6 +81,7 @@ Status colors are **shared across themes** and are NOT the accent. Only azure is --warning: #E0A33D --warning-light: rgba(224,163,61,0.16) --danger: #F2555A --danger-light: rgba(242,85,90,0.14) ``` +Status colors as text on their own tint use `--success-text`, `--warning-text` and `--danger-text` (dark: `#4CC08A`, `#E0A33D`, `#FF7A7E`; light: `#1B6F47`, `#7A5000`, `#B3262C`), which meet AA on any surface; the base values above are for fills, dots and tints. Drift counts use `--warning`; conflicts/denials use `--danger`; in-sync uses `--success`. Status chips = tinted bg + colored text + a 6px dot. **Never solid-fill pills.** ### Shadows (warm-tinted in light) @@ -127,6 +129,8 @@ Headings get `text-wrap: balance`. Running prose (rare in-app) stays ≀ ~65ch. - **Copy voice:** plain, specific, count-forward ("5 harnesses, 5 drifted", "Drift 3"). Buttons say what happens ("Recompile all" β†’ toast "Recompiled 4 configs"). Errors: what broke + how to fix, as an `ErrorNotice` (Β§7). No exclamation marks. - **Labs:** entries carrying a `labs` key in `apps/desktop/src/nav.ts` (Comparator today) are hidden from the sidebar, the ⌘-number shortcuts and the command palette until enabled in Settings β€Ί Labs. The route itself stays mounted, so a direct navigation still renders it (ux-consolidation spec AC-8, design D4). +**Access and writes (what copy may promise):** the webview has no shell access: it can open links, and every process the app runs starts from Rust. It cannot write files directly; writes go through the guarded Rust commands, and removing a store moves it to `~/.harness/backups/quarantine/` instead of deleting it. Backups and rollback manifests for applied changes live under `~/.harness/backups/`. Folders and files come from native dialogs (project folder, plugin import, exports); the app can touch a project only after the user picks it. Security presets merge into existing permissions: they add rules, keep existing deny rules, and list any deny rule a preset would remove for confirmation before writing. + --- ## 5. Information architecture @@ -163,9 +167,9 @@ Reference implementation of the visual language: the signed-off mock (Fleet β€” ### Machine (home) β€” this screen IS the product pitch 1. **Page head:** title "Machine" + one-line subtitle ("Every AI-harness resource on this machine, across all supported surfaces.") + primary action "Refresh" (right; reads "Scanning…" while a scan is in flight). 2. **Project directory:** chosen in the title bar (see Β§5, "Title bar"), not on the page; Machine has no directory field of its own. With no project the scan is machine-only; a project adds its project-scope stores, and every change of project starts a new scan with nothing selected. Refresh rescans with the same project. A `--warning`-toned notice ("Project directory could not be scanned β€” showing machine-only results") appears if the chosen directory degrades. -3. **Summary strip:** a single elevated bar: Resources (n) Β· Gaps (n) Β· Differs (n) Β· Drift vs harness.yaml (n) Β· Surfaces detected (n/total). Big-metric type, tabular-nums, uppercase micro-labels. Gaps and Differs count *rows* with at least one such chip (the unit the filter reveals; pairwise diffs would overcount), `--warning` when above zero. A non-zero Gaps or Differs cell is a toggle button (`aria-pressed`, active = `--accent-light` with an inset azure bottom rule) that filters the grid through `?filter=gaps|differs`, keeping every other query param. The active cell stays a pressed button even when its count reaches zero, so an empty filtered grid always has a visible cause. While filtered, a status line under the strip reads "Showing N of M resources with a closable gap" (or "…whose content differs") with a ghost "Show all". A drawer whose row is filtered out closes. The filter belongs to the grid: while the Drift view shows, no filter cell reads as pressed and there is no status line, and choosing Gaps or Differs returns to the grid with that filter in one URL update. The Drift cell is always a toggle button that selects the Drift view (pressed while it shows; pressing it again returns to the grid). Its value is the count of drift items the Drift list shows (unacknowledged; under `harness=`, that harness only) from the last scan Drift itself ran since Machine opened, `--warning` above zero, and "β€”" before any such scan: never "…", which would claim a scan is running, and Machine never scans for drift to fill it (see item 6). Under `harness=` the cell's accessible name says whose count it is ("Drift vs harness.yaml 3 for Cursor"). **View tabs:** under the strip sits a two-option segmented control, Resources | Drift vs harness.yaml. The options switch the content below, so it is a WAI-ARIA tab list labelled "Machine view": each option is a `tab` with `aria-selected` and `aria-controls` naming the one `tabpanel` that holds the view, which is labelled by the selected tab. Only the selected tab is in the Tab order; Left/Right (wrapping) and Home/End move to a tab and select it. Selected = `--accent-light` with an inset azure bottom rule, like a pressed strip cell. It selects `?view=grid|drift` (grid is the default and drops the param), keeping every other query param; choosing the tab already selected adds no history entry. It shows even when the machine scan failed, since Drift does not need the inventory, and keeps one place in the tree whether or not the strip has rendered, so focus on it survives the first scan landing. -4. **Grid:** rows = resources grouped by kind (uppercase group header), columns = surfaces grouped by product family (grouped header row); an undetected surface's column is dimmed and labelled "not installed". Each cell is a mono chip whose variant comes from `pages/machine/cell-state.ts` (spec AC-13, AC-14): `user` / `project` = present at that scope (tinted); `+ copy` = a closable gap, a dashed ghost chip; `differs` = present, but its effective digest departs from the row's baseline (the most frequent digest, ties to the earliest surface in registry order), `--warning` tint; `β€”` = no such concept on this surface; a dimmed `Β·` = has the concept but keeps no store here (not a gap); `?` = unknown (surface installed, store may be hidden); blank = absent and nothing can be copied there. Tooltips list every entry's digest, file and scope. Surface headers carry a skipped-entries count badge and, where readable, a marketplace-count badge. A persistent legend under the grid names every chip and both header badges, and lists only states the grid uses. Drift has no chip: it is per harness.yaml target, not per grid cell, and lives in the Drift view. Row click opens the drawer; the selected row is `--accent-light`, so the neutral chips stay legible on it. -5. **Row drawer:** belongs to the grid view; switching to Drift closes it. A right-side panel, `--hk-drawer-width` (380px) wide. While it is open the page reserves that width on its right (`.hk-page[data-drawer-open]`), so no grid column sits under it; a narrow window scrolls the grid instead (AC-19). "Where it lives" (per-surface entries: scope, file path, short digest) and, when the row has cross-surface differences, "Differences" (each delta's path, kind, and leftβ†’right values). Below that, the copy action as **From β†’ To** (AC-15): a source select over the surfaces that hold the resource, defaulting to the one holding the baseline, and a target select listing closable gaps first, then surfaces that hold a different version (which replace content and need the overwrite acknowledgement), defaulting to the first gap. Then the resolved CLI command, a capability-loss or overwrite checkbox when the plan requires one, a secret-value notice when applicable, and Apply / Copy CLI command / Copy prompt. A successful Apply toasts "Copied to " (AC-16) and rescans; the drawer stays open on the selected row, refreshed from the new scan, and Apply stays off until that scan rebuilds the plan, so one click writes once. +3. **Summary strip:** a single elevated bar: Resources (n) Β· Gaps (n) Β· Differs (n) Β· Drift vs harness.yaml (n) Β· Surfaces detected (n/total). Big-metric type, tabular-nums, uppercase micro-labels. Gaps and Differs count *rows* with at least one such chip (the unit the filter reveals; pairwise diffs would overcount), `--warning` when above zero. A non-zero Gaps or Differs cell is a toggle button (`aria-pressed`, active = `--accent-light` with an inset azure bottom rule) that filters the grid through `?filter=gaps|differs`, keeping every other query param. The active cell stays a pressed button even when its count reaches zero, so an empty filtered grid always has a visible cause. While filtered, a status line under the strip reads "Showing N of M resources with a closable gap" (or "…whose content differs") with a ghost "Show all". A drawer whose row is filtered out closes. The filter belongs to the grid: while the Drift view shows, no filter cell reads as pressed and there is no status line, and choosing Gaps or Differs returns to the grid with that filter in one URL update. The Drift cell is always a toggle button that selects the Drift view (pressed while it shows; pressing it again returns to the grid). Its value is the count of drift items the Drift list shows (unacknowledged; under `harness=`, that harness only) from the last scan Drift itself ran since Machine opened, `--warning` above zero, and "β€”" before any such scan: never "…", which would claim a scan is running, and Machine never scans for drift to fill it (see item 6). Under `harness=` the cell's accessible name says whose count it is ("Drift vs harness.yaml 3 for Cursor"). **View tabs:** under the strip sits a two-option segmented control, Resources | Drift vs harness.yaml. The options switch the content below, so it is a WAI-ARIA tab list labelled "Machine view": each option is a `tab` with `aria-selected` and `aria-controls` naming the one `tabpanel` that holds the view, which is labelled by the selected tab. Only one tab is in the Tab order (the selected one, until focus moves along the list). Activation is manual: Left/Right (wrapping) and Home/End move focus only, and Enter, Space or a click selects. Selecting Drift mounts the Drift page and starts its scan, so moving focus across the tabs must not. Selected = `--accent-light` with an inset azure bottom rule, like a pressed strip cell. It selects `?view=grid|drift` (grid is the default and drops the param), keeping every other query param; choosing the tab already selected adds no history entry. It shows even when the machine scan failed, since Drift does not need the inventory, and keeps one place in the tree whether or not the strip has rendered, so focus on it survives the first scan landing. +4. **Grid:** rows = resources grouped by kind (uppercase group header), columns = surfaces grouped by product family (grouped header row). Surfaces that are not installed are hidden by default, with an "N of M surfaces installed" note and a "Show all M" button above the grid ("Hide not installed" reverses it); a shown but undetected column is dimmed and labelled "not installed". When no surface is installed, all of them show. Hidden surfaces still count toward each row's baseline digest. Each cell is a mono chip whose variant comes from `pages/machine/cell-state.ts` (spec AC-13, AC-14): `user` / `project` = present at that scope (tinted); `+ copy` = a closable gap, a dashed ghost chip; `differs` = present, but its effective digest departs from the row's baseline (the most frequent digest, ties to the earliest surface in registry order), `--warning` tint; `β€”` = no such concept on this surface; a dimmed `Β·` = has the concept but keeps no store here (not a gap); `?` = unknown (surface installed, store may be hidden); blank = absent and nothing can be copied there. Tooltips list every entry's digest, file and scope. Surface headers carry a skipped-entries count badge and, where readable, a marketplace-count badge. A persistent legend under the grid names every chip state except the blank one and both header badges. It is a fixed list: it shows a state whether or not the current grid uses it. A plugin gap shows no "+ copy", because the app cannot write plugins (the drawer offers the CLI command and agent prompt instead). Drift has no chip: it is per harness.yaml target, not per grid cell, and lives in the Drift view. Instructions are one row per scope ("User instructions", "Project instructions"), whatever each surface names its file (CLAUDE.md, AGENTS.md); the file stays in the cell's tooltip, and a file holding only a `harness:sync` block counts as present (spec AC-57). Row click opens the drawer; clicking a cell opens it with that cell's surface as the default "To" target (when that surface can receive the copy); the selected row is `--accent-light`, so the neutral chips stay legible on it. +5. **Row drawer:** belongs to the grid view; switching to Drift closes it. A right-side panel, `--hk-drawer-width` (380px) wide. While it is open the page reserves that width on its right (`.hk-page[data-drawer-open]`), so no grid column sits under it; a narrow window scrolls the grid instead (AC-19). "Where it lives" (per-surface entries: scope, file path, short digest) and, when the row has cross-surface differences, "Differences" (each delta's path, kind, and leftβ†’right values). Below that, the copy action as **From β†’ To** (AC-15): a source select over the surfaces that hold the resource, defaulting to the one holding the baseline, and a target select listing closable gaps first, then surfaces that hold a different version (which replace content and need the overwrite acknowledgement), defaulting to the clicked cell's surface, else the first gap. Then the resolved CLI command, a capability-loss or overwrite checkbox when the plan requires one, a secret-value notice when applicable, and Apply / Copy CLI command / Copy prompt. A successful Apply toasts "Copied to " (AC-16) and rescans; the drawer stays open on the selected row, refreshed from the new scan, and Apply stays off until that scan rebuilds the plan, so one click writes once. 6. **Drift view** (`?view=drift`, spec AC-18, design D6): replaces the grid, its legend, the filter status line and the skipped diagnostics (inside the tab panel) with the existing Drift page rendered embedded (no second `

`, no nested page container; see "Drift" below). Reached from the strip's Drift cell, the view toggle, the palette's "Open Drift vs harness.yaml", the redirected `/drift` route and the legacy `?drift=1`; `harness=` filters it (spec AC-6, AC-7). The app's scroll container keeps its offset across routes and views, so whenever the view becomes Drift (on arrival or on a switch) or `harness=` changes while it shows, the page scrolls the tabs and the start of Drift to the top of the scroll area, but only when that part is not already on screen: a user already looking at it is not moved. On a cold load the scroll waits for the first machine scan, since the strip it brings lands above the view; a later Refresh does not scroll. Drift is mounted only in this view, and that is behavioural: it scans every scope's harness.yaml and compiled output when it mounts, and the grid reads only the stores of the title bar's project, so nothing about drift runs until someone picks this view. There is no accordion. 7. **Skipped diagnostics** (grid view only): a collapsible disclosure listing, per surface, each skipped file and the reason it was skipped. @@ -173,7 +177,7 @@ Reference implementation of the visual language: the signed-off mock (Fleet β€” Items grouped by project β†’ harness. Each item shows: classification badge (repairable-inside-markers / user-edited-outside / missing / orphaned), an inline **mono diff viewer** (syntax-highlighted, red/green gutters using `--danger`/`--success` tints), and a per-item **Fix** button that previews the exact plan before applying. Header offers **Fix all** (dry-run preview first). User-content drift offers only Acknowledge / Review β€” never silent overwrite. Every row has an action. ### Profile and Claude Code (editors) -The generic "Configure" group is retired β€” no group by that name returns (spec AC-3, design D5). Editors now live under two sidebar groups: **Claude Code** (Instructions, MCP servers, Plugins, Hooks, Permissions, Usage β€” each edits that one surface's own files) and **Profile** (harness.yaml). Today Profile's `/harness/file` is a single editor whose empty state offers three entry paths β€” "Generate from Claude Code setup" (scans existing config), "Start from a profile", and "Create from scratch" (the only one that opens a blank template) β€” each of which drops into the same Monaco editor, where "Save harness.yaml" then appears. Its planned end state (P3, spec AC-22–AC-25, design D11) is a Monaco YAML editor (left/main) + a structured side panel (plugins, MCP servers, instruction slots, permissions) that round-trips to the YAML, with the empty state replaced by the full **import flow** ("Scan this machine"). That full flow is not built yet, but "Generate from Claude Code setup" is already a real scan-based precursor to it today β€” narrower in scope (one surface, not Machine's planned multi-surface scan), not absent. +The generic "Configure" group is retired β€” no group by that name returns (spec AC-3, design D5). Editors now live under two sidebar groups: **Claude Code** (Instructions, MCP servers, Plugins, Hooks, Permissions, Usage β€” each edits that one surface's own files) and **Profile** (harness.yaml). Today Profile's `/harness/file` is a single editor whose empty state offers three entry paths β€” "Generate from Claude Code setup" (scans existing config), "Start from a profile", and "Create from scratch" (the only one that opens a blank template) β€” each of which drops into the same Monaco editor, where "Save harness.yaml" then appears. Profile and Compile follow the title-bar project (spec AC-55): with one chosen, both show and compile that project's committed `harness.yaml` as the team baseline, and Profile shows it read-only (no Editor view, no save; a project with no `harness.yaml` gets a plain notice, not the personal-profile empty state); with none, both use the editable personal `~/.claude/harness.yaml`. Compile, for a project with no `harness.yaml`, still compiles the personal profile into it. The page header names the scope ("Personal profile", "Team baseline Β· ", or on Compile "Personal profile β†’ "); `lib/harness-source.ts` does the read. Its planned end state (P3, spec AC-22–AC-25, design D11) is a Monaco YAML editor (left/main) + a structured side panel (plugins, MCP servers, instruction slots, permissions) that round-trips to the YAML, with the empty state replaced by the full **import flow** ("Scan this machine"). That full flow is not built yet, but "Generate from Claude Code setup" is already a real scan-based precursor to it today β€” narrower in scope (one surface, not Machine's planned multi-surface scan), not absent. ### Onboarding (first run) β€” the highest-craft screen Full-bleed within the window (no app sidebar yet β€” it's a wizard). Sequence: diff --git a/apps/desktop/e2e/tauri-bridge-mock.ts b/apps/desktop/e2e/tauri-bridge-mock.ts index 29f8fbf6..d5f7baef 100644 --- a/apps/desktop/e2e/tauri-bridge-mock.ts +++ b/apps/desktop/e2e/tauri-bridge-mock.ts @@ -12,19 +12,6 @@ export const MOCK_RESPONSES: Record = { content: 'version: "1"\nmetadata:\n name: test-harness\n', path: "~/.claude/harness.yaml", }, - scan_claude_config: { - mcpServersJson: JSON.stringify({ - mcpServers: { - tauri: { command: "tauri-mcp" }, - grafana: { command: "grafana-mcp" }, - }, - }), - settingsJson: JSON.stringify({ - permissions: { allow: Array(16).fill("Bash") }, - }), - mcpSource: "~/.claude/mcp.json", - settingsSource: "~/.claude/settings.local.json", - }, list_installed_plugins: [], check_plugin_updates: [], list_marketplaces: [], diff --git a/apps/desktop/e2e/tests/smoke.spec.ts b/apps/desktop/e2e/tests/smoke.spec.ts index 62749b2f..ddd6d45a 100644 --- a/apps/desktop/e2e/tests/smoke.spec.ts +++ b/apps/desktop/e2e/tests/smoke.spec.ts @@ -227,7 +227,7 @@ test.describe("⌘K affordance and page commands (AC-21)", () => { await cmdk.click(); const palette = appPage.getByRole("dialog", { name: "Command palette" }); await expect(palette).toBeVisible(); - await expect(palette.getByRole("button").first()).toHaveText("Rescan this machine"); + await expect(palette.getByRole("option").first()).toHaveText("Rescan this machine"); await expect(palette.getByText("This page")).toBeVisible(); await appPage.keyboard.press("Escape"); diff --git a/apps/desktop/scripts/__tests__/check-tauri-capability-coverage.test.ts b/apps/desktop/scripts/__tests__/check-tauri-capability-coverage.test.ts index c9cb1f2b..a04e3b90 100644 --- a/apps/desktop/scripts/__tests__/check-tauri-capability-coverage.test.ts +++ b/apps/desktop/scripts/__tests__/check-tauri-capability-coverage.test.ts @@ -5,6 +5,10 @@ import { parseRegisteredCommands, parseAllowedCommands, analyzeCoverage, + camelToKebab, + requiredPermissions, + expandGrants, + analyzePluginPermissions, } from "../check-tauri-capability-coverage.mjs"; const LIB_RS = ` @@ -77,3 +81,69 @@ describe("capability-coverage parser", () => { expect(kebab("read_plugin_tree")).toBe("read-plugin-tree"); }); }); + +const MANIFESTS = { + fs: { + default_permission: { identifier: "default", permissions: ["allow-exists"] }, + permission_sets: { "read-dirs": { identifier: "read-dirs", permissions: ["allow-read-dir"] } }, + permissions: { + "allow-exists": {}, + "allow-lstat": {}, + "allow-read-dir": {}, + "allow-read-text-file": {}, + "allow-write-text-file": {}, + }, + }, + shell: { + default_permission: { identifier: "default", permissions: ["allow-open"] }, + permission_sets: {}, + permissions: { "allow-open": {}, "allow-execute": {}, "allow-spawn": {} }, + }, +}; + +describe("plugin permission coverage (AC-60)", () => { + it("maps a JS export to its permission", () => { + expect(camelToKebab("readTextFile")).toBe("read-text-file"); + expect(requiredPermissions("fs", "readTextFile")).toEqual(["allow-read-text-file"]); + expect(requiredPermissions("shell", "open")).toEqual(["allow-open"]); + expect(requiredPermissions("shell", "Command")).toEqual(["allow-execute", "allow-spawn"]); + expect(requiredPermissions("fs", "BaseDirectory")).toBeNull(); + }); + + it("expands a default and a named set, and scoped object grants", () => { + const granted = expandGrants( + { permissions: ["fs:default", "fs:read-dirs", { identifier: "fs:allow-lstat", allow: [] }, "core:window:allow-x", "allow-bare"] }, + MANIFESTS, + ); + for (const id of ["fs:allow-exists", "fs:allow-read-dir", "fs:allow-lstat", "core:window:allow-x"]) { + expect(granted.has(id), id).toBe(true); + } + expect(granted.has("fs:allow-read-text-file")).toBe(false); + expect(granted.has("allow-bare")).toBe(false); + }); + + it("flags a plugin call whose permission is not granted", () => { + const imports = new Map([ + ["fs:readTextFile", ["src/a.ts:1"]], + ["fs:exists", ["src/b.ts:2"]], + ]); + const granted = expandGrants({ permissions: ["fs:default"] }, MANIFESTS); + const { missingGrant, unknownPermission } = analyzePluginPermissions({ imports, granted, manifests: MANIFESTS }); + expect(missingGrant.map(([k]) => k)).toEqual(["fs:readTextFile"]); + expect(unknownPermission).toHaveLength(0); + }); + + it("passes when the grant arrives through the plugin default set", () => { + const imports = new Map([["shell:open", ["src/a.ts:1"]]]); + const granted = expandGrants({ permissions: ["shell:default"] }, MANIFESTS); + const { missingGrant } = analyzePluginPermissions({ imports, granted, manifests: MANIFESTS }); + expect(missingGrant).toHaveLength(0); + }); + + it("flags an import that maps to a permission the manifest does not define", () => { + const imports = new Map([["fs:frobnicate", ["src/a.ts:1"]]]); + const granted = expandGrants({ permissions: ["fs:default"] }, MANIFESTS); + const { unknownPermission } = analyzePluginPermissions({ imports, granted, manifests: MANIFESTS }); + expect(unknownPermission.map(([k]) => k)).toEqual(["fs:frobnicate"]); + }); +}); diff --git a/apps/desktop/scripts/check-tauri-capability-coverage.mjs b/apps/desktop/scripts/check-tauri-capability-coverage.mjs index 53191f2c..32952c14 100644 --- a/apps/desktop/scripts/check-tauri-capability-coverage.mjs +++ b/apps/desktop/scripts/check-tauri-capability-coverage.mjs @@ -87,6 +87,133 @@ export function analyzeCoverage({ registered, allowed, invoked }) { return { missingPerm, notRegistered }; } +// ── Plugin permissions (AC-60) ─────────────────────────────────────────────── +// +// The same packaged-build-only failure exists for plugin calls: `readTextFile` from +// @tauri-apps/plugin-fs needs `fs:allow-read-text-file`, `open` from plugin-shell needs +// `shell:allow-open`. Dev mode does not enforce them. These helpers map the JS imports +// of the fs / dialog / shell plugins to the permission each call needs, and check it +// against the capability's grants, expanded through the plugin's default and named +// permission sets in gen/schemas/acl-manifests.json. + +export const CHECKED_PLUGINS = ["fs", "dialog", "shell"]; + +export const camelToKebab = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); + +// Permissions that satisfy a JS export, when the name is not simply allow-. +// Any one of the listed permissions is enough. +const ALTERNATIVES = { + "shell:Command": ["allow-execute", "allow-spawn"], +}; + +/** Permissions (any one suffices) the JS export `fn` of plugin `plugin` needs, or null for a non-call export. */ +export function requiredPermissions(plugin, fn) { + const key = `${plugin}:${fn}`; + if (ALTERNATIVES[key]) return ALTERNATIVES[key]; + // Types, enums and classes (BaseDirectory, FileHandle, ...) are not permission-gated calls. + if (!/^[a-z]/.test(fn)) return null; + return [`allow-${camelToKebab(fn)}`]; +} + +/** + * Imports of the fs / dialog / shell plugins, static or dynamic. Returns + * Map<"plugin:export", string[] locations>. `import type` and `type X` members are skipped. + */ +export function parsePluginImports(srcDir, rootForRelative = srcDir) { + const found = new Map(); + const plugins = CHECKED_PLUGINS.join("|"); + const staticRe = new RegExp( + `import\\s+(type\\s+)?\\{([^}]*)\\}\\s*from\\s*["']@tauri-apps/plugin-(${plugins})["']`, + "g", + ); + const dynamicRe = new RegExp( + `\\{([\\w$,\\s]*)\\}\\s*=\\s*await\\s+import\\(\\s*["']@tauri-apps/plugin-(${plugins})["']\\s*\\)`, + "g", + ); + const add = (plugin, members, text, index, rel) => { + const line = text.slice(0, index).split("\n").length; + for (let member of members.split(",")) { + member = member.trim(); + if (!member || /^type\s/.test(member)) continue; + const name = member.split(/\s+as\s+/)[0].trim(); + const key = `${plugin}:${name}`; + if (!found.has(key)) found.set(key, []); + found.get(key).push(`${rel}:${line}`); + } + }; + (function walk(dir) { + for (const entry of readdirSync(dir)) { + const full = join(dir, entry); + const st = statSync(full); + if (st.isDirectory()) { + if (entry === "node_modules" || entry === "dist") continue; + walk(full); + } else if (/\.(ts|tsx)$/.test(entry) && !/\.test\.(ts|tsx)$/.test(entry)) { + const text = readFileSync(full, "utf8"); + const rel = full.slice(rootForRelative.length + 1); + let m; + while ((m = staticRe.exec(text)) !== null) { + if (m[1]) continue; + add(m[3], m[2], text, m.index, rel); + } + while ((m = dynamicRe.exec(text)) !== null) add(m[2], m[1], text, m.index, rel); + } + } + })(srcDir); + return found; +} + +/** + * Every "plugin:permission" a capability grants, with plugin default / named sets expanded. + * A scoped object ({ identifier: "fs:allow-exists", allow: [...] }) grants its identifier. + */ +export function expandGrants(capsJson, manifests) { + const caps = typeof capsJson === "string" ? JSON.parse(capsJson) : capsJson; + const manifestOf = typeof manifests === "string" ? JSON.parse(manifests) : manifests; + const granted = new Set(); + const grant = (plugin, id, seen = new Set()) => { + const key = `${plugin}:${id}`; + if (seen.has(key)) return; + seen.add(key); + granted.add(key); + const m = manifestOf[plugin]; + if (!m) return; + const set = + id === "default" ? m.default_permission : m.permission_sets?.[id]; + for (const inner of set?.permissions ?? []) grant(plugin, inner, seen); + }; + for (const p of caps.permissions) { + const id = typeof p === "string" ? p : p?.identifier; + if (typeof id !== "string") continue; + const colon = id.lastIndexOf(":"); + if (colon === -1) continue; // bare allow-* app commands are checked elsewhere + // "core:window:allow-x" nests, so the plugin key is everything before the last colon. + grant(id.slice(0, colon), id.slice(colon + 1)); + } + return granted; +} + +/** Pure analysis: imports needing a permission the capability does not grant, or that does not exist. */ +export function analyzePluginPermissions({ imports, granted, manifests }) { + const manifestOf = typeof manifests === "string" ? JSON.parse(manifests) : manifests; + const missingGrant = []; + const unknownPermission = []; + for (const [key, locs] of imports) { + const [plugin, fn] = key.split(":"); + const needed = requiredPermissions(plugin, fn); + if (!needed) continue; + const known = manifestOf[plugin]?.permissions ?? {}; + if (!needed.some((id) => id in known)) { + unknownPermission.push([key, needed, locs]); + continue; + } + if (!needed.some((id) => granted.has(`${plugin}:${id}`))) { + missingGrant.push([key, needed.map((id) => `${plugin}:${id}`), locs]); + } + } + return { missingGrant, unknownPermission }; +} + function runCli() { const desktopRoot = resolve(dirname(fileURLToPath(import.meta.url)), ".."); const registered = parseRegisteredCommands( @@ -119,12 +246,42 @@ function runCli() { console.error(` - ${cmd} e.g. ${locs[0]}`); } } + // Plugin permissions: fs / dialog / shell JS imports against the grants in the capability. + const manifests = JSON.parse( + readFileSync(join(desktopRoot, "src-tauri/gen/schemas/acl-manifests.json"), "utf8"), + ); + const granted = expandGrants( + readFileSync(join(desktopRoot, "src-tauri/capabilities/default.json"), "utf8"), + manifests, + ); + const imports = parsePluginImports(srcDir, desktopRoot); + const { missingGrant, unknownPermission } = analyzePluginPermissions({ imports, granted, manifests }); + if (missingGrant.length) { + failed = true; + console.error( + `\n::error::${missingGrant.length} plugin call(s) imported by the webview are not granted by capabilities/default.json.`, + ); + console.error("These work under `tauri dev` but are refused in the packaged build:"); + for (const [key, perms, locs] of missingGrant.sort()) { + console.error(` - ${key} (needs ${perms.join(" or ")}) e.g. ${locs[0]}`); + } + } + if (unknownPermission.length) { + failed = true; + console.error( + `\n::error::${unknownPermission.length} plugin import(s) map to a permission that gen/schemas/acl-manifests.json does not define (update requiredPermissions, or regenerate the manifest with a build):`, + ); + for (const [key, perms, locs] of unknownPermission.sort()) { + console.error(` - ${key} (expected ${perms.join(" or ")}) e.g. ${locs[0]}`); + } + } + if (failed) { console.error("\nAdd the missing allow-* entry to capabilities/default.json (and register the command in lib.rs)."); process.exit(1); } console.log( - `Tauri capability coverage OK: ${invoked.size} invoked command(s), ${registered.size} registered, ${allowed.size} allow-* permissions.`, + `Tauri capability coverage OK: ${invoked.size} invoked command(s), ${registered.size} registered, ${allowed.size} allow-* permissions; ${imports.size} plugin import(s) all granted.`, ); } diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 652f0b9b..65777c1f 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -40,3 +40,5 @@ security-framework = "3" [dev-dependencies] tempfile = "3" +# `tauri::test` (mock runtime) for src/capability_smoke.rs +tauri = { version = "2", features = ["test"] } diff --git a/apps/desktop/src-tauri/build.rs b/apps/desktop/src-tauri/build.rs index 7b07a081..91d3942f 100644 --- a/apps/desktop/src-tauri/build.rs +++ b/apps/desktop/src-tauri/build.rs @@ -94,6 +94,8 @@ fn main() { "sync_write_files", "apply_surface_transaction", "record_transaction", + "list_changes", + "undo_change", "migrate_drift_acknowledgements", "acknowledge_drift", "unacknowledge_drift", @@ -104,7 +106,6 @@ fn main() { // Harness file "read_harness_file", "write_harness_file", - "scan_claude_config", // Harness detection (used by Fleet) "detect_harnesses", // Runtime FS scope grants (used by Fleet/Drift's project scope) diff --git a/apps/desktop/src-tauri/capabilities/default.json b/apps/desktop/src-tauri/capabilities/default.json index 855436bf..8ccd62d7 100644 --- a/apps/desktop/src-tauri/capabilities/default.json +++ b/apps/desktop/src-tauri/capabilities/default.json @@ -112,7 +112,6 @@ "allow-write-config-file", "allow-read-harness-file", "allow-write-harness-file", - "allow-scan-claude-config", "allow-list-custom-profiles", "allow-get-custom-profile", "allow-save-custom-profile", @@ -179,6 +178,8 @@ "allow-record-bundle-number", "allow-apply-surface-transaction", "allow-record-transaction", + "allow-list-changes", + "allow-undo-change", "allow-migrate-drift-acknowledgements", "allow-acknowledge-drift", "allow-unacknowledge-drift", diff --git a/apps/desktop/src-tauri/gen/schemas/acl-manifests.json b/apps/desktop/src-tauri/gen/schemas/acl-manifests.json index ca5f0a51..671e29c8 100644 --- a/apps/desktop/src-tauri/gen/schemas/acl-manifests.json +++ b/apps/desktop/src-tauri/gen/schemas/acl-manifests.json @@ -1 +1 @@ -{"__app-acl__":{"default_permission":null,"permissions":{"allow-acknowledge-drift":{"identifier":"allow-acknowledge-drift","description":"Enables the acknowledge_drift command without any pre-configured scope.","commands":{"allow":["acknowledge_drift"],"deny":[]}},"allow-acknowledge-drift-item":{"identifier":"allow-acknowledge-drift-item","description":"Enables the acknowledge_drift_item command without any pre-configured scope.","commands":{"allow":["acknowledge_drift_item"],"deny":[]}},"allow-apply-security-preset":{"identifier":"allow-apply-security-preset","description":"Enables the apply_security_preset command without any pre-configured scope.","commands":{"allow":["apply_security_preset"],"deny":[]}},"allow-apply-surface-transaction":{"identifier":"allow-apply-surface-transaction","description":"Enables the apply_surface_transaction command without any pre-configured scope.","commands":{"allow":["apply_surface_transaction"],"deny":[]}},"allow-check-for-updates":{"identifier":"allow-check-for-updates","description":"Enables the check_for_updates command without any pre-configured scope.","commands":{"allow":["check_for_updates"],"deny":[]}},"allow-check-git-repo":{"identifier":"allow-check-git-repo","description":"Enables the check_git_repo command without any pre-configured scope.","commands":{"allow":["check_git_repo"],"deny":[]}},"allow-check-plugin-updates":{"identifier":"allow-check-plugin-updates","description":"Enables the check_plugin_updates command without any pre-configured scope.","commands":{"allow":["check_plugin_updates"],"deny":[]}},"allow-choose-project-dir":{"identifier":"allow-choose-project-dir","description":"Enables the choose_project_dir command without any pre-configured scope.","commands":{"allow":["choose_project_dir"],"deny":[]}},"allow-clear-audit-entries":{"identifier":"allow-clear-audit-entries","description":"Enables the clear_audit_entries command without any pre-configured scope.","commands":{"allow":["clear_audit_entries"],"deny":[]}},"allow-compute-live-stats":{"identifier":"allow-compute-live-stats","description":"Enables the compute_live_stats command without any pre-configured scope.","commands":{"allow":["compute_live_stats"],"deny":[]}},"allow-create-evaluation-session":{"identifier":"allow-create-evaluation-session","description":"Enables the create_evaluation_session command without any pre-configured scope.","commands":{"allow":["create_evaluation_session"],"deny":[]}},"allow-create-worktrees":{"identifier":"allow-create-worktrees","description":"Enables the create_worktrees command without any pre-configured scope.","commands":{"allow":["create_worktrees"],"deny":[]}},"allow-delete-comparison":{"identifier":"allow-delete-comparison","description":"Enables the delete_comparison command without any pre-configured scope.","commands":{"allow":["delete_comparison"],"deny":[]}},"allow-delete-custom-profile":{"identifier":"allow-delete-custom-profile","description":"Enables the delete_custom_profile command without any pre-configured scope.","commands":{"allow":["delete_custom_profile"],"deny":[]}},"allow-delete-keychain-secret":{"identifier":"allow-delete-keychain-secret","description":"Enables the delete_keychain_secret command without any pre-configured scope.","commands":{"allow":["delete_keychain_secret"],"deny":[]}},"allow-delete-pairwise-vote":{"identifier":"allow-delete-pairwise-vote","description":"Enables the delete_pairwise_vote command without any pre-configured scope.","commands":{"allow":["delete_pairwise_vote"],"deny":[]}},"allow-detect-claude-account":{"identifier":"allow-detect-claude-account","description":"Enables the detect_claude_account command without any pre-configured scope.","commands":{"allow":["detect_claude_account"],"deny":[]}},"allow-detect-harnesses":{"identifier":"allow-detect-harnesses","description":"Enables the detect_harnesses command without any pre-configured scope.","commands":{"allow":["detect_harnesses"],"deny":[]}},"allow-export-comparison-json":{"identifier":"allow-export-comparison-json","description":"Enables the export_comparison_json command without any pre-configured scope.","commands":{"allow":["export_comparison_json"],"deny":[]}},"allow-export-plugin-as-zip":{"identifier":"allow-export-plugin-as-zip","description":"Enables the export_plugin_as_zip command without any pre-configured scope.","commands":{"allow":["export_plugin_as_zip"],"deny":[]}},"allow-export-plugin-to-folder":{"identifier":"allow-export-plugin-to-folder","description":"Enables the export_plugin_to_folder command without any pre-configured scope.","commands":{"allow":["export_plugin_to_folder"],"deny":[]}},"allow-get-acknowledged-drift-items":{"identifier":"allow-get-acknowledged-drift-items","description":"Enables the get_acknowledged_drift_items command without any pre-configured scope.","commands":{"allow":["get_acknowledged_drift_items"],"deny":[]}},"allow-get-cached-definitions":{"identifier":"allow-get-cached-definitions","description":"Enables the get_cached_definitions command without any pre-configured scope.","commands":{"allow":["get_cached_definitions"],"deny":[]}},"allow-get-comparator-analytics":{"identifier":"allow-get-comparator-analytics","description":"Enables the get_comparator_analytics command without any pre-configured scope.","commands":{"allow":["get_comparator_analytics"],"deny":[]}},"allow-get-comparison":{"identifier":"allow-get-comparison","description":"Enables the get_comparison command without any pre-configured scope.","commands":{"allow":["get_comparison"],"deny":[]}},"allow-get-comparison-diffs":{"identifier":"allow-get-comparison-diffs","description":"Enables the get_comparison_diffs command without any pre-configured scope.","commands":{"allow":["get_comparison_diffs"],"deny":[]}},"allow-get-custom-profile":{"identifier":"allow-get-custom-profile","description":"Enables the get_custom_profile command without any pre-configured scope.","commands":{"allow":["get_custom_profile"],"deny":[]}},"allow-get-diff-against-commit":{"identifier":"allow-get-diff-against-commit","description":"Enables the get_diff_against_commit command without any pre-configured scope.","commands":{"allow":["get_diff_against_commit"],"deny":[]}},"allow-get-evaluation-session":{"identifier":"allow-get-evaluation-session","description":"Enables the get_evaluation_session command without any pre-configured scope.","commands":{"allow":["get_evaluation_session"],"deny":[]}},"allow-get-evaluations":{"identifier":"allow-get-evaluations","description":"Enables the get_evaluations command without any pre-configured scope.","commands":{"allow":["get_evaluations"],"deny":[]}},"allow-get-harness-recommendations":{"identifier":"allow-get-harness-recommendations","description":"Enables the get_harness_recommendations command without any pre-configured scope.","commands":{"allow":["get_harness_recommendations"],"deny":[]}},"allow-get-highest-bundle-number":{"identifier":"allow-get-highest-bundle-number","description":"Enables the get_highest_bundle_number command without any pre-configured scope.","commands":{"allow":["get_highest_bundle_number"],"deny":[]}},"allow-get-history-size":{"identifier":"allow-get-history-size","description":"Enables the get_history_size command without any pre-configured scope.","commands":{"allow":["get_history_size"],"deny":[]}},"allow-get-pairwise-analytics":{"identifier":"allow-get-pairwise-analytics","description":"Enables the get_pairwise_analytics command without any pre-configured scope.","commands":{"allow":["get_pairwise_analytics"],"deny":[]}},"allow-get-pairwise-votes":{"identifier":"allow-get-pairwise-votes","description":"Enables the get_pairwise_votes command without any pre-configured scope.","commands":{"allow":["get_pairwise_votes"],"deny":[]}},"allow-get-panel-diffs":{"identifier":"allow-get-panel-diffs","description":"Enables the get_panel_diffs command without any pre-configured scope.","commands":{"allow":["get_panel_diffs"],"deny":[]}},"allow-get-system-info":{"identifier":"allow-get-system-info","description":"Enables the get_system_info command without any pre-configured scope.","commands":{"allow":["get_system_info"],"deny":[]}},"allow-grant-project-scope":{"identifier":"allow-grant-project-scope","description":"Enables the grant_project_scope command without any pre-configured scope.","commands":{"allow":["grant_project_scope"],"deny":[]}},"allow-guarded-remove-file":{"identifier":"allow-guarded-remove-file","description":"Enables the guarded_remove_file command without any pre-configured scope.","commands":{"allow":["guarded_remove_file"],"deny":[]}},"allow-guarded-rename-file":{"identifier":"allow-guarded-rename-file","description":"Enables the guarded_rename_file command without any pre-configured scope.","commands":{"allow":["guarded_rename_file"],"deny":[]}},"allow-guarded-write-file":{"identifier":"allow-guarded-write-file","description":"Enables the guarded_write_file command without any pre-configured scope.","commands":{"allow":["guarded_write_file"],"deny":[]}},"allow-import-plugin-from-path":{"identifier":"allow-import-plugin-from-path","description":"Enables the import_plugin_from_path command without any pre-configured scope.","commands":{"allow":["import_plugin_from_path"],"deny":[]}},"allow-import-plugin-from-zip":{"identifier":"allow-import-plugin-from-zip","description":"Enables the import_plugin_from_zip command without any pre-configured scope.","commands":{"allow":["import_plugin_from_zip"],"deny":[]}},"allow-list-active-sessions":{"identifier":"allow-list-active-sessions","description":"Enables the list_active_sessions command without any pre-configured scope.","commands":{"allow":["list_active_sessions"],"deny":[]}},"allow-list-audit-entries":{"identifier":"allow-list-audit-entries","description":"Enables the list_audit_entries command without any pre-configured scope.","commands":{"allow":["list_audit_entries"],"deny":[]}},"allow-list-claude-dir":{"identifier":"allow-list-claude-dir","description":"Enables the list_claude_dir command without any pre-configured scope.","commands":{"allow":["list_claude_dir"],"deny":[]}},"allow-list-comparisons":{"identifier":"allow-list-comparisons","description":"Enables the list_comparisons command without any pre-configured scope.","commands":{"allow":["list_comparisons"],"deny":[]}},"allow-list-custom-profiles":{"identifier":"allow-list-custom-profiles","description":"Enables the list_custom_profiles command without any pre-configured scope.","commands":{"allow":["list_custom_profiles"],"deny":[]}},"allow-list-drift-acknowledgements":{"identifier":"allow-list-drift-acknowledgements","description":"Enables the list_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":["list_drift_acknowledgements"],"deny":[]}},"allow-list-installed-plugins":{"identifier":"allow-list-installed-plugins","description":"Enables the list_installed_plugins command without any pre-configured scope.","commands":{"allow":["list_installed_plugins"],"deny":[]}},"allow-list-marketplaces":{"identifier":"allow-list-marketplaces","description":"Enables the list_marketplaces command without any pre-configured scope.","commands":{"allow":["list_marketplaces"],"deny":[]}},"allow-list-required-env":{"identifier":"allow-list-required-env","description":"Enables the list_required_env command without any pre-configured scope.","commands":{"allow":["list_required_env"],"deny":[]}},"allow-list-security-presets":{"identifier":"allow-list-security-presets","description":"Enables the list_security_presets command without any pre-configured scope.","commands":{"allow":["list_security_presets"],"deny":[]}},"allow-list-sessions-summary":{"identifier":"allow-list-sessions-summary","description":"Enables the list_sessions_summary command without any pre-configured scope.","commands":{"allow":["list_sessions_summary"],"deny":[]}},"allow-migrate-drift-acknowledgements":{"identifier":"allow-migrate-drift-acknowledgements","description":"Enables the migrate_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":["migrate_drift_acknowledgements"],"deny":[]}},"allow-push-file-history":{"identifier":"allow-push-file-history","description":"Enables the push_file_history command without any pre-configured scope.","commands":{"allow":["push_file_history"],"deny":[]}},"allow-put-cached-definitions":{"identifier":"allow-put-cached-definitions","description":"Enables the put_cached_definitions command without any pre-configured scope.","commands":{"allow":["put_cached_definitions"],"deny":[]}},"allow-read-claude-md":{"identifier":"allow-read-claude-md","description":"Enables the read_claude_md command without any pre-configured scope.","commands":{"allow":["read_claude_md"],"deny":[]}},"allow-read-env-config":{"identifier":"allow-read-env-config","description":"Enables the read_env_config command without any pre-configured scope.","commands":{"allow":["read_env_config"],"deny":[]}},"allow-read-file-history":{"identifier":"allow-read-file-history","description":"Enables the read_file_history command without any pre-configured scope.","commands":{"allow":["read_file_history"],"deny":[]}},"allow-read-harness-file":{"identifier":"allow-read-harness-file","description":"Enables the read_harness_file command without any pre-configured scope.","commands":{"allow":["read_harness_file"],"deny":[]}},"allow-read-hooks":{"identifier":"allow-read-hooks","description":"Enables the read_hooks command without any pre-configured scope.","commands":{"allow":["read_hooks"],"deny":[]}},"allow-read-live-activity":{"identifier":"allow-read-live-activity","description":"Enables the read_live_activity command without any pre-configured scope.","commands":{"allow":["read_live_activity"],"deny":[]}},"allow-read-permissions":{"identifier":"allow-read-permissions","description":"Enables the read_permissions command without any pre-configured scope.","commands":{"allow":["read_permissions"],"deny":[]}},"allow-read-plugin-file":{"identifier":"allow-read-plugin-file","description":"Enables the read_plugin_file command without any pre-configured scope.","commands":{"allow":["read_plugin_file"],"deny":[]}},"allow-read-plugin-tree":{"identifier":"allow-read-plugin-tree","description":"Enables the read_plugin_tree command without any pre-configured scope.","commands":{"allow":["read_plugin_tree"],"deny":[]}},"allow-read-session-facet":{"identifier":"allow-read-session-facet","description":"Enables the read_session_facet command without any pre-configured scope.","commands":{"allow":["read_session_facet"],"deny":[]}},"allow-read-session-transcript":{"identifier":"allow-read-session-transcript","description":"Enables the read_session_transcript command without any pre-configured scope.","commands":{"allow":["read_session_transcript"],"deny":[]}},"allow-read-stats-cache":{"identifier":"allow-read-stats-cache","description":"Enables the read_stats_cache command without any pre-configured scope.","commands":{"allow":["read_stats_cache"],"deny":[]}},"allow-record-bundle-number":{"identifier":"allow-record-bundle-number","description":"Enables the record_bundle_number command without any pre-configured scope.","commands":{"allow":["record_bundle_number"],"deny":[]}},"allow-record-transaction":{"identifier":"allow-record-transaction","description":"Enables the record_transaction command without any pre-configured scope.","commands":{"allow":["record_transaction"],"deny":[]}},"allow-remove-worktrees":{"identifier":"allow-remove-worktrees","description":"Enables the remove_worktrees command without any pre-configured scope.","commands":{"allow":["remove_worktrees"],"deny":[]}},"allow-reveal-evaluation-session":{"identifier":"allow-reveal-evaluation-session","description":"Enables the reveal_evaluation_session command without any pre-configured scope.","commands":{"allow":["reveal_evaluation_session"],"deny":[]}},"allow-save-comparison":{"identifier":"allow-save-comparison","description":"Enables the save_comparison command without any pre-configured scope.","commands":{"allow":["save_comparison"],"deny":[]}},"allow-save-custom-profile":{"identifier":"allow-save-custom-profile","description":"Enables the save_custom_profile command without any pre-configured scope.","commands":{"allow":["save_custom_profile"],"deny":[]}},"allow-save-evaluation":{"identifier":"allow-save-evaluation","description":"Enables the save_evaluation command without any pre-configured scope.","commands":{"allow":["save_evaluation"],"deny":[]}},"allow-save-file-diffs":{"identifier":"allow-save-file-diffs","description":"Enables the save_file_diffs command without any pre-configured scope.","commands":{"allow":["save_file_diffs"],"deny":[]}},"allow-save-pairwise-vote":{"identifier":"allow-save-pairwise-vote","description":"Enables the save_pairwise_vote command without any pre-configured scope.","commands":{"allow":["save_pairwise_vote"],"deny":[]}},"allow-save-panel":{"identifier":"allow-save-panel","description":"Enables the save_panel command without any pre-configured scope.","commands":{"allow":["save_panel"],"deny":[]}},"allow-scan-claude-config":{"identifier":"allow-scan-claude-config","description":"Enables the scan_claude_config command without any pre-configured scope.","commands":{"allow":["scan_claude_config"],"deny":[]}},"allow-set-keychain-secret":{"identifier":"allow-set-keychain-secret","description":"Enables the set_keychain_secret command without any pre-configured scope.","commands":{"allow":["set_keychain_secret"],"deny":[]}},"allow-submit-feedback":{"identifier":"allow-submit-feedback","description":"Enables the submit_feedback command without any pre-configured scope.","commands":{"allow":["submit_feedback"],"deny":[]}},"allow-sync-create-backup":{"identifier":"allow-sync-create-backup","description":"Enables the sync_create_backup command without any pre-configured scope.","commands":{"allow":["sync_create_backup"],"deny":[]}},"allow-sync-file-exists":{"identifier":"allow-sync-file-exists","description":"Enables the sync_file_exists command without any pre-configured scope.","commands":{"allow":["sync_file_exists"],"deny":[]}},"allow-sync-list-backups":{"identifier":"allow-sync-list-backups","description":"Enables the sync_list_backups command without any pre-configured scope.","commands":{"allow":["sync_list_backups"],"deny":[]}},"allow-sync-read-dir":{"identifier":"allow-sync-read-dir","description":"Enables the sync_read_dir command without any pre-configured scope.","commands":{"allow":["sync_read_dir"],"deny":[]}},"allow-sync-read-file":{"identifier":"allow-sync-read-file","description":"Enables the sync_read_file command without any pre-configured scope.","commands":{"allow":["sync_read_file"],"deny":[]}},"allow-sync-restore-backup":{"identifier":"allow-sync-restore-backup","description":"Enables the sync_restore_backup command without any pre-configured scope.","commands":{"allow":["sync_restore_backup"],"deny":[]}},"allow-sync-write-files":{"identifier":"allow-sync-write-files","description":"Enables the sync_write_files command without any pre-configured scope.","commands":{"allow":["sync_write_files"],"deny":[]}},"allow-tag-comparison-task-type":{"identifier":"allow-tag-comparison-task-type","description":"Enables the tag_comparison_task_type command without any pre-configured scope.","commands":{"allow":["tag_comparison_task_type"],"deny":[]}},"allow-trigger-rebuild":{"identifier":"allow-trigger-rebuild","description":"Enables the trigger_rebuild command without any pre-configured scope.","commands":{"allow":["trigger_rebuild"],"deny":[]}},"allow-unacknowledge-drift":{"identifier":"allow-unacknowledge-drift","description":"Enables the unacknowledge_drift command without any pre-configured scope.","commands":{"allow":["unacknowledge_drift"],"deny":[]}},"allow-unacknowledge-drift-item":{"identifier":"allow-unacknowledge-drift-item","description":"Enables the unacknowledge_drift_item command without any pre-configured scope.","commands":{"allow":["unacknowledge_drift_item"],"deny":[]}},"allow-uninstall-plugin":{"identifier":"allow-uninstall-plugin","description":"Enables the uninstall_plugin command without any pre-configured scope.","commands":{"allow":["uninstall_plugin"],"deny":[]}},"allow-update-comparison-status":{"identifier":"allow-update-comparison-status","description":"Enables the update_comparison_status command without any pre-configured scope.","commands":{"allow":["update_comparison_status"],"deny":[]}},"allow-update-comparison-title":{"identifier":"allow-update-comparison-title","description":"Enables the update_comparison_title command without any pre-configured scope.","commands":{"allow":["update_comparison_title"],"deny":[]}},"allow-update-evaluation-score":{"identifier":"allow-update-evaluation-score","description":"Enables the update_evaluation_score command without any pre-configured scope.","commands":{"allow":["update_evaluation_score"],"deny":[]}},"allow-update-panel-result":{"identifier":"allow-update-panel-result","description":"Enables the update_panel_result command without any pre-configured scope.","commands":{"allow":["update_panel_result"],"deny":[]}},"allow-update-permissions":{"identifier":"allow-update-permissions","description":"Enables the update_permissions command without any pre-configured scope.","commands":{"allow":["update_permissions"],"deny":[]}},"allow-verify-definitions-signature":{"identifier":"allow-verify-definitions-signature","description":"Enables the verify_definitions_signature command without any pre-configured scope.","commands":{"allow":["verify_definitions_signature"],"deny":[]}},"allow-write-config-file":{"identifier":"allow-write-config-file","description":"Enables the write_config_file command without any pre-configured scope.","commands":{"allow":["write_config_file"],"deny":[]}},"allow-write-env-config":{"identifier":"allow-write-env-config","description":"Enables the write_env_config command without any pre-configured scope.","commands":{"allow":["write_env_config"],"deny":[]}},"allow-write-harness-file":{"identifier":"allow-write-harness-file","description":"Enables the write_harness_file command without any pre-configured scope.","commands":{"allow":["write_harness_file"],"deny":[]}},"allow-write-plugin-file":{"identifier":"allow-write-plugin-file","description":"Enables the write_plugin_file command without any pre-configured scope.","commands":{"allow":["write_plugin_file"],"deny":[]}},"deny-acknowledge-drift":{"identifier":"deny-acknowledge-drift","description":"Denies the acknowledge_drift command without any pre-configured scope.","commands":{"allow":[],"deny":["acknowledge_drift"]}},"deny-acknowledge-drift-item":{"identifier":"deny-acknowledge-drift-item","description":"Denies the acknowledge_drift_item command without any pre-configured scope.","commands":{"allow":[],"deny":["acknowledge_drift_item"]}},"deny-apply-security-preset":{"identifier":"deny-apply-security-preset","description":"Denies the apply_security_preset command without any pre-configured scope.","commands":{"allow":[],"deny":["apply_security_preset"]}},"deny-apply-surface-transaction":{"identifier":"deny-apply-surface-transaction","description":"Denies the apply_surface_transaction command without any pre-configured scope.","commands":{"allow":[],"deny":["apply_surface_transaction"]}},"deny-check-for-updates":{"identifier":"deny-check-for-updates","description":"Denies the check_for_updates command without any pre-configured scope.","commands":{"allow":[],"deny":["check_for_updates"]}},"deny-check-git-repo":{"identifier":"deny-check-git-repo","description":"Denies the check_git_repo command without any pre-configured scope.","commands":{"allow":[],"deny":["check_git_repo"]}},"deny-check-plugin-updates":{"identifier":"deny-check-plugin-updates","description":"Denies the check_plugin_updates command without any pre-configured scope.","commands":{"allow":[],"deny":["check_plugin_updates"]}},"deny-choose-project-dir":{"identifier":"deny-choose-project-dir","description":"Denies the choose_project_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["choose_project_dir"]}},"deny-clear-audit-entries":{"identifier":"deny-clear-audit-entries","description":"Denies the clear_audit_entries command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_audit_entries"]}},"deny-compute-live-stats":{"identifier":"deny-compute-live-stats","description":"Denies the compute_live_stats command without any pre-configured scope.","commands":{"allow":[],"deny":["compute_live_stats"]}},"deny-create-evaluation-session":{"identifier":"deny-create-evaluation-session","description":"Denies the create_evaluation_session command without any pre-configured scope.","commands":{"allow":[],"deny":["create_evaluation_session"]}},"deny-create-worktrees":{"identifier":"deny-create-worktrees","description":"Denies the create_worktrees command without any pre-configured scope.","commands":{"allow":[],"deny":["create_worktrees"]}},"deny-delete-comparison":{"identifier":"deny-delete-comparison","description":"Denies the delete_comparison command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_comparison"]}},"deny-delete-custom-profile":{"identifier":"deny-delete-custom-profile","description":"Denies the delete_custom_profile command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_custom_profile"]}},"deny-delete-keychain-secret":{"identifier":"deny-delete-keychain-secret","description":"Denies the delete_keychain_secret command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_keychain_secret"]}},"deny-delete-pairwise-vote":{"identifier":"deny-delete-pairwise-vote","description":"Denies the delete_pairwise_vote command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_pairwise_vote"]}},"deny-detect-claude-account":{"identifier":"deny-detect-claude-account","description":"Denies the detect_claude_account command without any pre-configured scope.","commands":{"allow":[],"deny":["detect_claude_account"]}},"deny-detect-harnesses":{"identifier":"deny-detect-harnesses","description":"Denies the detect_harnesses command without any pre-configured scope.","commands":{"allow":[],"deny":["detect_harnesses"]}},"deny-export-comparison-json":{"identifier":"deny-export-comparison-json","description":"Denies the export_comparison_json command without any pre-configured scope.","commands":{"allow":[],"deny":["export_comparison_json"]}},"deny-export-plugin-as-zip":{"identifier":"deny-export-plugin-as-zip","description":"Denies the export_plugin_as_zip command without any pre-configured scope.","commands":{"allow":[],"deny":["export_plugin_as_zip"]}},"deny-export-plugin-to-folder":{"identifier":"deny-export-plugin-to-folder","description":"Denies the export_plugin_to_folder command without any pre-configured scope.","commands":{"allow":[],"deny":["export_plugin_to_folder"]}},"deny-get-acknowledged-drift-items":{"identifier":"deny-get-acknowledged-drift-items","description":"Denies the get_acknowledged_drift_items command without any pre-configured scope.","commands":{"allow":[],"deny":["get_acknowledged_drift_items"]}},"deny-get-cached-definitions":{"identifier":"deny-get-cached-definitions","description":"Denies the get_cached_definitions command without any pre-configured scope.","commands":{"allow":[],"deny":["get_cached_definitions"]}},"deny-get-comparator-analytics":{"identifier":"deny-get-comparator-analytics","description":"Denies the get_comparator_analytics command without any pre-configured scope.","commands":{"allow":[],"deny":["get_comparator_analytics"]}},"deny-get-comparison":{"identifier":"deny-get-comparison","description":"Denies the get_comparison command without any pre-configured scope.","commands":{"allow":[],"deny":["get_comparison"]}},"deny-get-comparison-diffs":{"identifier":"deny-get-comparison-diffs","description":"Denies the get_comparison_diffs command without any pre-configured scope.","commands":{"allow":[],"deny":["get_comparison_diffs"]}},"deny-get-custom-profile":{"identifier":"deny-get-custom-profile","description":"Denies the get_custom_profile command without any pre-configured scope.","commands":{"allow":[],"deny":["get_custom_profile"]}},"deny-get-diff-against-commit":{"identifier":"deny-get-diff-against-commit","description":"Denies the get_diff_against_commit command without any pre-configured scope.","commands":{"allow":[],"deny":["get_diff_against_commit"]}},"deny-get-evaluation-session":{"identifier":"deny-get-evaluation-session","description":"Denies the get_evaluation_session command without any pre-configured scope.","commands":{"allow":[],"deny":["get_evaluation_session"]}},"deny-get-evaluations":{"identifier":"deny-get-evaluations","description":"Denies the get_evaluations command without any pre-configured scope.","commands":{"allow":[],"deny":["get_evaluations"]}},"deny-get-harness-recommendations":{"identifier":"deny-get-harness-recommendations","description":"Denies the get_harness_recommendations command without any pre-configured scope.","commands":{"allow":[],"deny":["get_harness_recommendations"]}},"deny-get-highest-bundle-number":{"identifier":"deny-get-highest-bundle-number","description":"Denies the get_highest_bundle_number command without any pre-configured scope.","commands":{"allow":[],"deny":["get_highest_bundle_number"]}},"deny-get-history-size":{"identifier":"deny-get-history-size","description":"Denies the get_history_size command without any pre-configured scope.","commands":{"allow":[],"deny":["get_history_size"]}},"deny-get-pairwise-analytics":{"identifier":"deny-get-pairwise-analytics","description":"Denies the get_pairwise_analytics command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pairwise_analytics"]}},"deny-get-pairwise-votes":{"identifier":"deny-get-pairwise-votes","description":"Denies the get_pairwise_votes command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pairwise_votes"]}},"deny-get-panel-diffs":{"identifier":"deny-get-panel-diffs","description":"Denies the get_panel_diffs command without any pre-configured scope.","commands":{"allow":[],"deny":["get_panel_diffs"]}},"deny-get-system-info":{"identifier":"deny-get-system-info","description":"Denies the get_system_info command without any pre-configured scope.","commands":{"allow":[],"deny":["get_system_info"]}},"deny-grant-project-scope":{"identifier":"deny-grant-project-scope","description":"Denies the grant_project_scope command without any pre-configured scope.","commands":{"allow":[],"deny":["grant_project_scope"]}},"deny-guarded-remove-file":{"identifier":"deny-guarded-remove-file","description":"Denies the guarded_remove_file command without any pre-configured scope.","commands":{"allow":[],"deny":["guarded_remove_file"]}},"deny-guarded-rename-file":{"identifier":"deny-guarded-rename-file","description":"Denies the guarded_rename_file command without any pre-configured scope.","commands":{"allow":[],"deny":["guarded_rename_file"]}},"deny-guarded-write-file":{"identifier":"deny-guarded-write-file","description":"Denies the guarded_write_file command without any pre-configured scope.","commands":{"allow":[],"deny":["guarded_write_file"]}},"deny-import-plugin-from-path":{"identifier":"deny-import-plugin-from-path","description":"Denies the import_plugin_from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["import_plugin_from_path"]}},"deny-import-plugin-from-zip":{"identifier":"deny-import-plugin-from-zip","description":"Denies the import_plugin_from_zip command without any pre-configured scope.","commands":{"allow":[],"deny":["import_plugin_from_zip"]}},"deny-list-active-sessions":{"identifier":"deny-list-active-sessions","description":"Denies the list_active_sessions command without any pre-configured scope.","commands":{"allow":[],"deny":["list_active_sessions"]}},"deny-list-audit-entries":{"identifier":"deny-list-audit-entries","description":"Denies the list_audit_entries command without any pre-configured scope.","commands":{"allow":[],"deny":["list_audit_entries"]}},"deny-list-claude-dir":{"identifier":"deny-list-claude-dir","description":"Denies the list_claude_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["list_claude_dir"]}},"deny-list-comparisons":{"identifier":"deny-list-comparisons","description":"Denies the list_comparisons command without any pre-configured scope.","commands":{"allow":[],"deny":["list_comparisons"]}},"deny-list-custom-profiles":{"identifier":"deny-list-custom-profiles","description":"Denies the list_custom_profiles command without any pre-configured scope.","commands":{"allow":[],"deny":["list_custom_profiles"]}},"deny-list-drift-acknowledgements":{"identifier":"deny-list-drift-acknowledgements","description":"Denies the list_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":[],"deny":["list_drift_acknowledgements"]}},"deny-list-installed-plugins":{"identifier":"deny-list-installed-plugins","description":"Denies the list_installed_plugins command without any pre-configured scope.","commands":{"allow":[],"deny":["list_installed_plugins"]}},"deny-list-marketplaces":{"identifier":"deny-list-marketplaces","description":"Denies the list_marketplaces command without any pre-configured scope.","commands":{"allow":[],"deny":["list_marketplaces"]}},"deny-list-required-env":{"identifier":"deny-list-required-env","description":"Denies the list_required_env command without any pre-configured scope.","commands":{"allow":[],"deny":["list_required_env"]}},"deny-list-security-presets":{"identifier":"deny-list-security-presets","description":"Denies the list_security_presets command without any pre-configured scope.","commands":{"allow":[],"deny":["list_security_presets"]}},"deny-list-sessions-summary":{"identifier":"deny-list-sessions-summary","description":"Denies the list_sessions_summary command without any pre-configured scope.","commands":{"allow":[],"deny":["list_sessions_summary"]}},"deny-migrate-drift-acknowledgements":{"identifier":"deny-migrate-drift-acknowledgements","description":"Denies the migrate_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":[],"deny":["migrate_drift_acknowledgements"]}},"deny-push-file-history":{"identifier":"deny-push-file-history","description":"Denies the push_file_history command without any pre-configured scope.","commands":{"allow":[],"deny":["push_file_history"]}},"deny-put-cached-definitions":{"identifier":"deny-put-cached-definitions","description":"Denies the put_cached_definitions command without any pre-configured scope.","commands":{"allow":[],"deny":["put_cached_definitions"]}},"deny-read-claude-md":{"identifier":"deny-read-claude-md","description":"Denies the read_claude_md command without any pre-configured scope.","commands":{"allow":[],"deny":["read_claude_md"]}},"deny-read-env-config":{"identifier":"deny-read-env-config","description":"Denies the read_env_config command without any pre-configured scope.","commands":{"allow":[],"deny":["read_env_config"]}},"deny-read-file-history":{"identifier":"deny-read-file-history","description":"Denies the read_file_history command without any pre-configured scope.","commands":{"allow":[],"deny":["read_file_history"]}},"deny-read-harness-file":{"identifier":"deny-read-harness-file","description":"Denies the read_harness_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_harness_file"]}},"deny-read-hooks":{"identifier":"deny-read-hooks","description":"Denies the read_hooks command without any pre-configured scope.","commands":{"allow":[],"deny":["read_hooks"]}},"deny-read-live-activity":{"identifier":"deny-read-live-activity","description":"Denies the read_live_activity command without any pre-configured scope.","commands":{"allow":[],"deny":["read_live_activity"]}},"deny-read-permissions":{"identifier":"deny-read-permissions","description":"Denies the read_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["read_permissions"]}},"deny-read-plugin-file":{"identifier":"deny-read-plugin-file","description":"Denies the read_plugin_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_plugin_file"]}},"deny-read-plugin-tree":{"identifier":"deny-read-plugin-tree","description":"Denies the read_plugin_tree command without any pre-configured scope.","commands":{"allow":[],"deny":["read_plugin_tree"]}},"deny-read-session-facet":{"identifier":"deny-read-session-facet","description":"Denies the read_session_facet command without any pre-configured scope.","commands":{"allow":[],"deny":["read_session_facet"]}},"deny-read-session-transcript":{"identifier":"deny-read-session-transcript","description":"Denies the read_session_transcript command without any pre-configured scope.","commands":{"allow":[],"deny":["read_session_transcript"]}},"deny-read-stats-cache":{"identifier":"deny-read-stats-cache","description":"Denies the read_stats_cache command without any pre-configured scope.","commands":{"allow":[],"deny":["read_stats_cache"]}},"deny-record-bundle-number":{"identifier":"deny-record-bundle-number","description":"Denies the record_bundle_number command without any pre-configured scope.","commands":{"allow":[],"deny":["record_bundle_number"]}},"deny-record-transaction":{"identifier":"deny-record-transaction","description":"Denies the record_transaction command without any pre-configured scope.","commands":{"allow":[],"deny":["record_transaction"]}},"deny-remove-worktrees":{"identifier":"deny-remove-worktrees","description":"Denies the remove_worktrees command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_worktrees"]}},"deny-reveal-evaluation-session":{"identifier":"deny-reveal-evaluation-session","description":"Denies the reveal_evaluation_session command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_evaluation_session"]}},"deny-save-comparison":{"identifier":"deny-save-comparison","description":"Denies the save_comparison command without any pre-configured scope.","commands":{"allow":[],"deny":["save_comparison"]}},"deny-save-custom-profile":{"identifier":"deny-save-custom-profile","description":"Denies the save_custom_profile command without any pre-configured scope.","commands":{"allow":[],"deny":["save_custom_profile"]}},"deny-save-evaluation":{"identifier":"deny-save-evaluation","description":"Denies the save_evaluation command without any pre-configured scope.","commands":{"allow":[],"deny":["save_evaluation"]}},"deny-save-file-diffs":{"identifier":"deny-save-file-diffs","description":"Denies the save_file_diffs command without any pre-configured scope.","commands":{"allow":[],"deny":["save_file_diffs"]}},"deny-save-pairwise-vote":{"identifier":"deny-save-pairwise-vote","description":"Denies the save_pairwise_vote command without any pre-configured scope.","commands":{"allow":[],"deny":["save_pairwise_vote"]}},"deny-save-panel":{"identifier":"deny-save-panel","description":"Denies the save_panel command without any pre-configured scope.","commands":{"allow":[],"deny":["save_panel"]}},"deny-scan-claude-config":{"identifier":"deny-scan-claude-config","description":"Denies the scan_claude_config command without any pre-configured scope.","commands":{"allow":[],"deny":["scan_claude_config"]}},"deny-set-keychain-secret":{"identifier":"deny-set-keychain-secret","description":"Denies the set_keychain_secret command without any pre-configured scope.","commands":{"allow":[],"deny":["set_keychain_secret"]}},"deny-submit-feedback":{"identifier":"deny-submit-feedback","description":"Denies the submit_feedback command without any pre-configured scope.","commands":{"allow":[],"deny":["submit_feedback"]}},"deny-sync-create-backup":{"identifier":"deny-sync-create-backup","description":"Denies the sync_create_backup command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_create_backup"]}},"deny-sync-file-exists":{"identifier":"deny-sync-file-exists","description":"Denies the sync_file_exists command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_file_exists"]}},"deny-sync-list-backups":{"identifier":"deny-sync-list-backups","description":"Denies the sync_list_backups command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_list_backups"]}},"deny-sync-read-dir":{"identifier":"deny-sync-read-dir","description":"Denies the sync_read_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_read_dir"]}},"deny-sync-read-file":{"identifier":"deny-sync-read-file","description":"Denies the sync_read_file command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_read_file"]}},"deny-sync-restore-backup":{"identifier":"deny-sync-restore-backup","description":"Denies the sync_restore_backup command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_restore_backup"]}},"deny-sync-write-files":{"identifier":"deny-sync-write-files","description":"Denies the sync_write_files command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_write_files"]}},"deny-tag-comparison-task-type":{"identifier":"deny-tag-comparison-task-type","description":"Denies the tag_comparison_task_type command without any pre-configured scope.","commands":{"allow":[],"deny":["tag_comparison_task_type"]}},"deny-trigger-rebuild":{"identifier":"deny-trigger-rebuild","description":"Denies the trigger_rebuild command without any pre-configured scope.","commands":{"allow":[],"deny":["trigger_rebuild"]}},"deny-unacknowledge-drift":{"identifier":"deny-unacknowledge-drift","description":"Denies the unacknowledge_drift command without any pre-configured scope.","commands":{"allow":[],"deny":["unacknowledge_drift"]}},"deny-unacknowledge-drift-item":{"identifier":"deny-unacknowledge-drift-item","description":"Denies the unacknowledge_drift_item command without any pre-configured scope.","commands":{"allow":[],"deny":["unacknowledge_drift_item"]}},"deny-uninstall-plugin":{"identifier":"deny-uninstall-plugin","description":"Denies the uninstall_plugin command without any pre-configured scope.","commands":{"allow":[],"deny":["uninstall_plugin"]}},"deny-update-comparison-status":{"identifier":"deny-update-comparison-status","description":"Denies the update_comparison_status command without any pre-configured scope.","commands":{"allow":[],"deny":["update_comparison_status"]}},"deny-update-comparison-title":{"identifier":"deny-update-comparison-title","description":"Denies the update_comparison_title command without any pre-configured scope.","commands":{"allow":[],"deny":["update_comparison_title"]}},"deny-update-evaluation-score":{"identifier":"deny-update-evaluation-score","description":"Denies the update_evaluation_score command without any pre-configured scope.","commands":{"allow":[],"deny":["update_evaluation_score"]}},"deny-update-panel-result":{"identifier":"deny-update-panel-result","description":"Denies the update_panel_result command without any pre-configured scope.","commands":{"allow":[],"deny":["update_panel_result"]}},"deny-update-permissions":{"identifier":"deny-update-permissions","description":"Denies the update_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["update_permissions"]}},"deny-verify-definitions-signature":{"identifier":"deny-verify-definitions-signature","description":"Denies the verify_definitions_signature command without any pre-configured scope.","commands":{"allow":[],"deny":["verify_definitions_signature"]}},"deny-write-config-file":{"identifier":"deny-write-config-file","description":"Denies the write_config_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_config_file"]}},"deny-write-env-config":{"identifier":"deny-write-env-config","description":"Denies the write_env_config command without any pre-configured scope.","commands":{"allow":[],"deny":["write_env_config"]}},"deny-write-harness-file":{"identifier":"deny-write-harness-file","description":"Denies the write_harness_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_harness_file"]}},"deny-write-plugin-file":{"identifier":"deny-write-plugin-file","description":"Denies the write_plugin_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_plugin_file"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-fullscreen-on-monitor":{"identifier":"allow-set-fullscreen-on-monitor","description":"Enables the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":["set_fullscreen_on_monitor"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-fullscreen-on-monitor":{"identifier":"deny-set-fullscreen-on-monitor","description":"Denies the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen_on_monitor"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"fs":{"default_permission":{"identifier":"default","description":"This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\n\n- On Windows the access to webview data folder `$APPLOCALDATA/EBWebView` is denied.\n- On Linux the access to webview data paths inside `$APPLOCALDATA` are denied.\n","permissions":["create-app-specific-dirs","read-app-specific-dirs-recursive","deny-default"]},"permissions":{"allow-copy-file":{"identifier":"allow-copy-file","description":"Enables the copy_file command without any pre-configured scope.","commands":{"allow":["copy_file"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-exists":{"identifier":"allow-exists","description":"Enables the exists command without any pre-configured scope.","commands":{"allow":["exists"],"deny":[]}},"allow-fstat":{"identifier":"allow-fstat","description":"Enables the fstat command without any pre-configured scope.","commands":{"allow":["fstat"],"deny":[]}},"allow-ftruncate":{"identifier":"allow-ftruncate","description":"Enables the ftruncate command without any pre-configured scope.","commands":{"allow":["ftruncate"],"deny":[]}},"allow-lstat":{"identifier":"allow-lstat","description":"Enables the lstat command without any pre-configured scope.","commands":{"allow":["lstat"],"deny":[]}},"allow-mkdir":{"identifier":"allow-mkdir","description":"Enables the mkdir command without any pre-configured scope.","commands":{"allow":["mkdir"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-read":{"identifier":"allow-read","description":"Enables the read command without any pre-configured scope.","commands":{"allow":["read"],"deny":[]}},"allow-read-dir":{"identifier":"allow-read-dir","description":"Enables the read_dir command without any pre-configured scope.","commands":{"allow":["read_dir"],"deny":[]}},"allow-read-file":{"identifier":"allow-read-file","description":"Enables the read_file command without any pre-configured scope.","commands":{"allow":["read_file"],"deny":[]}},"allow-read-text-file":{"identifier":"allow-read-text-file","description":"Enables the read_text_file command without any pre-configured scope.","commands":{"allow":["read_text_file"],"deny":[]}},"allow-read-text-file-lines":{"identifier":"allow-read-text-file-lines","description":"Enables the read_text_file_lines command without any pre-configured scope.","commands":{"allow":["read_text_file_lines","read_text_file_lines_next"],"deny":[]}},"allow-read-text-file-lines-next":{"identifier":"allow-read-text-file-lines-next","description":"Enables the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":["read_text_file_lines_next"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-rename":{"identifier":"allow-rename","description":"Enables the rename command without any pre-configured scope.","commands":{"allow":["rename"],"deny":[]}},"allow-seek":{"identifier":"allow-seek","description":"Enables the seek command without any pre-configured scope.","commands":{"allow":["seek"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"allow-start-accessing-security-scoped-resource":{"identifier":"allow-start-accessing-security-scoped-resource","description":"Enables the start_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":["start_accessing_security_scoped_resource"],"deny":[]}},"allow-stat":{"identifier":"allow-stat","description":"Enables the stat command without any pre-configured scope.","commands":{"allow":["stat"],"deny":[]}},"allow-stop-accessing-security-scoped-resource":{"identifier":"allow-stop-accessing-security-scoped-resource","description":"Enables the stop_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":["stop_accessing_security_scoped_resource"],"deny":[]}},"allow-truncate":{"identifier":"allow-truncate","description":"Enables the truncate command without any pre-configured scope.","commands":{"allow":["truncate"],"deny":[]}},"allow-unwatch":{"identifier":"allow-unwatch","description":"Enables the unwatch command without any pre-configured scope.","commands":{"allow":["unwatch"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"allow-write":{"identifier":"allow-write","description":"Enables the write command without any pre-configured scope.","commands":{"allow":["write"],"deny":[]}},"allow-write-file":{"identifier":"allow-write-file","description":"Enables the write_file command without any pre-configured scope.","commands":{"allow":["write_file","open","write"],"deny":[]}},"allow-write-text-file":{"identifier":"allow-write-text-file","description":"Enables the write_text_file command without any pre-configured scope.","commands":{"allow":["write_text_file"],"deny":[]}},"deny-copy-file":{"identifier":"deny-copy-file","description":"Denies the copy_file command without any pre-configured scope.","commands":{"allow":[],"deny":["copy_file"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-exists":{"identifier":"deny-exists","description":"Denies the exists command without any pre-configured scope.","commands":{"allow":[],"deny":["exists"]}},"deny-fstat":{"identifier":"deny-fstat","description":"Denies the fstat command without any pre-configured scope.","commands":{"allow":[],"deny":["fstat"]}},"deny-ftruncate":{"identifier":"deny-ftruncate","description":"Denies the ftruncate command without any pre-configured scope.","commands":{"allow":[],"deny":["ftruncate"]}},"deny-lstat":{"identifier":"deny-lstat","description":"Denies the lstat command without any pre-configured scope.","commands":{"allow":[],"deny":["lstat"]}},"deny-mkdir":{"identifier":"deny-mkdir","description":"Denies the mkdir command without any pre-configured scope.","commands":{"allow":[],"deny":["mkdir"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-read":{"identifier":"deny-read","description":"Denies the read command without any pre-configured scope.","commands":{"allow":[],"deny":["read"]}},"deny-read-dir":{"identifier":"deny-read-dir","description":"Denies the read_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["read_dir"]}},"deny-read-file":{"identifier":"deny-read-file","description":"Denies the read_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_file"]}},"deny-read-text-file":{"identifier":"deny-read-text-file","description":"Denies the read_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file"]}},"deny-read-text-file-lines":{"identifier":"deny-read-text-file-lines","description":"Denies the read_text_file_lines command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines"]}},"deny-read-text-file-lines-next":{"identifier":"deny-read-text-file-lines-next","description":"Denies the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines_next"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-rename":{"identifier":"deny-rename","description":"Denies the rename command without any pre-configured scope.","commands":{"allow":[],"deny":["rename"]}},"deny-seek":{"identifier":"deny-seek","description":"Denies the seek command without any pre-configured scope.","commands":{"allow":[],"deny":["seek"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}},"deny-start-accessing-security-scoped-resource":{"identifier":"deny-start-accessing-security-scoped-resource","description":"Denies the start_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":[],"deny":["start_accessing_security_scoped_resource"]}},"deny-stat":{"identifier":"deny-stat","description":"Denies the stat command without any pre-configured scope.","commands":{"allow":[],"deny":["stat"]}},"deny-stop-accessing-security-scoped-resource":{"identifier":"deny-stop-accessing-security-scoped-resource","description":"Denies the stop_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":[],"deny":["stop_accessing_security_scoped_resource"]}},"deny-truncate":{"identifier":"deny-truncate","description":"Denies the truncate command without any pre-configured scope.","commands":{"allow":[],"deny":["truncate"]}},"deny-unwatch":{"identifier":"deny-unwatch","description":"Denies the unwatch command without any pre-configured scope.","commands":{"allow":[],"deny":["unwatch"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}},"deny-webview-data-linux":{"identifier":"deny-webview-data-linux","description":"This denies access to the following paths\n\n- `$APPLOCALDATA/CacheStorage/**`\n- `$APPLOCALDATA/cookies`\n- `$APPLOCALDATA/hsts-storage.sqlite`\n- `$APPLOCALDATA/serviceworkers/**`\n- `$APPLOCALDATA/WebKitCache/**`\n- `$APPLOCALDATA/databases/**`\n- `$APPLOCALDATA/localstorage/**`\n- `$APPLOCALDATA/mediakeys/**`\n- `$APPLOCALDATA/storage/**`\n\non linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]},"scope":{"deny":[{"path":"$APPLOCALDATA/CacheStorage/**"},{"path":"$APPLOCALDATA/cookies"},{"path":"$APPLOCALDATA/hsts-storage.sqlite"},{"path":"$APPLOCALDATA/serviceworkers/**"},{"path":"$APPLOCALDATA/WebKitCache/**"},{"path":"$APPLOCALDATA/databases/**"},{"path":"$APPLOCALDATA/localstorage/**"},{"path":"$APPLOCALDATA/mediakeys/**"},{"path":"$APPLOCALDATA/storage/**"}]},"platforms":["linux"]},"deny-webview-data-windows":{"identifier":"deny-webview-data-windows","description":"This denies access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]},"scope":{"deny":[{"path":"$APPLOCALDATA/EBWebView/**"}]},"platforms":["windows"]},"deny-write":{"identifier":"deny-write","description":"Denies the write command without any pre-configured scope.","commands":{"allow":[],"deny":["write"]}},"deny-write-file":{"identifier":"deny-write-file","description":"Denies the write_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_file"]}},"deny-write-text-file":{"identifier":"deny-write-text-file","description":"Denies the write_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text_file"]}},"read-all":{"identifier":"read-all","description":"This enables all read related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists","watch","unwatch"],"deny":[]}},"read-dirs":{"identifier":"read-dirs","description":"This enables directory read and file metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists"],"deny":[]}},"read-files":{"identifier":"read-files","description":"This enables file read related commands without any pre-configured accessible paths.","commands":{"allow":["read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists"],"deny":[]}},"read-meta":{"identifier":"read-meta","description":"This enables all index or metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists","size"],"deny":[]}},"scope":{"identifier":"scope","description":"An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n","commands":{"allow":[],"deny":[]}},"scope-app":{"identifier":"scope-app","description":"This scope permits access to all files and list content of top level directories in the application folders.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"},{"path":"$APPDATA"},{"path":"$APPDATA/*"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"},{"path":"$APPCACHE"},{"path":"$APPCACHE/*"},{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-app-index":{"identifier":"scope-app-index","description":"This scope permits to list all files and folders in the application directories.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPDATA"},{"path":"$APPLOCALDATA"},{"path":"$APPCACHE"},{"path":"$APPLOG"}]}},"scope-app-recursive":{"identifier":"scope-app-recursive","description":"This scope permits recursive access to the complete application folders, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"},{"path":"$APPDATA"},{"path":"$APPDATA/**"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"},{"path":"$APPCACHE"},{"path":"$APPCACHE/**"},{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-appcache":{"identifier":"scope-appcache","description":"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/*"}]}},"scope-appcache-index":{"identifier":"scope-appcache-index","description":"This scope permits to list all files and folders in the `$APPCACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"}]}},"scope-appcache-recursive":{"identifier":"scope-appcache-recursive","description":"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/**"}]}},"scope-appconfig":{"identifier":"scope-appconfig","description":"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"}]}},"scope-appconfig-index":{"identifier":"scope-appconfig-index","description":"This scope permits to list all files and folders in the `$APPCONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"}]}},"scope-appconfig-recursive":{"identifier":"scope-appconfig-recursive","description":"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"}]}},"scope-appdata":{"identifier":"scope-appdata","description":"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/*"}]}},"scope-appdata-index":{"identifier":"scope-appdata-index","description":"This scope permits to list all files and folders in the `$APPDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"}]}},"scope-appdata-recursive":{"identifier":"scope-appdata-recursive","description":"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]}},"scope-applocaldata":{"identifier":"scope-applocaldata","description":"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"}]}},"scope-applocaldata-index":{"identifier":"scope-applocaldata-index","description":"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"}]}},"scope-applocaldata-recursive":{"identifier":"scope-applocaldata-recursive","description":"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"}]}},"scope-applog":{"identifier":"scope-applog","description":"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-applog-index":{"identifier":"scope-applog-index","description":"This scope permits to list all files and folders in the `$APPLOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"}]}},"scope-applog-recursive":{"identifier":"scope-applog-recursive","description":"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-audio":{"identifier":"scope-audio","description":"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/*"}]}},"scope-audio-index":{"identifier":"scope-audio-index","description":"This scope permits to list all files and folders in the `$AUDIO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"}]}},"scope-audio-recursive":{"identifier":"scope-audio-recursive","description":"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/**"}]}},"scope-cache":{"identifier":"scope-cache","description":"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/*"}]}},"scope-cache-index":{"identifier":"scope-cache-index","description":"This scope permits to list all files and folders in the `$CACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"}]}},"scope-cache-recursive":{"identifier":"scope-cache-recursive","description":"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/**"}]}},"scope-config":{"identifier":"scope-config","description":"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/*"}]}},"scope-config-index":{"identifier":"scope-config-index","description":"This scope permits to list all files and folders in the `$CONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"}]}},"scope-config-recursive":{"identifier":"scope-config-recursive","description":"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/**"}]}},"scope-data":{"identifier":"scope-data","description":"This scope permits access to all files and list content of top level directories in the `$DATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/*"}]}},"scope-data-index":{"identifier":"scope-data-index","description":"This scope permits to list all files and folders in the `$DATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"}]}},"scope-data-recursive":{"identifier":"scope-data-recursive","description":"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/**"}]}},"scope-desktop":{"identifier":"scope-desktop","description":"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/*"}]}},"scope-desktop-index":{"identifier":"scope-desktop-index","description":"This scope permits to list all files and folders in the `$DESKTOP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"}]}},"scope-desktop-recursive":{"identifier":"scope-desktop-recursive","description":"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/**"}]}},"scope-document":{"identifier":"scope-document","description":"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/*"}]}},"scope-document-index":{"identifier":"scope-document-index","description":"This scope permits to list all files and folders in the `$DOCUMENT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"}]}},"scope-document-recursive":{"identifier":"scope-document-recursive","description":"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/**"}]}},"scope-download":{"identifier":"scope-download","description":"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/*"}]}},"scope-download-index":{"identifier":"scope-download-index","description":"This scope permits to list all files and folders in the `$DOWNLOAD`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"}]}},"scope-download-recursive":{"identifier":"scope-download-recursive","description":"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/**"}]}},"scope-exe":{"identifier":"scope-exe","description":"This scope permits access to all files and list content of top level directories in the `$EXE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/*"}]}},"scope-exe-index":{"identifier":"scope-exe-index","description":"This scope permits to list all files and folders in the `$EXE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"}]}},"scope-exe-recursive":{"identifier":"scope-exe-recursive","description":"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/**"}]}},"scope-font":{"identifier":"scope-font","description":"This scope permits access to all files and list content of top level directories in the `$FONT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/*"}]}},"scope-font-index":{"identifier":"scope-font-index","description":"This scope permits to list all files and folders in the `$FONT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"}]}},"scope-font-recursive":{"identifier":"scope-font-recursive","description":"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/**"}]}},"scope-home":{"identifier":"scope-home","description":"This scope permits access to all files and list content of top level directories in the `$HOME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/*"}]}},"scope-home-index":{"identifier":"scope-home-index","description":"This scope permits to list all files and folders in the `$HOME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"}]}},"scope-home-recursive":{"identifier":"scope-home-recursive","description":"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/**"}]}},"scope-localdata":{"identifier":"scope-localdata","description":"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/*"}]}},"scope-localdata-index":{"identifier":"scope-localdata-index","description":"This scope permits to list all files and folders in the `$LOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"}]}},"scope-localdata-recursive":{"identifier":"scope-localdata-recursive","description":"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/**"}]}},"scope-log":{"identifier":"scope-log","description":"This scope permits access to all files and list content of top level directories in the `$LOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/*"}]}},"scope-log-index":{"identifier":"scope-log-index","description":"This scope permits to list all files and folders in the `$LOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"}]}},"scope-log-recursive":{"identifier":"scope-log-recursive","description":"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/**"}]}},"scope-picture":{"identifier":"scope-picture","description":"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/*"}]}},"scope-picture-index":{"identifier":"scope-picture-index","description":"This scope permits to list all files and folders in the `$PICTURE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"}]}},"scope-picture-recursive":{"identifier":"scope-picture-recursive","description":"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/**"}]}},"scope-public":{"identifier":"scope-public","description":"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/*"}]}},"scope-public-index":{"identifier":"scope-public-index","description":"This scope permits to list all files and folders in the `$PUBLIC`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"}]}},"scope-public-recursive":{"identifier":"scope-public-recursive","description":"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/**"}]}},"scope-resource":{"identifier":"scope-resource","description":"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/*"}]}},"scope-resource-index":{"identifier":"scope-resource-index","description":"This scope permits to list all files and folders in the `$RESOURCE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"}]}},"scope-resource-recursive":{"identifier":"scope-resource-recursive","description":"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/**"}]}},"scope-runtime":{"identifier":"scope-runtime","description":"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/*"}]}},"scope-runtime-index":{"identifier":"scope-runtime-index","description":"This scope permits to list all files and folders in the `$RUNTIME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"}]}},"scope-runtime-recursive":{"identifier":"scope-runtime-recursive","description":"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/**"}]}},"scope-temp":{"identifier":"scope-temp","description":"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/*"}]}},"scope-temp-index":{"identifier":"scope-temp-index","description":"This scope permits to list all files and folders in the `$TEMP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"}]}},"scope-temp-recursive":{"identifier":"scope-temp-recursive","description":"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/**"}]}},"scope-template":{"identifier":"scope-template","description":"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/*"}]}},"scope-template-index":{"identifier":"scope-template-index","description":"This scope permits to list all files and folders in the `$TEMPLATE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"}]}},"scope-template-recursive":{"identifier":"scope-template-recursive","description":"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/**"}]}},"scope-video":{"identifier":"scope-video","description":"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/*"}]}},"scope-video-index":{"identifier":"scope-video-index","description":"This scope permits to list all files and folders in the `$VIDEO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"}]}},"scope-video-recursive":{"identifier":"scope-video-recursive","description":"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/**"}]}}},"permission_sets":{"allow-app-meta":{"identifier":"allow-app-meta","description":"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-index"]},"allow-app-meta-recursive":{"identifier":"allow-app-meta-recursive","description":"This allows full recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-recursive"]},"allow-app-read":{"identifier":"allow-app-read","description":"This allows non-recursive read access to the application folders.","permissions":["read-all","scope-app"]},"allow-app-read-recursive":{"identifier":"allow-app-read-recursive","description":"This allows full recursive read access to the complete application folders, files and subdirectories.","permissions":["read-all","scope-app-recursive"]},"allow-app-write":{"identifier":"allow-app-write","description":"This allows non-recursive write access to the application folders.","permissions":["write-all","scope-app"]},"allow-app-write-recursive":{"identifier":"allow-app-write-recursive","description":"This allows full recursive write access to the complete application folders, files and subdirectories.","permissions":["write-all","scope-app-recursive"]},"allow-appcache-meta":{"identifier":"allow-appcache-meta","description":"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-index"]},"allow-appcache-meta-recursive":{"identifier":"allow-appcache-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-recursive"]},"allow-appcache-read":{"identifier":"allow-appcache-read","description":"This allows non-recursive read access to the `$APPCACHE` folder.","permissions":["read-all","scope-appcache"]},"allow-appcache-read-recursive":{"identifier":"allow-appcache-read-recursive","description":"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["read-all","scope-appcache-recursive"]},"allow-appcache-write":{"identifier":"allow-appcache-write","description":"This allows non-recursive write access to the `$APPCACHE` folder.","permissions":["write-all","scope-appcache"]},"allow-appcache-write-recursive":{"identifier":"allow-appcache-write-recursive","description":"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["write-all","scope-appcache-recursive"]},"allow-appconfig-meta":{"identifier":"allow-appconfig-meta","description":"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-index"]},"allow-appconfig-meta-recursive":{"identifier":"allow-appconfig-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-recursive"]},"allow-appconfig-read":{"identifier":"allow-appconfig-read","description":"This allows non-recursive read access to the `$APPCONFIG` folder.","permissions":["read-all","scope-appconfig"]},"allow-appconfig-read-recursive":{"identifier":"allow-appconfig-read-recursive","description":"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["read-all","scope-appconfig-recursive"]},"allow-appconfig-write":{"identifier":"allow-appconfig-write","description":"This allows non-recursive write access to the `$APPCONFIG` folder.","permissions":["write-all","scope-appconfig"]},"allow-appconfig-write-recursive":{"identifier":"allow-appconfig-write-recursive","description":"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["write-all","scope-appconfig-recursive"]},"allow-appdata-meta":{"identifier":"allow-appdata-meta","description":"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-index"]},"allow-appdata-meta-recursive":{"identifier":"allow-appdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-recursive"]},"allow-appdata-read":{"identifier":"allow-appdata-read","description":"This allows non-recursive read access to the `$APPDATA` folder.","permissions":["read-all","scope-appdata"]},"allow-appdata-read-recursive":{"identifier":"allow-appdata-read-recursive","description":"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["read-all","scope-appdata-recursive"]},"allow-appdata-write":{"identifier":"allow-appdata-write","description":"This allows non-recursive write access to the `$APPDATA` folder.","permissions":["write-all","scope-appdata"]},"allow-appdata-write-recursive":{"identifier":"allow-appdata-write-recursive","description":"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["write-all","scope-appdata-recursive"]},"allow-applocaldata-meta":{"identifier":"allow-applocaldata-meta","description":"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-index"]},"allow-applocaldata-meta-recursive":{"identifier":"allow-applocaldata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-recursive"]},"allow-applocaldata-read":{"identifier":"allow-applocaldata-read","description":"This allows non-recursive read access to the `$APPLOCALDATA` folder.","permissions":["read-all","scope-applocaldata"]},"allow-applocaldata-read-recursive":{"identifier":"allow-applocaldata-read-recursive","description":"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-applocaldata-recursive"]},"allow-applocaldata-write":{"identifier":"allow-applocaldata-write","description":"This allows non-recursive write access to the `$APPLOCALDATA` folder.","permissions":["write-all","scope-applocaldata"]},"allow-applocaldata-write-recursive":{"identifier":"allow-applocaldata-write-recursive","description":"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-applocaldata-recursive"]},"allow-applog-meta":{"identifier":"allow-applog-meta","description":"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-index"]},"allow-applog-meta-recursive":{"identifier":"allow-applog-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-recursive"]},"allow-applog-read":{"identifier":"allow-applog-read","description":"This allows non-recursive read access to the `$APPLOG` folder.","permissions":["read-all","scope-applog"]},"allow-applog-read-recursive":{"identifier":"allow-applog-read-recursive","description":"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["read-all","scope-applog-recursive"]},"allow-applog-write":{"identifier":"allow-applog-write","description":"This allows non-recursive write access to the `$APPLOG` folder.","permissions":["write-all","scope-applog"]},"allow-applog-write-recursive":{"identifier":"allow-applog-write-recursive","description":"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["write-all","scope-applog-recursive"]},"allow-audio-meta":{"identifier":"allow-audio-meta","description":"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-index"]},"allow-audio-meta-recursive":{"identifier":"allow-audio-meta-recursive","description":"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-recursive"]},"allow-audio-read":{"identifier":"allow-audio-read","description":"This allows non-recursive read access to the `$AUDIO` folder.","permissions":["read-all","scope-audio"]},"allow-audio-read-recursive":{"identifier":"allow-audio-read-recursive","description":"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["read-all","scope-audio-recursive"]},"allow-audio-write":{"identifier":"allow-audio-write","description":"This allows non-recursive write access to the `$AUDIO` folder.","permissions":["write-all","scope-audio"]},"allow-audio-write-recursive":{"identifier":"allow-audio-write-recursive","description":"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["write-all","scope-audio-recursive"]},"allow-cache-meta":{"identifier":"allow-cache-meta","description":"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-index"]},"allow-cache-meta-recursive":{"identifier":"allow-cache-meta-recursive","description":"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-recursive"]},"allow-cache-read":{"identifier":"allow-cache-read","description":"This allows non-recursive read access to the `$CACHE` folder.","permissions":["read-all","scope-cache"]},"allow-cache-read-recursive":{"identifier":"allow-cache-read-recursive","description":"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.","permissions":["read-all","scope-cache-recursive"]},"allow-cache-write":{"identifier":"allow-cache-write","description":"This allows non-recursive write access to the `$CACHE` folder.","permissions":["write-all","scope-cache"]},"allow-cache-write-recursive":{"identifier":"allow-cache-write-recursive","description":"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.","permissions":["write-all","scope-cache-recursive"]},"allow-config-meta":{"identifier":"allow-config-meta","description":"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-index"]},"allow-config-meta-recursive":{"identifier":"allow-config-meta-recursive","description":"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-recursive"]},"allow-config-read":{"identifier":"allow-config-read","description":"This allows non-recursive read access to the `$CONFIG` folder.","permissions":["read-all","scope-config"]},"allow-config-read-recursive":{"identifier":"allow-config-read-recursive","description":"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["read-all","scope-config-recursive"]},"allow-config-write":{"identifier":"allow-config-write","description":"This allows non-recursive write access to the `$CONFIG` folder.","permissions":["write-all","scope-config"]},"allow-config-write-recursive":{"identifier":"allow-config-write-recursive","description":"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["write-all","scope-config-recursive"]},"allow-data-meta":{"identifier":"allow-data-meta","description":"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-index"]},"allow-data-meta-recursive":{"identifier":"allow-data-meta-recursive","description":"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-recursive"]},"allow-data-read":{"identifier":"allow-data-read","description":"This allows non-recursive read access to the `$DATA` folder.","permissions":["read-all","scope-data"]},"allow-data-read-recursive":{"identifier":"allow-data-read-recursive","description":"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.","permissions":["read-all","scope-data-recursive"]},"allow-data-write":{"identifier":"allow-data-write","description":"This allows non-recursive write access to the `$DATA` folder.","permissions":["write-all","scope-data"]},"allow-data-write-recursive":{"identifier":"allow-data-write-recursive","description":"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.","permissions":["write-all","scope-data-recursive"]},"allow-desktop-meta":{"identifier":"allow-desktop-meta","description":"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-index"]},"allow-desktop-meta-recursive":{"identifier":"allow-desktop-meta-recursive","description":"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-recursive"]},"allow-desktop-read":{"identifier":"allow-desktop-read","description":"This allows non-recursive read access to the `$DESKTOP` folder.","permissions":["read-all","scope-desktop"]},"allow-desktop-read-recursive":{"identifier":"allow-desktop-read-recursive","description":"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["read-all","scope-desktop-recursive"]},"allow-desktop-write":{"identifier":"allow-desktop-write","description":"This allows non-recursive write access to the `$DESKTOP` folder.","permissions":["write-all","scope-desktop"]},"allow-desktop-write-recursive":{"identifier":"allow-desktop-write-recursive","description":"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["write-all","scope-desktop-recursive"]},"allow-document-meta":{"identifier":"allow-document-meta","description":"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-index"]},"allow-document-meta-recursive":{"identifier":"allow-document-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-recursive"]},"allow-document-read":{"identifier":"allow-document-read","description":"This allows non-recursive read access to the `$DOCUMENT` folder.","permissions":["read-all","scope-document"]},"allow-document-read-recursive":{"identifier":"allow-document-read-recursive","description":"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["read-all","scope-document-recursive"]},"allow-document-write":{"identifier":"allow-document-write","description":"This allows non-recursive write access to the `$DOCUMENT` folder.","permissions":["write-all","scope-document"]},"allow-document-write-recursive":{"identifier":"allow-document-write-recursive","description":"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["write-all","scope-document-recursive"]},"allow-download-meta":{"identifier":"allow-download-meta","description":"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-index"]},"allow-download-meta-recursive":{"identifier":"allow-download-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-recursive"]},"allow-download-read":{"identifier":"allow-download-read","description":"This allows non-recursive read access to the `$DOWNLOAD` folder.","permissions":["read-all","scope-download"]},"allow-download-read-recursive":{"identifier":"allow-download-read-recursive","description":"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["read-all","scope-download-recursive"]},"allow-download-write":{"identifier":"allow-download-write","description":"This allows non-recursive write access to the `$DOWNLOAD` folder.","permissions":["write-all","scope-download"]},"allow-download-write-recursive":{"identifier":"allow-download-write-recursive","description":"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["write-all","scope-download-recursive"]},"allow-exe-meta":{"identifier":"allow-exe-meta","description":"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-index"]},"allow-exe-meta-recursive":{"identifier":"allow-exe-meta-recursive","description":"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-recursive"]},"allow-exe-read":{"identifier":"allow-exe-read","description":"This allows non-recursive read access to the `$EXE` folder.","permissions":["read-all","scope-exe"]},"allow-exe-read-recursive":{"identifier":"allow-exe-read-recursive","description":"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.","permissions":["read-all","scope-exe-recursive"]},"allow-exe-write":{"identifier":"allow-exe-write","description":"This allows non-recursive write access to the `$EXE` folder.","permissions":["write-all","scope-exe"]},"allow-exe-write-recursive":{"identifier":"allow-exe-write-recursive","description":"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.","permissions":["write-all","scope-exe-recursive"]},"allow-font-meta":{"identifier":"allow-font-meta","description":"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-index"]},"allow-font-meta-recursive":{"identifier":"allow-font-meta-recursive","description":"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-recursive"]},"allow-font-read":{"identifier":"allow-font-read","description":"This allows non-recursive read access to the `$FONT` folder.","permissions":["read-all","scope-font"]},"allow-font-read-recursive":{"identifier":"allow-font-read-recursive","description":"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.","permissions":["read-all","scope-font-recursive"]},"allow-font-write":{"identifier":"allow-font-write","description":"This allows non-recursive write access to the `$FONT` folder.","permissions":["write-all","scope-font"]},"allow-font-write-recursive":{"identifier":"allow-font-write-recursive","description":"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.","permissions":["write-all","scope-font-recursive"]},"allow-home-meta":{"identifier":"allow-home-meta","description":"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-index"]},"allow-home-meta-recursive":{"identifier":"allow-home-meta-recursive","description":"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-recursive"]},"allow-home-read":{"identifier":"allow-home-read","description":"This allows non-recursive read access to the `$HOME` folder.","permissions":["read-all","scope-home"]},"allow-home-read-recursive":{"identifier":"allow-home-read-recursive","description":"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.","permissions":["read-all","scope-home-recursive"]},"allow-home-write":{"identifier":"allow-home-write","description":"This allows non-recursive write access to the `$HOME` folder.","permissions":["write-all","scope-home"]},"allow-home-write-recursive":{"identifier":"allow-home-write-recursive","description":"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.","permissions":["write-all","scope-home-recursive"]},"allow-localdata-meta":{"identifier":"allow-localdata-meta","description":"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-index"]},"allow-localdata-meta-recursive":{"identifier":"allow-localdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-recursive"]},"allow-localdata-read":{"identifier":"allow-localdata-read","description":"This allows non-recursive read access to the `$LOCALDATA` folder.","permissions":["read-all","scope-localdata"]},"allow-localdata-read-recursive":{"identifier":"allow-localdata-read-recursive","description":"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-localdata-recursive"]},"allow-localdata-write":{"identifier":"allow-localdata-write","description":"This allows non-recursive write access to the `$LOCALDATA` folder.","permissions":["write-all","scope-localdata"]},"allow-localdata-write-recursive":{"identifier":"allow-localdata-write-recursive","description":"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-localdata-recursive"]},"allow-log-meta":{"identifier":"allow-log-meta","description":"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-index"]},"allow-log-meta-recursive":{"identifier":"allow-log-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-recursive"]},"allow-log-read":{"identifier":"allow-log-read","description":"This allows non-recursive read access to the `$LOG` folder.","permissions":["read-all","scope-log"]},"allow-log-read-recursive":{"identifier":"allow-log-read-recursive","description":"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.","permissions":["read-all","scope-log-recursive"]},"allow-log-write":{"identifier":"allow-log-write","description":"This allows non-recursive write access to the `$LOG` folder.","permissions":["write-all","scope-log"]},"allow-log-write-recursive":{"identifier":"allow-log-write-recursive","description":"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.","permissions":["write-all","scope-log-recursive"]},"allow-picture-meta":{"identifier":"allow-picture-meta","description":"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-index"]},"allow-picture-meta-recursive":{"identifier":"allow-picture-meta-recursive","description":"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-recursive"]},"allow-picture-read":{"identifier":"allow-picture-read","description":"This allows non-recursive read access to the `$PICTURE` folder.","permissions":["read-all","scope-picture"]},"allow-picture-read-recursive":{"identifier":"allow-picture-read-recursive","description":"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["read-all","scope-picture-recursive"]},"allow-picture-write":{"identifier":"allow-picture-write","description":"This allows non-recursive write access to the `$PICTURE` folder.","permissions":["write-all","scope-picture"]},"allow-picture-write-recursive":{"identifier":"allow-picture-write-recursive","description":"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["write-all","scope-picture-recursive"]},"allow-public-meta":{"identifier":"allow-public-meta","description":"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-index"]},"allow-public-meta-recursive":{"identifier":"allow-public-meta-recursive","description":"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-recursive"]},"allow-public-read":{"identifier":"allow-public-read","description":"This allows non-recursive read access to the `$PUBLIC` folder.","permissions":["read-all","scope-public"]},"allow-public-read-recursive":{"identifier":"allow-public-read-recursive","description":"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["read-all","scope-public-recursive"]},"allow-public-write":{"identifier":"allow-public-write","description":"This allows non-recursive write access to the `$PUBLIC` folder.","permissions":["write-all","scope-public"]},"allow-public-write-recursive":{"identifier":"allow-public-write-recursive","description":"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["write-all","scope-public-recursive"]},"allow-resource-meta":{"identifier":"allow-resource-meta","description":"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-index"]},"allow-resource-meta-recursive":{"identifier":"allow-resource-meta-recursive","description":"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-recursive"]},"allow-resource-read":{"identifier":"allow-resource-read","description":"This allows non-recursive read access to the `$RESOURCE` folder.","permissions":["read-all","scope-resource"]},"allow-resource-read-recursive":{"identifier":"allow-resource-read-recursive","description":"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["read-all","scope-resource-recursive"]},"allow-resource-write":{"identifier":"allow-resource-write","description":"This allows non-recursive write access to the `$RESOURCE` folder.","permissions":["write-all","scope-resource"]},"allow-resource-write-recursive":{"identifier":"allow-resource-write-recursive","description":"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["write-all","scope-resource-recursive"]},"allow-runtime-meta":{"identifier":"allow-runtime-meta","description":"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-index"]},"allow-runtime-meta-recursive":{"identifier":"allow-runtime-meta-recursive","description":"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-recursive"]},"allow-runtime-read":{"identifier":"allow-runtime-read","description":"This allows non-recursive read access to the `$RUNTIME` folder.","permissions":["read-all","scope-runtime"]},"allow-runtime-read-recursive":{"identifier":"allow-runtime-read-recursive","description":"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["read-all","scope-runtime-recursive"]},"allow-runtime-write":{"identifier":"allow-runtime-write","description":"This allows non-recursive write access to the `$RUNTIME` folder.","permissions":["write-all","scope-runtime"]},"allow-runtime-write-recursive":{"identifier":"allow-runtime-write-recursive","description":"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["write-all","scope-runtime-recursive"]},"allow-temp-meta":{"identifier":"allow-temp-meta","description":"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-index"]},"allow-temp-meta-recursive":{"identifier":"allow-temp-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-recursive"]},"allow-temp-read":{"identifier":"allow-temp-read","description":"This allows non-recursive read access to the `$TEMP` folder.","permissions":["read-all","scope-temp"]},"allow-temp-read-recursive":{"identifier":"allow-temp-read-recursive","description":"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.","permissions":["read-all","scope-temp-recursive"]},"allow-temp-write":{"identifier":"allow-temp-write","description":"This allows non-recursive write access to the `$TEMP` folder.","permissions":["write-all","scope-temp"]},"allow-temp-write-recursive":{"identifier":"allow-temp-write-recursive","description":"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.","permissions":["write-all","scope-temp-recursive"]},"allow-template-meta":{"identifier":"allow-template-meta","description":"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-index"]},"allow-template-meta-recursive":{"identifier":"allow-template-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-recursive"]},"allow-template-read":{"identifier":"allow-template-read","description":"This allows non-recursive read access to the `$TEMPLATE` folder.","permissions":["read-all","scope-template"]},"allow-template-read-recursive":{"identifier":"allow-template-read-recursive","description":"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["read-all","scope-template-recursive"]},"allow-template-write":{"identifier":"allow-template-write","description":"This allows non-recursive write access to the `$TEMPLATE` folder.","permissions":["write-all","scope-template"]},"allow-template-write-recursive":{"identifier":"allow-template-write-recursive","description":"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["write-all","scope-template-recursive"]},"allow-video-meta":{"identifier":"allow-video-meta","description":"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-index"]},"allow-video-meta-recursive":{"identifier":"allow-video-meta-recursive","description":"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-recursive"]},"allow-video-read":{"identifier":"allow-video-read","description":"This allows non-recursive read access to the `$VIDEO` folder.","permissions":["read-all","scope-video"]},"allow-video-read-recursive":{"identifier":"allow-video-read-recursive","description":"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["read-all","scope-video-recursive"]},"allow-video-write":{"identifier":"allow-video-write","description":"This allows non-recursive write access to the `$VIDEO` folder.","permissions":["write-all","scope-video"]},"allow-video-write-recursive":{"identifier":"allow-video-write-recursive","description":"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["write-all","scope-video-recursive"]},"create-app-specific-dirs":{"identifier":"create-app-specific-dirs","description":"This permissions allows to create the application specific directories.\n","permissions":["allow-mkdir","scope-app-index"]},"deny-default":{"identifier":"deny-default","description":"This denies access to dangerous Tauri relevant files and folders by default.","permissions":["deny-webview-data-linux","deny-webview-data-windows"]},"read-app-specific-dirs-recursive":{"identifier":"read-app-specific-dirs-recursive","description":"This permission allows recursive read functionality on the application\nspecific base directories.\n","permissions":["allow-read-dir","allow-read-file","allow-read-text-file","allow-read-text-file-lines","allow-read-text-file-lines-next","allow-exists","scope-app-recursive"]},"write-all":{"identifier":"write-all","description":"This enables all write related commands without any pre-configured accessible paths.","permissions":["allow-mkdir","allow-create","allow-copy-file","allow-remove","allow-rename","allow-truncate","allow-ftruncate","allow-write","allow-write-file","allow-write-text-file"]},"write-files":{"identifier":"write-files","description":"This enables all file write related commands without any pre-configured accessible paths.","permissions":["allow-create","allow-copy-file","allow-remove","allow-rename","allow-truncate","allow-ftruncate","allow-write","allow-write-file","allow-write-text-file"]}},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"description":"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},{"properties":{"path":{"description":"A path that can be accessed by the webview when using the fs APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"description":"FS scope entry.","title":"FsScopeEntry"}},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}},"window-state":{"default_permission":{"identifier":"default","description":"This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n","permissions":["allow-filename","allow-restore-state","allow-save-window-state"]},"permissions":{"allow-filename":{"identifier":"allow-filename","description":"Enables the filename command without any pre-configured scope.","commands":{"allow":["filename"],"deny":[]}},"allow-restore-state":{"identifier":"allow-restore-state","description":"Enables the restore_state command without any pre-configured scope.","commands":{"allow":["restore_state"],"deny":[]}},"allow-save-window-state":{"identifier":"allow-save-window-state","description":"Enables the save_window_state command without any pre-configured scope.","commands":{"allow":["save_window_state"],"deny":[]}},"deny-filename":{"identifier":"deny-filename","description":"Denies the filename command without any pre-configured scope.","commands":{"allow":[],"deny":["filename"]}},"deny-restore-state":{"identifier":"deny-restore-state","description":"Denies the restore_state command without any pre-configured scope.","commands":{"allow":[],"deny":["restore_state"]}},"deny-save-window-state":{"identifier":"deny-save-window-state","description":"Denies the save_window_state command without any pre-configured scope.","commands":{"allow":[],"deny":["save_window_state"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file +{"__app-acl__":{"default_permission":null,"permissions":{"allow-acknowledge-drift":{"identifier":"allow-acknowledge-drift","description":"Enables the acknowledge_drift command without any pre-configured scope.","commands":{"allow":["acknowledge_drift"],"deny":[]}},"allow-acknowledge-drift-item":{"identifier":"allow-acknowledge-drift-item","description":"Enables the acknowledge_drift_item command without any pre-configured scope.","commands":{"allow":["acknowledge_drift_item"],"deny":[]}},"allow-apply-security-preset":{"identifier":"allow-apply-security-preset","description":"Enables the apply_security_preset command without any pre-configured scope.","commands":{"allow":["apply_security_preset"],"deny":[]}},"allow-apply-surface-transaction":{"identifier":"allow-apply-surface-transaction","description":"Enables the apply_surface_transaction command without any pre-configured scope.","commands":{"allow":["apply_surface_transaction"],"deny":[]}},"allow-check-for-updates":{"identifier":"allow-check-for-updates","description":"Enables the check_for_updates command without any pre-configured scope.","commands":{"allow":["check_for_updates"],"deny":[]}},"allow-check-git-repo":{"identifier":"allow-check-git-repo","description":"Enables the check_git_repo command without any pre-configured scope.","commands":{"allow":["check_git_repo"],"deny":[]}},"allow-check-plugin-updates":{"identifier":"allow-check-plugin-updates","description":"Enables the check_plugin_updates command without any pre-configured scope.","commands":{"allow":["check_plugin_updates"],"deny":[]}},"allow-choose-project-dir":{"identifier":"allow-choose-project-dir","description":"Enables the choose_project_dir command without any pre-configured scope.","commands":{"allow":["choose_project_dir"],"deny":[]}},"allow-clear-audit-entries":{"identifier":"allow-clear-audit-entries","description":"Enables the clear_audit_entries command without any pre-configured scope.","commands":{"allow":["clear_audit_entries"],"deny":[]}},"allow-compute-live-stats":{"identifier":"allow-compute-live-stats","description":"Enables the compute_live_stats command without any pre-configured scope.","commands":{"allow":["compute_live_stats"],"deny":[]}},"allow-create-evaluation-session":{"identifier":"allow-create-evaluation-session","description":"Enables the create_evaluation_session command without any pre-configured scope.","commands":{"allow":["create_evaluation_session"],"deny":[]}},"allow-create-worktrees":{"identifier":"allow-create-worktrees","description":"Enables the create_worktrees command without any pre-configured scope.","commands":{"allow":["create_worktrees"],"deny":[]}},"allow-delete-comparison":{"identifier":"allow-delete-comparison","description":"Enables the delete_comparison command without any pre-configured scope.","commands":{"allow":["delete_comparison"],"deny":[]}},"allow-delete-custom-profile":{"identifier":"allow-delete-custom-profile","description":"Enables the delete_custom_profile command without any pre-configured scope.","commands":{"allow":["delete_custom_profile"],"deny":[]}},"allow-delete-keychain-secret":{"identifier":"allow-delete-keychain-secret","description":"Enables the delete_keychain_secret command without any pre-configured scope.","commands":{"allow":["delete_keychain_secret"],"deny":[]}},"allow-delete-pairwise-vote":{"identifier":"allow-delete-pairwise-vote","description":"Enables the delete_pairwise_vote command without any pre-configured scope.","commands":{"allow":["delete_pairwise_vote"],"deny":[]}},"allow-detect-claude-account":{"identifier":"allow-detect-claude-account","description":"Enables the detect_claude_account command without any pre-configured scope.","commands":{"allow":["detect_claude_account"],"deny":[]}},"allow-detect-harnesses":{"identifier":"allow-detect-harnesses","description":"Enables the detect_harnesses command without any pre-configured scope.","commands":{"allow":["detect_harnesses"],"deny":[]}},"allow-export-comparison-json":{"identifier":"allow-export-comparison-json","description":"Enables the export_comparison_json command without any pre-configured scope.","commands":{"allow":["export_comparison_json"],"deny":[]}},"allow-export-plugin-as-zip":{"identifier":"allow-export-plugin-as-zip","description":"Enables the export_plugin_as_zip command without any pre-configured scope.","commands":{"allow":["export_plugin_as_zip"],"deny":[]}},"allow-export-plugin-to-folder":{"identifier":"allow-export-plugin-to-folder","description":"Enables the export_plugin_to_folder command without any pre-configured scope.","commands":{"allow":["export_plugin_to_folder"],"deny":[]}},"allow-get-acknowledged-drift-items":{"identifier":"allow-get-acknowledged-drift-items","description":"Enables the get_acknowledged_drift_items command without any pre-configured scope.","commands":{"allow":["get_acknowledged_drift_items"],"deny":[]}},"allow-get-cached-definitions":{"identifier":"allow-get-cached-definitions","description":"Enables the get_cached_definitions command without any pre-configured scope.","commands":{"allow":["get_cached_definitions"],"deny":[]}},"allow-get-comparator-analytics":{"identifier":"allow-get-comparator-analytics","description":"Enables the get_comparator_analytics command without any pre-configured scope.","commands":{"allow":["get_comparator_analytics"],"deny":[]}},"allow-get-comparison":{"identifier":"allow-get-comparison","description":"Enables the get_comparison command without any pre-configured scope.","commands":{"allow":["get_comparison"],"deny":[]}},"allow-get-comparison-diffs":{"identifier":"allow-get-comparison-diffs","description":"Enables the get_comparison_diffs command without any pre-configured scope.","commands":{"allow":["get_comparison_diffs"],"deny":[]}},"allow-get-custom-profile":{"identifier":"allow-get-custom-profile","description":"Enables the get_custom_profile command without any pre-configured scope.","commands":{"allow":["get_custom_profile"],"deny":[]}},"allow-get-diff-against-commit":{"identifier":"allow-get-diff-against-commit","description":"Enables the get_diff_against_commit command without any pre-configured scope.","commands":{"allow":["get_diff_against_commit"],"deny":[]}},"allow-get-evaluation-session":{"identifier":"allow-get-evaluation-session","description":"Enables the get_evaluation_session command without any pre-configured scope.","commands":{"allow":["get_evaluation_session"],"deny":[]}},"allow-get-evaluations":{"identifier":"allow-get-evaluations","description":"Enables the get_evaluations command without any pre-configured scope.","commands":{"allow":["get_evaluations"],"deny":[]}},"allow-get-harness-recommendations":{"identifier":"allow-get-harness-recommendations","description":"Enables the get_harness_recommendations command without any pre-configured scope.","commands":{"allow":["get_harness_recommendations"],"deny":[]}},"allow-get-highest-bundle-number":{"identifier":"allow-get-highest-bundle-number","description":"Enables the get_highest_bundle_number command without any pre-configured scope.","commands":{"allow":["get_highest_bundle_number"],"deny":[]}},"allow-get-history-size":{"identifier":"allow-get-history-size","description":"Enables the get_history_size command without any pre-configured scope.","commands":{"allow":["get_history_size"],"deny":[]}},"allow-get-pairwise-analytics":{"identifier":"allow-get-pairwise-analytics","description":"Enables the get_pairwise_analytics command without any pre-configured scope.","commands":{"allow":["get_pairwise_analytics"],"deny":[]}},"allow-get-pairwise-votes":{"identifier":"allow-get-pairwise-votes","description":"Enables the get_pairwise_votes command without any pre-configured scope.","commands":{"allow":["get_pairwise_votes"],"deny":[]}},"allow-get-panel-diffs":{"identifier":"allow-get-panel-diffs","description":"Enables the get_panel_diffs command without any pre-configured scope.","commands":{"allow":["get_panel_diffs"],"deny":[]}},"allow-get-system-info":{"identifier":"allow-get-system-info","description":"Enables the get_system_info command without any pre-configured scope.","commands":{"allow":["get_system_info"],"deny":[]}},"allow-grant-project-scope":{"identifier":"allow-grant-project-scope","description":"Enables the grant_project_scope command without any pre-configured scope.","commands":{"allow":["grant_project_scope"],"deny":[]}},"allow-guarded-remove-file":{"identifier":"allow-guarded-remove-file","description":"Enables the guarded_remove_file command without any pre-configured scope.","commands":{"allow":["guarded_remove_file"],"deny":[]}},"allow-guarded-rename-file":{"identifier":"allow-guarded-rename-file","description":"Enables the guarded_rename_file command without any pre-configured scope.","commands":{"allow":["guarded_rename_file"],"deny":[]}},"allow-guarded-write-file":{"identifier":"allow-guarded-write-file","description":"Enables the guarded_write_file command without any pre-configured scope.","commands":{"allow":["guarded_write_file"],"deny":[]}},"allow-import-plugin-from-path":{"identifier":"allow-import-plugin-from-path","description":"Enables the import_plugin_from_path command without any pre-configured scope.","commands":{"allow":["import_plugin_from_path"],"deny":[]}},"allow-import-plugin-from-zip":{"identifier":"allow-import-plugin-from-zip","description":"Enables the import_plugin_from_zip command without any pre-configured scope.","commands":{"allow":["import_plugin_from_zip"],"deny":[]}},"allow-list-active-sessions":{"identifier":"allow-list-active-sessions","description":"Enables the list_active_sessions command without any pre-configured scope.","commands":{"allow":["list_active_sessions"],"deny":[]}},"allow-list-audit-entries":{"identifier":"allow-list-audit-entries","description":"Enables the list_audit_entries command without any pre-configured scope.","commands":{"allow":["list_audit_entries"],"deny":[]}},"allow-list-changes":{"identifier":"allow-list-changes","description":"Enables the list_changes command without any pre-configured scope.","commands":{"allow":["list_changes"],"deny":[]}},"allow-list-claude-dir":{"identifier":"allow-list-claude-dir","description":"Enables the list_claude_dir command without any pre-configured scope.","commands":{"allow":["list_claude_dir"],"deny":[]}},"allow-list-comparisons":{"identifier":"allow-list-comparisons","description":"Enables the list_comparisons command without any pre-configured scope.","commands":{"allow":["list_comparisons"],"deny":[]}},"allow-list-custom-profiles":{"identifier":"allow-list-custom-profiles","description":"Enables the list_custom_profiles command without any pre-configured scope.","commands":{"allow":["list_custom_profiles"],"deny":[]}},"allow-list-drift-acknowledgements":{"identifier":"allow-list-drift-acknowledgements","description":"Enables the list_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":["list_drift_acknowledgements"],"deny":[]}},"allow-list-installed-plugins":{"identifier":"allow-list-installed-plugins","description":"Enables the list_installed_plugins command without any pre-configured scope.","commands":{"allow":["list_installed_plugins"],"deny":[]}},"allow-list-marketplaces":{"identifier":"allow-list-marketplaces","description":"Enables the list_marketplaces command without any pre-configured scope.","commands":{"allow":["list_marketplaces"],"deny":[]}},"allow-list-required-env":{"identifier":"allow-list-required-env","description":"Enables the list_required_env command without any pre-configured scope.","commands":{"allow":["list_required_env"],"deny":[]}},"allow-list-security-presets":{"identifier":"allow-list-security-presets","description":"Enables the list_security_presets command without any pre-configured scope.","commands":{"allow":["list_security_presets"],"deny":[]}},"allow-list-sessions-summary":{"identifier":"allow-list-sessions-summary","description":"Enables the list_sessions_summary command without any pre-configured scope.","commands":{"allow":["list_sessions_summary"],"deny":[]}},"allow-migrate-drift-acknowledgements":{"identifier":"allow-migrate-drift-acknowledgements","description":"Enables the migrate_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":["migrate_drift_acknowledgements"],"deny":[]}},"allow-push-file-history":{"identifier":"allow-push-file-history","description":"Enables the push_file_history command without any pre-configured scope.","commands":{"allow":["push_file_history"],"deny":[]}},"allow-put-cached-definitions":{"identifier":"allow-put-cached-definitions","description":"Enables the put_cached_definitions command without any pre-configured scope.","commands":{"allow":["put_cached_definitions"],"deny":[]}},"allow-read-claude-md":{"identifier":"allow-read-claude-md","description":"Enables the read_claude_md command without any pre-configured scope.","commands":{"allow":["read_claude_md"],"deny":[]}},"allow-read-env-config":{"identifier":"allow-read-env-config","description":"Enables the read_env_config command without any pre-configured scope.","commands":{"allow":["read_env_config"],"deny":[]}},"allow-read-file-history":{"identifier":"allow-read-file-history","description":"Enables the read_file_history command without any pre-configured scope.","commands":{"allow":["read_file_history"],"deny":[]}},"allow-read-harness-file":{"identifier":"allow-read-harness-file","description":"Enables the read_harness_file command without any pre-configured scope.","commands":{"allow":["read_harness_file"],"deny":[]}},"allow-read-hooks":{"identifier":"allow-read-hooks","description":"Enables the read_hooks command without any pre-configured scope.","commands":{"allow":["read_hooks"],"deny":[]}},"allow-read-live-activity":{"identifier":"allow-read-live-activity","description":"Enables the read_live_activity command without any pre-configured scope.","commands":{"allow":["read_live_activity"],"deny":[]}},"allow-read-permissions":{"identifier":"allow-read-permissions","description":"Enables the read_permissions command without any pre-configured scope.","commands":{"allow":["read_permissions"],"deny":[]}},"allow-read-plugin-file":{"identifier":"allow-read-plugin-file","description":"Enables the read_plugin_file command without any pre-configured scope.","commands":{"allow":["read_plugin_file"],"deny":[]}},"allow-read-plugin-tree":{"identifier":"allow-read-plugin-tree","description":"Enables the read_plugin_tree command without any pre-configured scope.","commands":{"allow":["read_plugin_tree"],"deny":[]}},"allow-read-session-facet":{"identifier":"allow-read-session-facet","description":"Enables the read_session_facet command without any pre-configured scope.","commands":{"allow":["read_session_facet"],"deny":[]}},"allow-read-session-transcript":{"identifier":"allow-read-session-transcript","description":"Enables the read_session_transcript command without any pre-configured scope.","commands":{"allow":["read_session_transcript"],"deny":[]}},"allow-read-stats-cache":{"identifier":"allow-read-stats-cache","description":"Enables the read_stats_cache command without any pre-configured scope.","commands":{"allow":["read_stats_cache"],"deny":[]}},"allow-record-bundle-number":{"identifier":"allow-record-bundle-number","description":"Enables the record_bundle_number command without any pre-configured scope.","commands":{"allow":["record_bundle_number"],"deny":[]}},"allow-record-transaction":{"identifier":"allow-record-transaction","description":"Enables the record_transaction command without any pre-configured scope.","commands":{"allow":["record_transaction"],"deny":[]}},"allow-remove-worktrees":{"identifier":"allow-remove-worktrees","description":"Enables the remove_worktrees command without any pre-configured scope.","commands":{"allow":["remove_worktrees"],"deny":[]}},"allow-reveal-evaluation-session":{"identifier":"allow-reveal-evaluation-session","description":"Enables the reveal_evaluation_session command without any pre-configured scope.","commands":{"allow":["reveal_evaluation_session"],"deny":[]}},"allow-save-comparison":{"identifier":"allow-save-comparison","description":"Enables the save_comparison command without any pre-configured scope.","commands":{"allow":["save_comparison"],"deny":[]}},"allow-save-custom-profile":{"identifier":"allow-save-custom-profile","description":"Enables the save_custom_profile command without any pre-configured scope.","commands":{"allow":["save_custom_profile"],"deny":[]}},"allow-save-evaluation":{"identifier":"allow-save-evaluation","description":"Enables the save_evaluation command without any pre-configured scope.","commands":{"allow":["save_evaluation"],"deny":[]}},"allow-save-file-diffs":{"identifier":"allow-save-file-diffs","description":"Enables the save_file_diffs command without any pre-configured scope.","commands":{"allow":["save_file_diffs"],"deny":[]}},"allow-save-pairwise-vote":{"identifier":"allow-save-pairwise-vote","description":"Enables the save_pairwise_vote command without any pre-configured scope.","commands":{"allow":["save_pairwise_vote"],"deny":[]}},"allow-save-panel":{"identifier":"allow-save-panel","description":"Enables the save_panel command without any pre-configured scope.","commands":{"allow":["save_panel"],"deny":[]}},"allow-set-keychain-secret":{"identifier":"allow-set-keychain-secret","description":"Enables the set_keychain_secret command without any pre-configured scope.","commands":{"allow":["set_keychain_secret"],"deny":[]}},"allow-submit-feedback":{"identifier":"allow-submit-feedback","description":"Enables the submit_feedback command without any pre-configured scope.","commands":{"allow":["submit_feedback"],"deny":[]}},"allow-sync-create-backup":{"identifier":"allow-sync-create-backup","description":"Enables the sync_create_backup command without any pre-configured scope.","commands":{"allow":["sync_create_backup"],"deny":[]}},"allow-sync-file-exists":{"identifier":"allow-sync-file-exists","description":"Enables the sync_file_exists command without any pre-configured scope.","commands":{"allow":["sync_file_exists"],"deny":[]}},"allow-sync-list-backups":{"identifier":"allow-sync-list-backups","description":"Enables the sync_list_backups command without any pre-configured scope.","commands":{"allow":["sync_list_backups"],"deny":[]}},"allow-sync-read-dir":{"identifier":"allow-sync-read-dir","description":"Enables the sync_read_dir command without any pre-configured scope.","commands":{"allow":["sync_read_dir"],"deny":[]}},"allow-sync-read-file":{"identifier":"allow-sync-read-file","description":"Enables the sync_read_file command without any pre-configured scope.","commands":{"allow":["sync_read_file"],"deny":[]}},"allow-sync-restore-backup":{"identifier":"allow-sync-restore-backup","description":"Enables the sync_restore_backup command without any pre-configured scope.","commands":{"allow":["sync_restore_backup"],"deny":[]}},"allow-sync-write-files":{"identifier":"allow-sync-write-files","description":"Enables the sync_write_files command without any pre-configured scope.","commands":{"allow":["sync_write_files"],"deny":[]}},"allow-tag-comparison-task-type":{"identifier":"allow-tag-comparison-task-type","description":"Enables the tag_comparison_task_type command without any pre-configured scope.","commands":{"allow":["tag_comparison_task_type"],"deny":[]}},"allow-trigger-rebuild":{"identifier":"allow-trigger-rebuild","description":"Enables the trigger_rebuild command without any pre-configured scope.","commands":{"allow":["trigger_rebuild"],"deny":[]}},"allow-unacknowledge-drift":{"identifier":"allow-unacknowledge-drift","description":"Enables the unacknowledge_drift command without any pre-configured scope.","commands":{"allow":["unacknowledge_drift"],"deny":[]}},"allow-unacknowledge-drift-item":{"identifier":"allow-unacknowledge-drift-item","description":"Enables the unacknowledge_drift_item command without any pre-configured scope.","commands":{"allow":["unacknowledge_drift_item"],"deny":[]}},"allow-undo-change":{"identifier":"allow-undo-change","description":"Enables the undo_change command without any pre-configured scope.","commands":{"allow":["undo_change"],"deny":[]}},"allow-uninstall-plugin":{"identifier":"allow-uninstall-plugin","description":"Enables the uninstall_plugin command without any pre-configured scope.","commands":{"allow":["uninstall_plugin"],"deny":[]}},"allow-update-comparison-status":{"identifier":"allow-update-comparison-status","description":"Enables the update_comparison_status command without any pre-configured scope.","commands":{"allow":["update_comparison_status"],"deny":[]}},"allow-update-comparison-title":{"identifier":"allow-update-comparison-title","description":"Enables the update_comparison_title command without any pre-configured scope.","commands":{"allow":["update_comparison_title"],"deny":[]}},"allow-update-evaluation-score":{"identifier":"allow-update-evaluation-score","description":"Enables the update_evaluation_score command without any pre-configured scope.","commands":{"allow":["update_evaluation_score"],"deny":[]}},"allow-update-panel-result":{"identifier":"allow-update-panel-result","description":"Enables the update_panel_result command without any pre-configured scope.","commands":{"allow":["update_panel_result"],"deny":[]}},"allow-update-permissions":{"identifier":"allow-update-permissions","description":"Enables the update_permissions command without any pre-configured scope.","commands":{"allow":["update_permissions"],"deny":[]}},"allow-verify-definitions-signature":{"identifier":"allow-verify-definitions-signature","description":"Enables the verify_definitions_signature command without any pre-configured scope.","commands":{"allow":["verify_definitions_signature"],"deny":[]}},"allow-write-config-file":{"identifier":"allow-write-config-file","description":"Enables the write_config_file command without any pre-configured scope.","commands":{"allow":["write_config_file"],"deny":[]}},"allow-write-env-config":{"identifier":"allow-write-env-config","description":"Enables the write_env_config command without any pre-configured scope.","commands":{"allow":["write_env_config"],"deny":[]}},"allow-write-harness-file":{"identifier":"allow-write-harness-file","description":"Enables the write_harness_file command without any pre-configured scope.","commands":{"allow":["write_harness_file"],"deny":[]}},"allow-write-plugin-file":{"identifier":"allow-write-plugin-file","description":"Enables the write_plugin_file command without any pre-configured scope.","commands":{"allow":["write_plugin_file"],"deny":[]}},"deny-acknowledge-drift":{"identifier":"deny-acknowledge-drift","description":"Denies the acknowledge_drift command without any pre-configured scope.","commands":{"allow":[],"deny":["acknowledge_drift"]}},"deny-acknowledge-drift-item":{"identifier":"deny-acknowledge-drift-item","description":"Denies the acknowledge_drift_item command without any pre-configured scope.","commands":{"allow":[],"deny":["acknowledge_drift_item"]}},"deny-apply-security-preset":{"identifier":"deny-apply-security-preset","description":"Denies the apply_security_preset command without any pre-configured scope.","commands":{"allow":[],"deny":["apply_security_preset"]}},"deny-apply-surface-transaction":{"identifier":"deny-apply-surface-transaction","description":"Denies the apply_surface_transaction command without any pre-configured scope.","commands":{"allow":[],"deny":["apply_surface_transaction"]}},"deny-check-for-updates":{"identifier":"deny-check-for-updates","description":"Denies the check_for_updates command without any pre-configured scope.","commands":{"allow":[],"deny":["check_for_updates"]}},"deny-check-git-repo":{"identifier":"deny-check-git-repo","description":"Denies the check_git_repo command without any pre-configured scope.","commands":{"allow":[],"deny":["check_git_repo"]}},"deny-check-plugin-updates":{"identifier":"deny-check-plugin-updates","description":"Denies the check_plugin_updates command without any pre-configured scope.","commands":{"allow":[],"deny":["check_plugin_updates"]}},"deny-choose-project-dir":{"identifier":"deny-choose-project-dir","description":"Denies the choose_project_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["choose_project_dir"]}},"deny-clear-audit-entries":{"identifier":"deny-clear-audit-entries","description":"Denies the clear_audit_entries command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_audit_entries"]}},"deny-compute-live-stats":{"identifier":"deny-compute-live-stats","description":"Denies the compute_live_stats command without any pre-configured scope.","commands":{"allow":[],"deny":["compute_live_stats"]}},"deny-create-evaluation-session":{"identifier":"deny-create-evaluation-session","description":"Denies the create_evaluation_session command without any pre-configured scope.","commands":{"allow":[],"deny":["create_evaluation_session"]}},"deny-create-worktrees":{"identifier":"deny-create-worktrees","description":"Denies the create_worktrees command without any pre-configured scope.","commands":{"allow":[],"deny":["create_worktrees"]}},"deny-delete-comparison":{"identifier":"deny-delete-comparison","description":"Denies the delete_comparison command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_comparison"]}},"deny-delete-custom-profile":{"identifier":"deny-delete-custom-profile","description":"Denies the delete_custom_profile command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_custom_profile"]}},"deny-delete-keychain-secret":{"identifier":"deny-delete-keychain-secret","description":"Denies the delete_keychain_secret command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_keychain_secret"]}},"deny-delete-pairwise-vote":{"identifier":"deny-delete-pairwise-vote","description":"Denies the delete_pairwise_vote command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_pairwise_vote"]}},"deny-detect-claude-account":{"identifier":"deny-detect-claude-account","description":"Denies the detect_claude_account command without any pre-configured scope.","commands":{"allow":[],"deny":["detect_claude_account"]}},"deny-detect-harnesses":{"identifier":"deny-detect-harnesses","description":"Denies the detect_harnesses command without any pre-configured scope.","commands":{"allow":[],"deny":["detect_harnesses"]}},"deny-export-comparison-json":{"identifier":"deny-export-comparison-json","description":"Denies the export_comparison_json command without any pre-configured scope.","commands":{"allow":[],"deny":["export_comparison_json"]}},"deny-export-plugin-as-zip":{"identifier":"deny-export-plugin-as-zip","description":"Denies the export_plugin_as_zip command without any pre-configured scope.","commands":{"allow":[],"deny":["export_plugin_as_zip"]}},"deny-export-plugin-to-folder":{"identifier":"deny-export-plugin-to-folder","description":"Denies the export_plugin_to_folder command without any pre-configured scope.","commands":{"allow":[],"deny":["export_plugin_to_folder"]}},"deny-get-acknowledged-drift-items":{"identifier":"deny-get-acknowledged-drift-items","description":"Denies the get_acknowledged_drift_items command without any pre-configured scope.","commands":{"allow":[],"deny":["get_acknowledged_drift_items"]}},"deny-get-cached-definitions":{"identifier":"deny-get-cached-definitions","description":"Denies the get_cached_definitions command without any pre-configured scope.","commands":{"allow":[],"deny":["get_cached_definitions"]}},"deny-get-comparator-analytics":{"identifier":"deny-get-comparator-analytics","description":"Denies the get_comparator_analytics command without any pre-configured scope.","commands":{"allow":[],"deny":["get_comparator_analytics"]}},"deny-get-comparison":{"identifier":"deny-get-comparison","description":"Denies the get_comparison command without any pre-configured scope.","commands":{"allow":[],"deny":["get_comparison"]}},"deny-get-comparison-diffs":{"identifier":"deny-get-comparison-diffs","description":"Denies the get_comparison_diffs command without any pre-configured scope.","commands":{"allow":[],"deny":["get_comparison_diffs"]}},"deny-get-custom-profile":{"identifier":"deny-get-custom-profile","description":"Denies the get_custom_profile command without any pre-configured scope.","commands":{"allow":[],"deny":["get_custom_profile"]}},"deny-get-diff-against-commit":{"identifier":"deny-get-diff-against-commit","description":"Denies the get_diff_against_commit command without any pre-configured scope.","commands":{"allow":[],"deny":["get_diff_against_commit"]}},"deny-get-evaluation-session":{"identifier":"deny-get-evaluation-session","description":"Denies the get_evaluation_session command without any pre-configured scope.","commands":{"allow":[],"deny":["get_evaluation_session"]}},"deny-get-evaluations":{"identifier":"deny-get-evaluations","description":"Denies the get_evaluations command without any pre-configured scope.","commands":{"allow":[],"deny":["get_evaluations"]}},"deny-get-harness-recommendations":{"identifier":"deny-get-harness-recommendations","description":"Denies the get_harness_recommendations command without any pre-configured scope.","commands":{"allow":[],"deny":["get_harness_recommendations"]}},"deny-get-highest-bundle-number":{"identifier":"deny-get-highest-bundle-number","description":"Denies the get_highest_bundle_number command without any pre-configured scope.","commands":{"allow":[],"deny":["get_highest_bundle_number"]}},"deny-get-history-size":{"identifier":"deny-get-history-size","description":"Denies the get_history_size command without any pre-configured scope.","commands":{"allow":[],"deny":["get_history_size"]}},"deny-get-pairwise-analytics":{"identifier":"deny-get-pairwise-analytics","description":"Denies the get_pairwise_analytics command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pairwise_analytics"]}},"deny-get-pairwise-votes":{"identifier":"deny-get-pairwise-votes","description":"Denies the get_pairwise_votes command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pairwise_votes"]}},"deny-get-panel-diffs":{"identifier":"deny-get-panel-diffs","description":"Denies the get_panel_diffs command without any pre-configured scope.","commands":{"allow":[],"deny":["get_panel_diffs"]}},"deny-get-system-info":{"identifier":"deny-get-system-info","description":"Denies the get_system_info command without any pre-configured scope.","commands":{"allow":[],"deny":["get_system_info"]}},"deny-grant-project-scope":{"identifier":"deny-grant-project-scope","description":"Denies the grant_project_scope command without any pre-configured scope.","commands":{"allow":[],"deny":["grant_project_scope"]}},"deny-guarded-remove-file":{"identifier":"deny-guarded-remove-file","description":"Denies the guarded_remove_file command without any pre-configured scope.","commands":{"allow":[],"deny":["guarded_remove_file"]}},"deny-guarded-rename-file":{"identifier":"deny-guarded-rename-file","description":"Denies the guarded_rename_file command without any pre-configured scope.","commands":{"allow":[],"deny":["guarded_rename_file"]}},"deny-guarded-write-file":{"identifier":"deny-guarded-write-file","description":"Denies the guarded_write_file command without any pre-configured scope.","commands":{"allow":[],"deny":["guarded_write_file"]}},"deny-import-plugin-from-path":{"identifier":"deny-import-plugin-from-path","description":"Denies the import_plugin_from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["import_plugin_from_path"]}},"deny-import-plugin-from-zip":{"identifier":"deny-import-plugin-from-zip","description":"Denies the import_plugin_from_zip command without any pre-configured scope.","commands":{"allow":[],"deny":["import_plugin_from_zip"]}},"deny-list-active-sessions":{"identifier":"deny-list-active-sessions","description":"Denies the list_active_sessions command without any pre-configured scope.","commands":{"allow":[],"deny":["list_active_sessions"]}},"deny-list-audit-entries":{"identifier":"deny-list-audit-entries","description":"Denies the list_audit_entries command without any pre-configured scope.","commands":{"allow":[],"deny":["list_audit_entries"]}},"deny-list-changes":{"identifier":"deny-list-changes","description":"Denies the list_changes command without any pre-configured scope.","commands":{"allow":[],"deny":["list_changes"]}},"deny-list-claude-dir":{"identifier":"deny-list-claude-dir","description":"Denies the list_claude_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["list_claude_dir"]}},"deny-list-comparisons":{"identifier":"deny-list-comparisons","description":"Denies the list_comparisons command without any pre-configured scope.","commands":{"allow":[],"deny":["list_comparisons"]}},"deny-list-custom-profiles":{"identifier":"deny-list-custom-profiles","description":"Denies the list_custom_profiles command without any pre-configured scope.","commands":{"allow":[],"deny":["list_custom_profiles"]}},"deny-list-drift-acknowledgements":{"identifier":"deny-list-drift-acknowledgements","description":"Denies the list_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":[],"deny":["list_drift_acknowledgements"]}},"deny-list-installed-plugins":{"identifier":"deny-list-installed-plugins","description":"Denies the list_installed_plugins command without any pre-configured scope.","commands":{"allow":[],"deny":["list_installed_plugins"]}},"deny-list-marketplaces":{"identifier":"deny-list-marketplaces","description":"Denies the list_marketplaces command without any pre-configured scope.","commands":{"allow":[],"deny":["list_marketplaces"]}},"deny-list-required-env":{"identifier":"deny-list-required-env","description":"Denies the list_required_env command without any pre-configured scope.","commands":{"allow":[],"deny":["list_required_env"]}},"deny-list-security-presets":{"identifier":"deny-list-security-presets","description":"Denies the list_security_presets command without any pre-configured scope.","commands":{"allow":[],"deny":["list_security_presets"]}},"deny-list-sessions-summary":{"identifier":"deny-list-sessions-summary","description":"Denies the list_sessions_summary command without any pre-configured scope.","commands":{"allow":[],"deny":["list_sessions_summary"]}},"deny-migrate-drift-acknowledgements":{"identifier":"deny-migrate-drift-acknowledgements","description":"Denies the migrate_drift_acknowledgements command without any pre-configured scope.","commands":{"allow":[],"deny":["migrate_drift_acknowledgements"]}},"deny-push-file-history":{"identifier":"deny-push-file-history","description":"Denies the push_file_history command without any pre-configured scope.","commands":{"allow":[],"deny":["push_file_history"]}},"deny-put-cached-definitions":{"identifier":"deny-put-cached-definitions","description":"Denies the put_cached_definitions command without any pre-configured scope.","commands":{"allow":[],"deny":["put_cached_definitions"]}},"deny-read-claude-md":{"identifier":"deny-read-claude-md","description":"Denies the read_claude_md command without any pre-configured scope.","commands":{"allow":[],"deny":["read_claude_md"]}},"deny-read-env-config":{"identifier":"deny-read-env-config","description":"Denies the read_env_config command without any pre-configured scope.","commands":{"allow":[],"deny":["read_env_config"]}},"deny-read-file-history":{"identifier":"deny-read-file-history","description":"Denies the read_file_history command without any pre-configured scope.","commands":{"allow":[],"deny":["read_file_history"]}},"deny-read-harness-file":{"identifier":"deny-read-harness-file","description":"Denies the read_harness_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_harness_file"]}},"deny-read-hooks":{"identifier":"deny-read-hooks","description":"Denies the read_hooks command without any pre-configured scope.","commands":{"allow":[],"deny":["read_hooks"]}},"deny-read-live-activity":{"identifier":"deny-read-live-activity","description":"Denies the read_live_activity command without any pre-configured scope.","commands":{"allow":[],"deny":["read_live_activity"]}},"deny-read-permissions":{"identifier":"deny-read-permissions","description":"Denies the read_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["read_permissions"]}},"deny-read-plugin-file":{"identifier":"deny-read-plugin-file","description":"Denies the read_plugin_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_plugin_file"]}},"deny-read-plugin-tree":{"identifier":"deny-read-plugin-tree","description":"Denies the read_plugin_tree command without any pre-configured scope.","commands":{"allow":[],"deny":["read_plugin_tree"]}},"deny-read-session-facet":{"identifier":"deny-read-session-facet","description":"Denies the read_session_facet command without any pre-configured scope.","commands":{"allow":[],"deny":["read_session_facet"]}},"deny-read-session-transcript":{"identifier":"deny-read-session-transcript","description":"Denies the read_session_transcript command without any pre-configured scope.","commands":{"allow":[],"deny":["read_session_transcript"]}},"deny-read-stats-cache":{"identifier":"deny-read-stats-cache","description":"Denies the read_stats_cache command without any pre-configured scope.","commands":{"allow":[],"deny":["read_stats_cache"]}},"deny-record-bundle-number":{"identifier":"deny-record-bundle-number","description":"Denies the record_bundle_number command without any pre-configured scope.","commands":{"allow":[],"deny":["record_bundle_number"]}},"deny-record-transaction":{"identifier":"deny-record-transaction","description":"Denies the record_transaction command without any pre-configured scope.","commands":{"allow":[],"deny":["record_transaction"]}},"deny-remove-worktrees":{"identifier":"deny-remove-worktrees","description":"Denies the remove_worktrees command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_worktrees"]}},"deny-reveal-evaluation-session":{"identifier":"deny-reveal-evaluation-session","description":"Denies the reveal_evaluation_session command without any pre-configured scope.","commands":{"allow":[],"deny":["reveal_evaluation_session"]}},"deny-save-comparison":{"identifier":"deny-save-comparison","description":"Denies the save_comparison command without any pre-configured scope.","commands":{"allow":[],"deny":["save_comparison"]}},"deny-save-custom-profile":{"identifier":"deny-save-custom-profile","description":"Denies the save_custom_profile command without any pre-configured scope.","commands":{"allow":[],"deny":["save_custom_profile"]}},"deny-save-evaluation":{"identifier":"deny-save-evaluation","description":"Denies the save_evaluation command without any pre-configured scope.","commands":{"allow":[],"deny":["save_evaluation"]}},"deny-save-file-diffs":{"identifier":"deny-save-file-diffs","description":"Denies the save_file_diffs command without any pre-configured scope.","commands":{"allow":[],"deny":["save_file_diffs"]}},"deny-save-pairwise-vote":{"identifier":"deny-save-pairwise-vote","description":"Denies the save_pairwise_vote command without any pre-configured scope.","commands":{"allow":[],"deny":["save_pairwise_vote"]}},"deny-save-panel":{"identifier":"deny-save-panel","description":"Denies the save_panel command without any pre-configured scope.","commands":{"allow":[],"deny":["save_panel"]}},"deny-set-keychain-secret":{"identifier":"deny-set-keychain-secret","description":"Denies the set_keychain_secret command without any pre-configured scope.","commands":{"allow":[],"deny":["set_keychain_secret"]}},"deny-submit-feedback":{"identifier":"deny-submit-feedback","description":"Denies the submit_feedback command without any pre-configured scope.","commands":{"allow":[],"deny":["submit_feedback"]}},"deny-sync-create-backup":{"identifier":"deny-sync-create-backup","description":"Denies the sync_create_backup command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_create_backup"]}},"deny-sync-file-exists":{"identifier":"deny-sync-file-exists","description":"Denies the sync_file_exists command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_file_exists"]}},"deny-sync-list-backups":{"identifier":"deny-sync-list-backups","description":"Denies the sync_list_backups command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_list_backups"]}},"deny-sync-read-dir":{"identifier":"deny-sync-read-dir","description":"Denies the sync_read_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_read_dir"]}},"deny-sync-read-file":{"identifier":"deny-sync-read-file","description":"Denies the sync_read_file command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_read_file"]}},"deny-sync-restore-backup":{"identifier":"deny-sync-restore-backup","description":"Denies the sync_restore_backup command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_restore_backup"]}},"deny-sync-write-files":{"identifier":"deny-sync-write-files","description":"Denies the sync_write_files command without any pre-configured scope.","commands":{"allow":[],"deny":["sync_write_files"]}},"deny-tag-comparison-task-type":{"identifier":"deny-tag-comparison-task-type","description":"Denies the tag_comparison_task_type command without any pre-configured scope.","commands":{"allow":[],"deny":["tag_comparison_task_type"]}},"deny-trigger-rebuild":{"identifier":"deny-trigger-rebuild","description":"Denies the trigger_rebuild command without any pre-configured scope.","commands":{"allow":[],"deny":["trigger_rebuild"]}},"deny-unacknowledge-drift":{"identifier":"deny-unacknowledge-drift","description":"Denies the unacknowledge_drift command without any pre-configured scope.","commands":{"allow":[],"deny":["unacknowledge_drift"]}},"deny-unacknowledge-drift-item":{"identifier":"deny-unacknowledge-drift-item","description":"Denies the unacknowledge_drift_item command without any pre-configured scope.","commands":{"allow":[],"deny":["unacknowledge_drift_item"]}},"deny-undo-change":{"identifier":"deny-undo-change","description":"Denies the undo_change command without any pre-configured scope.","commands":{"allow":[],"deny":["undo_change"]}},"deny-uninstall-plugin":{"identifier":"deny-uninstall-plugin","description":"Denies the uninstall_plugin command without any pre-configured scope.","commands":{"allow":[],"deny":["uninstall_plugin"]}},"deny-update-comparison-status":{"identifier":"deny-update-comparison-status","description":"Denies the update_comparison_status command without any pre-configured scope.","commands":{"allow":[],"deny":["update_comparison_status"]}},"deny-update-comparison-title":{"identifier":"deny-update-comparison-title","description":"Denies the update_comparison_title command without any pre-configured scope.","commands":{"allow":[],"deny":["update_comparison_title"]}},"deny-update-evaluation-score":{"identifier":"deny-update-evaluation-score","description":"Denies the update_evaluation_score command without any pre-configured scope.","commands":{"allow":[],"deny":["update_evaluation_score"]}},"deny-update-panel-result":{"identifier":"deny-update-panel-result","description":"Denies the update_panel_result command without any pre-configured scope.","commands":{"allow":[],"deny":["update_panel_result"]}},"deny-update-permissions":{"identifier":"deny-update-permissions","description":"Denies the update_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["update_permissions"]}},"deny-verify-definitions-signature":{"identifier":"deny-verify-definitions-signature","description":"Denies the verify_definitions_signature command without any pre-configured scope.","commands":{"allow":[],"deny":["verify_definitions_signature"]}},"deny-write-config-file":{"identifier":"deny-write-config-file","description":"Denies the write_config_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_config_file"]}},"deny-write-env-config":{"identifier":"deny-write-env-config","description":"Denies the write_env_config command without any pre-configured scope.","commands":{"allow":[],"deny":["write_env_config"]}},"deny-write-harness-file":{"identifier":"deny-write-harness-file","description":"Denies the write_harness_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_harness_file"]}},"deny-write-plugin-file":{"identifier":"deny-write-plugin-file","description":"Denies the write_plugin_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_plugin_file"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-exit":{"identifier":"allow-exit","description":"Enables the exit command without any pre-configured scope.","commands":{"allow":["exit"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-exit":{"identifier":"deny-exit","description":"Denies the exit command without any pre-configured scope.","commands":{"allow":[],"deny":["exit"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-fullscreen-on-monitor":{"identifier":"allow-set-fullscreen-on-monitor","description":"Enables the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":["set_fullscreen_on_monitor"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-fullscreen-on-monitor":{"identifier":"deny-set-fullscreen-on-monitor","description":"Denies the set_fullscreen_on_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen_on_monitor"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"dialog":{"default_permission":{"identifier":"default","description":"This permission set configures the types of dialogs\navailable from the dialog plugin.\n\n#### Granted Permissions\n\nAll dialog types are enabled.\n\n\n","permissions":["allow-message","allow-save","allow-open"]},"permissions":{"allow-ask":{"identifier":"allow-ask","description":"Enables the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-confirm":{"identifier":"allow-confirm","description":"Enables the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `allow-message` and will be removed in v3)","commands":{"allow":["message"],"deny":[]}},"allow-message":{"identifier":"allow-message","description":"Enables the message command without any pre-configured scope.","commands":{"allow":["message"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-save":{"identifier":"allow-save","description":"Enables the save command without any pre-configured scope.","commands":{"allow":["save"],"deny":[]}},"deny-ask":{"identifier":"deny-ask","description":"Denies the ask command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-confirm":{"identifier":"deny-confirm","description":"Denies the confirm command without any pre-configured scope. (**DEPRECATED**: This is now an alias to `deny-message` and will be removed in v3)","commands":{"allow":[],"deny":["message"]}},"deny-message":{"identifier":"deny-message","description":"Denies the message command without any pre-configured scope.","commands":{"allow":[],"deny":["message"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-save":{"identifier":"deny-save","description":"Denies the save command without any pre-configured scope.","commands":{"allow":[],"deny":["save"]}}},"permission_sets":{},"global_scope_schema":null},"fs":{"default_permission":{"identifier":"default","description":"This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\n\n- On Windows the access to webview data folder `$APPLOCALDATA/EBWebView` is denied.\n- On Linux the access to webview data paths inside `$APPLOCALDATA` are denied.\n","permissions":["create-app-specific-dirs","read-app-specific-dirs-recursive","deny-default"]},"permissions":{"allow-copy-file":{"identifier":"allow-copy-file","description":"Enables the copy_file command without any pre-configured scope.","commands":{"allow":["copy_file"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-exists":{"identifier":"allow-exists","description":"Enables the exists command without any pre-configured scope.","commands":{"allow":["exists"],"deny":[]}},"allow-fstat":{"identifier":"allow-fstat","description":"Enables the fstat command without any pre-configured scope.","commands":{"allow":["fstat"],"deny":[]}},"allow-ftruncate":{"identifier":"allow-ftruncate","description":"Enables the ftruncate command without any pre-configured scope.","commands":{"allow":["ftruncate"],"deny":[]}},"allow-lstat":{"identifier":"allow-lstat","description":"Enables the lstat command without any pre-configured scope.","commands":{"allow":["lstat"],"deny":[]}},"allow-mkdir":{"identifier":"allow-mkdir","description":"Enables the mkdir command without any pre-configured scope.","commands":{"allow":["mkdir"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-read":{"identifier":"allow-read","description":"Enables the read command without any pre-configured scope.","commands":{"allow":["read"],"deny":[]}},"allow-read-dir":{"identifier":"allow-read-dir","description":"Enables the read_dir command without any pre-configured scope.","commands":{"allow":["read_dir"],"deny":[]}},"allow-read-file":{"identifier":"allow-read-file","description":"Enables the read_file command without any pre-configured scope.","commands":{"allow":["read_file"],"deny":[]}},"allow-read-text-file":{"identifier":"allow-read-text-file","description":"Enables the read_text_file command without any pre-configured scope.","commands":{"allow":["read_text_file"],"deny":[]}},"allow-read-text-file-lines":{"identifier":"allow-read-text-file-lines","description":"Enables the read_text_file_lines command without any pre-configured scope.","commands":{"allow":["read_text_file_lines","read_text_file_lines_next"],"deny":[]}},"allow-read-text-file-lines-next":{"identifier":"allow-read-text-file-lines-next","description":"Enables the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":["read_text_file_lines_next"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-rename":{"identifier":"allow-rename","description":"Enables the rename command without any pre-configured scope.","commands":{"allow":["rename"],"deny":[]}},"allow-seek":{"identifier":"allow-seek","description":"Enables the seek command without any pre-configured scope.","commands":{"allow":["seek"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"allow-start-accessing-security-scoped-resource":{"identifier":"allow-start-accessing-security-scoped-resource","description":"Enables the start_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":["start_accessing_security_scoped_resource"],"deny":[]}},"allow-stat":{"identifier":"allow-stat","description":"Enables the stat command without any pre-configured scope.","commands":{"allow":["stat"],"deny":[]}},"allow-stop-accessing-security-scoped-resource":{"identifier":"allow-stop-accessing-security-scoped-resource","description":"Enables the stop_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":["stop_accessing_security_scoped_resource"],"deny":[]}},"allow-truncate":{"identifier":"allow-truncate","description":"Enables the truncate command without any pre-configured scope.","commands":{"allow":["truncate"],"deny":[]}},"allow-unwatch":{"identifier":"allow-unwatch","description":"Enables the unwatch command without any pre-configured scope.","commands":{"allow":["unwatch"],"deny":[]}},"allow-watch":{"identifier":"allow-watch","description":"Enables the watch command without any pre-configured scope.","commands":{"allow":["watch"],"deny":[]}},"allow-write":{"identifier":"allow-write","description":"Enables the write command without any pre-configured scope.","commands":{"allow":["write"],"deny":[]}},"allow-write-file":{"identifier":"allow-write-file","description":"Enables the write_file command without any pre-configured scope.","commands":{"allow":["write_file","open","write"],"deny":[]}},"allow-write-text-file":{"identifier":"allow-write-text-file","description":"Enables the write_text_file command without any pre-configured scope.","commands":{"allow":["write_text_file"],"deny":[]}},"deny-copy-file":{"identifier":"deny-copy-file","description":"Denies the copy_file command without any pre-configured scope.","commands":{"allow":[],"deny":["copy_file"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-exists":{"identifier":"deny-exists","description":"Denies the exists command without any pre-configured scope.","commands":{"allow":[],"deny":["exists"]}},"deny-fstat":{"identifier":"deny-fstat","description":"Denies the fstat command without any pre-configured scope.","commands":{"allow":[],"deny":["fstat"]}},"deny-ftruncate":{"identifier":"deny-ftruncate","description":"Denies the ftruncate command without any pre-configured scope.","commands":{"allow":[],"deny":["ftruncate"]}},"deny-lstat":{"identifier":"deny-lstat","description":"Denies the lstat command without any pre-configured scope.","commands":{"allow":[],"deny":["lstat"]}},"deny-mkdir":{"identifier":"deny-mkdir","description":"Denies the mkdir command without any pre-configured scope.","commands":{"allow":[],"deny":["mkdir"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-read":{"identifier":"deny-read","description":"Denies the read command without any pre-configured scope.","commands":{"allow":[],"deny":["read"]}},"deny-read-dir":{"identifier":"deny-read-dir","description":"Denies the read_dir command without any pre-configured scope.","commands":{"allow":[],"deny":["read_dir"]}},"deny-read-file":{"identifier":"deny-read-file","description":"Denies the read_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_file"]}},"deny-read-text-file":{"identifier":"deny-read-text-file","description":"Denies the read_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file"]}},"deny-read-text-file-lines":{"identifier":"deny-read-text-file-lines","description":"Denies the read_text_file_lines command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines"]}},"deny-read-text-file-lines-next":{"identifier":"deny-read-text-file-lines-next","description":"Denies the read_text_file_lines_next command without any pre-configured scope.","commands":{"allow":[],"deny":["read_text_file_lines_next"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-rename":{"identifier":"deny-rename","description":"Denies the rename command without any pre-configured scope.","commands":{"allow":[],"deny":["rename"]}},"deny-seek":{"identifier":"deny-seek","description":"Denies the seek command without any pre-configured scope.","commands":{"allow":[],"deny":["seek"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}},"deny-start-accessing-security-scoped-resource":{"identifier":"deny-start-accessing-security-scoped-resource","description":"Denies the start_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":[],"deny":["start_accessing_security_scoped_resource"]}},"deny-stat":{"identifier":"deny-stat","description":"Denies the stat command without any pre-configured scope.","commands":{"allow":[],"deny":["stat"]}},"deny-stop-accessing-security-scoped-resource":{"identifier":"deny-stop-accessing-security-scoped-resource","description":"Denies the stop_accessing_security_scoped_resource command without any pre-configured scope.","commands":{"allow":[],"deny":["stop_accessing_security_scoped_resource"]}},"deny-truncate":{"identifier":"deny-truncate","description":"Denies the truncate command without any pre-configured scope.","commands":{"allow":[],"deny":["truncate"]}},"deny-unwatch":{"identifier":"deny-unwatch","description":"Denies the unwatch command without any pre-configured scope.","commands":{"allow":[],"deny":["unwatch"]}},"deny-watch":{"identifier":"deny-watch","description":"Denies the watch command without any pre-configured scope.","commands":{"allow":[],"deny":["watch"]}},"deny-webview-data-linux":{"identifier":"deny-webview-data-linux","description":"This denies access to the following paths\n\n- `$APPLOCALDATA/CacheStorage/**`\n- `$APPLOCALDATA/cookies`\n- `$APPLOCALDATA/hsts-storage.sqlite`\n- `$APPLOCALDATA/serviceworkers/**`\n- `$APPLOCALDATA/WebKitCache/**`\n- `$APPLOCALDATA/databases/**`\n- `$APPLOCALDATA/localstorage/**`\n- `$APPLOCALDATA/mediakeys/**`\n- `$APPLOCALDATA/storage/**`\n\non linux as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]},"scope":{"deny":[{"path":"$APPLOCALDATA/CacheStorage/**"},{"path":"$APPLOCALDATA/cookies"},{"path":"$APPLOCALDATA/hsts-storage.sqlite"},{"path":"$APPLOCALDATA/serviceworkers/**"},{"path":"$APPLOCALDATA/WebKitCache/**"},{"path":"$APPLOCALDATA/databases/**"},{"path":"$APPLOCALDATA/localstorage/**"},{"path":"$APPLOCALDATA/mediakeys/**"},{"path":"$APPLOCALDATA/storage/**"}]},"platforms":["linux"]},"deny-webview-data-windows":{"identifier":"deny-webview-data-windows","description":"This denies access to the\n`$APPLOCALDATA/EBWebView` folder on windows as the webview data and configuration values are stored here.\nAllowing access can lead to sensitive information disclosure and should be well considered.","commands":{"allow":[],"deny":[]},"scope":{"deny":[{"path":"$APPLOCALDATA/EBWebView/**"}]},"platforms":["windows"]},"deny-write":{"identifier":"deny-write","description":"Denies the write command without any pre-configured scope.","commands":{"allow":[],"deny":["write"]}},"deny-write-file":{"identifier":"deny-write-file","description":"Denies the write_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_file"]}},"deny-write-text-file":{"identifier":"deny-write-text-file","description":"Denies the write_text_file command without any pre-configured scope.","commands":{"allow":[],"deny":["write_text_file"]}},"read-all":{"identifier":"read-all","description":"This enables all read related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists","watch","unwatch"],"deny":[]}},"read-dirs":{"identifier":"read-dirs","description":"This enables directory read and file metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists"],"deny":[]}},"read-files":{"identifier":"read-files","description":"This enables file read related commands without any pre-configured accessible paths.","commands":{"allow":["read_file","read","open","read_text_file","read_text_file_lines","read_text_file_lines_next","seek","stat","lstat","fstat","exists"],"deny":[]}},"read-meta":{"identifier":"read-meta","description":"This enables all index or metadata related commands without any pre-configured accessible paths.","commands":{"allow":["read_dir","stat","lstat","fstat","exists","size"],"deny":[]}},"scope":{"identifier":"scope","description":"An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n \"identifier\": \"read-documents\",\n \"windows\": [\"main\"],\n \"permissions\": [\n \"fs:allow-read\",\n {\n \"identifier\": \"fs:scope\",\n \"allow\": [\n \"$APPDATA/documents/**/*\"\n ],\n \"deny\": [\n \"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n","commands":{"allow":[],"deny":[]}},"scope-app":{"identifier":"scope-app","description":"This scope permits access to all files and list content of top level directories in the application folders.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"},{"path":"$APPDATA"},{"path":"$APPDATA/*"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"},{"path":"$APPCACHE"},{"path":"$APPCACHE/*"},{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-app-index":{"identifier":"scope-app-index","description":"This scope permits to list all files and folders in the application directories.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPDATA"},{"path":"$APPLOCALDATA"},{"path":"$APPCACHE"},{"path":"$APPLOG"}]}},"scope-app-recursive":{"identifier":"scope-app-recursive","description":"This scope permits recursive access to the complete application folders, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"},{"path":"$APPDATA"},{"path":"$APPDATA/**"},{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"},{"path":"$APPCACHE"},{"path":"$APPCACHE/**"},{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-appcache":{"identifier":"scope-appcache","description":"This scope permits access to all files and list content of top level directories in the `$APPCACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/*"}]}},"scope-appcache-index":{"identifier":"scope-appcache-index","description":"This scope permits to list all files and folders in the `$APPCACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"}]}},"scope-appcache-recursive":{"identifier":"scope-appcache-recursive","description":"This scope permits recursive access to the complete `$APPCACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCACHE"},{"path":"$APPCACHE/**"}]}},"scope-appconfig":{"identifier":"scope-appconfig","description":"This scope permits access to all files and list content of top level directories in the `$APPCONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/*"}]}},"scope-appconfig-index":{"identifier":"scope-appconfig-index","description":"This scope permits to list all files and folders in the `$APPCONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"}]}},"scope-appconfig-recursive":{"identifier":"scope-appconfig-recursive","description":"This scope permits recursive access to the complete `$APPCONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPCONFIG"},{"path":"$APPCONFIG/**"}]}},"scope-appdata":{"identifier":"scope-appdata","description":"This scope permits access to all files and list content of top level directories in the `$APPDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/*"}]}},"scope-appdata-index":{"identifier":"scope-appdata-index","description":"This scope permits to list all files and folders in the `$APPDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"}]}},"scope-appdata-recursive":{"identifier":"scope-appdata-recursive","description":"This scope permits recursive access to the complete `$APPDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]}},"scope-applocaldata":{"identifier":"scope-applocaldata","description":"This scope permits access to all files and list content of top level directories in the `$APPLOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/*"}]}},"scope-applocaldata-index":{"identifier":"scope-applocaldata-index","description":"This scope permits to list all files and folders in the `$APPLOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"}]}},"scope-applocaldata-recursive":{"identifier":"scope-applocaldata-recursive","description":"This scope permits recursive access to the complete `$APPLOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOCALDATA"},{"path":"$APPLOCALDATA/**"}]}},"scope-applog":{"identifier":"scope-applog","description":"This scope permits access to all files and list content of top level directories in the `$APPLOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/*"}]}},"scope-applog-index":{"identifier":"scope-applog-index","description":"This scope permits to list all files and folders in the `$APPLOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"}]}},"scope-applog-recursive":{"identifier":"scope-applog-recursive","description":"This scope permits recursive access to the complete `$APPLOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$APPLOG"},{"path":"$APPLOG/**"}]}},"scope-audio":{"identifier":"scope-audio","description":"This scope permits access to all files and list content of top level directories in the `$AUDIO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/*"}]}},"scope-audio-index":{"identifier":"scope-audio-index","description":"This scope permits to list all files and folders in the `$AUDIO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"}]}},"scope-audio-recursive":{"identifier":"scope-audio-recursive","description":"This scope permits recursive access to the complete `$AUDIO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$AUDIO"},{"path":"$AUDIO/**"}]}},"scope-cache":{"identifier":"scope-cache","description":"This scope permits access to all files and list content of top level directories in the `$CACHE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/*"}]}},"scope-cache-index":{"identifier":"scope-cache-index","description":"This scope permits to list all files and folders in the `$CACHE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"}]}},"scope-cache-recursive":{"identifier":"scope-cache-recursive","description":"This scope permits recursive access to the complete `$CACHE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CACHE"},{"path":"$CACHE/**"}]}},"scope-config":{"identifier":"scope-config","description":"This scope permits access to all files and list content of top level directories in the `$CONFIG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/*"}]}},"scope-config-index":{"identifier":"scope-config-index","description":"This scope permits to list all files and folders in the `$CONFIG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"}]}},"scope-config-recursive":{"identifier":"scope-config-recursive","description":"This scope permits recursive access to the complete `$CONFIG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$CONFIG"},{"path":"$CONFIG/**"}]}},"scope-data":{"identifier":"scope-data","description":"This scope permits access to all files and list content of top level directories in the `$DATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/*"}]}},"scope-data-index":{"identifier":"scope-data-index","description":"This scope permits to list all files and folders in the `$DATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"}]}},"scope-data-recursive":{"identifier":"scope-data-recursive","description":"This scope permits recursive access to the complete `$DATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DATA"},{"path":"$DATA/**"}]}},"scope-desktop":{"identifier":"scope-desktop","description":"This scope permits access to all files and list content of top level directories in the `$DESKTOP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/*"}]}},"scope-desktop-index":{"identifier":"scope-desktop-index","description":"This scope permits to list all files and folders in the `$DESKTOP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"}]}},"scope-desktop-recursive":{"identifier":"scope-desktop-recursive","description":"This scope permits recursive access to the complete `$DESKTOP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DESKTOP"},{"path":"$DESKTOP/**"}]}},"scope-document":{"identifier":"scope-document","description":"This scope permits access to all files and list content of top level directories in the `$DOCUMENT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/*"}]}},"scope-document-index":{"identifier":"scope-document-index","description":"This scope permits to list all files and folders in the `$DOCUMENT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"}]}},"scope-document-recursive":{"identifier":"scope-document-recursive","description":"This scope permits recursive access to the complete `$DOCUMENT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOCUMENT"},{"path":"$DOCUMENT/**"}]}},"scope-download":{"identifier":"scope-download","description":"This scope permits access to all files and list content of top level directories in the `$DOWNLOAD` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/*"}]}},"scope-download-index":{"identifier":"scope-download-index","description":"This scope permits to list all files and folders in the `$DOWNLOAD`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"}]}},"scope-download-recursive":{"identifier":"scope-download-recursive","description":"This scope permits recursive access to the complete `$DOWNLOAD` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$DOWNLOAD"},{"path":"$DOWNLOAD/**"}]}},"scope-exe":{"identifier":"scope-exe","description":"This scope permits access to all files and list content of top level directories in the `$EXE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/*"}]}},"scope-exe-index":{"identifier":"scope-exe-index","description":"This scope permits to list all files and folders in the `$EXE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"}]}},"scope-exe-recursive":{"identifier":"scope-exe-recursive","description":"This scope permits recursive access to the complete `$EXE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$EXE"},{"path":"$EXE/**"}]}},"scope-font":{"identifier":"scope-font","description":"This scope permits access to all files and list content of top level directories in the `$FONT` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/*"}]}},"scope-font-index":{"identifier":"scope-font-index","description":"This scope permits to list all files and folders in the `$FONT`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"}]}},"scope-font-recursive":{"identifier":"scope-font-recursive","description":"This scope permits recursive access to the complete `$FONT` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$FONT"},{"path":"$FONT/**"}]}},"scope-home":{"identifier":"scope-home","description":"This scope permits access to all files and list content of top level directories in the `$HOME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/*"}]}},"scope-home-index":{"identifier":"scope-home-index","description":"This scope permits to list all files and folders in the `$HOME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"}]}},"scope-home-recursive":{"identifier":"scope-home-recursive","description":"This scope permits recursive access to the complete `$HOME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$HOME"},{"path":"$HOME/**"}]}},"scope-localdata":{"identifier":"scope-localdata","description":"This scope permits access to all files and list content of top level directories in the `$LOCALDATA` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/*"}]}},"scope-localdata-index":{"identifier":"scope-localdata-index","description":"This scope permits to list all files and folders in the `$LOCALDATA`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"}]}},"scope-localdata-recursive":{"identifier":"scope-localdata-recursive","description":"This scope permits recursive access to the complete `$LOCALDATA` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOCALDATA"},{"path":"$LOCALDATA/**"}]}},"scope-log":{"identifier":"scope-log","description":"This scope permits access to all files and list content of top level directories in the `$LOG` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/*"}]}},"scope-log-index":{"identifier":"scope-log-index","description":"This scope permits to list all files and folders in the `$LOG`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"}]}},"scope-log-recursive":{"identifier":"scope-log-recursive","description":"This scope permits recursive access to the complete `$LOG` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$LOG"},{"path":"$LOG/**"}]}},"scope-picture":{"identifier":"scope-picture","description":"This scope permits access to all files and list content of top level directories in the `$PICTURE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/*"}]}},"scope-picture-index":{"identifier":"scope-picture-index","description":"This scope permits to list all files and folders in the `$PICTURE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"}]}},"scope-picture-recursive":{"identifier":"scope-picture-recursive","description":"This scope permits recursive access to the complete `$PICTURE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PICTURE"},{"path":"$PICTURE/**"}]}},"scope-public":{"identifier":"scope-public","description":"This scope permits access to all files and list content of top level directories in the `$PUBLIC` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/*"}]}},"scope-public-index":{"identifier":"scope-public-index","description":"This scope permits to list all files and folders in the `$PUBLIC`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"}]}},"scope-public-recursive":{"identifier":"scope-public-recursive","description":"This scope permits recursive access to the complete `$PUBLIC` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$PUBLIC"},{"path":"$PUBLIC/**"}]}},"scope-resource":{"identifier":"scope-resource","description":"This scope permits access to all files and list content of top level directories in the `$RESOURCE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/*"}]}},"scope-resource-index":{"identifier":"scope-resource-index","description":"This scope permits to list all files and folders in the `$RESOURCE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"}]}},"scope-resource-recursive":{"identifier":"scope-resource-recursive","description":"This scope permits recursive access to the complete `$RESOURCE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RESOURCE"},{"path":"$RESOURCE/**"}]}},"scope-runtime":{"identifier":"scope-runtime","description":"This scope permits access to all files and list content of top level directories in the `$RUNTIME` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/*"}]}},"scope-runtime-index":{"identifier":"scope-runtime-index","description":"This scope permits to list all files and folders in the `$RUNTIME`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"}]}},"scope-runtime-recursive":{"identifier":"scope-runtime-recursive","description":"This scope permits recursive access to the complete `$RUNTIME` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$RUNTIME"},{"path":"$RUNTIME/**"}]}},"scope-temp":{"identifier":"scope-temp","description":"This scope permits access to all files and list content of top level directories in the `$TEMP` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/*"}]}},"scope-temp-index":{"identifier":"scope-temp-index","description":"This scope permits to list all files and folders in the `$TEMP`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"}]}},"scope-temp-recursive":{"identifier":"scope-temp-recursive","description":"This scope permits recursive access to the complete `$TEMP` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMP"},{"path":"$TEMP/**"}]}},"scope-template":{"identifier":"scope-template","description":"This scope permits access to all files and list content of top level directories in the `$TEMPLATE` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/*"}]}},"scope-template-index":{"identifier":"scope-template-index","description":"This scope permits to list all files and folders in the `$TEMPLATE`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"}]}},"scope-template-recursive":{"identifier":"scope-template-recursive","description":"This scope permits recursive access to the complete `$TEMPLATE` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$TEMPLATE"},{"path":"$TEMPLATE/**"}]}},"scope-video":{"identifier":"scope-video","description":"This scope permits access to all files and list content of top level directories in the `$VIDEO` folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/*"}]}},"scope-video-index":{"identifier":"scope-video-index","description":"This scope permits to list all files and folders in the `$VIDEO`folder.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"}]}},"scope-video-recursive":{"identifier":"scope-video-recursive","description":"This scope permits recursive access to the complete `$VIDEO` folder, including sub directories and files.","commands":{"allow":[],"deny":[]},"scope":{"allow":[{"path":"$VIDEO"},{"path":"$VIDEO/**"}]}}},"permission_sets":{"allow-app-meta":{"identifier":"allow-app-meta","description":"This allows non-recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-index"]},"allow-app-meta-recursive":{"identifier":"allow-app-meta-recursive","description":"This allows full recursive read access to metadata of the application folders, including file listing and statistics.","permissions":["read-meta","scope-app-recursive"]},"allow-app-read":{"identifier":"allow-app-read","description":"This allows non-recursive read access to the application folders.","permissions":["read-all","scope-app"]},"allow-app-read-recursive":{"identifier":"allow-app-read-recursive","description":"This allows full recursive read access to the complete application folders, files and subdirectories.","permissions":["read-all","scope-app-recursive"]},"allow-app-write":{"identifier":"allow-app-write","description":"This allows non-recursive write access to the application folders.","permissions":["write-all","scope-app"]},"allow-app-write-recursive":{"identifier":"allow-app-write-recursive","description":"This allows full recursive write access to the complete application folders, files and subdirectories.","permissions":["write-all","scope-app-recursive"]},"allow-appcache-meta":{"identifier":"allow-appcache-meta","description":"This allows non-recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-index"]},"allow-appcache-meta-recursive":{"identifier":"allow-appcache-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-appcache-recursive"]},"allow-appcache-read":{"identifier":"allow-appcache-read","description":"This allows non-recursive read access to the `$APPCACHE` folder.","permissions":["read-all","scope-appcache"]},"allow-appcache-read-recursive":{"identifier":"allow-appcache-read-recursive","description":"This allows full recursive read access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["read-all","scope-appcache-recursive"]},"allow-appcache-write":{"identifier":"allow-appcache-write","description":"This allows non-recursive write access to the `$APPCACHE` folder.","permissions":["write-all","scope-appcache"]},"allow-appcache-write-recursive":{"identifier":"allow-appcache-write-recursive","description":"This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.","permissions":["write-all","scope-appcache-recursive"]},"allow-appconfig-meta":{"identifier":"allow-appconfig-meta","description":"This allows non-recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-index"]},"allow-appconfig-meta-recursive":{"identifier":"allow-appconfig-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPCONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-appconfig-recursive"]},"allow-appconfig-read":{"identifier":"allow-appconfig-read","description":"This allows non-recursive read access to the `$APPCONFIG` folder.","permissions":["read-all","scope-appconfig"]},"allow-appconfig-read-recursive":{"identifier":"allow-appconfig-read-recursive","description":"This allows full recursive read access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["read-all","scope-appconfig-recursive"]},"allow-appconfig-write":{"identifier":"allow-appconfig-write","description":"This allows non-recursive write access to the `$APPCONFIG` folder.","permissions":["write-all","scope-appconfig"]},"allow-appconfig-write-recursive":{"identifier":"allow-appconfig-write-recursive","description":"This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.","permissions":["write-all","scope-appconfig-recursive"]},"allow-appdata-meta":{"identifier":"allow-appdata-meta","description":"This allows non-recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-index"]},"allow-appdata-meta-recursive":{"identifier":"allow-appdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-appdata-recursive"]},"allow-appdata-read":{"identifier":"allow-appdata-read","description":"This allows non-recursive read access to the `$APPDATA` folder.","permissions":["read-all","scope-appdata"]},"allow-appdata-read-recursive":{"identifier":"allow-appdata-read-recursive","description":"This allows full recursive read access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["read-all","scope-appdata-recursive"]},"allow-appdata-write":{"identifier":"allow-appdata-write","description":"This allows non-recursive write access to the `$APPDATA` folder.","permissions":["write-all","scope-appdata"]},"allow-appdata-write-recursive":{"identifier":"allow-appdata-write-recursive","description":"This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.","permissions":["write-all","scope-appdata-recursive"]},"allow-applocaldata-meta":{"identifier":"allow-applocaldata-meta","description":"This allows non-recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-index"]},"allow-applocaldata-meta-recursive":{"identifier":"allow-applocaldata-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-applocaldata-recursive"]},"allow-applocaldata-read":{"identifier":"allow-applocaldata-read","description":"This allows non-recursive read access to the `$APPLOCALDATA` folder.","permissions":["read-all","scope-applocaldata"]},"allow-applocaldata-read-recursive":{"identifier":"allow-applocaldata-read-recursive","description":"This allows full recursive read access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-applocaldata-recursive"]},"allow-applocaldata-write":{"identifier":"allow-applocaldata-write","description":"This allows non-recursive write access to the `$APPLOCALDATA` folder.","permissions":["write-all","scope-applocaldata"]},"allow-applocaldata-write-recursive":{"identifier":"allow-applocaldata-write-recursive","description":"This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-applocaldata-recursive"]},"allow-applog-meta":{"identifier":"allow-applog-meta","description":"This allows non-recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-index"]},"allow-applog-meta-recursive":{"identifier":"allow-applog-meta-recursive","description":"This allows full recursive read access to metadata of the `$APPLOG` folder, including file listing and statistics.","permissions":["read-meta","scope-applog-recursive"]},"allow-applog-read":{"identifier":"allow-applog-read","description":"This allows non-recursive read access to the `$APPLOG` folder.","permissions":["read-all","scope-applog"]},"allow-applog-read-recursive":{"identifier":"allow-applog-read-recursive","description":"This allows full recursive read access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["read-all","scope-applog-recursive"]},"allow-applog-write":{"identifier":"allow-applog-write","description":"This allows non-recursive write access to the `$APPLOG` folder.","permissions":["write-all","scope-applog"]},"allow-applog-write-recursive":{"identifier":"allow-applog-write-recursive","description":"This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.","permissions":["write-all","scope-applog-recursive"]},"allow-audio-meta":{"identifier":"allow-audio-meta","description":"This allows non-recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-index"]},"allow-audio-meta-recursive":{"identifier":"allow-audio-meta-recursive","description":"This allows full recursive read access to metadata of the `$AUDIO` folder, including file listing and statistics.","permissions":["read-meta","scope-audio-recursive"]},"allow-audio-read":{"identifier":"allow-audio-read","description":"This allows non-recursive read access to the `$AUDIO` folder.","permissions":["read-all","scope-audio"]},"allow-audio-read-recursive":{"identifier":"allow-audio-read-recursive","description":"This allows full recursive read access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["read-all","scope-audio-recursive"]},"allow-audio-write":{"identifier":"allow-audio-write","description":"This allows non-recursive write access to the `$AUDIO` folder.","permissions":["write-all","scope-audio"]},"allow-audio-write-recursive":{"identifier":"allow-audio-write-recursive","description":"This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.","permissions":["write-all","scope-audio-recursive"]},"allow-cache-meta":{"identifier":"allow-cache-meta","description":"This allows non-recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-index"]},"allow-cache-meta-recursive":{"identifier":"allow-cache-meta-recursive","description":"This allows full recursive read access to metadata of the `$CACHE` folder, including file listing and statistics.","permissions":["read-meta","scope-cache-recursive"]},"allow-cache-read":{"identifier":"allow-cache-read","description":"This allows non-recursive read access to the `$CACHE` folder.","permissions":["read-all","scope-cache"]},"allow-cache-read-recursive":{"identifier":"allow-cache-read-recursive","description":"This allows full recursive read access to the complete `$CACHE` folder, files and subdirectories.","permissions":["read-all","scope-cache-recursive"]},"allow-cache-write":{"identifier":"allow-cache-write","description":"This allows non-recursive write access to the `$CACHE` folder.","permissions":["write-all","scope-cache"]},"allow-cache-write-recursive":{"identifier":"allow-cache-write-recursive","description":"This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.","permissions":["write-all","scope-cache-recursive"]},"allow-config-meta":{"identifier":"allow-config-meta","description":"This allows non-recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-index"]},"allow-config-meta-recursive":{"identifier":"allow-config-meta-recursive","description":"This allows full recursive read access to metadata of the `$CONFIG` folder, including file listing and statistics.","permissions":["read-meta","scope-config-recursive"]},"allow-config-read":{"identifier":"allow-config-read","description":"This allows non-recursive read access to the `$CONFIG` folder.","permissions":["read-all","scope-config"]},"allow-config-read-recursive":{"identifier":"allow-config-read-recursive","description":"This allows full recursive read access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["read-all","scope-config-recursive"]},"allow-config-write":{"identifier":"allow-config-write","description":"This allows non-recursive write access to the `$CONFIG` folder.","permissions":["write-all","scope-config"]},"allow-config-write-recursive":{"identifier":"allow-config-write-recursive","description":"This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.","permissions":["write-all","scope-config-recursive"]},"allow-data-meta":{"identifier":"allow-data-meta","description":"This allows non-recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-index"]},"allow-data-meta-recursive":{"identifier":"allow-data-meta-recursive","description":"This allows full recursive read access to metadata of the `$DATA` folder, including file listing and statistics.","permissions":["read-meta","scope-data-recursive"]},"allow-data-read":{"identifier":"allow-data-read","description":"This allows non-recursive read access to the `$DATA` folder.","permissions":["read-all","scope-data"]},"allow-data-read-recursive":{"identifier":"allow-data-read-recursive","description":"This allows full recursive read access to the complete `$DATA` folder, files and subdirectories.","permissions":["read-all","scope-data-recursive"]},"allow-data-write":{"identifier":"allow-data-write","description":"This allows non-recursive write access to the `$DATA` folder.","permissions":["write-all","scope-data"]},"allow-data-write-recursive":{"identifier":"allow-data-write-recursive","description":"This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.","permissions":["write-all","scope-data-recursive"]},"allow-desktop-meta":{"identifier":"allow-desktop-meta","description":"This allows non-recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-index"]},"allow-desktop-meta-recursive":{"identifier":"allow-desktop-meta-recursive","description":"This allows full recursive read access to metadata of the `$DESKTOP` folder, including file listing and statistics.","permissions":["read-meta","scope-desktop-recursive"]},"allow-desktop-read":{"identifier":"allow-desktop-read","description":"This allows non-recursive read access to the `$DESKTOP` folder.","permissions":["read-all","scope-desktop"]},"allow-desktop-read-recursive":{"identifier":"allow-desktop-read-recursive","description":"This allows full recursive read access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["read-all","scope-desktop-recursive"]},"allow-desktop-write":{"identifier":"allow-desktop-write","description":"This allows non-recursive write access to the `$DESKTOP` folder.","permissions":["write-all","scope-desktop"]},"allow-desktop-write-recursive":{"identifier":"allow-desktop-write-recursive","description":"This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.","permissions":["write-all","scope-desktop-recursive"]},"allow-document-meta":{"identifier":"allow-document-meta","description":"This allows non-recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-index"]},"allow-document-meta-recursive":{"identifier":"allow-document-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOCUMENT` folder, including file listing and statistics.","permissions":["read-meta","scope-document-recursive"]},"allow-document-read":{"identifier":"allow-document-read","description":"This allows non-recursive read access to the `$DOCUMENT` folder.","permissions":["read-all","scope-document"]},"allow-document-read-recursive":{"identifier":"allow-document-read-recursive","description":"This allows full recursive read access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["read-all","scope-document-recursive"]},"allow-document-write":{"identifier":"allow-document-write","description":"This allows non-recursive write access to the `$DOCUMENT` folder.","permissions":["write-all","scope-document"]},"allow-document-write-recursive":{"identifier":"allow-document-write-recursive","description":"This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.","permissions":["write-all","scope-document-recursive"]},"allow-download-meta":{"identifier":"allow-download-meta","description":"This allows non-recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-index"]},"allow-download-meta-recursive":{"identifier":"allow-download-meta-recursive","description":"This allows full recursive read access to metadata of the `$DOWNLOAD` folder, including file listing and statistics.","permissions":["read-meta","scope-download-recursive"]},"allow-download-read":{"identifier":"allow-download-read","description":"This allows non-recursive read access to the `$DOWNLOAD` folder.","permissions":["read-all","scope-download"]},"allow-download-read-recursive":{"identifier":"allow-download-read-recursive","description":"This allows full recursive read access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["read-all","scope-download-recursive"]},"allow-download-write":{"identifier":"allow-download-write","description":"This allows non-recursive write access to the `$DOWNLOAD` folder.","permissions":["write-all","scope-download"]},"allow-download-write-recursive":{"identifier":"allow-download-write-recursive","description":"This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.","permissions":["write-all","scope-download-recursive"]},"allow-exe-meta":{"identifier":"allow-exe-meta","description":"This allows non-recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-index"]},"allow-exe-meta-recursive":{"identifier":"allow-exe-meta-recursive","description":"This allows full recursive read access to metadata of the `$EXE` folder, including file listing and statistics.","permissions":["read-meta","scope-exe-recursive"]},"allow-exe-read":{"identifier":"allow-exe-read","description":"This allows non-recursive read access to the `$EXE` folder.","permissions":["read-all","scope-exe"]},"allow-exe-read-recursive":{"identifier":"allow-exe-read-recursive","description":"This allows full recursive read access to the complete `$EXE` folder, files and subdirectories.","permissions":["read-all","scope-exe-recursive"]},"allow-exe-write":{"identifier":"allow-exe-write","description":"This allows non-recursive write access to the `$EXE` folder.","permissions":["write-all","scope-exe"]},"allow-exe-write-recursive":{"identifier":"allow-exe-write-recursive","description":"This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.","permissions":["write-all","scope-exe-recursive"]},"allow-font-meta":{"identifier":"allow-font-meta","description":"This allows non-recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-index"]},"allow-font-meta-recursive":{"identifier":"allow-font-meta-recursive","description":"This allows full recursive read access to metadata of the `$FONT` folder, including file listing and statistics.","permissions":["read-meta","scope-font-recursive"]},"allow-font-read":{"identifier":"allow-font-read","description":"This allows non-recursive read access to the `$FONT` folder.","permissions":["read-all","scope-font"]},"allow-font-read-recursive":{"identifier":"allow-font-read-recursive","description":"This allows full recursive read access to the complete `$FONT` folder, files and subdirectories.","permissions":["read-all","scope-font-recursive"]},"allow-font-write":{"identifier":"allow-font-write","description":"This allows non-recursive write access to the `$FONT` folder.","permissions":["write-all","scope-font"]},"allow-font-write-recursive":{"identifier":"allow-font-write-recursive","description":"This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.","permissions":["write-all","scope-font-recursive"]},"allow-home-meta":{"identifier":"allow-home-meta","description":"This allows non-recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-index"]},"allow-home-meta-recursive":{"identifier":"allow-home-meta-recursive","description":"This allows full recursive read access to metadata of the `$HOME` folder, including file listing and statistics.","permissions":["read-meta","scope-home-recursive"]},"allow-home-read":{"identifier":"allow-home-read","description":"This allows non-recursive read access to the `$HOME` folder.","permissions":["read-all","scope-home"]},"allow-home-read-recursive":{"identifier":"allow-home-read-recursive","description":"This allows full recursive read access to the complete `$HOME` folder, files and subdirectories.","permissions":["read-all","scope-home-recursive"]},"allow-home-write":{"identifier":"allow-home-write","description":"This allows non-recursive write access to the `$HOME` folder.","permissions":["write-all","scope-home"]},"allow-home-write-recursive":{"identifier":"allow-home-write-recursive","description":"This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.","permissions":["write-all","scope-home-recursive"]},"allow-localdata-meta":{"identifier":"allow-localdata-meta","description":"This allows non-recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-index"]},"allow-localdata-meta-recursive":{"identifier":"allow-localdata-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOCALDATA` folder, including file listing and statistics.","permissions":["read-meta","scope-localdata-recursive"]},"allow-localdata-read":{"identifier":"allow-localdata-read","description":"This allows non-recursive read access to the `$LOCALDATA` folder.","permissions":["read-all","scope-localdata"]},"allow-localdata-read-recursive":{"identifier":"allow-localdata-read-recursive","description":"This allows full recursive read access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["read-all","scope-localdata-recursive"]},"allow-localdata-write":{"identifier":"allow-localdata-write","description":"This allows non-recursive write access to the `$LOCALDATA` folder.","permissions":["write-all","scope-localdata"]},"allow-localdata-write-recursive":{"identifier":"allow-localdata-write-recursive","description":"This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.","permissions":["write-all","scope-localdata-recursive"]},"allow-log-meta":{"identifier":"allow-log-meta","description":"This allows non-recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-index"]},"allow-log-meta-recursive":{"identifier":"allow-log-meta-recursive","description":"This allows full recursive read access to metadata of the `$LOG` folder, including file listing and statistics.","permissions":["read-meta","scope-log-recursive"]},"allow-log-read":{"identifier":"allow-log-read","description":"This allows non-recursive read access to the `$LOG` folder.","permissions":["read-all","scope-log"]},"allow-log-read-recursive":{"identifier":"allow-log-read-recursive","description":"This allows full recursive read access to the complete `$LOG` folder, files and subdirectories.","permissions":["read-all","scope-log-recursive"]},"allow-log-write":{"identifier":"allow-log-write","description":"This allows non-recursive write access to the `$LOG` folder.","permissions":["write-all","scope-log"]},"allow-log-write-recursive":{"identifier":"allow-log-write-recursive","description":"This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.","permissions":["write-all","scope-log-recursive"]},"allow-picture-meta":{"identifier":"allow-picture-meta","description":"This allows non-recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-index"]},"allow-picture-meta-recursive":{"identifier":"allow-picture-meta-recursive","description":"This allows full recursive read access to metadata of the `$PICTURE` folder, including file listing and statistics.","permissions":["read-meta","scope-picture-recursive"]},"allow-picture-read":{"identifier":"allow-picture-read","description":"This allows non-recursive read access to the `$PICTURE` folder.","permissions":["read-all","scope-picture"]},"allow-picture-read-recursive":{"identifier":"allow-picture-read-recursive","description":"This allows full recursive read access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["read-all","scope-picture-recursive"]},"allow-picture-write":{"identifier":"allow-picture-write","description":"This allows non-recursive write access to the `$PICTURE` folder.","permissions":["write-all","scope-picture"]},"allow-picture-write-recursive":{"identifier":"allow-picture-write-recursive","description":"This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.","permissions":["write-all","scope-picture-recursive"]},"allow-public-meta":{"identifier":"allow-public-meta","description":"This allows non-recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-index"]},"allow-public-meta-recursive":{"identifier":"allow-public-meta-recursive","description":"This allows full recursive read access to metadata of the `$PUBLIC` folder, including file listing and statistics.","permissions":["read-meta","scope-public-recursive"]},"allow-public-read":{"identifier":"allow-public-read","description":"This allows non-recursive read access to the `$PUBLIC` folder.","permissions":["read-all","scope-public"]},"allow-public-read-recursive":{"identifier":"allow-public-read-recursive","description":"This allows full recursive read access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["read-all","scope-public-recursive"]},"allow-public-write":{"identifier":"allow-public-write","description":"This allows non-recursive write access to the `$PUBLIC` folder.","permissions":["write-all","scope-public"]},"allow-public-write-recursive":{"identifier":"allow-public-write-recursive","description":"This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.","permissions":["write-all","scope-public-recursive"]},"allow-resource-meta":{"identifier":"allow-resource-meta","description":"This allows non-recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-index"]},"allow-resource-meta-recursive":{"identifier":"allow-resource-meta-recursive","description":"This allows full recursive read access to metadata of the `$RESOURCE` folder, including file listing and statistics.","permissions":["read-meta","scope-resource-recursive"]},"allow-resource-read":{"identifier":"allow-resource-read","description":"This allows non-recursive read access to the `$RESOURCE` folder.","permissions":["read-all","scope-resource"]},"allow-resource-read-recursive":{"identifier":"allow-resource-read-recursive","description":"This allows full recursive read access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["read-all","scope-resource-recursive"]},"allow-resource-write":{"identifier":"allow-resource-write","description":"This allows non-recursive write access to the `$RESOURCE` folder.","permissions":["write-all","scope-resource"]},"allow-resource-write-recursive":{"identifier":"allow-resource-write-recursive","description":"This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.","permissions":["write-all","scope-resource-recursive"]},"allow-runtime-meta":{"identifier":"allow-runtime-meta","description":"This allows non-recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-index"]},"allow-runtime-meta-recursive":{"identifier":"allow-runtime-meta-recursive","description":"This allows full recursive read access to metadata of the `$RUNTIME` folder, including file listing and statistics.","permissions":["read-meta","scope-runtime-recursive"]},"allow-runtime-read":{"identifier":"allow-runtime-read","description":"This allows non-recursive read access to the `$RUNTIME` folder.","permissions":["read-all","scope-runtime"]},"allow-runtime-read-recursive":{"identifier":"allow-runtime-read-recursive","description":"This allows full recursive read access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["read-all","scope-runtime-recursive"]},"allow-runtime-write":{"identifier":"allow-runtime-write","description":"This allows non-recursive write access to the `$RUNTIME` folder.","permissions":["write-all","scope-runtime"]},"allow-runtime-write-recursive":{"identifier":"allow-runtime-write-recursive","description":"This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.","permissions":["write-all","scope-runtime-recursive"]},"allow-temp-meta":{"identifier":"allow-temp-meta","description":"This allows non-recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-index"]},"allow-temp-meta-recursive":{"identifier":"allow-temp-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMP` folder, including file listing and statistics.","permissions":["read-meta","scope-temp-recursive"]},"allow-temp-read":{"identifier":"allow-temp-read","description":"This allows non-recursive read access to the `$TEMP` folder.","permissions":["read-all","scope-temp"]},"allow-temp-read-recursive":{"identifier":"allow-temp-read-recursive","description":"This allows full recursive read access to the complete `$TEMP` folder, files and subdirectories.","permissions":["read-all","scope-temp-recursive"]},"allow-temp-write":{"identifier":"allow-temp-write","description":"This allows non-recursive write access to the `$TEMP` folder.","permissions":["write-all","scope-temp"]},"allow-temp-write-recursive":{"identifier":"allow-temp-write-recursive","description":"This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.","permissions":["write-all","scope-temp-recursive"]},"allow-template-meta":{"identifier":"allow-template-meta","description":"This allows non-recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-index"]},"allow-template-meta-recursive":{"identifier":"allow-template-meta-recursive","description":"This allows full recursive read access to metadata of the `$TEMPLATE` folder, including file listing and statistics.","permissions":["read-meta","scope-template-recursive"]},"allow-template-read":{"identifier":"allow-template-read","description":"This allows non-recursive read access to the `$TEMPLATE` folder.","permissions":["read-all","scope-template"]},"allow-template-read-recursive":{"identifier":"allow-template-read-recursive","description":"This allows full recursive read access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["read-all","scope-template-recursive"]},"allow-template-write":{"identifier":"allow-template-write","description":"This allows non-recursive write access to the `$TEMPLATE` folder.","permissions":["write-all","scope-template"]},"allow-template-write-recursive":{"identifier":"allow-template-write-recursive","description":"This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.","permissions":["write-all","scope-template-recursive"]},"allow-video-meta":{"identifier":"allow-video-meta","description":"This allows non-recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-index"]},"allow-video-meta-recursive":{"identifier":"allow-video-meta-recursive","description":"This allows full recursive read access to metadata of the `$VIDEO` folder, including file listing and statistics.","permissions":["read-meta","scope-video-recursive"]},"allow-video-read":{"identifier":"allow-video-read","description":"This allows non-recursive read access to the `$VIDEO` folder.","permissions":["read-all","scope-video"]},"allow-video-read-recursive":{"identifier":"allow-video-read-recursive","description":"This allows full recursive read access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["read-all","scope-video-recursive"]},"allow-video-write":{"identifier":"allow-video-write","description":"This allows non-recursive write access to the `$VIDEO` folder.","permissions":["write-all","scope-video"]},"allow-video-write-recursive":{"identifier":"allow-video-write-recursive","description":"This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.","permissions":["write-all","scope-video-recursive"]},"create-app-specific-dirs":{"identifier":"create-app-specific-dirs","description":"This permissions allows to create the application specific directories.\n","permissions":["allow-mkdir","scope-app-index"]},"deny-default":{"identifier":"deny-default","description":"This denies access to dangerous Tauri relevant files and folders by default.","permissions":["deny-webview-data-linux","deny-webview-data-windows"]},"read-app-specific-dirs-recursive":{"identifier":"read-app-specific-dirs-recursive","description":"This permission allows recursive read functionality on the application\nspecific base directories.\n","permissions":["allow-read-dir","allow-read-file","allow-read-text-file","allow-read-text-file-lines","allow-read-text-file-lines-next","allow-exists","scope-app-recursive"]},"write-all":{"identifier":"write-all","description":"This enables all write related commands without any pre-configured accessible paths.","permissions":["allow-mkdir","allow-create","allow-copy-file","allow-remove","allow-rename","allow-truncate","allow-ftruncate","allow-write","allow-write-file","allow-write-text-file"]},"write-files":{"identifier":"write-files","description":"This enables all file write related commands without any pre-configured accessible paths.","permissions":["allow-create","allow-copy-file","allow-remove","allow-rename","allow-truncate","allow-ftruncate","allow-write","allow-write-file","allow-write-text-file"]}},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"description":"A path that can be accessed by the webview when using the fs APIs. FS scope path pattern.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},{"properties":{"path":{"description":"A path that can be accessed by the webview when using the fs APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"}},"required":["path"],"type":"object"}],"description":"FS scope entry.","title":"FsScopeEntry"}},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}},"window-state":{"default_permission":{"identifier":"default","description":"This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n","permissions":["allow-filename","allow-restore-state","allow-save-window-state"]},"permissions":{"allow-filename":{"identifier":"allow-filename","description":"Enables the filename command without any pre-configured scope.","commands":{"allow":["filename"],"deny":[]}},"allow-restore-state":{"identifier":"allow-restore-state","description":"Enables the restore_state command without any pre-configured scope.","commands":{"allow":["restore_state"],"deny":[]}},"allow-save-window-state":{"identifier":"allow-save-window-state","description":"Enables the save_window_state command without any pre-configured scope.","commands":{"allow":["save_window_state"],"deny":[]}},"deny-filename":{"identifier":"deny-filename","description":"Denies the filename command without any pre-configured scope.","commands":{"allow":[],"deny":["filename"]}},"deny-restore-state":{"identifier":"deny-restore-state","description":"Denies the restore_state command without any pre-configured scope.","commands":{"allow":[],"deny":["restore_state"]}},"deny-save-window-state":{"identifier":"deny-save-window-state","description":"Denies the save_window_state command without any pre-configured scope.","commands":{"allow":[],"deny":["save_window_state"]}}},"permission_sets":{},"global_scope_schema":null}} \ No newline at end of file diff --git a/apps/desktop/src-tauri/gen/schemas/capabilities.json b/apps/desktop/src-tauri/gen/schemas/capabilities.json index d324e77d..5b6905e5 100644 --- a/apps/desktop/src-tauri/gen/schemas/capabilities.json +++ b/apps/desktop/src-tauri/gen/schemas/capabilities.json @@ -1 +1 @@ -{"default":{"identifier":"default","description":"Default capability β€” grants core API, read access to harness config roots under $HOME (the Machine-observation paths .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot and .agents are reachable only by the read, read-dir and exists permissions), mkdir and lstat inside the fs scope, and shell open. No shell execute, spawn, stdin or kill: production code runs processes from Rust only. fs write, rename and remove are not granted to the webview; they go through guarded_write_file, guarded_rename_file and guarded_remove_file, which write and rename only the engine's .harness-tmp- files, and delete only those and its backups (removing a store moves it to ~/.harness/backups/quarantine/ instead)","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-start-dragging","core:event:allow-listen","core:event:allow-emit","fs:allow-read-text-file","fs:allow-read-dir","fs:allow-exists","fs:allow-lstat","fs:allow-mkdir",{"identifier":"fs:scope","allow":[{"path":"$HOME/CLAUDE.md"},{"path":"$HOME/AGENTS.md"},{"path":"$HOME/.mcp.json"},{"path":"$HOME/.claude"},{"path":"$HOME/.claude/**"},{"path":"$HOME/.cursor"},{"path":"$HOME/.cursor/**"},{"path":"$HOME/.github"},{"path":"$HOME/.github/**"},{"path":"$HOME/.vscode"},{"path":"$HOME/.vscode/**"},{"path":"$HOME/.codex"},{"path":"$HOME/.codex/**"},{"path":"$HOME/.opencode"},{"path":"$HOME/.opencode/**"},{"path":"$HOME/.config/opencode"},{"path":"$HOME/.config/opencode/**"},{"path":"$HOME/.windsurf"},{"path":"$HOME/.windsurf/**"},{"path":"$HOME/.gemini"},{"path":"$HOME/.gemini/**"},{"path":"$HOME/.junie"},{"path":"$HOME/.junie/**"},{"path":"$HOME/.pi"},{"path":"$HOME/.pi/**"},{"path":"$HOME/.harness-kit"},{"path":"$HOME/.harness-kit/**"},{"path":"$HOME/.harness/backups"},{"path":"$HOME/.harness/backups/**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-exists","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},"dialog:default","dialog:allow-open","dialog:allow-save","shell:default","shell:allow-open","allow-list-installed-plugins","allow-list-marketplaces","allow-check-plugin-updates","allow-uninstall-plugin","allow-read-plugin-tree","allow-read-plugin-file","allow-write-plugin-file","allow-import-plugin-from-path","allow-import-plugin-from-zip","allow-export-plugin-as-zip","allow-export-plugin-to-folder","allow-read-hooks","allow-read-claude-md","allow-write-config-file","allow-read-harness-file","allow-write-harness-file","allow-scan-claude-config","allow-list-custom-profiles","allow-get-custom-profile","allow-save-custom-profile","allow-delete-custom-profile","allow-list-claude-dir","allow-detect-claude-account","allow-read-stats-cache","allow-list-sessions-summary","allow-read-session-facet","allow-list-active-sessions","allow-read-live-activity","allow-compute-live-stats","allow-read-session-transcript","allow-check-git-repo","allow-check-for-updates","allow-trigger-rebuild","allow-save-evaluation","allow-get-evaluations","allow-update-evaluation-score","allow-create-evaluation-session","allow-get-evaluation-session","allow-reveal-evaluation-session","allow-save-pairwise-vote","allow-get-pairwise-votes","allow-get-pairwise-analytics","allow-delete-pairwise-vote","allow-export-comparison-json","allow-get-comparator-analytics","allow-save-comparison","allow-update-comparison-title","allow-update-comparison-status","allow-list-comparisons","allow-get-comparison","allow-delete-comparison","allow-tag-comparison-task-type","allow-get-harness-recommendations","allow-save-panel","allow-update-panel-result","allow-save-file-diffs","allow-get-comparison-diffs","allow-get-panel-diffs","allow-read-permissions","allow-update-permissions","allow-list-security-presets","allow-apply-security-preset","allow-list-required-env","allow-set-keychain-secret","allow-delete-keychain-secret","allow-read-env-config","allow-write-env-config","allow-list-audit-entries","allow-clear-audit-entries","allow-read-file-history","allow-push-file-history","allow-get-history-size","allow-sync-read-file","allow-sync-file-exists","allow-sync-read-dir","allow-sync-write-files","allow-verify-definitions-signature","allow-get-cached-definitions","allow-put-cached-definitions","allow-get-highest-bundle-number","allow-record-bundle-number","allow-apply-surface-transaction","allow-record-transaction","allow-migrate-drift-acknowledgements","allow-acknowledge-drift","allow-unacknowledge-drift","allow-list-drift-acknowledgements","allow-sync-create-backup","allow-sync-list-backups","allow-sync-restore-backup","allow-detect-harnesses","allow-grant-project-scope","allow-choose-project-dir","allow-guarded-write-file","allow-guarded-rename-file","allow-guarded-remove-file","allow-acknowledge-drift-item","allow-unacknowledge-drift-item","allow-get-acknowledged-drift-items","allow-get-system-info","allow-submit-feedback"]}} \ No newline at end of file +{"default":{"identifier":"default","description":"Default capability β€” grants core API, read access to harness config roots under $HOME (the Machine-observation paths .claude.json, the exact Claude Desktop / VS Code User config files the surface registry declares, .copilot and .agents are reachable only by the read, read-dir and exists permissions), mkdir and lstat inside the fs scope, and shell open. No shell execute, spawn, stdin or kill: production code runs processes from Rust only. fs write, rename and remove are not granted to the webview; they go through guarded_write_file, guarded_rename_file and guarded_remove_file, which write and rename only the engine's .harness-tmp- files, and delete only those and its backups (removing a store moves it to ~/.harness/backups/quarantine/ instead)","local":true,"windows":["main"],"permissions":["core:default","core:window:allow-start-dragging","core:event:allow-listen","core:event:allow-emit","fs:allow-read-text-file","fs:allow-read-dir","fs:allow-exists","fs:allow-lstat","fs:allow-mkdir",{"identifier":"fs:scope","allow":[{"path":"$HOME/CLAUDE.md"},{"path":"$HOME/AGENTS.md"},{"path":"$HOME/.mcp.json"},{"path":"$HOME/.claude"},{"path":"$HOME/.claude/**"},{"path":"$HOME/.cursor"},{"path":"$HOME/.cursor/**"},{"path":"$HOME/.github"},{"path":"$HOME/.github/**"},{"path":"$HOME/.vscode"},{"path":"$HOME/.vscode/**"},{"path":"$HOME/.codex"},{"path":"$HOME/.codex/**"},{"path":"$HOME/.opencode"},{"path":"$HOME/.opencode/**"},{"path":"$HOME/.config/opencode"},{"path":"$HOME/.config/opencode/**"},{"path":"$HOME/.windsurf"},{"path":"$HOME/.windsurf/**"},{"path":"$HOME/.gemini"},{"path":"$HOME/.gemini/**"},{"path":"$HOME/.junie"},{"path":"$HOME/.junie/**"},{"path":"$HOME/.pi"},{"path":"$HOME/.pi/**"},{"path":"$HOME/.harness-kit"},{"path":"$HOME/.harness-kit/**"},{"path":"$HOME/.harness/backups"},{"path":"$HOME/.harness/backups/**"}]},{"identifier":"fs:allow-read-text-file","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-read-dir","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},{"identifier":"fs:allow-exists","allow":[{"path":"$HOME/.claude.json"},{"path":"$HOME/Library/Application Support/Claude/claude_desktop_config.json"},{"path":"$HOME/AppData/Roaming/Claude/claude_desktop_config.json"},{"path":"$HOME/Library/Application Support/Code/User/mcp.json"},{"path":"$HOME/.config/Code/User/mcp.json"},{"path":"$HOME/AppData/Roaming/Code/User/mcp.json"},{"path":"$HOME/.copilot"},{"path":"$HOME/.copilot/**"},{"path":"$HOME/.agents"},{"path":"$HOME/.agents/**"}]},"dialog:default","dialog:allow-open","dialog:allow-save","shell:default","shell:allow-open","allow-list-installed-plugins","allow-list-marketplaces","allow-check-plugin-updates","allow-uninstall-plugin","allow-read-plugin-tree","allow-read-plugin-file","allow-write-plugin-file","allow-import-plugin-from-path","allow-import-plugin-from-zip","allow-export-plugin-as-zip","allow-export-plugin-to-folder","allow-read-hooks","allow-read-claude-md","allow-write-config-file","allow-read-harness-file","allow-write-harness-file","allow-list-custom-profiles","allow-get-custom-profile","allow-save-custom-profile","allow-delete-custom-profile","allow-list-claude-dir","allow-detect-claude-account","allow-read-stats-cache","allow-list-sessions-summary","allow-read-session-facet","allow-list-active-sessions","allow-read-live-activity","allow-compute-live-stats","allow-read-session-transcript","allow-check-git-repo","allow-check-for-updates","allow-trigger-rebuild","allow-save-evaluation","allow-get-evaluations","allow-update-evaluation-score","allow-create-evaluation-session","allow-get-evaluation-session","allow-reveal-evaluation-session","allow-save-pairwise-vote","allow-get-pairwise-votes","allow-get-pairwise-analytics","allow-delete-pairwise-vote","allow-export-comparison-json","allow-get-comparator-analytics","allow-save-comparison","allow-update-comparison-title","allow-update-comparison-status","allow-list-comparisons","allow-get-comparison","allow-delete-comparison","allow-tag-comparison-task-type","allow-get-harness-recommendations","allow-save-panel","allow-update-panel-result","allow-save-file-diffs","allow-get-comparison-diffs","allow-get-panel-diffs","allow-read-permissions","allow-update-permissions","allow-list-security-presets","allow-apply-security-preset","allow-list-required-env","allow-set-keychain-secret","allow-delete-keychain-secret","allow-read-env-config","allow-write-env-config","allow-list-audit-entries","allow-clear-audit-entries","allow-read-file-history","allow-push-file-history","allow-get-history-size","allow-sync-read-file","allow-sync-file-exists","allow-sync-read-dir","allow-sync-write-files","allow-verify-definitions-signature","allow-get-cached-definitions","allow-put-cached-definitions","allow-get-highest-bundle-number","allow-record-bundle-number","allow-apply-surface-transaction","allow-record-transaction","allow-list-changes","allow-undo-change","allow-migrate-drift-acknowledgements","allow-acknowledge-drift","allow-unacknowledge-drift","allow-list-drift-acknowledgements","allow-sync-create-backup","allow-sync-list-backups","allow-sync-restore-backup","allow-detect-harnesses","allow-grant-project-scope","allow-choose-project-dir","allow-guarded-write-file","allow-guarded-rename-file","allow-guarded-remove-file","allow-acknowledge-drift-item","allow-unacknowledge-drift-item","allow-get-acknowledged-drift-items","allow-get-system-info","allow-submit-feedback"]}} \ No newline at end of file diff --git a/apps/desktop/src-tauri/gen/schemas/desktop-schema.json b/apps/desktop/src-tauri/gen/schemas/desktop-schema.json index 32195a7b..bb49c471 100644 --- a/apps/desktop/src-tauri/gen/schemas/desktop-schema.json +++ b/apps/desktop/src-tauri/gen/schemas/desktop-schema.json @@ -2480,6 +2480,12 @@ "const": "allow-list-audit-entries", "markdownDescription": "Enables the list_audit_entries command without any pre-configured scope." }, + { + "description": "Enables the list_changes command without any pre-configured scope.", + "type": "string", + "const": "allow-list-changes", + "markdownDescription": "Enables the list_changes command without any pre-configured scope." + }, { "description": "Enables the list_claude_dir command without any pre-configured scope.", "type": "string", @@ -2684,12 +2690,6 @@ "const": "allow-save-panel", "markdownDescription": "Enables the save_panel command without any pre-configured scope." }, - { - "description": "Enables the scan_claude_config command without any pre-configured scope.", - "type": "string", - "const": "allow-scan-claude-config", - "markdownDescription": "Enables the scan_claude_config command without any pre-configured scope." - }, { "description": "Enables the set_keychain_secret command without any pre-configured scope.", "type": "string", @@ -2768,6 +2768,12 @@ "const": "allow-unacknowledge-drift-item", "markdownDescription": "Enables the unacknowledge_drift_item command without any pre-configured scope." }, + { + "description": "Enables the undo_change command without any pre-configured scope.", + "type": "string", + "const": "allow-undo-change", + "markdownDescription": "Enables the undo_change command without any pre-configured scope." + }, { "description": "Enables the uninstall_plugin command without any pre-configured scope.", "type": "string", @@ -3104,6 +3110,12 @@ "const": "deny-list-audit-entries", "markdownDescription": "Denies the list_audit_entries command without any pre-configured scope." }, + { + "description": "Denies the list_changes command without any pre-configured scope.", + "type": "string", + "const": "deny-list-changes", + "markdownDescription": "Denies the list_changes command without any pre-configured scope." + }, { "description": "Denies the list_claude_dir command without any pre-configured scope.", "type": "string", @@ -3308,12 +3320,6 @@ "const": "deny-save-panel", "markdownDescription": "Denies the save_panel command without any pre-configured scope." }, - { - "description": "Denies the scan_claude_config command without any pre-configured scope.", - "type": "string", - "const": "deny-scan-claude-config", - "markdownDescription": "Denies the scan_claude_config command without any pre-configured scope." - }, { "description": "Denies the set_keychain_secret command without any pre-configured scope.", "type": "string", @@ -3392,6 +3398,12 @@ "const": "deny-unacknowledge-drift-item", "markdownDescription": "Denies the unacknowledge_drift_item command without any pre-configured scope." }, + { + "description": "Denies the undo_change command without any pre-configured scope.", + "type": "string", + "const": "deny-undo-change", + "markdownDescription": "Denies the undo_change command without any pre-configured scope." + }, { "description": "Denies the uninstall_plugin command without any pre-configured scope.", "type": "string", diff --git a/apps/desktop/src-tauri/gen/schemas/linux-schema.json b/apps/desktop/src-tauri/gen/schemas/linux-schema.json index 99f13f00..1510ea9c 100644 --- a/apps/desktop/src-tauri/gen/schemas/linux-schema.json +++ b/apps/desktop/src-tauri/gen/schemas/linux-schema.json @@ -2762,12 +2762,6 @@ "const": "allow-save-panel", "markdownDescription": "Enables the save_panel command without any pre-configured scope." }, - { - "description": "Enables the scan_claude_config command without any pre-configured scope.", - "type": "string", - "const": "allow-scan-claude-config", - "markdownDescription": "Enables the scan_claude_config command without any pre-configured scope." - }, { "description": "Enables the set_keychain_secret command without any pre-configured scope.", "type": "string", @@ -3470,12 +3464,6 @@ "const": "deny-save-panel", "markdownDescription": "Denies the save_panel command without any pre-configured scope." }, - { - "description": "Denies the scan_claude_config command without any pre-configured scope.", - "type": "string", - "const": "deny-scan-claude-config", - "markdownDescription": "Denies the scan_claude_config command without any pre-configured scope." - }, { "description": "Denies the set_keychain_secret command without any pre-configured scope.", "type": "string", diff --git a/apps/desktop/src-tauri/gen/schemas/macOS-schema.json b/apps/desktop/src-tauri/gen/schemas/macOS-schema.json index 32195a7b..bb49c471 100644 --- a/apps/desktop/src-tauri/gen/schemas/macOS-schema.json +++ b/apps/desktop/src-tauri/gen/schemas/macOS-schema.json @@ -2480,6 +2480,12 @@ "const": "allow-list-audit-entries", "markdownDescription": "Enables the list_audit_entries command without any pre-configured scope." }, + { + "description": "Enables the list_changes command without any pre-configured scope.", + "type": "string", + "const": "allow-list-changes", + "markdownDescription": "Enables the list_changes command without any pre-configured scope." + }, { "description": "Enables the list_claude_dir command without any pre-configured scope.", "type": "string", @@ -2684,12 +2690,6 @@ "const": "allow-save-panel", "markdownDescription": "Enables the save_panel command without any pre-configured scope." }, - { - "description": "Enables the scan_claude_config command without any pre-configured scope.", - "type": "string", - "const": "allow-scan-claude-config", - "markdownDescription": "Enables the scan_claude_config command without any pre-configured scope." - }, { "description": "Enables the set_keychain_secret command without any pre-configured scope.", "type": "string", @@ -2768,6 +2768,12 @@ "const": "allow-unacknowledge-drift-item", "markdownDescription": "Enables the unacknowledge_drift_item command without any pre-configured scope." }, + { + "description": "Enables the undo_change command without any pre-configured scope.", + "type": "string", + "const": "allow-undo-change", + "markdownDescription": "Enables the undo_change command without any pre-configured scope." + }, { "description": "Enables the uninstall_plugin command without any pre-configured scope.", "type": "string", @@ -3104,6 +3110,12 @@ "const": "deny-list-audit-entries", "markdownDescription": "Denies the list_audit_entries command without any pre-configured scope." }, + { + "description": "Denies the list_changes command without any pre-configured scope.", + "type": "string", + "const": "deny-list-changes", + "markdownDescription": "Denies the list_changes command without any pre-configured scope." + }, { "description": "Denies the list_claude_dir command without any pre-configured scope.", "type": "string", @@ -3308,12 +3320,6 @@ "const": "deny-save-panel", "markdownDescription": "Denies the save_panel command without any pre-configured scope." }, - { - "description": "Denies the scan_claude_config command without any pre-configured scope.", - "type": "string", - "const": "deny-scan-claude-config", - "markdownDescription": "Denies the scan_claude_config command without any pre-configured scope." - }, { "description": "Denies the set_keychain_secret command without any pre-configured scope.", "type": "string", @@ -3392,6 +3398,12 @@ "const": "deny-unacknowledge-drift-item", "markdownDescription": "Denies the unacknowledge_drift_item command without any pre-configured scope." }, + { + "description": "Denies the undo_change command without any pre-configured scope.", + "type": "string", + "const": "deny-undo-change", + "markdownDescription": "Denies the undo_change command without any pre-configured scope." + }, { "description": "Denies the uninstall_plugin command without any pre-configured scope.", "type": "string", diff --git a/apps/desktop/src-tauri/permissions/autogenerated/list_changes.toml b/apps/desktop/src-tauri/permissions/autogenerated/list_changes.toml new file mode 100644 index 00000000..103b7931 --- /dev/null +++ b/apps/desktop/src-tauri/permissions/autogenerated/list_changes.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-list-changes" +description = "Enables the list_changes command without any pre-configured scope." +commands.allow = ["list_changes"] + +[[permission]] +identifier = "deny-list-changes" +description = "Denies the list_changes command without any pre-configured scope." +commands.deny = ["list_changes"] diff --git a/apps/desktop/src-tauri/permissions/autogenerated/scan_claude_config.toml b/apps/desktop/src-tauri/permissions/autogenerated/scan_claude_config.toml deleted file mode 100644 index 528e0794..00000000 --- a/apps/desktop/src-tauri/permissions/autogenerated/scan_claude_config.toml +++ /dev/null @@ -1,11 +0,0 @@ -# Automatically generated - DO NOT EDIT! - -[[permission]] -identifier = "allow-scan-claude-config" -description = "Enables the scan_claude_config command without any pre-configured scope." -commands.allow = ["scan_claude_config"] - -[[permission]] -identifier = "deny-scan-claude-config" -description = "Denies the scan_claude_config command without any pre-configured scope." -commands.deny = ["scan_claude_config"] diff --git a/apps/desktop/src-tauri/permissions/autogenerated/undo_change.toml b/apps/desktop/src-tauri/permissions/autogenerated/undo_change.toml new file mode 100644 index 00000000..5ab36cd4 --- /dev/null +++ b/apps/desktop/src-tauri/permissions/autogenerated/undo_change.toml @@ -0,0 +1,11 @@ +# Automatically generated - DO NOT EDIT! + +[[permission]] +identifier = "allow-undo-change" +description = "Enables the undo_change command without any pre-configured scope." +commands.allow = ["undo_change"] + +[[permission]] +identifier = "deny-undo-change" +description = "Denies the undo_change command without any pre-configured scope." +commands.deny = ["undo_change"] diff --git a/apps/desktop/src-tauri/src/commands/changes.rs b/apps/desktop/src-tauri/src/commands/changes.rs new file mode 100644 index 00000000..16217117 --- /dev/null +++ b/apps/desktop/src-tauri/src/commands/changes.rs @@ -0,0 +1,987 @@ +//! The "Changes" list in Settings β€Ί Activity: what the app changed on this +//! machine, newest first, with Undo for each change that can still be undone. +//! +//! The ledger (`transactions` in harness.db) is an index; the rollback data is +//! the manifest the transaction engine wrote at `~/.harness/backups// +//! transaction.json`, which holds every file's content before and after. +//! +//! The webview is not trusted, so both commands take as little from it as +//! possible. `list_changes` takes a row limit. `undo_change` takes a +//! transaction id and nothing else: the paths, the contents and the +//! preconditions all come from the ledger row and the manifest it names, and +//! every one is checked here before any file is touched: +//! +//! - the row's manifest must sit at `.harness/backups//transaction.json` +//! under the real home directory, with no symlink on the way and a size cap; +//! - the manifest must be committed (not already undone, not half-applied); +//! - every file must be home-rooted and a config store the surface registry +//! declares (`is_declared_store`), the same allowlist `apply_surface_ +//! transaction` enforces, and never anything under `.harness/`; +//! - every file must still hold exactly what the change left there. A file +//! edited since is refused with the write command's own "changed on disk" +//! message, and because the writes go through `apply_surface_transaction_in` +//! all preconditions are checked before the first file is written. +//! +//! A forged ledger row or manifest therefore buys an attacker nothing the +//! webview could not already do with `apply_surface_transaction`: the same +//! allowlist applies, plus a digest that must match what is on disk. + +use super::harness_state::{list_transactions_at, state_path, TransactionRecord}; +use super::surface_write::{ + apply_surface_transaction_in, is_declared_store, precondition_digest, SurfaceFileWrite, + ABSENT_SENTINEL, +}; +use crate::db::Db; +use serde::{Deserialize, Serialize}; +use std::path::Path; +use tauri::State; + +const DEFAULT_LIMIT: i64 = 50; +const MAX_LIMIT: i64 = 200; +const MAX_MANIFEST_BYTES: u64 = 8 * 1024 * 1024; +const MAX_FILES_PER_CHANGE: usize = 256; +const MAX_ID_BYTES: usize = 4096; + +const PROJECT_CHANGE: &str = + "This change was made in a project folder. Undo it from that project."; + +/// One row of the Changes list. +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ChangeEntry { + pub transaction_id: String, + pub applied_at: String, + pub surfaces: Vec, + pub kinds: Vec, + pub identity_keys: Vec, + /// Home-relative paths the change touched. + pub files: Vec, + /// The surface a Machine copy came from, when this change was one. + pub copied_from: Option, + /// `applied`, `undone`, or `unavailable` (the manifest cannot be read). + pub status: String, + pub undoable: bool, + /// Why `undoable` is false, in words for the user. + pub reason: Option, +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct UndoOutcome { + pub transaction_id: String, + /// Home-relative paths put back. + pub files: Vec, + /// Set when the files were restored but the change could not be marked as + /// undone, so the list may still offer Undo for it. + pub warning: Option, +} + +/// An audit entry's text, built in Rust from structured fields. +#[derive(Debug)] +pub(crate) struct AuditDraft { + pub summary: String, + pub details: String, +} + +#[derive(Deserialize)] +struct Manifest { + version: u8, + status: String, + #[serde(default)] + changes: Vec, +} + +#[derive(Deserialize)] +struct ManifestChange { + #[serde(default)] + root: Option, + path: String, + before: Option, + after: Option, +} + +#[tauri::command] +pub fn list_changes(limit: Option) -> Result, String> { + let home = dirs::home_dir().ok_or("Could not resolve home directory")?; + list_changes_at(&state_path()?, &home, limit) +} + +#[tauri::command] +pub fn undo_change(db: State<'_, Db>, transaction_id: String) -> Result { + let home = dirs::home_dir().ok_or("Could not resolve home directory")?; + let (outcome, audit) = undo_change_at(&state_path()?, &home, &transaction_id)?; + super::security::log_audit( + &db, + "change_undone", + "changes", + &audit.summary, + Some(&audit.details), + "user", + ); + Ok(outcome) +} + +/// Path-taking core of [`list_changes`]. A missing database is an empty list, +/// not a reason to create one: this is a read. +pub(crate) fn list_changes_at( + db_path: &Path, + home: &Path, + limit: Option, +) -> Result, String> { + if !db_path.exists() { + return Ok(Vec::new()); + } + let limit = limit.unwrap_or(DEFAULT_LIMIT).clamp(0, MAX_LIMIT); + let records = list_transactions_at(db_path, Some(limit))?; + Ok(records + .into_iter() + .map(|record| entry_for(home, record)) + .collect()) +} + +fn entry_for(home: &Path, record: TransactionRecord) -> ChangeEntry { + let (status, undoable, reason, files) = match read_manifest(home, &record) { + Ok((manifest, _)) => { + let files = manifest.changes.iter().map(|c| c.path.clone()).collect(); + match undo_plan(&manifest) { + Ok(_) => ("applied", true, None, files), + Err(why) if manifest.status == "rolled-back" => ("undone", false, Some(why), files), + Err(why) => ("applied", false, Some(why), files), + } + } + Err(why) => ("unavailable", false, Some(why), Vec::new()), + }; + ChangeEntry { + transaction_id: record.transaction_id, + applied_at: record.applied_at, + surfaces: record.surfaces, + kinds: record.kinds, + identity_keys: record.identity_keys, + files, + copied_from: record.copied_from, + status: status.to_string(), + undoable, + reason, + } +} + +/// The manifest a ledger row points at, with the bytes it was read from. +fn read_manifest(home: &Path, record: &TransactionRecord) -> Result<(Manifest, Vec), String> { + let relative = manifest_relative(home, record)?; + let canonical_home = home + .canonicalize() + .map_err(|e| format!("Could not resolve the home directory: {}", e))?; + // No symlink at any component, the file itself included: the manifest is + // read as the source of what to write, so a planted link must not choose it. + let mut walked = canonical_home; + for segment in relative.split('/') { + walked = walked.join(segment); + match std::fs::symlink_metadata(&walked) { + Ok(meta) if meta.file_type().is_symlink() => { + return Err("The record for this change is not a regular file.".to_string()); + } + Ok(_) => {} + Err(_) => return Err("The backup for this change is no longer on disk.".to_string()), + } + } + let meta = std::fs::metadata(&walked) + .map_err(|_| "The backup for this change is no longer on disk.".to_string())?; + if !meta.is_file() || meta.len() > MAX_MANIFEST_BYTES { + return Err("The record for this change is not a regular file of a sane size.".to_string()); + } + let bytes = std::fs::read(&walked) + .map_err(|e| format!("Could not read the backup for this change: {}", e))?; + let manifest: Manifest = serde_json::from_slice(&bytes) + .map_err(|_| "The backup for this change could not be read.".to_string())?; + Ok((manifest, bytes)) +} + +/// The home-relative manifest path, after checking the row's claim about it. +fn manifest_relative(home: &Path, record: &TransactionRecord) -> Result { + let canonical_home = home + .canonicalize() + .map_err(|e| format!("Could not resolve the home directory: {}", e))?; + let root = Path::new(&record.manifest_root) + .canonicalize() + .map_err(|_| PROJECT_CHANGE.to_string())?; + if root != canonical_home { + return Err(PROJECT_CHANGE.to_string()); + } + let relative = record.manifest_path.replace('\\', "/"); + let parts: Vec<&str> = relative.split('/').collect(); + let shaped = parts.len() == 4 + && parts[0] == ".harness" + && parts[1] == "backups" + && parts[3] == "transaction.json"; + if !shaped || !is_declared_store(&relative) { + return Err("The record for this change points outside the app's backup folder.".to_string()); + } + Ok(relative) +} + +/// The writes that put every file back, or why this change cannot be undone. +/// Each write carries the digest of what the change left on disk, so a file +/// edited since refuses the whole undo. +fn undo_plan(manifest: &Manifest) -> Result, String> { + match manifest.status.as_str() { + "committed" => {} + "rolled-back" => return Err("Already undone.".to_string()), + _ => return Err("This change did not finish, so there is nothing to undo.".to_string()), + } + if manifest.version != 1 && manifest.version != 2 { + return Err("This change was made by a newer version of the app.".to_string()); + } + if manifest.changes.is_empty() { + return Err("This change touched no files.".to_string()); + } + if manifest.changes.len() > MAX_FILES_PER_CHANGE { + return Err("This change touched too many files to undo here.".to_string()); + } + let mut writes = Vec::with_capacity(manifest.changes.len()); + for change in &manifest.changes { + // A v1 manifest has no root: every file in it was project-rooted. + if change.root.as_deref() != Some("home") { + return Err(PROJECT_CHANGE.to_string()); + } + let path = change.path.replace('\\', "/"); + if path.starts_with(".harness/") || !is_declared_store(&path) { + return Err(format!( + "{} is not a config store the app manages, so it will not be touched.", + change.path + )); + } + writes.push(SurfaceFileWrite { + relative_path: path, + content: change.before.clone(), + expected_sha256: Some(match &change.after { + Some(after) => precondition_digest(after.as_bytes()), + None => ABSENT_SENTINEL.to_string(), + }), + }); + } + Ok(writes) +} + +/// Path-taking core of [`undo_change`]. +pub(crate) fn undo_change_at( + db_path: &Path, + home: &Path, + transaction_id: &str, +) -> Result<(UndoOutcome, AuditDraft), String> { + if transaction_id.trim().is_empty() || transaction_id.len() > MAX_ID_BYTES { + return Err("No recorded change has that id.".to_string()); + } + if !db_path.exists() { + return Err("No recorded change has that id.".to_string()); + } + let record = list_transactions_at(db_path, None)? + .into_iter() + .find(|record| record.transaction_id == transaction_id) + .ok_or_else(|| "No recorded change has that id.".to_string())?; + + let (manifest, bytes) = read_manifest(home, &record)?; + let writes = undo_plan(&manifest)?; + let files: Vec = writes.iter().map(|w| w.relative_path.clone()).collect(); + apply_surface_transaction_in(home, writes)?; + + // Mark the manifest so the list stops offering Undo. The digest is of the + // bytes read above: a manifest rewritten in between is left alone. + let warning = mark_undone(home, &record, &bytes).err().map(|why| { + format!("The files were restored, but the change could not be marked as undone: {}", why) + }); + + let audit = undo_audit_entry(&record, &files); + Ok(( + UndoOutcome { transaction_id: record.transaction_id, files, warning }, + audit, + )) +} + +fn mark_undone(home: &Path, record: &TransactionRecord, bytes: &[u8]) -> Result<(), String> { + let relative = manifest_relative(home, record)?; + let mut document: serde_json::Value = + serde_json::from_slice(bytes).map_err(|e| e.to_string())?; + document["status"] = serde_json::Value::String("rolled-back".to_string()); + let text = format!( + "{}\n", + serde_json::to_string_pretty(&document).map_err(|e| e.to_string())? + ); + apply_surface_transaction_in( + home, + vec![SurfaceFileWrite { + relative_path: relative, + content: Some(text), + expected_sha256: Some(precondition_digest(bytes)), + }], + ) + .map(|_| ()) +} + +// ── Audit text ───────────────────────────────────────────────── +// +// Built here from structured fields. The webview supplies ids (surface, +// kind, name) that are length-checked and stripped of control characters; +// it never supplies a sentence. + +const MAX_AUDIT_TOKEN: usize = 120; + +fn clean(text: &str) -> String { + text.chars() + .filter(|c| !c.is_control()) + .take(MAX_AUDIT_TOKEN) + .collect() +} + +fn is_surface_id(text: &str) -> bool { + !text.is_empty() + && text.len() <= 64 + && text + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_' || c == '.') +} + +/// The surface registry's ids (`SURFACE_IDS` in packages/core/src/surfaces/ +/// types.ts). Rust cannot read the TypeScript registry, so a vitest test +/// (`surface-ids-rust.test.ts`) fails if this list drifts from it. +pub(crate) const SURFACE_IDS: [&str; 11] = [ + "claude-code", + "claude-desktop", + "copilot-vscode", + "copilot-cli", + "codex", + "cursor", + "pi", + "opencode", + "windsurf", + "gemini", + "junie", +]; + +/// Every surface a webview-supplied record names must be a registry id. +pub(crate) fn check_surfaces(record: &TransactionRecord) -> Result<(), String> { + let known = |id: &str| SURFACE_IDS.contains(&id); + if let Some(from) = &record.copied_from { + if !known(from) { + return Err("copiedFrom is not a surface the registry declares".to_string()); + } + } + if record.surfaces.iter().any(|s| !known(s)) { + return Err("surfaces names a surface the registry does not declare".to_string()); + } + Ok(()) +} + +/// A copy's audit entry is written only when the engine's manifest for this +/// transaction is on disk and committed. The row's own claims are checked with +/// the same pinned-path rules Undo uses, and the manifest must sit in the +/// folder named for the transaction, so one real manifest cannot back a +/// second, invented transaction id. +pub(crate) fn require_committed_manifest(home: &Path, record: &TransactionRecord) -> Result<(), String> { + let relative = manifest_relative(home, record)?; + let folder = relative.split('/').nth(2).unwrap_or_default(); + if folder != record.transaction_id { + return Err("The manifest does not belong to this transaction.".to_string()); + } + let (manifest, _) = read_manifest(home, record)?; + if manifest.status != "committed" { + return Err("The transaction is not committed, so no copy is recorded.".to_string()); + } + Ok(()) +} + +/// What a change was about, for a sentence: `mcp-server github`, or a count. +fn describe(record: &TransactionRecord) -> String { + let names: Vec = record + .identity_keys + .iter() + .map(|key| clean(&key.replacen(':', " ", 1))) + .collect(); + match names.len() { + 0 => "a resource".to_string(), + 1..=3 => names.join(", "), + n => format!("{}, and {} more", names[..3].join(", "), n - 3), + } +} + +fn targets(record: &TransactionRecord) -> String { + let surfaces: Vec = record.surfaces.iter().map(|s| clean(s)).collect(); + surfaces.join(", ") +} + +/// The audit entry for a Machine copy, or `None` when the record is not one. +/// A record that names a source but is not shaped like a copy is an error, so +/// the log never says something the app did not do. +pub(crate) fn copy_audit_entry(record: &TransactionRecord) -> Result, String> { + let Some(from) = &record.copied_from else { + return Ok(None); + }; + if !is_surface_id(from) { + return Err("copiedFrom must be a surface id".to_string()); + } + if record.surfaces.is_empty() { + return Err("a copy must name the surface it went to".to_string()); + } + let to = targets(record); + Ok(Some(AuditDraft { + summary: format!("Copied {} from {} to {}", describe(record), from, to), + details: serde_json::json!({ + "transactionId": record.transaction_id, + "from": from, + "to": record.surfaces, + "kinds": record.kinds, + "identityKeys": record.identity_keys, + "appliedAt": record.applied_at, + }) + .to_string(), + })) +} + +fn undo_audit_entry(record: &TransactionRecord, files: &[String]) -> AuditDraft { + let on = targets(record); + let summary = if on.is_empty() { + format!("Undid the change to {}", describe(record)) + } else { + format!("Undid the change to {} on {}", describe(record), on) + }; + AuditDraft { + summary, + details: serde_json::json!({ + "transactionId": record.transaction_id, + "appliedAt": record.applied_at, + "files": files, + }) + .to_string(), + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::commands::harness_state::{record_transaction_at, record_transaction_audited}; + use crate::commands::surface_write::{apply_and_note_commits, set_test_home, CommittedTransactions}; + use std::fs; + use std::path::PathBuf; + + /// `record_transaction_audited` for a record whose apply "happened" in this + /// session: its id is in the committed set. + fn audited(db: &Db, f: &Fixture, row: TransactionRecord) -> Result<(), String> { + let committed = CommittedTransactions::default(); + committed.insert(&row.transaction_id); + record_transaction_audited(db, &committed, f.home.path(), &f.db, row) + } + + struct Fixture { + home: tempfile::TempDir, + db: PathBuf, + } + + fn fixture() -> Fixture { + let home = tempfile::tempdir().unwrap(); + set_test_home(home.path()); + let db = home.path().join("state.db"); + Fixture { home, db } + } + + fn record(f: &Fixture, id: &str, applied_at: &str) -> TransactionRecord { + TransactionRecord { + transaction_id: id.to_string(), + applied_at: applied_at.to_string(), + roots: vec!["home".to_string()], + manifest_path: format!(".harness/backups/{id}/transaction.json"), + manifest_root: f.home.path().to_string_lossy().into_owned(), + backup_dir: format!(".harness/backups/{id}"), + surfaces: vec!["codex".to_string()], + kinds: vec!["mcp-server".to_string()], + identity_keys: vec!["mcp-server:github".to_string()], + copied_from: None, + } + } + + fn write(f: &Fixture, relative: &str, content: &str) { + let path = f.home.path().join(relative); + fs::create_dir_all(path.parent().unwrap()).unwrap(); + fs::write(path, content).unwrap(); + } + + fn read(f: &Fixture, relative: &str) -> Option { + fs::read_to_string(f.home.path().join(relative)).ok() + } + + /// A committed change: the manifest on disk, the file holding `after`, and + /// the ledger row. + fn commit(f: &Fixture, id: &str, applied_at: &str, path: &str, before: Option<&str>, after: &str) { + let manifest = serde_json::json!({ + "version": 2, + "timestamp": id, + "status": "committed", + "changes": [{ "root": "home", "path": path, "before": before, "after": after }], + }); + write(f, &format!(".harness/backups/{id}/transaction.json"), &manifest.to_string()); + write(f, path, after); + record_transaction_at(&f.db, record(f, id, applied_at)).unwrap(); + } + + #[test] + fn lists_changes_newest_first_with_their_files() { + let f = fixture(); + commit(&f, "a", "2026-11-01T10:00:00.000Z", ".claude.json", Some("{}"), "{\"a\":1}"); + commit(&f, "b", "2026-11-02T10:00:00.000Z", ".codex/config.toml", None, "x = 1\n"); + + let listed = list_changes_at(&f.db, f.home.path(), None).unwrap(); + let ids: Vec<&str> = listed.iter().map(|e| e.transaction_id.as_str()).collect(); + assert_eq!(ids, ["b", "a"]); + assert_eq!(listed[0].files, [".codex/config.toml"]); + assert_eq!(listed[0].surfaces, ["codex"]); + assert_eq!(listed[0].status, "applied"); + assert!(listed[0].undoable); + assert!(listed[0].reason.is_none()); + } + + #[test] + fn a_limit_caps_the_list() { + let f = fixture(); + commit(&f, "a", "2026-11-01T10:00:00.000Z", ".claude.json", Some("{}"), "{\"a\":1}"); + commit(&f, "b", "2026-11-02T10:00:00.000Z", ".claude.json", Some("{\"a\":1}"), "{\"a\":2}"); + assert_eq!(list_changes_at(&f.db, f.home.path(), Some(1)).unwrap().len(), 1); + assert!(list_changes_at(&f.db, f.home.path(), Some(-5)).unwrap().is_empty()); + } + + #[test] + fn listing_without_a_database_is_empty_and_creates_nothing() { + let f = fixture(); + assert!(list_changes_at(&f.db, f.home.path(), None).unwrap().is_empty()); + assert!(!f.db.exists(), "a read created the state database"); + } + + #[test] + fn a_change_whose_backup_is_gone_is_listed_as_unavailable() { + let f = fixture(); + record_transaction_at(&f.db, record(&f, "gone", "2026-11-01T10:00:00.000Z")).unwrap(); + let listed = list_changes_at(&f.db, f.home.path(), None).unwrap(); + assert_eq!(listed[0].status, "unavailable"); + assert!(!listed[0].undoable); + assert!(listed[0].reason.as_deref().unwrap().contains("no longer on disk")); + } + + #[test] + fn a_project_change_is_listed_but_not_undoable_here() { + let f = fixture(); + let elsewhere = tempfile::tempdir().unwrap(); + let mut row = record(&f, "proj", "2026-11-01T10:00:00.000Z"); + row.manifest_root = elsewhere.path().to_string_lossy().into_owned(); + record_transaction_at(&f.db, row).unwrap(); + let listed = list_changes_at(&f.db, f.home.path(), None).unwrap(); + assert!(!listed[0].undoable); + assert_eq!(listed[0].reason.as_deref(), Some(PROJECT_CHANGE)); + } + + #[test] + fn undo_puts_the_file_back_and_marks_the_change_undone() { + let f = fixture(); + commit(&f, "a", "2026-11-01T10:00:00.000Z", ".claude.json", Some("{\"old\":true}"), "{\"new\":true}"); + + let (outcome, audit) = undo_change_at(&f.db, f.home.path(), "a").unwrap(); + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"old\":true}")); + assert_eq!(outcome.files, [".claude.json"]); + assert!(outcome.warning.is_none()); + assert!(audit.summary.contains("mcp-server github"), "{}", audit.summary); + + let listed = list_changes_at(&f.db, f.home.path(), None).unwrap(); + assert_eq!(listed[0].status, "undone"); + assert!(!listed[0].undoable); + + // A second Undo is refused and writes nothing. + let again = undo_change_at(&f.db, f.home.path(), "a").unwrap_err(); + assert!(again.contains("Already undone"), "{again}"); + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"old\":true}")); + } + + #[test] + fn undo_removes_a_file_the_change_created() { + let f = fixture(); + commit(&f, "c", "2026-11-01T10:00:00.000Z", ".codex/config.toml", None, "x = 1\n"); + undo_change_at(&f.db, f.home.path(), "c").unwrap(); + assert_eq!(read(&f, ".codex/config.toml"), None); + } + + #[test] + fn undo_refuses_when_the_file_changed_since_and_writes_nothing() { + let f = fixture(); + commit(&f, "a", "2026-11-01T10:00:00.000Z", ".claude.json", Some("{\"old\":true}"), "{\"new\":true}"); + write(&f, ".claude.json", "{\"edited\":\"by hand\"}"); + + let error = undo_change_at(&f.db, f.home.path(), "a").unwrap_err(); + assert!(error.contains("changed on disk"), "{error}"); + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"edited\":\"by hand\"}")); + // Still offered: the user can fix the file and try again. + let listed = list_changes_at(&f.db, f.home.path(), None).unwrap(); + assert_eq!(listed[0].status, "applied"); + } + + #[test] + fn one_changed_file_stops_the_undo_of_every_file() { + let f = fixture(); + let manifest = serde_json::json!({ + "version": 2, "timestamp": "m", "status": "committed", + "changes": [ + { "root": "home", "path": ".claude.json", "before": "{}", "after": "{\"a\":1}" }, + { "root": "home", "path": ".codex/config.toml", "before": "", "after": "x = 1\n" }, + ], + }); + write(&f, ".harness/backups/m/transaction.json", &manifest.to_string()); + write(&f, ".claude.json", "{\"a\":1}"); + write(&f, ".codex/config.toml", "x = 2\n"); + record_transaction_at(&f.db, record(&f, "m", "2026-11-01T10:00:00.000Z")).unwrap(); + + assert!(undo_change_at(&f.db, f.home.path(), "m").is_err()); + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"a\":1}")); + } + + #[test] + fn undo_refuses_an_unknown_or_empty_id() { + let f = fixture(); + commit(&f, "a", "2026-11-01T10:00:00.000Z", ".claude.json", Some("{}"), "{\"a\":1}"); + for id in ["nope", "", " ", &"x".repeat(MAX_ID_BYTES + 1)] { + let error = undo_change_at(&f.db, f.home.path(), id).unwrap_err(); + assert!(error.contains("No recorded change"), "{id:?}: {error}"); + } + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"a\":1}")); + } + + #[test] + fn undo_with_no_database_is_refused() { + let f = fixture(); + assert!(undo_change_at(&f.db, f.home.path(), "a").is_err()); + assert!(!f.db.exists()); + } + + #[test] + fn undo_refuses_a_row_whose_manifest_path_leaves_the_backup_folder() { + let f = fixture(); + write(&f, "outside/transaction.json", "{}"); + for (i, path) in [ + "../outside/transaction.json", + ".harness/backups/../../outside/transaction.json", + ".harness/harness.db", + "outside/transaction.json", + ".harness/backups/a/b/transaction.json", + ] + .iter() + .enumerate() + { + let id = format!("evil{i}"); + let mut row = record(&f, &id, "2026-11-01T10:00:00.000Z"); + row.manifest_path = path.to_string(); + record_transaction_at(&f.db, row).unwrap(); + let error = undo_change_at(&f.db, f.home.path(), &id).unwrap_err(); + assert!(error.contains("outside the app's backup folder"), "{path}: {error}"); + } + } + + #[test] + fn undo_refuses_a_manifest_that_names_a_file_the_app_does_not_manage() { + let f = fixture(); + for path in [".ssh/authorized_keys", ".harness/harness.db", "../escape", ".zshrc"] { + let manifest = serde_json::json!({ + "version": 2, "timestamp": "e", "status": "committed", + "changes": [{ "root": "home", "path": path, "before": "evil", "after": "x" }], + }); + write(&f, ".harness/backups/e/transaction.json", &manifest.to_string()); + record_transaction_at(&f.db, record(&f, "e", "2026-11-01T10:00:00.000Z")).unwrap(); + let error = undo_change_at(&f.db, f.home.path(), "e").unwrap_err(); + assert!(error.contains("will not be touched"), "{path}: {error}"); + } + assert_eq!(read(&f, ".ssh/authorized_keys"), None); + } + + #[test] + fn undo_refuses_a_project_rooted_manifest() { + let f = fixture(); + let manifest = serde_json::json!({ + "version": 1, "timestamp": "p", "status": "committed", + "changes": [{ "path": ".claude.json", "before": "{}", "after": "{\"a\":1}" }], + }); + write(&f, ".harness/backups/p/transaction.json", &manifest.to_string()); + write(&f, ".claude.json", "{\"a\":1}"); + record_transaction_at(&f.db, record(&f, "p", "2026-11-01T10:00:00.000Z")).unwrap(); + let error = undo_change_at(&f.db, f.home.path(), "p").unwrap_err(); + assert_eq!(error, PROJECT_CHANGE); + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"a\":1}")); + } + + #[test] + fn undo_refuses_a_manifest_that_is_not_committed() { + let f = fixture(); + let manifest = serde_json::json!({ + "version": 2, "timestamp": "n", "status": "prepared", + "changes": [{ "root": "home", "path": ".claude.json", "before": "{}", "after": "{\"a\":1}" }], + }); + write(&f, ".harness/backups/n/transaction.json", &manifest.to_string()); + write(&f, ".claude.json", "{\"a\":1}"); + record_transaction_at(&f.db, record(&f, "n", "2026-11-01T10:00:00.000Z")).unwrap(); + let error = undo_change_at(&f.db, f.home.path(), "n").unwrap_err(); + assert!(error.contains("did not finish"), "{error}"); + } + + #[cfg(unix)] + #[test] + fn undo_refuses_a_manifest_reached_through_a_symlink() { + let f = fixture(); + let elsewhere = tempfile::tempdir().unwrap(); + let manifest = serde_json::json!({ + "version": 2, "timestamp": "s", "status": "committed", + "changes": [{ "root": "home", "path": ".claude.json", "before": "{}", "after": "{\"a\":1}" }], + }); + fs::write(elsewhere.path().join("transaction.json"), manifest.to_string()).unwrap(); + fs::create_dir_all(f.home.path().join(".harness/backups")).unwrap(); + std::os::unix::fs::symlink(elsewhere.path(), f.home.path().join(".harness/backups/s")).unwrap(); + write(&f, ".claude.json", "{\"a\":1}"); + record_transaction_at(&f.db, record(&f, "s", "2026-11-01T10:00:00.000Z")).unwrap(); + assert!(undo_change_at(&f.db, f.home.path(), "s").is_err()); + assert_eq!(read(&f, ".claude.json").as_deref(), Some("{\"a\":1}")); + } + + // ── Audit ────────────────────────────────────────────────── + + fn audit_rows(db: &Db) -> Vec<(String, String, String, String, String)> { + let conn = db.conn.lock().unwrap(); + let mut stmt = conn + .prepare("SELECT event_type, category, summary, details, source FROM audit_log ORDER BY timestamp") + .unwrap(); + stmt.query_map([], |row| { + Ok((row.get(0)?, row.get(1)?, row.get(2)?, row.get::<_, Option>(3)?.unwrap_or_default(), row.get(4)?)) + }) + .unwrap() + .map(Result::unwrap) + .collect() + } + + #[test] + fn a_machine_copy_is_recorded_in_the_audit_log() { + let f = fixture(); + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + let mut row = record(&f, "copy1", "2026-11-03T09:00:00.000Z"); + row.copied_from = Some("claude-code".to_string()); + write_manifest(&f, "copy1", "committed"); + + audited(&db, &f, row).unwrap(); + + let rows = audit_rows(&db); + assert_eq!(rows.len(), 1); + let (event, category, summary, details, source) = &rows[0]; + assert_eq!(event, "machine_copy"); + assert_eq!(category, "changes"); + assert_eq!(summary, "Copied mcp-server github from claude-code to codex"); + assert_eq!(source, "machine"); + let details: serde_json::Value = serde_json::from_str(details).unwrap(); + assert_eq!(details["from"], "claude-code"); + assert_eq!(details["to"][0], "codex"); + assert_eq!(details["transactionId"], "copy1"); + assert_eq!(details["appliedAt"], "2026-11-03T09:00:00.000Z"); + // And the ledger row exists too. + assert_eq!(list_transactions_at(&f.db, None).unwrap().len(), 1); + } + + #[test] + fn a_record_without_a_source_surface_writes_no_audit_entry() { + let f = fixture(); + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + audited(&db, &f, record(&f, "page-save", "2026-11-03T09:00:00.000Z")).unwrap(); + assert!(audit_rows(&db).is_empty()); + assert_eq!(list_transactions_at(&f.db, None).unwrap().len(), 1); + } + + fn write_manifest(f: &Fixture, id: &str, status: &str) { + let manifest = serde_json::json!({ + "version": 2, "timestamp": id, "status": status, + "changes": [{ "root": "home", "path": ".claude.json", "before": null, "after": "{}" }], + }); + write(f, &format!(".harness/backups/{id}/transaction.json"), &manifest.to_string()); + } + + fn copy_row(f: &Fixture, id: &str) -> TransactionRecord { + let mut row = record(f, id, "2026-11-03T09:00:00.000Z"); + row.copied_from = Some("claude-code".to_string()); + row + } + + fn assert_refused_and_unlogged(f: &Fixture, row: TransactionRecord) { + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + assert!(audited(&db, f, row).is_err()); + assert!(audit_rows(&db).is_empty()); + assert!(!f.db.exists() || list_transactions_at(&f.db, None).unwrap().is_empty()); + } + + #[test] + fn a_copy_with_no_manifest_on_disk_is_refused_and_unlogged() { + let f = fixture(); + assert_refused_and_unlogged(&f, copy_row(&f, "forged")); + } + + #[test] + fn a_copy_whose_manifest_is_not_committed_is_refused_and_unlogged() { + for status in ["prepared", "rolled-back"] { + let f = fixture(); + write_manifest(&f, "half", status); + assert_refused_and_unlogged(&f, copy_row(&f, "half")); + } + } + + #[test] + fn a_copy_cannot_borrow_another_transactions_manifest() { + let f = fixture(); + write_manifest(&f, "real", "committed"); + let mut row = copy_row(&f, "forged"); + row.manifest_path = ".harness/backups/real/transaction.json".to_string(); + assert_refused_and_unlogged(&f, row); + } + + #[test] + fn surfaces_the_registry_does_not_know_are_refused() { + let f = fixture(); + write_manifest(&f, "c1", "committed"); + let mut from = copy_row(&f, "c1"); + from.copied_from = Some("not-a-surface".to_string()); + assert_refused_and_unlogged(&f, from); + let mut to = copy_row(&f, "c1"); + to.surfaces = vec!["codex".to_string(), "evil".to_string()]; + assert_refused_and_unlogged(&f, to); + // A plain page-save record names surfaces too, so the check is not copy-only. + let mut plain = record(&f, "c1", "2026-11-03T09:00:00.000Z"); + plain.surfaces = vec!["evil".to_string()]; + assert_refused_and_unlogged(&f, plain); + } + + #[test] + fn a_record_naming_more_surfaces_than_exist_is_refused() { + let f = fixture(); + let mut row = record(&f, "many", "2026-11-03T09:00:00.000Z"); + row.surfaces = vec!["codex".to_string(); 33]; + assert_refused_and_unlogged(&f, row); + } + + #[test] + fn every_registry_surface_id_is_accepted() { + let f = fixture(); + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + let mut row = record(&f, "all", "2026-11-03T09:00:00.000Z"); + row.surfaces = SURFACE_IDS.iter().map(|s| s.to_string()).collect(); + audited(&db, &f, row).unwrap(); + } + + fn webview_write(path: &str, content: &str) -> crate::commands::surface_write::SurfaceFileWrite { + serde_json::from_value(serde_json::json!({ + "relativePath": path, "content": content, "expectedSha256": null + })) + .unwrap() + } + + #[test] + fn a_forged_manifest_without_a_commit_through_apply_cannot_back_a_copy() { + // The webview writes the manifest file straight onto disk (here: + // directly), never through apply_surface_transaction's commit path. + let f = fixture(); + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + write_manifest(&f, "forged", "committed"); + let committed = CommittedTransactions::default(); + let err = record_transaction_audited(&db, &committed, f.home.path(), &f.db, copy_row(&f, "forged")) + .unwrap_err(); + assert!(err.contains("not applied by this app session"), "{err}"); + assert!(audit_rows(&db).is_empty()); + assert!(!f.db.exists() || list_transactions_at(&f.db, None).unwrap().is_empty()); + } + + #[test] + fn only_a_committed_manifest_written_by_apply_marks_the_id() { + let f = fixture(); + let committed = CommittedTransactions::default(); + let manifest = |status: &str| serde_json::json!({ "status": status }).to_string(); + for (path, content) in [ + (".harness/backups/p/transaction.json", manifest("prepared")), + (".harness/backups/q/other.json", manifest("committed")), + (".harness/backups/r/transaction.json", "not json".to_string()), + ] { + apply_and_note_commits(&committed, f.home.path(), vec![webview_write(path, &content)]).unwrap(); + } + assert!(!committed.contains("p") && !committed.contains("q") && !committed.contains("r")); + apply_and_note_commits( + &committed, + f.home.path(), + vec![webview_write(".harness/backups/ok/transaction.json", &manifest("committed"))], + ) + .unwrap(); + assert!(committed.contains("ok")); + } + + #[test] + fn a_failed_apply_marks_nothing() { + let f = fixture(); + let committed = CommittedTransactions::default(); + let body = serde_json::json!({ "status": "committed" }).to_string(); + let result = apply_and_note_commits( + &committed, + f.home.path(), + vec![ + webview_write(".harness/backups/bad/transaction.json", &body), + webview_write("not/a/declared/store", "x"), + ], + ); + assert!(result.is_err()); + assert!(!committed.contains("bad")); + } + + #[test] + fn an_identical_replay_logs_the_audit_entry_once() { + let f = fixture(); + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + write_manifest(&f, "twice", "committed"); + let committed = CommittedTransactions::default(); + committed.insert("twice"); + for _ in 0..2 { + record_transaction_audited(&db, &committed, f.home.path(), &f.db, copy_row(&f, "twice")).unwrap(); + } + assert_eq!(audit_rows(&db).len(), 1); + assert_eq!(list_transactions_at(&f.db, None).unwrap().len(), 1); + } + + #[test] + fn a_malformed_source_surface_refuses_the_record_and_logs_nothing() { + let f = fixture(); + let data = tempfile::tempdir().unwrap(); + let db = crate::db::init(data.path()).unwrap(); + for bad in ["", "a b", "x\ny", &"z".repeat(65), "Copied everything"] { + let mut row = record(&f, "bad", "2026-11-03T09:00:00.000Z"); + row.copied_from = Some(bad.to_string()); + assert!(audited(&db, &f, row).is_err(), "{bad:?}"); + } + assert!(audit_rows(&db).is_empty()); + assert!(!f.db.exists() || list_transactions_at(&f.db, None).unwrap().is_empty()); + } + + #[test] + fn audit_text_strips_control_characters_from_webview_ids() { + let f = fixture(); + let mut row = record(&f, "t", "2026-11-03T09:00:00.000Z"); + row.copied_from = Some("claude-code".to_string()); + row.identity_keys = vec!["mcp-server:evil\n[forged] entry".to_string()]; + let entry = copy_audit_entry(&row).unwrap().unwrap(); + assert!(!entry.summary.contains('\n'), "{}", entry.summary); + } + + #[test] + fn the_copy_source_survives_the_ledger_round_trip() { + let f = fixture(); + write_manifest(&f, "a", "committed"); + let mut row = record(&f, "a", "2026-11-01T10:00:00.000Z"); + row.copied_from = Some("claude-code".to_string()); + record_transaction_at(&f.db, row).unwrap(); + let listed = list_changes_at(&f.db, f.home.path(), None).unwrap(); + assert_eq!(listed[0].copied_from.as_deref(), Some("claude-code")); + } +} diff --git a/apps/desktop/src-tauri/src/commands/fs_scope.rs b/apps/desktop/src-tauri/src/commands/fs_scope.rs index a0990106..a3377987 100644 --- a/apps/desktop/src-tauri/src/commands/fs_scope.rs +++ b/apps/desktop/src-tauri/src/commands/fs_scope.rs @@ -67,9 +67,10 @@ pub(crate) fn is_home_or_ancestor(candidate: &Path, home: &Path) -> bool { /// /// The static capability (capabilities/default.json) only ever lists known /// harness config roots under `$HOME` β€” it intentionally does not grant -/// `$HOME/**`. Fleet/Drift's project scope is an arbitrary directory the user -/// picked via a folder dialog (see SyncPage's `open({ directory: true })` and -/// `getCurrentProjectDir()`), so it can't be listed ahead of time. This +/// `$HOME/**`. The project scope of Machine, Drift and Compile is an arbitrary +/// directory the user picked in the title bar's native folder dialog (see +/// `choose_project_dir` and `getCurrentProjectDir()`), so it can't be listed +/// ahead of time. This /// command extends the runtime scope to cover exactly that directory /// (not retroactively trusting any other path). The scope itself lasts one /// launch, so this must be called again each launch before the project scope diff --git a/apps/desktop/src-tauri/src/commands/harness_file.rs b/apps/desktop/src-tauri/src/commands/harness_file.rs index 5e1a84dc..f30b93d7 100644 --- a/apps/desktop/src-tauri/src/commands/harness_file.rs +++ b/apps/desktop/src-tauri/src/commands/harness_file.rs @@ -14,6 +14,10 @@ pub struct HarnessFileResult { pub found: bool, pub content: Option, pub path: Option, + /// True when `~/.claude/harness.yaml` is absent but a file sits at + /// `~/harness.yaml`, where older builds read it. A boolean only: that file + /// is never read. + pub legacy_home_file: bool, } #[tauri::command] @@ -27,13 +31,11 @@ fn read_harness_file_in(home_raw: &Path) -> Result { // compare correctly against the canonicalized candidate paths below. let home = home_raw.canonicalize().unwrap_or(home_raw); - // Search priority: - // 1. ~/.claude/harness.yaml - // 2. ~/harness.yaml - let candidates = [ - home.join(".claude").join("harness.yaml"), - home.join("harness.yaml"), - ]; + // The personal profile is ~/.claude/harness.yaml and nothing else (AC-55). + // Drift, Profile, Compile and onboarding all read this one path; a + // ~/harness.yaml is not a harness.yaml to any of them, so it is not + // read here either. + let candidates = [home.join(".claude").join("harness.yaml")]; for path in &candidates { // Use canonicalize() as the existence check β€” eliminates the TOCTOU @@ -54,13 +56,21 @@ fn read_harness_file_in(home_raw: &Path) -> Result { found: true, content: Some(content), path: Some(display_path), + legacy_home_file: false, }); } + // Existence only, so the UI can say the file is where it no longer looks. + // Its content is never read. + let legacy_home_file = std::fs::symlink_metadata(home.join("harness.yaml")) + .map(|m| m.is_file()) + .unwrap_or(false); + Ok(HarnessFileResult { found: false, content: None, path: None, + legacy_home_file, }) } @@ -93,58 +103,6 @@ fn write_harness_file_in( Ok("~/.claude/harness.yaml".to_string()) } -/// Scan ~/.claude/ for existing Claude Code configuration that can be used -/// to generate a harness.yaml. -/// -/// Claude Code stores MCP servers in mcp.json (no dot prefix) and -/// permissions in settings.local.json under the `permissions` key. -#[derive(serde::Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ClaudeConfigScan { - /// Raw content of mcp.json / .mcp.json β€” whichever was found first. - pub mcp_servers_json: Option, - /// Raw content of settings.local.json or settings.json β€” whichever was found first. - pub settings_json: Option, - /// Which MCP file was found, for display in the UI. - pub mcp_source: Option, - /// Which settings file was found, for display in the UI. - pub settings_source: Option, -} - -#[tauri::command] -pub fn scan_claude_config() -> Result { - scan_claude_config_in(&home_dir()?) -} - -fn scan_claude_config_in(home: &Path) -> Result { - let claude_dir = home.join(".claude"); - - // MCP servers: mcp.json is the current Claude Code location; .mcp.json is a legacy fallback. - let (mcp_servers_json, mcp_source) = [ - (claude_dir.join("mcp.json"), "~/.claude/mcp.json"), - (claude_dir.join(".mcp.json"), "~/.claude/.mcp.json"), - ] - .into_iter() - .find_map(|(path, label)| { - std::fs::read_to_string(&path).ok().map(|c| (Some(c), Some(label.to_string()))) - }) - .unwrap_or((None, None)); - - // Permissions: settings.local.json has per-user overrides (allow/deny/ask); - // fall back to settings.json for users without a local file. - let (settings_json, settings_source) = [ - (claude_dir.join("settings.local.json"), "~/.claude/settings.local.json"), - (claude_dir.join("settings.json"), "~/.claude/settings.json"), - ] - .into_iter() - .find_map(|(path, label)| { - std::fs::read_to_string(&path).ok().map(|c| (Some(c), Some(label.to_string()))) - }) - .unwrap_or((None, None)); - - Ok(ClaudeConfigScan { mcp_servers_json, settings_json, mcp_source, settings_source }) -} - #[cfg(test)] mod tests { use super::*; @@ -172,12 +130,36 @@ mod tests { } #[test] - fn read_harness_file_falls_back_to_home_root() { + fn read_harness_file_ignores_a_file_at_the_home_root() { let dir = TempDir::new().unwrap(); std::fs::write(dir.path().join("harness.yaml"), "version: \"1\"\n").unwrap(); let result = read_harness_file_in(dir.path()).unwrap(); + assert!(!result.found); + assert!(result.content.is_none()); + } + + #[test] + fn read_harness_file_reports_a_home_root_file_as_existence_only() { + let dir = TempDir::new().unwrap(); + std::fs::write(dir.path().join("harness.yaml"), "secret: x\n").unwrap(); + let result = read_harness_file_in(dir.path()).unwrap(); + assert!(result.legacy_home_file); + // Existence only: the content is never read or returned. + assert!(result.content.is_none()); + let json = serde_json::to_string(&result).unwrap(); + assert!(!json.contains("secret")); + } + + #[test] + fn read_harness_file_reports_no_legacy_file_when_claude_dir_has_one_or_none_exists() { + let dir = TempDir::new().unwrap(); + assert!(!read_harness_file_in(dir.path()).unwrap().legacy_home_file); + std::fs::write(dir.path().join("harness.yaml"), "a: 1\n").unwrap(); + std::fs::create_dir(dir.path().join(".claude")).unwrap(); + std::fs::write(dir.path().join(".claude/harness.yaml"), "b: 2\n").unwrap(); + let result = read_harness_file_in(dir.path()).unwrap(); assert!(result.found); - assert_eq!(result.path.unwrap(), "~/harness.yaml"); + assert!(!result.legacy_home_file); } #[test] @@ -253,27 +235,4 @@ mod tests { write_harness_file_in(dir.path(), "new\n".to_string(), Some(&digest)).unwrap(); assert_ne!(std::fs::metadata(&file).unwrap().ino(), before); } - - #[test] - fn scan_claude_config_returns_none_when_files_absent() { - let dir = TempDir::new().unwrap(); - std::fs::create_dir(dir.path().join(".claude")).unwrap(); - let result = scan_claude_config_in(dir.path()).unwrap(); - assert!(result.mcp_servers_json.is_none()); - assert!(result.settings_json.is_none()); - } - - #[test] - fn scan_claude_config_reads_mcp_and_settings() { - let dir = TempDir::new().unwrap(); - let claude = dir.path().join(".claude"); - std::fs::create_dir(&claude).unwrap(); - std::fs::write(claude.join("mcp.json"), r#"{"mcpServers":{}}"#).unwrap(); - std::fs::write(claude.join("settings.local.json"), r#"{"permissions":{"allow":[]}}"#).unwrap(); - let result = scan_claude_config_in(dir.path()).unwrap(); - assert!(result.mcp_servers_json.is_some()); - assert_eq!(result.mcp_source.unwrap(), "~/.claude/mcp.json"); - assert!(result.settings_json.is_some()); - assert_eq!(result.settings_source.unwrap(), "~/.claude/settings.local.json"); - } } diff --git a/apps/desktop/src-tauri/src/commands/harness_state.rs b/apps/desktop/src-tauri/src/commands/harness_state.rs index 1c211644..e1e4e511 100644 --- a/apps/desktop/src-tauri/src/commands/harness_state.rs +++ b/apps/desktop/src-tauri/src/commands/harness_state.rs @@ -51,6 +51,13 @@ pub struct TransactionRecord { pub surfaces: Vec, pub kinds: Vec, pub identity_keys: Vec, + /// The surface a Machine drawer copy took the resource from. Absent for + /// every other apply (an MCP page save, a CLI apply). Its presence is what + /// makes `record_transaction` write an audit entry; the entry's text is + /// built here from this id and the structured fields above, never taken + /// from the webview as prose. + #[serde(default)] + pub copied_from: Option, } /// The `payload` column's JSON, shared with the CLI. @@ -69,6 +76,8 @@ struct RecordPayload { kinds: Vec, #[serde(default)] identity_keys: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + copied_from: Option, } /// Resolve the shared db path the same way the CLI does, `HARNESS_STATE_PATH` @@ -80,7 +89,7 @@ struct RecordPayload { /// even when the user's shell exports it. The override is therefore reliable /// for CI and tests, not for a GUI launch β€” parity holds for the default /// path, which is what matters in practice. -fn state_path() -> Result { +pub(crate) fn state_path() -> Result { if let Ok(override_path) = std::env::var("HARNESS_STATE_PATH") { let trimmed = override_path.trim(); if !trimmed.is_empty() { @@ -231,6 +240,8 @@ fn migrate_locked(conn: &Connection) -> Result<(), String> { const MAX_FIELD_BYTES: usize = 4096; /// Most entries accepted in any one list field. const MAX_LIST_ENTRIES: usize = 256; +/// Most surfaces one record may name. +const MAX_SURFACES: usize = 32; /// Bound what a webview can put in the ledger. /// @@ -254,6 +265,12 @@ fn validate_record(record: &TransactionRecord) -> Result<(), String> { if record.transaction_id.trim().is_empty() { return Err("transactionId must not be empty".to_string()); } + // The registry holds 11 surfaces and a record names each at most once, so + // 32 leaves room for growth while refusing a padded list. The generic + // 256-entry cap above already bounds identityKeys. + if record.surfaces.len() > MAX_SURFACES { + return Err(format!("surfaces exceeds {} entries", MAX_SURFACES)); + } for (name, list) in [ ("roots", &record.roots), ("surfaces", &record.surfaces), @@ -289,8 +306,6 @@ fn tighten_permissions(path: &std::path::Path) { } /// Best-effort array-of-strings extraction, independent of sibling fields. -/// Only the (test-only) read path needs it. -#[cfg(test)] fn string_array(document: &serde_json::Value, key: &str) -> Vec { document .get(key) @@ -667,8 +682,56 @@ pub(crate) fn migrate_drift_acknowledgements_at( } #[tauri::command] -pub fn record_transaction(record: TransactionRecord) -> Result<(), String> { - record_transaction_at(&state_path()?, record) +pub fn record_transaction( + db: tauri::State<'_, crate::db::Db>, + committed: tauri::State<'_, super::surface_write::CommittedTransactions>, + record: TransactionRecord, +) -> Result<(), String> { + let home = dirs::home_dir().ok_or("Could not resolve home directory")?; + record_transaction_audited(&db, &committed, &home, &state_path()?, record) +} + +/// {@link record_transaction_at}, plus the audit entry a Machine copy owes. +/// +/// The entry is written only after the ledger row is, and only when the record +/// names a source surface. Its text comes from `changes::copy_audit_entry`, +/// which builds it from structured fields; a malformed `copiedFrom` refuses the +/// whole record rather than logging something the app did not do. +pub(crate) fn record_transaction_audited( + db: &crate::db::Db, + committed: &super::surface_write::CommittedTransactions, + home: &std::path::Path, + path: &std::path::Path, + record: TransactionRecord, +) -> Result<(), String> { + // A manifest file alone proves nothing (the webview can write one), so the + // id must be one this session's apply command committed. + if !committed.contains(&record.transaction_id) { + return Err(format!( + "Transaction {} was not applied by this app session, so it is not recorded.", + record.transaction_id + )); + } + // The webview is not trusted: every surface id must be one the registry + // declares, and a copy must be backed by a committed manifest on disk. + super::changes::check_surfaces(&record)?; + let audit = super::changes::copy_audit_entry(&record)?; + if audit.is_some() { + super::changes::require_committed_manifest(home, &record)?; + } + let inserted = record_transaction_at(path, record)?; + // An identical replay inserts nothing and so logs nothing. + if let (true, Some(entry)) = (inserted, audit) { + super::security::log_audit( + db, + "machine_copy", + "changes", + &entry.summary, + Some(&entry.details), + "machine", + ); + } + Ok(()) } /// Path-taking core of {@link record_transaction}. Split out so tests can @@ -678,51 +741,75 @@ pub fn record_transaction(record: TransactionRecord) -> Result<(), String> { pub(crate) fn record_transaction_at( path: &std::path::Path, record: TransactionRecord, -) -> Result<(), String> { +) -> Result { validate_record(&record)?; let conn = open_at(path)?; let payload = serde_json::to_string(&RecordPayload { surfaces: record.surfaces, kinds: record.kinds, identity_keys: record.identity_keys, + copied_from: record.copied_from, }) .map_err(|e| format!("Failed to serialize payload: {}", e))?; let roots = serde_json::to_string(&record.roots) .map_err(|e| format!("Failed to serialize roots: {}", e))?; - conn.execute( - "INSERT INTO transactions - (transaction_id, applied_at, roots, manifest_path, manifest_root, backup_dir, payload) - VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7) - ON CONFLICT(transaction_id) DO UPDATE SET - applied_at = excluded.applied_at, - roots = excluded.roots, - manifest_path = excluded.manifest_path, - manifest_root = excluded.manifest_root, - backup_dir = excluded.backup_dir, - payload = excluded.payload", - rusqlite::params![ - record.transaction_id, - record.applied_at, - roots, - record.manifest_path, - record.manifest_root, - record.backup_dir, - payload - ], - ) - .map_err(|e| format!("Failed to record transaction: {}", e))?; - Ok(()) + // A row is written once. The old upsert let any later call rewrite a real + // row's surfaces, kinds or source, which changes what the Changes list + // tells the user happened. Legitimate callers record each apply exactly + // once (core's `recordAppliedTransaction`), so a repeat is either an + // identical retry, which passes, or an overwrite, which does not. + let inserted = conn + .execute( + "INSERT INTO transactions + (transaction_id, applied_at, roots, manifest_path, manifest_root, backup_dir, payload) + VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7) + ON CONFLICT(transaction_id) DO NOTHING", + rusqlite::params![ + record.transaction_id, + record.applied_at, + roots, + record.manifest_path, + record.manifest_root, + record.backup_dir, + payload + ], + ) + .map_err(|e| format!("Failed to record transaction: {}", e))?; + if inserted == 0 { + let same: i64 = conn + .query_row( + "SELECT COUNT(*) FROM transactions + WHERE transaction_id = ?1 AND applied_at = ?2 AND roots = ?3 + AND manifest_path = ?4 AND manifest_root = ?5 AND backup_dir = ?6 + AND payload = ?7", + rusqlite::params![ + record.transaction_id, + record.applied_at, + roots, + record.manifest_path, + record.manifest_root, + record.backup_dir, + payload + ], + |row| row.get(0), + ) + .map_err(|e| format!("Failed to check the existing transaction: {}", e))?; + if same == 0 { + return Err(format!( + "Transaction {} is already recorded with different contents", + record.transaction_id + )); + } + } + Ok(inserted > 0) } /// Recorded transactions, newest first. /// -/// Deliberately NOT a #[tauri::command], and `cfg(test)` because that leaves -/// it with no production caller at all: nothing in the app reads the ledger β€” -/// `rollback --list` is a CLI command β€” and exposing a read over IPC with no -/// caller is attack surface bought for nothing. Re-exposing it later means -/// lifting the cfg and adding the attribute. -#[cfg(test)] +/// Not a #[tauri::command] itself: the webview never gets raw ledger rows. +/// `changes::list_changes` is the one reader the app exposes (Settings β€Ί +/// Activity), and it returns a trimmed view with the manifest's file names. pub(crate) fn list_transactions_at( path: &std::path::Path, limit: Option, @@ -750,6 +837,7 @@ pub(crate) fn list_transactions_at( surfaces: string_array(&document, "surfaces"), kinds: string_array(&document, "kinds"), identity_keys: string_array(&document, "identityKeys"), + copied_from: None, }; Ok(TransactionRecord { transaction_id: row.get(0)?, @@ -761,6 +849,10 @@ pub(crate) fn list_transactions_at( surfaces: parsed.surfaces, kinds: parsed.kinds, identity_keys: parsed.identity_keys, + copied_from: document + .get("copiedFrom") + .and_then(|value| value.as_str()) + .map(String::from), }) }; let rows = match limit { @@ -1043,6 +1135,7 @@ mod tests { surfaces: vec!["cursor".to_string()], kinds: vec!["mcp-server".to_string()], identity_keys: vec!["mcp-server:postgres".to_string()], + copied_from: None, } } @@ -1072,15 +1165,31 @@ mod tests { } #[test] - fn is_idempotent_on_the_same_transaction_id() { + fn re_recording_an_identical_row_is_a_no_op() { let path = scratch("idempotent"); record_transaction_at(&path, record("dup")).unwrap(); - let mut second = record("dup"); - second.surfaces = vec!["codex".to_string()]; - record_transaction_at(&path, second).unwrap(); - let listed = list_transactions_at(&path, None).unwrap(); - assert_eq!(listed.len(), 1); - assert_eq!(listed[0].surfaces, vec!["codex".to_string()]); + record_transaction_at(&path, record("dup")).unwrap(); + assert_eq!(list_transactions_at(&path, None).unwrap().len(), 1); + std::fs::remove_file(&path).ok(); + } + + #[test] + fn a_different_payload_for_an_existing_transaction_id_is_refused() { + let path = scratch("overwrite"); + record_transaction_at(&path, record("dup")).unwrap(); + let first = list_transactions_at(&path, None).unwrap(); + let mut forged = record("dup"); + forged.surfaces = vec!["codex".to_string()]; + forged.copied_from = Some("claude-code".to_string()); + assert!(record_transaction_at(&path, forged).unwrap_err().contains("already recorded")); + let mut moved = record("dup"); + moved.manifest_path = ".harness/backups/other/transaction.json".to_string(); + assert!(record_transaction_at(&path, moved).is_err()); + let after = list_transactions_at(&path, None).unwrap(); + assert_eq!(after.len(), 1); + assert_eq!(after[0].surfaces, first[0].surfaces); + assert_eq!(after[0].copied_from, first[0].copied_from); + assert_eq!(after[0].manifest_path, first[0].manifest_path); std::fs::remove_file(&path).ok(); } @@ -1333,6 +1442,7 @@ mod cross_impl { surfaces: vec!["cursor".to_string()], kinds: vec!["mcp-server".to_string()], identity_keys: vec!["mcp-server:postgres".to_string()], + copied_from: None, }, ) .unwrap(); diff --git a/apps/desktop/src-tauri/src/commands/ipc_contract.rs b/apps/desktop/src-tauri/src/commands/ipc_contract.rs new file mode 100644 index 00000000..0fca5214 --- /dev/null +++ b/apps/desktop/src-tauri/src/commands/ipc_contract.rs @@ -0,0 +1,293 @@ +//! AC-60, Rust half of the IPC contract. +//! +//! `apps/desktop/test-fixtures/ipc/.json` holds the exact payloads the +//! webview sends (`src/lib/__tests__/ipc-contract.test.ts` proves tauri.ts sends +//! them). This test checks each payload against the command's real signature, read +//! from the `#[tauri::command]` source: argument names after Tauri's camelCase +//! conversion (or `rename_all` on the attribute), required versus `Option` +//! arguments, scalar types, and for struct-typed arguments a real serde +//! deserialization into the type the command takes. +//! +//! Why read the source: a `#[tauri::command]` function cannot be called without +//! a running app, and its argument decoding happens inside the generated macro. +//! A payload that Tauri would refuse ("invalid args `expectedSha256`", "missing +//! required key") is refused here too. Deleting `rename_all`-free camelCase +//! behaviour, renaming a Rust parameter, or renaming a fixture field fails this. + +use std::collections::BTreeMap; +use std::fs; +use std::path::{Path, PathBuf}; + +use serde_json::Value; + +struct Param { + /// The key the webview must send. + key: String, + ty: String, +} + +struct Command { + params: Vec, +} + +fn manifest_dir() -> PathBuf { + PathBuf::from(env!("CARGO_MANIFEST_DIR")) +} + +fn camel(snake: &str) -> String { + let mut out = String::new(); + let mut upper = false; + for c in snake.chars() { + if c == '_' { + upper = true; + } else if upper { + out.extend(c.to_uppercase()); + upper = false; + } else { + out.push(c); + } + } + out +} + +/// Split on commas that are not nested inside `<>`, `()` or `[]`. +fn split_top_level(s: &str) -> Vec { + let mut parts = Vec::new(); + let mut depth = 0i32; + let mut cur = String::new(); + for c in s.chars() { + match c { + '<' | '(' | '[' => depth += 1, + '>' | ')' | ']' => depth -= 1, + ',' if depth == 0 => { + parts.push(std::mem::take(&mut cur)); + continue; + } + _ => {} + } + cur.push(c); + } + if !cur.trim().is_empty() { + parts.push(cur); + } + parts.into_iter().map(|p| p.trim().to_string()).filter(|p| !p.is_empty()).collect() +} + +/// Arguments Tauri injects itself; the webview never sends them. +fn is_injected(ty: &str) -> bool { + let t = ty.trim_start_matches('&').trim(); + t.starts_with("State<") + || t.starts_with("tauri::State<") + || t.starts_with("AppHandle") + || t.starts_with("tauri::AppHandle") + || t.starts_with("Window") + || t.starts_with("WebviewWindow") + || t.starts_with("tauri::Window") + || t.starts_with("tauri::WebviewWindow") + || t.starts_with("Webview") +} + +fn collect_rs(dir: &Path, out: &mut Vec) { + for entry in fs::read_dir(dir).unwrap() { + let path = entry.unwrap().path(); + if path.is_dir() { + collect_rs(&path, out); + } else if path.extension().is_some_and(|e| e == "rs") { + out.push(path); + } + } +} + +/// Every `#[tauri::command]` under src/, keyed by function name. +fn scan_commands() -> BTreeMap { + let mut files = Vec::new(); + collect_rs(&manifest_dir().join("src"), &mut files); + files.retain(|f| !f.ends_with("commands/ipc_contract.rs")); + let mut found = BTreeMap::new(); + for file in files { + let text = fs::read_to_string(&file).unwrap(); + let mut rest = text.as_str(); + while let Some(at) = rest.find("#[tauri::command") { + let after = &rest[at..]; + let attr_end = after.find(']').expect("unterminated attribute"); + let attr = &after[..attr_end]; + let snake = if attr.contains("rename_all") { + assert!( + attr.contains("\"snake_case\""), + "{}: unsupported rename_all in {attr}", + file.display() + ); + true + } else { + false + }; + let body = &after[attr_end..]; + let fn_at = body.find("fn ").expect("command without fn"); + let sig = &body[fn_at + 3..]; + let paren = sig.find('(').unwrap(); + let name = sig[..paren].trim().to_string(); + // Find the matching close paren of the parameter list. + let mut depth = 0i32; + let mut end = 0usize; + for (i, c) in sig[paren..].char_indices() { + match c { + '(' => depth += 1, + ')' => { + depth -= 1; + if depth == 0 { + end = paren + i; + break; + } + } + _ => {} + } + } + let mut params = Vec::new(); + for raw in split_top_level(&sig[paren + 1..end]) { + let (pname, ty) = raw.split_once(':').unwrap_or_else(|| panic!("odd param `{raw}` in {name}")); + let ty = ty.trim().to_string(); + if is_injected(&ty) { + continue; + } + let pname = pname.trim().trim_start_matches("mut ").trim(); + let key = if snake { pname.to_string() } else { camel(pname) }; + params.push(Param { key, ty }); + } + found.insert(name, Command { params }); + rest = &rest[at + attr_end..]; + } + } + found +} + +fn strip_option(ty: &str) -> Option<&str> { + ty.strip_prefix("Option<").and_then(|t| t.strip_suffix('>')).map(str::trim) +} + +/// Check one value against a Rust type. Struct types deserialize for real. +fn check_value(ty: &str, v: &Value) -> Result<(), String> { + if let Some(inner) = strip_option(ty) { + return if v.is_null() { Ok(()) } else { check_value(inner, v) }; + } + let ok = match ty { + "String" => v.is_string(), + "bool" => v.is_boolean(), + "i8" | "i16" | "i32" | "i64" | "isize" => v.is_i64(), + "u8" | "u16" | "u32" | "u64" | "usize" => v.is_u64(), + "f32" | "f64" => v.is_number(), + "Vec" => v.as_array().is_some_and(|a| a.iter().all(Value::is_string)), + "PermissionsState" => { + return serde_json::from_value::(v.clone()) + .map(|_| ()) + .map_err(|e| e.to_string()) + } + "Vec" => { + return serde_json::from_value::>(v.clone()) + .map(|_| ()) + .map_err(|e| e.to_string()) + } + "Vec" => { + return serde_json::from_value::>(v.clone()) + .map(|_| ()) + .map_err(|e| e.to_string()) + } + "Vec" => { + return serde_json::from_value::>(v.clone()) + .map(|_| ()) + .map_err(|e| e.to_string()) + } + "DriftAck" => { + return serde_json::from_value::(v.clone()) + .map(|_| ()) + .map_err(|e| e.to_string()) + } + other => return Err(format!("no contract check for argument type `{other}`; add one to check_value")), + }; + if ok { + Ok(()) + } else { + Err(format!("expected {ty}, got {v}")) + } +} + +/// Why Tauri would refuse this payload for this command, if it would. +fn refusal(cmd: &Command, payload: &Value) -> Option { + let empty = serde_json::Map::new(); + let obj = match payload { + Value::Null => &empty, + Value::Object(o) => o, + other => return Some(format!("payload must be an object or null, got {other}")), + }; + for key in obj.keys() { + if !cmd.params.iter().any(|p| &p.key == key) { + return Some(format!( + "unexpected argument `{key}`; the command takes {:?}", + cmd.params.iter().map(|p| p.key.as_str()).collect::>() + )); + } + } + for p in &cmd.params { + match obj.get(&p.key) { + None if strip_option(&p.ty).is_some() => {} + None => return Some(format!("missing required argument `{}`", p.key)), + Some(v) => { + if let Err(e) = check_value(&p.ty, v) { + return Some(format!("argument `{}`: {e}", p.key)); + } + } + } + } + None +} + +#[test] +fn every_ipc_fixture_is_accepted_by_its_command() { + let commands = scan_commands(); + assert!(commands.len() > 60, "scan found only {} commands; the parser is broken", commands.len()); + let dir = manifest_dir().join("../test-fixtures/ipc"); + let mut checked = 0; + let mut failures = Vec::new(); + for entry in fs::read_dir(&dir).expect("test-fixtures/ipc missing") { + let path = entry.unwrap().path(); + if path.extension().is_none_or(|e| e != "json") { + continue; + } + let fixture: Value = serde_json::from_str(&fs::read_to_string(&path).unwrap()).unwrap(); + let name = fixture["command"].as_str().expect("fixture without `command`"); + assert_eq!( + path.file_stem().unwrap().to_str().unwrap(), + name, + "fixture file name must be the command name" + ); + let Some(cmd) = commands.get(name) else { + failures.push(format!("{name}: no #[tauri::command] with this name")); + continue; + }; + for (i, call) in fixture["calls"].as_array().expect("fixture without `calls`").iter().enumerate() { + if let Some(why) = refusal(cmd, &call["payload"]) { + failures.push(format!("{name} call #{}: {why}", i + 1)); + } + checked += 1; + } + } + assert!(checked > 60, "only {checked} payloads checked"); + assert!(failures.is_empty(), "IPC fixtures the Rust commands would refuse:\n {}", failures.join("\n ")); +} + +#[test] +fn the_checker_rejects_a_renamed_field() { + // Guards the checker itself: a snake_case key where Tauri expects camelCase, + // the `rename_all` miss, must be refused. + let cmd = Command { + params: vec![ + Param { key: camel("expected_sha256"), ty: "Option".into() }, + Param { key: camel("file_path"), ty: "String".into() }, + ], + }; + assert!(refusal(&cmd, &serde_json::json!({ "filePath": "a", "expectedSha256": "x" })).is_none()); + assert!(refusal(&cmd, &serde_json::json!({ "filePath": "a" })).is_none()); + assert!(refusal(&cmd, &serde_json::json!({ "file_path": "a" })).is_some()); + assert!(refusal(&cmd, &serde_json::json!({ "filePath": "a", "expected_sha256": "x" })).is_some()); + assert!(refusal(&cmd, &serde_json::json!({ "filePath": 3 })).is_some()); + assert!(refusal(&cmd, &Value::Null).is_some()); +} diff --git a/apps/desktop/src-tauri/src/commands/mod.rs b/apps/desktop/src-tauri/src/commands/mod.rs index 0697819b..4a97c363 100644 --- a/apps/desktop/src-tauri/src/commands/mod.rs +++ b/apps/desktop/src-tauri/src/commands/mod.rs @@ -16,6 +16,7 @@ pub mod harness_file; pub mod profiles; pub mod harness_state; pub mod surface_write; +pub mod changes; pub mod sync; pub mod parity; pub mod pairwise; @@ -25,3 +26,5 @@ pub mod harnesses; pub mod feedback; pub mod fs_scope; pub mod fs_guarded; +#[cfg(test)] +mod ipc_contract; diff --git a/apps/desktop/src-tauri/src/commands/security.rs b/apps/desktop/src-tauri/src/commands/security.rs index 1ef71cdf..91ffd053 100644 --- a/apps/desktop/src-tauri/src/commands/security.rs +++ b/apps/desktop/src-tauri/src/commands/security.rs @@ -347,7 +347,7 @@ fn update_permissions_at( Ok((old_perms, settings_digest_at(path)?)) } -fn log_audit( +pub(crate) fn log_audit( db: &Db, event_type: &str, category: &str, diff --git a/apps/desktop/src-tauri/src/commands/surface_write.rs b/apps/desktop/src-tauri/src/commands/surface_write.rs index 419e821d..3e10a5dc 100644 --- a/apps/desktop/src-tauri/src/commands/surface_write.rs +++ b/apps/desktop/src-tauri/src/commands/surface_write.rs @@ -50,6 +50,39 @@ fn is_state_path(normalized: &str) -> bool { normalized.starts_with(".harness/backups/") } +/// Transaction ids this app session's `apply_surface_transaction` itself wrote +/// a committed manifest for. In memory only, so it empties on restart: the +/// apply and the `record_transaction` that follows it are one call chain in +/// core's `recordAppliedTransaction`, so a restart between them loses the +/// ledger row (the apply still stands, and the manifest is on disk) but can +/// never leave a record that is accepted without its apply. +#[derive(Default)] +pub struct CommittedTransactions(std::sync::Mutex>); + +impl CommittedTransactions { + pub(crate) fn insert(&self, id: &str) { + self.0.lock().unwrap_or_else(|e| e.into_inner()).insert(id.to_string()); + } + + pub(crate) fn contains(&self, id: &str) -> bool { + self.0.lock().unwrap_or_else(|e| e.into_inner()).contains(id) + } +} + +/// The transaction id a write commits: the file is +/// `.harness/backups//transaction.json` and its content says +/// `"status":"committed"`. +fn committed_id(file: &SurfaceFileWrite) -> Option { + let relative = file.relative_path.replace('\\', "/"); + let rest = relative.strip_prefix(".harness/backups/")?; + let (id, name) = rest.split_once('/')?; + if name != "transaction.json" || id.is_empty() { + return None; + } + let document: serde_json::Value = serde_json::from_str(file.content.as_deref()?).ok()?; + (document.get("status")?.as_str()? == "committed").then(|| id.to_string()) +} + /// Whether a home-relative path is a config store the registry declares. /// Segment-aware in both directions: ".claude.json.bak" is not ".claude.json", /// and ".claude/skillsets/x" is not inside ".claude/skills". @@ -183,14 +216,32 @@ struct Target { /// written: the batch stops there with an error that says it was replaced, /// and lists it among the files already written. #[tauri::command] -pub fn apply_surface_transaction(files: Vec) -> Result, String> { +pub fn apply_surface_transaction( + committed: tauri::State<'_, CommittedTransactions>, + files: Vec, +) -> Result, String> { let home = dirs::home_dir().ok_or("Could not resolve home directory")?; - apply_surface_transaction_in(&home, files) + apply_and_note_commits(&committed, &home, files) +} + +/// The command body: apply, and only on success remember which transactions +/// this call committed. +pub(crate) fn apply_and_note_commits( + committed: &CommittedTransactions, + home: &Path, + files: Vec, +) -> Result, String> { + let ids: Vec = files.iter().filter_map(committed_id).collect(); + let written = apply_surface_transaction_in(home, files)?; + for id in ids { + committed.insert(&id); + } + Ok(written) } /// The command body with the home directory injected, so tests run against a /// tempdir instead of the real home (and never mutate the process-global HOME). -fn apply_surface_transaction_in( +pub(crate) fn apply_surface_transaction_in( home: &Path, files: Vec, ) -> Result, String> { @@ -835,6 +886,26 @@ mod tests { } } + #[test] + fn dot_dot_is_refused_inside_and_around_declared_stores() { + // A `..` segment can hop out of a declared directory, or into one from + // outside, even when the textual prefix looks declared. + for path in [ + ".claude/skills/../../.ssh/id_rsa", + ".claude/skills/review/../../../.zshrc", + ".claude/../.claude.json", + "foo/../.claude.json", + "..", + ".claude/skills/..", + ".harness/backups/../harness.db", + ".harness/backups/x/../../device.json", + ".claude\\skills\\..\\..\\.ssh\\id_rsa", + ] { + assert!(!is_declared_store(path), "{path} should be rejected"); + assert!(!is_declared_project_store(path), "{path} should be rejected as a project store"); + } + } + #[test] fn a_directory_shaped_path_is_refused_not_written_as_a_file() { let home = tempfile::TempDir::new().unwrap(); diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 07c9d107..8b97a9b4 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -68,6 +68,7 @@ pub fn run() { .plugin(tauri_plugin_window_state::Builder::default().build()) .plugin(tauri_plugin_dialog::init()) .manage(database) + .manage(commands::surface_write::CommittedTransactions::default()) .invoke_handler(tauri::generate_handler![ // Plugins commands::plugins::list_installed_plugins, @@ -90,7 +91,6 @@ pub fn run() { // Harness File commands::harness_file::read_harness_file, commands::harness_file::write_harness_file, - commands::harness_file::scan_claude_config, // Custom Profiles commands::profiles::list_custom_profiles, commands::profiles::get_custom_profile, @@ -172,6 +172,8 @@ pub fn run() { commands::harness_state::get_highest_bundle_number, commands::harness_state::record_bundle_number, commands::harness_state::record_transaction, + commands::changes::list_changes, + commands::changes::undo_change, commands::harness_state::migrate_drift_acknowledgements, commands::harness_state::acknowledge_drift, commands::harness_state::unacknowledge_drift, @@ -179,9 +181,9 @@ pub fn run() { commands::sync::sync_create_backup, commands::sync::sync_list_backups, commands::sync::sync_restore_backup, - // Harness detection (used by Fleet) + // Harness detection (used by Comparator's setup) commands::harnesses::detect_harnesses, - // Runtime FS scope grants (used by Fleet/Drift's project scope) + // Runtime FS scope grants (used by the project scope of Machine, Drift and Compile) commands::fs_scope::grant_project_scope, commands::fs_scope::choose_project_dir, // Guarded write/rename/remove for the webview's TauriFsProvider diff --git a/apps/desktop/src-tauri/tests/capability_smoke.rs b/apps/desktop/src-tauri/tests/capability_smoke.rs new file mode 100644 index 00000000..94081be9 --- /dev/null +++ b/apps/desktop/src-tauri/tests/capability_smoke.rs @@ -0,0 +1,161 @@ +//! AC-60, runtime half. Builds a Tauri app on the mock runtime with the REAL +//! `tauri.conf.json`, the REAL `capabilities/default.json` and the ACL manifest +//! build.rs generates, then sends IPC requests through Tauri's own dispatcher from +//! the "main" window. Granted calls pass the ACL; calls the capability does not +//! grant are refused with Tauri's ACL error. +//! +//! This is the nightly "real app" check where a real launch is not possible: +//! tauri-driver has no macOS WebKit driver, so the packaged app cannot be driven +//! from CI. The mock runtime has no webview, but it runs the same ACL resolver the +//! packaged app uses, so a capability change that breaks production fails here. +//! +//! No app command handlers are registered, on purpose. The ACL check runs before +//! dispatch, so a granted command reaches "command not found" and nothing touches +//! the user's disk, keychain or network; an ungranted one stops at the ACL. This +//! file is its own crate because `generate_context!` may be expanded once per crate. + +use tauri::ipc::{CallbackFn, InvokeBody, InvokeResponseBody}; +use tauri::test::{get_ipc_response, mock_builder, MockRuntime, INVOKE_KEY}; +use tauri::webview::InvokeRequest; +use tauri::{App, Manager, WebviewUrl, WebviewWindowBuilder}; + +const CAPABILITY: &str = include_str!("../capabilities/default.json"); +const BUILD_RS: &str = include_str!("../build.rs"); + +fn app() -> App { + let app = mock_builder() + .plugin(tauri_plugin_fs::init()) + .plugin(tauri_plugin_shell::init()) + .plugin(tauri_plugin_dialog::init()) + .build(tauri::generate_context!()) + .expect("the real tauri.conf.json and capabilities must build an app"); + if app.get_webview_window("main").is_none() { + WebviewWindowBuilder::new(&app, "main", WebviewUrl::default()) + .build() + .expect("create the main window"); + } + app +} + +fn call( + app: &App, + cmd: &str, + body: serde_json::Value, + origin: &str, +) -> Result { + let window = app.get_webview_window("main").expect("main window"); + get_ipc_response( + &window, + InvokeRequest { + cmd: cmd.into(), + callback: CallbackFn(0), + error: CallbackFn(1), + url: origin.parse().unwrap(), + body: InvokeBody::Json(body), + headers: Default::default(), + invoke_key: INVOKE_KEY.to_string(), + }, + ) +} + +fn is_acl_refusal(err: &serde_json::Value) -> bool { + let text = err.to_string(); + text.contains("not allowed") || text.contains("Permissions associated with this command") +} + +/// Every app command declared in build.rs's AppManifest: the commands the app +/// registers, each of which the capability must grant. Read from the declaration, +/// not from the capability, so deleting a grant makes a command fail here instead +/// of silently shrinking the list. +fn manifest_app_commands() -> Vec { + let start = BUILD_RS.find("commands(&[").expect("AppManifest commands list in build.rs"); + let end = BUILD_RS[start..].find("])").expect("end of commands list") + start; + BUILD_RS[start..end] + .lines() + .map(|l| l.trim()) + .filter(|l| !l.starts_with("//")) + .filter_map(|l| l.strip_prefix('"').and_then(|r| r.split('"').next())) + .map(str::to_string) + .collect() +} + +/// Bare `allow-` app-command grants in the capability, as command names. +fn granted_app_commands() -> Vec { + let caps: serde_json::Value = serde_json::from_str(CAPABILITY).unwrap(); + caps["permissions"] + .as_array() + .unwrap() + .iter() + .filter_map(|p| p.as_str()) + .filter_map(|id| id.strip_prefix("allow-")) + .map(|kebab| kebab.replace('-', "_")) + .collect() +} + +#[test] +fn the_real_app_builds_with_the_real_capability() { + let app = app(); + assert!(app.get_webview_window("main").is_some()); +} + +#[test] +fn every_granted_app_command_passes_the_acl() { + let app = app(); + let commands = manifest_app_commands(); + assert!(commands.len() > 60, "found only {} manifest commands; the parser is broken", commands.len()); + let mut granted = granted_app_commands(); + granted.sort(); + let mut declared = commands.clone(); + declared.sort(); + assert_eq!(declared, granted, "build.rs AppManifest and default.json grants must list the same commands"); + let mut refused = Vec::new(); + for cmd in &commands { + if let Err(e) = call(&app, cmd, serde_json::json!({}), "tauri://localhost") { + if is_acl_refusal(&e) { + refused.push(format!("{cmd}: {e}")); + } + } + } + assert!(refused.is_empty(), "granted in default.json but refused by the ACL:\n {}", refused.join("\n ")); +} + +#[test] +fn granted_plugin_calls_are_not_refused_by_the_acl() { + // `exists` outside the fs scope fails on the SCOPE ("forbidden path"), not on the + // ACL: the permission is granted, the path is not. TauriFsProvider.exists() relies + // on this and treats the string as "absent". + let app = app(); + if let Err(e) = call(&app, "plugin:fs|exists", serde_json::json!({ "path": "/etc/hosts" }), "tauri://localhost") { + let text = e.to_string(); + assert!( + !is_acl_refusal(&e) || text.contains("forbidden path"), + "fs exists must be granted by the capability: {text}" + ); + } +} + +#[test] +fn ungranted_plugin_calls_are_refused_by_the_acl() { + let app = app(); + for (cmd, body) in [ + ("plugin:fs|write_text_file", serde_json::json!({ "path": "/tmp/x" })), + ("plugin:fs|remove", serde_json::json!({ "path": "/tmp/x" })), + ("plugin:fs|rename", serde_json::json!({ "oldPath": "/tmp/a", "newPath": "/tmp/b" })), + ("plugin:shell|execute", serde_json::json!({})), + ("plugin:shell|spawn", serde_json::json!({})), + ] { + match call(&app, cmd, body, "tauri://localhost") { + Ok(_) => panic!("{cmd} must not be granted to the webview"), + Err(e) => assert!(is_acl_refusal(&e), "{cmd} refused, but not by the ACL: {e}"), + } + } +} + +#[test] +fn a_remote_origin_gets_no_app_commands() { + let app = app(); + match call(&app, "get_system_info", serde_json::json!({}), "https://example.com/") { + Ok(_) => panic!("a remote page must not reach app commands"), + Err(e) => assert!(is_acl_refusal(&e), "refused, but not by the ACL: {e}"), + } +} diff --git a/apps/desktop/src/app.css b/apps/desktop/src/app.css index 71c313e3..8ea3e060 100644 --- a/apps/desktop/src/app.css +++ b/apps/desktop/src/app.css @@ -11,8 +11,8 @@ --bg-sidebar-solid: #FFFFFF; --fg-base: #1A1714; --fg-muted: #57514A; - --fg-subtle: #8B8479; - --fg-placeholder: #A8A199; + --fg-subtle: #655F55; + --fg-placeholder: #716A60; --border-base: rgba(20, 15, 10, 0.06); --border-strong: rgba(20, 15, 10, 0.10); --border-subtle: rgba(20, 15, 10, 0.03); @@ -22,6 +22,10 @@ --accent-fg: #1668A6; --accent-text: #1668A6; --accent-glow: rgba(46, 155, 230, 0.25); + --accent-fill: #1D6FB0; + --success-text: #1B6F47; + --warning-text: #7A5000; + --danger-text: #B3262C; /* design-tokens:light:end */ /* Category accents */ @@ -62,7 +66,7 @@ } /* Whole-harness portability ledger: dense, operational, and intentionally - distinct from the summary-card language used elsewhere in Fleet. */ + distinct from the summary-card language used elsewhere in the app. */ .hk-portability { margin-top: 24px; padding: 18px 0 0; @@ -151,7 +155,7 @@ white-space: nowrap; } -.hk-portability-ledger strong[data-tone="danger"] { color: var(--danger); } +.hk-portability-ledger strong[data-tone="danger"] { color: var(--danger-text); } .hk-portability-body { display: flex; @@ -271,7 +275,7 @@ .hk-conflict-ledger-title p { margin: 0 0 3px; - color: var(--danger); + color: var(--danger-text); font: 650 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase; @@ -365,7 +369,7 @@ } /* Light theme: --warning on its own tint is ~2:1 at 10.5px; mix toward the body colour for ~4.8:1. */ .hk-cell[data-variant="differs"] { background: var(--warning-light); color: color-mix(in srgb, var(--warning) 50%, var(--fg-base)); } -.dark .hk-cell[data-variant="differs"] { color: var(--warning); } +.dark .hk-cell[data-variant="differs"] { color: var(--warning-text); } .hk-cell[data-variant="none"], .hk-cell[data-variant="unmanaged"] { color: var(--fg-subtle); opacity: 0.55; } .hk-cell[data-variant="unknown"] { background: var(--bg-elevated); color: var(--fg-muted); } @@ -440,8 +444,8 @@ --bg-sidebar-solid: #1B191E; --fg-base: #EDEAE6; --fg-muted: #A29C95; - --fg-subtle: #6C665F; - --fg-placeholder: #514C46; + --fg-subtle: #968F88; + --fg-placeholder: #8A847D; --border-base: rgba(255, 255, 255, 0.05); --border-strong: rgba(255, 255, 255, 0.09); --border-subtle: rgba(255, 255, 255, 0.03); @@ -451,6 +455,10 @@ --accent-fg: #6BC0F5; --accent-text: #6BC0F5; --accent-glow: rgba(46, 155, 230, 0.35); + --accent-fill: #1D6FB0; + --success-text: #4CC08A; + --warning-text: #E0A33D; + --danger-text: #FF7A7E; /* design-tokens:dark:end */ /* Category accents */ @@ -919,7 +927,7 @@ body { .btn-danger { border-color: var(--danger); - color: var(--danger); + color: var(--danger-text); font-weight: 600; } diff --git a/apps/desktop/src/components/CommandPalette.tsx b/apps/desktop/src/components/CommandPalette.tsx index f7eebd6a..f4bc497c 100644 --- a/apps/desktop/src/components/CommandPalette.tsx +++ b/apps/desktop/src/components/CommandPalette.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent } from "react"; +import { useEffect, useId, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent } from "react"; import { useNavigate } from "react-router-dom"; import { toggleTheme } from "../lib/theme"; import { useCommands } from "../lib/commands"; @@ -44,6 +44,7 @@ export function CommandPalette({ open, onClose, sections }: CommandPaletteProps) const [selectedId, setSelectedId] = useState(null); const inputRef = useRef(null); const dialogRef = useRef(null); + const listId = useId(); const registered = useCommands(); @@ -127,6 +128,9 @@ export function CommandPalette({ open, onClose, sections }: CommandPaletteProps) if (e.key === "Escape") { e.preventDefault(); onClose(); + } else if (e.key === "Tab") { + // The input is the palette's only tab stop: keep focus inside the modal. + e.preventDefault(); } else if (e.key === "ArrowDown") { e.preventDefault(); const next = filtered[Math.min(selected + 1, filtered.length - 1)]; @@ -185,6 +189,11 @@ export function CommandPalette({ open, onClose, sections }: CommandPaletteProps) }} placeholder="Type a command or search…" aria-label="Command palette search" + role="combobox" + aria-expanded="true" + aria-controls={listId} + aria-autocomplete="list" + aria-activedescendant={filtered[selected] ? `${listId}-${selected}` : undefined} style={{ border: "none", outline: "none", @@ -195,9 +204,9 @@ export function CommandPalette({ open, onClose, sections }: CommandPaletteProps) }} />
-
+
{filtered.length === 0 && ( -
+
No matching commands
)} @@ -206,9 +215,10 @@ export function CommandPalette({ open, onClose, sections }: CommandPaletteProps) lastGroup = cmd.group; const isSel = i === selected; return ( -
+
{showGroup && (
)} - +
); })} diff --git a/apps/desktop/src/components/ContextMenu.tsx b/apps/desktop/src/components/ContextMenu.tsx index 442459a2..d8b40eea 100644 --- a/apps/desktop/src/components/ContextMenu.tsx +++ b/apps/desktop/src/components/ContextMenu.tsx @@ -11,23 +11,52 @@ interface ContextMenuProps { onClose: () => void; } +/** + * A menu (WAI-ARIA menu pattern): focus moves to the first item on open, + * Arrow/Home/End move between items, Enter/Space activate, Escape and Tab + * close it, and focus returns to whatever opened it (AC-61). + */ export default function ContextMenu({ x, y, items, onClose }: ContextMenuProps) { const menuRef = useRef(null); useEffect(() => { + const opener = document.activeElement; + const itemEls = () => Array.from(menuRef.current?.querySelectorAll('[role="menuitem"]') ?? []); + itemEls()[0]?.focus(); + function onPointerDown(e: PointerEvent) { if (menuRef.current && !menuRef.current.contains(e.target as Node)) { onClose(); } } function onKeyDown(e: KeyboardEvent) { - if (e.key === "Escape") onClose(); + const els = itemEls(); + const at = els.indexOf(document.activeElement as HTMLElement); + const focusAt = (i: number) => { + e.preventDefault(); + els[(i + els.length) % els.length]?.focus(); + }; + if (e.key === "Escape") { + e.preventDefault(); + onClose(); + } else if (e.key === "Tab") { + onClose(); + } else if (e.key === "ArrowDown") focusAt(at + 1); + else if (e.key === "ArrowUp") focusAt(at === -1 ? -1 : at - 1); + else if (e.key === "Home") focusAt(0); + else if (e.key === "End") focusAt(-1); } document.addEventListener("pointerdown", onPointerDown); document.addEventListener("keydown", onKeyDown); return () => { document.removeEventListener("pointerdown", onPointerDown); document.removeEventListener("keydown", onKeyDown); + // Give focus back unless the user already moved it somewhere on purpose + // (a pointer click elsewhere) β€” body means nothing else claimed it. + if (opener instanceof HTMLElement && opener.isConnected && document.activeElement !== opener) { + const active = document.activeElement; + if (!active || active === document.body || menuRef.current?.contains(active)) opener.focus(); + } }; // onClose is always () => setContextMenu(null) β€” stable by contract. // Omitting it from deps prevents listener churn on every parent render. @@ -37,6 +66,7 @@ export default function ContextMenu({ x, y, items, onClose }: ContextMenuProps) return (
{ item.onClick(); onClose(); }} style={{ display: "block", @@ -74,11 +107,13 @@ export default function ContextMenu({ x, y, items, onClose }: ContextMenuProps) border: "none", borderRadius: "5px", background: "transparent", - color: item.danger ? "var(--danger)" : "var(--fg-base)", + color: item.danger ? "var(--danger-text)" : "var(--fg-base)", cursor: "pointer", }} onMouseEnter={(e) => (e.currentTarget.style.background = item.danger ? "rgba(220,38,38,0.08)" : "var(--hover-bg)")} onMouseLeave={(e) => (e.currentTarget.style.background = "transparent")} + onFocus={(e) => (e.currentTarget.style.background = item.danger ? "rgba(220,38,38,0.08)" : "var(--hover-bg)")} + onBlur={(e) => (e.currentTarget.style.background = "transparent")} > {item.label} diff --git a/apps/desktop/src/components/FeedbackModal.tsx b/apps/desktop/src/components/FeedbackModal.tsx index 6a82146c..a48b8aba 100644 --- a/apps/desktop/src/components/FeedbackModal.tsx +++ b/apps/desktop/src/components/FeedbackModal.tsx @@ -1,5 +1,6 @@ -import { useEffect, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { createPortal } from "react-dom"; +import { useDialogFocus } from "@harness-kit/ui"; import { open } from "@tauri-apps/plugin-shell"; import { getSystemInfo, submitFeedback, @@ -43,6 +44,17 @@ export default function FeedbackModal({ open: isOpen, onClose }: Props) { getSystemInfo().then(setSysInfo).catch(() => {}); }, [isOpen]); + const dialogRef = useRef(null); + useDialogFocus(isOpen, dialogRef); + useEffect(() => { + if (!isOpen) return; + function onKey(e: KeyboardEvent) { + if (e.key === "Escape") onClose(); + } + window.addEventListener("keydown", onKey); + return () => window.removeEventListener("keydown", onKey); + }, [isOpen, onClose]); + if (!isOpen) return null; const canSubmit = @@ -85,12 +97,21 @@ export default function FeedbackModal({ open: isOpen, onClose }: Props) { return createPortal(
-
e.stopPropagation()}> +
e.stopPropagation()} + > {/* Header */}
- Send Feedback + Send Feedback + {open && ( + setOpen(false)} + items={[ + { label: "Copy name", onClick: onCopy }, + { separator: true }, + { label: "Uninstall", onClick: onRemove, danger: true }, + ]} + /> + )} + + ); +} + +async function openMenu(user: ReturnType) { + await user.click(screen.getByRole("button", { name: "Actions" })); + const menu = screen.getByRole("menu"); + await waitFor(() => expect(screen.getByRole("menuitem", { name: "Copy name" })).toHaveFocus()); + return menu; +} + +describe("ContextMenu", () => { + it("is role=menu with menuitems and a separator, and focuses the first item", async () => { + const user = userEvent.setup(); + render(); + const menu = await openMenu(user); + expect(screen.getAllByRole("menuitem")).toHaveLength(2); + expect(menu.querySelector('[role="separator"]')).not.toBeNull(); + }); + + it("moves with the arrow keys, wrapping, and Home/End", async () => { + const user = userEvent.setup(); + render(); + await openMenu(user); + await user.keyboard("{ArrowDown}"); + expect(screen.getByRole("menuitem", { name: "Uninstall" })).toHaveFocus(); + await user.keyboard("{ArrowDown}"); + expect(screen.getByRole("menuitem", { name: "Copy name" })).toHaveFocus(); + await user.keyboard("{ArrowUp}"); + expect(screen.getByRole("menuitem", { name: "Uninstall" })).toHaveFocus(); + await user.keyboard("{Home}"); + expect(screen.getByRole("menuitem", { name: "Copy name" })).toHaveFocus(); + await user.keyboard("{End}"); + expect(screen.getByRole("menuitem", { name: "Uninstall" })).toHaveFocus(); + }); + + it("activates the focused item with Enter and closes", async () => { + const onRemove = vi.fn(); + const user = userEvent.setup(); + render(); + await openMenu(user); + await user.keyboard("{ArrowDown}{Enter}"); + expect(onRemove).toHaveBeenCalledOnce(); + expect(screen.queryByRole("menu")).not.toBeInTheDocument(); + }); + + it("returns focus to the opener on Escape", async () => { + const user = userEvent.setup(); + render(); + const opener = screen.getByRole("button", { name: "Actions" }); + await openMenu(user); + await user.keyboard("{Escape}"); + expect(screen.queryByRole("menu")).not.toBeInTheDocument(); + expect(opener).toHaveFocus(); + }); + + it("closes on Tab instead of leaving focus behind a hidden menu", async () => { + const user = userEvent.setup(); + render(); + await openMenu(user); + await user.tab(); + expect(screen.queryByRole("menu")).not.toBeInTheDocument(); + }); +}); diff --git a/apps/desktop/src/components/__tests__/ToastProvider.test.tsx b/apps/desktop/src/components/__tests__/ToastProvider.test.tsx index ec1fae1f..824ca4a9 100644 --- a/apps/desktop/src/components/__tests__/ToastProvider.test.tsx +++ b/apps/desktop/src/components/__tests__/ToastProvider.test.tsx @@ -7,7 +7,7 @@ function Pusher({ variant = "success", }: { title?: string; - variant?: "success" | "warning"; + variant?: "success" | "warning" | "danger"; }) { const toast = useToast(); return ( @@ -17,10 +17,41 @@ function Pusher({ ); } +// The one live region (AC-61): always mounted, toasts appear inside it. +const region = () => screen.getByRole("log", { name: "Notifications" }); +const shownToasts = () => Array.from(region().querySelectorAll(".hk-toast")).map((t) => t.textContent); + describe("ToastProvider", () => { beforeEach(() => vi.useFakeTimers()); afterEach(() => vi.useRealTimers()); + it("mounts the live region before any toast, so the first message is announced", () => { + render( + + + , + ); + expect(region()).toBeInTheDocument(); + expect(shownToasts()).toEqual([]); + fireEvent.click(screen.getByRole("button", { name: "push" })); + // The same node: the region was not created by the toast. + expect(region()).toHaveTextContent("Copied github to Codex"); + }); + + it("gives a danger toast role=alert and the others no role of their own", () => { + render( + + + + , + ); + const [danger, ok] = screen.getAllByRole("button", { name: "push" }); + fireEvent.click(danger); + fireEvent.click(ok); + expect(screen.getByRole("alert")).toHaveTextContent("Copied github to Codex"); + expect(screen.queryByRole("status")).not.toBeInTheDocument(); + }); + it("shows a pushed toast and dismisses it after the timeout", () => { render( @@ -28,12 +59,12 @@ describe("ToastProvider", () => { , ); fireEvent.click(screen.getByRole("button", { name: "push" })); - expect(screen.getByRole("status")).toHaveTextContent("Copied github to Codex"); + expect(region()).toHaveTextContent("Copied github to Codex"); act(() => vi.advanceTimersByTime(TOAST_TIMEOUT_MS - 1)); - expect(screen.queryByRole("status")).toBeInTheDocument(); + expect(shownToasts()).toHaveLength(1); act(() => vi.advanceTimersByTime(1)); - expect(screen.queryByRole("status")).not.toBeInTheDocument(); + expect(shownToasts()).toHaveLength(0); }); it("keeps a warning until it is dismissed", () => { @@ -44,9 +75,9 @@ describe("ToastProvider", () => { ); fireEvent.click(screen.getByRole("button", { name: "push" })); act(() => vi.advanceTimersByTime(TOAST_TIMEOUT_MS * 3)); - expect(screen.getByRole("status")).toHaveTextContent("Copied github to Codex"); + expect(region()).toHaveTextContent("Copied github to Codex"); fireEvent.click(screen.getByRole("button", { name: "Dismiss notification" })); - expect(screen.queryByRole("status")).not.toBeInTheDocument(); + expect(shownToasts()).toHaveLength(0); }); it("dismisses on the close button", () => { @@ -57,7 +88,7 @@ describe("ToastProvider", () => { ); fireEvent.click(screen.getByRole("button", { name: "push" })); fireEvent.click(screen.getByRole("button", { name: "Dismiss notification" })); - expect(screen.queryByRole("status")).not.toBeInTheDocument(); + expect(shownToasts()).toHaveLength(0); }); it("gives each toast its own id, so dismissing one keeps the other", () => { @@ -70,10 +101,9 @@ describe("ToastProvider", () => { const [first, second] = screen.getAllByRole("button", { name: "push" }); fireEvent.click(first); fireEvent.click(second); - expect(screen.getAllByRole("status")).toHaveLength(2); + expect(shownToasts()).toHaveLength(2); fireEvent.click(screen.getAllByRole("button", { name: "Dismiss notification" })[0]); - expect(screen.getAllByRole("status")).toHaveLength(1); - expect(screen.getByRole("status")).toHaveTextContent("second"); + expect(shownToasts()).toEqual(["second"]); }); it("shows the newest three when more are stacked", () => { @@ -85,13 +115,12 @@ describe("ToastProvider", () => { , ); for (const button of screen.getAllByRole("button", { name: "push" })) fireEvent.click(button); - const shown = screen.getAllByRole("status").map((toast) => toast.textContent); - expect(shown).toEqual(["two", "three", "four"]); + expect(shownToasts()).toEqual(["two", "three", "four"]); }); it("is a no-op outside a provider", () => { render(); expect(() => fireEvent.click(screen.getByRole("button", { name: "push" }))).not.toThrow(); - expect(screen.queryByRole("status")).not.toBeInTheDocument(); + expect(screen.queryByRole("log")).not.toBeInTheDocument(); }); }); diff --git a/apps/desktop/src/components/__tests__/dialogs-a11y.test.tsx b/apps/desktop/src/components/__tests__/dialogs-a11y.test.tsx new file mode 100644 index 00000000..9153bd78 --- /dev/null +++ b/apps/desktop/src/components/__tests__/dialogs-a11y.test.tsx @@ -0,0 +1,70 @@ +import { describe, it, expect, vi } from "vitest"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { useState } from "react"; + +vi.mock("@tauri-apps/plugin-shell", () => ({ open: vi.fn() })); +vi.mock("../../lib/tauri", () => ({ + getSystemInfo: vi.fn().mockResolvedValue({}), + submitFeedback: vi.fn(), + listCustomProfiles: vi.fn().mockResolvedValue([]), + getCustomProfile: vi.fn(), + deleteCustomProfile: vi.fn(), +})); + +import FeedbackModal from "../FeedbackModal"; +import ProfilePickerModal from "../ProfilePickerModal"; + +// AC-61: FeedbackModal and ProfilePickerModal are real dialogs. +function Host({ which }: { which: "feedback" | "profiles" }) { + const [open, setOpen] = useState(false); + return ( + <> + + {which === "feedback" ? ( + setOpen(false)} /> + ) : ( + setOpen(false)} onSelect={() => {}} /> + )} + + ); +} + +describe.each([ + ["feedback", "Send Feedback"], + ["profiles", "Choose a profile"], +] as const)("%s dialog", (which, name) => { + it("is a named modal dialog that takes focus", async () => { + const user = userEvent.setup(); + render(); + await user.click(screen.getByRole("button", { name: "Launch" })); + const dialog = await screen.findByRole("dialog", { name }); + expect(dialog).toHaveAttribute("aria-modal", "true"); + await waitFor(() => expect(dialog).toHaveFocus()); + }); + + it("traps Tab and returns focus to the trigger on Escape or close", async () => { + const user = userEvent.setup(); + render(); + const trigger = screen.getByRole("button", { name: "Launch" }); + await user.click(trigger); + const dialog = await screen.findByRole("dialog", { name }); + await waitFor(() => expect(dialog).toHaveFocus()); + for (let i = 0; i < 40; i++) { + await user.tab(); + expect(dialog).toContainElement(document.activeElement as HTMLElement); + } + await user.keyboard("{Escape}"); + await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument()); + expect(trigger).toHaveFocus(); + }); +}); + +describe("feedback dialog close control", () => { + it("labels the icon-only close button", async () => { + const user = userEvent.setup(); + render(); + await user.click(screen.getByRole("button", { name: "Launch" })); + expect(await screen.findByRole("button", { name: "Close" })).toBeInTheDocument(); + }); +}); diff --git a/apps/desktop/src/components/__tests__/ui-modal.test.tsx b/apps/desktop/src/components/__tests__/ui-modal.test.tsx new file mode 100644 index 00000000..e11f27bb --- /dev/null +++ b/apps/desktop/src/components/__tests__/ui-modal.test.tsx @@ -0,0 +1,100 @@ +import { describe, it, expect } from "vitest"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { useState } from "react"; +import { Modal } from "@harness-kit/ui"; + +// AC-61: every modal traps focus while open and returns it to the trigger. +function Harness({ conditional = false }: { conditional?: boolean }) { + const [open, setOpen] = useState(false); + const modal = ( + setOpen(false)} title="Rename" footer={}> + + + ); + return ( + <> + + {conditional ? (open ? modal : null) : modal} + + ); +} + +async function openModal(user: ReturnType) { + await user.click(screen.getByRole("button", { name: "Open" })); + const dialog = await screen.findByRole("dialog", { name: "Rename" }); + await waitFor(() => expect(dialog).toHaveFocus()); + return dialog; +} + +describe("@harness-kit/ui Modal focus", () => { + it("moves focus into the dialog on open", async () => { + const user = userEvent.setup(); + render(); + await openModal(user); + }); + + it("keeps Tab inside the dialog, wrapping at both ends", async () => { + const user = userEvent.setup(); + render(); + await openModal(user); + const close = screen.getByRole("button", { name: "Close dialog" }); + const input = screen.getByRole("textbox", { name: "Name" }); + const save = screen.getByRole("button", { name: "Save" }); + + await user.tab(); + expect(close).toHaveFocus(); + await user.tab(); + expect(input).toHaveFocus(); + await user.tab(); + expect(save).toHaveFocus(); + await user.tab(); // past the last: wraps, never reaches the page behind + expect(close).toHaveFocus(); + await user.tab({ shift: true }); // before the first: wraps to the last + expect(save).toHaveFocus(); + }); + + it("pulls focus back in when it is outside the dialog", async () => { + const user = userEvent.setup(); + render(); + await openModal(user); + screen.getByRole("button", { name: "Open" }).focus(); + await user.tab(); + expect(screen.getByRole("dialog")).toContainElement(document.activeElement as HTMLElement); + }); + + it("returns focus to the trigger on Escape", async () => { + const user = userEvent.setup(); + render(); + const trigger = screen.getByRole("button", { name: "Open" }); + await openModal(user); + await user.keyboard("{Escape}"); + expect(screen.queryByRole("dialog")).not.toBeInTheDocument(); + expect(trigger).toHaveFocus(); + }); + + it("returns focus to the trigger when the parent unmounts the modal", async () => { + const user = userEvent.setup(); + render(); + const trigger = screen.getByRole("button", { name: "Open" }); + await openModal(user); + await user.click(screen.getByRole("button", { name: "Close dialog" })); + expect(screen.queryByRole("dialog")).not.toBeInTheDocument(); + expect(trigger).toHaveFocus(); + }); + + it("gives two open modals distinct title ids", async () => { + render( + <> + {}} title="First"> + a + + {}} title="Second"> + b + + , + ); + expect(screen.getByRole("dialog", { name: "First" })).toBeInTheDocument(); + expect(screen.getByRole("dialog", { name: "Second" })).toBeInTheDocument(); + }); +}); diff --git a/apps/desktop/src/components/observatory/BudgetAlertBanner.tsx b/apps/desktop/src/components/observatory/BudgetAlertBanner.tsx index 8dd44571..c816df56 100644 --- a/apps/desktop/src/components/observatory/BudgetAlertBanner.tsx +++ b/apps/desktop/src/components/observatory/BudgetAlertBanner.tsx @@ -65,7 +65,7 @@ export default function BudgetAlertBanner({
); })} - -
); } diff --git a/apps/desktop/src/pages/drift/__tests__/DriftPage.test.tsx b/apps/desktop/src/pages/drift/__tests__/DriftPage.test.tsx index c3047c79..478c9719 100644 --- a/apps/desktop/src/pages/drift/__tests__/DriftPage.test.tsx +++ b/apps/desktop/src/pages/drift/__tests__/DriftPage.test.tsx @@ -32,10 +32,20 @@ vi.mock("@tauri-apps/api/path", () => ({ join: vi.fn((...segments: string[]) => Promise.resolve(segments.join("/"))), })); +// Paths with no file, and paths whose read fails. Every other harness.yaml +// exists and reads as a valid one. +const absentPaths = new Set(); +const unreadablePaths = new Set(); + function makeFsProvider(cwd: string) { return { cwd: () => cwd, - readFile: vi.fn(() => Promise.resolve('version: "1"\nmetadata:\n name: test-harness\n')), + exists: vi.fn((p: string) => Promise.resolve(!absentPaths.has(p))), + readFile: vi.fn((p: string) => + unreadablePaths.has(p) + ? Promise.reject(new Error("EACCES: permission denied")) + : Promise.resolve('version: "1"\nmetadata:\n name: test-harness\n'), + ), joinPath: (...segs: string[]) => segs.join("/"), homedir: () => Promise.resolve("/home/user"), }; @@ -55,7 +65,9 @@ vi.mock("../../../lib/tauri", () => ({ unacknowledgeDriftItem: vi.fn(), getAcknowledgedDriftItems: () => mockGetAcknowledgedDriftItems(), migrateDriftAcknowledgements: vi.fn(() => Promise.resolve(0)), + readHarnessFile: () => mockReadHarnessFile(), })); +const mockReadHarnessFile = vi.fn(); function renderPage() { return render( @@ -68,11 +80,14 @@ function renderPage() { describe("DriftPage", () => { beforeEach(() => { vi.clearAllMocks(); + absentPaths.clear(); + unreadablePaths.clear(); localStorage.clear(); mockParseHarness.mockReturnValue({ config: { metadata: { name: "test-harness" } } }); mockValidateHarness.mockReturnValue({ valid: true }); mockGetAcknowledgedDriftItems.mockResolvedValue([]); mockGrantProjectScope.mockResolvedValue(undefined); + mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null }); }); it("shows the empty state when there is no drift", async () => { @@ -81,6 +96,85 @@ describe("DriftPage", () => { await waitFor(() => expect(screen.getByText("No drift detected")).toBeInTheDocument()); }); + describe("what the empty state claims (AC-55)", () => { + const EMPTY = { items: [], hasDrift: false, byClass: {} }; + + it("says 'no harness.yaml', not 'No drift detected', when ~/.claude/harness.yaml is absent", async () => { + absentPaths.add("/home/user/.claude/harness.yaml"); + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + expect(await screen.findByTestId("drift-scope-notes")).toHaveTextContent( + "no harness.yaml at /home/user/.claude/harness.yaml", + ); + expect(screen.queryByText("No drift detected")).not.toBeInTheDocument(); + expect(mockDetectDrift).not.toHaveBeenCalled(); + }); + + it("tells the user to move ~/harness.yaml when only that file exists", async () => { + absentPaths.add("/home/user/.claude/harness.yaml"); + mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null, legacy_home_file: true }); + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + expect(await screen.findByTestId("drift-scope-notes")).toHaveTextContent( + "Found ~/harness.yaml. Harness Kit now reads ~/.claude/harness.yaml; move the file there.", + ); + }); + + it("shows no move notice when ~/.claude/harness.yaml exists", async () => { + mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null, legacy_home_file: true }); + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + await screen.findByText("No drift detected"); + expect(screen.queryByText(/Found ~\/harness.yaml/)).not.toBeInTheDocument(); + }); + + it("says 'could not read' when the file exists but cannot be read", async () => { + unreadablePaths.add("/home/user/.claude/harness.yaml"); + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + expect(await screen.findByTestId("drift-scope-notes")).toHaveTextContent( + "could not read /home/user/.claude/harness.yaml (EACCES: permission denied)", + ); + expect(screen.queryByText("No drift detected")).not.toBeInTheDocument(); + }); + + it("says 'never compiled' when every slot is missing", async () => { + mockDetectDrift.mockResolvedValue({ + items: [ + { class: "missing", path: "CLAUDE.md", adapter: "claude-code", target: "claude-code", harnessName: "h", slot: "operational", detail: "d" }, + ], + hasDrift: true, + byClass: {}, + }); + renderPage(); + expect(await screen.findByTestId("drift-scope-notes")).toHaveTextContent("has never been compiled"); + }); + + it("does not mention 'this project' when no project is set", async () => { + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + const description = await screen.findByText(/Every deployed config matches harness\.yaml/); + expect(description).toHaveTextContent("across Global."); + expect(description).not.toHaveTextContent("this project"); + }); + + it("mentions 'this project' when one is set, and reads its committed harness.yaml", async () => { + localStorage.setItem("harness-kit-current-project", "/repo/first"); + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + const description = await screen.findByText(/Every deployed config matches harness\.yaml/); + expect(description).toHaveTextContent("across Global and this project."); + }); + + it("reports a project with no committed harness.yaml by its own path", async () => { + localStorage.setItem("harness-kit-current-project", "/repo/first"); + absentPaths.add("/repo/first/harness.yaml"); + mockDetectDrift.mockResolvedValue(EMPTY); + renderPage(); + expect(await screen.findByTestId("drift-scope-notes")).toHaveTextContent("no harness.yaml at /repo/first/harness.yaml"); + }); + }); + it("a failed scan says so, with Retry and the raw error behind Details, not 'No drift detected' (AC-20)", async () => { const raw = "EACCES: permission denied, open '/home/user/.claude/CLAUDE.md'"; mockDetectDrift diff --git a/apps/desktop/src/pages/drift/__tests__/drift-data.test.ts b/apps/desktop/src/pages/drift/__tests__/drift-data.test.ts new file mode 100644 index 00000000..4df3bc37 --- /dev/null +++ b/apps/desktop/src/pages/drift/__tests__/drift-data.test.ts @@ -0,0 +1,126 @@ +import { describe, it, expect, vi } from "vitest"; +import type { DriftItem, FsProvider } from "@harness-kit/core"; +import { + collectDrift, + describeScopes, + scopeHarnessPath, + type DriftScope, + type ScopedDriftItem, +} from "../drift-data"; + +const mockDetectDrift = vi.fn(); +vi.mock("@harness-kit/core", async (importOriginal) => ({ + ...(await importOriginal()), + detectDrift: (...args: unknown[]) => mockDetectDrift(...args), +})); +vi.mock("@tauri-apps/api/path", () => ({ homeDir: vi.fn(async () => "/home/user") })); +vi.mock("../../../lib/harness-fs", () => ({ TauriFsProvider: vi.fn() })); +vi.mock("../../../lib/project-dir", () => ({ grantProjectDir: vi.fn(), projectDirLabel: (d: string) => d })); + +const VALID = 'version: "1"\nmetadata:\n name: t\n description: d\n'; + +/** An FsProvider holding `files` (path -> content or an Error to throw on read). */ +function fsWith(cwd: string, files: Record): FsProvider { + return { + cwd: () => cwd, + joinPath: (...segs: string[]) => segs.join("/"), + homedir: async () => "/home/user", + exists: async (p: string) => p in files, + readFile: async (p: string) => { + const v = files[p]; + if (v === undefined) throw new Error("not found"); + if (v instanceof Error) throw v; + return v; + }, + } as unknown as FsProvider; +} + +const globalScope = (files: Record): DriftScope => ({ + kind: "global", + root: "/home/user", + label: "Global", + fs: fsWith("/home/user", files), +}); +const projectScope = (files: Record): DriftScope => ({ + kind: "project", + root: "/repo", + label: "repo", + fs: fsWith("/repo", files), +}); + +const item = (cls: DriftItem["class"]): DriftItem => + ({ class: cls, path: "CLAUDE.md", adapter: "claude-code", harnessName: "t", slot: "operational" }) as DriftItem; +const entry = (scope: DriftScope, cls: DriftItem["class"]): ScopedDriftItem => ({ scope, item: item(cls) }); + +describe("scopeHarnessPath (AC-55)", () => { + it("is ~/.claude/harness.yaml for Global and /harness.yaml for a project", () => { + expect(scopeHarnessPath(globalScope({}))).toBe("/home/user/.claude/harness.yaml"); + expect(scopeHarnessPath(projectScope({}))).toBe("/repo/harness.yaml"); + }); +}); + +describe("collectDrift reads the personal profile and the project baseline (AC-55)", () => { + it("does not read ~/harness.yaml for Global", async () => { + mockDetectDrift.mockReset().mockResolvedValue({ items: [], hasDrift: false, byClass: {} }); + const stray = globalScope({ "/home/user/harness.yaml": VALID }); + await collectDrift([stray]); + expect(mockDetectDrift).not.toHaveBeenCalled(); + + const personal = globalScope({ "/home/user/.claude/harness.yaml": VALID }); + await collectDrift([personal]); + expect(mockDetectDrift).toHaveBeenCalledTimes(1); + }); + + it("reads the project's committed harness.yaml", async () => { + mockDetectDrift.mockReset().mockResolvedValue({ items: [], hasDrift: false, byClass: {} }); + await collectDrift([projectScope({ "/repo/harness.yaml": VALID })]); + expect(mockDetectDrift).toHaveBeenCalledTimes(1); + }); +}); + +describe("describeScopes distinguishes the four states (AC-55)", () => { + it("no harness.yaml", async () => { + const [s] = await describeScopes([globalScope({})], []); + expect(s.state).toBe("no-file"); + expect(s.path).toBe("/home/user/.claude/harness.yaml"); + }); + + it("could not read: the file exists but reading throws", async () => { + const [s] = await describeScopes( + [globalScope({ "/home/user/.claude/harness.yaml": new Error("EACCES: permission denied") })], + [], + ); + expect(s.state).toBe("unreadable"); + expect(s.detail).toContain("EACCES"); + }); + + it("could not read: the file exists but is not valid harness.yaml", async () => { + const [s] = await describeScopes([globalScope({ "/home/user/.claude/harness.yaml": "version: [" })], []); + expect(s.state).toBe("unreadable"); + }); + + it("never compiled: a harness.yaml whose every deployed slot is missing", async () => { + const scope = globalScope({ "/home/user/.claude/harness.yaml": VALID }); + const [s] = await describeScopes([scope], [entry(scope, "missing"), entry(scope, "missing")]); + expect(s.state).toBe("never-compiled"); + }); + + it("clean: a harness.yaml with no drift", async () => { + const scope = globalScope({ "/home/user/.claude/harness.yaml": VALID }); + const [s] = await describeScopes([scope], []); + expect(s.state).toBe("clean"); + }); + + it("drifted: some slots missing, others not, is drift and not 'never compiled'", async () => { + const scope = globalScope({ "/home/user/.claude/harness.yaml": VALID }); + const [s] = await describeScopes([scope], [entry(scope, "missing"), entry(scope, "modified-inside-markers")]); + expect(s.state).toBe("drifted"); + }); + + it("keeps each scope's entries apart", async () => { + const g = globalScope({ "/home/user/.claude/harness.yaml": VALID }); + const p = projectScope({ "/repo/harness.yaml": VALID }); + const states = await describeScopes([g, p], [entry(p, "missing")]); + expect(states.map((s) => s.state)).toEqual(["clean", "never-compiled"]); + }); +}); diff --git a/apps/desktop/src/pages/drift/drift-data.ts b/apps/desktop/src/pages/drift/drift-data.ts index d5fd3a6e..ee82af37 100644 --- a/apps/desktop/src/pages/drift/drift-data.ts +++ b/apps/desktop/src/pages/drift/drift-data.ts @@ -9,6 +9,7 @@ import { } from "@harness-kit/core"; import { TauriFsProvider } from "../../lib/harness-fs"; import { grantProjectDir, projectDirLabel } from "../../lib/project-dir"; +import { errorDetails } from "../../lib/error-details"; export interface DriftScope { kind: "global" | "project"; @@ -52,21 +53,58 @@ export function summarizeDrift(entries: ScopedDriftItem[], acknowledged: Readonl return { byHarness, total }; } -async function readScopeConfig(fs: FsProvider): Promise { - const path = fs.joinPath(fs.cwd(), "harness.yaml"); +/** + * The harness.yaml a scope is compared against (AC-55): Global is the personal + * profile at `~/.claude/harness.yaml`, the same file Profile, Compile and + * onboarding use; a project is its own committed `harness.yaml`, the team + * baseline. Never `~/harness.yaml`. + */ +export function scopeHarnessPath(scope: DriftScope): string { + return scope.kind === "global" + ? scope.fs.joinPath(scope.root, ".claude", "harness.yaml") + : scope.fs.joinPath(scope.root, "harness.yaml"); +} + +/** + * What Drift knows about one scope's harness.yaml. `no-file` and `unreadable` + * are different facts (nothing to compare against vs. a file we could not + * use); `never-compiled` and `clean` both have a usable file. + */ +export type ScopeState = "no-file" | "unreadable" | "never-compiled" | "clean" | "drifted"; + +export interface ScopeStatus { + scope: DriftScope; + state: ScopeState; + /** Absolute path of the harness.yaml this scope reads. */ + path: string; + /** Why the file could not be read (`unreadable` only). */ + detail?: string; +} + +type ScopeFile = + | { state: "no-file" } + | { state: "unreadable"; detail: string } + | { state: "ok"; config: HarnessConfig }; + +async function loadScopeFile(scope: DriftScope): Promise { + const path = scopeHarnessPath(scope); + if (!(await scope.fs.exists(path))) return { state: "no-file" }; let yamlString: string; try { - yamlString = await fs.readFile(path); - } catch { - return null; + yamlString = await scope.fs.readFile(path); + } catch (err) { + return { state: "unreadable", detail: errorDetails(err) }; } try { const { config } = parseHarness(yamlString); const validation = validateHarness(config); - if (!validation.valid) return null; - return config; - } catch { - return null; + if (!validation.valid) { + const first = validation.errors[0]; + return { state: "unreadable", detail: first ? `${first.path}: ${first.message}` : "not a valid harness.yaml" }; + } + return { state: "ok", config }; + } catch (err) { + return { state: "unreadable", detail: errorDetails(err) }; } } @@ -97,18 +135,44 @@ export async function buildDriftScopes(projectDir: string | null): Promise { const results: ScopedDriftItem[] = []; for (const scope of scopes) { - const config = await readScopeConfig(scope.fs); - if (!config) continue; + const file = await loadScopeFile(scope); + if (file.state !== "ok") continue; const homeRoot = await scope.fs.homedir(); - const report = await detectDrift(config, { fs: scope.fs, projectRoot: scope.fs.cwd(), homeRoot }); + const report = await detectDrift(file.config, { fs: scope.fs, projectRoot: scope.fs.cwd(), homeRoot }); for (const item of report.items) { results.push({ scope, item }); } } return results; } + +/** + * One status per scope (AC-55), given what `collectDrift` found. "Never + * compiled" is a file with at least one drift item where every item is + * `missing`: nothing the file describes has been deployed yet. Any other mix + * is drift. + */ +export async function describeScopes(scopes: DriftScope[], entries: ScopedDriftItem[]): Promise { + const statuses: ScopeStatus[] = []; + for (const scope of scopes) { + const path = scopeHarnessPath(scope); + const file = await loadScopeFile(scope); + if (file.state === "no-file") { + statuses.push({ scope, state: "no-file", path }); + } else if (file.state === "unreadable") { + statuses.push({ scope, state: "unreadable", path, detail: file.detail }); + } else { + const own = entries.filter((e) => e.scope.kind === scope.kind && e.scope.root === scope.root); + const state: ScopeState = + own.length === 0 ? "clean" : own.every((e) => e.item.class === "missing") ? "never-compiled" : "drifted"; + statuses.push({ scope, state, path }); + } + } + return statuses; +} diff --git a/apps/desktop/src/pages/fleet/RegistryEnrollment.tsx b/apps/desktop/src/pages/fleet/RegistryEnrollment.tsx index b40dce97..56cb8305 100644 --- a/apps/desktop/src/pages/fleet/RegistryEnrollment.tsx +++ b/apps/desktop/src/pages/fleet/RegistryEnrollment.tsx @@ -107,7 +107,7 @@ export function RegistryEnrollment({ inventory }: { inventory: Omit void sync(activeToken, preferredOrganization) }, }); diff --git a/apps/desktop/src/pages/fleet/__tests__/RegistryEnrollment.test.tsx b/apps/desktop/src/pages/fleet/__tests__/RegistryEnrollment.test.tsx index 5f026574..3dc182c7 100644 --- a/apps/desktop/src/pages/fleet/__tests__/RegistryEnrollment.test.tsx +++ b/apps/desktop/src/pages/fleet/__tests__/RegistryEnrollment.test.tsx @@ -36,7 +36,7 @@ describe("RegistryEnrollment failures (AC-20)", () => { fetchMock.mockRejectedValueOnce(new TypeError("Failed to fetch")).mockImplementation(() => json([])); render(); - expect(await screen.findByRole("alert")).toHaveTextContent("Couldn't sync with the registry"); + expect(await screen.findByRole("alert")).toHaveTextContent("Couldn't reach the registry"); // The raw network text is only in Details, not the status line. expect(screen.getByText("Failed to fetch")).not.toBeVisible(); expect(screen.queryByRole("button", { name: "Refresh assignment" })).not.toBeInTheDocument(); diff --git a/apps/desktop/src/pages/fleet/adapter-meta.ts b/apps/desktop/src/pages/fleet/adapter-meta.ts index dfeec1c1..ede48ef7 100644 --- a/apps/desktop/src/pages/fleet/adapter-meta.ts +++ b/apps/desktop/src/pages/fleet/adapter-meta.ts @@ -3,12 +3,12 @@ import type { HarnessInfo } from "@harness-kit/shared"; /** * Display metadata for each core AdapterId β€” name + a short mono monogram - * (DESIGN.md Β§6.3 Fleet matrix: "mono monogram tile + name + mono version"). + * (a mono monogram tile, the name, and a mono version). * * `harnessInfoId` cross-references the Rust `detect_harnesses()` probe (a * different, coarser id scheme) so we can show a CLI version string sourced - * from that existing probe rather than re-probing in core (core's fleet - * report never populates FleetCell.version β€” see packages/core/src/fleet/report.ts). + * from that existing probe rather than re-probing in core (core's report + * never populates FleetCell.version β€” see packages/core/src/fleet/report.ts). * Adapters with no corresponding detectHarnesses() entry (agents-md, pi) show * no version β€” that's honest, not a bug. */ diff --git a/apps/desktop/src/pages/harness/HarnessFilePage.tsx b/apps/desktop/src/pages/harness/HarnessFilePage.tsx index dcaf4363..7f1060e3 100644 --- a/apps/desktop/src/pages/harness/HarnessFilePage.tsx +++ b/apps/desktop/src/pages/harness/HarnessFilePage.tsx @@ -1,10 +1,14 @@ -import { Suspense, lazy, useCallback, useEffect, useMemo, useState } from "react"; +import { Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useNavigate } from "react-router-dom"; import { Button, Card, ErrorNotice, Input } from "@harness-kit/ui"; -import { readHarnessFile, scanClaudeConfig, writeHarnessFile, saveCustomProfile } from "../../lib/tauri"; +import { writeHarnessFile, saveCustomProfile } from "../../lib/tauri"; +import { describeHarnessSource, readHarnessSource } from "../../lib/harness-source"; +import { LEGACY_HARNESS_NOTICE } from "../../lib/legacy-harness-notice"; +import { projectDirLabel, useProjectDir } from "../../lib/project-dir"; +import { importPersonalHarness } from "../../lib/personal-inventory"; import { parseHarness, validateHarnessYaml } from "@harness-kit/core"; import type { HarnessConfig, ValidationResult } from "@harness-kit/core"; -import { generateHarnessYaml, HARNESS_TEMPLATE } from "../../lib/harness-generator"; +import { HARNESS_TEMPLATE } from "../../lib/harness-generator"; import type { HarnessProfile } from "../../lib/profiles"; import { getAvailableViewModes } from "../../lib/viewModes"; import { useRegisterCommands } from "../../lib/commands"; @@ -34,6 +38,9 @@ export default function HarnessFilePage() { const [filePath, setFilePath] = useState(null); const [view, setView] = useState("formatted"); + // A file at ~/harness.yaml with none at ~/.claude/harness.yaml (existence only). + const [legacyHomeFile, setLegacyHomeFile] = useState(false); + // Editor state const [editorContent, setEditorContent] = useState(""); const [saving, setSaving] = useState(false); @@ -51,19 +58,47 @@ export default function HarnessFilePage() { const [profileSaveError, setProfileSaveError] = useState(null); const [profileSavedMsg, setProfileSavedMsg] = useState(false); + // AC-55: Profile follows the title-bar project. With one chosen it shows that + // project's committed harness.yaml (the team baseline), read-only; without + // one it is the editable personal ~/.claude/harness.yaml. + const [projectDir] = useProjectDir(); + const source = describeHarnessSource(projectDir); + const readOnly = source.kind === "project"; + + // A read still in flight for the previous project must not land on the new one. + const loadGeneration = useRef(0); const loadHarness = useCallback(() => { + const generation = ++loadGeneration.current; setLoading(true); - readHarnessFile() + setFetchError(null); + readHarnessSource(projectDir) .then((result) => { + if (generation !== loadGeneration.current) return; setFound(result.found); + setLegacyHomeFile(result.legacy_home_file === true); setDiskContent(result.content); setFilePath(result.path); }) - .catch((e) => setFetchError(errorDetails(e))) - .finally(() => setLoading(false)); - }, []); + .catch((e) => { + if (generation !== loadGeneration.current) return; + setFound(false); + setLegacyHomeFile(false); + setDiskContent(null); + setFilePath(null); + setFetchError(errorDetails(e)); + }) + .finally(() => { + if (generation === loadGeneration.current) setLoading(false); + }); + }, [projectDir]); - useEffect(() => { loadHarness(); }, [loadHarness]); + useEffect(() => { + // A new scope starts from the formatted view: the editor belongs to the + // personal file and holds its text. + setView("formatted"); + setSaveError(null); + loadHarness(); + }, [loadHarness]); const saveable = editorContent !== (diskContent ?? "") && view === "editor"; @@ -93,8 +128,9 @@ export default function HarnessFilePage() { setSaving(true); setSaveError(null); try { - // AC-50: only the file at the write target counts as "loaded". When the - // page loaded ~/harness.yaml instead, ~/.claude/harness.yaml was absent. + // AC-50: the digest is of the file at the write target; `undefined` + // when the page found no file there (AC-55: the personal profile is + // ~/.claude/harness.yaml and nothing else). const expected = filePath === "~/.claude/harness.yaml" ? await loadedDigest(diskContent) : undefined; const savedPath = await writeHarnessFile(editorContent, expected); setDiskContent(editorContent); @@ -152,9 +188,12 @@ export default function HarnessFilePage() { setGenerating(true); setGenerateError(null); try { - const scan = await scanClaudeConfig(); - const { yaml } = generateHarnessYaml(scan); - openEditor(yaml); + // AC-56: the same machine inventory the Machine grid shows. + const { harnessYaml } = await importPersonalHarness({ + name: "my-harness", + description: "Generated from existing Claude Code configuration.", + }); + openEditor(harnessYaml); } catch (e) { // Stay on the empty state: opening the blank template here would hide // the failure behind an editor that looks like a scan result. @@ -204,17 +243,17 @@ export default function HarnessFilePage() { const toolbarActions = found && !loading ? (
- {/* Sync */} + {/* Compile */} {/* Save as Profile */}
@@ -275,27 +314,35 @@ export default function HarnessFilePage() { // ── Render ──────────────────────────────────────────────────── const isFullHeight = view === "editor" && found; - const viewModes = getAvailableViewModes("harness.yaml", true); + const viewModes = getAvailableViewModes("harness.yaml", true).filter( + (mode) => !readOnly || mode.key !== "editor", + ); return (
+ {/* Eyebrow β€” a full shared PageHeader arrives in a later phase; this + small-caps kicker follows the same convention as SectionLabel in + SyncPage.tsx until then. The scope is always named: which + harness.yaml this page shows depends on the title-bar project. */} +
+ + Profile + + + {source.label} + {readOnly && " (read-only)"} + +
+ {/* Standardized toolbar */} {found && !loading && ( <> - {/* Eyebrow β€” a full shared PageHeader arrives in a later phase; this - small-caps kicker follows the same convention as SectionLabel - in SyncPage.tsx until then. */} -
- - Profile - -
+

+ No harness.yaml in {projectDirLabel(projectDir ?? "")} +

+

+ The team baseline is the harness.yaml committed + at the project root. Add one there, or clear the project in the title bar to work on your personal profile. +

+ + )} + + {!loading && !fetchError && !found && !readOnly && legacyHomeFile && ( +

+ {LEGACY_HARNESS_NOTICE} +

+ )} + + {!loading && !fetchError && !found && !readOnly && view !== "editor" && (

No harness.yaml found diff --git a/apps/desktop/src/pages/harness/PluginExplorerPage.tsx b/apps/desktop/src/pages/harness/PluginExplorerPage.tsx index 49afbc4b..57416ba8 100644 --- a/apps/desktop/src/pages/harness/PluginExplorerPage.tsx +++ b/apps/desktop/src/pages/harness/PluginExplorerPage.tsx @@ -111,7 +111,7 @@ export default function PluginExplorerPage() { animate={{ opacity: 1 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} - style={{ fontSize: "11px", color: "var(--success)", fontWeight: 500 }} + style={{ fontSize: "11px", color: "var(--success-text)", fontWeight: 500 }} > Saved diff --git a/apps/desktop/src/pages/harness/PluginsPage.tsx b/apps/desktop/src/pages/harness/PluginsPage.tsx index 970c7b74..6f5e7601 100644 --- a/apps/desktop/src/pages/harness/PluginsPage.tsx +++ b/apps/desktop/src/pages/harness/PluginsPage.tsx @@ -34,11 +34,11 @@ const PREVIEW_PLUGINS: InstalledPlugin[] = [ { name: "harness-share", version: "0.3.0", - description: "Compile and sync harness.yaml across AI tool configurations.", + description: "Compile harness.yaml to your AI tool configurations.", marketplace: "harness-kit", source: "browser-preview://plugins/harness-share", category: "Configure", - tags: ["sync", "configuration"], + tags: ["compile", "configuration"], component_counts: { skills: 4, agents: 0, scripts: 3 }, }, ]; @@ -404,8 +404,9 @@ export default function PluginsPage() { } navigate(`/harness/plugins/${encodeURIComponent(plugin.name)}`); }} - onContextMenu={(e) => { - setContextMenu({ x: e.clientX, y: e.clientY, plugin }); + menuOpen={contextMenu?.plugin.name === plugin.name} + onContextMenu={(at) => { + setContextMenu({ ...at, plugin }); }} /> ))} diff --git a/apps/desktop/src/pages/harness/SyncPage.tsx b/apps/desktop/src/pages/harness/SyncPage.tsx index 2fd8fa66..865681bd 100644 --- a/apps/desktop/src/pages/harness/SyncPage.tsx +++ b/apps/desktop/src/pages/harness/SyncPage.tsx @@ -6,7 +6,6 @@ import { COMPILE_SURFACE_IDS, compile, detectPlatforms, isCompileSurface, parseH import type { CompileResult, DetectedPlatform, SurfaceId } from "@harness-kit/core"; import { surfaceLabel } from "../../lib/surface-labels"; import { - readHarnessFile, syncCreateBackup, syncFileExists, syncListBackups, @@ -14,7 +13,8 @@ import { } from "../../lib/tauri"; import type { BackupManifest } from "../../lib/tauri"; import { SyncFsProvider } from "../../lib/sync-fs"; -import { grantProjectDir, useProjectDir } from "../../lib/project-dir"; +import { grantProjectDir, projectDirLabel, useProjectDir } from "../../lib/project-dir"; +import { describeHarnessSource, readHarnessSource } from "../../lib/harness-source"; import SyncPreview from "./sync/SyncPreview"; import { useRegisterCommands } from "../../lib/commands"; import { errorDetails } from "../../lib/error-details"; @@ -53,6 +53,16 @@ export default function SyncPage() { const projectDir = currentProject ?? ""; const [dirValid, setDirValid] = useState(false); const [dirChecking, setDirChecking] = useState(false); + // AC-55: what is compiled is the project's committed harness.yaml (the team + // baseline). Without one, and with no project chosen, it is the personal + // ~/.claude/harness.yaml; a project that has none keeps getting the personal + // profile compiled into it, as before. + const [personalFallback, setPersonalFallback] = useState(false); + const source = describeHarnessSource(currentProject); + const sourceLabel = + personalFallback && currentProject + ? `Personal profile β†’ ${projectDirLabel(currentProject)}` + : source.label; // Platforms const [detectedPlatforms, setDetectedPlatforms] = useState([]); @@ -75,14 +85,32 @@ export default function SyncPage() { const [backups, setBackups] = useState([]); // Load harness file + // A read still in flight for the previous project must not land on the new one. + const loadGeneration = useRef(0); const loadHarness = useCallback(() => { + const generation = ++loadGeneration.current; setHarnessLoading(true); setHarnessError(null); - readHarnessFile() + // Nothing from the previous scope may be previewed while this one loads. + setHarnessContent(null); + setHarnessPath(null); + setPersonalFallback(false); + readHarnessSource(currentProject) + .then(async (projectResult) => { + // A project without a committed harness.yaml keeps the personal + // profile; a file that could not be read rejects above instead. + if (projectResult.found || !currentProject) return projectResult; + const personal = await readHarnessSource(null); + if (generation === loadGeneration.current) setPersonalFallback(personal.found); + return personal; + }) .then((result) => { + if (generation !== loadGeneration.current) return; if (result.found && result.content) { setHarnessContent(result.content); setHarnessPath(result.path); + setHarnessName("default"); + setHarnessDescription(null); try { const { config } = parseHarness(result.content); setHarnessName(config.metadata?.name ?? "default"); @@ -94,12 +122,15 @@ export default function SyncPage() { } }) .catch((e) => { + if (generation !== loadGeneration.current) return; setHarnessContent(null); setHarnessPath(null); setHarnessError(errorDetails(e)); }) - .finally(() => setHarnessLoading(false)); - }, []); + .finally(() => { + if (generation === loadGeneration.current) setHarnessLoading(false); + }); + }, [currentProject]); useEffect(() => { loadHarness(); }, [loadHarness]); useEffect(() => { syncListBackups().then(setBackups).catch(() => {}); }, []); @@ -292,7 +323,7 @@ export default function SyncPage() { } title="No harness.yaml found" - description="Create your harness.yaml first, then come back to sync it to your projects." + description="Create your harness.yaml first, then come back to compile it to your projects." action={

diff --git a/apps/desktop/src/pages/harness/__tests__/HarnessFilePage.test.tsx b/apps/desktop/src/pages/harness/__tests__/HarnessFilePage.test.tsx index 2c824d4c..34d367b2 100644 --- a/apps/desktop/src/pages/harness/__tests__/HarnessFilePage.test.tsx +++ b/apps/desktop/src/pages/harness/__tests__/HarnessFilePage.test.tsx @@ -4,20 +4,37 @@ import { MemoryRouter } from "react-router-dom"; import HarnessFilePage from "../HarnessFilePage"; import { CommandPalette } from "../../../components/CommandPalette"; import { loadedDigest } from "../../../lib/loaded-digest"; +import { setCurrentProjectDir } from "../../../lib/project-dir"; // ── Mocks ────────────────────────────────────────────────────── const mockReadHarnessFile = vi.fn(); const mockWriteHarnessFile = vi.fn(); -const mockScanClaudeConfig = vi.fn(); +const mockGrantProjectScope = vi.fn(); vi.mock("../../../lib/tauri", () => ({ readHarnessFile: () => mockReadHarnessFile(), writeHarnessFile: (content: string, expectedSha256?: string) => mockWriteHarnessFile(content, expectedSha256), - scanClaudeConfig: () => mockScanClaudeConfig(), + grantProjectScope: (dir: string) => mockGrantProjectScope(dir), +})); + +// A chosen project is read through the sync bridge; these are its files. +const projectFiles: Record = {}; +vi.mock("../../../lib/sync-fs", () => ({ + SyncFsProvider: vi.fn(function SyncFsProvider(this: Record) { + this.joinPath = (...segs: string[]) => segs.join("/"); + this.exists = async (p: string) => p in projectFiles; + this.readFile = async (p: string) => projectFiles[p]; + }), +})); +vi.mock("../../../lib/harness-fs", () => ({ TauriFsProvider: vi.fn() })); + +// AC-56: "Generate from Claude Code setup" builds from the machine inventory. +const mockImportPersonalHarness = vi.fn(); +vi.mock("../../../lib/personal-inventory", () => ({ + importPersonalHarness: () => mockImportPersonalHarness(), })); vi.mock("../../../lib/harness-generator", () => ({ - generateHarnessYaml: () => ({ yaml: "version: \"1\"\n# generated\n" }), HARNESS_TEMPLATE: "# template\n", })); @@ -109,14 +126,19 @@ describe("HarnessFilePage", () => { ); }); - it("sends no digest when the page loaded ~/harness.yaml, since the write target was absent (AC-50)", async () => { - mockReadHarnessFile.mockResolvedValue({ found: true, content: 'version: "1"\n', path: "~/harness.yaml" }); - mockWriteHarnessFile.mockResolvedValue("~/.claude/harness.yaml"); + it("tells the user a ~/harness.yaml needs moving when ~/.claude/harness.yaml is absent", async () => { + mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null, legacy_home_file: true }); renderPage(); - fireEvent.click(await screen.findByText("Editor")); - fireEvent.change(await screen.findByTestId("fake-editor"), { target: { value: "edited\n" } }); - fireEvent.keyDown(window, { key: "s", metaKey: true }); - await waitFor(() => expect(mockWriteHarnessFile).toHaveBeenCalledWith("edited\n", undefined)); + expect(await screen.findByTestId("legacy-harness-notice")).toHaveTextContent( + "Found ~/harness.yaml. Harness Kit now reads ~/.claude/harness.yaml; move the file there.", + ); + }); + + it("shows no legacy notice when there is no file at ~/harness.yaml", async () => { + mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null }); + renderPage(); + await screen.findByText("No harness.yaml found"); + expect(screen.queryByTestId("legacy-harness-notice")).not.toBeInTheDocument(); }); it("names a changed-on-disk refusal and offers Reload from disk (AC-50)", async () => { @@ -148,11 +170,11 @@ describe("HarnessFilePage", () => { fireEvent.click(await screen.findByText("Editor")); const editor = await screen.findByTestId("fake-editor"); // Nothing changed yet: listed, but off like the Save button. - expect(palette().getByRole("button", { name: /Save harness\.yaml/ })).toHaveAttribute("aria-disabled", "true"); + expect(palette().getByRole("option", { name: /Save harness\.yaml/ })).toHaveAttribute("aria-disabled", "true"); fireEvent.change(editor, { target: { value: 'version: "1"\nmetadata:\n name: first\n' } }); fireEvent.change(editor, { target: { value: 'version: "1"\nmetadata:\n name: second\n' } }); - const save = palette().getByRole("button", { name: /Save harness\.yaml/ }); + const save = palette().getByRole("option", { name: /Save harness\.yaml/ }); expect(save).not.toHaveAttribute("aria-disabled"); fireEvent.click(save); @@ -181,9 +203,9 @@ describe("HarnessFilePage", () => { it("keeps a failed scan on the empty state with the error and Retry scan, not the template (AC-20)", async () => { mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null }); - mockScanClaudeConfig + mockImportPersonalHarness .mockRejectedValueOnce("permission denied: ~/.claude") - .mockResolvedValue({}); + .mockResolvedValue({ harnessYaml: 'version: "1"\n# generated\n' }); renderPage(); fireEvent.click(await screen.findByRole("button", { name: "Generate from Claude Code setup" })); @@ -196,7 +218,55 @@ describe("HarnessFilePage", () => { fireEvent.click(screen.getByRole("button", { name: "Retry scan" })); const editor = await screen.findByTestId("fake-editor"); expect(editor).toHaveValue('version: "1"\n# generated\n'); - expect(mockScanClaudeConfig).toHaveBeenCalledTimes(2); + expect(mockImportPersonalHarness).toHaveBeenCalledTimes(2); expect(screen.queryByRole("alert")).not.toBeInTheDocument(); }); }); + +describe("HarnessFilePage follows the title-bar project (AC-55)", () => { + beforeEach(() => { + vi.clearAllMocks(); + for (const key of Object.keys(projectFiles)) delete projectFiles[key]; + mockGrantProjectScope.mockResolvedValue(undefined); + act(() => setCurrentProjectDir(null)); + }); + + it("labels the personal profile when no project is chosen", async () => { + mockReadHarnessFile.mockResolvedValue({ found: true, content: 'version: "1"\n', path: "~/.claude/harness.yaml" }); + renderPage(); + expect(await screen.findByTestId("profile-scope")).toHaveTextContent("Personal profile"); + }); + + it("shows the project's committed harness.yaml, read-only, with the scope in the header", async () => { + projectFiles["/work/acme/harness.yaml"] = 'version: "1"\nmetadata:\n name: team\n'; + act(() => setCurrentProjectDir("/work/acme")); + renderPage(); + expect(await screen.findByText("/work/acme/harness.yaml")).toBeInTheDocument(); + expect(screen.getByTestId("profile-scope")).toHaveTextContent("Team baseline Β· acme"); + expect(mockReadHarnessFile).not.toHaveBeenCalled(); + // No Editor view, so nothing here can write to the project file. + expect(screen.queryByText("Editor")).toBeNull(); + expect(screen.getByText(/read-only/i)).toBeInTheDocument(); + }); + + it("says the project has no harness.yaml and offers no personal-profile actions", async () => { + act(() => setCurrentProjectDir("/work/acme")); + renderPage(); + expect(await screen.findByText(/No harness\.yaml in acme/)).toBeInTheDocument(); + expect(screen.queryByRole("button", { name: "Generate from Claude Code setup" })).toBeNull(); + expect(screen.queryByRole("button", { name: "Create from scratch" })).toBeNull(); + expect(screen.getByTestId("profile-scope")).toHaveTextContent("Team baseline Β· acme"); + }); + + it("returns to the personal profile when the project is cleared", async () => { + projectFiles["/work/acme/harness.yaml"] = 'version: "1"\n'; + mockReadHarnessFile.mockResolvedValue({ found: true, content: 'version: "1"\n', path: "~/.claude/harness.yaml" }); + act(() => setCurrentProjectDir("/work/acme")); + renderPage(); + await screen.findByText("/work/acme/harness.yaml"); + act(() => setCurrentProjectDir(null)); + expect(await screen.findByText("~/.claude/harness.yaml")).toBeInTheDocument(); + expect(screen.getByTestId("profile-scope")).toHaveTextContent("Personal profile"); + expect(screen.getByText("Editor")).toBeInTheDocument(); + }); +}); diff --git a/apps/desktop/src/pages/harness/__tests__/PluginRow.test.tsx b/apps/desktop/src/pages/harness/__tests__/PluginRow.test.tsx new file mode 100644 index 00000000..01d597a0 --- /dev/null +++ b/apps/desktop/src/pages/harness/__tests__/PluginRow.test.tsx @@ -0,0 +1,45 @@ +import { describe, it, expect, vi } from "vitest"; +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import PluginRow from "../plugins/PluginRow"; + +// AC-61: a plugin row is reachable and operable from the keyboard, and its +// context menu is a menu button, not a right-click-only gesture. +const plugin = { name: "demo", version: "1.0.0", description: "A demo plugin" }; + +function setup(extra: { menuOpen?: boolean } = {}) { + const onClick = vi.fn(); + const onContextMenu = vi.fn(); + render(); + return { onClick, onContextMenu }; +} + +describe("PluginRow keyboard", () => { + it("opens the plugin from its name with Enter and Space", async () => { + const user = userEvent.setup(); + const { onClick } = setup(); + await user.tab(); + expect(screen.getByRole("button", { name: "demo" })).toHaveFocus(); + await user.keyboard("{Enter}"); + await user.keyboard(" "); + expect(onClick).toHaveBeenCalledTimes(2); + }); + + it("has a menu button that announces the menu and its state", () => { + setup({ menuOpen: true }); + const actions = screen.getByRole("button", { name: "Actions for demo" }); + expect(actions).toHaveAttribute("aria-haspopup", "menu"); + expect(actions).toHaveAttribute("aria-expanded", "true"); + }); + + it("opens the menu from the keyboard without opening the plugin", async () => { + const user = userEvent.setup(); + const { onClick, onContextMenu } = setup(); + await user.tab(); + await user.tab(); + expect(screen.getByRole("button", { name: "Actions for demo" })).toHaveFocus(); + await user.keyboard("{Enter}"); + expect(onContextMenu).toHaveBeenCalledOnce(); + expect(onClick).not.toHaveBeenCalled(); + }); +}); diff --git a/apps/desktop/src/pages/harness/__tests__/PluginsPage.test.tsx b/apps/desktop/src/pages/harness/__tests__/PluginsPage.test.tsx index 3100d038..75f65658 100644 --- a/apps/desktop/src/pages/harness/__tests__/PluginsPage.test.tsx +++ b/apps/desktop/src/pages/harness/__tests__/PluginsPage.test.tsx @@ -356,7 +356,7 @@ describe("PluginsPage drag-to-import (Tauri drag-drop event)", () => { ); await waitFor(() => expect(screen.queryByText("Loading…")).not.toBeInTheDocument()); const option = () => - within(screen.getByRole("dialog", { name: "Command palette" })).getByRole("button", { + within(screen.getByRole("dialog", { name: "Command palette" })).getByRole("option", { name: "Import plugin from folder…", }); expect(option()).not.toHaveAttribute("aria-disabled"); diff --git a/apps/desktop/src/pages/harness/__tests__/SyncPage.test.tsx b/apps/desktop/src/pages/harness/__tests__/SyncPage.test.tsx index 028f30bd..58674820 100644 --- a/apps/desktop/src/pages/harness/__tests__/SyncPage.test.tsx +++ b/apps/desktop/src/pages/harness/__tests__/SyncPage.test.tsx @@ -45,11 +45,19 @@ vi.mock("../../../lib/harness-generator", () => ({ HARNESS_TEMPLATE: 'version: "1"\n# template', })); +// The chosen project's committed harness.yaml (AC-55): `null` means the +// project has none. Every project in these tests holds the same content. +let projectHarness: string | null = 'version: "1"'; vi.mock("../../../lib/sync-fs", () => ({ // Must be constructible β€” SyncPage calls `new SyncFsProvider(dir)`, and an // arrow-function implementation throws "not a constructor" under `new`. - SyncFsProvider: vi.fn(function SyncFsProvider() { return {}; }), + SyncFsProvider: vi.fn(function SyncFsProvider(this: Record) { + this.joinPath = (...segs: string[]) => segs.join("/"); + this.exists = async (p: string) => projectHarness !== null && p.endsWith("/harness.yaml"); + this.readFile = async () => projectHarness; + }), })); +vi.mock("../../../lib/harness-fs", () => ({ TauriFsProvider: vi.fn() })); // framer-motion: render children without animation vi.mock("framer-motion", () => ({ @@ -85,6 +93,7 @@ function renderPage() { describe("SyncPage", () => { beforeEach(() => { vi.clearAllMocks(); + projectHarness = 'version: "1"'; mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null }); mockSyncFileExists.mockResolvedValue(false); mockSyncListBackups.mockResolvedValue([]); @@ -193,16 +202,16 @@ describe("SyncPage", () => { ); const palette = () => within(screen.getByRole("dialog", { name: "Command palette" })); await screen.findByText(/Directory found/i); - const preview = palette().getByRole("button", { name: "Preview compile changes" }); + const preview = palette().getByRole("option", { name: "Preview compile changes" }); await waitFor(() => expect(preview).not.toHaveAttribute("aria-disabled")); - expect(palette().queryByRole("button", { name: /Apply/ })).not.toBeInTheDocument(); + expect(palette().queryByRole("option", { name: /Apply/ })).not.toBeInTheDocument(); fireEvent.click(preview); await waitFor(() => expect(compile).toHaveBeenCalledTimes(1)); expect(await screen.findByRole("button", { name: "Apply 1 file" })).toBeInTheDocument(); - expect(palette().getByRole("button", { name: "Apply 1 compiled file" })).not.toHaveAttribute("aria-disabled"); + expect(palette().getByRole("option", { name: "Apply 1 compiled file" })).not.toHaveAttribute("aria-disabled"); // Preview is off outside the idle phase, button and command alike. - expect(palette().getByRole("button", { name: "Preview compile changes" })).toHaveAttribute("aria-disabled", "true"); + expect(palette().getByRole("option", { name: "Preview compile changes" })).toHaveAttribute("aria-disabled", "true"); }); it("a failed preview names what failed, raw error behind Details, and Retry previews again (AC-20)", async () => { @@ -277,7 +286,7 @@ describe("SyncPage", () => { // The old preview is gone, button and command alike, and nothing was written. expect(screen.queryByRole("button", { name: /^Apply/ })).not.toBeInTheDocument(); - expect(palette().queryByRole("button", { name: /^Apply/ })).not.toBeInTheDocument(); + expect(palette().queryByRole("option", { name: /^Apply/ })).not.toBeInTheDocument(); expect(screen.getByRole("button", { name: "Preview Changes" })).toBeEnabled(); expect(syncCreateBackup).not.toHaveBeenCalled(); expect(syncWriteFiles).not.toHaveBeenCalled(); @@ -287,7 +296,7 @@ describe("SyncPage", () => { expect(vi.mocked(compile).mock.calls[1][1]).toEqual(["cursor"]); fireEvent.click(await screen.findByRole("button", { name: "Apply 1 file" })); - await screen.findByText("Sync complete"); + await screen.findByText("Compile complete"); expect(syncCreateBackup).toHaveBeenCalledTimes(1); expect(syncCreateBackup).toHaveBeenCalledWith("/repo/stale", "default", ["cursor"], []); expect(syncWriteFiles).toHaveBeenCalledTimes(1); @@ -353,11 +362,11 @@ describe("SyncPage", () => { return settle; } - it("does not show Sync complete on the new project when an old apply succeeds", async () => { + it("does not show Compile complete on the new project when an old apply succeeds", async () => { const settle = await applyThenSwitchProject(); await act(async () => { settle.resolve(); }); - expect(screen.queryByText("Sync complete")).not.toBeInTheDocument(); + expect(screen.queryByText("Compile complete")).not.toBeInTheDocument(); expect(screen.getByRole("button", { name: "Preview Changes" })).toBeEnabled(); // The backup the old apply took still shows up in the list. await waitFor(() => expect(mockSyncListBackups).toHaveBeenCalled()); @@ -374,6 +383,71 @@ describe("SyncPage", () => { }); }); + describe("harness source follows the title-bar project (AC-55)", () => { + beforeEach(() => { + mockSyncFileExists.mockResolvedValue(true); + act(() => setCurrentProjectDir(null)); + }); + + it("names the personal profile when no project is chosen", async () => { + mockReadHarnessFile.mockResolvedValue({ found: true, content: 'version: "1"', path: "/home/user/.claude/harness.yaml" }); + renderPage(); + expect(await screen.findByTestId("compile-source")).toHaveTextContent("Personal profile"); + }); + + it("compiles the project's committed harness.yaml, not the personal one", async () => { + projectHarness = 'version: "1"\nmetadata:\n name: team\n'; + mockReadHarnessFile.mockResolvedValue({ found: true, content: "personal", path: "/home/user/.claude/harness.yaml" }); + vi.mocked(detectPlatforms).mockResolvedValueOnce([ + { platform: "cursor", indicators: [".cursor"], needsConfirmation: false }, + ]); + vi.mocked(compile).mockResolvedValueOnce({ harnessName: "team", targets: ["cursor"], files: [], warnings: [] } as never); + setCurrentProjectDir("/work/acme"); + renderPage(); + + expect(await screen.findByTestId("compile-source")).toHaveTextContent("Team baseline Β· acme"); + expect(screen.getByText("/work/acme/harness.yaml")).toBeInTheDocument(); + await screen.findByText(/Directory found/i); + const previewButton = screen.getByRole("button", { name: "Preview Changes" }); + await waitFor(() => expect(previewButton).toBeEnabled()); + fireEvent.click(previewButton); + + await waitFor(() => expect(compile).toHaveBeenCalledTimes(1)); + expect(vi.mocked(compile).mock.calls[0][0]).toBe('version: "1"\nmetadata:\n name: team\n'); + expect(mockReadHarnessFile).not.toHaveBeenCalled(); + }); + + it("compiles the personal profile into a project that has no harness.yaml, and says so", async () => { + projectHarness = null; + mockReadHarnessFile.mockResolvedValue({ found: true, content: "personal", path: "/home/user/.claude/harness.yaml" }); + vi.mocked(detectPlatforms).mockResolvedValueOnce([ + { platform: "cursor", indicators: [".cursor"], needsConfirmation: false }, + ]); + vi.mocked(compile).mockResolvedValueOnce({ harnessName: "default", targets: ["cursor"], files: [], warnings: [] } as never); + setCurrentProjectDir("/work/acme"); + renderPage(); + + expect(await screen.findByTestId("compile-source")).toHaveTextContent("Personal profile β†’ acme"); + expect(screen.getByText("/home/user/.claude/harness.yaml")).toBeInTheDocument(); + await screen.findByText(/Directory found/i); + const previewButton = screen.getByRole("button", { name: "Preview Changes" }); + await waitFor(() => expect(previewButton).toBeEnabled()); + fireEvent.click(previewButton); + await waitFor(() => expect(compile).toHaveBeenCalledTimes(1)); + expect(vi.mocked(compile).mock.calls[0][0]).toBe("personal"); + }); + + it("says there is nothing to compile when neither the project nor the personal profile has one", async () => { + projectHarness = null; + mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null }); + setCurrentProjectDir("/work/acme"); + renderPage(); + + expect(await screen.findByText("No harness.yaml found")).toBeInTheDocument(); + expect(screen.queryByRole("button", { name: "Preview Changes" })).not.toBeInTheDocument(); + }); + }); + describe("project directory (AC-17)", () => { beforeEach(() => { mockReadHarnessFile.mockResolvedValue({ found: true, content: 'version: "1"', path: "/home/user/.claude/harness.yaml" }); diff --git a/apps/desktop/src/pages/harness/harness-file/EnvSection.tsx b/apps/desktop/src/pages/harness/harness-file/EnvSection.tsx index 1bc818c5..0bbe472f 100644 --- a/apps/desktop/src/pages/harness/harness-file/EnvSection.tsx +++ b/apps/desktop/src/pages/harness/harness-file/EnvSection.tsx @@ -11,7 +11,7 @@ const requiredBadgeStyle: CSSProperties = { padding: "1px 6px", borderRadius: "10px", background: "var(--danger-light)", - color: "var(--danger)", + color: "var(--danger-text)", }; const sensitiveBadgeStyle: CSSProperties = { diff --git a/apps/desktop/src/pages/harness/harness-file/PermissionsSection.tsx b/apps/desktop/src/pages/harness/harness-file/PermissionsSection.tsx index 901b33ef..3489a996 100644 --- a/apps/desktop/src/pages/harness/harness-file/PermissionsSection.tsx +++ b/apps/desktop/src/pages/harness/harness-file/PermissionsSection.tsx @@ -91,21 +91,21 @@ const toolItemStyle: CSSProperties = { const allowToolStyle: CSSProperties = { ...toolItemStyle, background: "var(--success-light)", - color: "var(--success)", + color: "var(--success-text)", border: "1px solid var(--success-light)", }; const denyToolStyle: CSSProperties = { ...toolItemStyle, background: "var(--danger-light)", - color: "var(--danger)", + color: "var(--danger-text)", border: "1px solid var(--danger-light)", }; const askToolStyle: CSSProperties = { ...toolItemStyle, background: "var(--warning-light)", - color: "var(--warning)", + color: "var(--warning-text)", border: "1px solid var(--warning-light)", }; @@ -160,7 +160,7 @@ export default function PermissionsSection({ permissions }: PermissionsSectionPr {tools?.allow && tools.allow.length > 0 && (
0 && (
0 && (
Paths
{paths?.writable && paths.writable.length > 0 && (
-
Writable
+
Writable
{paths.writable.map((p) => ( - {p} + {p} ))}
)} diff --git a/apps/desktop/src/pages/harness/harness-file/ValidationBanner.tsx b/apps/desktop/src/pages/harness/harness-file/ValidationBanner.tsx index 4c7bde98..3f773922 100644 --- a/apps/desktop/src/pages/harness/harness-file/ValidationBanner.tsx +++ b/apps/desktop/src/pages/harness/harness-file/ValidationBanner.tsx @@ -47,7 +47,7 @@ export default function ValidationBanner({ result }: ValidationBannerProps) { }; return ( - + Validation errors:
    {shown.map((err, i) => ( diff --git a/apps/desktop/src/pages/harness/plugins/ImportBanner.tsx b/apps/desktop/src/pages/harness/plugins/ImportBanner.tsx index b6be6c7b..56c3ce1d 100644 --- a/apps/desktop/src/pages/harness/plugins/ImportBanner.tsx +++ b/apps/desktop/src/pages/harness/plugins/ImportBanner.tsx @@ -62,7 +62,7 @@ export default function ImportBanner({ status, onDismiss }: ImportBannerProps) { const TONES = { accent: { background: "var(--accent-light)", color: "var(--accent-text)" }, - success: { background: "var(--success-light)", color: "var(--success)" }, + success: { background: "var(--success-light)", color: "var(--success-text)" }, } as const; function Reveal({ children }: { children: ReactNode }) { diff --git a/apps/desktop/src/pages/harness/plugins/PluginRow.tsx b/apps/desktop/src/pages/harness/plugins/PluginRow.tsx index c44fe5ad..f39046a7 100644 --- a/apps/desktop/src/pages/harness/plugins/PluginRow.tsx +++ b/apps/desktop/src/pages/harness/plugins/PluginRow.tsx @@ -9,10 +9,13 @@ interface PluginRowProps { index: number; isLast: boolean; onClick: () => void; - onContextMenu: (e: React.MouseEvent) => void; + /** Right-click, or the row's menu button; `x`/`y` is where to anchor the menu. */ + onContextMenu: (at: { x: number; y: number }) => void; + /** True while this row's menu is open (drives the menu button's aria-expanded). */ + menuOpen?: boolean; } -export default function PluginRow({ plugin, update, index, isLast, onClick, onContextMenu }: PluginRowProps) { +export default function PluginRow({ plugin, update, index, isLast, onClick, onContextMenu, menuOpen = false }: PluginRowProps) { const counts = formatComponentCounts(plugin.component_counts); return ( @@ -23,7 +26,7 @@ export default function PluginRow({ plugin, update, index, isLast, onClick, onCo onClick={onClick} onContextMenu={(e) => { e.preventDefault(); - onContextMenu(e); + onContextMenu({ x: e.clientX, y: e.clientY }); }} style={{ display: "flex", alignItems: "center", gap: "12px", @@ -37,9 +40,15 @@ export default function PluginRow({ plugin, update, index, isLast, onClick, onCo {/* Left zone: name, description, counts, tags */}
    - + {/* The keyboard way in: a native button, so Enter and Space work. + Its click bubbles to the row's onClick, which opens the plugin. */} +
    @@ -68,6 +77,23 @@ export default function PluginRow({ plugin, update, index, isLast, onClick, onCo )}
    + {/* Menu button: the keyboard and touch way to the right-click actions */} + + {/* Right zone: version + date */}
    {writeCount} write{writeCount !== 1 ? "s" : ""} {warningCount > 0 && ( - + {warningCount} warning{warningCount !== 1 ? "s" : ""} )} @@ -109,7 +109,7 @@ export default function SyncPreview({ result, applying, onApply }: SyncPreviewPr {/* Warnings */} {result.warnings.length > 0 && ( -

    +

    Warnings

      diff --git a/apps/desktop/src/pages/machine/MachineGrid.tsx b/apps/desktop/src/pages/machine/MachineGrid.tsx index 8a6dbe3f..dd5559e1 100644 --- a/apps/desktop/src/pages/machine/MachineGrid.tsx +++ b/apps/desktop/src/pages/machine/MachineGrid.tsx @@ -1,4 +1,5 @@ -import { Fragment, type CSSProperties } from "react"; +import { Fragment, useState, type CSSProperties } from "react"; +import { Button } from "@harness-kit/ui"; import { Store } from "lucide-react"; import type { GridCell, GridRow, MachineInventory, SurfaceId } from "@harness-kit/core"; import { surfaceLabel } from "../../lib/surface-labels"; @@ -58,6 +59,11 @@ function CellChip({ ); } +const RESOURCE_COL_WIDTH = 180; +// Wide enough for a cell chip (46px + padding) and a short label; longer +// labels truncate. Below RESOURCE + this Γ— columns the grid scrolls. +const SURFACE_COL_MIN_WIDTH = 84; + // Surface-header badges. Shared with the legend, which shows a sample of each. const HEADER_BADGE_STYLE: CSSProperties = { display: "inline-flex", @@ -112,7 +118,11 @@ function GridLegend() { export interface MachineGridProps { inventory: MachineInventory; selectedRowKey: string | null; - onRowClick: (row: GridRow) => void; + /** + * `surface` is the clicked cell's column (AC-57); undefined for a click on + * the row's name or its keyboard activation. + */ + onRowClick: (row: GridRow, surface?: SurfaceId) => void; /** Precomputed variants by row key (see `inventoryVariants`). Computed per row when omitted. */ variants?: Map>; } @@ -123,8 +133,15 @@ export function MachineGrid({ onRowClick, variants: variantsByRow, }: MachineGridProps) { - const groups = familyGroups(inventory.surfaces); - const surfaceOrder: SurfaceId[] = inventory.surfaces.map((surface) => surface.id); + // AC-59: surfaces that are not installed are hidden until asked for. With + // none installed, hiding them would leave an empty grid, so all show. + const [showAll, setShowAll] = useState(false); + const installedCount = inventory.surfaces.filter((surface) => surface.detected).length; + const hasHidden = installedCount > 0 && installedCount < inventory.surfaces.length; + const shownSurfaces = + showAll || !hasHidden ? inventory.surfaces : inventory.surfaces.filter((surface) => surface.detected); + const groups = familyGroups(shownSurfaces); + const surfaceOrder: SurfaceId[] = shownSurfaces.map((surface) => surface.id); const detectedById = new Map(inventory.surfaces.map((surface) => [surface.id, surface.detected])); const skippedById = new Map( inventory.surfaces.map((surface) => [surface.id, surface.skipped.length]), @@ -154,11 +171,47 @@ export function MachineGrid({ return (
      + {hasHidden && ( +
      + {!showAll && ( + + {installedCount} of {inventory.surfaces.length} surfaces installed + + )} + +
      + )}
      + + + {surfaceOrder.map((id) => ( + + ))} + {/* Product-family group header row */} @@ -201,10 +254,31 @@ export function MachineGrid({ scope="col" data-testid={`surface-col-${id}`} data-detected={detected ? "true" : "false"} - style={{ ...headCellStyle, ...(detected ? {} : { opacity: 0.45 }) }} + title={surfaceLabel(id)} + style={{ + ...headCellStyle, + overflow: "hidden", + ...(detected ? {} : { opacity: 0.45 }), + }} > - + {/* The label owns its line, so a narrow column never cuts it to + make room for the badges; they sit on their own line below. */} +
      {surfaceLabel(id)} +
      +
      0 || marketplaces !== null ? "flex" : "none", + alignItems: "center", + justifyContent: "center", + flexWrap: "wrap", + gap: 4, + marginTop: 2, + }} + > {skipped > 0 && ( )} - +
      {!detected && ( )} @@ -391,6 +396,7 @@ export default function MachinePage() { diffs={rowDiffs} gaps={inventory?.gaps ?? []} surfaceOrder={inventory?.surfaces.map((surface) => surface.id) ?? []} + initialTarget={clickedSurface ?? undefined} onClose={() => setSelectedRow(null)} onApplied={() => load(projectDir, true)} /> diff --git a/apps/desktop/src/pages/machine/RowDrawer.tsx b/apps/desktop/src/pages/machine/RowDrawer.tsx index 70d2adc6..8fbaa020 100644 --- a/apps/desktop/src/pages/machine/RowDrawer.tsx +++ b/apps/desktop/src/pages/machine/RowDrawer.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useId, useState } from "react"; +import { useCallback, useEffect, useId, useRef, useState } from "react"; import { Button, ErrorNotice } from "@harness-kit/ui"; import { ArrowRight, X } from "lucide-react"; import type { GridRow, MachineDiff, MachineGap, SurfaceId } from "@harness-kit/core"; @@ -42,9 +42,23 @@ export interface RowDrawerProps { onClose: () => void; /** Re-scan after a successful apply so the grid reflects the write. */ onApplied?: () => void; + /** + * The surface of the grid cell that was clicked (AC-57): the first choice + * for "To". Ignored when that surface cannot receive a copy from the chosen + * source (it holds the same content, or cannot take this resource). + */ + initialTarget?: SurfaceId; } -export function RowDrawer({ row, diffs, gaps, surfaceOrder, onClose, onApplied }: RowDrawerProps) { +export function RowDrawer({ + row, + diffs, + gaps, + surfaceOrder, + onClose, + onApplied, + initialTarget, +}: RowDrawerProps) { const presentSurfaces = Object.entries(row.cells).filter( ([, cell]) => cell.status === "present", ); @@ -60,8 +74,23 @@ export function RowDrawer({ row, diffs, gaps, surfaceOrder, onClose, onApplied } return () => window.removeEventListener("keydown", onKeyDown); }, [onClose]); + // Focus moves into the drawer on open and returns to the cell that opened + // it on close (AC-61). Not a trap: the drawer is not modal. + const drawerRef = useRef(null); + useEffect(() => { + const opener = document.activeElement; + drawerRef.current?.focus({ preventScroll: true }); + return () => { + const active = document.activeElement; + const leftInDrawer = !active || active === document.body || (drawerRef.current?.contains(active) ?? false); + if (leftInDrawer && opener instanceof HTMLElement && opener.isConnected) opener.focus(); + }; + }, []); + return ( ); @@ -288,11 +321,13 @@ function RowActions({ gaps, surfaceOrder, onApplied, + initialTarget, }: { row: GridRow; gaps: MachineGap[]; surfaceOrder: SurfaceId[]; onApplied?: () => void; + initialTarget?: SurfaceId; }) { const sources = inSurfaceOrder(presentSources(row), surfaceOrder); // AC-15: default to the copy holding the row's baseline digest, the one the @@ -315,7 +350,7 @@ function RowActions({ const diffTargets = source === undefined ? [] : inSurfaceOrder(divergentTargets(row, source), surfaceOrder); const targets = [...gapTargets, ...diffTargets]; - const [chosenTarget, setTarget] = useState(null); + const [chosenTarget, setTarget] = useState(initialTarget ?? null); const target: SurfaceId | "" = chosenTarget !== null && targets.includes(chosenTarget) ? chosenTarget : (targets[0] ?? ""); // Whether ANY source has something to copy. A source whose digest is @@ -425,7 +460,7 @@ function RowActions({ return (
      {!anyTargets - ? "Present on every surface that supports it β€” nothing to sync." + ? "Present on every surface that supports it β€” nothing to copy." : "Not present on any surface β€” nothing to copy from."}
      ); @@ -535,7 +570,9 @@ function RowActions({ aria-label={ view.plan.overwrites === undefined ? "Acknowledge capability loss" - : "Acknowledge overwriting the target's version" + : row.kind === "instructions" + ? "Acknowledge updating the Harness Kit block" + : "Acknowledge overwriting the target's version" } /> {view.plan.overwrites === undefined ? ( @@ -549,11 +586,23 @@ function RowActions({ // action was deferred from M2 because a one-click copy would // silently pick a winner. - {surfaceLabel(target as SurfaceId)} already has this. Applying replaces its - version:{" "} - {view.plan.overwrites - .map((delta) => `${delta.path} (${delta.kind})`) - .join(", ")} + {row.kind === "instructions" ? ( + <> + {view.plan.targetInstructions?.hasBlock + ? view.plan.targetInstructions.hasOwnText + ? `${surfaceLabel(target as SurfaceId)} already has a Harness Kit block and text of its own outside it. Applying updates the block; the text outside it stays, so the two will still differ.` + : `${surfaceLabel(target as SurfaceId)} already has a Harness Kit block with different content. Applying updates that block.` + : `${surfaceLabel(target as SurfaceId)} already has its own instructions. Applying adds a Harness Kit block; its text stays, so the two will still differ.`} + + ) : ( + <> + {surfaceLabel(target as SurfaceId)} already has this. Applying replaces its + version:{" "} + {view.plan.overwrites + .map((delta) => `${delta.path} (${delta.kind})`) + .join(", ")} + + )} )} diff --git a/apps/desktop/src/pages/machine/__tests__/MachineGrid.test.tsx b/apps/desktop/src/pages/machine/__tests__/MachineGrid.test.tsx index 0727b2eb..098ebb70 100644 --- a/apps/desktop/src/pages/machine/__tests__/MachineGrid.test.tsx +++ b/apps/desktop/src/pages/machine/__tests__/MachineGrid.test.tsx @@ -1,8 +1,9 @@ import { describe, expect, it, vi } from "vitest"; -import { render, screen, within } from "@testing-library/react"; +import { fireEvent, render, screen, within } from "@testing-library/react"; import { MACHINE_FIXTURE_INVENTORY } from "../../__fixtures__/machine-fixture-data"; import { MachineGrid } from "../MachineGrid"; import { CELL_VARIANTS, LEGEND_VARIANTS } from "../cell-state"; +import { surfaceLabel } from "../../../lib/surface-labels"; function renderGrid() { return render( @@ -43,6 +44,8 @@ describe("MachineGrid cell chips (AC-13)", () => { it("renders no chip in an absent cell that is not a gap", () => { renderGrid(); + // copilot-cli is not installed, so its column is hidden until asked for. + fireEvent.click(screen.getByRole("button", { name: /^Show all/ })); // copilot-cli is absent on the github row but not in the gap's missingOn. const cell = screen.getByTestId("cell-mcp-server:github-copilot-cli"); expect(cell).toHaveAttribute("data-variant", "absent"); @@ -80,3 +83,133 @@ describe("MachineGrid legend (AC-13)", () => { } }); }); + +describe("MachineGrid cell clicks (AC-57)", () => { + it("passes the clicked cell's surface to onRowClick", () => { + const onRowClick = vi.fn(); + render(); + fireEvent.click(screen.getByTestId("cell-mcp-server:github-gemini")); + expect(onRowClick).toHaveBeenCalledTimes(1); + expect(onRowClick.mock.calls[0][0].key).toBe("mcp-server:github"); + expect(onRowClick.mock.calls[0][1]).toBe("gemini"); + }); + + it("opens with no target when the row's name is clicked", () => { + const onRowClick = vi.fn(); + render(); + fireEvent.click(screen.getByText("github")); + expect(onRowClick).toHaveBeenCalledTimes(1); + expect(onRowClick.mock.calls[0][1]).toBeUndefined(); + }); +}); + +describe("MachineGrid instructions row (AC-57)", () => { + const instructionsRow = MACHINE_FIXTURE_INVENTORY.rows.find((row) => row.kind === "instructions")!; + + it("shows instructions as one 'User instructions' row, not one per file", () => { + renderGrid(); + expect(MACHINE_FIXTURE_INVENTORY.rows.filter((row) => row.kind === "instructions")).toHaveLength(1); + expect(screen.getByText("User instructions")).toBeInTheDocument(); + expect(screen.queryByText("CLAUDE.md")).toBeNull(); + }); + + it("a copied-to cell is present, and no '+ copy' chip is left on the row", () => { + const copied = { + ...MACHINE_FIXTURE_INVENTORY, + rows: MACHINE_FIXTURE_INVENTORY.rows.map((row) => + row.key === instructionsRow.key + ? { + ...row, + cells: { + ...row.cells, + codex: { + status: "present" as const, + effectiveDigest: "sha256:0000000000", + entries: [ + { + scope: "user" as const, + digest: "sha256:0000000000", + provenance: { file: "~/.codex/AGENTS.md", formatId: "markdown-instructions" as const }, + }, + ], + }, + }, + } + : row, + ), + }; + render(); + const cell = screen.getByTestId(`cell-${instructionsRow.key}-codex`); + expect(cell).toHaveAttribute("data-status", "present"); + expect(cell).not.toHaveTextContent("+ copy"); + }); +}); + +describe("MachineGrid column labels at narrow widths (2c.12)", () => { + it("truncates a surface label with an ellipsis and keeps the full name in a tooltip", () => { + renderGrid(); + const header = screen.getByTestId("surface-col-claude-code"); + expect(header).toHaveAttribute("title", surfaceLabel("claude-code")); + const label = screen.getByTestId("surface-label-claude-code"); + expect(label.style.textOverflow).toBe("ellipsis"); + expect(label.style.overflow).toBe("hidden"); + expect(screen.getByTestId("machine-grid").style.tableLayout).toBe("fixed"); + }); + + it("puts badges on their own line so they never take room from the label", () => { + renderGrid(); + const badges = screen.getAllByTestId(/^surface-marketplaces-/); + expect(badges.length).toBeGreaterThan(0); + for (const badge of badges) { + const id = badge.getAttribute("data-testid")!.replace("surface-marketplaces-", ""); + const label = screen.getByTestId(`surface-label-${id}`); + expect(label.contains(badge)).toBe(false); + // The badge's container is a separate block below the label, not the label's own row. + expect(badge.parentElement).not.toBe(label.parentElement); + expect(label.parentElement).toBe(screen.getByTestId(`surface-col-${id}`)); + } + }); +}); + +describe("MachineGrid not-installed surfaces (AC-59)", () => { + const total = MACHINE_FIXTURE_INVENTORY.surfaces.length; + const hidden = MACHINE_FIXTURE_INVENTORY.surfaces.filter((s) => !s.detected).map((s) => s.id); + + it("hides undetected surfaces by default, cells and headers alike", () => { + renderGrid(); + expect(hidden.length).toBeGreaterThan(0); + for (const id of hidden) { + expect(screen.queryByTestId(`surface-col-${id}`)).not.toBeInTheDocument(); + expect(screen.queryByTestId(`cell-mcp-server:github-${id}`)).not.toBeInTheDocument(); + } + expect(screen.getByTestId("surface-col-claude-code")).toBeInTheDocument(); + }); + + it("'Show all N' reveals them, annotated, and 'Hide not installed' puts them back", () => { + renderGrid(); + fireEvent.click(screen.getByRole("button", { name: `Show all ${total}` })); + for (const id of hidden) { + expect(within(screen.getByTestId(`surface-col-${id}`)).getByText("not installed")).toBeInTheDocument(); + } + fireEvent.click(screen.getByRole("button", { name: "Hide not installed" })); + expect(screen.queryByTestId(`surface-col-${hidden[0]}`)).not.toBeInTheDocument(); + }); + + it("offers no control when every surface is installed", () => { + const inventory = { + ...MACHINE_FIXTURE_INVENTORY, + surfaces: MACHINE_FIXTURE_INVENTORY.surfaces.map((s) => ({ ...s, detected: true })), + }; + render(); + expect(screen.queryByRole("button", { name: /Show all/ })).not.toBeInTheDocument(); + }); + + it("shows every column when nothing is installed, rather than an empty grid", () => { + const inventory = { + ...MACHINE_FIXTURE_INVENTORY, + surfaces: MACHINE_FIXTURE_INVENTORY.surfaces.map((s) => ({ ...s, detected: false })), + }; + render(); + expect(screen.getByTestId("surface-col-claude-code")).toBeInTheDocument(); + }); +}); diff --git a/apps/desktop/src/pages/machine/__tests__/MachinePage.test.tsx b/apps/desktop/src/pages/machine/__tests__/MachinePage.test.tsx index abb889db..23647c42 100644 --- a/apps/desktop/src/pages/machine/__tests__/MachinePage.test.tsx +++ b/apps/desktop/src/pages/machine/__tests__/MachinePage.test.tsx @@ -378,9 +378,19 @@ describe("MachinePage", () => { vi.mocked(collectDrift).mockResolvedValue([]); }); + it("hides undetected columns by default (AC-59)", async () => { + renderPage(); + await screen.findByTestId("machine-grid"); + for (const id of SURFACE_IDS) { + expect(screen.queryByTestId(`surface-col-${id}`) !== null).toBe(DETECTED.has(id)); + } + expect(screen.getByRole("button", { name: "Show all 11" })).toBeInTheDocument(); + }); + it("renders all 11 surface columns grouped by family, undetected dimmed and annotated", async () => { renderPage(); await screen.findByTestId("machine-grid"); + fireEvent.click(screen.getByRole("button", { name: "Show all 11" })); for (const id of SURFACE_IDS) { const col = screen.getByTestId(`surface-col-${id}`); @@ -402,6 +412,7 @@ describe("MachinePage", () => { it("renders NA cells as em-dash with tooltip and unknown cells as ? badge", async () => { renderPage(); await screen.findByTestId("machine-grid"); + fireEvent.click(screen.getByRole("button", { name: "Show all 11" })); const naCell = screen.getByTestId("cell-mcp-server:postgres-pi"); expect(naCell).toHaveAttribute("data-status", "not-applicable"); @@ -433,6 +444,15 @@ describe("MachinePage", () => { expect(drawer).not.toHaveTextContent("Sync arrives in M2"); }); + it("opens the drawer with the clicked cell's surface as the target (AC-57)", async () => { + renderPage(); + await screen.findByTestId("machine-grid"); + + fireEvent.click(screen.getByTestId("cell-mcp-server:postgres-cursor")); + const drawer = await screen.findByTestId("machine-row-drawer"); + expect((within(drawer).getByLabelText("To") as HTMLSelectElement).value).toBe("cursor"); + }); + it("badges a surface's registered plugin marketplaces, naming them in the title (AC-4)", async () => { renderPage(); await screen.findByTestId("machine-grid"); @@ -1514,11 +1534,11 @@ describe("MachinePage commands in the palette (AC-21)", () => { } function paletteOption(name: string | RegExp) { - return within(screen.getByRole("dialog", { name: "Command palette" })).getByRole("button", { name }); + return within(screen.getByRole("dialog", { name: "Command palette" })).getByRole("option", { name }); } function queryPaletteOption(name: string | RegExp) { - return within(screen.getByRole("dialog", { name: "Command palette" })).queryByRole("button", { name }); + return within(screen.getByRole("dialog", { name: "Command palette" })).queryByRole("option", { name }); } it("Rescan runs the page's own scan again", async () => { diff --git a/apps/desktop/src/pages/machine/__tests__/RowDrawer.test.tsx b/apps/desktop/src/pages/machine/__tests__/RowDrawer.test.tsx index b6edc2e2..fc8999ff 100644 --- a/apps/desktop/src/pages/machine/__tests__/RowDrawer.test.tsx +++ b/apps/desktop/src/pages/machine/__tests__/RowDrawer.test.tsx @@ -128,6 +128,44 @@ describe("RowDrawer from β†’ to (AC-15)", () => { }); }); +describe("RowDrawer clicked-cell target (AC-57)", () => { + beforeEach(() => { + vi.mocked(buildCellAction).mockClear(); + }); + + function drawer(initialTarget?: SurfaceId) { + return ( + + ); + } + + it("starts with the clicked surface as the target, not the first gap", async () => { + render(drawer("claude-code")); + expect(targetSelect().value).toBe("claude-code"); + await waitFor(() => expect(lastPlan()).toEqual(["codex", "claude-code"])); + }); + + it("falls back to the default target when the clicked surface cannot be one", () => { + // cursor holds the baseline digest: nothing to copy onto it from codex. + render(drawer("cursor")); + expect(targetSelect().value).toBe("gemini"); + }); + + it("moves to a different clicked cell on the same row", () => { + const { rerender } = render(drawer("claude-code")); + expect(targetSelect().value).toBe("claude-code"); + rerender(drawer("gemini")); + expect(targetSelect().value).toBe("gemini"); + }); +}); + describe("RowDrawer apply never runs a stale plan", () => { beforeEach(() => { vi.mocked(buildCellAction).mockClear(); diff --git a/apps/desktop/src/pages/machine/__tests__/RowDrawerFocus.test.tsx b/apps/desktop/src/pages/machine/__tests__/RowDrawerFocus.test.tsx new file mode 100644 index 00000000..a39e454b --- /dev/null +++ b/apps/desktop/src/pages/machine/__tests__/RowDrawerFocus.test.tsx @@ -0,0 +1,61 @@ +import { describe, expect, it, vi } from "vitest"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { useState } from "react"; +import type { GridRow, SurfaceId } from "@harness-kit/core"; +import { RowDrawer } from "../RowDrawer"; + +vi.mock("../cell-actions", async (importOriginal) => ({ + ...(await importOriginal()), + buildCellAction: vi.fn(async () => ({ + request: {}, + plan: { supported: true, noop: false, requiresConfirmation: false, changes: [] }, + cli: "", + prompt: "", + })), + applyCellActionViaTauri: vi.fn(async () => ({ written: [] })), +})); + +const ORDER: SurfaceId[] = ["claude-code", "codex", "cursor", "gemini"]; +const row = { + key: "mcp-server:postgres", + kind: "mcp-server", + name: "postgres", + cells: { "claude-code": { status: "absent", entries: [] } }, +} as unknown as GridRow; + +// AC-61: opening the drawer moves focus into it; closing returns it to the cell. +function Host() { + const [open, setOpen] = useState(false); + return ( + <> + + {open && setOpen(false)} />} + + ); +} + +describe("RowDrawer focus (AC-61)", () => { + it("moves focus into the drawer on open", async () => { + const user = userEvent.setup(); + render(); + await user.click(screen.getByRole("button", { name: "cell" })); + const drawer = screen.getByTestId("machine-row-drawer"); + expect(drawer).toContainElement(document.activeElement as HTMLElement); + }); + + it("returns focus to the cell that opened it on Escape and on the close button", async () => { + const user = userEvent.setup(); + render(); + const cell = screen.getByRole("button", { name: "cell" }); + await user.click(cell); + await user.keyboard("{Escape}"); + await waitFor(() => expect(screen.queryByTestId("machine-row-drawer")).not.toBeInTheDocument()); + expect(cell).toHaveFocus(); + + await user.click(cell); + await user.click(screen.getByRole("button", { name: "Close details" })); + expect(screen.queryByTestId("machine-row-drawer")).not.toBeInTheDocument(); + expect(cell).toHaveFocus(); + }); +}); diff --git a/apps/desktop/src/pages/machine/__tests__/cell-actions.test.ts b/apps/desktop/src/pages/machine/__tests__/cell-actions.test.ts index 38504399..2580b710 100644 --- a/apps/desktop/src/pages/machine/__tests__/cell-actions.test.ts +++ b/apps/desktop/src/pages/machine/__tests__/cell-actions.test.ts @@ -71,8 +71,10 @@ describe("applyCellActionViaTauri records a rollback point", () => { const [, changes, input] = recordAppliedTransaction.mock.calls[0] as unknown as [ unknown, Array<{ root: string; path: string; before: string | null; after: string | null }>, - { manifestRoot: string; surfaces: string[]; identityKeys: string[] }, + { manifestRoot: string; surfaces: string[]; identityKeys: string[]; copiedFrom?: string }, ]; + // Rust writes the audit entry (from, to, what, when) from this. + expect(input.copiedFrom).toBe("claude-code"); // roots is derived from these β€” an empty array here is the M2 bug. expect(changes).toEqual([ { root: "home", path: ".cursor/mcp.json", before: "{}", after: '{"a":1}' }, diff --git a/apps/desktop/src/pages/machine/__tests__/cell-state.test.ts b/apps/desktop/src/pages/machine/__tests__/cell-state.test.ts index c9f60ffb..0fb370a2 100644 --- a/apps/desktop/src/pages/machine/__tests__/cell-state.test.ts +++ b/apps/desktop/src/pages/machine/__tests__/cell-state.test.ts @@ -57,9 +57,9 @@ describe("rowCellVariants on the fixture", () => { it("marks absent cells not in any gap as absent", () => { // copilot-cli is undetected, so the engine never lists it as closable. expect(variantsFor("mcp-server:github")["copilot-cli"]).toBe("absent"); - // instructions:claude.md has no gap entry at all. - expect(variantsFor("instructions:claude.md").codex).toBe("absent"); - expect(variantsFor("instructions:claude.md").gemini).toBe("absent"); + // instructions:user instructions has no gap entry at all. + expect(variantsFor("instructions:user instructions").codex).toBe("absent"); + expect(variantsFor("instructions:user instructions").gemini).toBe("absent"); }); it("maps not-applicable, unmanaged and unknown to their own variants", () => { @@ -167,3 +167,26 @@ describe("inventoryVariants", () => { } }); }); + +describe("rowCellVariants: '+ copy' only where the app can apply (AC-57)", () => { + const pluginRow: GridRow = { + key: "plugin:board@harness-kit", + kind: "plugin", + name: "board@harness-kit", + cells: { + "claude-code": present("sha256:aa"), + codex: { status: "absent", entries: [] }, + } as unknown as Record, + }; + const gaps = [{ row: pluginRow.key, presentOn: ["claude-code"], missingOn: ["codex"] }] as never; + + it("shows a plugin gap as absent, because the drawer cannot run an installer", () => { + expect(rowCellVariants(pluginRow, gaps, ["claude-code", "codex"]).codex).toBe("absent"); + }); + + it("still shows an mcp-server gap as '+ copy'", () => { + const row = { ...pluginRow, key: "mcp-server:x", kind: "mcp-server" as const, name: "x" }; + const mcpGaps = [{ row: row.key, presentOn: ["claude-code"], missingOn: ["codex"] }] as never; + expect(rowCellVariants(row, mcpGaps, ["claude-code", "codex"]).codex).toBe("gap"); + }); +}); diff --git a/apps/desktop/src/pages/machine/cell-actions.ts b/apps/desktop/src/pages/machine/cell-actions.ts index e0cc5b1a..808a73c5 100644 --- a/apps/desktop/src/pages/machine/cell-actions.ts +++ b/apps/desktop/src/pages/machine/cell-actions.ts @@ -127,10 +127,12 @@ export async function buildCellAction( * those: no stale-edit check, no backup, and nothing applied from the desktop * could ever be rolled back. * - * Known gap: no ledger row, because the desktop StateStore bridge does not - * exist yet. The manifest is on disk and usable via - * `harness-kit rollback --transaction `; it just will not appear in - * `rollback --list` until that bridge lands. + * After the apply commits, a ledger row is recorded through + * `TauriTransactionLedger` (the `record_transaction` command). That row is + * what Settings β€Ί Activity lists under Changes, where Undo restores the + * previous content, and it is what makes Rust write the audit entry for the + * copy. A failed record comes back as `ledgerError` below; the files are + * already changed and the manifest is on disk. */ export interface CellApplyResult { written: string[]; @@ -161,9 +163,9 @@ export async function applyCellActionViaTauri( } const home = await homeDir(); // Namespaced: the CLI mints ids from the same clock with the same format, - // and record_transaction does ON CONFLICT DO UPDATE β€” so a same-millisecond - // collision would silently overwrite one apply's rollback point with the - // other's, and they would share a backups// directory too. + // and record_transaction refuses a second, different row for an id + // (ON CONFLICT DO NOTHING) β€” so a same-millisecond collision would fail the + // second apply's record, and the two would share a backups// directory. const timestamp = `${new Date().toISOString().replace(/[:.]/g, "-")}-app`; const prefix = home.endsWith("/") ? home : `${home}/`; // The drawer only ever applies at user scope, so every change is home-rooted @@ -219,6 +221,8 @@ export async function applyCellActionViaTauri( surfaces: [view.request.to], kinds: [view.request.kind], identityKeys: [`${view.request.kind}:${view.request.name.toLowerCase()}`], + // Rust turns this into the audit entry (from, to, what, when). + copiedFrom: view.request.from, }, new TauriTransactionLedger(), ); diff --git a/apps/desktop/src/pages/machine/cell-state.ts b/apps/desktop/src/pages/machine/cell-state.ts index bdd41599..a32aac90 100644 --- a/apps/desktop/src/pages/machine/cell-state.ts +++ b/apps/desktop/src/pages/machine/cell-state.ts @@ -26,6 +26,7 @@ export const CELL_VARIANTS: Record = { "present-user": { chip: "user", label: "present at user scope" }, "present-project": { chip: "project", label: "present in this project" }, gap: { chip: "+ copy", label: "closable gap" }, + // (a gap the app cannot apply shows as absent: see APP_APPLIES_KINDS) differs: { chip: "differs", label: "same name, different content" }, absent: { chip: null, label: "not here, and nothing can be copied here" }, none: { chip: "β€”", label: "no such concept" }, @@ -88,10 +89,18 @@ function presentVariant(cell: GridCell, baseline: string | undefined): CellVaria return winner?.scope === "project" ? "present-project" : "present-user"; } +/** + * Kinds the drawer's Apply can write. A plugin gap is real but the app cannot + * close it (it needs the surface's own installer, see `appCannotRun` in + * RowDrawer), so its cells do not offer "+ copy" (AC-57). + */ +const APP_APPLIES_KINDS: ReadonlySet = new Set(["mcp-server", "skill", "instructions"]); + /** * One variant per cell in `row.cells`. "differs" is relative to * `rowBaselineDigest`, not to the pairwise `inventory.diffs`. An absent cell - * is a "gap" only when the row's MachineGap lists its surface in `missingOn`. + * is a "gap" only when the row's MachineGap lists its surface in `missingOn` + * and the drawer can apply that kind of row. */ export function rowCellVariants( row: GridRow, @@ -99,7 +108,9 @@ export function rowCellVariants( surfaceOrder: SurfaceId[], ): Record { const baseline = rowBaselineDigest(row, surfaceOrder); - const missingOn = new Set(gaps.find((gap) => gap.row === row.key)?.missingOn ?? []); + const missingOn = new Set( + APP_APPLIES_KINDS.has(row.kind) ? (gaps.find((gap) => gap.row === row.key)?.missingOn ?? []) : [], + ); const variants = {} as Record; for (const id of Object.keys(row.cells) as SurfaceId[]) { const cell = row.cells[id]; diff --git a/apps/desktop/src/pages/machine/machine-data.ts b/apps/desktop/src/pages/machine/machine-data.ts index a4f2f47e..acb9d9e2 100644 --- a/apps/desktop/src/pages/machine/machine-data.ts +++ b/apps/desktop/src/pages/machine/machine-data.ts @@ -33,7 +33,7 @@ export interface MachineScanResult { * `scanRoot` is the optional project directory; null = machine-only * observation (user-scope stores only). A project dir needs a runtime FS * scope grant first (the static capability only covers known $HOME config - * roots) β€” mirroring Fleet, a failed grant drops the project from the scan + * roots) β€” as in drift-data.ts, a failed grant drops the project from the scan * rather than failing the whole inventory, but the degradation is reported * so the page can surface it instead of silently under-reporting. */ diff --git a/apps/desktop/src/pages/observatory/SessionsPage.tsx b/apps/desktop/src/pages/observatory/SessionsPage.tsx index b2700f38..a7b7a40f 100644 --- a/apps/desktop/src/pages/observatory/SessionsPage.tsx +++ b/apps/desktop/src/pages/observatory/SessionsPage.tsx @@ -10,10 +10,10 @@ import { errorDetails } from "../../lib/error-details"; // ── Outcome badge ────────────────────────────────────────────── const OUTCOME_COLORS: Record = { - fully_achieved: { bg: "var(--success-light)", color: "var(--success)" }, + fully_achieved: { bg: "var(--success-light)", color: "var(--success-text)" }, mostly_achieved: { bg: "var(--accent-light)", color: "var(--accent-text)" }, - partially_achieved: { bg: "var(--warning-light)", color: "var(--warning)" }, - not_achieved: { bg: "var(--danger-light)", color: "var(--danger)" }, + partially_achieved: { bg: "var(--warning-light)", color: "var(--warning-text)" }, + not_achieved: { bg: "var(--danger-light)", color: "var(--danger-text)" }, }; function OutcomeBadge({ outcome }: { outcome: string }) { @@ -150,7 +150,7 @@ function TranscriptRow({ entry }: { entry: TranscriptEntry }) { padding: "1px 5px", borderRadius: "4px", background: "var(--success-light)", - color: "var(--success)", + color: "var(--success-text)", fontWeight: 500, }}> {name} @@ -254,10 +254,10 @@ function SessionDetail({ fontWeight: 500, }}> - {formatNumber(transcript.totalOutputTokens)} tokens out + {formatNumber(transcript.totalOutputTokens)} tokens out - {formatNumber(transcript.totalToolCalls)} tool calls + {formatNumber(transcript.totalToolCalls)} tool calls {transcript.modelsUsed.map(shortModelName).join(", ")} {transcript.subagentCount > 0 && ( @@ -266,7 +266,7 @@ function SessionDetail({
      )} {transcript.truncated && ( - truncated + truncated )} )} diff --git a/apps/desktop/src/pages/onboarding/OnboardingFlow.tsx b/apps/desktop/src/pages/onboarding/OnboardingFlow.tsx index d94e2b03..3a66493c 100644 --- a/apps/desktop/src/pages/onboarding/OnboardingFlow.tsx +++ b/apps/desktop/src/pages/onboarding/OnboardingFlow.tsx @@ -1,6 +1,6 @@ -import { lazy, Suspense } from "react"; +import { lazy, Suspense, useRef } from "react"; import { ArrowRight, Search } from "lucide-react"; -import { Button, Card, ErrorNotice, StatusChip } from "@harness-kit/ui"; +import { Button, Card, ErrorNotice, StatusChip, useDialogFocus } from "@harness-kit/ui"; import type { SprawlReveal } from "./onboarding-data"; const MonacoEditor = lazy(() => import("../../components/plugin-explorer/MonacoEditor")); @@ -46,8 +46,18 @@ export function OnboardingFlow({ onSkip, onRetry, }: OnboardingFlowProps) { + const shellRef = useRef(null); + useDialogFocus(true, shellRef); return ( -
      +

      Nothing is written until you confirm.

      diff --git a/apps/desktop/src/pages/onboarding/OnboardingPage.tsx b/apps/desktop/src/pages/onboarding/OnboardingPage.tsx index a33ad4df..ad8677f2 100644 --- a/apps/desktop/src/pages/onboarding/OnboardingPage.tsx +++ b/apps/desktop/src/pages/onboarding/OnboardingPage.tsx @@ -10,7 +10,8 @@ import { lineDiff, collapseToHunks } from "../drift/line-diff"; import { getCurrentProjectDir } from "../../lib/project-dir"; import { errorDetails } from "../../lib/error-details"; import { OnboardingFlow, type OnboardingStep } from "./OnboardingFlow"; -import { buildSprawlReveal, type SprawlReveal } from "./onboarding-data"; +import { buildSprawlReveal, withInventorySections, type SprawlReveal } from "./onboarding-data"; +import { importPersonalHarness } from "../../lib/personal-inventory"; export interface OnboardingPageProps { /** Called once the user has confirmed (write or explore read-only) β€” dismisses the wizard. */ @@ -76,6 +77,12 @@ export default function OnboardingPage({ onFinish }: OnboardingPageProps) { } } + // AC-56: the file written comes from the machine inventory the grid + // shows; the scan above only supplies the reveal and the sections the + // inventory does not cover. + const inventory = await importPersonalHarness(); + combined = withInventorySections(combined, inventory.harnessConfig); + if (cancelled) return; const elapsed = Math.max(0.1, (Date.now() - startedAt.current) / 1000); setScanSeconds(Math.round(elapsed * 10) / 10); @@ -219,10 +226,11 @@ export default function OnboardingPage({ onFinish }: OnboardingPageProps) { * Merge two importMachine() results (global scope + project scope) into one * for display purposes: union the per-adapter findings (dedupe by file) and * concatenate provenance conflicts. The synthesized harnessYaml/harnessConfig - * from the global pass is kept as the write target β€” this mirrors "global - * config is the source of truth, project just adds visibility into what's - * also configured there" rather than silently picking one scope's YAML over - * the other. + * from the global pass is kept β€” this mirrors "global config is the source of + * truth, project just adds visibility into what's also configured there" + * rather than silently picking one scope's YAML over the other. The caller + * then replaces its MCP servers and permissions with the machine inventory's + * (`withInventorySections`, AC-56) before anything is written. */ function mergeImportResults( a: ImportProjectResult, diff --git a/apps/desktop/src/pages/onboarding/__tests__/OnboardingModal.test.tsx b/apps/desktop/src/pages/onboarding/__tests__/OnboardingModal.test.tsx new file mode 100644 index 00000000..b3798898 --- /dev/null +++ b/apps/desktop/src/pages/onboarding/__tests__/OnboardingModal.test.tsx @@ -0,0 +1,38 @@ +import { describe, expect, it, vi } from "vitest"; +import { render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { OnboardingFlow } from "../OnboardingFlow"; + +// AC-61: onboarding covers the whole window, so it is a modal dialog: focus +// starts inside it and Tab cannot reach the app behind. +describe("OnboardingFlow as a modal shell", () => { + it("is a named modal dialog that takes focus and keeps Tab inside", async () => { + const user = userEvent.setup(); + render( + <> + + + , + ); + const dialog = screen.getByRole("dialog", { name: "Set up Harness Kit" }); + expect(dialog).toHaveAttribute("aria-modal", "true"); + await waitFor(() => expect(dialog).toHaveFocus()); + for (let i = 0; i < 6; i++) { + await user.tab(); + expect(dialog).toContainElement(document.activeElement as HTMLElement); + } + }); +}); diff --git a/apps/desktop/src/pages/onboarding/__tests__/OnboardingPage.test.tsx b/apps/desktop/src/pages/onboarding/__tests__/OnboardingPage.test.tsx index 89847d97..98bda19b 100644 --- a/apps/desktop/src/pages/onboarding/__tests__/OnboardingPage.test.tsx +++ b/apps/desktop/src/pages/onboarding/__tests__/OnboardingPage.test.tsx @@ -3,6 +3,8 @@ import { render, screen, waitFor, fireEvent } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import OnboardingPage from "../OnboardingPage"; import { loadedDigest } from "../../../lib/loaded-digest"; +import type { ImportProjectResult } from "@harness-kit/core"; +import { withInventorySections } from "../onboarding-data"; import { ONBOARDING_FIXTURE_RESULT, ONBOARDING_FIXTURE_LOW_COUNT } from "../../__fixtures__/onboarding-fixture-data"; // ── Mocks ────────────────────────────────────────────────────── @@ -13,6 +15,19 @@ vi.mock("@harness-kit/core", () => ({ importMachine: (...args: unknown[]) => mockImportMachine(...args), })); +// AC-56: the file comes from the machine inventory. This stands in for the +// grid's data; it deliberately differs from the adapter scan's servers. +const mockImportPersonalHarness = vi.fn(); +vi.mock("../../../lib/personal-inventory", () => ({ + importPersonalHarness: (...args: unknown[]) => mockImportPersonalHarness(...args), +})); +const INVENTORY_CONFIG = { + version: "1", + metadata: { name: "inv", description: "d" }, + "mcp-servers": { fromGrid: { transport: "stdio", command: "grid-cmd" } }, +} as unknown as ImportProjectResult["harnessConfig"]; +const EXPECTED_YAML = withInventorySections(ONBOARDING_FIXTURE_RESULT, INVENTORY_CONFIG).harnessYaml; + vi.mock("@tauri-apps/api/path", () => ({ homeDir: vi.fn(() => Promise.resolve("/home/user")), })); @@ -55,6 +70,18 @@ describe("OnboardingPage", () => { mockWriteHarnessFile.mockResolvedValue("~/.claude/harness.yaml"); mockReadHarnessFile.mockResolvedValue({ found: false, content: null, path: null }); mockWriteConfigFile.mockResolvedValue(undefined); + mockImportPersonalHarness.mockResolvedValue({ harnessConfig: INVENTORY_CONFIG, harnessYaml: "", inventory: {} }); + }); + + it("writes the servers the machine inventory shows, not the adapter scan's (AC-56)", async () => { + mockImportMachine.mockResolvedValue(ONBOARDING_FIXTURE_RESULT); + const user = userEvent.setup(); + renderPage(); + await user.click(await screen.findByRole("button", { name: /preview harness\.yaml/i }, { timeout: 3000 })); + const preview = await screen.findByTestId("monaco-stub"); + expect(preview).toHaveTextContent("fromGrid"); + expect(preview).not.toHaveTextContent("postgres"); + expect(mockImportPersonalHarness).toHaveBeenCalledTimes(1); }); it("runs the scan step then advances to the sprawl reveal with real counts", async () => { @@ -107,11 +134,11 @@ describe("OnboardingPage", () => { expect(mockWriteHarnessFile).not.toHaveBeenCalled(); await user.click(screen.getByRole("button", { name: /^write harness\.yaml$/i })); - await waitFor(() => expect(mockWriteHarnessFile).toHaveBeenCalledWith(ONBOARDING_FIXTURE_RESULT.harnessYaml)); + await waitFor(() => expect(mockWriteHarnessFile).toHaveBeenCalledWith(EXPECTED_YAML)); await waitFor(() => expect(onFinish).toHaveBeenCalled()); }); - it("explore read-only finishes without writing anything", async () => { + it("skip for now finishes without writing anything", async () => { mockImportMachine.mockResolvedValue(ONBOARDING_FIXTURE_RESULT); const user = userEvent.setup(); const { onFinish } = renderPage(); @@ -121,7 +148,7 @@ describe("OnboardingPage", () => { }); await user.click(screen.getByRole("button", { name: /preview harness\.yaml/i })); await user.click(await screen.findByRole("button", { name: /^continue$/i })); - await user.click(await screen.findByRole("button", { name: /explore read-only/i })); + await user.click(await screen.findByRole("button", { name: /skip for now/i })); expect(mockWriteHarnessFile).not.toHaveBeenCalled(); expect(onFinish).toHaveBeenCalled(); @@ -200,7 +227,7 @@ describe("OnboardingPage", () => { it("writes directly when no file exists", async () => { const { user, onFinish } = await toConfirm(); await user.click(await screen.findByRole("button", { name: /^write harness\.yaml$/i })); - await waitFor(() => expect(mockWriteHarnessFile).toHaveBeenCalledWith(ONBOARDING_FIXTURE_RESULT.harnessYaml)); + await waitFor(() => expect(mockWriteHarnessFile).toHaveBeenCalledWith(EXPECTED_YAML)); expect(mockWriteConfigFile).not.toHaveBeenCalled(); await waitFor(() => expect(onFinish).toHaveBeenCalled()); }); @@ -208,7 +235,7 @@ describe("OnboardingPage", () => { it("skips the write when the existing file is identical", async () => { mockReadHarnessFile.mockResolvedValue({ found: true, - content: ONBOARDING_FIXTURE_RESULT.harnessYaml, + content: EXPECTED_YAML, path: TARGET, }); const { user, onFinish } = await toConfirm(); @@ -247,7 +274,7 @@ describe("OnboardingPage", () => { await waitFor(() => expect(onFinish).toHaveBeenCalled()); expect(mockWriteHarnessFile).toHaveBeenCalledTimes(1); expect(mockWriteHarnessFile).toHaveBeenCalledWith( - ONBOARDING_FIXTURE_RESULT.harnessYaml, + EXPECTED_YAML, await loadedDigest("version: old\n"), ); expect(mockWriteConfigFile).not.toHaveBeenCalled(); diff --git a/apps/desktop/src/pages/onboarding/__tests__/onboarding-data.test.ts b/apps/desktop/src/pages/onboarding/__tests__/onboarding-data.test.ts index ea6446da..52504f40 100644 --- a/apps/desktop/src/pages/onboarding/__tests__/onboarding-data.test.ts +++ b/apps/desktop/src/pages/onboarding/__tests__/onboarding-data.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from "vitest"; import type { ImportProjectResult } from "@harness-kit/core"; -import { buildSprawlReveal } from "../onboarding-data"; +import { buildSprawlReveal, withInventorySections } from "../onboarding-data"; import { ONBOARDING_FIXTURE_RESULT, ONBOARDING_FIXTURE_LOW_COUNT, @@ -81,3 +81,34 @@ describe("buildSprawlReveal", () => { expect(reveal.conflicts).toHaveLength(0); }); }); + +describe("withInventorySections (AC-56)", () => { + const inventoryConfig = { + version: "1", + metadata: { name: "inv", description: "d" }, + "mcp-servers": { fromGrid: { transport: "stdio", command: "grid-cmd" } }, + permissions: { tools: { allow: ["Bash(ls)"] } }, + } as ImportProjectResult["harnessConfig"]; + + it("takes mcp-servers and permissions from the inventory, not from the adapter scan", () => { + const out = withInventorySections(ONBOARDING_FIXTURE_RESULT, inventoryConfig); + expect(Object.keys(out.harnessConfig["mcp-servers"] ?? {})).toEqual(["fromGrid"]); + expect(out.harnessConfig.permissions).toEqual({ tools: { allow: ["Bash(ls)"] } }); + expect(out.harnessYaml).toContain("fromGrid"); + expect(out.harnessYaml).not.toContain("postgres"); + }); + + it("drops adapter-scan servers when the inventory has none", () => { + const empty = { version: "1", metadata: { name: "inv", description: "d" } } as ImportProjectResult["harnessConfig"]; + const out = withInventorySections(ONBOARDING_FIXTURE_RESULT, empty); + expect(out.harnessConfig["mcp-servers"]).toBeUndefined(); + expect(out.harnessYaml).not.toContain("mcp-servers"); + }); + + it("keeps what the inventory does not cover (instructions) and the scan's findings", () => { + const out = withInventorySections(ONBOARDING_FIXTURE_LOW_COUNT, inventoryConfig); + expect(out.harnessConfig.instructions).toEqual({ operational: "Run tests before committing." }); + expect(out.findings).toBe(ONBOARDING_FIXTURE_LOW_COUNT.findings); + expect(out.harnessYaml).toContain("Run tests before committing."); + }); +}); diff --git a/apps/desktop/src/pages/onboarding/onboarding-data.ts b/apps/desktop/src/pages/onboarding/onboarding-data.ts index f7e96c3a..ec1c4fa6 100644 --- a/apps/desktop/src/pages/onboarding/onboarding-data.ts +++ b/apps/desktop/src/pages/onboarding/onboarding-data.ts @@ -1,6 +1,8 @@ +import { stringify as stringifyYaml } from "yaml"; import type { AdapterFindingsSummary, AdapterId, + HarnessConfig, ImportConflict, ImportProjectResult, } from "@harness-kit/core"; @@ -151,3 +153,24 @@ export function buildSprawlReveal(result: ImportProjectResult): SprawlReveal { isLowHarnessCount: detected.length <= 1, }; } + +/** + * AC-56: the harness.yaml onboarding writes takes its MCP servers and + * permissions from the machine inventory (the grid's data), not from the + * per-adapter scan. The scan still supplies the findings the reveal shows and + * the sections the inventory does not cover (instructions, skills); the + * scan's own `mcp-servers` and `permissions` are replaced, never merged, so + * the file cannot list a server the grid does not. + */ +export function withInventorySections( + scan: ImportProjectResult, + inventoryConfig: HarnessConfig, +): ImportProjectResult { + const { "mcp-servers": _scanServers, permissions: _scanPermissions, ...rest } = scan.harnessConfig; + const harnessConfig: HarnessConfig = { + ...rest, + ...(inventoryConfig["mcp-servers"] ? { "mcp-servers": inventoryConfig["mcp-servers"] } : {}), + ...(inventoryConfig.permissions ? { permissions: inventoryConfig.permissions } : {}), + }; + return { ...scan, harnessConfig, harnessYaml: stringifyYaml(harnessConfig, { lineWidth: 0 }) }; +} diff --git a/apps/desktop/src/pages/security/AuditLogPage.tsx b/apps/desktop/src/pages/security/AuditLogPage.tsx index c9e646ff..afad4a27 100644 --- a/apps/desktop/src/pages/security/AuditLogPage.tsx +++ b/apps/desktop/src/pages/security/AuditLogPage.tsx @@ -9,7 +9,7 @@ import ContextMenu from "../../components/ContextMenu"; const PAGE_SIZE = 25; -type CategoryFilter = "all" | "permissions" | "secrets"; +type CategoryFilter = "all" | "permissions" | "secrets" | "changes"; function Pill({ label, active, onClick }: { label: string; active: boolean; onClick: () => void }) { return ( @@ -37,6 +37,8 @@ const EVENT_VARIANT: Record = { preset_applied: "success", secret_access: "warning", secret_delete: "danger", + machine_copy: "success", + change_undone: "warning", }; function EventBadge({ eventType }: { eventType: string }) { @@ -128,7 +130,7 @@ export default function AuditLogPage() { Audit Log

      - Track permission changes, secret operations, and preset applications. + Track permission changes, secret operations, preset applications, and copies between surfaces.

      @@ -153,6 +155,7 @@ export default function AuditLogPage() { handleFilterChange("all")} /> handleFilterChange("permissions")} /> handleFilterChange("secrets")} /> + handleFilterChange("changes")} />
      @@ -205,7 +208,7 @@ export default function AuditLogPage() { } title="No audit entries found" - description="Entries are created when permissions or secrets are modified." + description="Entries are created when permissions or secrets change, or a Machine copy applies." /> ) : ( entries.map((entry, idx) => ( diff --git a/apps/desktop/src/pages/security/PermissionsPage.tsx b/apps/desktop/src/pages/security/PermissionsPage.tsx index 02373641..20ba976a 100644 --- a/apps/desktop/src/pages/security/PermissionsPage.tsx +++ b/apps/desktop/src/pages/security/PermissionsPage.tsx @@ -399,7 +399,7 @@ function CurrentConfigSummary({ } else if (mode === "auto") { detail = AI classifiers approve non-destructive actions.; } else if (tools.length === 0) { - detail = No tools selected β€” all actions will prompt.; + detail = No tools selected β€” all actions will prompt.; } else { detail = ( @@ -1124,9 +1124,9 @@ export default function PermissionsPage() { {(() => { const allTools = [...permissions.tools.allow, ...permissions.tools.deny, ...permissions.tools.ask]; const rows: { key: "allow" | "deny" | "ask"; label: string; color: string; chipColor: "green" | "red" | "amber" }[] = [ - { key: "allow", label: "Allow", color: "var(--success)", chipColor: "green" }, - { key: "deny", label: "Deny", color: "var(--danger)", chipColor: "red" }, - { key: "ask", label: "Ask", color: "var(--warning)", chipColor: "amber" }, + { key: "allow", label: "Allow", color: "var(--success-text)", chipColor: "green" }, + { key: "deny", label: "Deny", color: "var(--danger-text)", chipColor: "red" }, + { key: "ask", label: "Ask", color: "var(--warning-text)", chipColor: "amber" }, ]; return (
      @@ -1175,7 +1175,7 @@ export default function PermissionsPage() { return (
      -

      Writable

      +

      Writable

      {permissions.paths.writable.length > 0 && (
      {permissions.paths.writable.map((p) => ( @@ -1186,7 +1186,7 @@ export default function PermissionsPage() { addToList("writable", v)} placeholder="Add path…" suggestions={PATH_SUGGESTIONS} existing={allPaths} />
      -

      Read-only

      +

      Read-only

      {permissions.paths.readonly.length > 0 && (
      {permissions.paths.readonly.map((p) => ( diff --git a/apps/desktop/src/pages/security/SecretsPage.tsx b/apps/desktop/src/pages/security/SecretsPage.tsx index bfe09b08..491a4668 100644 --- a/apps/desktop/src/pages/security/SecretsPage.tsx +++ b/apps/desktop/src/pages/security/SecretsPage.tsx @@ -201,7 +201,7 @@ export default function SecretsPage() { {secret.isSet ? "Update" : "Set"} {secret.isSet && ( - )} diff --git a/apps/desktop/src/pages/security/__tests__/AuditLogPage.test.tsx b/apps/desktop/src/pages/security/__tests__/AuditLogPage.test.tsx index 5f96f230..6d40fab7 100644 --- a/apps/desktop/src/pages/security/__tests__/AuditLogPage.test.tsx +++ b/apps/desktop/src/pages/security/__tests__/AuditLogPage.test.tsx @@ -136,9 +136,16 @@ describe("AuditLogPage β€” empty state", () => { it("shows hint text in empty state", async () => { renderPage(); expect( - await screen.findByText(/Entries are created when permissions or secrets are modified/), + await screen.findByText(/Entries are created when permissions or secrets change/), ).toBeInTheDocument(); }); + + it("filters to Machine copies and undone changes with the Changes pill", async () => { + mockListAuditEntries.mockResolvedValue([]); + renderPage(); + fireEvent.click(await screen.findByRole("button", { name: "Changes" })); + await waitFor(() => expect(mockListAuditEntries).toHaveBeenLastCalledWith(25, 0, "changes")); + }); }); describe("AuditLogPage β€” entries list", () => { diff --git a/apps/desktop/src/pages/settings/ActivityTab.tsx b/apps/desktop/src/pages/settings/ActivityTab.tsx index 324a4907..90df0377 100644 --- a/apps/desktop/src/pages/settings/ActivityTab.tsx +++ b/apps/desktop/src/pages/settings/ActivityTab.tsx @@ -1,21 +1,23 @@ import { Suspense, lazy, useEffect, useState } from "react"; import { homeDir } from "@tauri-apps/api/path"; import { PortabilityPanel } from "../fleet/PortabilityPanel"; +import { RegistryEnrollment } from "../fleet/RegistryEnrollment"; +import { getLedgerLab } from "../../lib/preferences"; import { buildDesktopPortabilitySnapshot, type DesktopPortabilitySnapshot } from "../fleet/portability-data"; import { getCurrentProjectDir } from "../../lib/project-dir"; import { installationId } from "../../lib/installation-id"; import { grantProjectScope } from "../../lib/tauri"; import { errorDetails } from "../../lib/error-details"; import { ErrorNotice } from "@harness-kit/ui"; +import { ChangesList } from "./ChangesList"; const AuditLogPage = lazy(() => import("../security/AuditLogPage")); /** - * Settings β€Ί Activity (AC-11, Task 1.7). Combines the audit log - * (permission/secret/preset events, from the retired standalone Audit Log - * page) with the portability reconciliation ledger (rollback points, - * portability notices, device enrollment β€” from the retired Fleet page) - * on one tab. + * Settings β€Ί Activity (AC-11, Task 1.7). One tab for three things: the + * Changes list (what the app changed, with Undo), the audit log (permission, + * secret, preset and Machine copy events), and device enrollment. The + * reconciliation ledger (layers, conflicts, rollback points) is a Labs view. */ export function ActivityTab() { const [snapshot, setSnapshot] = useState(null); @@ -35,8 +37,8 @@ export function ActivityTab() { const projectDir = getCurrentProjectDir(); const home = await homeDir(); // The static FS capability only covers known $HOME config roots, not - // an arbitrary project dir β€” grant runtime scope first (mirrors - // machine-data.ts / drift-data.ts / the retired FleetPage). A failed + // an arbitrary project dir β€” grant runtime scope first (as + // machine-data.ts and drift-data.ts do). A failed // grant just drops the project layer rather than failing the ledger. const scopeReady = projectDir ? await grantProjectScope(projectDir).then( @@ -69,13 +71,15 @@ export function ActivityTab() { return (
      + + {error && ( setAttempt((n) => n + 1) }} /> @@ -88,7 +92,7 @@ export function ActivityTab() { padding: "6px 10px", borderRadius: 6, background: "var(--warning-light)", - color: "var(--warning)", + color: "var(--warning-text)", fontSize: 11.5, }} > @@ -96,7 +100,20 @@ export function ActivityTab() {
      )} - + {getLedgerLab() ? ( + + ) : ( + snapshot && ( +
      +
      +

      Device enrollment

      +
      +
      + +
      +
      + ) + )}
      ); } diff --git a/apps/desktop/src/pages/settings/ChangesList.tsx b/apps/desktop/src/pages/settings/ChangesList.tsx new file mode 100644 index 00000000..952f4f20 --- /dev/null +++ b/apps/desktop/src/pages/settings/ChangesList.tsx @@ -0,0 +1,218 @@ +import { useCallback, useEffect, useState } from "react"; +import { Button, Card, EmptyState, ErrorNotice } from "@harness-kit/ui"; +import { History } from "lucide-react"; +import type { SurfaceId } from "@harness-kit/core"; +import { listChanges, undoChange, type ChangeEntry } from "../../lib/tauri"; +import { surfaceLabel } from "../../lib/surface-labels"; +import { errorDetails } from "../../lib/error-details"; + +const KIND_LABEL: Record = { + "mcp-server": "MCP server", + skill: "Skill", + instruction: "Instructions", + hook: "Hook", + command: "Command", + agent: "Agent", + plugin: "Plugin", +}; + +function formatTime(value: string): string { + const date = new Date(value); + if (Number.isNaN(date.getTime())) return value; + return date.toLocaleString(undefined, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }); +} + +/** "MCP server github", from an identity key like `mcp-server:github`. */ +function describeKey(key: string): string { + const at = key.indexOf(":"); + if (at < 0) return key; + const kind = key.slice(0, at); + return `${KIND_LABEL[kind] ?? kind} ${key.slice(at + 1)}`; +} + +function describeWhat(entry: ChangeEntry): string { + if (entry.identityKeys.length === 0) return "Changed config files"; + const shown = entry.identityKeys.slice(0, 2).map(describeKey).join(", "); + const more = entry.identityKeys.length - 2; + return more > 0 ? `${shown}, and ${more} more` : shown; +} + +function describeWhere(entry: ChangeEntry): string { + const surfaces = entry.surfaces.map((id) => surfaceLabel(id as SurfaceId)).join(", "); + const copy = entry.copiedFrom ? `Copied from ${surfaceLabel(entry.copiedFrom as SurfaceId)} to ` : ""; + return `${copy}${surfaces}`; +} + +function describeFiles(entry: ChangeEntry): string { + if (entry.files.length === 0) return ""; + const [first] = entry.files; + return entry.files.length > 1 ? `~/${first} and ${entry.files.length - 1} more` : `~/${first}`; +} + +/** + * Settings β€Ί Activity β€Ί Changes: what the app changed on this machine, newest + * first. Each change that can still be undone has Undo. The webview sends only + * the change's id; Rust checks that every file still holds what the change + * left there and refuses if one was edited since. + */ +export function ChangesList() { + const [changes, setChanges] = useState(null); + const [loadError, setLoadError] = useState(null); + const [confirming, setConfirming] = useState(null); + const [busy, setBusy] = useState(null); + // Per-change refusal text, kept on the row so it stays beside what it is about. + const [undoErrors, setUndoErrors] = useState>({}); + const [notice, setNotice] = useState(null); + + const load = useCallback(async () => { + setLoadError(null); + try { + setChanges(await listChanges()); + } catch (error) { + setChanges(null); + setLoadError(errorDetails(error)); + } + }, []); + + useEffect(() => { + void load(); + }, [load]); + + async function handleUndo(entry: ChangeEntry) { + setConfirming(null); + setBusy(entry.transactionId); + setNotice(null); + setUndoErrors((current) => { + const { [entry.transactionId]: _dropped, ...rest } = current; + return rest; + }); + try { + const outcome = await undoChange(entry.transactionId); + setNotice( + outcome.warning + ? `${describeWhat(entry)} was put back. ${outcome.warning}` + : `${describeWhat(entry)} was put back.`, + ); + } catch (error) { + setUndoErrors((current) => ({ ...current, [entry.transactionId]: errorDetails(error) })); + } finally { + setBusy(null); + } + await load(); + } + + return ( +
      +
      +

      + Changes +

      +

      + What this app changed in your config files. Undo puts a file back as it was, unless it has been edited since. +

      +
      + + {loadError && ( + void load() }} + /> + )} + + {notice && ( +
      + {notice} +
      + )} + + {changes && ( + + {changes.length === 0 ? ( + } + title="No changes yet" + description="Changes made from Machine and the MCP servers page appear here." + /> + ) : ( +
        + {changes.map((entry) => ( +
      • + {formatTime(entry.appliedAt)} +
        +
        {describeWhat(entry)}
        +
        + {describeWhere(entry)} + {entry.files.length > 0 && Β· {describeFiles(entry)}} +
        + {!entry.undoable && entry.reason && ( +
        + {entry.status === "undone" ? "Undone." : entry.reason} +
        + )} + {undoErrors[entry.transactionId] && ( +
        + {undoErrors[entry.transactionId]} +
        + )} +
        +
        + {entry.undoable && + (confirming === entry.transactionId ? ( + <> + + + + ) : ( + + ))} +
        +
      • + ))} +
      + )} +
      + )} +
      + ); +} diff --git a/apps/desktop/src/pages/settings/__tests__/ActivityTab.test.tsx b/apps/desktop/src/pages/settings/__tests__/ActivityTab.test.tsx index dcb786ae..febf0ae0 100644 --- a/apps/desktop/src/pages/settings/__tests__/ActivityTab.test.tsx +++ b/apps/desktop/src/pages/settings/__tests__/ActivityTab.test.tsx @@ -45,6 +45,8 @@ const mockGrantProjectScope = vi.fn(); vi.mock("../../../lib/tauri", () => ({ listAuditEntries: (...args: unknown[]) => mockListAuditEntries(...args), clearAuditEntries: vi.fn(), + listChanges: vi.fn(() => Promise.resolve([])), + undoChange: vi.fn(), grantProjectScope: (...args: unknown[]) => mockGrantProjectScope(...args), })); @@ -58,14 +60,33 @@ describe("ActivityTab", () => { mockBuildDesktopPortabilitySnapshot.mockResolvedValue(snapshot); }); - it("renders both the audit log and the reconciliation ledger", async () => { + it("shows the audit log and device enrollment, not the ledger internals, by default (2c.13)", async () => { + render(); + + expect(await screen.findByText("Audit Log")).toBeInTheDocument(); + expect(await screen.findByRole("heading", { name: "Device enrollment" })).toBeInTheDocument(); + expect(screen.queryByText("Reconciliation ledger")).not.toBeInTheDocument(); + expect(screen.queryByText("Rollback points")).not.toBeInTheDocument(); + }); + + it("shows the Changes list first, above the audit log", async () => { + render(); + const changes = await screen.findByRole("heading", { name: "Changes" }); + const audit = await screen.findByText("Audit Log"); + expect(changes.compareDocumentPosition(audit) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); + }); + + it("renders the reconciliation ledger when the Labs flag is on", async () => { + localStorage.setItem("harness-kit-labs-ledger", "true"); render(); expect(await screen.findByText("Audit Log")).toBeInTheDocument(); expect(await screen.findByText("Reconciliation ledger")).toBeInTheDocument(); + expect(screen.queryByRole("heading", { name: "Device enrollment" })).not.toBeInTheDocument(); }); it("does not grant project scope when no project is tracked", async () => { + localStorage.setItem("harness-kit-labs-ledger", "true"); render(); await screen.findByText("Reconciliation ledger"); expect(mockGrantProjectScope).not.toHaveBeenCalled(); @@ -73,6 +94,7 @@ describe("ActivityTab", () => { it("shows a degraded notice when a project is tracked but its scope grant fails", async () => { localStorage.setItem("harness-kit-sync-recent-dirs", JSON.stringify(["/repo/gone"])); + localStorage.setItem("harness-kit-labs-ledger", "true"); mockGrantProjectScope.mockRejectedValue(new Error("forbidden")); render(); @@ -88,11 +110,12 @@ describe("ActivityTab", () => { }); it("shows an error notice when the snapshot build itself fails outright (AC-20)", async () => { + localStorage.setItem("harness-kit-labs-ledger", "true"); mockBuildDesktopPortabilitySnapshot.mockRejectedValueOnce(new Error("boom")); render(); - expect(await screen.findByRole("alert")).toHaveTextContent("Couldn't build the reconciliation ledger"); + expect(await screen.findByRole("alert")).toHaveTextContent("Couldn't read this device's state"); expect(screen.queryByText(/Error: boom/)).not.toBeInTheDocument(); expect(screen.getByText("boom")).not.toBeVisible(); expect(screen.queryByTestId("project-degraded-notice")).not.toBeInTheDocument(); diff --git a/apps/desktop/src/pages/settings/__tests__/ChangesList.test.tsx b/apps/desktop/src/pages/settings/__tests__/ChangesList.test.tsx new file mode 100644 index 00000000..b211742a --- /dev/null +++ b/apps/desktop/src/pages/settings/__tests__/ChangesList.test.tsx @@ -0,0 +1,146 @@ +import { describe, it, expect, vi, beforeEach } from "vitest"; +import { render, screen, fireEvent, waitFor, within } from "@testing-library/react"; +import { ChangesList } from "../ChangesList"; +import type { ChangeEntry } from "../../../lib/tauri"; + +const mockListChanges = vi.fn(); +const mockUndoChange = vi.fn(); + +vi.mock("../../../lib/tauri", () => ({ + listChanges: (...args: unknown[]) => mockListChanges(...args), + undoChange: (...args: unknown[]) => mockUndoChange(...args), +})); + +function change(overrides: Partial = {}): ChangeEntry { + return { + transactionId: "tx-1", + appliedAt: "2026-11-02T10:00:00.000Z", + surfaces: ["codex"], + kinds: ["mcp-server"], + identityKeys: ["mcp-server:github"], + files: [".codex/config.toml"], + copiedFrom: "claude-code", + status: "applied", + undoable: true, + reason: null, + ...overrides, + }; +} + +describe("ChangesList", () => { + beforeEach(() => { + vi.clearAllMocks(); + mockListChanges.mockResolvedValue([]); + }); + + it("says so when nothing has changed yet", async () => { + render(); + expect(await screen.findByText("No changes yet")).toBeInTheDocument(); + }); + + it("lists what changed, where, which file and when, in the order Rust returned", async () => { + mockListChanges.mockResolvedValue([ + change({ transactionId: "new", identityKeys: ["mcp-server:github"] }), + change({ + transactionId: "old", + appliedAt: "2026-11-01T10:00:00.000Z", + identityKeys: ["mcp-server:postgres"], + copiedFrom: null, + files: [".claude.json"], + surfaces: ["claude-code"], + }), + ]); + render(); + + const rows = await screen.findAllByTestId("change-row"); + expect(rows).toHaveLength(2); + expect(within(rows[0]!).getByText("MCP server github")).toBeInTheDocument(); + expect(within(rows[0]!).getByText(/Copied from Claude Code to Codex/)).toBeInTheDocument(); + expect(within(rows[0]!).getByText(/~\/\.codex\/config\.toml/)).toBeInTheDocument(); + expect(within(rows[1]!).getByText("MCP server postgres")).toBeInTheDocument(); + expect(within(rows[1]!).queryByText(/Copied from/)).not.toBeInTheDocument(); + }); + + it("asks for the list with no arguments the webview could abuse", async () => { + render(); + await screen.findByText("No changes yet"); + expect(mockListChanges).toHaveBeenCalledWith(); + }); + + it("undoes a change after confirmation, sending only its id, and reloads the list", async () => { + mockListChanges.mockResolvedValueOnce([change()]).mockResolvedValueOnce([ + change({ status: "undone", undoable: false, reason: "Already undone." }), + ]); + mockUndoChange.mockResolvedValue({ transactionId: "tx-1", files: [".codex/config.toml"], warning: null }); + render(); + + fireEvent.click(await screen.findByRole("button", { name: "Undo" })); + expect(mockUndoChange).not.toHaveBeenCalled(); + fireEvent.click(screen.getByRole("button", { name: "Undo this change" })); + + await waitFor(() => expect(mockUndoChange).toHaveBeenCalledWith("tx-1")); + expect(await screen.findByRole("status")).toHaveTextContent("MCP server github was put back."); + await waitFor(() => expect(screen.queryByRole("button", { name: "Undo" })).not.toBeInTheDocument()); + expect(screen.getByText("Undone.")).toBeInTheDocument(); + expect(mockListChanges).toHaveBeenCalledTimes(2); + }); + + it("cancelling the confirmation undoes nothing", async () => { + mockListChanges.mockResolvedValue([change()]); + render(); + fireEvent.click(await screen.findByRole("button", { name: "Undo" })); + fireEvent.click(screen.getByRole("button", { name: "Cancel" })); + expect(mockUndoChange).not.toHaveBeenCalled(); + expect(screen.getByRole("button", { name: "Undo" })).toBeInTheDocument(); + }); + + it("shows the refusal on the row when the file changed since, and keeps Undo available", async () => { + mockListChanges.mockResolvedValue([change()]); + mockUndoChange.mockRejectedValue( + "Refusing to write '.codex/config.toml': it changed on disk since it was read (expected a, found b)", + ); + render(); + + fireEvent.click(await screen.findByRole("button", { name: "Undo" })); + fireEvent.click(screen.getByRole("button", { name: "Undo this change" })); + + expect(await screen.findByRole("alert")).toHaveTextContent("changed on disk"); + expect(screen.queryByRole("status")).not.toBeInTheDocument(); + expect(await screen.findByRole("button", { name: "Undo" })).toBeInTheDocument(); + }); + + it("offers no Undo on a change that cannot be undone, and says why", async () => { + mockListChanges.mockResolvedValue([ + change({ + undoable: false, + status: "unavailable", + reason: "The backup for this change is no longer on disk.", + }), + ]); + render(); + expect(await screen.findByText("The backup for this change is no longer on disk.")).toBeInTheDocument(); + expect(screen.queryByRole("button", { name: "Undo" })).not.toBeInTheDocument(); + }); + + it("shows a notice with Retry when the list cannot be read", async () => { + mockListChanges.mockRejectedValueOnce("state database is locked").mockResolvedValueOnce([]); + render(); + expect(await screen.findByText("Couldn't load the list of changes")).toBeInTheDocument(); + expect(screen.queryByText("No changes yet")).not.toBeInTheDocument(); + fireEvent.click(screen.getByRole("button", { name: "Retry" })); + expect(await screen.findByText("No changes yet")).toBeInTheDocument(); + }); + + it("passes a restore-but-not-marked warning on to the user", async () => { + mockListChanges.mockResolvedValue([change()]); + mockUndoChange.mockResolvedValue({ + transactionId: "tx-1", + files: [], + warning: "The files were restored, but the change could not be marked as undone: disk full", + }); + render(); + fireEvent.click(await screen.findByRole("button", { name: "Undo" })); + fireEvent.click(screen.getByRole("button", { name: "Undo this change" })); + expect(await screen.findByRole("status")).toHaveTextContent("could not be marked as undone"); + }); +}); diff --git a/apps/desktop/src/routes/DriftRedirect.tsx b/apps/desktop/src/routes/DriftRedirect.tsx index df2ebf2d..3e8121bb 100644 --- a/apps/desktop/src/routes/DriftRedirect.tsx +++ b/apps/desktop/src/routes/DriftRedirect.tsx @@ -6,8 +6,8 @@ import { withView } from "../pages/machine/machine-view-model"; * Governed by specs/ux-consolidation/spec.md AC-6 (retired routes redirect * and keep the query the destination reads), AC-7 (a harness in the query * opens Drift filtered to it) and AC-18 (Drift is a view of Machine). DriftPage - * reads `harness` from the URL, and dropping it here made every Fleet row - * click arrive unfiltered. + * reads `harness` from the URL, and dropping it here made every link that + * names a harness arrive unfiltered. */ export function DriftRedirect() { const { search } = useLocation(); diff --git a/apps/desktop/test-fixtures/errors.json b/apps/desktop/test-fixtures/errors.json new file mode 100644 index 00000000..ebed9d69 --- /dev/null +++ b/apps/desktop/test-fixtures/errors.json @@ -0,0 +1,8 @@ +{ + "_comment": "Error values as the Tauri runtime delivers them to the webview: bare strings, not Error objects. Unit mocks reject with these so a handler that reads err.message is caught. The first two come from the fs plugin and the ACL; the rest are the shape of a Rust command returning Err(String).", + "forbiddenPath": "forbidden path: /Users/someone/.zshrc, maybe it is not allowed on the scope for `allow-exists` permission in your capability configuration file", + "aclDenied": "fs.write_text_file not allowed. Permissions associated with this command: fs:allow-write-file, fs:default, fs:write-all", + "commandNotAllowed": "Command guarded_write_file not allowed by ACL", + "rustRefusal": "refused: the file changed on disk since it was read (expected sha256 does not match)", + "ioError": "No such file or directory (os error 2)" +} diff --git a/apps/desktop/test-fixtures/ipc/acknowledge_drift.json b/apps/desktop/test-fixtures/ipc/acknowledge_drift.json new file mode 100644 index 00000000..d5c77f8e --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/acknowledge_drift.json @@ -0,0 +1,27 @@ +{ + "command": "acknowledge_drift", + "calls": [ + { + "fn": "acknowledgeDriftItem", + "args": [ + { + "scopeRoot": "/Users/u/work/app", + "adapter": "claude-code", + "path": ".claude/settings.json", + "harnessName": "team", + "slot": "mcp:github" + } + ], + "payload": { + "ack": { + "scopeRoot": "/Users/u/work/app", + "adapter": "claude-code", + "path": ".claude/settings.json", + "harnessName": "team", + "slot": "mcp:github", + "acknowledgedAt": "2026-01-01T00:00:00.000Z" + } + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/apply_security_preset.json b/apps/desktop/test-fixtures/ipc/apply_security_preset.json new file mode 100644 index 00000000..4ccc0f2c --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/apply_security_preset.json @@ -0,0 +1,31 @@ +{ + "command": "apply_security_preset", + "calls": [ + { + "fn": "applySecurityPreset", + "args": [ + "strict", + "abc123", + [ + "Bash(rm:*)" + ] + ], + "payload": { + "presetId": "strict", + "expectedSha256": "abc123", + "confirmedDropDeny": [ + "Bash(rm:*)" + ] + } + }, + { + "fn": "applySecurityPreset", + "args": [ + "strict" + ], + "payload": { + "presetId": "strict" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/check_plugin_updates.json b/apps/desktop/test-fixtures/ipc/check_plugin_updates.json new file mode 100644 index 00000000..f3c58511 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/check_plugin_updates.json @@ -0,0 +1,10 @@ +{ + "command": "check_plugin_updates", + "calls": [ + { + "fn": "checkPluginUpdates", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/clear_audit_entries.json b/apps/desktop/test-fixtures/ipc/clear_audit_entries.json new file mode 100644 index 00000000..f7dc05ea --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/clear_audit_entries.json @@ -0,0 +1,14 @@ +{ + "command": "clear_audit_entries", + "calls": [ + { + "fn": "clearAuditEntries", + "args": [ + "2026-01-01" + ], + "payload": { + "beforeDate": "2026-01-01" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/compute_live_stats.json b/apps/desktop/test-fixtures/ipc/compute_live_stats.json new file mode 100644 index 00000000..4223d0d1 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/compute_live_stats.json @@ -0,0 +1,21 @@ +{ + "command": "compute_live_stats", + "calls": [ + { + "fn": "computeLiveStats", + "args": [], + "payload": { + "sinceDate": null + } + }, + { + "fn": "computeLiveStats", + "args": [ + "2026-01-01" + ], + "payload": { + "sinceDate": "2026-01-01" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/delete_comparison.json b/apps/desktop/test-fixtures/ipc/delete_comparison.json new file mode 100644 index 00000000..d4d265c8 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/delete_comparison.json @@ -0,0 +1,14 @@ +{ + "command": "delete_comparison", + "calls": [ + { + "fn": "deleteComparison", + "args": [ + "c-1" + ], + "payload": { + "id": "c-1" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/delete_custom_profile.json b/apps/desktop/test-fixtures/ipc/delete_custom_profile.json new file mode 100644 index 00000000..32c3bb84 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/delete_custom_profile.json @@ -0,0 +1,14 @@ +{ + "command": "delete_custom_profile", + "calls": [ + { + "fn": "deleteCustomProfile", + "args": [ + "team" + ], + "payload": { + "id": "team" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/delete_keychain_secret.json b/apps/desktop/test-fixtures/ipc/delete_keychain_secret.json new file mode 100644 index 00000000..00027507 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/delete_keychain_secret.json @@ -0,0 +1,14 @@ +{ + "command": "delete_keychain_secret", + "calls": [ + { + "fn": "deleteKeychainSecret", + "args": [ + "GITHUB_TOKEN" + ], + "payload": { + "name": "GITHUB_TOKEN" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/detect_claude_account.json b/apps/desktop/test-fixtures/ipc/detect_claude_account.json new file mode 100644 index 00000000..db305ab6 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/detect_claude_account.json @@ -0,0 +1,10 @@ +{ + "command": "detect_claude_account", + "calls": [ + { + "fn": "detectClaudeAccount", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/detect_harnesses.json b/apps/desktop/test-fixtures/ipc/detect_harnesses.json new file mode 100644 index 00000000..8c51ffe2 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/detect_harnesses.json @@ -0,0 +1,10 @@ +{ + "command": "detect_harnesses", + "calls": [ + { + "fn": "detectHarnesses", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/export_plugin_as_zip.json b/apps/desktop/test-fixtures/ipc/export_plugin_as_zip.json new file mode 100644 index 00000000..7798f4a1 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/export_plugin_as_zip.json @@ -0,0 +1,14 @@ +{ + "command": "export_plugin_as_zip", + "calls": [ + { + "fn": "exportPluginAsZip", + "args": [ + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0" + ], + "payload": { + "pluginPath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/export_plugin_to_folder.json b/apps/desktop/test-fixtures/ipc/export_plugin_to_folder.json new file mode 100644 index 00000000..a5a3a09a --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/export_plugin_to_folder.json @@ -0,0 +1,14 @@ +{ + "command": "export_plugin_to_folder", + "calls": [ + { + "fn": "exportPluginToFolder", + "args": [ + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0" + ], + "payload": { + "pluginPath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/get_comparison.json b/apps/desktop/test-fixtures/ipc/get_comparison.json new file mode 100644 index 00000000..e9875ab6 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/get_comparison.json @@ -0,0 +1,14 @@ +{ + "command": "get_comparison", + "calls": [ + { + "fn": "getComparison", + "args": [ + "c-1" + ], + "payload": { + "id": "c-1" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/get_comparison_diffs.json b/apps/desktop/test-fixtures/ipc/get_comparison_diffs.json new file mode 100644 index 00000000..0a0e342a --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/get_comparison_diffs.json @@ -0,0 +1,14 @@ +{ + "command": "get_comparison_diffs", + "calls": [ + { + "fn": "getComparisonDiffs", + "args": [ + "c-1" + ], + "payload": { + "comparisonId": "c-1" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/get_custom_profile.json b/apps/desktop/test-fixtures/ipc/get_custom_profile.json new file mode 100644 index 00000000..b23f33fa --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/get_custom_profile.json @@ -0,0 +1,14 @@ +{ + "command": "get_custom_profile", + "calls": [ + { + "fn": "getCustomProfile", + "args": [ + "team" + ], + "payload": { + "id": "team" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/get_history_size.json b/apps/desktop/test-fixtures/ipc/get_history_size.json new file mode 100644 index 00000000..3c807fcb --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/get_history_size.json @@ -0,0 +1,10 @@ +{ + "command": "get_history_size", + "calls": [ + { + "fn": "getHistorySize", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/get_panel_diffs.json b/apps/desktop/test-fixtures/ipc/get_panel_diffs.json new file mode 100644 index 00000000..8f423033 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/get_panel_diffs.json @@ -0,0 +1,16 @@ +{ + "command": "get_panel_diffs", + "calls": [ + { + "fn": "getPanelDiffs", + "args": [ + "c-1", + "p-1" + ], + "payload": { + "comparisonId": "c-1", + "panelId": "p-1" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/get_system_info.json b/apps/desktop/test-fixtures/ipc/get_system_info.json new file mode 100644 index 00000000..0522b6c3 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/get_system_info.json @@ -0,0 +1,10 @@ +{ + "command": "get_system_info", + "calls": [ + { + "fn": "getSystemInfo", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/grant_project_scope.json b/apps/desktop/test-fixtures/ipc/grant_project_scope.json new file mode 100644 index 00000000..17e02db3 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/grant_project_scope.json @@ -0,0 +1,14 @@ +{ + "command": "grant_project_scope", + "calls": [ + { + "fn": "grantProjectScope", + "args": [ + "/Users/u/work/app" + ], + "payload": { + "path": "/Users/u/work/app" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/import_plugin_from_path.json b/apps/desktop/test-fixtures/ipc/import_plugin_from_path.json new file mode 100644 index 00000000..cdb1c54c --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/import_plugin_from_path.json @@ -0,0 +1,23 @@ +{ + "command": "import_plugin_from_path", + "calls": [ + { + "fn": "importPluginFromPath", + "args": [ + null + ], + "payload": { + "sourcePath": null + } + }, + { + "fn": "importPluginFromPath", + "args": [ + "/Users/u/Downloads/demo" + ], + "payload": { + "sourcePath": "/Users/u/Downloads/demo" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/import_plugin_from_zip.json b/apps/desktop/test-fixtures/ipc/import_plugin_from_zip.json new file mode 100644 index 00000000..c1d3556f --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/import_plugin_from_zip.json @@ -0,0 +1,23 @@ +{ + "command": "import_plugin_from_zip", + "calls": [ + { + "fn": "importPluginFromZip", + "args": [ + null + ], + "payload": { + "zipPath": null + } + }, + { + "fn": "importPluginFromZip", + "args": [ + "/Users/u/Downloads/demo.zip" + ], + "payload": { + "zipPath": "/Users/u/Downloads/demo.zip" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_active_sessions.json b/apps/desktop/test-fixtures/ipc/list_active_sessions.json new file mode 100644 index 00000000..a4c527c6 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_active_sessions.json @@ -0,0 +1,10 @@ +{ + "command": "list_active_sessions", + "calls": [ + { + "fn": "listActiveSessions", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_audit_entries.json b/apps/desktop/test-fixtures/ipc/list_audit_entries.json new file mode 100644 index 00000000..e37d8757 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_audit_entries.json @@ -0,0 +1,29 @@ +{ + "command": "list_audit_entries", + "calls": [ + { + "fn": "listAuditEntries", + "args": [ + 50, + 0, + "permissions" + ], + "payload": { + "limit": 50, + "offset": 0, + "category": "permissions" + } + }, + { + "fn": "listAuditEntries", + "args": [ + 50, + 100 + ], + "payload": { + "limit": 50, + "offset": 100 + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_changes.json b/apps/desktop/test-fixtures/ipc/list_changes.json new file mode 100644 index 00000000..e460a8dd --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_changes.json @@ -0,0 +1,19 @@ +{ + "command": "list_changes", + "calls": [ + { + "fn": "listChanges", + "args": [ + 50 + ], + "payload": { + "limit": 50 + } + }, + { + "fn": "listChanges", + "args": [], + "payload": {} + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_claude_dir.json b/apps/desktop/test-fixtures/ipc/list_claude_dir.json new file mode 100644 index 00000000..52c7258e --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_claude_dir.json @@ -0,0 +1,10 @@ +{ + "command": "list_claude_dir", + "calls": [ + { + "fn": "listClaudeDir", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_comparisons.json b/apps/desktop/test-fixtures/ipc/list_comparisons.json new file mode 100644 index 00000000..6a54ad03 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_comparisons.json @@ -0,0 +1,24 @@ +{ + "command": "list_comparisons", + "calls": [ + { + "fn": "listComparisons", + "args": [], + "payload": { + "limit": 50, + "offset": 0 + } + }, + { + "fn": "listComparisons", + "args": [ + 20, + 40 + ], + "payload": { + "limit": 20, + "offset": 40 + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_custom_profiles.json b/apps/desktop/test-fixtures/ipc/list_custom_profiles.json new file mode 100644 index 00000000..039ddfc5 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_custom_profiles.json @@ -0,0 +1,10 @@ +{ + "command": "list_custom_profiles", + "calls": [ + { + "fn": "listCustomProfiles", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_drift_acknowledgements.json b/apps/desktop/test-fixtures/ipc/list_drift_acknowledgements.json new file mode 100644 index 00000000..188b5c61 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_drift_acknowledgements.json @@ -0,0 +1,10 @@ +{ + "command": "list_drift_acknowledgements", + "calls": [ + { + "fn": "getAcknowledgedDriftItems", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_installed_plugins.json b/apps/desktop/test-fixtures/ipc/list_installed_plugins.json new file mode 100644 index 00000000..60c0e5dc --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_installed_plugins.json @@ -0,0 +1,10 @@ +{ + "command": "list_installed_plugins", + "calls": [ + { + "fn": "listInstalledPlugins", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_marketplaces.json b/apps/desktop/test-fixtures/ipc/list_marketplaces.json new file mode 100644 index 00000000..3f8d02db --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_marketplaces.json @@ -0,0 +1,10 @@ +{ + "command": "list_marketplaces", + "calls": [ + { + "fn": "listMarketplaces", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_required_env.json b/apps/desktop/test-fixtures/ipc/list_required_env.json new file mode 100644 index 00000000..a23d5ac8 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_required_env.json @@ -0,0 +1,10 @@ +{ + "command": "list_required_env", + "calls": [ + { + "fn": "listRequiredEnv", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_security_presets.json b/apps/desktop/test-fixtures/ipc/list_security_presets.json new file mode 100644 index 00000000..0ccd372c --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_security_presets.json @@ -0,0 +1,10 @@ +{ + "command": "list_security_presets", + "calls": [ + { + "fn": "listSecurityPresets", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/list_sessions_summary.json b/apps/desktop/test-fixtures/ipc/list_sessions_summary.json new file mode 100644 index 00000000..2f8da834 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/list_sessions_summary.json @@ -0,0 +1,10 @@ +{ + "command": "list_sessions_summary", + "calls": [ + { + "fn": "listSessionsSummary", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/migrate_drift_acknowledgements.json b/apps/desktop/test-fixtures/ipc/migrate_drift_acknowledgements.json new file mode 100644 index 00000000..316685dc --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/migrate_drift_acknowledgements.json @@ -0,0 +1,14 @@ +{ + "command": "migrate_drift_acknowledgements", + "calls": [ + { + "fn": "migrateDriftAcknowledgements", + "args": [ + "/Users/u/.harness-kit/comparator.db" + ], + "payload": { + "legacyDb": "/Users/u/.harness-kit/comparator.db" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/push_file_history.json b/apps/desktop/test-fixtures/ipc/push_file_history.json new file mode 100644 index 00000000..5b085f0b --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/push_file_history.json @@ -0,0 +1,18 @@ +{ + "command": "push_file_history", + "calls": [ + { + "fn": "pushFileHistory", + "args": [ + "demo", + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md", + "# demo" + ], + "payload": { + "pluginName": "demo", + "filePath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md", + "content": "# demo" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_claude_md.json b/apps/desktop/test-fixtures/ipc/read_claude_md.json new file mode 100644 index 00000000..516c986e --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_claude_md.json @@ -0,0 +1,14 @@ +{ + "command": "read_claude_md", + "calls": [ + { + "fn": "readClaudeMd", + "args": [ + "/Users/u/.claude/CLAUDE.md" + ], + "payload": { + "path": "/Users/u/.claude/CLAUDE.md" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_env_config.json b/apps/desktop/test-fixtures/ipc/read_env_config.json new file mode 100644 index 00000000..a464f4a1 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_env_config.json @@ -0,0 +1,10 @@ +{ + "command": "read_env_config", + "calls": [ + { + "fn": "readEnvConfig", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_file_history.json b/apps/desktop/test-fixtures/ipc/read_file_history.json new file mode 100644 index 00000000..bc56f3db --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_file_history.json @@ -0,0 +1,16 @@ +{ + "command": "read_file_history", + "calls": [ + { + "fn": "readFileHistory", + "args": [ + "demo", + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md" + ], + "payload": { + "pluginName": "demo", + "filePath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_harness_file.json b/apps/desktop/test-fixtures/ipc/read_harness_file.json new file mode 100644 index 00000000..79485b81 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_harness_file.json @@ -0,0 +1,10 @@ +{ + "command": "read_harness_file", + "calls": [ + { + "fn": "readHarnessFile", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_hooks.json b/apps/desktop/test-fixtures/ipc/read_hooks.json new file mode 100644 index 00000000..9660004f --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_hooks.json @@ -0,0 +1,10 @@ +{ + "command": "read_hooks", + "calls": [ + { + "fn": "readHooks", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_live_activity.json b/apps/desktop/test-fixtures/ipc/read_live_activity.json new file mode 100644 index 00000000..9e09ff1d --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_live_activity.json @@ -0,0 +1,10 @@ +{ + "command": "read_live_activity", + "calls": [ + { + "fn": "readLiveActivity", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_permissions.json b/apps/desktop/test-fixtures/ipc/read_permissions.json new file mode 100644 index 00000000..c92d72a6 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_permissions.json @@ -0,0 +1,10 @@ +{ + "command": "read_permissions", + "calls": [ + { + "fn": "readPermissions", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_plugin_file.json b/apps/desktop/test-fixtures/ipc/read_plugin_file.json new file mode 100644 index 00000000..568c8240 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_plugin_file.json @@ -0,0 +1,14 @@ +{ + "command": "read_plugin_file", + "calls": [ + { + "fn": "readPluginFile", + "args": [ + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md" + ], + "payload": { + "filePath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_plugin_tree.json b/apps/desktop/test-fixtures/ipc/read_plugin_tree.json new file mode 100644 index 00000000..445f52af --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_plugin_tree.json @@ -0,0 +1,14 @@ +{ + "command": "read_plugin_tree", + "calls": [ + { + "fn": "readPluginTree", + "args": [ + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0" + ], + "payload": { + "pluginPath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_session_facet.json b/apps/desktop/test-fixtures/ipc/read_session_facet.json new file mode 100644 index 00000000..d2db0d3a --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_session_facet.json @@ -0,0 +1,14 @@ +{ + "command": "read_session_facet", + "calls": [ + { + "fn": "readSessionFacet", + "args": [ + "sess-1" + ], + "payload": { + "sessionId": "sess-1" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_session_transcript.json b/apps/desktop/test-fixtures/ipc/read_session_transcript.json new file mode 100644 index 00000000..9ff9dea7 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_session_transcript.json @@ -0,0 +1,16 @@ +{ + "command": "read_session_transcript", + "calls": [ + { + "fn": "readSessionTranscript", + "args": [ + "sess-1", + "-Users-u-work-app" + ], + "payload": { + "sessionId": "sess-1", + "project": "-Users-u-work-app" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/read_stats_cache.json b/apps/desktop/test-fixtures/ipc/read_stats_cache.json new file mode 100644 index 00000000..14bd9f09 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/read_stats_cache.json @@ -0,0 +1,10 @@ +{ + "command": "read_stats_cache", + "calls": [ + { + "fn": "readStatsCache", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/save_comparison.json b/apps/desktop/test-fixtures/ipc/save_comparison.json new file mode 100644 index 00000000..1b5df214 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/save_comparison.json @@ -0,0 +1,22 @@ +{ + "command": "save_comparison", + "calls": [ + { + "fn": "saveComparison", + "args": [ + "c-1", + "Title", + "Fix the bug", + "/Users/u/work/app", + "deadbeef" + ], + "payload": { + "id": "c-1", + "title": "Title", + "prompt": "Fix the bug", + "workingDir": "/Users/u/work/app", + "pinnedCommit": "deadbeef" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/save_custom_profile.json b/apps/desktop/test-fixtures/ipc/save_custom_profile.json new file mode 100644 index 00000000..c1fcd74d --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/save_custom_profile.json @@ -0,0 +1,16 @@ +{ + "command": "save_custom_profile", + "calls": [ + { + "fn": "saveCustomProfile", + "args": [ + "team", + "name: team\n" + ], + "payload": { + "id": "team", + "content": "name: team\n" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/save_file_diffs.json b/apps/desktop/test-fixtures/ipc/save_file_diffs.json new file mode 100644 index 00000000..0caa1345 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/save_file_diffs.json @@ -0,0 +1,30 @@ +{ + "command": "save_file_diffs", + "calls": [ + { + "fn": "saveFileDiffs", + "args": [ + "c-1", + "p-1", + [ + { + "filePath": "a.ts", + "diffText": "@@", + "changeType": "modified" + } + ] + ], + "payload": { + "comparisonId": "c-1", + "panelId": "p-1", + "diffs": [ + { + "filePath": "a.ts", + "diffText": "@@", + "changeType": "modified" + } + ] + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/save_panel.json b/apps/desktop/test-fixtures/ipc/save_panel.json new file mode 100644 index 00000000..9b194229 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/save_panel.json @@ -0,0 +1,22 @@ +{ + "command": "save_panel", + "calls": [ + { + "fn": "savePanel", + "args": [ + "p-1", + "c-1", + "claude", + "Claude Code", + "sonnet" + ], + "payload": { + "id": "p-1", + "comparisonId": "c-1", + "harnessId": "claude", + "harnessName": "Claude Code", + "model": "sonnet" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/set_keychain_secret.json b/apps/desktop/test-fixtures/ipc/set_keychain_secret.json new file mode 100644 index 00000000..73dc41b7 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/set_keychain_secret.json @@ -0,0 +1,16 @@ +{ + "command": "set_keychain_secret", + "calls": [ + { + "fn": "setKeychainSecret", + "args": [ + "GITHUB_TOKEN", + "not-a-real-secret" + ], + "payload": { + "name": "GITHUB_TOKEN", + "value": "not-a-real-secret" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/submit_feedback.json b/apps/desktop/test-fixtures/ipc/submit_feedback.json new file mode 100644 index 00000000..a6a686e9 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/submit_feedback.json @@ -0,0 +1,28 @@ +{ + "command": "submit_feedback", + "calls": [ + { + "fn": "submitFeedback", + "args": [ + "bug", + "It broke", + "Details", + { + "os": "macos", + "osVersion": "15.1", + "arch": "aarch64", + "appVersion": "0.13.0" + } + ], + "payload": { + "category": "bug", + "title": "It broke", + "description": "Details", + "os": "macos", + "osVersion": "15.1", + "arch": "aarch64", + "appVersion": "0.13.0" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_create_backup.json b/apps/desktop/test-fixtures/ipc/sync_create_backup.json new file mode 100644 index 00000000..1f4d239e --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_create_backup.json @@ -0,0 +1,28 @@ +{ + "command": "sync_create_backup", + "calls": [ + { + "fn": "syncCreateBackup", + "args": [ + "/Users/u/work/app", + "team", + [ + "claude-code" + ], + [ + "CLAUDE.md" + ] + ], + "payload": { + "projectDir": "/Users/u/work/app", + "harnessName": "team", + "platforms": [ + "claude-code" + ], + "filePaths": [ + "CLAUDE.md" + ] + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_file_exists.json b/apps/desktop/test-fixtures/ipc/sync_file_exists.json new file mode 100644 index 00000000..8580a91d --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_file_exists.json @@ -0,0 +1,16 @@ +{ + "command": "sync_file_exists", + "calls": [ + { + "fn": "syncFileExists", + "args": [ + "/Users/u/work/app", + "CLAUDE.md" + ], + "payload": { + "projectDir": "/Users/u/work/app", + "filePath": "CLAUDE.md" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_list_backups.json b/apps/desktop/test-fixtures/ipc/sync_list_backups.json new file mode 100644 index 00000000..ecabd006 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_list_backups.json @@ -0,0 +1,10 @@ +{ + "command": "sync_list_backups", + "calls": [ + { + "fn": "syncListBackups", + "args": [], + "payload": null + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_read_dir.json b/apps/desktop/test-fixtures/ipc/sync_read_dir.json new file mode 100644 index 00000000..2aa5194a --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_read_dir.json @@ -0,0 +1,16 @@ +{ + "command": "sync_read_dir", + "calls": [ + { + "fn": "syncReadDir", + "args": [ + "/Users/u/work/app", + ".claude/skills" + ], + "payload": { + "projectDir": "/Users/u/work/app", + "dirPath": ".claude/skills" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_read_file.json b/apps/desktop/test-fixtures/ipc/sync_read_file.json new file mode 100644 index 00000000..960738d2 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_read_file.json @@ -0,0 +1,16 @@ +{ + "command": "sync_read_file", + "calls": [ + { + "fn": "syncReadFile", + "args": [ + "/Users/u/work/app", + "CLAUDE.md" + ], + "payload": { + "projectDir": "/Users/u/work/app", + "filePath": "CLAUDE.md" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_restore_backup.json b/apps/desktop/test-fixtures/ipc/sync_restore_backup.json new file mode 100644 index 00000000..cc3528ff --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_restore_backup.json @@ -0,0 +1,14 @@ +{ + "command": "sync_restore_backup", + "calls": [ + { + "fn": "syncRestoreBackup", + "args": [ + "b-1" + ], + "payload": { + "backupId": "b-1" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/sync_write_files.json b/apps/desktop/test-fixtures/ipc/sync_write_files.json new file mode 100644 index 00000000..c123035d --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/sync_write_files.json @@ -0,0 +1,26 @@ +{ + "command": "sync_write_files", + "calls": [ + { + "fn": "syncWriteFiles", + "args": [ + "/Users/u/work/app", + [ + { + "relativePath": "CLAUDE.md", + "content": "hi" + } + ] + ], + "payload": { + "projectDir": "/Users/u/work/app", + "files": [ + { + "relativePath": "CLAUDE.md", + "content": "hi" + } + ] + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/unacknowledge_drift.json b/apps/desktop/test-fixtures/ipc/unacknowledge_drift.json new file mode 100644 index 00000000..aee62839 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/unacknowledge_drift.json @@ -0,0 +1,27 @@ +{ + "command": "unacknowledge_drift", + "calls": [ + { + "fn": "unacknowledgeDriftItem", + "args": [ + { + "scopeRoot": "/Users/u/work/app", + "adapter": "claude-code", + "path": ".claude/settings.json", + "harnessName": "team", + "slot": "mcp:github" + } + ], + "payload": { + "ack": { + "scopeRoot": "/Users/u/work/app", + "adapter": "claude-code", + "path": ".claude/settings.json", + "harnessName": "team", + "slot": "mcp:github", + "acknowledgedAt": "" + } + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/undo_change.json b/apps/desktop/test-fixtures/ipc/undo_change.json new file mode 100644 index 00000000..0f155345 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/undo_change.json @@ -0,0 +1,14 @@ +{ + "command": "undo_change", + "calls": [ + { + "fn": "undoChange", + "args": [ + "2026-11-01T10-00-00-000Z-app" + ], + "payload": { + "transactionId": "2026-11-01T10-00-00-000Z-app" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/uninstall_plugin.json b/apps/desktop/test-fixtures/ipc/uninstall_plugin.json new file mode 100644 index 00000000..7ca6e6af --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/uninstall_plugin.json @@ -0,0 +1,14 @@ +{ + "command": "uninstall_plugin", + "calls": [ + { + "fn": "uninstallPlugin", + "args": [ + "demo@harness-kit" + ], + "payload": { + "name": "demo@harness-kit" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/update_comparison_status.json b/apps/desktop/test-fixtures/ipc/update_comparison_status.json new file mode 100644 index 00000000..264aec37 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/update_comparison_status.json @@ -0,0 +1,16 @@ +{ + "command": "update_comparison_status", + "calls": [ + { + "fn": "updateComparisonStatus", + "args": [ + "c-1", + "completed" + ], + "payload": { + "id": "c-1", + "status": "completed" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/update_comparison_title.json b/apps/desktop/test-fixtures/ipc/update_comparison_title.json new file mode 100644 index 00000000..f9ad572e --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/update_comparison_title.json @@ -0,0 +1,16 @@ +{ + "command": "update_comparison_title", + "calls": [ + { + "fn": "updateComparisonTitle", + "args": [ + "c-1", + "New" + ], + "payload": { + "id": "c-1", + "title": "New" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/update_panel_result.json b/apps/desktop/test-fixtures/ipc/update_panel_result.json new file mode 100644 index 00000000..a35ea47f --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/update_panel_result.json @@ -0,0 +1,22 @@ +{ + "command": "update_panel_result", + "calls": [ + { + "fn": "updatePanelResult", + "args": [ + "c-1", + "p-1", + 0, + 1234, + "completed" + ], + "payload": { + "comparisonId": "c-1", + "panelId": "p-1", + "exitCode": 0, + "durationMs": 1234, + "status": "completed" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/update_permissions.json b/apps/desktop/test-fixtures/ipc/update_permissions.json new file mode 100644 index 00000000..71739101 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/update_permissions.json @@ -0,0 +1,24 @@ +{ + "command": "update_permissions", + "calls": [ + { + "fn": "updatePermissions", + "args": [ + { + "tools": { "allow": ["Read"], "deny": ["Bash(rm:*)"], "ask": [] }, + "paths": { "writable": ["/Users/u/work/app"], "readonly": [".env"] }, + "network": { "allowedHosts": ["github.com"] } + }, + "abc123" + ], + "payload": { + "permissions": { + "tools": { "allow": ["Read"], "deny": ["Bash(rm:*)"], "ask": [] }, + "paths": { "writable": ["/Users/u/work/app"], "readonly": [".env"] }, + "network": { "allowedHosts": ["github.com"] } + }, + "expectedSha256": "abc123" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/write_config_file.json b/apps/desktop/test-fixtures/ipc/write_config_file.json new file mode 100644 index 00000000..c8d8d52f --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/write_config_file.json @@ -0,0 +1,29 @@ +{ + "command": "write_config_file", + "calls": [ + { + "fn": "writeConfigFile", + "args": [ + "/Users/u/.claude/CLAUDE.md", + "hi", + "abc123" + ], + "payload": { + "path": "/Users/u/.claude/CLAUDE.md", + "content": "hi", + "expectedSha256": "abc123" + } + }, + { + "fn": "writeConfigFile", + "args": [ + "/Users/u/.claude/CLAUDE.md", + "hi" + ], + "payload": { + "path": "/Users/u/.claude/CLAUDE.md", + "content": "hi" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/write_env_config.json b/apps/desktop/test-fixtures/ipc/write_env_config.json new file mode 100644 index 00000000..3ffeee3e --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/write_env_config.json @@ -0,0 +1,30 @@ +{ + "command": "write_env_config", + "calls": [ + { + "fn": "writeEnvConfig", + "args": [ + [ + { + "name": "GITHUB_TOKEN", + "description": "GitHub access", + "value": "", + "pluginName": "demo" + } + ], + "absent" + ], + "payload": { + "entries": [ + { + "name": "GITHUB_TOKEN", + "description": "GitHub access", + "value": "", + "pluginName": "demo" + } + ], + "expectedSha256": "absent" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/write_harness_file.json b/apps/desktop/test-fixtures/ipc/write_harness_file.json new file mode 100644 index 00000000..806d6e3c --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/write_harness_file.json @@ -0,0 +1,25 @@ +{ + "command": "write_harness_file", + "calls": [ + { + "fn": "writeHarnessFile", + "args": [ + "name: team\n", + "abc123" + ], + "payload": { + "content": "name: team\n", + "expectedSha256": "abc123" + } + }, + { + "fn": "writeHarnessFile", + "args": [ + "name: team\n" + ], + "payload": { + "content": "name: team\n" + } + } + ] +} diff --git a/apps/desktop/test-fixtures/ipc/write_plugin_file.json b/apps/desktop/test-fixtures/ipc/write_plugin_file.json new file mode 100644 index 00000000..47dc1518 --- /dev/null +++ b/apps/desktop/test-fixtures/ipc/write_plugin_file.json @@ -0,0 +1,29 @@ +{ + "command": "write_plugin_file", + "calls": [ + { + "fn": "writePluginFile", + "args": [ + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md", + "# demo", + "abc123" + ], + "payload": { + "filePath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md", + "content": "# demo", + "expectedSha256": "abc123" + } + }, + { + "fn": "writePluginFile", + "args": [ + "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md", + "# demo" + ], + "payload": { + "filePath": "/Users/u/.claude/plugins/cache/harness-kit/demo/1.0.0/SKILL.md", + "content": "# demo" + } + } + ] +} diff --git a/packages/core/__tests__/agent-prompt.test.ts b/packages/core/__tests__/agent-prompt.test.ts index e42c71f3..ca2b3bf5 100644 --- a/packages/core/__tests__/agent-prompt.test.ts +++ b/packages/core/__tests__/agent-prompt.test.ts @@ -118,4 +118,48 @@ describe("agent prompt generation (AC-11, AC-35, AC-22)", () => { expect(prompt).toContain("pg-mcp"); expect(prompt).toContain("5432"); }); + + it("asks only for the harness block when instructions differ, and keeps the target's own text", async () => { + const fs = new MockFsProvider({ + "/home/user/.claude/CLAUDE.md": "# House rules\n\nBe kind.\n", + "/home/user/.codex/config.toml": 'model = "gpt-5"\n', + "/home/user/.codex/AGENTS.md": + "# Codex notes\n\n\nOld rules.\n\n", + }); + const request = { + kind: "instructions" as const, + name: "User instructions", + from: "claude-code" as const, + to: "codex" as const, + scope: "user" as const, + }; + const plan = await planCellAction(fs, request, OPTS); + expect(plan.overwrites).toBeDefined(); + const prompt = buildAgentPrompt(plan, request); + expect(prompt).toContain("Update only that block"); + expect(prompt).toContain("leave the text outside it"); + expect(prompt).not.toContain("Replace its version"); + }); + + it("does not call instructions missing when the target has its own file but no harness block", async () => { + const fs = new MockFsProvider({ + "/home/user/.claude/CLAUDE.md": "# House rules\n\nBe kind.\n", + "/home/user/.codex/config.toml": 'model = "gpt-5"\n', + "/home/user/.codex/AGENTS.md": "# Codex notes\n\nMine.\n", + }); + const request = { + kind: "instructions" as const, + name: "User instructions", + from: "claude-code" as const, + to: "codex" as const, + scope: "user" as const, + }; + const plan = await planCellAction(fs, request, OPTS); + expect(plan.requiresConfirmation).toBe(true); + const prompt = buildAgentPrompt(plan, request); + expect(prompt).not.toContain("missing from"); + expect(prompt).toContain("its own instructions"); + expect(prompt).toContain("only the harness block"); + expect(prompt).toContain("leave the rest"); + }); }); diff --git a/packages/core/__tests__/apply-cell-action.test.ts b/packages/core/__tests__/apply-cell-action.test.ts index 221aa878..ae34defa 100644 --- a/packages/core/__tests__/apply-cell-action.test.ts +++ b/packages/core/__tests__/apply-cell-action.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from "vitest"; import { applyCellAction, CellActionError } from "../src/write/apply-cell-action.js"; import { planCellAction } from "../src/write/plan-cell-action.js"; +import { buildMachineInventory } from "../src/observe/machine-inventory.js"; import { createHomeTransactionRoot } from "../src/surfaces/write-scope.js"; import { MockFsProvider } from "./helpers/mock-fs.js"; @@ -117,3 +118,134 @@ describe("cell action apply gate (AC-34, AC-17)", () => { expect(fs.getFile("/home/user/.harness/backups/apply/.cursor/mcp.json")).toBeDefined(); }); }); + +describe("instructions copy leaves no gap on rescan (AC-57)", () => { + const instructionsMachine = () => + new MockFsProvider({ + "/home/user/.claude/CLAUDE.md": "# House rules\n\nBe kind.\n", + "/home/user/.codex/config.toml": 'model = "gpt-5"\n', + }); + + it("an applied copy of User instructions into Codex's AGENTS.md closes the gap", async () => { + const fs = instructionsMachine(); + const before = await buildMachineInventory(fs, OPTS); + const gap = before.gaps.find((g) => g.row === "instructions:user instructions"); + expect(gap?.missingOn).toContain("codex"); + + const planned = await planCellAction( + fs, + { kind: "instructions", name: "User instructions", from: "claude-code", to: "codex", scope: "user" }, + OPTS, + ); + expect(planned.supported).toBe(true); + const result = await applyCellAction(planned, context(fs), { homeRoot: "/home/user" }); + expect(result.committed).toBe(true); + // What lands is a harness:sync marker block, not a file copy. + expect(fs.getFile("/home/user/.codex/AGENTS.md")).toContain("\nShared.\n\n", + }); + await copy(fs, "claude-code", "codex", "a"); + const codex = fs.getFile("/home/user/.codex/AGENTS.md")!; + expect(codex).toContain("Prose one."); + expect(codex).toContain("Shared."); + expect(sync(codex)).toBe(1); + const row = await userRow(fs); + expect(row.cells.codex.effectiveDigest).toBe(row.cells["claude-code"].effectiveDigest); + }); + + it("copying back and forth never nests blocks", async () => { + const fs = new MockFsProvider({ + ...instructionsMachine().getAllFiles(), + "/home/user/.codex/AGENTS.md": "# Beta\n", + }); + await copy(fs, "claude-code", "codex", "a"); + // Claude's own text changes; the codex copy is now the older one. + const edited = new MockFsProvider({ + ...fs.getAllFiles(), + "/home/user/.claude/CLAUDE.md": "# Alpha two\n", + }); + await copy(edited, "codex", "claude-code", "b"); + expect(sync(edited.getFile("/home/user/.claude/CLAUDE.md")!)).toBe(1); + await copy(edited, "claude-code", "codex", "c"); + const codex = edited.getFile("/home/user/.codex/AGENTS.md")!; + expect(sync(codex)).toBe(1); + expect(codex).toContain("# Beta"); + expect(codex.match(/END harness:sync/g)).toHaveLength(1); + }); + + it("refuses a Project instructions row requested at user scope instead of writing the user file", async () => { + const fs = new MockFsProvider({ + "/home/user/.codex/config.toml": 'model = "gpt-5"\n', + "/project/CLAUDE.md": "# Project only\n", + }); + const planned = await planCellAction( + fs, + { kind: "instructions", name: "Project instructions", from: "claude-code", to: "codex", scope: "user" }, + { ...OPTS, projectRoot: "/project" }, + ); + expect(planned.supported).toBe(false); + expect(planned.changes).toEqual([]); + }); +}); diff --git a/packages/core/__tests__/import-inventory.test.ts b/packages/core/__tests__/import-inventory.test.ts new file mode 100644 index 00000000..5f497ec1 --- /dev/null +++ b/packages/core/__tests__/import-inventory.test.ts @@ -0,0 +1,124 @@ +import { describe, it, expect } from "vitest"; +import { parse as parseYaml } from "yaml"; +import { importFromInventory } from "../src/import/import-inventory.js"; +import { buildMachineInventory } from "../src/observe/machine-inventory.js"; +import { validateHarness } from "../src/schema/validate.js"; +import type { ObserveOptions } from "../src/observe/observe-surface.js"; +import { MockFsProvider } from "./helpers/mock-fs.js"; + +const HOME = "/home/user"; +const OPTS: ObserveOptions = { projectRoot: null, homeRoot: HOME, platform: "darwin" }; + +const CLAUDE_JSON = JSON.stringify({ + mcpServers: { + github: { + command: "npx", + args: ["-y", "gh-mcp"], + env: { GITHUB_TOKEN: "ghp_abcdefghijklmnopqrstuvwxyz0123456789", PORT: "5432" }, + }, + remote: { type: "http", url: "https://example.com/mcp" }, + authed: { + type: "http", + url: "https://authed.example.com/mcp", + headers: { Authorization: "Bearer ghp_abcdefghijklmnopqrstuvwxyz0123456789", "X-Region": "us" }, + }, + }, +}); +const SETTINGS = JSON.stringify({ + permissions: { allow: ["Bash(git status)"], deny: ["Read(.env)"], additionalDirectories: ["/work"] }, +}); +// The retired location: Claude Code no longer reads it, so the grid does not show it. +const RETIRED_MCP = JSON.stringify({ mcpServers: { retired: { command: "old" } } }); + +function fs(): MockFsProvider { + return new MockFsProvider( + { + [`${HOME}/.claude.json`]: CLAUDE_JSON, + [`${HOME}/.claude/settings.json`]: SETTINGS, + [`${HOME}/.claude/mcp.json`]: RETIRED_MCP, + }, + HOME, + HOME, + ); +} + +describe("importFromInventory (AC-56)", () => { + it("builds harness.yaml from the servers the grid shows", async () => { + const result = await importFromInventory(fs(), OPTS); + const gridServers = (await buildMachineInventory(fs(), OPTS)).rows + .filter((r) => r.kind === "mcp-server") + .map((r) => r.name) + .sort(); + expect(Object.keys(result.harnessConfig["mcp-servers"] ?? {}).sort()).toEqual(gridServers); + expect(gridServers).toEqual(["authed", "github", "remote"]); + }); + + it("never reads the retired ~/.claude/mcp.json", async () => { + const result = await importFromInventory(fs(), OPTS); + expect(result.harnessYaml).not.toContain("retired"); + }); + + it("returns the same inventory the grid builds", async () => { + const result = await importFromInventory(fs(), OPTS); + expect(result.inventory).toEqual(await buildMachineInventory(fs(), OPTS)); + }); + + it("writes secrets as ${NAME} references, never the literal placeholder", async () => { + const { harnessConfig, harnessYaml } = await importFromInventory(fs(), OPTS); + const servers = harnessConfig["mcp-servers"]!; + expect(servers.github).toMatchObject({ transport: "stdio", command: "npx", args: ["-y", "gh-mcp"] }); + // An env secret references the env var of the same name. + expect((servers.github as { env: Record }).env).toEqual({ + GITHUB_TOKEN: "${GITHUB_TOKEN}", + PORT: "5432", + }); + // A header secret gets a derived name, SERVER_HEADER, upper-snake-cased. The sanitizer + // replaces the whole header value, so a "Bearer " prefix is not recoverable here. + expect((servers.authed as { headers: Record }).headers).toEqual({ + Authorization: "${AUTHED_AUTHORIZATION}", + "X-Region": "us", + }); + expect(servers.remote).toMatchObject({ transport: "http", url: "https://example.com/mcp" }); + expect(harnessYaml).not.toContain("ghp_"); + expect(harnessYaml).not.toContain(""); + }); + + it("carries Claude Code permissions", async () => { + const { harnessConfig } = await importFromInventory(fs(), OPTS); + expect(harnessConfig.permissions).toEqual({ + tools: { allow: ["Bash(git status)"], deny: ["Read(.env)"] }, + paths: { writable: ["/work"] }, + }); + }); + + it("emits a schema-valid document that round-trips as YAML", async () => { + const { harnessConfig, harnessYaml } = await importFromInventory(fs(), OPTS, undefined, { + name: "mine", + description: "from the machine", + }); + expect(validateHarness(harnessConfig).valid).toBe(true); + expect(parseYaml(harnessYaml)).toEqual(JSON.parse(JSON.stringify(harnessConfig))); + expect(harnessConfig.metadata?.name).toBe("mine"); + }); + + it("skips a disabled server rather than writing it as enabled", async () => { + const disabled = new MockFsProvider( + { + [`${HOME}/.config/opencode/opencode.json`]: JSON.stringify({ + mcp: { off: { type: "local", command: ["x"], enabled: false } }, + }), + }, + HOME, + HOME, + ); + const { harnessConfig } = await importFromInventory(disabled, OPTS); + expect(harnessConfig["mcp-servers"]).toBeUndefined(); + }); + + it("an empty machine yields a valid document with no sections", async () => { + const { harnessConfig } = await importFromInventory(new MockFsProvider({}, HOME, HOME), OPTS); + expect(harnessConfig["mcp-servers"]).toBeUndefined(); + expect(harnessConfig.permissions).toBeUndefined(); + expect(validateHarness(harnessConfig).valid).toBe(true); + }); +}); diff --git a/packages/core/__tests__/ledger.test.ts b/packages/core/__tests__/ledger.test.ts index e3048567..e937c1d0 100644 --- a/packages/core/__tests__/ledger.test.ts +++ b/packages/core/__tests__/ledger.test.ts @@ -52,6 +52,16 @@ describe("transaction ledger recording (AC-32)", () => { expect(store.records[0]?.roots).toEqual(["home"]); }); + it("carries the source surface of a copy into the row, and adds no key otherwise", async () => { + const store = fakeStore(); + const changes = [{ root: "home" as const, path: ".claude.json", before: "{}", after: "{}" }]; + const input = { ...INPUT, surfaces: [...INPUT.surfaces], kinds: [...INPUT.kinds] }; + await recordAppliedTransaction(RESULT, changes, { ...input, copiedFrom: "codex" }, store); + await recordAppliedTransaction(RESULT, changes, input, store); + expect(store.records[0]?.copiedFrom).toBe("codex"); + expect("copiedFrom" in (store.records[1] ?? {})).toBe(false); + }); + it("lists both roots for a mixed transaction, in a stable order", async () => { const store = fakeStore(); await recordAppliedTransaction( diff --git a/packages/core/__tests__/machine-inventory.test.ts b/packages/core/__tests__/machine-inventory.test.ts index 644eab60..64fd93ac 100644 --- a/packages/core/__tests__/machine-inventory.test.ts +++ b/packages/core/__tests__/machine-inventory.test.ts @@ -358,12 +358,11 @@ describe("row display name", () => { }); }); -describe("instructions rows (file-based identity)", () => { - it("CLAUDE.md (claude-code) and AGENTS.md (codex) land in SEPARATE rows even with identical content", () => { - // Instruction identity is file-based (Task 9): different filenames mean - // different identityKeys, so same-content files across surfaces are - // separate rows. Content-level cross-file instruction comparison - // (matching CLAUDE.md against AGENTS.md) is post-M1. +describe("instructions rows (one per scope, AC-57)", () => { + it("CLAUDE.md (claude-code) and AGENTS.md (codex) share ONE 'User instructions' row", () => { + // Each surface keeps its instructions in a differently named file, so a + // file-based identity made every copy leave a gap in the row it came + // from. Identity is the scope instead; the file stays in provenance. const content = { content: "Shared house rules." }; const inventory = computeMachineInventory([ obs("claude-code", [ @@ -374,14 +373,48 @@ describe("instructions rows (file-based identity)", () => { ]), ]); - const claudeRow = row(inventory, "instructions:claude.md"); - const agentsRow = row(inventory, "instructions:agents.md"); - expect(claudeRow.name).toBe("CLAUDE.md"); - expect(agentsRow.name).toBe("AGENTS.md"); - expect(claudeRow.cells["claude-code"].status).toBe("present"); - expect(claudeRow.cells.codex.status).toBe("absent"); - expect(agentsRow.cells.codex.status).toBe("present"); - // Separate rows β‡’ no diff is computed between the two files. + const instructionRows = inventory.rows.filter((r) => r.kind === "instructions"); + expect(instructionRows.map((r) => r.key)).toEqual(["instructions:user instructions"]); + const shared = instructionRows[0]!; + expect(shared.name).toBe("User instructions"); + expect(shared.cells["claude-code"].status).toBe("present"); + expect(shared.cells.codex.status).toBe("present"); + expect(shared.cells.codex.entries[0]!.provenance.file).toBe(`${HOME}/.codex/AGENTS.md`); + expect(inventory.gaps).toEqual([]); expect(inventory.diffs).toEqual([]); }); + + it("user-scope and project-scope instructions are separate rows", () => { + const inventory = computeMachineInventory([ + obs("claude-code", [ + { kind: "instructions", scope: "user", name: "CLAUDE.md", value: { content: "a" } }, + { kind: "instructions", scope: "project", name: "CLAUDE.md", value: { content: "b" } }, + ]), + obs("codex", []), + ]); + expect(inventory.rows.map((r) => [r.key, r.name])).toEqual([ + ["instructions:project instructions", "Project instructions"], + ["instructions:user instructions", "User instructions"], + ]); + }); + + it("a file holding only a harness:sync marker block counts as present", () => { + const block = "\nShared house rules.\n\n"; + const inventory = computeMachineInventory([ + obs("claude-code", [{ kind: "instructions", name: "CLAUDE.md", value: { content: "Shared house rules." } }]), + obs("codex", [{ kind: "instructions", name: "AGENTS.md", value: { content: block } }]), + ]); + expect(row(inventory, "instructions:user instructions").cells.codex.status).toBe("present"); + expect(inventory.gaps).toEqual([]); + }); + + it("an instructions gap is still a gap where the target has no instructions file", () => { + const inventory = computeMachineInventory([ + obs("claude-code", [{ kind: "instructions", name: "CLAUDE.md", value: { content: "x" } }]), + obs("codex", []), + ]); + expect(inventory.gaps.map((g) => [g.row, g.missingOn])).toEqual([ + ["instructions:user instructions", ["codex"]], + ]); + }); }); diff --git a/packages/core/__tests__/mcp-servers.test.ts b/packages/core/__tests__/mcp-servers.test.ts index 2ff0f626..2e577867 100644 --- a/packages/core/__tests__/mcp-servers.test.ts +++ b/packages/core/__tests__/mcp-servers.test.ts @@ -11,6 +11,31 @@ function makeConfig(servers: HarnessConfig["mcp-servers"] = {}): HarnessConfig { }; } +describe("compileMcpServers placeholder guard", () => { + it("refuses a literal env value, naming the server and key", async () => { + const config = makeConfig({ + github: { transport: "stdio", command: "npx", env: { GITHUB_TOKEN: "" } }, + }); + await expect(compileMcpServers(config, ["claude-code"], new MockFsProvider())).rejects.toThrow( + /'github'.*env\.GITHUB_TOKEN/, + ); + }); + + it("refuses a header value, and passes ${NAME} references through verbatim", async () => { + const bad = makeConfig({ + api: { transport: "http", url: "https://x.test/mcp", headers: { Authorization: "Bearer " } }, + }); + await expect(compileMcpServers(bad, ["claude-code"], new MockFsProvider())).rejects.toThrow( + /'api'.*headers\.Authorization/, + ); + const good = makeConfig({ + github: { transport: "stdio", command: "npx", env: { GITHUB_TOKEN: "${GITHUB_TOKEN}" } }, + }); + const { files } = await compileMcpServers(good, ["claude-code"], new MockFsProvider()); + expect(JSON.parse(files[0]!.content).mcpServers.github.env.GITHUB_TOKEN).toBe("${GITHUB_TOKEN}"); + }); +}); + describe("compileMcpServers", () => { it("creates MCP JSON files for each target", async () => { const fs = new MockFsProvider(); diff --git a/packages/core/__tests__/normalize.test.ts b/packages/core/__tests__/normalize.test.ts index b6113d19..bfafa07b 100644 --- a/packages/core/__tests__/normalize.test.ts +++ b/packages/core/__tests__/normalize.test.ts @@ -400,6 +400,49 @@ describe("normalizeResource β€” instructions", () => { }); expect(a.digest).toBe(b.digest); }); + + it("identity is the scope, not the file name (AC-57)", () => { + const make = (name: string, scope: "user" | "project") => + normalizeResource({ + surface: "codex", + kind: "instructions", + scope, + name, + value: { content: "x" }, + provenance: { file: `/somewhere/${name}`, formatId: "markdown-instructions" }, + }); + expect(make("CLAUDE.md", "user").identityKey).toBe("instructions:user instructions"); + expect(make("AGENTS.md", "user").identityKey).toBe("instructions:user instructions"); + expect(make("AGENTS.md", "user").name).toBe("User instructions"); + expect(make("AGENTS.md", "project").identityKey).toBe("instructions:project instructions"); + expect(make("AGENTS.md", "project").name).toBe("Project instructions"); + // The file stays visible as provenance. + expect(make("AGENTS.md", "user").provenance.file).toBe("/somewhere/AGENTS.md"); + }); + + it("digests the whole file with only the harness:sync marker lines removed", () => { + const make = (content: string) => + normalizeResource({ + surface: "codex", + kind: "instructions", + scope: "user", + name: "AGENTS.md", + value: { content }, + provenance: { file: "/h/AGENTS.md", formatId: "markdown-instructions" }, + }).digest; + const block = "\nBe kind.\n"; + expect(make(block)).toBe(make("Be kind.")); + // Prose outside the block counts: it is not the same instructions. + expect(make(`# Mine\n\n${block}\n`)).not.toBe(make("Be kind.")); + expect(make(`# Mine\n\n${block}\n`)).toBe(make("# Mine\n\nBe kind.")); + // Editing prose outside a block shows as a change. + expect(make(`# Mine\n\n${block}\n`)).not.toBe(make(`# Mine edited\n\n${block}\n`)); + // A block an older build named after the source file reads the same. + expect(make("\nBe kind.\n")).toBe( + make("Be kind."), + ); + expect(make(block)).not.toBe(make("Be rude.")); + }); }); describe("identity", () => { diff --git a/packages/core/__tests__/portability.test.ts b/packages/core/__tests__/portability.test.ts index 46454b35..d5187654 100644 --- a/packages/core/__tests__/portability.test.ts +++ b/packages/core/__tests__/portability.test.ts @@ -263,6 +263,44 @@ describe("file transactions", () => { expect(JSON.parse(fs.getFile("/project/.harness/backups/test/transaction.json")!).status).toBe("rolled-back"); }); + it("removes a file the transaction created when a later write fails", async () => { + class FailSecondRenameFs extends MockFsProvider { + override async renameFile(from: string, to: string): Promise { + if (to === "/project/b.txt") throw new Error("injected write failure"); + await super.renameFile(from, to); + } + } + const fs = new FailSecondRenameFs({ "/project/b.txt": "b0" }); + const result = await applyFileTransaction( + [ + { path: "created.txt", before: null, after: "new" }, + { path: "b.txt", before: "b0", after: "b1" }, + ], + { fs, timestamp: "created-fail" }, + ); + expect(result.committed).toBe(false); + expect(result.rolledBack).toContain("created.txt"); + expect(await fs.exists("/project/created.txt")).toBe(false); + expect(fs.getFile("/project/b.txt")).toBe("b0"); + expect( + JSON.parse(fs.getFile("/project/.harness/backups/created-fail/transaction.json")!).status, + ).toBe("rolled-back"); + }); + + it("rolling back a committed transaction deletes the file it created", async () => { + const fs = new MockFsProvider({}); + const applied = await applyFileTransaction( + [{ path: "created.txt", before: null, after: "new" }], + { fs, timestamp: "create" }, + ); + expect(applied.committed).toBe(true); + expect(fs.getFile("/project/created.txt")).toBe("new"); + const manifest = JSON.parse(fs.getFile("/project/.harness/backups/create/transaction.json")!); + const rolledBack = await rollbackFileTransaction(manifest, { fs, timestamp: "undo-create" }); + expect(rolledBack.committed).toBe(true); + expect(await fs.exists("/project/created.txt")).toBe(false); + }); + it("rolls back a committed transaction but refuses to overwrite later edits", async () => { const fs = new MockFsProvider({ "/project/a.txt": "a0" }); const applied = await applyFileTransaction( diff --git a/packages/core/__tests__/read-mcp.test.ts b/packages/core/__tests__/read-mcp.test.ts new file mode 100644 index 00000000..d52823a8 --- /dev/null +++ b/packages/core/__tests__/read-mcp.test.ts @@ -0,0 +1,71 @@ +import { describe, it, expect } from "vitest"; +import { reverseTranslateServer } from "../src/import/read-mcp.js"; + +describe("reverseTranslateServer (AC-58)", () => { + it("reads a command-only entry as stdio", () => { + expect(reverseTranslateServer({ command: "npx", args: ["-y", "x"], env: { A: "1" } })).toEqual({ + transport: "stdio", + command: "npx", + args: ["-y", "x"], + env: { A: "1" }, + }); + }); + + it("reads an explicit type stdio entry as stdio", () => { + expect(reverseTranslateServer({ type: "stdio", command: "node" })).toEqual({ + transport: "stdio", + command: "node", + }); + }); + + it("reads a url-only entry (Cursor shape, no type) as http, keeping headers", () => { + expect( + reverseTranslateServer({ url: "https://mcp.example.com/mcp", headers: { Authorization: "Bearer x" } }), + ).toEqual({ + transport: "http", + url: "https://mcp.example.com/mcp", + headers: { Authorization: "Bearer x" }, + }); + }); + + it("reads url + type http as http", () => { + expect(reverseTranslateServer({ type: "http", url: "https://a.example/mcp" })).toEqual({ + transport: "http", + url: "https://a.example/mcp", + }); + }); + + it("reads url + type sse as sse", () => { + expect(reverseTranslateServer({ type: "sse", url: "https://a.example/sse" })).toEqual({ + transport: "sse", + url: "https://a.example/sse", + }); + }); + + it("reads url + an unrecognized remote type (streamable-http) as http", () => { + expect(reverseTranslateServer({ type: "streamable-http", url: "https://a.example/mcp" })).toEqual({ + transport: "http", + url: "https://a.example/mcp", + }); + }); + + it("with both url and command and no type, command wins (stdio)", () => { + expect(reverseTranslateServer({ command: "node", url: "https://a.example" })).toEqual({ + transport: "stdio", + command: "node", + }); + }); + + it("with both url and command, an explicit network type wins", () => { + expect(reverseTranslateServer({ type: "http", command: "node", url: "https://a.example" })).toEqual({ + transport: "http", + url: "https://a.example", + }); + }); + + it("returns null for explicit stdio with only a url, and for empty entries", () => { + expect(reverseTranslateServer({ type: "stdio", url: "https://a.example" })).toBeNull(); + expect(reverseTranslateServer({})).toBeNull(); + expect(reverseTranslateServer({ type: "http" })).toBeNull(); + }); +}); diff --git a/packages/core/__tests__/write-store.test.ts b/packages/core/__tests__/write-store.test.ts index d763e11a..d1ed7d5c 100644 --- a/packages/core/__tests__/write-store.test.ts +++ b/packages/core/__tests__/write-store.test.ts @@ -152,10 +152,38 @@ describe("store write executors (AC-12, AC-13)", () => { const after = plan.changes[0]!.after!; expect(after).toContain("# My own notes"); expect(after).toContain("Keep me."); - expect(after).toContain("BEGIN harness:sync:house-style"); + // The slot is the scope's, not the source file's name. + expect(after).toContain("BEGIN harness:sync:user-instructions"); + expect(after).not.toContain("house-style"); expect(after).toContain("Use tabs."); }); + it("never nests: a source with prose and a sync block copies all of it, minus the marker lines", async () => { + const fs = new MockFsProvider({ "/home/user/.codex/AGENTS.md": "mine\n" }); + const plan = await planStoreWrite( + fs, + store({ kind: "instructions", formatId: "markdown-instructions", path: ".codex/AGENTS.md" }), + "/home/user/.codex/AGENTS.md", + { + kind: "instructions", + name: "User instructions", + value: { + content: + "own prose\n\n\nUse tabs.\n\n", + }, + }, + ); + if (!plan.supported) throw new Error("expected supported"); + const after = plan.changes[0]!.after!; + expect(after.match(/BEGIN harness:sync/g)).toHaveLength(1); + expect(after).toContain("Use tabs."); + expect(after).toContain("own prose"); + expect(after.match(/END harness:sync/g)).toHaveLength(1); + // The target's block holds the source's prose and block text, no nested markers. + const block = after.slice(after.indexOf("$/; + for (let i = 0; i < lines.length; i++) { + const match = lines[i].trim().match(begin); + if (!match) continue; + const endTag = ``; + for (let j = i + 1; j < lines.length; j++) { + if (lines[j].trim() === endTag) { + return { + slot: match[1], + startLine: i, + endLine: j, + content: lines.slice(i + 1, j).join("\n"), + }; + } + } + } + return null; +} + +const SYNC_MARKER_LINE = /^$/; + +/** + * The instruction text a file carries for cross-surface comparison and for + * copying: the whole file with only the `harness:sync` BEGIN/END marker lines + * removed. Text inside a block and text outside both count, so the user's own + * prose is never invisible to a comparison or silently left out of a copy, + * and a copy of a file that holds a block never nests markers. + */ +export function syncedInstructionsContent(fileContent: string): string { + return fileContent + .split("\n") + .filter((line) => !SYNC_MARKER_LINE.test(line.trim())) + .join("\n"); +} + +/** The file's text outside its first `harness:sync` block (the whole file when it has none). */ +export function textOutsideSyncBlock(fileContent: string): string { + const block = findAnySyncBlock(fileContent); + if (!block) return fileContent; + const lines = fileContent.split("\n"); + return [...lines.slice(0, block.startLine), ...lines.slice(block.endLine + 1)].join("\n"); +} + export function replaceMarkerBlock( fileContent: string, name: string, diff --git a/packages/core/src/compile/mcp-servers.ts b/packages/core/src/compile/mcp-servers.ts index e4fb7270..b3146487 100644 --- a/packages/core/src/compile/mcp-servers.ts +++ b/packages/core/src/compile/mcp-servers.ts @@ -7,6 +7,7 @@ import type { } from "../types.js"; import { readJsonOrDefault } from "../utils/read-json.js"; import { getTarget } from "./targets.js"; +import { SECRET_PLACEHOLDER } from "../observe/normalize.js"; export interface McpJsonEntry { type: string; @@ -43,6 +44,32 @@ export function translateServer(server: McpServer): McpJsonEntry { return entry; } +/** + * Refuse a server holding the inventory's `` placeholder in a value a + * server reads. It is a stand-in for a hidden credential, not a credential: + * emitting it would write a config that fails at connect time with no hint why. + */ +export function assertNoSecretPlaceholder(serverName: string, server: McpServer): void { + const fields: Array<[string, string]> = + server.transport === "stdio" + ? [ + ...Object.entries(server.env ?? {}).map(([k, v]): [string, string] => [`env.${k}`, v]), + ...(server.args ?? []).map((v, i): [string, string] => [`args[${i}]`, v]), + ] + : [ + ...Object.entries(server.headers ?? {}).map(([k, v]): [string, string] => [`headers.${k}`, v]), + ["url", server.url], + ]; + for (const [field, value] of fields) { + if (typeof value === "string" && value.includes(SECRET_PLACEHOLDER)) { + throw new Error( + `MCP server '${serverName}': ${field} is the placeholder ${SECRET_PLACEHOLDER}, not a value. ` + + `Set it to a \${NAME} reference or the real value in harness.yaml before compiling.`, + ); + } + } +} + export async function compileMcpServers( config: HarnessConfig, targets: SurfaceId[], @@ -60,6 +87,7 @@ export async function compileMcpServers( // Translate all servers const translated: Record = {}; for (const [name, server] of Object.entries(mcpServers)) { + assertNoSecretPlaceholder(name, server); translated[name] = translateServer(server); } diff --git a/packages/core/src/import/import-inventory.ts b/packages/core/src/import/import-inventory.ts new file mode 100644 index 00000000..3b59ee27 --- /dev/null +++ b/packages/core/src/import/import-inventory.ts @@ -0,0 +1,156 @@ +import { stringify as stringifyYaml } from "yaml"; +import type { FsProvider } from "../fs-provider.js"; +import type { HarnessConfig, HarnessPermissions, McpServer } from "../types.js"; +import type { SurfaceDescriptor } from "../surfaces/types.js"; +import { SURFACES } from "../surfaces/registry.js"; +import { computeMachineInventory, type MachineInventory } from "../observe/machine-inventory.js"; +import { observeAllSurfaces, type ObserveOptions } from "../observe/observe-surface.js"; +import { normalizeObservation, SECRET_PLACEHOLDER, type NormalizedResource } from "../observe/normalize.js"; +import { CURRENT_PROTOCOL_VERSION } from "../utils/protocol-version.js"; +import { isRecord } from "../utils/is-record.js"; + +export interface InventoryImportMeta { + /** harness.yaml metadata.name. */ + name?: string; + /** harness.yaml metadata.description. */ + description?: string; +} + +export interface InventoryImportResult { + /** The same inventory `buildMachineInventory` returns for these inputs: what the Machine grid shows. */ + inventory: MachineInventory; + harnessConfig: HarnessConfig; + harnessYaml: string; +} + +function referenceName(raw: string): string { + return raw.replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toUpperCase(); +} + +/** + * Replace the inventory's `` placeholder with a `${NAME}` reference so + * the written file never carries a value that would break the server. An env + * var uses its own key as NAME; a header uses `_
      ` because a + * header name is not an environment variable name. + */ +function referenceSecrets(values: Record, nameFor: (key: string) => string): Record { + return Object.fromEntries( + Object.entries(values).map(([key, value]) => [ + key, + typeof value === "string" ? value.replaceAll(SECRET_PLACEHOLDER, `\${${nameFor(key)}}`) : value, + ]), + ); +} + +/** An MCP server's canonical form (observe/normalize.ts) back to a harness.yaml server, or null to skip it. */ +function toMcpServerNamed(serverName: string, form: unknown): McpServer | null { + const server = toMcpServer(form); + if (!server) return null; + if (server.transport === "stdio") { + return server.env ? { ...server, env: referenceSecrets(server.env, (key) => key) } : server; + } + return server.headers + ? { ...server, headers: referenceSecrets(server.headers, (key) => `${referenceName(serverName)}_${referenceName(key)}`) } + : server; +} + +function toMcpServer(form: unknown): McpServer | null { + if (!isRecord(form)) return null; + // A disabled server is not part of the setup the grid reports as active; + // writing it back without the flag would turn it on. + if (form.enabled === false) return null; + const transport = form.transport; + if (transport === "stdio") { + if (typeof form.command !== "string") return null; + return { + transport: "stdio", + command: form.command, + ...(Array.isArray(form.args) ? { args: form.args as string[] } : {}), + ...(isRecord(form.env) && Object.keys(form.env).length > 0 ? { env: form.env as Record } : {}), + }; + } + if (transport === "http" || transport === "sse" || transport === "ws") { + if (typeof form.url !== "string") return null; + return { + transport, + url: form.url, + ...(isRecord(form.headers) && Object.keys(form.headers).length > 0 + ? { headers: form.headers as Record } + : {}), + }; + } + return null; +} + +function stringList(value: unknown): string[] { + return Array.isArray(value) ? value.filter((v): v is string => typeof v === "string") : []; +} + +function union(...lists: string[][]): string[] { + return [...new Set(lists.flat())]; +} + +/** Claude Code's `permissions` block (allow/deny/additionalDirectories) from settings-style permission rows. */ +function toPermissions(resources: NormalizedResource[]): HarnessPermissions | undefined { + const blocks = resources + .filter((r) => r.kind === "permissions" && isRecord(r.canonicalForm) && isRecord(r.canonicalForm.permissions)) + .map((r) => (r.canonicalForm as { permissions: Record }).permissions); + const allow = union(...blocks.map((b) => stringList(b.allow))); + const deny = union(...blocks.map((b) => stringList(b.deny))); + const writable = union(...blocks.map((b) => stringList(b.additionalDirectories))); + const permissions: HarnessPermissions = {}; + if (allow.length > 0 || deny.length > 0) { + permissions.tools = { ...(allow.length > 0 ? { allow } : {}), ...(deny.length > 0 ? { deny } : {}) }; + } + if (writable.length > 0) permissions.paths = { writable }; + return Object.keys(permissions).length > 0 ? permissions : undefined; +} + +/** + * Build a harness.yaml from the machine inventory (AC-56): observe every + * surface once, fold the observations into the grid's inventory, and derive + * the document from those same normalized resources, so onboarding and + * "Generate from Claude Code setup" cannot disagree with the Machine grid. + * + * Covers MCP servers and permissions. Values are the inventory's + * secret-sanitized canonical forms: a credential-shaped env or header value is + * written as a `${NAME}` reference, never verbatim and never as the literal + * `` placeholder (which would break the server once compiled). When the same server is on several surfaces the + * first in registry order wins (project scope over user scope); the + * inventory's `diffs` list the disagreements. + */ +export async function importFromInventory( + fs: FsProvider, + opts: ObserveOptions, + surfaces: readonly SurfaceDescriptor[] = SURFACES, + meta: InventoryImportMeta = {}, +): Promise { + const observations = await observeAllSurfaces(fs, opts, [...surfaces]); + const inventory = computeMachineInventory(observations, surfaces); + const resources = observations.flatMap(normalizeObservation); + + const mcpServers: Record = {}; + const ordered = [...resources.filter((r) => r.scope === "project"), ...resources.filter((r) => r.scope !== "project")]; + for (const resource of ordered) { + if (resource.kind !== "mcp-server" || resource.name in mcpServers) continue; + const server = toMcpServerNamed(resource.name, resource.canonicalForm); + if (server) mcpServers[resource.name] = server; + } + const sortedServers = Object.fromEntries(Object.entries(mcpServers).sort(([a], [b]) => a.localeCompare(b))); + const permissions = toPermissions(resources); + + const harnessConfig: HarnessConfig = { + $schema: "https://harnessprotocol.io/schema/v2/harness.schema.json", + version: CURRENT_PROTOCOL_VERSION, + kind: "profile", + scope: opts.projectRoot === null ? "personal" : "project", + metadata: { + name: meta.name ?? "imported", + description: meta.description ?? "Built from this machine's inventory by harness-kit.", + }, + ...(Object.keys(sortedServers).length > 0 ? { "mcp-servers": sortedServers } : {}), + ...(permissions ? { permissions } : {}), + }; + + return { inventory, harnessConfig, harnessYaml: stringifyYaml(harnessConfig, { lineWidth: 0 }) }; +} diff --git a/packages/core/src/import/read-mcp.ts b/packages/core/src/import/read-mcp.ts index 5ed1f13f..96f19c11 100644 --- a/packages/core/src/import/read-mcp.ts +++ b/packages/core/src/import/read-mcp.ts @@ -25,7 +25,10 @@ const NETWORK_TRANSPORTS = new Set(["http", "sse", "ws"]); * so both paths translate the common shapes identically. */ export function reverseTranslateServer(entry: McpJsonEntry): McpServer | null { - const type = entry.type ?? "stdio"; + // Precedence: an explicit `type` wins. With no `type`, `command` means + // stdio and a `url` without a `command` means a remote (http) server β€” + // Cursor and Claude Code both write url entries with no `type`. + const type = entry.type ?? (entry.url && !entry.command ? "http" : "stdio"); if (type === "stdio") { if (!entry.command) return null; @@ -38,10 +41,11 @@ export function reverseTranslateServer(entry: McpJsonEntry): McpServer | null { return server; } - if (NETWORK_TRANSPORTS.has(type)) { - if (!entry.url) return null; + // Any non-stdio type that carries a url is remote. Known transports keep + // their name; spellings like "streamable-http" read as http. + if (entry.url) { const server: McpServer = { - transport: type as "http" | "sse" | "ws", + transport: NETWORK_TRANSPORTS.has(type) ? (type as "http" | "sse" | "ws") : "http", url: entry.url, ...(entry.headers ? { headers: entry.headers } : {}), }; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index c7516828..b10d7775 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -191,6 +191,8 @@ export type { export type { ImportContext } from "./import/import-project.js"; export type { SynthesizeResult } from "./import/synthesize.js"; export { importProject, importMachine, importProjectValidated } from "./import/import-project.js"; +export { importFromInventory } from "./import/import-inventory.js"; +export type { InventoryImportMeta, InventoryImportResult } from "./import/import-inventory.js"; export { skillDirectoryDigest } from "./import/read-skills.js"; export { synthesize } from "./import/synthesize.js"; export { diff --git a/packages/core/src/observe/machine-inventory.ts b/packages/core/src/observe/machine-inventory.ts index 36298ef9..e63d8cd1 100644 --- a/packages/core/src/observe/machine-inventory.ts +++ b/packages/core/src/observe/machine-inventory.ts @@ -265,10 +265,11 @@ function effectiveResource(resources: NormalizedResource[]): NormalizedResource * a cell for EVERY observed surface (including undetected ones β€” the grid * lists all 11 columns and the UI greys undetected ones). * - * Note on instructions rows: identity is file-based (Task 9) β€” CLAUDE.md - * and AGENTS.md have different identityKeys and land in separate rows even - * when their content overlaps. Content-level cross-file instruction - * comparison is post-M1. + * Note on instructions rows: identity is per scope (AC-57) β€” CLAUDE.md, + * AGENTS.md and the like share one "User instructions" row, and the + * project-scope files share one "Project instructions" row. A file holding + * only a `harness:sync` block, which a copy writes, counts as present. + * Differing content shows as a diff between the cells. */ export function computeMachineInventory( observations: SurfaceObservation[], diff --git a/packages/core/src/observe/normalize.ts b/packages/core/src/observe/normalize.ts index 96da7b84..465cf6f8 100644 --- a/packages/core/src/observe/normalize.ts +++ b/packages/core/src/observe/normalize.ts @@ -3,6 +3,7 @@ import type { StoreFormatId, SurfaceId, SurfaceScope } from "../surfaces/types.j import { digestValue } from "../portability/resource-model.js"; import { looksLikeSecret, sanitizeCommandArgs, sanitizeUrl } from "../portability/secrets.js"; import { isRecord } from "../utils/is-record.js"; +import { syncedInstructionsContent } from "../compile/markers.js"; import type { ObservedResource, SurfaceObservation } from "./observe-surface.js"; import type { InstructionsStoreValue, SkillStoreValue } from "./read-store.js"; import type { PluginStoreValue } from "../codecs/plugin-shapes.js"; @@ -33,7 +34,8 @@ export interface NormalizedResource { surface: SurfaceId; kind: HarnessResourceKind; /** Original, case-preserved name as observed (display form; identityKey - * holds the case-collapsed join key). */ + * holds the case-collapsed join key). For `instructions` it is the + * per-scope row name, not the file name (see `instructionsRowName`). */ name: string; /** * `${kind}:${name.toLowerCase().trim()}` β€” cross-surface identity. The @@ -195,14 +197,20 @@ function canonicalizeSkill(value: unknown): unknown { /** * instructions canonical form: `{ content }`, whitespace-normalized. - * Identity stays the resource's reported (file-based) name β€” cross-surface - * instruction identity is content-level and deferred to Task 10's diffing. + * Identity is per scope (`instructionsRowName`), set in `normalizeResource`; + * the content here feeds the digest and the diff between surfaces. */ function canonicalizeInstructions(value: unknown): unknown { if (!isRecord(value)) return deepCanonical(value); const instructions = value as Partial; return { - content: typeof instructions.content === "string" ? normalizeText(instructions.content) : "", + // The whole file counts, with only the `harness:sync` marker lines removed: + // they are Harness Kit's bookkeeping, but text inside and outside a block + // is the user's instructions, and a difference in either is a difference. + content: + typeof instructions.content === "string" + ? normalizeText(syncedInstructionsContent(instructions.content)) + : "", }; } @@ -256,14 +264,27 @@ const CANONICALIZERS: Record = { // ── public API ────────────────────────────────────────────────── +/** + * The row name for an instructions file. Every surface keeps its instructions + * in a differently named file (CLAUDE.md, AGENTS.md, copilot-instructions.md), + * so a file-based identity put one surface's copy in a row the source never + * shared: a copy the app reported as done left the gap open (AC-57). Identity + * is the scope instead; the file stays in `provenance`. + */ +export function instructionsRowName(scope: SurfaceScope): string { + return scope === "user" ? "User instructions" : "Project instructions"; +} + /** Normalize one observed resource into its canonical, digested form. */ export function normalizeResource(resource: ObservedResource): NormalizedResource { const canonicalForm = CANONICALIZERS[resource.kind](resource.value); + const name = + resource.kind === "instructions" ?instructionsRowName(resource.scope) : resource.name; return { surface: resource.surface, kind: resource.kind, - name: resource.name, - identityKey: `${resource.kind}:${resource.name.toLowerCase().trim()}`, + name, + identityKey: `${resource.kind}:${name.toLowerCase().trim()}`, scope: resource.scope, canonicalForm, digest: digestValue(canonicalForm), diff --git a/packages/core/src/portability/capabilities.ts b/packages/core/src/portability/capabilities.ts index 23bbad9c..e0dfd6a0 100644 --- a/packages/core/src/portability/capabilities.ts +++ b/packages/core/src/portability/capabilities.ts @@ -205,7 +205,7 @@ function capabilityFor( * SCOPE β€” the definitions registry reaches the SURFACE GRID path only: * observe β†’ grid β†’ plan β†’ apply β†’ rollback. The legacy compile/portability * flow (`reconcile.ts`, `apply.ts`, `portability-common.ts`, the desktop - * Fleet page) still reads `TARGET_CAPABILITY_MATRIX`, because that flow + * portability panel in the desktop's Settings β€Ί Activity) still reads `TARGET_CAPABILITY_MATRIX`, because that flow * compiles a harness.yaml and never resolves definitions at all. AC-26 is * scoped to "next inventory", so this line is deliberate β€” but it means a * bundle that changes a capability is visible to `sync` and not to `apply`. diff --git a/packages/core/src/state/ledger.ts b/packages/core/src/state/ledger.ts index 12626a59..4e172213 100644 --- a/packages/core/src/state/ledger.ts +++ b/packages/core/src/state/ledger.ts @@ -18,6 +18,8 @@ export interface LedgerEntryInput { surfaces: SurfaceId[]; kinds: HarnessResourceKind[]; identityKeys: string[]; + /** Set for a Machine drawer copy: the surface it was copied from. */ + copiedFrom?: SurfaceId; } export interface LedgerOutcome { @@ -58,6 +60,7 @@ export async function recordAppliedTransaction( surfaces: input.surfaces, kinds: input.kinds, identityKeys: input.identityKeys, + ...(input.copiedFrom ? { copiedFrom: input.copiedFrom } : {}), }; try { await store.recordTransaction(record); diff --git a/packages/core/src/state/store.ts b/packages/core/src/state/store.ts index c7ea1865..ec4c8a80 100644 --- a/packages/core/src/state/store.ts +++ b/packages/core/src/state/store.ts @@ -93,6 +93,11 @@ export interface TransactionRecord { kinds: HarnessResourceKind[]; /** `${kind}:${lowercased name}` identity keys changed. */ identityKeys: string[]; + /** + * The surface a Machine drawer copy took the resource from. Absent for every + * other apply. The desktop turns its presence into an audit entry. + */ + copiedFrom?: SurfaceId; } /** diff --git a/packages/core/src/write/agent-prompt.ts b/packages/core/src/write/agent-prompt.ts index 86f7171b..1ea9ccd9 100644 --- a/packages/core/src/write/agent-prompt.ts +++ b/packages/core/src/write/agent-prompt.ts @@ -175,9 +175,15 @@ export function buildAgentPrompt( // resource with different content β€” telling an agent it is missing is a // false premise, and saying nothing about the replacement hides the part // that destroys work. - plan.overwrites === undefined + request.kind === "instructions" && plan.targetInstructions + ? plan.targetInstructions.hasBlock + ? `${target.label} ALREADY has a harness-managed instructions block${plan.targetInstructions.hasOwnText ? " and text of its own outside it" : " with different content"}. Update only that block with ${source.label}'s instructions and leave the text outside it as it is.` + : `${target.label} already has its own instructions file, with no harness block. Add or update only the harness block ( to ) with ${source.label}'s instructions and leave the rest of the file as it is.` + : plan.overwrites === undefined ? `It is already configured in ${source.label} and missing from ${target.label}. Reproduce it using ${target.label}'s own configuration β€” do not copy ${source.label}'s file format verbatim.` - : `${target.label} ALREADY has this, with different content. Replace its version with ${source.label}'s, using ${target.label}'s own configuration β€” do not copy ${source.label}'s file format verbatim.`, + : request.kind === "instructions" + ? `${target.label} ALREADY has a harness-managed instructions block with different content. Update only that block with ${source.label}'s instructions and leave the text outside it as it is.` + : `${target.label} ALREADY has this, with different content. Replace its version with ${source.label}'s, using ${target.label}'s own configuration β€” do not copy ${source.label}'s file format verbatim.`, "", `Target configuration: ${targetFile}`, `Scope: ${request.scope === "user" ? "user/global (applies everywhere)" : "this project only"}`, diff --git a/packages/core/src/write/plan-cell-action.ts b/packages/core/src/write/plan-cell-action.ts index 2037abcb..9eb1cbf0 100644 --- a/packages/core/src/write/plan-cell-action.ts +++ b/packages/core/src/write/plan-cell-action.ts @@ -16,10 +16,11 @@ import type { SurfaceScope, } from "../surfaces/types.js"; import { isRecord } from "../utils/is-record.js"; +import { findAnySyncBlock, textOutsideSyncBlock } from "../compile/markers.js"; import { planStoreWrite, unsupportedKindReason } from "./write-store.js"; import { diffCanonicalForms } from "../observe/machine-inventory.js"; import type { FieldDelta } from "../observe/machine-inventory.js"; -import { normalizeResource } from "../observe/normalize.js"; +import { instructionsRowName, normalizeResource } from "../observe/normalize.js"; import { planPluginAction } from "../plugins/broker.js"; import type { BrokerPlan } from "../plugins/broker.js"; import type { PlannedFileChange } from "./write-store.js"; @@ -87,6 +88,12 @@ export interface CellActionPlan { * the deferral that created it was about never silently choosing a winner. */ overwrites?: FieldDelta[]; + /** + * Instructions cells only: what the target's file already holds. A copy + * writes only the harness block and keeps the rest, so the wording depends on + * whether the target has a block and/or text of its own outside one. + */ + targetInstructions?: { hasBlock: boolean; hasOwnText: boolean }; /** * Set for `plugin` cells only. A plugin is not installed by writing a * config store β€” it goes through the surface's own installer, or is @@ -188,8 +195,15 @@ async function findEntry( projectRoot: opts.projectRoot, homeRoot: opts.homeRoot, }); + // Instructions match by row name (per scope), not by file name: the grid's + // "User instructions" row spans CLAUDE.md, AGENTS.md and the rest. const matches = result.entries.filter( - (candidate) => candidate.kind === kind && candidate.name.toLowerCase() === wanted, + (candidate) => + candidate.kind === kind && + (kind === "instructions" + ? instructionsRowName(candidate.scope ?? store.scope) + : candidate.name + ).toLowerCase() === wanted, ); // Ordering STORES project-first is not enough when one store's format // emits both scopes β€” Claude Code declares plugins in a single user-scope @@ -221,6 +235,17 @@ export async function planCellAction( */ registry: readonly SurfaceDescriptor[] = SURFACES, ): Promise { + // An instructions row is per scope, and the write goes to the request's + // scope. A "Project instructions" row requested at user scope would copy + // project text into the user's own file, so refuse it. + if ( + request.kind === "instructions" && + request.name.trim().toLowerCase() !== instructionsRowName(request.scope).toLowerCase() + ) { + return refuse( + `'${request.name}' is not a ${request.scope}-scope instructions row β€” copy it at its own scope.`, + ); + } const found = await findEntry(fs, request.from, request.kind, request.name, opts, registry); if (!found) { return refuse( @@ -336,6 +361,18 @@ export async function planCellAction( ? diffAgainstExisting(request.kind, existing.entry.value, found.entry.value) : null; + const existingText = + request.kind === "instructions" && existing !== null && isRecord(existing.entry.value) + ? existing.entry.value.content + : undefined; + const targetInstructions = + typeof existingText === "string" && existingText.trim() !== "" + ? { + hasBlock: findAnySyncBlock(existingText) !== null, + hasOwnText: textOutsideSyncBlock(existingText).trim() !== "", + } + : null; + return { supported: true, changes, @@ -344,6 +381,7 @@ export async function planCellAction( value: found.entry.value, loss, ...(overwrites !== null ? { overwrites } : {}), + ...(targetInstructions !== null ? { targetInstructions } : {}), requiresConfirmation: hasGenuineLoss(loss) || overwrites !== null, source, target, diff --git a/packages/core/src/write/write-store.ts b/packages/core/src/write/write-store.ts index 5aa0feb5..f5a91d99 100644 --- a/packages/core/src/write/write-store.ts +++ b/packages/core/src/write/write-store.ts @@ -1,7 +1,13 @@ import { translateServer } from "../adapters/opencode/config-file.js"; import { writeCodexMcp } from "../codecs/toml-codex.js"; import type { CodexMcpValue } from "../codecs/toml-codex.js"; -import { appendMarkerBlock, findMarkerBlock, replaceMarkerBlock } from "../compile/markers.js"; +import { + appendMarkerBlock, + buildMarkerBlock, + findAnySyncBlock, + findMarkerBlock, + syncedInstructionsContent, +} from "../compile/markers.js"; import { translateServer as translateMcpJson } from "../compile/mcp-servers.js"; import type { FsProvider } from "../fs-provider.js"; import type { HarnessResourceKind } from "../portability/types.js"; @@ -216,15 +222,20 @@ async function writeMarkdownInstructions( const before = await readBefore(fs, path); const current = before ?? ""; + // One block per file, named for the scope rather than the source file, so a + // copy from CLAUDE.md into AGENTS.md and back addresses the same block. + const slot = `${store.scope}-instructions`; if (edit.value === null) { - if (!findMarkerBlock(current, MARKER_NAME, edit.name)) { + // Blocks an older build wrote under the source file's name still count. + const removeSlot = findMarkerBlock(current, MARKER_NAME, slot) ? slot : edit.name; + if (!findMarkerBlock(current, MARKER_NAME, removeSlot)) { return { supported: true, changes: [] }; } // Exact marker match, not startsWith: removing "api" was stripping the // markers off "api-extra", turning managed content into unmanaged prose // and making the next sync append a duplicate block. - const beginTag = ``; - const endTag = ``; + const beginTag = ``; + const endTag = ``; const lines = current.split("\n"); const begin = lines.findIndex((line) => line.trim() === beginTag); const end = lines.findIndex((line, index) => index > begin && line.trim() === endTag); @@ -239,9 +250,22 @@ async function writeMarkdownInstructions( if (typeof value.content !== "string") { return unsupported(`instructions '${edit.name}' have no content to write.`); } - const after = findMarkerBlock(current, MARKER_NAME, edit.name) - ? replaceMarkerBlock(current, MARKER_NAME, edit.name, value.content) - : appendMarkerBlock(current, MARKER_NAME, edit.name, value.content); + // The source may itself carry a block (it was a copy target once); copy what + // the block holds, never the markers, so blocks do not nest. + const content = syncedInstructionsContent(value.content); + const existingBlock = findAnySyncBlock(current); + let after: string; + if (existingBlock) { + // Replace the block in place, moving a legacy-named one onto the scope slot. + const lines = current.split("\n"); + after = [ + ...lines.slice(0, existingBlock.startLine), + buildMarkerBlock(MARKER_NAME, slot, content), + ...lines.slice(existingBlock.endLine + 1), + ].join("\n"); + } else { + after = appendMarkerBlock(current, MARKER_NAME, slot, content); + } return { supported: true, changes: [{ path, before, after }] }; } diff --git a/packages/design-tokens/__tests__/tokens.test.ts b/packages/design-tokens/__tests__/tokens.test.ts index f0412246..cde7cf8a 100644 --- a/packages/design-tokens/__tests__/tokens.test.ts +++ b/packages/design-tokens/__tests__/tokens.test.ts @@ -31,6 +31,56 @@ describe("design tokens", () => { } }); + // WCAG AA (AC-61): 4.5:1 for body text, against the real backgrounds. + const lum = (hex: string) => { + const [r, g, b] = [1, 3, 5].map((i) => { + const v = parseInt(hex.slice(i, i + 2), 16) / 255; + return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; + }); + return 0.2126 * r + 0.7152 * g + 0.0722 * b; + }; + const ratio = (a: string, b: string) => { + const [x, y] = [lum(a), lum(b)]; + return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); + }; + const mixOn = (fg: string, bg: string, alpha: number) => + "#" + + [1, 3, 5] + .map((i) => + Math.round(parseInt(fg.slice(i, i + 2), 16) * alpha + parseInt(bg.slice(i, i + 2), 16) * (1 - alpha)) + .toString(16) + .padStart(2, "0"), + ) + .join(""); + const STATUS_BASE = { successText: "#3fb07a", warningText: "#e0a33d", dangerText: "#f2555a" } as const; + + for (const [name, mode, tint] of [ + ["light", palette.light, 0.1], + ["dark", palette.dark, 0.16], + ] as const) { + it(`${name}: fg-subtle meets 4.5:1 on base, surface and elevated`, () => { + for (const bg of [mode.bgBase, mode.bgSurface, mode.bgElevated]) { + expect(ratio(mode.fgSubtle, bg)).toBeGreaterThanOrEqual(4.5); + } + }); + it(`${name}: fg-placeholder meets 4.5:1 on base and surface`, () => { + for (const bg of [mode.bgBase, mode.bgSurface]) { + expect(ratio(mode.fgPlaceholder, bg)).toBeGreaterThanOrEqual(4.5); + } + }); + it(`${name}: status text meets 4.5:1 on its own tint over every surface`, () => { + for (const [key, base] of Object.entries(STATUS_BASE)) { + for (const bg of [mode.bgBase, mode.bgSurface, mode.bgElevated]) { + const fg = mode[key as keyof typeof STATUS_BASE]; + expect(ratio(fg, mixOn(base, bg, tint)), `${key} on ${bg}`).toBeGreaterThanOrEqual(4.5); + } + } + }); + it(`${name}: white text on the primary fill meets 4.5:1`, () => { + expect(ratio("#FFFFFF", mode.accentFill)).toBeGreaterThanOrEqual(4.5); + }); + } + it("cssVarBlock emits one declaration per token with the mode's values", () => { const block = cssVarBlock(palette.dark); const lines = block.split("\n"); diff --git a/packages/design-tokens/src/tokens.ts b/packages/design-tokens/src/tokens.ts index bd54d65d..0dacb6f5 100644 --- a/packages/design-tokens/src/tokens.ts +++ b/packages/design-tokens/src/tokens.ts @@ -34,6 +34,12 @@ export interface ModeTokens { accentFg: string; accentText: string; accentGlow: string; + /** Fill behind white text (primary button): AA, unlike `accent`. */ + accentFill: string; + /** Status colors as TEXT on their own tint over any surface (AA). */ + successText: string; + warningText: string; + dangerText: string; } export interface Palette { @@ -50,8 +56,8 @@ export const palette: Palette = { bgSidebarSolid: "#FFFFFF", fgBase: "#1A1714", fgMuted: "#57514A", - fgSubtle: "#8B8479", - fgPlaceholder: "#A8A199", + fgSubtle: "#655F55", // 5.7:1 on bg-base, 6.3 surface, 5.3 elevated (was 3.3) + fgPlaceholder: "#716A60", // 4.8:1 on bg-base, 5.3 surface (was 2.5) borderBase: "rgba(20, 15, 10, 0.06)", borderStrong: "rgba(20, 15, 10, 0.10)", borderSubtle: "rgba(20, 15, 10, 0.03)", @@ -61,6 +67,10 @@ export const palette: Palette = { accentFg: "#1668A6", // azure TEXT on light must use this (AA on white) accentText: "#1668A6", // #2E9BE6 fails small-text contrast on light accentGlow: "rgba(46, 155, 230, 0.25)", + accentFill: "#1D6FB0", // white text on it: 5.3:1 (#2E9BE6 gave 3.0:1) + successText: "#1B6F47", + warningText: "#7A5000", + dangerText: "#B3262C", }, dark: { bgBase: "#131215", // warm graphite β€” NOT slate @@ -70,8 +80,8 @@ export const palette: Palette = { bgSidebarSolid: "#1B191E", fgBase: "#EDEAE6", // warm off-white fgMuted: "#A29C95", - fgSubtle: "#6C665F", - fgPlaceholder: "#514C46", + fgSubtle: "#968F88", // 5.9:1 on bg-base, 5.5 surface, 5.0 elevated (was 3.3) + fgPlaceholder: "#8A847D", // 5.1:1 on bg-base, 4.7 surface (was 2.1) borderBase: "rgba(255, 255, 255, 0.05)", borderStrong: "rgba(255, 255, 255, 0.09)", borderSubtle: "rgba(255, 255, 255, 0.03)", @@ -81,6 +91,10 @@ export const palette: Palette = { accentFg: "#6BC0F5", // azure text on dark, AA on --bg-base accentText: "#6BC0F5", accentGlow: "rgba(46, 155, 230, 0.35)", + accentFill: "#1D6FB0", + successText: "#4CC08A", + warningText: "#E0A33D", + dangerText: "#FF7A7E", }, }; @@ -104,6 +118,10 @@ export const CSS_VARS: ReadonlyArray = [ ["accentFg", "--accent-fg"], ["accentText", "--accent-text"], ["accentGlow", "--accent-glow"], + ["accentFill", "--accent-fill"], + ["successText", "--success-text"], + ["warningText", "--warning-text"], + ["dangerText", "--danger-text"], ]; /** Render a mode's tokens as indented CSS custom-property declarations. */ diff --git a/packages/ui/src/components/Modal.tsx b/packages/ui/src/components/Modal.tsx index 042f94c3..290837de 100644 --- a/packages/ui/src/components/Modal.tsx +++ b/packages/ui/src/components/Modal.tsx @@ -1,5 +1,6 @@ -import { useEffect, useRef, type ReactNode } from "react"; +import { useEffect, useId, useRef, type ReactNode } from "react"; import { X } from "lucide-react"; +import { useDialogFocus } from "./useDialogFocus"; export interface ModalProps { open: boolean; @@ -18,16 +19,9 @@ export interface ModalProps { */ export function Modal({ open, onClose, title, children, footer, ariaLabel }: ModalProps) { const dialogRef = useRef(null); - const triggerRef = useRef(null); + const titleId = useId(); - useEffect(() => { - if (open) { - triggerRef.current = document.activeElement; - requestAnimationFrame(() => dialogRef.current?.focus()); - } else if (triggerRef.current instanceof HTMLElement) { - triggerRef.current.focus(); - } - }, [open]); + useDialogFocus(open, dialogRef); useEffect(() => { if (!open) return; @@ -50,14 +44,14 @@ export function Modal({ open, onClose, title, children, footer, ariaLabel }: Mod role="dialog" aria-modal="true" aria-label={typeof title === "string" ? undefined : ariaLabel} - aria-labelledby={typeof title === "string" ? "hk-modal-title" : undefined} + aria-labelledby={typeof title === "string" ? titleId : undefined} tabIndex={-1} className="hk-modal" onMouseDown={(e) => e.stopPropagation()} > {title && (
      -
      +
      {title}
      + + + + {GRID_TOOLS.map((tool) => ( + + ))} + + + + {GRID_ROWS.map((row) => ( + + + {row.cells.map((cell, i) => ( + + ))} + + ))} + +
      Resource{tool}
      + {row.name} + {row.kind} + + + {CELL_LABEL[cell]} + +
      +
      Tools that are not installed are hidden. Click a cell to copy.
      - {/* Harness */} -
      + {/* Profile */} +
      -              # harness.yaml β€” the one file that travels with you{'\n'}
      +              # ~/.claude/harness.yaml β€” your personal profile{'\n'}
                     version: 1{'\n\n'}
                     plugins:{'\n'}
                     {'  '}- research@harness-kit{'\n'}
      @@ -294,6 +305,30 @@ export function DesktopMock({
                   
      + {/* Claude Code */} +
      +
      Permissions
      +
      Claude Code Β· allow, ask and deny rules
      +
      + {[ + { status: 'allow', rule: 'Bash(pnpm *)' }, + { status: 'allow', rule: 'Read(~/repos/**)' }, + { status: 'allow', rule: 'WebFetch(api.github.com)' }, + { status: 'ask', rule: 'Bash(git push origin *)' }, + { status: 'ask', rule: 'Write(~/.zshrc)' }, + { status: 'deny', rule: 'Read(~/.ssh/**)' }, + { status: 'deny', rule: 'Bash(rm -rf /**)' }, + ].map((row, i) => ( +
      + + {row.status} + + {row.rule} +
      + ))} +
      +
      + {/* Marketplace */}
      Marketplace
      @@ -336,63 +371,6 @@ export function DesktopMock({
      - {/* Security */} -
      -
      Permissions
      -
      Claude Code Β· auto-allow rules
      -
      - {[ - { status: 'allow', rule: 'Bash(pnpm *)' }, - { status: 'allow', rule: 'Read(~/repos/**)' }, - { status: 'allow', rule: 'WebFetch(api.github.com)' }, - { status: 'ask', rule: 'Bash(git push origin *)' }, - { status: 'ask', rule: 'Write(~/.zshrc)' }, - { status: 'deny', rule: 'Read(~/.ssh/**)' }, - { status: 'deny', rule: 'Bash(rm -rf /**)' }, - ].map((row, i) => ( -
      - - {row.status} - - {row.rule} -
      - ))} -
      -
      - - {/* Parity */} -
      -
      Cross-harness parity
      -
      What runs where, right now
      - - - - - - - - - - - - {[ - { tool: 'Claude Code', plugins: 'βœ“', mcp: 'βœ“', hooks: 'βœ“', skills: 'βœ“' }, - { tool: 'Cursor', plugins: 'βœ“', mcp: 'βœ“', hooks: 'β€”', skills: '◐' }, - { tool: 'Copilot', plugins: 'βœ“', mcp: 'β€”', hooks: 'β€”', skills: '◐' }, - { tool: 'Windsurf', plugins: '◐', mcp: 'β€”', hooks: 'β€”', skills: 'β€”' }, - ].map((row) => ( - - - - - - - - ))} - -
      ToolPluginsMCPHooksSkills
      {row.tool}{row.plugins}{row.mcp}{row.hooks}{row.skills}
      -
      -
    diff --git a/website/content/docs/apps/machine.md b/website/content/docs/apps/machine.md new file mode 100644 index 00000000..f7156c5c --- /dev/null +++ b/website/content/docs/apps/machine.md @@ -0,0 +1,84 @@ +--- +title: Machine +--- + +# Machine + +Machine is the home screen of the desktop app (`Cmd+1`). It reads the config each AI +coding tool keeps on your machine and lays it out in one grid, so you can see where +tools disagree and copy a missing piece from one to another. + +## The grid + +Rows are resources, grouped by kind: MCP servers, skills, instructions, plugins and +more. Columns are tools, grouped by product family. Each cell shows one state: + +- `user` or `project`: the resource is present at that scope. +- `+ copy`: the resource is missing here and can be copied in. +- `differs`: a resource of the same name is here, but its content is not the same. +- `β€”`: the tool has no such concept. +- `Β·`: the tool has the concept but keeps no store the app reads. +- `?`: the tool is installed but its store may be hidden, so the app cannot tell. +- Blank: the resource is absent and nothing can be copied there. + +A legend under the grid lists these states. Hover a cell to see each entry's file and +scope. + +Tools that are not installed are hidden. A note above the grid shows how many of the +supported tools are installed, and **Show all** brings the rest back. Hidden tools +still count when the app decides which copy is the baseline for a row. + +Instructions appear as one row per scope, User instructions and Project instructions, +whatever each tool calls its file (`CLAUDE.md`, `AGENTS.md`). + +## Choosing a project + +The title bar holds one project selector. With no project, Machine scans only the +config in your home folder. Choose a folder and the scan adds that project's own +config. The app can read a project only after you pick it in the native folder dialog. +The last project is restored at launch, so macOS may ask for folder access on start if +it sits in a protected folder such as Documents. + +## The summary strip + +The strip above the grid shows counts for Resources, Gaps, Differs, Drift and installed +tools. Select **Gaps** or **Differs** to filter the grid to those rows. + +## Copying a resource + +Click a row to open the drawer. Click a cell and the drawer opens with that cell's tool +as the target. The drawer shows: + +- where the resource lives, with scope, file and a short digest +- the differences between copies, field by field +- a **From** and **To** choice, with the copy that most tools agree on as the default + source + +Apply writes the copy. Before it writes, the app shows what will change. If the target +cannot express everything in the resource, or already holds a different version, you +confirm that first. A backup and a rollback point go to `~/.harness/backups/` for files +in your home folder, and to the project's `.harness/backups/` for project files. + +The CLI command that does the same copy is shown in the drawer, along with a prompt you +can paste into the target tool's own agent. The app cannot write plugins. For a plugin +the drawer shows the CLI command and the prompt, and the CLI installs it. + +## Drift view + +The **Drift vs harness.yaml** tab next to **Resources** compares your `harness.yaml` +with the files compiled from it. Each item shows its state, a diff, and a **Fix** +button that previews the exact change before it writes. Changes you made by hand +outside the compiled sections are never overwritten. You can acknowledge them or review +them. + +Drift scans when you open the tab, not before. + +## Which `harness.yaml` + +There is one personal profile, `~/.claude/harness.yaml`. Profile, Compile, Drift and +first-run setup all read that same file. A project can also commit its own +`harness.yaml` as the team baseline. With a project chosen in the title bar, Profile and +Compile show and compile that project's file, and Profile shows it read-only. Drift +compares your machine against the personal file and, when a project is chosen, the +project against its own file. Compile to project still compiles your personal profile +into a project that has no `harness.yaml` of its own. diff --git a/website/content/docs/apps/meta.json b/website/content/docs/apps/meta.json index 5dd41e4c..4970ad59 100644 --- a/website/content/docs/apps/meta.json +++ b/website/content/docs/apps/meta.json @@ -1,4 +1,4 @@ { "title": "Desktop App", - "pages": ["comparator", "observatory", "command-palette", "parity"] + "pages": ["machine", "observatory", "comparator", "command-palette"] } diff --git a/website/content/docs/apps/observatory.md b/website/content/docs/apps/observatory.md index 0ad027c3..90260f85 100644 --- a/website/content/docs/apps/observatory.md +++ b/website/content/docs/apps/observatory.md @@ -1,12 +1,15 @@ --- -title: Observatory +title: Usage --- -# Observatory +# Usage -Observatory is a session monitoring dashboard that reads directly from Claude Code's -local data files. It requires no configuration β€” open it and your usage history is -already there. +Usage is the session dashboard for Claude Code. It was called Observatory in earlier +releases and now sits under **Claude Code** in the sidebar, as the last item after +Permissions. It reads Claude Code's local data files and needs no setup. Open it and +your usage history is already there. + +Usage covers Claude Code only. It does not read data from other tools. ## Data Sources @@ -57,8 +60,8 @@ and return to the global range. ## Budget Guard -Set a daily token or cost limit in Preferences. When today's usage exceeds the limit, -a red alert banner appears above the stat cards. +Set a daily token or cost limit under **Claude Code β€Ί Permissions**. When today's usage +exceeds the limit, an alert banner appears above the stat cards. ## Refresh diff --git a/website/content/docs/apps/parity.md b/website/content/docs/apps/parity.md index 0672a4d7..2c2a93e4 100644 --- a/website/content/docs/apps/parity.md +++ b/website/content/docs/apps/parity.md @@ -4,69 +4,11 @@ title: Harness Parity # Harness Parity -> **Superseded:** the desktop app's **Machine** view now ships the real cross-surface -> grid (11 surfaces Γ— resource kinds, gaps, and structured diffs). This page describes -> an earlier design and will be rewritten in M3, once cell actions cover diffs as well as gaps. - -Harness Parity is the other half of the cross-harness compiler: after you compile -your `harness.yaml`, it confirms every connected AI tool actually ended up with the -same capabilities β€” config files, settings keys, CLI flags, MCP servers, plugin -types β€” and catches drift before it bites. It shows which capabilities are -supported by each tool installed on your machine, and which ones are actually -present on disk. - -## The Capability Grid - -The main view is a scrollable grid. Rows are capabilities, grouped into categories. -Columns are harnesses (Claude Code, Cursor, Copilot, etc.). Each cell shows one of -three glyphs: - -- `●` (solid dot) β€” supported and detected on disk -- `β—‹` (ring) β€” supported by the harness but the file or config is missing -- `β€”` (dash) β€” not supported by this harness - -Hover over a cell to see the expected file path for that capability. - -## Filters - -- **Installed only / All harnesses** β€” toggle to show only harnesses that are - detected on your machine, or show all known harnesses regardless of availability -- **Category chips** β€” filter rows to a single category: Config Files, Settings, - CLI, MCP, Plugins -- **Search** β€” filter rows by feature name - -Right-click a harness column header to hide that column. A chip in the filter bar -shows how many columns are hidden and lets you restore them. - -## Scanning - -Click **Scan now** to re-probe all harness config files and update the `β—‹`/`●` states. -The scan age is shown next to the button. The initial probe runs automatically on page -load. - -## Feature Detail Drawer - -Click any row label to open the feature detail drawer. It shows the full description -of the capability, which harnesses support it, and the expected file path per harness. -From the drawer you can batch-select all missing instances of that capability across -harnesses. - -## Batch Actions - -Select cells in the grid to stage a batch action. The batch action bar appears at the -bottom of the screen with options to generate the missing config or setting across -all selected harnesses at once. - -## What's Changed - -A collapsible panel at the bottom of the page shows drift detected in the last 30 days β€” -new features added by a harness that aren't yet in your baseline, or missing files -that were previously present. - -Each drift item can be: - -- **Acknowledged** β€” marked as known and dismissed from the active list -- **Created** β€” for `missing_file` drift, the config file can be created in-place -- **Marked as Known** β€” for `new_feature` drift, adds it to the parity baseline - -Toggle **Show acknowledged** to review items you've already acted on. +Harness Parity was a capability grid in earlier releases. It is gone from the desktop +app. [Machine](/docs/apps/machine) replaced it: the same question, which tool has what, +now comes from the config actually on your machine, and a cell opens a drawer that +copies a resource from one tool to another. + +To see which capabilities each tool supports, use the capability matrix on the +[home page](/). To check that compiled files still match `harness.yaml`, use the Drift +tab in Machine or run `harness check` from the CLI. diff --git a/website/content/docs/concepts/harness-protocol.md b/website/content/docs/concepts/harness-protocol.md index dee65d80..39480c13 100644 --- a/website/content/docs/concepts/harness-protocol.md +++ b/website/content/docs/concepts/harness-protocol.md @@ -23,7 +23,7 @@ Harness Kit continues to parse and compile v1 profiles. New captures produce v2, ## Desktop App -The desktop app treats `harness.yaml` and native configuration as peer state. Fleet and Drift show profile scope, provenance, capability losses, reconciliation conflicts, capture/apply previews, rollout assignment, and local rollback history. Invalid profiles and state are surfaced as blocking errors rather than silently treated as absent. +The desktop app treats `harness.yaml` and native configuration as peer state. Machine shows where each resource lives across tools and previews a copy, including capability losses, before it writes. Its Drift view lists reconciliation conflicts. Settings β€Ί Activity lists rollback points, portability notices and device enrollment. Invalid profiles and state are surfaced as blocking errors rather than silently treated as absent. ## Architectural constraints diff --git a/website/content/docs/getting-started/architecture.mdx b/website/content/docs/getting-started/architecture.mdx index fc621ce5..3fea0189 100644 --- a/website/content/docs/getting-started/architecture.mdx +++ b/website/content/docs/getting-started/architecture.mdx @@ -56,10 +56,10 @@ The full schema also supports top-level skills, architecture constraints, policy ## Desktop App -The desktop app is a management console with a single sidebar: Machine, Profile, Claude Code, and Marketplace, plus Settings pinned at the bottom. It reads your harness configuration, provides observability into what your AI tools are doing, and gives you direct control over the pieces that are hard to manage from a terminal. +The desktop app is a management console with a single sidebar: Machine, Profile, Claude Code, and Marketplace, plus Settings pinned at the bottom. It reads your harness configuration and shows what each AI tool has set up. Copies between tools, Compile and Drift fixes show a preview before they write and keep a backup under `~/.harness/backups/` or the project's `.harness/backups/`. The app has no shell access, and folder choices, plugin imports and exports use native dialogs. -- **Machine** β€” home; a cross-surface grid of every AI-harness resource detected on your machine (and, once you point it at a project directory, that project's resources too), with drift repair against harness.yaml embedded as a collapsible section below the grid. After updating to v0.13.0, pick the project folder once more. -- **Profile** β€” view, edit, and compile your harness.yaml +- **Machine** β€” home; a cross-surface grid of every AI-harness resource detected on your machine (and, once you choose a project folder in the title bar, that project's resources too). Click a cell to open a drawer and copy a resource from one tool to another. Tools that are not installed are hidden until you choose "Show all". Drift repair against harness.yaml is a second view, a tab next to the grid. After updating to v0.13.0, pick the project folder once more. See [Machine](/docs/apps/machine). +- **Profile** β€” view, edit, and compile your harness.yaml. With no project chosen it is your personal `~/.claude/harness.yaml`; with a project chosen it is that project's committed harness.yaml, the team baseline, shown read-only. - **Claude Code** β€” Instructions, MCP servers, Plugins, Hooks, Permissions, and Usage (session telemetry: every session, every tool call, token usage, timeline, trends) β€” all scoped to that one surface - **Marketplace** β€” browse and install plugins from the registry - **Settings** β€” preferences, secrets management, and the activity log live here as tabs; there's no separate top-level Security section diff --git a/website/content/docs/getting-started/installation.mdx b/website/content/docs/getting-started/installation.mdx index e13e3042..490a53fc 100644 --- a/website/content/docs/getting-started/installation.mdx +++ b/website/content/docs/getting-started/installation.mdx @@ -8,7 +8,7 @@ description: Three ways to install harness-kit β€” pick what fits your workflow. ## Desktop App -The full harness-kit experience. Observatory, Memory, Board, and a Cmd+K command palette β€” all in one native app with a visual interface for managing your AI tool configurations. +A native app that shows the config each AI coding tool on your machine has, and copies a missing piece from one tool to another. It has a Machine grid, a harness.yaml editor, Claude Code editors, a plugin marketplace and a Cmd+K command palette. It reads local files and needs no account.