@celljs/ta-workspace 4.16.0 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-cn.md +1 -1
- package/package.json +3 -3
- package/web/index.js +1464 -765
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A pi package that comes with Ta: the workspace of the conversation shown, in the
|
|
|
9
9
|
| Search | Text in the files (ripgrep, git grep or grep, whichever the machine has): match case, whole word, a regular expression (its error shown), files to include and to exclude (globs separated by commas, a folder takes all inside it); each match of a line is a result, which opens the file selected on it. Replace one, in a file or all (with `$1` for a group), the change shown on each result; dismiss results (a file or a folder); collapse and expand all; the results as a list or a tree of folders |
|
|
10
10
|
| Source control | The branch with what it is ahead and behind, a box for the commit message (Ctrl+Enter or Cmd+Enter; with nothing staged it offers to stage all), merge changes, staged changes and changes, as a list or a tree; stage, unstage and discard a file or a group (discarding asks; for an untracked file it deletes), pull, push and fetch. A change opens in Monaco's diff editor, side by side or inline, the unchanged lines folded; a change not staged can be edited there and saved |
|
|
11
11
|
| Terminal | Shells on the machine of the session, in one tab; the first opens with it; they survive a dropped connection for 30 s. Files dragged from the explorer are typed as their paths, quoted for the shell |
|
|
12
|
-
| Browser | A page in its tab, such as the dev server the agent started: back, forward, reload and the address in one bar, a line while the page loads; a start page with the addresses opened lately (remove one with its ×), or the ports dev servers take when there are none yet. A page of the origin of Ta itself runs without `allow-same-origin`, so it cannot reach the page or its token. In a directory of another machine (`ssh://`), a page of its `localhost` is that machine's: its port is opened on the machine of `ta serve` (`pi.remote.forwardPort`), and the bar keeps the address as typed. In Ta Desktop (`pi.ui.supportsWebview`) the page is a `<webview>` instead of a frame: sites cannot refuse it, signing in works and stays (a partition of its own), back and forward follow the page, the bar shows its title and icon and stops a load, a failed load or a crashed page says so with a retry, and the context menu, browser shortcuts and DevTools are the app's. There the agent works the same page with the `browser` tool (`pi.ui.debugWebview`): navigate, back, forward, reload; a snapshot of the accessibility tree whose elements carry refs; click, type, press, scroll; a screenshot (a data URL for codemode's `image()`); evaluate, wait, and any command of the DevTools protocol on the page. Refs hold for the page of the last snapshot only. The view comes up while the agent works it and the bar says so; text goes in without the keyboard focus, and a click or a key gives the focus back to where the user was typing. The start page offers to import sign-ins (`pi.ui.desktop.browserData`, macOS and Windows): the user picks a profile of Chrome, Edge, Brave, Arc, Vivaldi or Chromium, says yes in a dialog of the app, and its cookies come over; passwords and history do not. The same dialog clears the data of the browser |
|
|
12
|
+
| Browser | A page in its tab, such as the dev server the agent started: back, forward, reload and the address in one bar, a line while the page loads; a start page with the addresses opened lately (remove one with its ×), or the ports dev servers take when there are none yet. A page of the origin of Ta itself runs without `allow-same-origin`, so it cannot reach the page or its token. In a directory of another machine (`ssh://`), a page of its `localhost` is that machine's: its port is opened on the machine of `ta serve` (`pi.remote.forwardPort`), and the bar keeps the address as typed. In Ta Desktop (`pi.ui.supportsWebview`) the page is a `<webview>` instead of a frame: sites cannot refuse it, signing in works and stays (a partition of its own), back and forward follow the page, the bar shows its title and icon and stops a load, a failed load or a crashed page says so with a retry, and the context menu, browser shortcuts and DevTools are the app's. There the agent works the same page with the `browser` tool (`pi.ui.debugWebview`): navigate, back, forward, reload; a snapshot of the accessibility tree whose elements carry refs; click, type, press, scroll; a screenshot (a data URL for codemode's `image()`); evaluate, wait, and any command of the DevTools protocol on the page. Refs hold for the page of the last snapshot only. The view comes up while the agent works it and the bar says so; text goes in without the keyboard focus, and a click or a key gives the focus back to where the user was typing. The start page offers to import sign-ins (`pi.ui.desktop.browserData`, macOS and Windows): the user picks a profile of Chrome, Edge, Brave, Arc, Vivaldi or Chromium, says yes in a dialog of the app, and its cookies come over; passwords and history do not. The same dialog clears the data of the browser In Ta Desktop, the pointer button of the bar picks an element of the page: what is under the pointer is outlined, a click takes it (the page does not get the click), Escape lets go; its page, selector, name and text go in the message box of the conversation as a quote, with a picture of it, for the user to say what to change (`pi.ui.addToComposer`). |
|
|
13
13
|
|
|
14
14
|
Each view is a `panel` view of its web extension, opened from the `+` of the workbench or its empty state (`pi.web` of `package.json`); the work runs on the server through `pi.workspace` (`listDirectory`, `readFile`, `writeFile`, `uploadFile`, `fileUrl`, `runCommand`, …) and `pi.terminals`, in the execution environment of the directory, so a remote `ta exec-server` works the same. Search, source control and the changes to files are this package's: it runs `rg` (or `git grep`, or `grep`), `git`, `mkdir`, `mv -n` and `rm` with `runCommand` and reads their output; paths go to git as `:(literal)` pathspecs. Paths may not leave the directory. What the agent changes with its tools shows at once.
|
|
15
15
|
|
package/README.zh-cn.md
CHANGED
|
@@ -9,7 +9,7 @@ Ta 自带的 pi 包:`ta serve` 的 web 客户端中会话的工作区,以 ID
|
|
|
9
9
|
| 搜索 | 文件中的文本(ripgrep、git grep 或 grep,机器有哪个就用哪个):匹配大小写、全词、正则表达式(其错误显示)、要包含和排除的文件(逗号分隔的 glob,一个文件夹包含其内部所有文件);一行的每个匹配都是一个结果,在它上面打开选中的文件。替换一个、在一个文件中或全部(用 `$1` 表示组),变更显示在每个结果上;关闭结果(一个文件或文件夹);全部折叠和展开;结果作为列表或文件夹树 |
|
|
10
10
|
| 源代码管理 | 分支及其领先和落后的情况,提交消息的框(Ctrl+Enter 或 Cmd+Enter;没有暂存任何东西时提供暂存全部),合并变更、暂存的变更和变更,作为列表或树;暂存、取消暂存和放弃一个文件或组(放弃询问;对于未跟踪的文件它删除)、拉取、推送和获取。不暂存的变更在 Monaco 的 diff 编辑器中打开,并排或内联,未更改的行折叠;不暂存的变更可以在那里编辑并保存 |
|
|
11
11
|
| 终端 | 会话机器上的 shell,在一个标签页中;第一个与它一起打开;它们在丢失连接后存活 30 秒。从资源管理器拖进来的文件输入为它们的路径,按 shell 的规则加引号 |
|
|
12
|
-
| 浏览器 | 其标签页中的页面,例如 agent 启动的开发服务器:后退、前进、重新加载和一行中的地址,页面加载时的一条线;如果还没有的话,带有最近打开的地址(用其 × 删除一个)的起始页,或开发服务器采用的端口。Ta 本身的来源的页面在没有 `allow-same-origin` 的情况下运行,因此无法到达页面或其令牌。在其他机器的目录里(`ssh://`),页面里的 `localhost` 是那台机器的:它的端口在 `ta serve` 所在的机器上打开(`pi.remote.forwardPort`),地址栏保留输入的地址。在 Ta 桌面版里(`pi.ui.supportsWebview`),页面是 `<webview>` 而不是 iframe:网站不能拒绝被打开,登录可用且会保留(独立分区),后退前进跟随页面,地址栏显示标题和图标、加载中可停止,加载失败或页面崩溃时提示并可重试,右键菜单、浏览器快捷键和开发者工具由应用提供。Agent 在那里用 `browser` 工具(`pi.ui.debugWebview`)操作同一个网页:打开、后退、前进、刷新;读取无障碍树快照,可操作的元素带编号(ref);点击、输入、按键、滚动;截图(数据 URL,交给 codemode 的 `image()`);执行脚本、等待,以及任意只作用于该网页的 DevTools 协议命令。编号只对最近一次快照所在的页面有效。Agent 操作时浏览器会显示出来,地址栏旁标明“Ta 正在操作”;输入文字不占用键盘焦点,点击或按键之后焦点回到用户原来输入的地方。起始页可以导入登录状态(`pi.ui.desktop.browserData`,macOS 和 Windows):选择 Chrome、Edge、Brave、Arc、Vivaldi 或 Chromium 的一个个人资料,在应用的原生对话框里确认后复制它的 Cookie;不导入密码和浏览记录。同一个对话框里可以清除内置浏览器的数据 |
|
|
12
|
+
| 浏览器 | 其标签页中的页面,例如 agent 启动的开发服务器:后退、前进、重新加载和一行中的地址,页面加载时的一条线;如果还没有的话,带有最近打开的地址(用其 × 删除一个)的起始页,或开发服务器采用的端口。Ta 本身的来源的页面在没有 `allow-same-origin` 的情况下运行,因此无法到达页面或其令牌。在其他机器的目录里(`ssh://`),页面里的 `localhost` 是那台机器的:它的端口在 `ta serve` 所在的机器上打开(`pi.remote.forwardPort`),地址栏保留输入的地址。在 Ta 桌面版里(`pi.ui.supportsWebview`),页面是 `<webview>` 而不是 iframe:网站不能拒绝被打开,登录可用且会保留(独立分区),后退前进跟随页面,地址栏显示标题和图标、加载中可停止,加载失败或页面崩溃时提示并可重试,右键菜单、浏览器快捷键和开发者工具由应用提供。Agent 在那里用 `browser` 工具(`pi.ui.debugWebview`)操作同一个网页:打开、后退、前进、刷新;读取无障碍树快照,可操作的元素带编号(ref);点击、输入、按键、滚动;截图(数据 URL,交给 codemode 的 `image()`);执行脚本、等待,以及任意只作用于该网页的 DevTools 协议命令。编号只对最近一次快照所在的页面有效。Agent 操作时浏览器会显示出来,地址栏旁标明“Ta 正在操作”;输入文字不占用键盘焦点,点击或按键之后焦点回到用户原来输入的地方。起始页可以导入登录状态(`pi.ui.desktop.browserData`,macOS 和 Windows):选择 Chrome、Edge、Brave、Arc、Vivaldi 或 Chromium 的一个个人资料,在应用的原生对话框里确认后复制它的 Cookie;不导入密码和浏览记录。同一个对话框里可以清除内置浏览器的数据 在 Ta 桌面版里,栏上的指针按钮用来选取页面元素:鼠标下的元素会被框出,点一下选中(页面收不到这次点击),Esc 取消;元素所在的网页、选择器、名称和文字作为引用放进对话的输入框,并附上它的截图,用户接着说想怎么改(`pi.ui.addToComposer`)。 |
|
|
13
13
|
|
|
14
14
|
每个视图是其 web 扩展的 `panel` 视图,从工作台的 `+` 或其空状态打开(`pi.web` 的 `package.json`);工作通过 `pi.workspace`(`listDirectory`、`readFile`、`writeFile`、`uploadFile`、`fileUrl`、`runCommand` 等)和 `pi.terminals` 在目录的执行环境上运行,所以远程 `ta exec-server` 一样工作。搜索、源代码管理和对文件的更改是此包的:它用 `runCommand` 运行 `rg`(或 `git grep`,或 `grep`)、`git`、`mkdir`、`mv -n` 和 `rm` 并读取其输出;路径作为 `:(literal)` pathspec 传递给 git。路径不能离开目录。agent 用其工具所做的更改立即显示。
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-workspace",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "A pi package for Ta: the workspace beside the conversation, with an explorer, open files, search, source control, terminals and a browser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@celljs/ta-protocol": "4.
|
|
29
|
-
"@celljs/ta-web": "4.
|
|
28
|
+
"@celljs/ta-protocol": "4.17.0",
|
|
29
|
+
"@celljs/ta-web": "4.17.0",
|
|
30
30
|
"@types/react": "^19.3.0",
|
|
31
31
|
"marked": "^14.1.4"
|
|
32
32
|
},
|