Skip to content

Commit 0021a9f

Browse files
authored
feat: update vscode-based desktop IDE modules to use vscode-desktop-core (#279)
1 parent 70ca76e commit 0021a9f

File tree

19 files changed

+268
-386
lines changed

19 files changed

+268
-386
lines changed

registry/coder/modules/cursor/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
1616
module "cursor" {
1717
count = data.coder_workspace.me.start_count
1818
source = "registry.coder.com/coder/cursor/coder"
19-
version = "1.3.3"
19+
version = "1.4.0"
2020
agent_id = coder_agent.main.id
2121
}
2222
```
@@ -29,7 +29,7 @@ module "cursor" {
2929
module "cursor" {
3030
count = data.coder_workspace.me.start_count
3131
source = "registry.coder.com/coder/cursor/coder"
32-
version = "1.3.3"
32+
version = "1.4.0"
3333
agent_id = coder_agent.main.id
3434
folder = "/home/coder/project"
3535
}
@@ -45,7 +45,7 @@ The following example configures Cursor to use the GitHub MCP server with authen
4545
module "cursor" {
4646
count = data.coder_workspace.me.start_count
4747
source = "registry.coder.com/coder/cursor/coder"
48-
version = "1.3.3"
48+
version = "1.4.0"
4949
agent_id = coder_agent.main.id
5050
folder = "/home/coder/project"
5151
mcp = jsonencode({
@@ -58,6 +58,7 @@ module "cursor" {
5858
"type" : "http"
5959
}
6060
61+
6162
}
6263
})
6364
}

registry/coder/modules/cursor/main.test.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ describe("cursor", async () => {
2626
);
2727

2828
const coder_app = state.resources.find(
29-
(res) => res.type === "coder_app" && res.name === "cursor",
29+
(res) =>
30+
res.type === "coder_app" &&
31+
res.module === "module.vscode-desktop-core" &&
32+
res.name === "vscode-desktop",
3033
);
3134

3235
expect(coder_app).not.toBeNull();
@@ -76,21 +79,6 @@ describe("cursor", async () => {
7679
);
7780
});
7881

79-
it("expect order to be set", async () => {
80-
const state = await runTerraformApply(import.meta.dir, {
81-
agent_id: "foo",
82-
order: "22",
83-
});
84-
85-
const coder_app = state.resources.find(
86-
(res) => res.type === "coder_app" && res.name === "cursor",
87-
);
88-
89-
expect(coder_app).not.toBeNull();
90-
expect(coder_app?.instances.length).toBe(1);
91-
expect(coder_app?.instances[0].attributes.order).toBe(22);
92-
});
93-
9482
it("writes ~/.cursor/mcp.json when mcp provided", async () => {
9583
const id = await runContainer("alpine");
9684
try {

registry/coder/modules/cursor/main.tf

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,21 @@ locals {
6464
mcp_b64 = var.mcp != "" ? base64encode(var.mcp) : ""
6565
}
6666

67-
resource "coder_app" "cursor" {
68-
agent_id = var.agent_id
69-
external = true
70-
icon = "/icon/cursor.svg"
71-
slug = var.slug
72-
display_name = var.display_name
73-
order = var.order
74-
group = var.group
75-
url = join("", [
76-
"cursor://coder.coder-remote/open",
77-
"?owner=",
78-
data.coder_workspace_owner.me.name,
79-
"&workspace=",
80-
data.coder_workspace.me.name,
81-
var.folder != "" ? join("", ["&folder=", var.folder]) : "",
82-
var.open_recent ? "&openRecent" : "",
83-
"&url=",
84-
data.coder_workspace.me.access_url,
85-
"&token=$SESSION_TOKEN",
86-
])
67+
module "vscode-desktop-core" {
68+
source = "registry.coder.com/coder/vscode-desktop-core/coder"
69+
version = "1.0.0"
70+
71+
agent_id = var.agent_id
72+
73+
coder_app_icon = "/icon/cursor.svg"
74+
coder_app_slug = var.slug
75+
coder_app_display_name = var.display_name
76+
coder_app_order = var.order
77+
coder_app_group = var.group
78+
79+
folder = var.folder
80+
open_recent = var.open_recent
81+
protocol = "cursor"
8782
}
8883

8984
resource "coder_script" "cursor_mcp" {
@@ -103,6 +98,6 @@ resource "coder_script" "cursor_mcp" {
10398
}
10499

105100
output "cursor_url" {
106-
value = coder_app.cursor.url
101+
value = module.vscode-desktop-core.ide_uri
107102
description = "Cursor IDE Desktop URL."
108-
}
103+
}

registry/coder/modules/kiro/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
1818
module "kiro" {
1919
count = data.coder_workspace.me.start_count
2020
source = "registry.coder.com/coder/kiro/coder"
21-
version = "1.1.1"
21+
version = "1.2.0"
2222
agent_id = coder_agent.main.id
2323
}
2424
```
@@ -31,7 +31,7 @@ module "kiro" {
3131
module "kiro" {
3232
count = data.coder_workspace.me.start_count
3333
source = "registry.coder.com/coder/kiro/coder"
34-
version = "1.1.1"
34+
version = "1.2.0"
3535
agent_id = coder_agent.main.id
3636
folder = "/home/coder/project"
3737
}
@@ -47,7 +47,7 @@ The following example configures Kiro to use the GitHub MCP server with authenti
4747
module "kiro" {
4848
count = data.coder_workspace.me.start_count
4949
source = "registry.coder.com/coder/kiro/coder"
50-
version = "1.1.1"
50+
version = "1.2.0"
5151
agent_id = coder_agent.main.id
5252
folder = "/home/coder/project"
5353
mcp = jsonencode({
@@ -60,6 +60,7 @@ module "kiro" {
6060
"type" : "http"
6161
}
6262
63+
6364
}
6465
})
6566
}

registry/coder/modules/kiro/kiro.tftest.hcl

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ run "default_output" {
1717
condition = output.kiro_url == "kiro://coder.coder-remote/open?owner=default&workspace=default&url=https://mydeployment.coder.com&token=$SESSION_TOKEN"
1818
error_message = "Default kiro_url must match expected value"
1919
}
20-
21-
assert {
22-
condition = coder_app.kiro.order == null
23-
error_message = "coder_app order must be null by default"
24-
}
2520
}
2621

