Sign inSign up

penrithbeacon/wcp-widget-markdown-editor

By penrithbeacon

•Updated 3 months ago

Image
0

1.2K

penrithbeacon/wcp-widget-markdown-editor repository overview

⁠WCP Widget: Markdown Editor

WYSIWYG markdown file editor with folder browser, multi-instance configuration, Publish to Web, and companion host agent for native filesystem access.

Specification: widgetcontextprotocol.com⁠ | Part of the Penrith Beacon WCP⁠ widget suite.

WCP 2.1.0 certified. Full theme reception (both URL forms), orchestration-aware state, Publish to Web (WCP-compliant SPA), WCP export.


⁠Components

ComponentDefault sizeDescription
Markdown Explorer12×12Main widget — WYSIWYG editor with resizable file tree sidebar
Settings12×12Configure root folder, theme (built-ins + WCPT import), companion agent status
About12×12OCI image reference, version, publisher, agent installer download

⁠Quick Start

docker run -d \
  --name wcp-widget-markdown-editor \
  -p 127.0.0.1:3748:3748 \
  -v markdown_workspace:/workspace \
  -e CONTAINER_NAME=wcp-widget-markdown-editor \
  -e WIDGET_PORT=3748 \
  --add-host host.docker.internal:host-gateway \
  --restart unless-stopped \
  docker.io/penrithbeacon/wcp-widget-markdown-editor:latest

⁠Docker Compose

services:
  wcp-widget-markdown-editor:
    image: docker.io/penrithbeacon/wcp-widget-markdown-editor:latest
    container_name: wcp-widget-markdown-editor
    ports:
      - "127.0.0.1:3748:3748"
    volumes:
      - markdown_workspace:/workspace
    environment:
      - WIDGET_PORT=3748
      - CONTAINER_NAME=wcp-widget-markdown-editor
      - AGENT_PORT=3749
    restart: unless-stopped
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  markdown_workspace:
    driver: local

⁠Setup Guide

⁠Without companion agent

The widget UI loads, but file browsing requires the companion agent. Configure the agent first for full functionality.

⁠With companion agent

The wcp-agent-markdown-editor companion agent provides host filesystem access — browse your local drives from within the widget.

  1. Download the macOS installer from the About component (GET /widget/agent/installer) or from GitHub Releases⁠
  2. Run the .pkg installer — the agent starts automatically at login on 127.0.0.1:3749
  3. The widget detects the agent automatically via host.docker.internal:3749
  4. Open Settings → set the Root Folder using the Browse picker (shows your host filesystem)

The installer includes Uninstall WCP Markdown Editor Agent.app in /Applications/ for clean removal.


⁠WCP Request Headers

HeaderRequiredDescription
Wcp-Instance-IdYesUnique card instance identifier
Wcp-Dashboard-IdYesDashboard installation identifier
Wcp-VersionYesWCP protocol version of the requesting dashboard
Wcp-Widget-IdYesWidget identifier within the dashboard
Wcp-Orchestration-IdNoActive orchestration identifier
Wcp-Application-IdNoActive application identifier

⁠Endpoints

EndpointDescription
GET /wcpContainer Directory — WCP two-tier discovery
GET /widget/wcpWidget Manifest with runtime publish status
GET /widget/Markdown Explorer component
GET /widget/settings/Settings component
GET /widget/about/About component
GET /widget/indexWidget Index
GET /widget/healthHealth check
GET /widget/icon.svgWidget icon
GET /widget/api/guidsComponent UUIDs
GET /widget/logsWCP logs protocol
POST /widget/configureSave per-instance config: { root, theme }
GET /widget/api/root/validateValidate root path + agent reachability
GET /widget/api/files/listList files/dirs via agent
GET /widget/api/files/readRead file via agent
POST /widget/api/files/saveWrite file via agent
POST /widget/api/files/mkdirCreate directory via agent
POST /widget/api/files/renameRename via agent: { old, new }
POST /widget/api/files/deleteDelete via agent
GET /widget/api/agent/statusAgent reachability check
GET /widget/api/agent/browseProxy: agent directory listing
GET /widget/api/agent/drivesProxy: agent volumes/drives
GET /widget/api/themesActive theme + custom theme list
POST /widget/api/themes/importImport themes from .wcpt
DELETE /widget/api/themes/<id>Delete a custom theme
POST /widget/publishPublish document as WCP-compliant SPA
DELETE /widget/publishRemove published SPA
GET /widget/api/publish/statusPublished SPA state + metadata
GET /widget/export.wcpDownload as .wcp package
GET /widget/agent/installerCompanion agent .pkg installer
GET /Serves published SPA

