@langify-org/dsh-code-server 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 langify-org
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ja.md ADDED
@@ -0,0 +1,64 @@
1
+ # @langify-org/dsh-code-server
2
+
3
+ [English](README.md) | 日本語 | [中文](README.zh.md)
4
+
5
+ DeepSeek Harness のセッションの作業フォルダーを、DSH の右サイドバーの中で [code-server](https://github.com/coder/code-server) を使って編集できます。DSH 内のテキストファイルへのリンクは、このエディターの該当行で開きます。
6
+
7
+ ## 必要なもの
8
+
9
+ - DSH `>=0.2.1-rc.3 <0.3.0-0`(Linux または macOS)。
10
+ - 別途インストールした code-server。4.143 で検証しています。起動と停止はプラグインが行うので、自分で動かす必要はありません。
11
+ - セッションのファイルが DSH の動いているマシン上にあること。サンドボックスなど別のファイルシステム上のセッションは拒否します。
12
+
13
+ ## 導入
14
+
15
+ ```sh
16
+ dsh plugin --profile <profile> add @langify-org/dsh-code-server
17
+ ```
18
+
19
+ DSH の Web 版や Desktop 版では **Plugins** ページから追加できます。
20
+
21
+ ## 使い方
22
+
23
+ 右サイドバーでタブを追加し、**Code** を選びます。セッションの作業フォルダーが開きます。初回は code-server の起動に数秒かかります。DSH の他の場所(**Workspace files** や会話中のリンクなど)でテキストファイルを選ぶと、Code ページに表示されます。画像や PDF などは DSH の標準のビューアーで開きます。
24
+
25
+ - エディターがつながっている間の知らせは、エディターに出ます。ステータスバーに接続状態を示す **DSH** が表示され、クリックすると**再接続**か接続のログを選べます。開けなかったファイルもエディターに知らせが出ます。セッションの作業フォルダーが変わると、新しいフォルダーで開き直すかを尋ねる通知が出ます。
26
+ - エディターから再接続すると、保存していない変更があれば先に保存を求め、そのあとエディターを再読み込みします。再接続前に選んだファイルは開き直しません。
27
+ - ページが表示するのは、エディターが知らせられないときだけです。code-server の起動中や起動失敗、接続が終わったあとです。接続が終わってもエディターは残り、上に**再接続**が出ます。DSH のタブの再読み込みコマンドでも同じです。
28
+ - エディターが時間内に確認しなかったファイルの表示要求は「結果不明」として報告し、再送しません。エディターが後から表示する可能性があるためです。
29
+
30
+ ## 設定
31
+
32
+ | 設定 | 既定値 | 意味 |
33
+ | --------------- | ------------- | -------------------------------------------------------------- |
34
+ | `command` | `code-server` | 実行ファイルの名前またはパス。 |
35
+ | `userDataDir` | 空 | code-server の `--user-data-dir`。空なら code-server の既定。 |
36
+ | `extensionsDir` | 空 | code-server の `--extensions-dir`。空なら code-server の既定。 |
37
+
38
+ 既定のままなら、普段使いの code-server と設定・拡張を共有します。同じディレクトリを使う別の code-server を同時に動かさないでください。
39
+
40
+ ## 仕組み
41
+
42
+ - プラグインは必要になったときに DSH 用の code-server を1つ起動します。待ち受けは本人だけが開ける Unix socket(`0700` のディレクトリ内の `0600`)で、code-server 自身の認証は無効にしています。ネットワークのポートは開きません。
43
+ - DSH は自分のオリジンの `/code-server` で code-server を配信します。すべてのリクエストと WebSocket は、先に DSH の認証とオリジンの検査を通ります。そのため code-server には、DSH に届く場所(Tailscale 経由など)からだけ届きます。
44
+ - 起動のたびに、同梱の VS Code 拡張 **DSH Code Bridge**(`langify-org.dsh-code-bridge`)を code-server に入れ、古いものを置き換えます。
45
+ - Code ページごとに専用の接続(binding)を作ります。ページは binding をエディターの URL の断片(サーバーには送られない部分)に入れ、そのエディター画面の拡張がそれを読み取って、別の非公開 socket でプラグインに接続します。同じフォルダーを複数のページで開いていても、ファイルはその画面にだけ開きます。
46
+
47
+ ## セキュリティ
48
+
49
+ code-server とそのターミナル・拡張は、あなたの権限で、DSH のサンドボックスや承認の外で動きます。さらに DSH と同じオリジンなので、code-server の中で動くコード(拡張やその webview を含む)は、あなたのセッションで DSH を操作することもできます。信頼できる拡張だけを入れてください。[SECURITY.ja.md](../../SECURITY.ja.md) も参照してください。
50
+
51
+ ## 手動確認
52
+
53
+ ブラウザーと実際の code-server が必要なため、`pnpm check` には含めていません。リリース前に `pnpm dev` で確認します。`pnpm dev` では [dev.patch.yml](dev.patch.yml) により、code-server の設定と拡張は `.dsh/code-server/` に置かれ、普段の code-server とは分かれます。Host とページの変更は `pnpm dev` の実行中に反映されますが、`src/extension/` の変更は `pnpm dev` を起動し直すまで反映されません。code-server が拡張を入れるのは起動時だけだからです。
54
+
55
+ 1. **Code** にはエディターだけが表示され、上に何も出ない。エディターのステータスバーの **DSH** が接続済みになる(Restricted Mode でも)。接続が終わった後もエディターは残り、上の行に**再接続**が出る。
56
+ 2. **Workspace files** で選んだテキストファイルが Code ページの該当行で開く。画像は DSH のビューアーのまま開く。
57
+ 3. サインインしていないと `/code-server/` と `POST /api/langify-code-server/create` が 401 を返し、別オリジンからの WebSocket の upgrade は 403 を返す。
58
+ 4. セッションの作業フォルダーが変わると、エディターが開き直すかを尋ねる。未保存のファイルがあれば先に保存を求め、そのあとページが新しいフォルダーでエディターを開き直す。
59
+ 5. Code タブを閉じると binding が閉じる。DSH を止めると code-server も止まり、socket が消える。
60
+
61
+ ## 既知の制約
62
+
63
+ - DSH にはファイルのタブが開く前に割り込む仕組みがないため、Code ページに切り替わる前に、ファイルのタブが一瞬表示されます。
64
+ - binding の受け渡しは、code-server が `vscode.env.asExternalUri` に答えるときにページの URL の断片を保つことに依存しています。これは code-server の挙動であって、文書化された約束ではありません。code-server を更新したら確認し直してください。
package/README.md CHANGED
@@ -1,3 +1,64 @@
1
- # Temporary Holding Version
1
+ # @langify-org/dsh-code-server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ English | [日本語](README.ja.md) | [中文](README.zh.md)
4
+
5
+ Edit a DeepSeek Harness session's working folder in [code-server](https://github.com/coder/code-server), inside DSH's right sidebar. Text-file links in DSH open in that editor, at their line.
6
+
7
+ ## Requirements
8
+
9
+ - DSH `>=0.2.1-rc.3 <0.3.0-0`, on Linux or macOS.
10
+ - code-server, installed separately. Tested with 4.143. The plugin starts and stops it; you do not run it yourself.
11
+ - The session's files must be on the machine DSH runs on. Sessions on another file system, such as a sandbox, are refused.
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ dsh plugin --profile <profile> add @langify-org/dsh-code-server
17
+ ```
18
+
19
+ In DSH Web or Desktop, use the **Plugins** page instead.
20
+
21
+ ## Use
22
+
23
+ Open the right sidebar, add a tab, and choose **Code**. The page opens the session's working folder; the first time, starting code-server takes a few seconds. Choosing a text file elsewhere in DSH, for example in **Workspace files** or a link in the conversation, shows it in the Code page. Images, PDFs and other files keep DSH's own viewers.
24
+
25
+ - While the editor is connected, it is where you hear about it. Its status bar shows **DSH** with the connection's state; click it to **Reconnect** or to see the connection log. A file that cannot be opened is reported there, and when the session's working folder changes, a notification offers to reopen the editor on it.
26
+ - Reconnecting from the editor asks you to save unsaved changes first, then reloads the editor. Files you chose before reconnecting are not reopened.
27
+ - The page speaks only when the editor cannot: while code-server starts or if it fails, and after the connection ends. The editor then stays, with **Reconnect** above it; DSH's refresh command for the tab does the same.
28
+ - A file request that the editor did not confirm in time is reported as unknown and never sent again, because the editor may still show it later.
29
+
30
+ ## Configuration
31
+
32
+ | Setting | Default | Meaning |
33
+ | --------------- | ------------- | ------------------------------------------------------------------- |
34
+ | `command` | `code-server` | Executable name or path. |
35
+ | `userDataDir` | empty | code-server's `--user-data-dir`. Empty uses code-server's default. |
36
+ | `extensionsDir` | empty | code-server's `--extensions-dir`. Empty uses code-server's default. |
37
+
38
+ With the defaults, the editor shares settings and extensions with your own code-server. Do not run another code-server on the same directories at the same time.
39
+
40
+ ## How it works
41
+
42
+ - The plugin starts one code-server for DSH on demand, listening on a Unix socket that only you can open (mode `0600` in a `0700` directory), with code-server's own authentication off. It never opens a network port.
43
+ - DSH serves code-server under `/code-server` on its own origin. Every request and WebSocket passes DSH's authentication and origin check first, so code-server is reachable wherever DSH is, for example over Tailscale, and nowhere else.
44
+ - Before each start, the plugin installs its bundled VS Code extension, **DSH Code Bridge** (`langify-org.dsh-code-bridge`), into code-server, replacing any older copy.
45
+ - Each Code page gets its own connection ("binding"). The page puts the binding in the editor's URL fragment, which never reaches a server; the extension in that editor window reads it back and connects to the plugin over another private socket. Files open in that window only, even when several pages show the same folder.
46
+
47
+ ## Security
48
+
49
+ code-server runs as you, and so do its terminal and extensions, outside DSH's sandbox and approvals. Because it shares DSH's origin, code running in code-server, including extensions and their webviews, can also use DSH with your session. Install only extensions you trust. See also [SECURITY.md](../../SECURITY.md).
50
+
51
+ ## Manual checks
52
+
53
+ These need a browser and a real code-server, so they are not part of `pnpm check`. Run them with `pnpm dev` before a release. Under `pnpm dev`, [dev.patch.yml](dev.patch.yml) keeps code-server's settings and extensions in `.dsh/code-server/`, apart from your own code-server. Changes to the host and the page reload while `pnpm dev` runs; a change under `src/extension/` takes effect only after restarting `pnpm dev`, because code-server installs the extension when it starts.
54
+
55
+ 1. **Code** shows the editor with nothing above it, and the editor's status bar shows **DSH** as connected, also in Restricted Mode. After the connection ends, the editor stays and a line above it offers **Reconnect**.
56
+ 2. A text file chosen in **Workspace files** opens in the Code page at its line; an image keeps DSH's viewer.
57
+ 3. Without signing in, `/code-server/` and `POST /api/langify-code-server/create` answer 401, and a WebSocket upgrade from another origin answers 403.
58
+ 4. After the session's working folder changes, the editor offers to reopen; with an unsaved file it asks to save first, then the page reloads the editor on the new folder.
59
+ 5. Closing the Code tab closes its binding; stopping DSH stops code-server and removes its sockets.
60
+
61
+ ## Known limitations
62
+
63
+ - DSH has no hook before a file tab opens, so a file tab appears briefly before the Code page takes over.
64
+ - Finding the binding relies on code-server keeping the page's URL fragment when it answers `vscode.env.asExternalUri`. That is code-server's behavior, not a documented promise; check it again after updating code-server.
package/README.zh.md ADDED
@@ -0,0 +1,64 @@
1
+ # @langify-org/dsh-code-server
2
+
3
+ [English](README.md) | [日本語](README.ja.md) | 中文
4
+
5
+ 在 DeepSeek Harness 的右侧边栏中,用 [code-server](https://github.com/coder/code-server) 编辑会话的工作文件夹。DSH 中指向文本文件的链接会在该编辑器中的对应行打开。
6
+
7
+ ## 要求
8
+
9
+ - DSH `>=0.2.1-rc.3 <0.3.0-0`,运行于 Linux 或 macOS。
10
+ - 另行安装的 code-server,已在 4.143 上验证。插件负责启动和停止它,无需你自己运行。
11
+ - 会话的文件必须位于运行 DSH 的机器上。位于其他文件系统(例如沙箱)上的会话会被拒绝。
12
+
13
+ ## 安装
14
+
15
+ ```sh
16
+ dsh plugin --profile <profile> add @langify-org/dsh-code-server
17
+ ```
18
+
19
+ 在 DSH Web 或 Desktop 中,也可以在 **Plugins** 页面添加。
20
+
21
+ ## 使用
22
+
23
+ 打开右侧边栏,添加标签页并选择 **Code**,即可打开会话的工作文件夹。首次启动 code-server 需要几秒钟。在 DSH 的其他位置(例如 **Workspace files** 或对话中的链接)选择文本文件时,它会显示在 Code 页面中。图片、PDF 等文件仍使用 DSH 自带的查看器。
24
+
25
+ - 编辑器已连接时,相关提示都显示在编辑器中。状态栏会显示表示连接状态的 **DSH**,点击即可选择**重新连接**或查看连接日志。无法打开的文件也会在编辑器中提示;会话的工作文件夹变化时,会弹出通知询问是否在新文件夹中重新打开编辑器。
26
+ - 从编辑器重新连接时,如有未保存的更改,会先要求保存,然后重新加载编辑器。重新连接前选择的文件不会重新打开。
27
+ - 只有在编辑器无法提示时,页面才会显示:code-server 启动中或启动失败,以及连接结束之后。连接结束后编辑器仍会保留,上方会提供**重新连接**;DSH 标签页的刷新命令也有同样的效果。
28
+ - 编辑器未能及时确认的打开请求会被报告为结果未知,并且不会重新发送,因为编辑器之后仍可能显示该文件。
29
+
30
+ ## 配置
31
+
32
+ | 设置 | 默认值 | 含义 |
33
+ | --------------- | ------------- | ------------------------------------------------------- |
34
+ | `command` | `code-server` | 可执行文件的名称或路径。 |
35
+ | `userDataDir` | 空 | code-server 的 `--user-data-dir`。为空时使用其默认值。 |
36
+ | `extensionsDir` | 空 | code-server 的 `--extensions-dir`。为空时使用其默认值。 |
37
+
38
+ 使用默认值时,编辑器会与你平时使用的 code-server 共享设置和扩展。请不要同时运行使用相同目录的另一个 code-server。
39
+
40
+ ## 工作原理
41
+
42
+ - 插件在需要时为 DSH 启动一个 code-server,监听只有你能打开的 Unix 套接字(位于 `0700` 目录中,权限为 `0600`),并关闭 code-server 自身的认证。它不会打开任何网络端口。
43
+ - DSH 在自己的源下通过 `/code-server` 提供 code-server。每个请求和 WebSocket 都会先经过 DSH 的认证和来源检查,因此只有能访问 DSH 的地方(例如通过 Tailscale)才能访问 code-server。
44
+ - 每次启动前,插件都会把内置的 VS Code 扩展 **DSH Code Bridge**(`langify-org.dsh-code-bridge`)安装到 code-server 中,替换旧版本。
45
+ - 每个 Code 页面都有自己的连接(binding)。页面把 binding 放在编辑器 URL 的片段中(这一部分不会发送到服务器),该编辑器窗口中的扩展读取它,并通过另一个私有套接字连接到插件。即使多个页面打开了同一个文件夹,文件也只会在对应的窗口中打开。
46
+
47
+ ## 安全
48
+
49
+ code-server 及其终端和扩展以你的身份运行,不受 DSH 沙箱和审批的约束。由于它与 DSH 同源,在 code-server 中运行的代码(包括扩展及其 webview)也能以你的会话使用 DSH。请只安装你信任的扩展。另请参阅 [SECURITY.zh.md](../../SECURITY.zh.md)。
50
+
51
+ ## 手动检查
52
+
53
+ 这些检查需要浏览器和真实的 code-server,因此不包含在 `pnpm check` 中。发布前请用 `pnpm dev` 进行检查。在 `pnpm dev` 下,[dev.patch.yml](dev.patch.yml) 会把 code-server 的设置和扩展放在 `.dsh/code-server/` 中,与你平时使用的 code-server 分开。Host 和页面的修改会在 `pnpm dev` 运行期间重新加载;而 `src/extension/` 下的修改要重启 `pnpm dev` 后才会生效,因为 code-server 只在启动时安装扩展。
54
+
55
+ 1. **Code** 只显示编辑器,上方没有其他内容;编辑器状态栏中的 **DSH** 显示为已连接(受限模式下也是如此)。连接结束后编辑器仍会保留,上方的一行会提供**重新连接**。
56
+ 2. 在 **Workspace files** 中选择的文本文件会在 Code 页面的对应行打开;图片仍使用 DSH 的查看器。
57
+ 3. 未登录时,`/code-server/` 和 `POST /api/langify-code-server/create` 返回 401,来自其他源的 WebSocket upgrade 返回 403。
58
+ 4. 会话的工作文件夹变化后,编辑器会询问是否重新打开;如有未保存的文件,会先要求保存,然后页面在新文件夹中重新打开编辑器。
59
+ 5. 关闭 Code 标签页会关闭其 binding;停止 DSH 会停止 code-server 并删除其套接字。
60
+
61
+ ## 已知限制
62
+
63
+ - DSH 没有在文件标签页打开之前进行拦截的机制,因此在切换到 Code 页面之前,文件标签页会短暂出现。
64
+ - 传递 binding 依赖于 code-server 在响应 `vscode.env.asExternalUri` 时保留页面 URL 的片段。这是 code-server 的行为,而不是有文档保证的承诺;更新 code-server 后请重新检查。
@@ -0,0 +1,4 @@
1
+ # Bundle layer: inserts the code-server plugin when a profile enables this package.
2
+ - insert:
3
+ - id: langify-code-server
4
+ name: '@langify-org/dsh-code-server'