2722
run "adds_folder" {
@@ -53,54 +48,6 @@ run "folder_and_open_recent" {
5348
}
5449
}
5550

56-
run "custom_slug_display_name" {
57-
command = plan
58-
59-
variables {
60-
agent_id = "foo"
61-
slug = "kiro-ai"
62-
display_name = "Kiro AI IDE"
63-
}
64-
65-
assert {
66-
condition = coder_app.kiro.slug == "kiro-ai"
67-
error_message = "coder_app slug must be set to kiro-ai"
68-
}
69-
70-
assert {
71-
condition = coder_app.kiro.display_name == "Kiro AI IDE"
72-
error_message = "coder_app display_name must be set to Kiro AI IDE"
73-
}
74-
}
75-
76-
run "sets_order" {
77-
command = plan
78-
79-
variables {
80-
agent_id = "foo"
81-
order = 5
82-
}
83-
84-
assert {
85-
condition = coder_app.kiro.order == 5
86-
error_message = "coder_app order must be set to 5"
87-
}
88-
}
89-
90-
run "sets_group" {
91-
command = plan
92-
93-
variables {
94-
agent_id = "foo"
95-
group = "AI IDEs"
96-
}
97-
98-
assert {
99-
condition = coder_app.kiro.group == "AI IDEs"
100-
error_message = "coder_app group must be set to AI IDEs"
101-
}
102-
}
103-
10451
run "writes_mcp_json" {
10552
command = plan
10653

registry/coder/modules/kiro/main.test.ts

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ describe("kiro", async () => {
2626
);
2727

2828
const coder_app = state.resources.find(
29-
(res) => res.type === "coder_app" && res.name === "kiro",
29+
(res) =>
30+
res.type === "coder_app" &&
31+
res.module === "module.vscode-desktop-core" &&
32+
res.name === "vscode-desktop",
3033
);
3134

3235
expect(coder_app).not.toBeNull();
@@ -55,47 +58,6 @@ describe("kiro", async () => {
5558
);
5659
});
5760

58-
it("custom slug and display_name", async () => {
59-
const state = await runTerraformApply(import.meta.dir, {
60-
agent_id: "foo",
61-
slug: "kiro-ai",
62-
display_name: "Kiro AI IDE",
63-
});
64-
65-
const coder_app = state.resources.find(
66-
(res) => res.type === "coder_app" && res.name === "kiro",
67-
);
68-
69-
expect(coder_app?.instances[0].attributes.slug).toBe("kiro-ai");
70-
expect(coder_app?.instances[0].attributes.display_name).toBe("Kiro AI IDE");
71-
});
72-
73-
it("sets order", async () => {
74-
const state = await runTerraformApply(import.meta.dir, {
75-
agent_id: "foo",
76-
order: "5",
77-
});
78-
79-
const coder_app = state.resources.find(
80-
(res) => res.type === "coder_app" && res.name === "kiro",
81-
);
82-
83-
expect(coder_app?.instances[0].attributes.order).toBe(5);
84-
});
85-
86-
it("sets group", async () => {
87-
const state = await runTerraformApply(import.meta.dir, {
88-
agent_id: "foo",
89-
group: "AI IDEs",
90-
});
91-
92-
const coder_app = state.resources.find(
93-
(res) => res.type === "coder_app" && res.name === "kiro",
94-
);
95-
96-
expect(coder_app?.instances[0].attributes.group).toBe("AI IDEs");
97-
});
98-
9961
it("writes ~/.kiro/settings/mcp.json when mcp provided", async () => {
10062
const id = await runContainer("alpine");
10163
try {

registry/coder/modules/kiro/main.tf

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ variable "group" {
3838
default = null
3939
}
4040

41-
variable "slug" {
42-
type = string
43-
description = "The slug of the app."
44-
default = "kiro"
45-
}
46-
47-
variable "display_name" {
48-
type = string
49-
description = "The display name of the app."
50-
default = "Kiro IDE"
51-
}
52-
5341
variable "mcp" {
5442
type = string
5543
description = "JSON-encoded string to configure MCP servers for Kiro. When set, writes ~/.kiro/settings/mcp.json."
@@ -63,26 +51,21 @@ locals {
6351
mcp_b64 = var.mcp != "" ? base64encode(var.mcp) : ""
6452
}
6553

66-
resource "coder_app" "kiro" {
67-
agent_id = var.agent_id
68-
external = true
69-
icon = "/icon/kiro.svg"
70-
slug = var.slug
71-
display_name = var.display_name
72-
order = var.order
73-
group = var.group
74-
url = join("", [
75-
"kiro://coder.coder-remote/open",
76-
"?owner=",
77-
data.coder_workspace_owner.me.name,
78-
"&workspace=",
79-
data.coder_workspace.me.name,
80-
var.folder != "" ? join("", ["&folder=", var.folder]) : "",
81-
var.open_recent ? "&openRecent" : "",
82-
"&url=",
83-
data.coder_workspace.me.access_url,
84-
"&token=$SESSION_TOKEN",
85-
])
54+
module "vscode-desktop-core" {
55+
source = "registry.coder.com/coder/vscode-desktop-core/coder"
56+
version = "1.0.0"
57+
58+
agent_id = var.agent_id
59+
60+
coder_app_icon = "/icon/kiro.svg"
61+
coder_app_slug = "kiro-ai"
62+
coder_app_display_name = "Kiro AI IDE"
63+
coder_app_order = var.order
64+
coder_app_group = var.group
65+
66+
folder = var.folder
67+
open_recent = var.open_recent
68+
protocol = "kiro"
8669
}
8770

8871
resource "coder_script" "kiro_mcp" {
@@ -102,6 +85,6 @@ resource "coder_script" "kiro_mcp" {
10285
}
10386

10487
output "kiro_url" {
105-
value = coder_app.kiro.url
88+
value = module.vscode-desktop-core.ide_uri
10689
description = "Kiro IDE URL."
107-
}
90+
}

registry/coder/modules/vscode-desktop-core/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
display_name: VSCode Desktop Core
2+
display_name: Coder VSCode Desktop Core
33
description: Building block for modules that need to link to an external VSCode-based IDE
44
icon: ../../../../.icons/coder.svg
55
verified: true
@@ -11,20 +11,20 @@ tags: [internal, library]
1111
> [!CAUTION]
1212
> We do not recommend using this module directly. Instead, please consider using one of our [Desktop IDE modules](https://registry.coder.com/modules?search=tag%3Aide).
1313
14-
The VSCode Desktop Core module is a building block for modules that need to expose access to VSCode-based IDEs. It is intended primarily to be used as a library to create modules for VSCode-based IDEs.
14+
The VSCode Desktop Core module is a building block for modules that need to expose access to VSCode-based IDEs. It is intended primarily for internal use by Coder to create modules for VSCode-based IDEs.
1515

1616
```tf
1717
module "vscode-desktop-core" {
1818
source = "registry.coder.com/coder/vscode-desktop-core/coder"
19-
version = "1.0.0"
19+
version = "1.0.1"
2020
2121
agent_id = var.agent_id
2222
23-
coder_app_icon = "/icon/code.svg"
24-
coder_app_slug = "vscode"
25-
coder_app_display_name = "VS Code Desktop"
26-
coder_app_order = var.order
27-
coder_app_group = var.group
23+
web_app_icon = "/icon/code.svg"
24+
web_app_slug = "vscode"
25+
web_app_display_name = "VS Code Desktop"
26+
web_app_order = var.order
27+
web_app_group = var.group
2828
2929
folder = var.folder
3030
open_recent = var.open_recent

0 commit comments

Comments
 (0)