Skip to content

Commit fef659e

Browse files
committed
revert changes
1 parent aafc932 commit fef659e

File tree

3 files changed

+17
-58
lines changed

3 files changed

+17
-58
lines changed

registry/coder/modules/aider/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ module "aider" {
2828
## Usage Example
2929

3030
```tf
31+
data "coder_parameter" "ai_prompt" {
32+
name = "AI Prompt"
33+
description = "Write an initial prompt for Aider to work on."
34+
type = "string"
35+
default = ""
36+
mutable = true
37+
}
38+
3139
variable "gemini_api_key" {
3240
type = string
3341
description = "Gemini API key"
@@ -43,6 +51,7 @@ module "aider" {
4351
ai_provider = "google"
4452
model = "gemini"
4553
install_agentapi = true
54+
task_prompt = data.coder_parameter.ai_prompt.value
4655
system_prompt = "..."
4756
}
4857
```

registry/coder/modules/aider/main.tf

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -128,37 +128,28 @@ variable "custom_env_var_name" {
128128
default = ""
129129
}
130130

131-
variable "use_tasks" {
131+
variable "install_agentapi" {
132132
type = bool
133-
description = "the Use Task variable will provide agentapi + Task support"
133+
description = "Whether to install AgentAPI."
134134
default = true
135135
}
136136

137-
# variable "install_agentapi" {
138-
# type = bool
139-
# description = "Whether to install AgentAPI."
140-
# default = true
141-
# }
142-
143137
variable "agentapi_version" {
144138
type = string
145139
description = "The version of AgentAPI to install."
146140
default = "v0.6.3"
147141
}
148142

149-
data "coder_parameter" "ai_prompt" {
150-
name = "AI Prompt"
151-
description = "Write an initial prompt for Aider to work on."
152-
type = "string"
143+
variable "task_prompt" {
144+
type = string
145+
description = "Task prompt to use with Aider"
153146
default = ""
154-
mutable = true
155-
156147
}
157148

158149
resource "coder_env" "ai_prompt" {
159150
agent_id = var.agent_id
160151
name = "ARG_TASK_PROMPT"
161-
value = data.coder_parameter.ai_prompt.value
152+
value = var.task_prompt
162153
}
163154

164155
variable "base_aider_config" {
@@ -263,7 +254,7 @@ module "agentapi" {
263254
cli_app_slug = "${local.app_slug}-cli"
264255
cli_app_display_name = "Aider CLI"
265256
module_dir_name = local.module_dir_name
266-
install_agentapi = var.use_tasks ? true : false
257+
install_agentapi = var.install_agentapi
267258
agentapi_version = var.agentapi_version
268259
pre_install_script = var.experiment_pre_install_script
269260
post_install_script = var.experiment_post_install_script
@@ -299,44 +290,3 @@ module "agentapi" {
299290
EOT
300291
}
301292

302-
resource "coder_script" "aider" {
303-
agent_id = var.agent_id
304-
display_name = "Aider"
305-
icon = var.icon
306-
script = <<-EOT
307-
#!/bin/bash
308-
set -e
309-
function install_aider() {
310-
echo "pipx installing..."
311-
sudo apt-get install -y pipx
312-
echo "pipx installed!"
313-
pipx ensurepath
314-
mkdir -p "${var.folder}/.local/bin"
315-
export PATH="$HOME/.local/bin:${var.folder}/.local/bin:$PATH" # ensure in current shell too
316-
317-
if ! command_exists aider; then
318-
echo "Installing Aider via pipx..."
319-
pipx install --force aider-install
320-
aider-install
321-
fi
322-
echo "Aider installed: $(aider --version || echo 'check failed the Aider module insatllation failed')"
323-
}
324-
EOT
325-
run_on_start = true
326-
}
327-
328-
resource "coder_app" "aider_cli" {
329-
agent_id = var.agent_id
330-
slug = "aider"
331-
display_name = "Aider"
332-
icon = var.icon
333-
command = <<-EOT
334-
#!/bin/bash
335-
set -e
336-
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
337-
cd "${var.folder}"
338-
echo "Starting Aider directly..."
339-
export ${local.env_var_name}="${var.credentials}"
340-
aider ${local.model_flag} ${var.model}
341-
EOT
342-
}

registry/coder/modules/aider/scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function install_aider() {
1717
echo "pipx installed!"
1818
pipx ensurepath
1919
mkdir -p "$AIDER_START_DIRECTORY/.local/bin"
20-
export PATH="$HOME/.local/bin:$AIDER_START_DIRECTORY/.local/bin:$PATH" # ensure in current shell too
20+
export PATH="$HOME/.local/bin:$AIDER_START_DIRECTORY/.local/bin:$PATH"
2121

2222
if ! command_exists aider; then
2323
echo "Installing Aider via pipx..."

0 commit comments

Comments
 (0)