mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: import new modules and refactor codegen script (#26838)
This commit is contained in:
@@ -35,6 +35,7 @@ type ModuleManifest struct {
|
||||
Tags []string `json:"tags"`
|
||||
CompatibleOS []string `json:"compatible_os"`
|
||||
ConflictsWith []string `json:"conflicts_with"`
|
||||
Namespace string `json:"namespace"`
|
||||
PinnedVersion string `json:"pinned_version"`
|
||||
Variables []ModuleVariable `json:"variables"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
module "antigravity" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "{{ .RegistryBase }}/coder/antigravity/coder"
|
||||
version = "{{ .PinnedVersion }}"
|
||||
agent_id = coder_agent.{{ .AgentResourceName }}.id
|
||||
folder = {{ .Variables.folder }}
|
||||
mcp = {{ .Variables.mcp }}
|
||||
open_recent = {{ .Variables.open_recent }}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"id": "antigravity",
|
||||
"display_name": "Antigravity",
|
||||
"description": "Add a one-click button to launch Google Antigravity",
|
||||
"icon": "/icon/antigravity.svg",
|
||||
"category": "AI Agent",
|
||||
"tags": [
|
||||
"ide",
|
||||
"antigravity",
|
||||
"ai",
|
||||
"google"
|
||||
],
|
||||
"compatible_os": [
|
||||
"linux"
|
||||
],
|
||||
"conflicts_with": [],
|
||||
"namespace": "coder",
|
||||
"pinned_version": "1.0.1",
|
||||
"variables": [
|
||||
{
|
||||
"name": "agent_id",
|
||||
"type": "string",
|
||||
"description": "The ID of a Coder agent.",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": true
|
||||
},
|
||||
{
|
||||
"name": "folder",
|
||||
"type": "string",
|
||||
"description": "The folder to open in Antigravity IDE.",
|
||||
"default": "",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "mcp",
|
||||
"type": "string",
|
||||
"description": "JSON-encoded string to configure MCP servers for Antigravity. When set, writes ~/.gemini/antigravity/mcp_config.json.",
|
||||
"default": "",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "open_recent",
|
||||
"type": "bool",
|
||||
"description": "Open the most recent workspace or folder. Falls back to the folder if there is no recent workspace or folder to open.",
|
||||
"default": false,
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
variable "openai_api_key" {
|
||||
description = "OpenAI API key for Codex CLI."
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
module "codex" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "{{ .RegistryBase }}/coder-labs/codex/coder"
|
||||
version = "{{ .PinnedVersion }}"
|
||||
agent_id = coder_agent.{{ .AgentResourceName }}.id
|
||||
base_config_toml = {{ .Variables.base_config_toml }}
|
||||
codex_version = {{ .Variables.codex_version }}
|
||||
enable_ai_gateway = {{ .Variables.enable_ai_gateway }}
|
||||
icon = {{ .Variables.icon }}
|
||||
install_codex = {{ .Variables.install_codex }}
|
||||
mcp = {{ .Variables.mcp }}
|
||||
model_reasoning_effort = {{ .Variables.model_reasoning_effort }}
|
||||
openai_api_key = var.openai_api_key
|
||||
post_install_script = {{ .Variables.post_install_script }}
|
||||
pre_install_script = {{ .Variables.pre_install_script }}
|
||||
workdir = {{ .Variables.workdir }}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"id": "codex",
|
||||
"display_name": "Codex CLI",
|
||||
"description": "Install and configure the Codex CLI in your workspace.",
|
||||
"icon": "/icon/openai.svg",
|
||||
"category": "AI Agent",
|
||||
"tags": [
|
||||
"agent",
|
||||
"codex",
|
||||
"ai",
|
||||
"openai",
|
||||
"ai-gateway"
|
||||
],
|
||||
"compatible_os": [
|
||||
"linux"
|
||||
],
|
||||
"conflicts_with": [],
|
||||
"namespace": "coder-labs",
|
||||
"pinned_version": "5.3.0",
|
||||
"variables": [
|
||||
{
|
||||
"name": "agent_id",
|
||||
"type": "string",
|
||||
"description": "The ID of a Coder agent.",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": true
|
||||
},
|
||||
{
|
||||
"name": "base_config_toml",
|
||||
"type": "string",
|
||||
"description": "Complete base TOML configuration for Codex (without mcp_servers section).\nWhen empty, the module generates a minimal default:\n\n preferred_auth_method = \"apikey\"\n # model_provider = \"aigateway\" (sets the default profile, when enable_ai_gateway = true)\n # model_reasoning_effort = \"\u003cvalue\u003e\" (sets the reasoning effort, when model_reasoning_effort is set)\n\n [projects.\"\u003cworkdir\u003e\"] (when workdir is set)\n trust_level = \"trusted\"\n\nWhen non-empty, the value is written verbatim as the base of config.toml;\nmcp and AI Gateway sections are still appended after it.\nNote: model_reasoning_effort and workdir trust are only applied in the\ndefault config. Include them in your custom config if needed.\n",
|
||||
"default": "",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "codex_version",
|
||||
"type": "string",
|
||||
"description": "The version of Codex to install.",
|
||||
"default": "latest",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "enable_ai_gateway",
|
||||
"type": "bool",
|
||||
"description": "Use AI Gateway for Codex. https://coder.com/docs/ai-coder/ai-gateway",
|
||||
"default": false,
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "icon",
|
||||
"type": "string",
|
||||
"description": "The icon to use for the app.",
|
||||
"default": "/icon/openai.svg",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "install_codex",
|
||||
"type": "bool",
|
||||
"description": "Whether to install Codex.",
|
||||
"default": true,
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "mcp",
|
||||
"type": "string",
|
||||
"description": "MCP server configurations in TOML format. When set, servers are appended to the Codex config.toml.",
|
||||
"default": "",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "model_reasoning_effort",
|
||||
"type": "string",
|
||||
"description": "The reasoning effort for the model. One of: none, minimal, low, medium, high, xhigh. See https://platform.openai.com/docs/guides/latest-model#lower-reasoning-effort",
|
||||
"default": "",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "openai_api_key",
|
||||
"type": "string",
|
||||
"description": "OpenAI API key for Codex CLI.",
|
||||
"default": "",
|
||||
"required": false,
|
||||
"sensitive": true,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "post_install_script",
|
||||
"type": "string",
|
||||
"description": "Custom script to run after installing Codex.",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "pre_install_script",
|
||||
"type": "string",
|
||||
"description": "Custom script to run before installing Codex.",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "workdir",
|
||||
"type": "string",
|
||||
"description": "Optional project directory. When set, the module pre-creates it if missing and adds it as a trusted project in Codex config.toml.",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
module "kasmvnc" {
|
||||
count = data.coder_workspace.me.start_count
|
||||
source = "{{ .RegistryBase }}/coder/kasmvnc/coder"
|
||||
version = "{{ .PinnedVersion }}"
|
||||
agent_id = coder_agent.{{ .AgentResourceName }}.id
|
||||
desktop_environment = {{ .Variables.desktop_environment }}
|
||||
kasm_version = {{ .Variables.kasm_version }}
|
||||
port = {{ .Variables.port }}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"id": "kasmvnc",
|
||||
"display_name": "KasmVNC",
|
||||
"description": "A modern open source VNC server",
|
||||
"icon": "/icon/kasmvnc.svg",
|
||||
"category": "Utility",
|
||||
"tags": [
|
||||
"vnc",
|
||||
"desktop",
|
||||
"kasmvnc"
|
||||
],
|
||||
"compatible_os": [
|
||||
"linux"
|
||||
],
|
||||
"conflicts_with": [],
|
||||
"namespace": "coder",
|
||||
"pinned_version": "1.3.0",
|
||||
"variables": [
|
||||
{
|
||||
"name": "agent_id",
|
||||
"type": "string",
|
||||
"description": "The ID of a Coder agent.",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": true
|
||||
},
|
||||
{
|
||||
"name": "desktop_environment",
|
||||
"type": "string",
|
||||
"description": "Specifies the desktop environment of the workspace. This should be pre-installed on the workspace.",
|
||||
"required": true,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "kasm_version",
|
||||
"type": "string",
|
||||
"description": "Version of KasmVNC to install.",
|
||||
"default": "1.4.0",
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
},
|
||||
{
|
||||
"name": "port",
|
||||
"type": "number",
|
||||
"description": "The port to run KasmVNC on.",
|
||||
"default": 6800,
|
||||
"required": false,
|
||||
"sensitive": false,
|
||||
"computed": false
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user