paseo-open-with 0.1.0 → 0.2.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/OVERVIEW.md CHANGED
@@ -1,19 +1,40 @@
1
+ Open With opens the workspace folder, or a file link in an agent reply, in another app.
2
+
3
+ ## Open the workspace
4
+
1
5
  Open With adds a button to the workspace header. Click it, then click an app, and the workspace folder opens in that app.
2
6
 
3
7
  The menu starts with Fork, GitHub Desktop, VS Code, Cursor, a terminal, and the file manager. It shows only the apps it finds on the computer that runs the daemon. Where it can, it shows each app's own icon.
4
8
 
9
+ ## Open a file link
10
+
11
+ Right-click a local file link in an agent reply, for example `src/app.ts:42` or `D:\out\chart.png`:
12
+
13
+ - **Show in Folder** opens File Explorer or Finder with the file selected.
14
+ - **Open** opens the file with its default app.
15
+ - **Open With ›** opens the file in an app from your list. Fork and GitHub Desktop get the git repository that holds the file, and the terminal gets its folder.
16
+ - **Copy Path** copies the absolute path.
17
+
18
+ Right-click an image in an agent reply to get **Copy Image** too. Left-click keeps Paseo's own behavior.
19
+
5
20
  ## Add your own apps
6
21
 
7
- Choose **Edit apps…** at the bottom of the menu, or open the plugin settings. There you can:
22
+ Choose **Edit apps…** in either menu, or open the plugin settings. There you can:
8
23
 
9
- - Add any program, with its path and its arguments. `{path}` in the arguments is the workspace folder. Put double quotes around a value with spaces, for example `-d "{path}"`.
24
+ - Add any program, with its path and its arguments. `{path}` in the arguments is the workspace folder, or the file you right-clicked. Put double quotes around a value with spaces, for example `-d "{path}"`.
10
25
  - Change the program path of a built-in app, for example when it is installed in an unusual folder.
11
26
  - Turn apps off, and move them up or down in the menu.
12
27
 
13
28
  The settings belong to each daemon, because apps are installed in different places on each computer.
14
29
 
30
+ ## Move from File Links
31
+
32
+ Open With includes the File Links plugin. If you have File Links, remove it, or every file link gets two right-click menus.
33
+
15
34
  ## Limits
16
35
 
17
36
  The daemon starts the app, so the app opens on the computer that runs the daemon. On a remote host, it opens on that host.
18
37
 
19
38
  Built-in paths are known for Windows and macOS. On Linux, the built-in apps must be on `PATH`. Program icons are read on Windows only. On other systems the menu shows a generic icon.
39
+
40
+ The right-click menu works in the desktop and web apps. The mobile app has no right-click.
package/OVERVIEW.zh-CN.md CHANGED
@@ -1,19 +1,40 @@
1
+ Open With 用其他程序打开 workspace 目录,或 Agent 回复里的文件链接。
2
+
3
+ ## 打开 workspace
4
+
1
5
  Open With 在 workspace 顶栏加一个按钮。点按钮,再点一个程序,就用这个程序打开 workspace 目录。
2
6
 
3
7
  菜单预置了 Fork、GitHub Desktop、VS Code、Cursor、终端和文件管理器。菜单只显示在运行 daemon 的电脑上找到的程序。能读到程序图标时,显示程序自己的图标。
4
8
 
9
+ ## 打开文件链接
10
+
11
+ 右击 Agent 回复里的本地文件链接,例如 `src/app.ts:42` 或 `D:\out\chart.png`:
12
+
13
+ - **在文件夹中显示**:打开资源管理器或 Finder,并选中这个文件。
14
+ - **打开**:用默认程序打开文件。
15
+ - **打开方式 ›**:用列表里的程序打开文件。Fork 和 GitHub Desktop 打开文件所在的 git 仓库,终端打开文件所在的目录。
16
+ - **复制路径**:复制绝对路径。
17
+
18
+ 右击 Agent 回复里的图片,还可以 **复制图片**。左键单击保持 Paseo 原来的行为。
19
+
5
20
  ## 添加自己的程序
6
21
 
7
- 点菜单底部的 **编辑程序…**,或打开插件设置。在设置里可以:
22
+ 点任一菜单里的 **编辑程序…**,或打开插件设置。在设置里可以:
8
23
 
9
- - 添加任何程序,填写程序路径和参数。参数里的 `{path}` 代表 workspace 目录。值里有空格时,用双引号括起来,例如 `-d "{path}"`。
24
+ - 添加任何程序,填写程序路径和参数。参数里的 `{path}` 代表 workspace 目录,或你右击的文件。值里有空格时,用双引号括起来,例如 `-d "{path}"`。
10
25
  - 修改预置程序的路径,例如程序装在不常见的目录时。
