@langify-org/dsh-code-server 0.2.1 → 0.2.2
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.ja.md +1 -1
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/dist/index.mjs +34 -8
- package/extension/dsh-code-bridge.vsix +0 -0
- package/package.json +2 -2
package/README.ja.md
CHANGED
|
@@ -52,7 +52,7 @@ code-server とそのターミナル・拡張は、あなたの権限で、DSH
|
|
|
52
52
|
|
|
53
53
|
## 手動確認
|
|
54
54
|
|
|
55
|
-
ブラウザーと実際の 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/`
|
|
55
|
+
ブラウザーと実際の 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/` の変更は、プラグインが次に開くエディターの画面から反映されるので、Code タブで**再接続**を押してください。
|
|
56
56
|
|
|
57
57
|
1. **Code** にはエディターだけが表示され、上に何も出ない。エディターのステータスバーの **DSH** が接続済みになる(Restricted Mode でも)。接続が終わった後もエディターは残り、上の行に**再接続**が出る。
|
|
58
58
|
2. **Workspace files** で選んだテキストファイルが Code ページの該当行で開く。画像は DSH のビューアーのまま開く。
|
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ code-server runs as you, and so do its terminal and extensions, outside DSH's sa
|
|
|
52
52
|
|
|
53
53
|
## Manual checks
|
|
54
54
|
|
|
55
|
-
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/`
|
|
55
|
+
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/` reaches the next editor window the plugin opens, so press **Reconnect** in the Code tab.
|
|
56
56
|
|
|
57
57
|
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**.
|
|
58
58
|
2. A text file chosen in **Workspace files** opens in the Code page at its line; an image keeps DSH's viewer.
|
package/README.zh.md
CHANGED
|
@@ -52,7 +52,7 @@ code-server 及其终端和扩展以你的身份运行,不受 DSH 沙箱和审
|
|
|
52
52
|
|
|
53
53
|
## 手动检查
|
|
54
54
|
|
|
55
|
-
这些检查需要浏览器和真实的 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/`
|
|
55
|
+
这些检查需要浏览器和真实的 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/` 下的修改会在插件打开的下一个编辑器窗口中生效,因此请在 Code 标签页中点击**重新连接**。
|
|
56
56
|
|
|
57
57
|
1. **Code** 只显示编辑器,上方没有其他内容;编辑器状态栏中的 **DSH** 显示为已连接(受限模式下也是如此)。连接结束后编辑器仍会保留,上方的一行会提供**重新连接**。
|
|
58
58
|
2. 在 **Workspace files** 中选择的文本文件会在 Code 页面的对应行打开;图片仍使用 DSH 的查看器。
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chmod, mkdtemp, realpath, rm } from "node:fs/promises";
|
|
1
|
+
import { chmod, mkdtemp, realpath, rm, stat } from "node:fs/promises";
|
|
2
2
|
import { homedir, tmpdir } from "node:os";
|
|
3
3
|
import { isAbsolute, join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -472,6 +472,11 @@ var CodeServer = class {
|
|
|
472
472
|
#starting;
|
|
473
473
|
#child;
|
|
474
474
|
#disposed = false;
|
|
475
|
+
/** The CLI with its directories, once resolved, to install the extension with. */
|
|
476
|
+
#cli;
|
|
477
|
+
/** The installed VSIX's modification time and size. */
|
|
478
|
+
#installed = "";
|
|
479
|
+
#installing = Promise.resolve();
|
|
475
480
|
/**
|
|
476
481
|
* @param extension - VSIX installed before every start.
|
|
477
482
|
* @param onStarted - called once per process; its disposer runs when the process exits.
|
|
@@ -491,6 +496,18 @@ var CodeServer = class {
|
|
|
491
496
|
});
|
|
492
497
|
return this.#starting;
|
|
493
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* Install the bundled extension again if its VSIX changed since it was
|
|
501
|
+
* installed, so that windows opened from now on run it. Only a linked
|
|
502
|
+
* development copy of the plugin changes while it runs.
|
|
503
|
+
*/
|
|
504
|
+
syncExtension() {
|
|
505
|
+
const installing = this.#installing.then(async () => {
|
|
506
|
+
if (this.#cli !== void 0) await this.#installExtension(this.#cli);
|
|
507
|
+
});
|
|
508
|
+
this.#installing = installing.catch(() => {});
|
|
509
|
+
return installing;
|
|
510
|
+
}
|
|
494
511
|
async dispose() {
|
|
495
512
|
this.#disposed = true;
|
|
496
513
|
const child = this.#child;
|
|
@@ -507,16 +524,12 @@ var CodeServer = class {
|
|
|
507
524
|
throw new CodeServerError("code_server_not_found", `Cannot find ${this.#options.command}`, { cause: error });
|
|
508
525
|
}
|
|
509
526
|
const directories = [...this.#options.userDataDir === void 0 ? [] : ["--user-data-dir", this.#options.userDataDir], ...this.#options.extensionsDir === void 0 ? [] : ["--extensions-dir", this.#options.extensionsDir]];
|
|
527
|
+
this.#cli = [command, ...directories];
|
|
510
528
|
const version = await this.#run([command, "--version"]);
|
|
511
529
|
const commit = /^\S+ ([0-9a-f]{40}) /.exec(version)?.[1];
|
|
512
530
|
if (commit === void 0) throw new CodeServerError("code_server_failed", `Unrecognized code-server version: ${version}`);
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
...directories,
|
|
516
|
-
"--install-extension",
|
|
517
|
-
this.#extension,
|
|
518
|
-
"--force"
|
|
519
|
-
]);
|
|
531
|
+
this.#installed = "";
|
|
532
|
+
await this.syncExtension();
|
|
520
533
|
await rm(this.#socketPath, { force: true });
|
|
521
534
|
if (this.#disposed) throw new CodeServerError("code_server_failed", "The plugin has stopped");
|
|
522
535
|
const child = this.#subprocess.spawn({
|
|
@@ -558,6 +571,18 @@ var CodeServer = class {
|
|
|
558
571
|
await waitUntilListening(this.#socketPath, child);
|
|
559
572
|
return running;
|
|
560
573
|
}
|
|
574
|
+
async #installExtension(cli) {
|
|
575
|
+
const { mtimeMs, size } = await stat(this.#extension);
|
|
576
|
+
const stamp = `${mtimeMs}:${size}`;
|
|
577
|
+
if (stamp === this.#installed) return;
|
|
578
|
+
await this.#run([
|
|
579
|
+
...cli,
|
|
580
|
+
"--install-extension",
|
|
581
|
+
this.#extension,
|
|
582
|
+
"--force"
|
|
583
|
+
]);
|
|
584
|
+
this.#installed = stamp;
|
|
585
|
+
}
|
|
561
586
|
/** Run a short code-server CLI command and return its stdout. */
|
|
562
587
|
async #run(argv) {
|
|
563
588
|
const child = this.#subprocess.spawn({
|
|
@@ -615,6 +640,7 @@ function rpcRoutes(services, bridge, codeServer, editors) {
|
|
|
615
640
|
const { cwd } = await sessionFolders(services, sessionId, signal);
|
|
616
641
|
const folder = await localPath(services, cwd, cwd, "directory", signal);
|
|
617
642
|
await codeServer.ensure();
|
|
643
|
+
await codeServer.syncExtension();
|
|
618
644
|
const base = await editors[ingress]();
|
|
619
645
|
signal.throwIfAborted();
|
|
620
646
|
const bindingId = bridge.create(sessionId, ownerId, folder);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langify-org/dsh-code-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Edit the session's working folder in code-server inside DeepSeek Harness, served through DSH's authenticated web server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"code-server",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
|
-
"build": "tsdown
|
|
86
|
+
"build": "tsdown",
|
|
87
87
|
"typecheck": "tsc -p src/client"
|
|
88
88
|
}
|
|
89
89
|
}
|