fpasoterm 1.6.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.

Potentially problematic release.


This version of fpasoterm might be problematic. Click here for more details.

Files changed (101) hide show
  1. package/CHANGELOG.md +230 -0
  2. package/CONTRIBUTING.md +67 -0
  3. package/INSTALL.ja.md +204 -0
  4. package/INSTALL.md +229 -0
  5. package/LICENSE +21 -0
  6. package/README.ja.md +389 -0
  7. package/README.md +607 -0
  8. package/bin/fpasoterm +2882 -0
  9. package/completions/_fpasoterm +81 -0
  10. package/completions/fpasoterm.bash +55 -0
  11. package/completions/fpasoterm.fish +64 -0
  12. package/completions/fpasoterm.ps1 +47 -0
  13. package/docs/capability-diagnostics.en.md +77 -0
  14. package/docs/capability-diagnostics.ja.md +63 -0
  15. package/docs/completion.en.md +141 -0
  16. package/docs/completion.ja.md +113 -0
  17. package/docs/config.en.md +554 -0
  18. package/docs/config.ja.md +544 -0
  19. package/docs/debugging.en.md +72 -0
  20. package/docs/debugging.ja.md +66 -0
  21. package/docs/diagnostics.en.md +69 -0
  22. package/docs/diagnostics.ja.md +64 -0
  23. package/docs/font-diagnostics.en.md +116 -0
  24. package/docs/font-diagnostics.ja.md +105 -0
  25. package/docs/fpasoterm-plugin.d.ts +51 -0
  26. package/docs/known-issues.en.md +23 -0
  27. package/docs/known-issues.ja.md +23 -0
  28. package/docs/plugins.en.md +266 -0
  29. package/docs/plugins.ja.md +176 -0
  30. package/docs/pr-review.en.md +177 -0
  31. package/docs/pr-review.ja.md +170 -0
  32. package/docs/release-checklist.en.md +72 -0
  33. package/docs/release-checklist.ja.md +71 -0
  34. package/docs/security.en.md +36 -0
  35. package/docs/security.ja.md +31 -0
  36. package/docs/spec.en.md +106 -0
  37. package/docs/spec.ja.md +99 -0
  38. package/docs/sshfs.en.md +28 -0
  39. package/docs/sshfs.ja.md +28 -0
  40. package/docs/sync.en.md +280 -0
  41. package/docs/sync.ja.md +280 -0
  42. package/examples/apply-default-appearance.bat +8 -0
  43. package/examples/apply-default-appearance.ps1 +7 -0
  44. package/examples/apply-default-appearance.sh +7 -0
  45. package/examples/apply-runtime-appearance.bat +8 -0
  46. package/examples/apply-runtime-appearance.ps1 +7 -0
  47. package/examples/apply-runtime-appearance.sh +7 -0
  48. package/examples/config/default-appearance.toml +36 -0
  49. package/examples/config/minimal.toml +30 -0
  50. package/examples/config/profiles.toml +20 -0
  51. package/examples/config/runtime-appearance.toml +24 -0
  52. package/examples/config/sync-folder.toml +17 -0
  53. package/examples/config/tui-compatibility.toml +7 -0
  54. package/examples/config/with-plugins.toml +33 -0
  55. package/examples/plugins/hello.ts +17 -0
  56. package/examples/plugins/status-banner.ts +14 -0
  57. package/examples/plugins/theme.ts +32 -0
  58. package/examples/plugins/welcome-banner.ts +16 -0
  59. package/extra/linux/icons/hicolor/128x128/apps/fpasoterm.png +0 -0
  60. package/extra/linux/icons/hicolor/16x16/apps/fpasoterm.png +0 -0
  61. package/extra/linux/icons/hicolor/192x192/apps/fpasoterm.png +0 -0
  62. package/extra/linux/icons/hicolor/256x256/apps/fpasoterm.png +0 -0
  63. package/extra/linux/icons/hicolor/32x32/apps/fpasoterm.png +0 -0
  64. package/extra/linux/icons/hicolor/48x48/apps/fpasoterm.png +0 -0
  65. package/extra/linux/icons/hicolor/512x512/apps/fpasoterm.png +0 -0
  66. package/extra/linux/icons/hicolor/64x64/apps/fpasoterm.png +0 -0
  67. package/extra/linux/io.github.oyoguhito.fpasoterm.desktop +10 -0
  68. package/extra/logo/fpasoterm.png +0 -0
  69. package/extra/macos/fpasoterm.icns +0 -0
  70. package/extra/windows/fpasoterm.cmd +40 -0
  71. package/extra/windows/fpasoterm.ico +0 -0
  72. package/package.json +81 -0
  73. package/scripts/build-artifacts.js +183 -0
  74. package/scripts/generate-icon.js +251 -0
  75. package/scripts/init-jj-empty-main +41 -0
  76. package/scripts/install-linux-desktop.js +238 -0
  77. package/scripts/run +16 -0
  78. package/scripts/security/scan-secrets.js +89 -0
  79. package/scripts/tests/smoke.js +2476 -0
  80. package/scripts/uninstall-desktop.js +20 -0
  81. package/scripts/uninstall-linux-desktop.js +96 -0
  82. package/scripts/uninstall-windows-path.js +94 -0
  83. package/src/config.js +855 -0
  84. package/src/renderer/confirm.html +71 -0
  85. package/src/renderer/index.html +223 -0
  86. package/src/renderer/renderer.js +4166 -0
  87. package/src/renderer/styles.css +969 -0
  88. package/src/renderer/vendor/addon-fit/addon-fit.js +2 -0
  89. package/src/renderer/vendor/addon-image/LICENSE +19 -0
  90. package/src/renderer/vendor/addon-image/addon-image.js +3 -0
  91. package/src/renderer/vendor/addon-web-links/LICENSE +19 -0
  92. package/src/renderer/vendor/addon-web-links/addon-web-links.js +2 -0
  93. package/src/renderer/vendor/xterm/xterm.css +292 -0
  94. package/src/renderer/vendor/xterm/xterm.js +2 -0
  95. package/src-tauri/Cargo.lock +5253 -0
  96. package/src-tauri/Cargo.toml +29 -0
  97. package/src-tauri/build.rs +140 -0
  98. package/src-tauri/capabilities/default.json +13 -0
  99. package/src-tauri/default-config.toml +128 -0
  100. package/src-tauri/src/main.rs +9347 -0
  101. package/src-tauri/tauri.conf.json +60 -0
