You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Workspace-native workflow** — browse files, preview documents, upload attachments, edit code, reference files in prompts, and optionally flip core tools to a remote SSH host per chat
16
16
-**Built-in tools** — Ghostty-based terminal, code editor, Office/PDF/CSV/image/video viewers, draw.io, kanban board and mindmap editors, VNC client, and browser automation
17
17
-**Agent control features** — steering, queued follow-ups, threading, side prompts, autoresearch experiment loops, and scheduled tasks
18
18
-**Optional auth and channels** — passkeys/TOTP for the web UI, plus optional WhatsApp integration
@@ -108,7 +108,7 @@ Key environment variables:
108
108
|`PICLAW_KEYCHAIN_KEY`|_(empty)_| Master key for encrypted secret storage |
109
109
|`PICLAW_TRUST_PROXY`|`0`| Enable when behind a reverse proxy or tunnel |
110
110
111
-
For the full list, auth setup (TOTP/passkeys), reverse proxy configuration, and SSHFS/FUSE support, see [docs/configuration.md](docs/configuration.md).
111
+
For the full list, auth setup (TOTP/passkeys), per-chat SSH-backed remote tools, reverse proxy configuration, and SSHFS/FUSE support, see [docs/configuration.md](docs/configuration.md).
| per-chat `ssh-core` session extension | Created per session by `AgentPool`| Wraps `read`/`write`/`edit`/`bash` with chat-scoped local-or-remote SSH execution |
|`platform/windows/win-ui/`| Always loaded (runtime no-op off Windows) | Windows desktop automation via bun:ffi + IAccessible (`win_*` tools) |
136
138
|`viewers/drawio-editor/`| Always loaded | Self-hosted draw.io editor with extension route, save endpoint, and workspace export |
@@ -211,6 +213,7 @@ Page load
211
213
- Web and WhatsApp share the same storage and agent pool.
212
214
- Core utilities (config/env/chat context) live in `src/core`; shared helpers live in `src/utils`.
213
215
- Chat context (chat JID + channel) is tracked in AsyncLocalStorage; tools/extensions read from the scoped context (defaults to `web:default` / `web`) rather than env variables.
216
+
- SSH-backed core-tool state is chat-scoped and persisted in SQLite (`chat_ssh_configs`). `AgentPool` injects a per-session `ssh-core` extension and can hot-swap the live SSH backend for an existing warm chat session.
214
217
- Workspace tree responses are cached briefly (1s) and rate-limited to prevent bursty UI reloads (HTTP 429 when exceeded).
215
218
- The **workspace explorer** is a responsive sidebar (visible on desktop/tablet ≥1024px landscape) that shows a file tree of `/workspace`, supports file previews, drag-and-drop upload, inline file creation, inline rename, drag-and-drop move, and file reference pills for prompts.
216
219
- The **code editor** is a standalone pane extension (`extensions/viewers/editor/`) using CodeMirror 6 directly (no Preact wrapper). It opens in the tabbed content area when a file is clicked in the explorer. Supports syntax highlighting for 12 languages, search/replace, line wrapping, dirty tracking, Cmd+S save, vim mode, whitespace toggle, and accent-aware theming. The editor bundle is lazy-loaded on first file open. Backend endpoints: `GET /workspace/file?mode=edit` (full content up to 256 KB) and `PUT /workspace/file` (save).
The `ssh` tool stores chat-scoped profiles in SQLite and applies them immediately to live sessions when possible. That means the agent can switch a chat from local → remote → local again in the same turn/session without recreating the session runtime.
140
+
141
+
### Required key material
142
+
143
+
Live per-chat SSH uses keychain-backed credentials:
144
+
145
+
-`private_key_keychain` — required; keychain entry containing the OpenSSH private key
Copy file name to clipboardExpand all lines: docs/runtime-flows.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,6 +219,47 @@ Without isolation, a scheduled task's prompt and response would appear in the ag
219
219
-**Model safety**: The model is restored to its pre-task state on the correct branch.
220
220
-**No session forking**: Unlike `fork()` which creates a new session file, `navigateTree()` stays in the same file and simply moves the branch pointer.
221
221
222
+
## Session-scoped SSH remote tools
223
+
224
+
A chat can optionally switch its core file/shell tools to a remote host over SSH.
225
+
226
+
- Control surface: agent-only `ssh` tool
227
+
- Scope: one chat JID at a time
228
+
- Persistence: SQLite `chat_ssh_configs`
229
+
- Affected tools: `read`, `write`, `edit`, `bash`
230
+
231
+
The important runtime property is that SSH mode is **live mutable**. If a warm session already exists, `ssh set` and `ssh clear` can flip the backend immediately for the next tool/model step without rebuilding the whole session.
232
+
233
+
```mermaid
234
+
sequenceDiagram
235
+
participant Agent
236
+
participant ssh as ssh tool
237
+
participant Pool as AgentPool
238
+
participant DB as SQLite
239
+
participant Core as ssh-core wrappers
240
+
participant Host as Local or Remote host
241
+
242
+
Agent->>ssh: action=set target+keychain
243
+
ssh->>Pool: setChatSshConfig(chatJid, config)
244
+
Pool->>DB: upsert chat_ssh_configs
245
+
Pool->>Core: applyLiveChatSshConfig(chatJid)
246
+
Core-->>Host: next read/write/edit/bash uses SSH
247
+
248
+
Agent->>ssh: action=clear
249
+
ssh->>Pool: clearChatSshConfig(chatJid)
250
+
Pool->>DB: delete chat_ssh_configs row
251
+
Pool->>Core: clearLiveChatSshConfig(chatJid)
252
+
Core-->>Host: next core tool call runs locally
253
+
```
254
+
255
+
Transport semantics match the packaged SSH extension model:
256
+
257
+
- multiplexed connection reuse
258
+
-`ControlMaster=auto`
259
+
-`ControlPersist=600`
260
+
- persistent remote shell state
261
+
- configured remote cwd/home mapping
262
+
222
263
## Session lifecycle (summary)
223
264
224
265
- Messages for a chat JID share a warm `AgentSession`.
Copy file name to clipboardExpand all lines: docs/tools-and-skills.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,12 +64,24 @@ You can extend that baseline with `.piclaw/config.json`:
64
64
-`exec_batch` — run multiple shell commands and return concise summaries for each
65
65
-`powershell` — Windows-only replacement for the default shell tool; active instead of `bash` on Windows hosts
66
66
-`exit_process` — gracefully terminate piclaw so Supervisor restarts it; kept always active because lifecycle control should not depend on same-turn lazy activation
67
+
-`ssh` — get, set, or clear the session-scoped SSH profile used by remote-backed core tools (`read`, `write`, `edit`, `bash`)
67
68
68
69
`messages``search` accepts `query`, `chat_jid` (or `*`/`all`), `role`, `after`, `before`, `since`, `limit`, `offset`, and `details_max_chars` for controlling detail payloads.
69
70
`messages``get` accepts `row_ids`, optional `chat_jid`, `role`, `context_before`, `context_after`, and `details_max_chars`.
70
71
`messages``add` accepts `content`, optional `chat_jid`, `type` (`user` or `agent`), and `media_ids`.
71
72
`messages``delete` accepts `row_ids` and optional `chat_jid`, `force`, and `dry_run`.
72
73
74
+
`ssh` accepts:
75
+
-`action` — `get`, `set`, or `clear`
76
+
-`chat_jid` — optional override; defaults to the current chat
77
+
-`ssh_target` — `user@host` or `user@host:/remote/path`
78
+
-`ssh_port` — optional port (default `22`)
79
+
-`private_key_keychain` — keychain entry containing the private key
0 commit comments