这一篇讲画布上和代码直接相关的三类节点:文件管理器、编辑器和浏览器。它们和终端放在同一张画布上,可以用连线把上下文交给 Agent。
文件管理器与文件树
- 在画布空白处右键(或点 Dock 上的
+),在「内容」分组里选「新建文件管理器」,得到一个文件管理器节点。
- 节点里是当前项目的文件树,顶部有「过滤」框和当前路径;文件状态用字母标出:已修改、新增、已删除、已重命名、未跟踪。
- 点文件会打开对应的编辑器节点;也可以从新建菜单选「打开文件…」。
侧栏里的「资源管理器」(⇧⌘E,Windows / Linux 为 Ctrl+Shift+E)是同一棵文件树,可以固定在侧边。
在文件树里可以:
- 新建文件、新建文件夹、重命名、移动;
- 「删除到回收站」,删除后提示里有「撤销」;
- 「复制路径」「复制相对路径」,以及在访达 / 资源管理器 / 文件管理器中显示。
文件还可以拖动:拖到终端会把路径插入终端,拖到画布会打开预览。
找文件和找内容
- 快速打开(⌘P,Windows / Linux 为 Ctrl+P):按文件名查找;输入
:12:4 这样的写法可以跳到第 12 行第 4 列。
- 项目搜索(⇧⌘H,Windows / Linux 为 Ctrl+Shift+H):在「文件」与「搜索」两个页签之间切换;支持「正则表达式」「区分大小写」「全字匹配」,以及「包含(glob)」「排除(glob)」。过大或二进制的文件会被跳过,并提示跳过的数量。
编辑器
编辑器节点用于查看和修改项目里的文件。
- 修改后节点标出「未保存」,按 ⌘S(Windows / Linux 为 Ctrl+S)保存。
- 「查找/替换」支持区分大小写、全字匹配和正则。
- Markdown 文件可以在「预览」「并排」「编辑」之间切换;图片可以缩放,PDF 与媒体文件提供预览。
- 行边会标出相对 Git 的改动。
下面几种情况编辑器会替你保护内容:
- 草稿恢复:意外关闭后再次打开,会提示「已恢复未保存的草稿」,可以「丢弃草稿」。磁盘上的文件在此期间被改过时会另外提示。
- 文件在磁盘上被改了:提示「磁盘上的文件已被修改」(被替换、被删除也有对应提示)。可以点「比较」看「磁盘版 → 草稿」,再选「重载并放弃草稿」或「保留草稿」;两边都有改动时用「三方合并」,逐处选择取草稿还是取磁盘版。
- 另存为:目标路径已有文件时会提示,不会静默覆盖。
- 非 UTF-8 的文件只读;过大的文件显示「文件过大」。
语言服务
对常见语言,编辑器提供补全、诊断、悬停说明、跳转到定义、查找引用、重命名符号和格式化。
| 操作 |
macOS |
Windows / Linux |
| 跳转到定义 |
F12 |
F12 |
| 查找引用 |
⇧F12 |
Shift+F12 |
| 重命名符号 |
F2 |
F2 |
| 格式化文件 |
⇧⌥F |
Shift+Alt+F |
| 代码操作 |
⌘. |
Ctrl+. |
| 跳转到行 |
⌃G |
Ctrl+G |
- 诊断汇总在「问题」面板,引用结果在「引用」面板;它们没有默认快捷键,从命令面板或编辑器状态栏进入。
- 重命名与代码操作会先给出「应用修改」预览;任何一个文件无法修改(在工作区之外、有未保存的草稿等)时,整次修改都不会应用。
- 语言服务由机器上已有的对应 language server 提供。找不到时状态里会写明原因,例如「这台机器上没有对应的 language server」或「需要工作区的执行权限」;在「设置 → 工作空间」的语言服务区域可以启用或停用某种语言、指定可执行文件路径、开启「保存时格式化」。
远程文件
项目可以放在另一台机器上,文件、编辑器、Git 和语言服务都在那台机器上执行。
- 在「设置 → SSH」点「添加主机」,填写名称、主机、用户、端口和密钥,保存。
- 在主机的操作里「验证」,状态会显示 Worker 版本与平台;首次连接需要在「主机密钥」里核对并「信任」。
- 使用「打开远程项目」,填写「远程项目路径」,就得到一个在该主机上运行的工作空间。
- 已有工作空间要换主机时,在设置的工作空间页用「切换」;还有未保存的编辑器草稿、终端会话、浏览器会话、Git 操作或上传时,会先列出来,需要「停止并切换」。
编辑器里的语言服务在远程主机上同样可用;个别情况(例如远端执行主机上没有语言服务)会在状态里说明。
浏览器节点
浏览器节点让你和 Agent 共用同一个网页会话。
- 在新建菜单选「新建浏览器」。
- 地址栏、「后退」「前进」「刷新」「停止」和标签页的用法与普通浏览器一致;「外部打开」会用系统浏览器打开当前页。
- 谁在操作会显示在节点上:「你在控制」「Agent … 在操作」或「无人控制」。需要自己动手时点「接管」,完成后「交还」。
- Agent 可以读取页面(无障碍快照)、导航、点击、输入、拖放、选择下拉项、等待、截图和导出 PDF,也能拿到 Console 与 Network 的摘要。登录状态会保留。
- 你下载的文件直接存到系统下载目录;Agent 触发的下载需要你确认。
常用设置在「设置 → 浏览器」(仅桌面版):「隐藏后回收页面」及其分钟数、「后台页面上限」、「新节点起始页」,以及「清理数据」。页面被回收后回到节点会重新加载。
在服务器上运行时,浏览器节点显示的是服务器上 Chromium 的「远程画面」:同一时间只接受一个观看者;服务器找不到 Chromium 时,安装一个,或用环境变量 ARMADRA_BROWSER_PATH 指定路径。
接下来:连线与上下文共享说明怎样让 Agent 读取这些节点;键盘快捷键列出了编辑器与浏览器节点里的键。
Guides
Files, editor and browser
Browse files on the canvas, edit code, use language services, and share a browser node with agents.
This page covers the three node types that deal directly with code: the file browser, the editor and the browser. They sit on the same canvas as your terminals, and links can hand their context to an agent.
File browser and file tree
- Right-click an empty spot on the canvas (or click
+ on the Dock) and choose “New file browser” in the “Content” group.
- The node shows the project’s file tree, with a “Filter” box and the current path at the top. File status is marked with a letter: modified, added, deleted, renamed, untracked.
- Clicking a file opens it in an editor node; “Open file…” in the new menu does the same.
“Explorer” in the sidebar (⇧⌘E, Ctrl+Shift+E on Windows / Linux) is the same tree and can be pinned to the side.
In the tree you can:
- create files and folders, rename and move them;
- “Delete to trash”, with an “Undo” in the notification afterwards;
- “Copy path”, “Copy relative path”, and reveal the file in Finder / Explorer / the file manager.
Files can also be dragged: onto a terminal to insert the path, onto the canvas to open a preview.
Finding files and text
- Quick open (⌘P, Ctrl+P on Windows / Linux): search by file name; write
:12:4 to jump to line 12, column 4.
- Search in project (⇧⌘H, Ctrl+Shift+H on Windows / Linux): switch between the “Files” and “Search” tabs; options are “Regular expression”, “Match case”, “Whole word”, and “Include (glob)” / “Exclude (glob)”. Files that are too large or binary are skipped, and the count is shown.
Editor
An editor node views and edits a file in the project.
- After an edit the node shows “Unsaved”; press ⌘S (Ctrl+S on Windows / Linux) to save.
- “Find / replace” supports case, whole-word and regular-expression matching.
- Markdown files switch between “Preview”, “Side by side” and “Edit”; images can be zoomed, and PDF and media files are previewed.
- The gutter marks changes against Git.
The editor protects your work in these cases:
- Draft recovery: after an unexpected close, reopening shows “Restored an unsaved draft”, with “Discard draft”. If the file on disk changed in the meantime, you get an extra notice.
- File changed on disk: you see “The file changed on disk” (replaced and deleted have their own notices). Click “Compare” to see “Disk → draft”, then choose “Reload and discard draft” or “Keep draft”; when both sides changed, use “Three-way merge” and pick, hunk by hunk, the draft or the disk version.
- Save as: if the target path already has a file you are told, and nothing is overwritten silently.
- Non-UTF-8 files are read-only; very large files show “File too large”.
Language services
For common languages the editor offers completion, diagnostics, hover, go to definition, find references, rename symbol and formatting.
| Action |
macOS |
Windows / Linux |
| Go to definition |
F12 |
F12 |
| Find references |
⇧F12 |
Shift+F12 |
| Rename symbol |
F2 |
F2 |
| Format file |
⇧⌥F |
Shift+Alt+F |
| Code actions |
⌘. |
Ctrl+. |
| Go to line |
⌃G |
Ctrl+G |
- Diagnostics are collected in the “Problems” panel and reference results in the “References” panel; neither has a default shortcut, so open them from the command palette or from the editor status bar.
- Rename and code actions show an “Apply changes” preview first; if any file cannot be changed (outside the workspace, has an unsaved draft, and so on), none of the changes is applied.
- Language services run on language servers already installed on the machine. When one is missing, the status says why, for example “No language server for this on this machine” or “Needs the workspace’s execute grant”. In “Settings → Workspace” you can enable or disable a language, set the executable path and turn on “Format on save”.
Remote files
A project can live on another machine; files, the editor, Git and language services then run there.
- In “Settings → SSH” choose “Add host”, fill in name, host, user, port and key, and save.
- Use “Validate” in the host’s actions: the status shows the Worker version and platform. On first connect, check and “Trust” the key under “Host key”.
- Use “Open remote project” and enter the “Remote project path” to get a workspace that runs on that host.
- To move an existing workspace to another host, use “Switch” in the workspace page of Settings. Unsaved editor drafts, terminal sessions, browser sessions, Git operations or uploads still tied to the old host are listed first, and you choose “Stop and switch”.
Language services work on remote hosts too; in a few cases (for example when the remote execution host has none) the status explains why not.
Browser node
A browser node gives you and your agents one shared web session.
- Choose “New browser” in the new menu.
- The address bar, “Back”, “Forward”, “Reload”, “Stop” and tabs work like an ordinary browser; “Open externally” opens the current page in the system browser.
- The node shows who is driving: “You are driving”, “Agent … is driving” or “Nobody is driving”. To take the wheel click “Take over”, and “Hand back” when done.
- Agents can read the page (accessibility snapshot), navigate, click, type, drag and drop, pick dropdown options, wait, take screenshots and export PDFs, and can get Console and Network summaries. Sign-ins persist.
- Files you download go straight to the system downloads folder; downloads started by an agent wait for your confirmation.
Common settings are in “Settings → Browser” (desktop only): “Free hidden pages” and its minutes, “Background page limit”, “New node start page”, and “Clear data”. A freed page reloads when you return to it.
When running on a server, a browser node shows “Remote view” of Chromium on the server: it takes one viewer at a time. If the server finds no Chromium, install one or point the ARMADRA_BROWSER_PATH environment variable at it.
Next: Links and context explains how agents read these nodes; Keyboard shortcuts lists the keys inside the editor and browser nodes.