@@ -0,0 +1,266 @@
1
+ # Plugins
2
+
3
+ fpasoterm plugins are local JavaScript or TypeScript files that run in the
4
+ terminal renderer after the terminal is ready. Use them for small, personal
5
+ behavior changes such as a startup message, terminal option adjustment, or
6
+ diagnostic integration.
7
+
8
+ Prefer a plugin for a new convenience workflow instead of adding it to the
9
+ fpasoterm core. Core changes remain appropriate for terminal correctness,
10
+ platform integration, security, and compatibility with shells, multiplexers,
11
+ and TUI editors.
12
+
13
+ Plugins are an advanced local customization feature. They are not a sandboxed
14
+ extension format. fpasoterm downloads a public port only when the user
15
+ explicitly invokes `--plugin-install`; it never downloads plugins at startup
16
+ or automatically from a renderer plugin.
17
+
18
+ For reviewed public plugins, use the
19
+ [fpasoterm-plugins ports repository](https://github.com/oyoguhito/fpasoterm-plugins).
20
+ It owns the public catalog, `INDEX`, development checks, and contribution
21
+ process. End users install a reviewed local checkout or an explicit local
22
+ plugin file through the fpasoterm CLI; this document defines that runtime
23
+ contract and manual local plugin layout.
24
+
25
+ ## Security
26
+
27
+ Plugins run in the renderer context alongside the terminal UI. Enable only
28
+ local files that you trust and have reviewed. Do not enable plugins copied from
29
+ unknown sources, and do not put passwords, access tokens, private paths, or
30
+ other secrets in a plugin file.
31
+
32
+ ## Plugin directory
33
+
34
+ Place `.js` or `.ts` files below the `plugins` directory beside the active
35
+ `config.toml`:
36
+
37
+ ```text
38
+ ~/.config/fpasoterm/User/
39
+ ├── config.toml
40
+ └── plugins/
41
+ ├── welcome-banner.ts
42
+ └── status-banner.ts
43
+ ```
44
+
45
+ Subdirectories are supported. Plugin paths in the configuration are always
46
+ relative to the `User` directory, for example `plugins/team/banner.ts`.
47
+
48
+ TypeScript plugins are transpiled at launch and cached below:
49
+
50
+ ```text
51
+ ~/.config/fpasoterm/User/cache/plugins/
52
+ ```
53
+
54
+ Do not edit generated files in that cache; edit the original `.ts` file in
55
+ `User/plugins` instead.
56
+
57
+ ## Plugin version metadata
58
+
59
+ Plugins may declare their own version and description in source comments. No
60
+ manifest or extra directory is required:
61
+
62
+ ```ts
63
+ // @fpasoterm-plugin version: 1.0.0
64
+ // @fpasoterm-plugin description: Displays a concise startup message.
65
+ ```
66
+
67
+ `version` is an arbitrary local release identifier; use semantic versions such
68
+ as `1.0.0` for consistency. It is distinct from `api.version`, which is the
69
+ running fpasoterm application version. Omit the header for older plugins; the
70
+ CLI reports their version as `(not declared)`.
71
+
72
+ ## Enable plugins
73
+
74
+ fpasoterm creates `User/plugins` on its first normal launch. For a manually
75
+ maintained local plugin, place its trusted source there and enable it in
76
+ configuration.
77
+
78
+ Enable the files in `~/.config/fpasoterm/User/config.toml`:
79
+
80
+ ```toml
81
+ [plugins]
82
+ enabled = [
83
+ "plugins/welcome-banner.ts",
84
+ "plugins/status-banner.ts",
85
+ ]
86
+ ```
87
+
88
+ Restart fpasoterm after changing the plugin list or plugin source. Plugins are
89
+ loaded in the order written in `enabled`.
90
+
91
+ The CLI, including packaged Windows/macOS/Linux binaries, can update the list
92
+ by plugin filename:
93
+
94
+ ```sh
95
+ fpasoterm --enable-plugin welcome-banner,status-banner
96
+ fpasoterm --disable-plugin status-banner
97
+ fpasoterm --show-config
98
+ ```
99
+
100
+ The explicit plugin-management spellings are also available from every CLI:
101
+
102
+ ```sh
103
+ fpasoterm --plugin-path
104
+ fpasoterm --plugin-list
105
+ fpasoterm --plugin-info welcome-banner
106
+ fpasoterm --plugin-uninstall welcome-banner
107
+ fpasoterm --plugin-enable welcome-banner
108
+ fpasoterm --plugin-disable welcome-banner
109
+ fpasoterm --plugin-enable-all
110
+ fpasoterm --plugin-disable-all
111
+ ```
112
+
113
+ `--plugin-list` is a local-only view of the active `User/plugins` directory. It does not query
114
+ GitHub or the public port catalog; use `--plugin-search [query]` for that remote catalog. It
115
+ prints discovered files with their declared versions and the `enabled` entries. The
116
+ `--plugin-enable` and `--plugin-disable` options are aliases for the existing
117
+ `--enable-plugin` and `--disable-plugin` options.
118
+ `--plugin-info <file>` prints the resolved source path, enabled state, declared
119
+ version, description, load status, and renderer URL without opening a window. Pass a
120
+ `.js` or `.ts` filename such as `welcome-banner.ts`. For all local
121
+ `--plugin-*` selectors, the leading `plugins/` and the `.js`/`.ts` suffix are
122
+ optional: use `welcome-banner` or `appearance/teal`. If both `.js` and `.ts`
123
+ would match, provide an extension or a more specific path.
124
+ `--plugin-uninstall <file>` removes one or comma-separated local plugin source
125
+ files from `User/plugins`, removes their generated cache files, and removes the
126
+ same entries from `plugins.enabled`. It never contacts the public catalog and
127
+ refuses ambiguous names, traversal, and symlinked plugin files. Restart open
128
+ fpasoterm windows after removal. It cannot be combined with other plugin
129
+ mutation options.
130
+ `--plugin-enable-all` enables every discovered `.js`/`.ts` file. It reports an
131
+ error when `User/plugins` contains no plugin source; it never silently creates
132
+ or enables an empty list.
133
+ `--plugin-disable-all` clears only `plugins.enabled`; it does not delete any
134
+ plugin source or cache file.
135
+
136
+ ## Public Port Install
137
+
138
+ Search the public metadata index before selecting a port. This requests only
139
+ the official `INDEX`; it does not download or execute plugin source:
140
+
141
+ ```sh
142
+ fpasoterm --plugin-search
143
+ fpasoterm --plugin-search teal
144
+ ```
145
+
146
+ `--plugin-search` is a **remote** search and prints its source as the official
147
+ GitHub `INDEX`. The `fpasoterm-plugins` `ports` command remains useful for
148
+ local `INDEX` search, port development, and validation. It is not required for
149
+ an end-user install.
150
+
151
+ Download one selected port from the official
152
+ [`oyoguhito/fpasoterm-plugins`](https://github.com/oyoguhito/fpasoterm-plugins)
153
+ repository without cloning its full checkout or installing Node.js:
154
+
155
+ ```sh
156
+ fpasoterm --plugin-install appearance/teal
157
+ fpasoterm --plugin-install appearance/teal --enable
158
+ fpasoterm --plugin-uninstall appearance/teal
159
+ ```
160
+
161
+ The first command copies only the requested source into `User/plugins` and
162
+ leaves it disabled for review. `--enable` explicitly adds it to
163
+ `plugins.enabled`. Existing files are preserved unless
164
+ `--force` is supplied. The installer connects over HTTPS only to
165
+ the fixed official repository, validates port/source paths, manifest metadata,
166
+ source size, and the expected fpasoterm plugin header. Downloaded plugins still
167
+ run in the renderer, so review and trust them before enabling them.
168
+
169
+ ### Local checkout or file install
170
+
171
+ To install a port you have cloned, reviewed, or are developing locally, use
172
+ the fpasoterm CLI directly. No `npm run ports install` step is needed:
173
+
174
+ ```sh
175
+ git clone https://github.com/oyoguhito/fpasoterm-plugins.git
176
+ fpasoterm --plugin-install appearance/teal \
177
+ --plugin-ports-dir ./fpasoterm-plugins --enable
178
+ ```
179
+
180
+ `--plugin-ports-dir` explicitly selects the checkout containing `ports/`.
181
+ Without it, `--plugin-install` obtains the selected port from the official
182
+ GitHub repository. With it, the installer reads `port.toml`, checks metadata
183
+ and the minimum fpasoterm version, then copies only that local plugin source.
184
+ The local path never contacts the network.
185
+
186
+ For a standalone trusted plugin outside a ports checkout, explicitly name the
187
+ source file:
188
+
189
+ ```sh
190
+ fpasoterm --plugin-install-file ~/work/my-plugins/team-banner.ts --enable
191
+ ```
192
+
193
+ Both local commands require a regular `.js` or `.ts` file with the fpasoterm
194
+ plugin header and renderer API marker. They preserve an existing destination
195
+ unless `--force` is supplied.
196
+
197
+ When duplicate filenames exist in different subdirectories, use a path
198
+ relative to `plugins`, such as `team/status-banner.ts`.
199
+
200
+ ### Windows packaged binary
201
+
202
+ MSI/EXE supports `fpasoterm.exe --plugin-install <category/name>` with or
203
+ without `--plugin-ports-dir`, and `--plugin-install-file` directly; Node.js is
204
+ not required. Use `fpasoterm.cmd` only when running from a Windows source checkout.
205
+
206
+ At startup, plugin scripts are loaded from the trusted `User/plugins` source or
207
+ the generated TypeScript cache using Tauri's local asset protocol. The default
208
+ `User` directory is supported. After enabling or editing a plugin, close and
209
+ restart the affected fpasoterm window. For a load failure, start with
210
+ `fpasoterm --foreground --console-diagnostics` and look for `plugin loaded` or
211
+ `failed to load plugin`.
212
+
213
+ Every plugin is evaluated in its own function scope. Plugins can therefore use
214
+ their own top-level `const` and `let` declarations without colliding with other
215
+ enabled plugins. Use `window.fpasotermPluginApi` for the supported shared API.
216
+
217
+ ## Plugin API
218
+
219
+ The supported API is declared in
220
+ [`docs/fpasoterm-plugin.d.ts`](fpasoterm-plugin.d.ts). Add this line at the top
221
+ of a TypeScript plugin when working from this repository:
222
+
223
+ ```ts
224
+ /// <reference path="../../docs/fpasoterm-plugin.d.ts" />
225
+ ```
226
+
227
+ Installed plugins can instead copy the declaration file locally and update the
228
+ reference path. The API is available as `window.fpasotermPluginApi` and
229
+ provides:
230
+
231
+ - `terminal`: write text, focus the terminal, and adjust supported terminal options.
232
+ - `fitAddon`: call `fit()` after a plugin changes terminal layout-related options.
233
+ - `config`: read the resolved runtime configuration, including `plugins.enabled`.
234
+ - `log(message)`: write a plugin-prefixed diagnostic entry.
235
+ - `version`: read the running fpasoterm version and build identifier.
236
+ - `getOfficialPluginIndex()`: read metadata from the same fixed official `INDEX`
237
+ used by `fpasoterm --plugin-search`. It does not download, install, enable,
238
+ or execute plugin source.
239
+ - `onReady(callback)`: run code once after the terminal backend has started.
240
+ - `registerCommand(id, title, handler)`: add an action button under the
241
+ hamburger menu's `Plugins` submenu. The submenu is shown only when at least
242
+ one loaded plugin registers a command. Enabling a plugin alone does not add a
243
+ button because fpasoterm has no action handler to invoke.
244
+
245
+ All current in-tree samples register one command, so enabling current copies of
246
+ `hello.ts`, `status-banner.ts`, `theme.ts`, and `welcome-banner.ts` shows four
247
+ buttons. If an older local sample does not register a command, it remains
248
+ enabled and can still run its startup code, but it is intentionally absent from
249
+ the menu. Use `--plugin-info <file>` to inspect its source/version and restart
250
+ after replacing a local plugin file.
251
+
252
+ Keep plugins small and defensive. A plugin load error is reported in diagnostics
253
+ and does not stop later enabled plugins from loading, but an invalid plugin can
254
+ still affect the renderer while it runs.
255
+
256
+ Registered commands use the existing menu's Tab and arrow-key navigation.
257
+ `Ctrl+Shift+P` remains assigned to `Log Show`; a command palette can reuse the
258
+ same command registry in a future release without changing plugin source.
259
+
260
+ ## Samples And Ports
261
+
262
+ The in-tree `examples/plugins/` files are minimal API references. Installable
263
+ samples, appearance themes, metadata, compatibility validation, and updates are
264
+ maintained in [fpasoterm-plugins](https://github.com/oyoguhito/fpasoterm-plugins).
265
+
266
+ See [Configuration](config.en.md) for the full `config.toml` reference.
@@ -0,0 +1,176 @@
1
+ # プラグイン
2
+
3
+ fpasoterm のプラグインは、terminal の準備後に renderer で動作するローカルの JavaScript または TypeScript file です。起動時メッセージ、terminal option の調整、diagnostics 連携など、個人用の小さな挙動変更に使えます。追加すると便利な workflow は、原則として本体ではなく plugin として実装します。本体の変更は terminal の正確性、platform integration、security、shell / multiplexer / TUI editorとの互換性に必要なものへ限定します。
4
+
5
+ plugin は高度なローカルカスタマイズ機能で、sandbox 化された extension 形式ではありません。fpasoterm は利用者が `--plugin-install` を明示した場合に限り公開portを取得できます。起動時やrenderer pluginから自動取得することはありません。
6
+
7
+ review済みの公開pluginは [fpasoterm-plugins ports repository](https://github.com/oyoguhito/fpasoterm-plugins) を使用してください。このrepositoryは公開catalog、`INDEX`、開発時のcheck、contribution processを管理します。利用者向けのlocal checkoutまたは指定fileからのinstallはfpasoterm本体CLIで行います。本書はfpasoterm本体のruntime contractと手動local plugin配置を説明します。
8
+
9
+ ## セキュリティ
10
+
11
+ plugin は terminal UI と同じ renderer context で実行されます。内容を確認して信頼できるローカル file だけを有効にしてください。出所不明の plugin は有効にせず、password、access token、private path、その他の秘密情報を plugin file に書かないでください。
12
+
13
+ ## plugin directory
14
+
15
+ active な `config.toml` と同じ場所にある `plugins` directory 配下へ、`.js` または `.ts` file を配置します。
16
+
17
+ ```text
18
+ ~/.config/fpasoterm/User/
19
+ ├── config.toml
20
+ └── plugins/
21
+ ├── welcome-banner.ts
22
+ └── status-banner.ts
23
+ ```
24
+
25
+ subdirectory も使えます。設定に書く plugin path は常に `User` directory からの相対 path です。たとえば `plugins/team/banner.ts` のように指定します。
26
+
27
+ TypeScript plugin は起動時に変換され、次の directory に cache されます。
28
+
29
+ ```text
30
+ ~/.config/fpasoterm/User/cache/plugins/
31
+ ```
32
+
33
+ この cache の生成 file は編集せず、`User/plugins` 配下にある元の `.ts` file を編集してください。
34
+
35
+ ## plugin version metadata
36
+
37
+ plugin source の comment に version と description を宣言できます。manifestや追加 directory は不要です。
38
+
39
+ ```ts
40
+ // @fpasoterm-plugin version: 1.0.0
41
+ // @fpasoterm-plugin description: 簡潔な起動 message を表示する。
42
+ ```
43
+
44
+ `version` は plugin 固有のローカル release 識別子です。一貫性のため `1.0.0` のような semantic version を推奨します。実行中 fpasoterm 本体の version を返す `api.version` とは別です。headerの無い既存 plugin は従来どおり動作し、CLIでは `(not declared)` と表示します。
45
+
46
+ ## plugin の有効化
47
+
48
+ fpasoterm は最初の通常起動時に `User/plugins` を作成します。手動管理するlocal pluginの場合は、そこへ信頼できるsourceを配置して設定で有効化します。
49
+
50
+ `~/.config/fpasoterm/User/config.toml` で有効にします。
51
+
52
+ ```toml
53
+ [plugins]
54
+ enabled = [
55
+ "plugins/welcome-banner.ts",
56
+ "plugins/status-banner.ts",
57
+ ]
58
+ ```
59
+
60
+ plugin list または plugin source を変更した後は fpasoterm を再起動してください。`enabled` に書かれた順番で読み込まれます。
61
+
62
+ CLIでは、packaged Windows/macOS/Linux binaryを含めて、file nameを指定してlistを更新できます。
63
+
64
+ ```sh
65
+ fpasoterm --enable-plugin welcome-banner,status-banner
66
+ fpasoterm --disable-plugin status-banner
67
+ fpasoterm --show-config
68
+ ```
69
+
70
+ すべてのCLIでplugin管理用の明示的な表記も使えます。
71
+
72
+ ```sh
73
+ fpasoterm --plugin-path
74
+ fpasoterm --plugin-list
75
+ fpasoterm --plugin-info welcome-banner
76
+ fpasoterm --plugin-uninstall welcome-banner
77
+ fpasoterm --plugin-enable welcome-banner
78
+ fpasoterm --plugin-disable welcome-banner
79
+ fpasoterm --plugin-enable-all
80
+ fpasoterm --plugin-disable-all
81
+ ```
82
+
83
+ `--plugin-list` はactiveな `User/plugins` directoryだけを対象にする **local list** です。GitHubや公開port catalogへの問い合わせは行いません。remote catalogは `--plugin-search [query]` を使用してください。検出した fileと宣言されたversion、および `enabled` を表示します。`--plugin-enable` と `--plugin-disable` は、既存の `--enable-plugin` と `--disable-plugin` の alias です。
84
+ `--plugin-info <file>` は window を起動せずに、source path、有効状態、宣言version、description、load status、renderer URL を表示します。localの`--plugin-*` selectorでは、`plugins/` prefixと`.js`/`.ts` suffixを省略できます。たとえば`welcome-banner`や`appearance/teal`を指定できます。`.js`と`.ts`の両方が一致する場合はextensionまたはより具体的なpathを指定してください。
85
+ `--plugin-uninstall <file>` は `User/plugins` のlocal plugin sourceを1件またはcomma区切りで削除し、生成済みcacheと同じ`plugins.enabled` entryも削除します。公開catalogには接続せず、曖昧なname、traversal、symlink化されたplugin fileはerrorにします。削除後は開いているfpasoterm windowを再起動してください。他のplugin変更optionとの同時指定はできません。
86
+ `--plugin-enable-all` は検出済みの全 `.js` / `.ts` fileを有効化します。`User/plugins`にplugin sourceが無い場合は、空のlistを成功扱いにせずerrorを表示します。`--plugin-disable-all` は `plugins.enabled` だけを空にし、plugin sourceやcache fileは削除しません。
87
+
88
+ ## 公開portの直接install
89
+
90
+ portを選ぶ前に公開metadata indexを検索できます。これは公式`INDEX`だけを取得し、plugin sourceのdownloadや実行は行いません。
91
+
92
+ ```sh
93
+ fpasoterm --plugin-search
94
+ fpasoterm --plugin-search teal
95
+ ```
96
+
97
+ `--plugin-search` は公式GitHub `INDEX`を表示する **remote search** で、出力にもsourceを表示します。`fpasoterm-plugins` 内の `ports` command はlocal `INDEX`検索、port開発、検証に使えますが、利用者がpluginをinstallするためには不要です。
98
+
99
+ 公式の [oyoguhito/fpasoterm-plugins](https://github.com/oyoguhito/fpasoterm-plugins)
100
+ repositoryから、必要なportだけを本体CLIで直接取得できます。ports checkout全体やNode.jsは不要です。
101
+
102
+ ```sh
103
+ fpasoterm --plugin-install appearance/teal
104
+ fpasoterm --plugin-install appearance/teal --enable
105
+ fpasoterm --plugin-uninstall appearance/teal
106
+ ```
107
+
108
+ 最初のcommandは指定portのsourceだけを`User/plugins`へcopyし、reviewできるよう無効のままにします。`--enable`を明示した場合だけ`plugins.enabled`へ追加します。既存fileは`--force`を指定しない限り置き換えません。installerは固定の公式repositoryにHTTPSで接続し、port/source path、manifest metadata、source size、期待するfpasoterm plugin headerを検証します。download後もpluginはrendererで動作するため、有効化前に内容を確認して信頼できるものだけを使用してください。
109
+
110
+ ### local checkout / fileからのinstall
111
+
112
+ clone、review、開発中のlocal portは、`npm run ports install` を使わずfpasoterm本体CLIからinstallできます。
113
+
114
+ ```sh
115
+ git clone https://github.com/oyoguhito/fpasoterm-plugins.git
116
+ fpasoterm --plugin-install appearance/teal \
117
+ --plugin-ports-dir ./fpasoterm-plugins --enable
118
+ ```
119
+
120
+ `--plugin-ports-dir` には `ports/` を含むcheckoutを明示します。指定しない`--plugin-install`は公式GitHub repositoryから対象portを取得します。指定した場合はlocal installerとして`port.toml`、metadata、必要なfpasoterm versionを検証し、該当plugin sourceだけをcopyします。local経路はnetworkへ接続しません。
121
+
122
+ ports checkout外にある信頼済みの単独pluginをcopyする場合は、source fileを明示します。
123
+
124
+ ```sh
125
+ fpasoterm --plugin-install-file ~/work/my-plugins/team-banner.ts --enable
126
+ ```
127
+
128
+ どちらのlocal commandもfpasoterm plugin headerとrenderer API markerを持つ通常の`.js`または`.ts` fileだけを受け付けます。既存fileは`--force`を指定しない限り置き換えません。
129
+
130
+ subdirectory に同名 file がある場合は、`team/status-banner.ts` のように `plugins` からの相対 path を指定してください。
131
+
132
+ ### Windows packaged binary
133
+
134
+ MSI/EXEでは`fpasoterm.exe --plugin-install <category/name>`を`--plugin-ports-dir`の有無にかかわらず使用でき、`--plugin-install-file`も直接使用できます。Node.jsは不要です。Windows source checkoutで実行する場合だけ`fpasoterm.cmd`を使用します。
135
+
136
+ 起動時は、trusted な `User/plugins` source または生成されたTypeScript cacheをTauriのlocal asset protocol経由で読み込みます。標準の`User` directoryが対象です。pluginを有効化または編集した後は、対象のfpasoterm windowを閉じて再起動してください。読み込みerrorを調べる場合は、`fpasoterm --foreground --console-diagnostics`で起動し、`plugin loaded` または `failed to load plugin` を確認します。
137
+
138
+ 各pluginは個別のfunction scopeで評価します。そのため、複数のpluginがそれぞれtop-levelで`const`や`let`を使用しても衝突しません。共有APIには`window.fpasotermPluginApi`を使用してください。
139
+
140
+ ## plugin API
141
+
142
+ 対応 API は [`docs/fpasoterm-plugin.d.ts`](fpasoterm-plugin.d.ts) に定義されています。この repository 内で TypeScript plugin を作成する場合は、先頭に次を追加します。
143
+
144
+ ```ts
145
+ /// <reference path="../../docs/fpasoterm-plugin.d.ts" />
146
+ ```
147
+
148
+ install 後の plugin では declaration file をローカルへコピーし、reference path を調整できます。API は `window.fpasotermPluginApi` として利用でき、次を提供します。
149
+
150
+ - `terminal`: text の出力、terminal の focus、対応する terminal option の変更。
151
+ - `fitAddon`: layout 関連 option を変更した後の `fit()` 実行。
152
+ - `config`: `plugins.enabled` を含む解決済み runtime config の参照。
153
+ - `log(message)`: plugin prefix 付き diagnostics の出力。
154
+ - `version`: 実行中の fpasoterm version と build identifier の参照。
155
+ - `getOfficialPluginIndex()`: `fpasoterm --plugin-search` と同じ固定公式
156
+ `INDEX`からmetadataを取得します。plugin sourceのdownload、install、enable、実行は
157
+ 行いません。
158
+ - `onReady(callback)`: terminal backend の起動成功後に一度だけ code を実行。
159
+ - `registerCommand(id, title, handler)`: 既存 hamburger menu の `Plugins` submenu配下へ
160
+ action buttonを追加する。loaded pluginが一つ以上commandを登録した場合だけsubmenuを表示する。pluginを
161
+ 有効化しただけでは実行するhandlerがないため、buttonは追加しない。
162
+
163
+ 現在のrepository内sampleはすべて一つのcommandを登録します。最新版の`hello.ts`、`status-banner.ts`、
164
+ `theme.ts`、`welcome-banner.ts`を有効化すると、4つのbuttonが表示されるのが正しい動作です。古いlocal sampleが
165
+ commandを登録しない場合もplugin自体は有効で起動時処理を実行できますが、意図してmenuには表示しません。sourceと
166
+ versionは`--plugin-info <file>`で確認し、local plugin fileを差し替えた後はwindowを再起動してください。
167
+
168
+ plugin は小さく防御的に実装してください。読み込み error は diagnostics に記録され、後続の有効 plugin の読み込みは継続します。ただし、実行中の不正な plugin は renderer に影響する可能性があります。
169
+
170
+ 登録した command は既存 menu の Tab / 矢印キー操作で選択できます。`Ctrl+Shift+P` は `Log Show` に割り当て済みのため維持します。将来 command palette を追加する場合も、同じ command registry を plugin source の変更なしに利用できます。
171
+
172
+ ## Sample と Ports
173
+
174
+ repository内の`examples/plugins/`は最小のAPI参照用です。install可能なsample、appearance theme、metadata、compatibility validation、updateは [fpasoterm-plugins](https://github.com/oyoguhito/fpasoterm-plugins) で管理します。
175
+
176
+ `config.toml` の全設定は [設定](config.ja.md) を参照してください。
@@ -0,0 +1,177 @@
1
+ # Pull Request Review
2
+
3
+ Ordinary pull requests do not include release artifacts by default. Release
4
+ artifacts are generated from version tags by the `Release` workflow and uploaded
5
+ to GitHub Releases.
6
+
7
+ Use this document when a reviewer asks what to test when no downloadable PR
8
+ artifact is available.
9
+
10
+ ## Source Checkout Review
11
+
12
+ Use this path when the reviewer can build on the target OS.
13
+
14
+ ```sh
15
+ gh pr checkout <number> --repo oyoguhito/fpasoterm
16
+ npm install
17
+ npm run check
18
+ ```
19
+
20
+ Without GitHub CLI:
21
+
22
+ ```sh
23
+ git fetch origin pull/<number>/head:review-pr-<number>
24
+ git switch review-pr-<number>
25
+ npm install
26
+ npm run check
27
+ ```
28
+
29
+ `git fetch` only downloads remote references; it does not change the current
30
+ working tree. Always run `git switch` or `git checkout` before building.
31
+
32
+ Prerequisites are Node.js 22+, Rust stable, and the native target tools: Xcode
33
+ Command Line Tools on macOS, or Visual Studio Build Tools with **Desktop
34
+ development with C++** plus the Edge WebView2 Runtime on Windows. If no local
35
+ checkout exists yet, clone first with
36
+ `git clone https://github.com/oyoguhito/fpasoterm.git` and `cd fpasoterm`.
37
+
38
+ ## Windows MSI Review
39
+
40
+ Run these commands from PowerShell in the repository root. The PR-number ref
41
+ avoids guessing the head branch name:
42
+
43
+ ```powershell
44
+ git fetch origin pull/<number>/head:review-pr-<number>
45
+ git switch review-pr-<number>
46
+ git status --short
47
+ git log -1 --oneline
48
+ npm ci
49
+ npm run check
50
+ npm run build:bundles
51
+ ```
52
+
53
+ The empty `git status --short` and the final `git log` line confirm the exact
54
+ revision that is being packaged. `git fetch` alone leaves the current branch
55
+ unchanged and must not be used as the build step.
56
+
57
+ First test the built executable directly, which cannot accidentally launch an
58
+ older Start menu, pinned, or Path entry. Use the generated `.cmd` wrapper for
59
+ CLI output so PowerShell waits for the GUI-subsystem executable:
60
+
61
+ ```powershell
62
+ .\src-tauri\target\release\fpasoterm.cmd --version
63
+ .\src-tauri\target\release\fpasoterm.exe
64
+ ```
65
+
66
+ Then test the actual Node launcher behavior required by PRs that change CLI
67
+ startup. It must print a status line and return the PowerShell prompt without
68
+ waiting for the window:
69
+
70
+ ```powershell
71
+ node .\bin\fpasoterm
72
+ Get-Content "$env:LOCALAPPDATA\fpasoterm\launcher.log" -Tail 40
73
+ ```
74
+
75
+ The log should contain `cargo-build-start` / `cargo-build-complete` only when a
76
+ local build was required, followed by `desktop-spawned` and elapsed times.
77
+
78
+ Then open `Help` in the application and verify that `Config:` names the file
79
+ being edited, and that the expected PR UI is present.
80
+
81
+ An unreleased PR commonly has the same package version as an installed build.
82
+ Close every fpasoterm process before installing its MSI, then force Windows
83
+ Installer to reinstall the package rather than retaining its same-version
84
+ installation:
85
+
86
+ ```powershell
87
+ Get-Process fpasoterm -ErrorAction SilentlyContinue | Stop-Process -Force
88
+ $msi = Get-ChildItem .\artifacts\*.msi | Sort-Object LastWriteTime -Descending | Select-Object -First 1
89
+ & msiexec.exe /i $msi.FullName REINSTALL=ALL REINSTALLMODE=vomus
90
+ if ($LASTEXITCODE -notin 0, 3010) { throw "MSI install failed: $LASTEXITCODE" }
91
+ ```
92
+
93
+ Exit code `3010` means Windows requires a restart. Launch the installed app
94
+ from its updated Start menu shortcut after this step. When only functional
95
+ review is needed, prefer the direct release executable above; it is the most
96
+ reliable way to prove the PR branch is running.
97
+
98
+ ## Windows Direct Binary Review
99
+
100
+ For changes that affect direct `fpasoterm.exe` behavior, build and run the
101
+ Windows binary from the PR branch.
102
+
103
+ Debug build:
104
+
105
+ ```powershell
106
+ cargo build --manifest-path src-tauri/Cargo.toml
107
+ .\src-tauri\target\debug\fpasoterm.exe --help
108
+ .\src-tauri\target\debug\fpasoterm.exe --size 1200x800 --title "PR test" --titlebar-color "#2e7d32"
109
+ ```
110
+
111
+ Release-style local build:
112
+
113
+ ```powershell
114
+ npm run build
115
+ .\src-tauri\target\release\fpasoterm.exe --help
116
+ ```
117
+
118
+ Expected behavior:
119
+
120
+ - `--help` exits before opening the GUI window and prints usage text.
121
+ - `--size` changes the initial window size.
122
+ - `--title` changes the custom titlebar text.
123
+ - `--titlebar-color` changes the custom titlebar color.
124
+
125
+ ## macOS App Bundle Review
126
+
127
+ Run these commands in Terminal from the repository root. Build natively on the
128
+ architecture being reviewed: Apple Silicon builds arm64, while an Intel Mac
129
+ builds x64.
130
+
131
+ ```sh
132
+ git fetch origin pull/<number>/head:review-pr-<number>
133
+ git switch review-pr-<number>
134
+ git status --short
135
+ git log -1 --oneline
136
+ npm ci
137
+ npm run check
138
+ npm run build:bundles
139
+ ./src-tauri/target/release/fpasoterm --version
140
+ node ./bin/fpasoterm
141
+ tail -40 ~/.cache/fpasoterm/launcher.log
142
+ ```
143
+
144
+ `node ./bin/fpasoterm` is the command to use when reviewing launcher behavior:
145
+ it must print a cached-runtime or Cargo-build status and return the Terminal
146
+ prompt before the window appears. Use `--foreground --console-diagnostics` only
147
+ to intentionally wait for compiler and application output.
148
+
149
+ Open the locally built app bundle separately to review the icon and Finder/App
150
+ bundle behavior:
151
+
152
+ ```sh
153
+ open -n ./src-tauri/target/release/bundle/macos/fpasoterm.app
154
+ ```
155
+
156
+ If macOS blocks an unsigned local build, use Finder's **Open** action and
157
+ approve it in Privacy & Security. Do not substitute an older tagged DMG for the
158
+ PR branch build.
159
+
160
+ ## If There Is No Artifact
161
+
162
+ If there is no downloadable artifact on the PR, the review target is the PR
163
+ branch itself. The reviewer should check out the PR branch, install dependencies,
164
+ run the local checks, and build a local debug or release binary for the target
165
+ OS.
166
+
167
+ Do not use tag release assets as substitutes for PR artifacts, because those
168
+ assets were built from a version tag, not from the pull request branch.
169
+
170
+ ## When PR Artifacts Are Required
171
+
172
+ If reviewers need downloadable `.exe`, `.msi`, `.deb`, `.rpm`, `.dmg`, or app
173
+ archives for every pull request, add a separate `pull_request` artifact workflow.
174
+ That workflow should build from the PR branch and upload GitHub Actions
175
+ artifacts, but it should not publish a GitHub Release.
176
+
177
+ Keep the tag-based `Release` workflow for official versioned releases.