⁠WCP Compatibility

PropertyValue
WCP Version2.1.0
Widget Version1.1.4
Render modeiframe
AuthNone
Default card size12×12
Multi-instanceYes

⁠Technical Details

PropertyValue
Base imagepython:3.12-slim
Platformslinux/amd64, linux/arm64
Port3748
FrameworkFlask 3.0.3 + Flask-CORS 4.0.1
Persistent storagemarkdown_workspace volume at /workspace

⁠Tags

TagDescription
latestMost recent stable release
1.1.4Path tooltip on truncated path label; Copy Path button with 3-second success state
1.1.3Filename shown in Explorer path display; viewer clears on folder nav and Up
1.1.2Search bar persisted across file refresh
betaCurrent beta release
1.1.0-betaBeta — theme card, WCP URL compliance, WCP-compliant SPA, GFM tables, agent-only model
1.1.0-wcp2.1.0Pinned build — same code as 1.1.0-beta
1.0.0-wcp2.1.0Initial release

⁠Changelog

⁠1.1.4 (2026-06-28)
  • Path tooltip — hovering the truncated path label in the toolbar now shows the full absolute path in a native browser tooltip (title attribute kept in sync on every folder/file navigation)
  • Copy Path button — new "Copy Path" button in the toolbar writes the current path to the clipboard; shows "Path Copied!" with a green success state for 3 seconds, then reverts; repeated clicks reset the timer
⁠1.1.0 (2026-06-10) — includes companion agent v1.0.2 installer
  • Theme card — Settings page now shows 3 Penrith Beacon WCP built-in themes (Dark / Light / High Contrast) with "Built-in" badge; custom theme import from .wcpt files via checkbox modal with Select All / Deselect All
  • Full-dashboard theme broadcast — selecting a theme in Settings posts wcp:theme-apply to window.top, updating the entire dashboard (podium, stave tabs, all widgets)
  • WCP URL theme compliance — all four HTML templates now support both ?com.doc.widgetcontextprotocol=<base64> (query string) and #wcp-theme=<base64> (hash) forms
  • WCP-compliant published SPA — POST /widget/publish generates HTML with baked-in active theme CSS vars and inline URL reception snippet; full var(--wcp-color-*) typography
  • GFM table round-trip — TipTap Table/TableRow/TableHeader/TableCell extensions added; Turndown GFM plugin preserves pipe table format on save
  • Encoding fix — agent file reads use utf-8-sig with latin-1 fallback, eliminating � replacement characters in files with non-ASCII content
  • Agent-only file model — all file operations proxy through the companion agent; Docker volume stores widget state only
  • Uninstaller app — Uninstall WCP Markdown Editor Agent.app bundled in agent .pkg for clean one-click removal
  • Published page card — Settings page shows current publish state, source .md path, published timestamp, View and Unpublish actions
  • Unpublish button — toolbar Unpublish button removes the published SPA; settings card updates immediately
  • Manifest fixes — /wcp now includes type: "directory"; /widget/wcp now includes uuid and container fields
  • Theme delete fix — replaced window.confirm() with a custom inline modal; confirm() is silently blocked in cross-origin iframes by Chromium/Electron 35; delete button now works correctly
  • Companion agent v1.0.2 — (a) fixes UTF-8 write encoding, resolves HTTP 502 on non-ASCII saves; (b) uses os.scandir() + threaded=True, resolves blank sidecar caused by SMB cold-start latency exceeding browse timeout; (c) installer now shows a welcome screen with product name and version; (d) preinstall uses launchctl bootout + pkill to reliably stop any running agent before upgrade
⁠1.0.0 (2026-06-09)
  • Initial release — full WCP 2.1.0 compliance, WYSIWYG editor, companion agent support, Publish to Web, WCP export

⁠Source

Tag summary

Content type

Image

Digest

sha256:4c77baa09…

Size

59.6 MB

Last updated

3 months ago

docker pull penrithbeacon/wcp-widget-markdown-editor