@@ -36,21 +36,76 @@ variable "icon" {
36
36
default = " /icon/aider.svg"
37
37
}
38
38
39
- variable "folder " {
39
+ variable "workdir " {
40
40
type = string
41
41
description = " The folder to run Aider in."
42
42
default = " /home/coder"
43
43
}
44
44
45
- variable "install_aider " {
45
+ variable "report_tasks " {
46
46
type = bool
47
- description = " Whether to install Aider. "
47
+ description = " Whether to enable task reporting to Coder UI via AgentAPI "
48
48
default = true
49
49
}
50
50
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" {
52
107
type = bool
53
- description = " Whether to enable task reporting ."
108
+ description = " Whether to install Aider ."
54
109
default = true
55
110
}
56
111
@@ -76,24 +131,6 @@ variable "system_prompt" {
76
131
EOT
77
132
}
78
133
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
-
97
134
variable "experiment_additional_extensions" {
98
135
type = string
99
136
description = " Additional extensions configuration in YAML format to append to the config."
@@ -128,30 +165,6 @@ variable "custom_env_var_name" {
128
165
default = " "
129
166
}
130
167
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
-
155
168
variable "base_aider_config" {
156
169
type = string
157
170
description = <<- EOT
@@ -243,34 +256,34 @@ locals {
243
256
244
257
module "agentapi" {
245
258
source = " registry.coder.com/coder/agentapi/coder"
246
- version = " 1.0 .1"
259
+ version = " 1.1 .1"
247
260
248
261
agent_id = var. agent_id
249
262
web_app_slug = local. app_slug
250
263
web_app_order = var. order
251
264
web_app_group = var. group
252
265
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
256
270
module_dir_name = local. module_dir_name
257
271
install_agentapi = var. install_agentapi
258
272
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
261
275
start_script = <<- EOT
262
276
#!/bin/bash
263
277
set -o errexit
264
278
set -o pipefail
265
279
266
280
echo -n '${ base64encode (local. start_script )} ' | base64 -d > /tmp/start.sh
267
281
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 ) } ' \
270
284
ARG_MODEL='${ var . model } ' \
271
285
ARG_PROVIDER='${ var . ai_provider } ' \
272
286
ARG_ENV_API_NAME_HOLDER='${ local . env_var_name } ' \
273
- AIDER_PROMPT='${ var . aider_prompt } ' \
274
287
/tmp/start.sh
275
288
EOT
276
289
@@ -281,10 +294,10 @@ module "agentapi" {
281
294
282
295
echo -n '${ base64encode (local. install_script )} ' | base64 -d > /tmp/install.sh
283
296
chmod +x /tmp/install.sh
284
- AIDER_START_DIRECTORY='${ var . folder } ' \
297
+ AIDER_START_DIRECTORY='${ var . workdir } ' \
285
298
ARG_INSTALL_AIDER='${ var . install_aider } ' \
286
299
AIDER_SYSTEM_PROMPT='${ var . system_prompt } ' \
287
- ARG_IMPLEMENT_MCP ='${ var . experiment_report_tasks } ' \
300
+ ARG_REPORT_TASKS ='${ var . report_tasks } ' \
288
301
ARG_AIDER_CONFIG="$(echo -n '${ base64encode (trimspace (local. combined_extensions ))} ' | base64 -d)" \
289
302
/tmp/install.sh
290
303
EOT
0 commit comments