11
26
  - 关闭不用的程序,在菜单里上移或下移程序。
12
27
 
13
28
  设置按 daemon 分别保存,因为每台电脑上程序的安装位置不同。
14
29
 
30
+ ## 从 File Links 迁移
31
+
32
+ Open With 已包含 File Links 插件的功能。如果装了 File Links,请删除它,否则每个文件链接会出现两个右键菜单。
33
+
15
34
  ## 限制
16
35
 
17
36
  程序由 daemon 启动,所以程序在运行 daemon 的电脑上打开。连接远程主机时,程序在那台主机上打开。
18
37
 
19
38
  预置程序的路径支持 Windows 和 macOS。在 Linux 上,预置程序必须在 `PATH` 里。只在 Windows 上读取程序图标,其他系统显示通用图标。
39
+
40
+ 右键菜单支持桌面版和网页版。移动版没有右键。
package/README.md CHANGED
@@ -1,11 +1,17 @@
1
1
  # Open With for Paseo
2
2
 
3
- A [Paseo](https://paseo.sh) plugin that opens the workspace folder in another app,
4
- in two clicks from the workspace header.
3
+ A [Paseo](https://paseo.sh) plugin that opens the workspace folder, or a file
4
+ link in an agent reply, in another app.
5
+
6
+ ![Open With: the workspace header menu, and the right-click menu on a file link](docs/images/promo.png)
5
7
 
6
8
  Paseo's own "Open in" button has a fixed list of editors, and you cannot add an
7
9
  app such as Fork. Open With has a menu that you can change: add any program, turn
8
- apps off, and put them in your order.
10
+ apps off, and put them in your order. The same list is in the right-click menu of
11
+ file links and images in agent replies.
12
+
13
+ Open With 0.2 includes the File Links plugin. If you have File Links, remove it
14
+ (see [Move from File Links](#move-from-file-links)).
9
15
 
10
16
  ## Install
11
17
 
@@ -15,12 +21,15 @@ Requires **Paseo 0.13.2 or later**.
15
21
  paseo plugin install https://github.com/stv1024/paseo-open-with
16
22
  ```
17
23
 
18
- If the button does not show, reload the Paseo window (**Ctrl+R**, or **Cmd+R** on macOS).
24
+ If the button or the menu does not show, reload the Paseo window (**Ctrl+R**, or
25
+ **Cmd+R** on macOS).
19
26
 
20
- ## Use
27
+ ## Open the workspace
21
28
 
22
29
  Click the button in the workspace header, then click an app.
23
30
 
31
+ ![The Open With menu in the workspace header](docs/images/menu.png)
32
+
24
33
  Built-in apps:
25
34
 
26
35
  | App | Windows | macOS | Linux |
@@ -34,9 +43,52 @@ Built-in apps:
34
43
 
35
44
  The menu shows only the apps it finds. Apps on `PATH` are found too.
36
45
 
46
+ ## Open a file link
47
+
48
+ Right-click a local file link in an agent reply:
49
+
50
+ | Item | What it does |
51
+ | --- | --- |
52
+ | **Show in Folder** | Opens File Explorer or Finder with the file or folder selected. |
53
+ | **Open** | Opens the file with its default app, or opens the folder. |
54
+ | **Open With ›** | Opens the file in an app from your list. |
55
+ | **Copy Path** | Copies the absolute path. |
56
+
57
+ ![Right-click a file link, then choose Open With and an app](docs/images/file-menu.png)
58
+
59
+ In **Open With ›**, each app gets what it can use:
60
+
61
+ | App | Gets |
62
+ | --- | --- |
63
+ | Fork, GitHub Desktop | the git repository that holds the file |
64
+ | Terminal | the folder that holds the file |
65
+ | VS Code, Cursor, and apps you add | the file itself |
66
+
67
+ Right-click an image in an agent reply to get **Copy Image** too. The file items
68
+ show only when the image comes from a local file.
69
+
70
+ Left-click keeps Paseo's own behavior. To get the browser menu instead, hold
71
+ **Shift** (or any other modifier key) while you right-click.
72
+
73
+ ### Supported links
74
+
75
+ - Windows paths: `D:\work\report.md`, `\\server\share\a.txt`
76
+ - `file://` URLs
77
+ - Absolute POSIX paths: `/home/me/a.md`
78
+ - Home paths: `~/notes.md`
79
+ - Paths relative to the workspace: `src/app.ts`
80
+
81
+ Line suffixes such as `:42`, `:42:7`, `(42,7)` and `#L42` are ignored, so the menu
82
+ acts on the file. Web links (`https://…`, `mailto:`) keep the normal menu.
83
+
84
+ If the file does not exist, the menu shows **File not found** and keeps
85
+ **Copy Path** available. Images that an agent reads are often temporary copies, so
86
+ **Show in Folder** can open a temp folder.
87
+
37
88
  ## Add an app
38
89
 
39
- Choose **Edit apps…** at the bottom of the menu. Then choose **Add app** and fill in:
90
+ Choose **Edit apps…** at the bottom of either menu. Then choose **Add app** and
91
+ fill in:
40
92
 
41
93
  | Field | Example |
42
94
  | --- | --- |
@@ -45,21 +97,51 @@ Choose **Edit apps…** at the bottom of the menu. Then choose **Add app** and f
45
97
  | Name | `Sublime Merge` |
46
98
  | Icon | a [Lucide](https://lucide.dev/icons) icon name, used when Paseo cannot read the program icon |
47
99
 
48
- `{path}` is the workspace folder. Arguments split on spaces. Double quotes keep a
49
- value with spaces together, and backslashes stay as they are. `%VAR%` (Windows) and
50
- a leading `~` in the program path are expanded. A program name without a folder is
51
- looked up on `PATH`.
100
+ `{path}` is the workspace folder, or the file you right-clicked. Arguments split
101
+ on spaces. Double quotes keep a value with spaces together, and backslashes stay
102
+ as they are. `%VAR%` (Windows) and a leading `~` in the program path are expanded.
103
+ A program name without a folder is looked up on `PATH`.
52
104
 
53
105
  To change a built-in app, click it and fill in only the fields to change. **Reset**
54
106
  returns it to the defaults.
55
107
 
56
108
  Settings are saved per daemon, so each computer keeps its own list.
57
109
 
110
+ ![The Open With settings, with a custom app open for editing](docs/images/settings.png)
111
+
58
112
  ## How it works
59
113
 
60
- The daemon finds the apps, reads their icons (Windows only), and starts the app
61
- with the workspace folder. So the app opens on the computer that runs the daemon.
62
- A launch error shows as a toast.
114
+ The daemon finds the apps, reads their icons (Windows only), and starts the app.
115
+ So the app opens on the computer that runs the daemon, not on a remote client.
116
+ A launch error shows as a toast in the header menu, and in the right-click menu.
117
+
118
+ On Linux, **Show in Folder** asks the file manager to select the file through
119
+ D-Bus (`org.freedesktop.FileManager1`). When no file manager answers, it opens the
120
+ folder.
121
+
122
+ The right-click menu works in the desktop and web apps. The mobile app has no
123
+ right-click. Both menus follow Paseo's app language. Simplified Chinese is
124
+ translated; other languages show English.
125
+
126
+ ![The right-click menu in Simplified Chinese](docs/images/file-menu-zh-CN.png)
127
+
128
+ ## Move from File Links
129
+
130
+ File Links (`file-links`) is now part of Open With. To move:
131
+
132
+ ```bash
133
+ paseo plugin remove file-links
134
+ paseo plugin install https://github.com/stv1024/paseo-open-with # or: paseo plugin update open-with
135
+ ```
136
+
137
+ Remove File Links, or every file link gets two right-click menus.
138
+
139
+ ## Update
140
+
141
+ ```bash
142
+ paseo plugin update open-with --check
143
+ paseo plugin update open-with
144
+ ```
63
145
 
64
146
  ## Develop
65
147
 
@@ -70,6 +152,14 @@ npm test
70
152
  paseo plugin install .
71
153
  ```
72
154
 
155
+ Run `paseo plugin reload open-with` after each change.
156
+
157
+ The images in `docs/images` are rendered from the HTML mockups in
158
+ `docs/media-src`: `node docs/media-src/render.mjs`. The script uses Chrome Headless
159
+ Shell when Playwright has installed it (`npx playwright install chromium --only-shell`),
160
+ and a local Chrome or Edge when not. On Windows, prefer the Shell: full Chrome can
161
+ check the Windows account password when it creates a new profile.
162
+
73
163
  ### Release
74
164
 
75
165
  Releases go to npm as `paseo-open-with` through
@@ -80,7 +170,7 @@ section, then commit, tag and push:
80
170
  ```bash
81
171
  npm run typecheck && npm test && npm run pack:npm # check the packed file list
82
172
  git push origin main
83
- git tag -a v0.1.0 -m "Open With 0.1.0" && git push origin v0.1.0
173
+ git tag -a v0.2.0 -m "Open With 0.2.0" && git push origin v0.2.0
84
174
  ```
85
175
 
86
176
  The tag push publishes the tarball. Then create the GitHub release from the tag.