diff --git a/extensions/open-in-workspace/README.md b/extensions/open-in-workspace/README.md new file mode 100644 index 00000000000..3ad73011599 --- /dev/null +++ b/extensions/open-in-workspace/README.md @@ -0,0 +1,23 @@ +# Open in Workspace — Hermes WebUI Extension + +Adds an **"Open in workspace"** button to `read_file` tool cards. When you click it, the file opens in the workspace file-tree panel — the same behavior as clicking an artifact link. + +## How it works + +- Watches for new tool-card-row elements with `data-tool-kind="read"` +- Extracts the file path from `row._tcData.args` (or the rendered args section) +- Injects a Lucide folder-open button inside `.tool-card-detail` +- Uses `MutationObserver` so it works on dynamically-rendered cards + +## Install + +From **Settings → Extensions → Gallery**, find **Open in Workspace** and click Install. + +Or configure manually: + +```bash +# Clone or copy the extension files, then: +export HERMES_WEBUI_EXTENSION_DIR=/path/to/open-in-workspace-ext +export HERMES_WEBUI_EXTENSION_MANIFEST=manifest.json +./start.sh +``` diff --git a/extensions/open-in-workspace/manifest.json b/extensions/open-in-workspace/manifest.json new file mode 100644 index 00000000000..d5dcc751d1f --- /dev/null +++ b/extensions/open-in-workspace/manifest.json @@ -0,0 +1,7 @@ +{ + "id": "open-in-workspace", + "name": "Open in Workspace", + "description": "Adds an 'Open in workspace' button to read_file tool cards, letting you click to reveal the file in the workspace file-tree panel.", + "scripts": ["open-in-workspace.js"], + "stylesheets": [] +} diff --git a/extensions/open-in-workspace/open-in-workspace.js b/extensions/open-in-workspace/open-in-workspace.js new file mode 100644 index 00000000000..71d28304d02 --- /dev/null +++ b/extensions/open-in-workspace/open-in-workspace.js @@ -0,0 +1,129 @@ +(function () { + 'use strict'; + + if (document.getElementById('ext-open-in-workspace--loaded')) return; + var MARKER = document.createElement('meta'); + MARKER.id = 'ext-open-in-workspace--loaded'; + + /* ── CSS injected via plain