@ycodium-ai/plugin-browser-workbench 0.2.3710 → 0.2.3799
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/dist/index.js +19 -1
- package/locales/en.json +7 -1
- package/locales/zh-CN.json +7 -1
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -1109,6 +1109,11 @@ var WorkbenchRuntime = class {
|
|
|
1109
1109
|
});
|
|
1110
1110
|
throw new WorkbenchFailure(kind, failureMessage(kind));
|
|
1111
1111
|
}
|
|
1112
|
+
/** 设置里的端口留空时会接哪个:上次用 attach 命令登记的端口;没有就是 `null`(改用 VS Code CLI)。 */
|
|
1113
|
+
async attachedPortWithoutSetting() {
|
|
1114
|
+
const file = await readConfigFile(this.paths);
|
|
1115
|
+
return parsePort(file?.attachPort);
|
|
1116
|
+
}
|
|
1112
1117
|
async desiredExternalPort() {
|
|
1113
1118
|
const fromSettings = parsePort(this.ctx.config.attachPort);
|
|
1114
1119
|
if (fromSettings !== null) return fromSettings;
|
|
@@ -1608,7 +1613,7 @@ var progressItemSchema = {
|
|
|
1608
1613
|
// src/index.ts
|
|
1609
1614
|
var index_default = definePlugin({
|
|
1610
1615
|
id: "browser-workbench",
|
|
1611
|
-
apiVersion:
|
|
1616
|
+
apiVersion: 60,
|
|
1612
1617
|
activate: (ctx) => {
|
|
1613
1618
|
const runtime = new WorkbenchRuntime(ctx);
|
|
1614
1619
|
void runtime.start().catch((error) => {
|
|
@@ -1700,9 +1705,22 @@ var index_default = definePlugin({
|
|
|
1700
1705
|
resultSchema: emptyResultSchema,
|
|
1701
1706
|
handle: () => runtime.detach()
|
|
1702
1707
|
});
|
|
1708
|
+
ctx.command({
|
|
1709
|
+
name: "effectiveSettings",
|
|
1710
|
+
description: "Settings card: what the workbench attaches to when the port is empty.",
|
|
1711
|
+
scope: "read",
|
|
1712
|
+
payloadSchema: emptyPayloadSchema,
|
|
1713
|
+
handle: async () => {
|
|
1714
|
+
const port = await runtime.attachedPortWithoutSetting();
|
|
1715
|
+
return {
|
|
1716
|
+
attachPort: port === null ? { detailKey: "settings.attachPort.cli" } : { value: String(port), detailKey: "settings.attachPort.attached" }
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
});
|
|
1703
1720
|
ctx.settingsCard({
|
|
1704
1721
|
titleKey: "settings.card.title",
|
|
1705
1722
|
descriptionKey: "settings.card.description",
|
|
1723
|
+
effectiveCommand: "effectiveSettings",
|
|
1706
1724
|
fields: [
|
|
1707
1725
|
{
|
|
1708
1726
|
key: "attachPort",
|
package/locales/en.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"presentation": {
|
|
3
|
+
"name": "Browser VS Code",
|
|
4
|
+
"description": "Open a VS Code workbench in the browser on this machine."
|
|
5
|
+
},
|
|
2
6
|
"settings": {
|
|
3
7
|
"card": {
|
|
4
8
|
"title": "External workbench",
|
|
@@ -6,7 +10,9 @@
|
|
|
6
10
|
},
|
|
7
11
|
"attachPort": {
|
|
8
12
|
"label": "code-server port",
|
|
9
|
-
"description": "Loopback port of a code-server already listening on this machine. Leave empty to use the official VS Code CLI
|
|
13
|
+
"description": "Loopback port of a code-server already listening on this machine. Leave empty to use the port registered by the last attach, or else the official VS Code CLI.",
|
|
14
|
+
"cli": "Official VS Code CLI",
|
|
15
|
+
"attached": "registered by the last attach"
|
|
10
16
|
}
|
|
11
17
|
},
|
|
12
18
|
"failure": {
|
package/locales/zh-CN.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"presentation": {
|
|
3
|
+
"name": "浏览器 VS Code",
|
|
4
|
+
"description": "在这台机器的浏览器里打开 VS Code。"
|
|
5
|
+
},
|
|
2
6
|
"settings": {
|
|
3
7
|
"card": {
|
|
4
8
|
"title": "外部工作台",
|
|
@@ -6,7 +10,9 @@
|
|
|
6
10
|
},
|
|
7
11
|
"attachPort": {
|
|
8
12
|
"label": "code-server 端口",
|
|
9
|
-
"description": "此机器上已在监听的 code-server
|
|
13
|
+
"description": "此机器上已在监听的 code-server 回环端口。留空则用上次登记的端口,没有就改用官方 VS Code CLI。",
|
|
14
|
+
"cli": "官方 VS Code CLI",
|
|
15
|
+
"attached": "上次登记的端口"
|
|
10
16
|
}
|
|
11
17
|
},
|
|
12
18
|
"failure": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-browser-workbench",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3799",
|
|
4
4
|
"description": "Installs the official VS Code CLI on this machine and opens it in a system browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser-workbench",
|
|
@@ -24,12 +24,14 @@
|
|
|
24
24
|
"esbuild": "0.28.1",
|
|
25
25
|
"typescript": "~6.0.3",
|
|
26
26
|
"vite-plus": "0.2.2",
|
|
27
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
27
|
+
"@ycodium-ai/plugin-api": "0.2.3799"
|
|
28
28
|
},
|
|
29
29
|
"ycodium": {
|
|
30
30
|
"plugin": "./dist/index.js",
|
|
31
31
|
"displayName": "Browser VS Code",
|
|
32
|
-
"
|
|
32
|
+
"displayNameKey": "presentation.name",
|
|
33
|
+
"description": "Open a VS Code workbench in the browser on this machine.",
|
|
34
|
+
"descriptionKey": "presentation.description",
|
|
33
35
|
"icon": "./assets/icon.svg",
|
|
34
36
|
"permissions": [
|
|
35
37
|
{
|