@@ -36,21 +36,76 @@ variable "icon" {
3636 default = " /icon/aider.svg"
3737}
3838
39- variable "folder " {
39+ variable "workdir " {
4040 type = string
4141 description = " The folder to run Aider in."
4242 default = " /home/coder"
4343}
4444
45- variable "install_aider " {
45+ variable "report_tasks " {
4646 type = bool
47- description = " Whether to install Aider. "
47+ description = " Whether to enable task reporting to Coder UI via AgentAPI "
4848 default = true
4949}
5050
51- variable "experiment_report_tasks" {
51+ variable "cli_app" {
52+ type = bool
53+ description = " Whether to create a CLI app for Aider"
54+ default = false
55+ }
56+
57+ variable "web_app_display_name" {
58+ type = string
59+ description = " Display name for the web app"
60+ default = " Aider"
61+ }
62+
63+ variable "cli_app_display_name" {
64+ type = string
65+ description = " Display name for the CLI app"
66+ default = " Aider CLI"
67+ }
68+
69+ variable "pre_install_script" {
70+ type = string
71+ description = " Custom script to run before installing Aider."
72+ default = null
73+ }
74+
75+ variable "post_install_script" {
76+ type = string
77+ description = " Custom script to run after installing Aider."
78+ default = null
79+ }
80+
81+ variable "install_agentapi" {
82+ type = bool
83+ description = " Whether to install AgentAPI."
84+ default = true
85+ }
86+
87+ variable "agentapi_version" {
88+ type = string
89+ description = " The version of AgentAPI to install."
90+ default = " v0.6.3"
91+ }
92+
93+ variable "ai_prompt" {
94+ type = string
95+ description = " Initial task prompt for Claude Code."
96+ default = " "
97+ }
98+
99+ resource "coder_env" "ai_prompt" {
100+ agent_id = var. agent_id
101+ name = " ARG_AI_PROMPT"
102+ value = var. ai_prompt
103+ }
104+ # ---------------------------------------------
105+
106+ variable "install_aider" {
52107 type = bool
53- description = " Whether to enable task reporting ."
108+ description = " Whether to install Aider ."
54109 default = true
55110}
56111
@@ -76,24 +131,6 @@ variable "system_prompt" {
76131 EOT
77132}
78133
79- variable "aider_prompt" {
80- type = bool
81- description = " This prompt will be sent to Aider and should run only once, and AgentAPI will be disabled."
82- default = false
83- }
84-
85- variable "experiment_pre_install_script" {
86- type = string
87- description = " Custom script to run before installing Aider."
88- default = null
89- }
90-
91- variable "experiment_post_install_script" {
92- type = string
93- description = " Custom script to run after installing Aider."
94- default = null
95- }
96-
97134variable "experiment_additional_extensions" {
98135 type = string
99136 description = " Additional extensions configuration in YAML format to append to the config."
@@ -128,30 +165,6 @@ variable "custom_env_var_name" {
128165 default = " "
129166}
130167
131- variable "install_agentapi" {
132- type = bool
133- description = " Whether to install AgentAPI."
134- default = true
135- }
136-
137- variable "agentapi_version" {
138- type = string
139- description = " The version of AgentAPI to install."
140- default = " v0.6.3"
141- }
142-
143- variable "task_prompt" {
144- type = string
145- description = " Task prompt to use with Aider"
146- default = " "
147- }
148-
149- resource "coder_env" "ai_prompt" {
150- agent_id = var. agent_id
151- name = " ARG_TASK_PROMPT"
152- value = var. task_prompt
153- }
154-
155168variable "base_aider_config" {
156169 type = string
157170 description = <<- EOT
@@ -243,34 +256,34 @@ locals {
243256
244257module "agentapi" {
245258 source = " registry.coder.com/coder/agentapi/coder"
246- version = " 1.0 .1"
259+ version = " 1.1 .1"
247260
248261 agent_id = var. agent_id
249262 web_app_slug = local. app_slug
250263 web_app_order = var. order
251264 web_app_group = var. group
252265 web_app_icon = var. icon
253- web_app_display_name = " Aider"
254- cli_app_slug = " ${ local . app_slug } -cli"
255- cli_app_display_name = " Aider CLI"
266+ web_app_display_name = var. web_app_display_name
267+ cli_app = var. cli_app
268+ cli_app_slug = var. cli_app ? " ${ local . app_slug } -cli" : null
269+ cli_app_display_name = var. cli_app ? var. cli_app_display_name : null
256270 module_dir_name = local. module_dir_name
257271 install_agentapi = var. install_agentapi
258272 agentapi_version = var. agentapi_version
259- pre_install_script = var. experiment_pre_install_script
260- post_install_script = var. experiment_post_install_script
273+ pre_install_script = var. pre_install_script
274+ post_install_script = var. post_install_script
261275 start_script = <<- EOT
262276 #!/bin/bash
263277 set -o errexit
264278 set -o pipefail
265279
266280 echo -n '${ base64encode (local. start_script )} ' | base64 -d > /tmp/start.sh
267281 chmod +x /tmp/start.sh
268- AIDER_START_DIRECTORY='${ var . folder } ' \
269- ARG_API_KEY='${ var . credentials } ' \
282+ AIDER_START_DIRECTORY='${ var . workdir } ' \
283+ ARG_API_KEY='${ base64encode ( var. credentials ) } ' \
270284 ARG_MODEL='${ var . model } ' \
271285 ARG_PROVIDER='${ var . ai_provider } ' \
272286 ARG_ENV_API_NAME_HOLDER='${ local . env_var_name } ' \
273- AIDER_PROMPT='${ var . aider_prompt } ' \
274287 /tmp/start.sh
275288 EOT
276289
@@ -281,10 +294,10 @@ module "agentapi" {
281294
282295 echo -n '${ base64encode (local. install_script )} ' | base64 -d > /tmp/install.sh
283296 chmod +x /tmp/install.sh
284- AIDER_START_DIRECTORY='${ var . folder } ' \
297+ AIDER_START_DIRECTORY='${ var . workdir } ' \
285298 ARG_INSTALL_AIDER='${ var . install_aider } ' \
286299 AIDER_SYSTEM_PROMPT='${ var . system_prompt } ' \
287- ARG_IMPLEMENT_MCP ='${ var . experiment_report_tasks } ' \
300+ ARG_REPORT_TASKS ='${ var . report_tasks } ' \
288301 ARG_AIDER_CONFIG="$(echo -n '${ base64encode (trimspace (local. combined_extensions ))} ' | base64 -d)" \
289302 /tmp/install.sh
290303 EOT
0 commit comments