@celljs/ta-workspace 4.9.1 → 4.11.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 +2 -2
- package/README.zh-cn.md +2 -2
- package/package.json +3 -3
- package/web/index.js +1032 -382
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A pi package that comes with Ta: the workspace of the conversation shown, in the
|
|
|
4
4
|
|
|
5
5
|
| View | What it does |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| Explorer | The files of the conversation's directory, with the file icons of VS Code, the colors and letters of git (folders take the change inside them, ignored files are dimmed) and indent guides; it follows the tab shown. As VS Code's default `files.exclude`, it hides `.git`, `.svn`, `.hg`, `.DS_Store` and `Thumbs.db` (`TaExcludedFiles`); the eye of its header shows them, kept for the user in every browser. A click opens a file as a preview tab (the next preview takes its place), a double click keeps it: Markdown, HTML, images, videos, sounds and PDFs as a preview, the rest in Monaco (`pi.ui.CodeEditor`), saved with Ctrl+S or Cmd+S. New file and folder (`a/b.ts` makes the folders), rename and delete in place, with the checks of VS Code on names; a context menu with copy path and relative path, find in folder, upload files or a folder, and download (a folder as a zip made in the page); in Ta Desktop, reveal in Finder (File Explorer on Windows, the file manager on Linux) for directories of this machine (`pi.ui.desktop`). Drag an item onto a folder to move it there (a closed folder opens while it is held over it), files or folders of the system onto the tree to upload them, and an item onto the message box (an `@` reference) or a terminal (its path) (`pi.ui.fileDrag`); the keys of a tree (arrows, Home/End, F2 or Enter on a Mac, Delete) |
|
|
7
|
+
| Explorer | The files of the conversation's directory, with the file icons of VS Code, the colors and letters of git (folders take the change inside them, ignored files are dimmed) and indent guides; it follows the tab shown. As VS Code's default `files.exclude`, it hides `.git`, `.svn`, `.hg`, `.DS_Store` and `Thumbs.db` (`TaExcludedFiles`); the eye of its header shows them, kept for the user in every browser. A click opens a file as a preview tab (the next preview takes its place), a double click keeps it: Markdown, HTML, images, videos, sounds and PDFs as a preview (a picture zooms as in a viewer of pictures, and ← → or the buttons at its sides go through the pictures of its folder in the same preview tab, "2 / 5" above it), the rest in Monaco (`pi.ui.CodeEditor`), saved with Ctrl+S or Cmd+S. New file and folder (`a/b.ts` makes the folders), rename and delete in place, with the checks of VS Code on names; a context menu with copy path and relative path, find in folder, upload files or a folder, and download (a folder as a zip made in the page); in Ta Desktop, reveal in Finder (File Explorer on Windows, the file manager on Linux) for directories of this machine (`pi.ui.desktop`). Drag an item onto a folder to move it there (a closed folder opens while it is held over it), files or folders of the system onto the tree to upload them, and an item onto the message box (an `@` reference) or a terminal (its path) (`pi.ui.fileDrag`); the keys of a tree (arrows, Home/End, F2 or Enter on a Mac, Delete) |
|
|
8
8
|
| Open files | The tabs of files and changes this package opened, the one shown marked; close, close others, close below, reveal in the explorer |
|
|
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 |
|
|
@@ -13,7 +13,7 @@ A pi package that comes with Ta: the workspace of the conversation shown, in the
|
|
|
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
|
|
|
16
|
-
Files open in Monaco, which the page brings (`pi.ui.CodeEditor`, bundled with Ta, no network); Markdown, HTML, SVG open as a preview first, with Edit beside Preview. Previews load the file from `TaWorkspaceServer.fileUrl`: a page runs sandboxed in an origin of its own, Markdown (rendered with marked, bundled in) runs no scripts, and both load the files beside them with relative URLs. Diffs open in Monaco's diff editor (`pi.ui.DiffEditor`), terminals are xterm.js, as in VS Code (`pi.ui.createTerminal`: drawn with WebGL, in the theme of the page; Cmd or Ctrl + click opens the URLs and the paths of files they print, at the line a compiler or grep names). The file icons are the Seti icons VS Code shows by default (font and map from `extensions/theme-seti` of microsoft/vscode, MIT; `bun scripts/seti.ts` writes them again into `web-src/util/seti*.ts`). With `script` on the server a shell gets a pseudo-terminal; without it, it runs on pipes and the server echoes and edits the line.
|
|
16
|
+
Files open in Monaco, which the page brings (`pi.ui.CodeEditor`, bundled with Ta, no network); Markdown, HTML, SVG open as a preview first, with Edit beside Preview. Previews load the file from `TaWorkspaceServer.fileUrl`: a page runs sandboxed in an origin of its own (`PAGE_SANDBOX`, never `allow-same-origin`), Markdown (rendered with marked, bundled in) runs no scripts, and both load the files beside them with relative URLs. Where the page is not served by ta serve — the app on a phone, a page through a relay — that URL is not there to load: pictures, videos, sounds and PDFs come as the bytes of `pi.files` in a `blob:` URL, and an HTML page is shown from the text of the file in a frame under a policy that reaches nothing (`PAGE_CSP`), so the css, js and pictures it loads by relative path do not come and a self-contained report shows as it is. Diffs open in Monaco's diff editor (`pi.ui.DiffEditor`), terminals are xterm.js, as in VS Code (`pi.ui.createTerminal`: drawn with WebGL, in the theme of the page; Cmd or Ctrl + click opens the URLs and the paths of files they print, at the line a compiler or grep names). The file icons are the Seti icons VS Code shows by default (font and map from `extensions/theme-seti` of microsoft/vscode, MIT; `bun scripts/seti.ts` writes them again into `web-src/util/seti*.ts`). With `script` on the server a shell gets a pseudo-terminal; without it, it runs on pipes and the server echoes and edits the line.
|
|
17
17
|
|
|
18
18
|
Links of replies open here (`pi.registerOpener`): a file as its tab, with the lines the link names selected (`src/a.ts#L10-L20`, `src/a.ts:10:5`), even a file open with changes, which keeps them; a directory in the explorer, which switches to it; a page in the browser. Cmd or Ctrl + click opens a page in the browser of the system instead, which Ta does itself.
|
|
19
19
|
|
package/README.zh-cn.md
CHANGED
|
@@ -4,7 +4,7 @@ Ta 自带的 pi 包:`ta serve` 的 web 客户端中会话的工作区,以 ID
|
|
|
4
4
|
|
|
5
5
|
| 视图 | 功能 |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| 资源管理器 | 会话目录的文件,带有 VS Code 的文件图标、git 的颜色和字母(文件夹显示其内部的更改,被忽略的文件变暗)并缩进指南;它遵循显示的标签页。和 VS Code 默认的 `files.exclude` 一样,它隐藏 `.git`、`.svn`、`.hg`、`.DS_Store` 和 `Thumbs.db`(`TaExcludedFiles`);顶栏的眼睛按钮可以显示它们,这个选择按用户保存,在每个浏览器里都一样。单击打开文件作为预览标签页(下一个预览替换它),双击保留它:Markdown、HTML、图像、视频、声音和 PDF
|
|
7
|
+
| 资源管理器 | 会话目录的文件,带有 VS Code 的文件图标、git 的颜色和字母(文件夹显示其内部的更改,被忽略的文件变暗)并缩进指南;它遵循显示的标签页。和 VS Code 默认的 `files.exclude` 一样,它隐藏 `.git`、`.svn`、`.hg`、`.DS_Store` 和 `Thumbs.db`(`TaExcludedFiles`);顶栏的眼睛按钮可以显示它们,这个选择按用户保存,在每个浏览器里都一样。单击打开文件作为预览标签页(下一个预览替换它),双击保留它:Markdown、HTML、图像、视频、声音和 PDF 作为预览(图片可以像看图软件一样缩放,← → 或两侧按钮在同一个预览标签里切换同目录的图片,上方显示"2 / 5"),其余的在 Monaco(`pi.ui.CodeEditor`)中,用 Ctrl+S 或 Cmd+S 保存。新建文件和文件夹(`a/b.ts` 创建文件夹)、就地重命名和删除,带有 VS Code 的名称检查;右键菜单有复制路径和相对路径、在文件夹中查找、上传文件或文件夹、下载(文件夹在页面里打包成 zip);在 Ta 桌面版里,本机目录还可以在 Finder 中显示(Windows 上是文件资源管理器,Linux 上是文件管理器,`pi.ui.desktop`)。把一项拖到文件夹上即移到那里(悬停在关着的文件夹上会展开),把系统里的文件或文件夹拖进树里即上传,拖到输入框成为 `@` 引用、拖到终端输入它的路径(`pi.ui.fileDrag`);树的按键(箭头、Home/End、F2 或 Mac 上的 Enter、Delete) |
|
|
8
8
|
| 打开的文件 | 此包打开的文件和更改的标签页,显示的被标记;关闭、关闭其他、关闭下方、在资源管理器中显示 |
|
|
9
9
|
| 搜索 | 文件中的文本(ripgrep、git grep 或 grep,机器有哪个就用哪个):匹配大小写、全词、正则表达式(其错误显示)、要包含和排除的文件(逗号分隔的 glob,一个文件夹包含其内部所有文件);一行的每个匹配都是一个结果,在它上面打开选中的文件。替换一个、在一个文件中或全部(用 `$1` 表示组),变更显示在每个结果上;关闭结果(一个文件或文件夹);全部折叠和展开;结果作为列表或文件夹树 |
|
|
10
10
|
| 源代码管理 | 分支及其领先和落后的情况,提交消息的框(Ctrl+Enter 或 Cmd+Enter;没有暂存任何东西时提供暂存全部),合并变更、暂存的变更和变更,作为列表或树;暂存、取消暂存和放弃一个文件或组(放弃询问;对于未跟踪的文件它删除)、拉取、推送和获取。不暂存的变更在 Monaco 的 diff 编辑器中打开,并排或内联,未更改的行折叠;不暂存的变更可以在那里编辑并保存 |
|
|
@@ -13,7 +13,7 @@ Ta 自带的 pi 包:`ta serve` 的 web 客户端中会话的工作区,以 ID
|
|
|
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
|
|
|
16
|
-
文件在 Monaco 中打开,页面带来(`pi.ui.CodeEditor`,与 Ta 打包,无网络);Markdown、HTML、SVG 首先作为预览打开,旁边有编辑。预览从 `TaWorkspaceServer.fileUrl`
|
|
16
|
+
文件在 Monaco 中打开,页面带来(`pi.ui.CodeEditor`,与 Ta 打包,无网络);Markdown、HTML、SVG 首先作为预览打开,旁边有编辑。预览从 `TaWorkspaceServer.fileUrl` 加载文件:页面在自己的源里沙箱化(`PAGE_SANDBOX`,绝不含 `allow-same-origin`),Markdown(用 marked 呈现,打包在)不运行脚本,两个都用相对 URL 加载其旁边的文件。页面不是由 ta serve 提供时——手机应用、经中继打开的页面——这个地址在页面里加载不到:图片、视频、声音和 PDF 用 `pi.files` 取字节做成 `blob:` 地址,HTML 页面按文件文本放进一个够不到任何东西的沙框里显示(`PAGE_CSP`),所以用相对路径加载的 css、js、图片不会来,自包含的报告页照原样显示。Diff 在 Monaco 的 diff 编辑器中打开(`pi.ui.DiffEditor`),终端是 xterm.js,与 VS Code 相同(`pi.ui.createTerminal`:WebGL 绘制,跟随页面主题;输出里的 URL 和文件路径按 Cmd 或 Ctrl + 点击打开,定位到编译器或 grep 给出的行)。文件图标是 VS Code 默认显示的 Seti 图标(字体和地图来自 microsoft/vscode 的 `extensions/theme-seti`,MIT;`bun scripts/seti.ts` 将它们再次写入 `web-src/util/seti*.ts`)。在服务器上用 `script` 时,shell 获得伪终端;没有它,它在管道上运行,服务器回显并编辑线。
|
|
17
17
|
|
|
18
18
|
回复的链接在这里打开(`pi.registerOpener`):文件作为其标签页,链接名称选中的行(`src/a.ts#L10-L20`、`src/a.ts:10:5`),甚至文件打开有更改,这保留它们;资源管理器中的目录,切换到它;浏览器中的页面。Cmd 或 Ctrl + 单击在系统的浏览器中打开页面,Ta 自己做。
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-workspace",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.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.11.0",
|
|
29
|
+
"@celljs/ta-web": "4.11.0",
|
|
30
30
|
"@types/react": "^19.3.0",
|
|
31
31
|
"marked": "^14.0.0"
|
|
32
32
|
},
|