Skip to the content.

OpenClaw Desktop File Explorer + Notepad Implementation Brief

Objective

Add two new native apps to the standalone OpenClaw desktop shell in ~/.openclaw/workspace/dashboard:

The goal is to let an operator work with files in /root/.openclaw from the desktop shell without leaving the browser UI.

Important Context

The target is the standalone WebOS dashboard, not the main Next.js frontend.

Relevant files:

Current shell behavior:

Because of that, Notepad should be implemented as a single app window with internal tabs, not as many independent editor windows.

Hard Constraints

1. Do not add repo-wide file editing directly to task-server.js

task-server.js currently:

Do not expose /root/.openclaw read/write endpoints from that server.

2. Use a separate local-only filesystem API server

Create a new server, for example:

Requirements:

Suggested env vars:

3. Never trust raw paths from the client

Do not use basename() as the main path safety mechanism for this feature because nested folders are required.

Instead:

  1. Resolve the requested path against OPENCLAW_FS_ROOT.
  2. Normalize with path.resolve.
  3. If needed, use fs.realpath for final verification.
  4. Reject any request whose resolved path escapes the allowed root.

4. Default to text editing only

This feature is for source files and docs, not arbitrary binary editing.

Rules:

Product Direction

Explorer app

Build a native view:

Register it in:

Core UX:

Notepad app

Build a native view:

Register it in:

Core UX:

Phase 1 editor can be plain textarea. Fancy syntax highlighting is optional.

Backend

Create filesystem-api-server.mjs modeled after memory-api-server.mjs, but for the full OpenClaw root.

Suggested endpoints:

Suggested response shapes:

list

{
  "path": "frontend/src",
  "parent": "frontend",
  "items": [
    {
      "name": "app",
      "path": "frontend/src/app",
      "type": "directory",
      "size": 4096,
      "modified": "2026-03-23T08:00:00.000Z"
    },
    {
      "name": "page.tsx",
      "path": "frontend/src/app/page.tsx",
      "type": "file",
      "size": 8123,
      "modified": "2026-03-23T08:01:00.000Z",
      "isText": true
    }
  ]
}

file read

{
  "path": "frontend/src/app/page.tsx",
  "name": "page.tsx",
  "content": "...",
  "encoding": "utf8",
  "size": 8123,
  "lines": 240,
  "isText": true,
  "modified": "2026-03-23T08:01:00.000Z"
}

file write

{
  "path": "frontend/src/app/page.tsx",
  "saved": true,
  "size": 8300,
  "lines": 245,
  "modified": "2026-03-23T08:05:00.000Z"
}

Passing file-open requests between apps

Do not change the shell to support multi-instance window payloads in phase 1.

Use the existing shared shell state instead:

This matches the current shell better than rewriting the window manager first.

Suggested state shape:

{
  "notepad": {
    "openRequest": {
      "path": "frontend/src/app/page.tsx",
      "requestedAt": "2026-03-23T08:05:00.000Z"
    }
  }
}

Security Requirements

Protected paths

Some paths should be read-only by default or require a strong confirmation before write operations:

Recommended rule:

Secret-aware save guard

Before saving:

  1. inspect file path against protected patterns,
  2. scan content for obvious secrets,
  3. warn before writing sensitive material,
  4. log the save event without logging secret contents.

If existing secret-scanning utilities can be reused, prefer reuse over inventing a second scanner.

Binary and size safeguards

Suggested guardrails:

Implementation Plan

Phase 1: Filesystem API

Create:

Add:

Phase 2: Notepad

Create:

Add to:

Requirements:

Use the existing Memory app as a reference for basic text editing and saving flow, but do not reuse its flat-file path assumptions.

Phase 3: Explorer

Create:

Add to:

Requirements:

Phase 4: Polish

Add:

Phase 5: Tests and docs

Update:

Add tests for:

Acceptance Criteria

The feature is complete when all of the following are true:

  1. The desktop shell shows two new apps: Explorer and Notepad.
  2. Explorer can browse nested directories under /root/.openclaw.
  3. Explorer can search for files and content.
  4. Double-clicking a text file opens it in Notepad.
  5. Notepad can keep multiple files open as tabs.
  6. Ctrl+S / Cmd+S saves the active file.
  7. Path traversal attempts are rejected server-side.
  8. Sensitive paths are not silently writable.
  9. Binary files are not treated like editable text.
  10. The feature works without changing the shell into a multi-instance window manager.

Nice-to-Have After Phase 1

Summary For OpenClaw

Implement this as a local-only, security-conscious desktop file tool for the standalone dashboard.

Do this:

Do not do this: