Compare commits
5 Commits
main
...
35C4n0r/fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e343154999 | ||
|
|
f750e9f8c8 | ||
|
|
f88240f5d1 | ||
|
|
8499f9c313 | ||
|
|
9be5edb005 |
@ -43,7 +43,7 @@ variable "workdir" {
|
|||||||
|
|
||||||
variable "report_tasks" {
|
variable "report_tasks" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Whether to enable task reporting to Coder UI via AgentAPI"
|
description = "Whether to enable AgentAPI and task reporting to Coder"
|
||||||
default = true
|
default = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,13 +352,15 @@ locals {
|
|||||||
var.report_tasks ? format("\n%s\n", local.report_tasks_system_prompt) : "",
|
var.report_tasks ? format("\n%s\n", local.report_tasks_system_prompt) : "",
|
||||||
local.custom_system_prompt != "" ? format("\n%s\n", local.custom_system_prompt) : ""
|
local.custom_system_prompt != "" ? format("\n%s\n", local.custom_system_prompt) : ""
|
||||||
)
|
)
|
||||||
|
agent_name = "claude"
|
||||||
}
|
}
|
||||||
|
|
||||||
module "agentapi" {
|
module "agentapi" {
|
||||||
source = "registry.coder.com/coder/agentapi/coder"
|
source = "git::https://github.com/coder/registry.git//registry/coder/modules/agentapi?ref=35C4n0r/feat-agentapi-architecture-improv"
|
||||||
version = "2.0.0"
|
# version = "2.0.0"
|
||||||
|
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
|
enable_agentapi = var.report_tasks
|
||||||
web_app_slug = local.app_slug
|
web_app_slug = local.app_slug
|
||||||
web_app_order = var.order
|
web_app_order = var.order
|
||||||
web_app_group = var.group
|
web_app_group = var.group
|
||||||
@ -370,6 +372,7 @@ module "agentapi" {
|
|||||||
cli_app_display_name = var.cli_app ? var.cli_app_display_name : null
|
cli_app_display_name = var.cli_app ? var.cli_app_display_name : null
|
||||||
agentapi_subdomain = var.subdomain
|
agentapi_subdomain = var.subdomain
|
||||||
module_dir_name = local.module_dir_name
|
module_dir_name = local.module_dir_name
|
||||||
|
agent_name = local.agent_name
|
||||||
install_agentapi = var.install_agentapi
|
install_agentapi = var.install_agentapi
|
||||||
agentapi_version = var.agentapi_version
|
agentapi_version = var.agentapi_version
|
||||||
pre_install_script = var.pre_install_script
|
pre_install_script = var.pre_install_script
|
||||||
|
|||||||
@ -12,6 +12,7 @@ command_exists() {
|
|||||||
command -v "$1" > /dev/null 2>&1
|
command -v "$1" > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODULE_PATH="$HOME/.claude-module"
|
||||||
ARG_RESUME_SESSION_ID=${ARG_RESUME_SESSION_ID:-}
|
ARG_RESUME_SESSION_ID=${ARG_RESUME_SESSION_ID:-}
|
||||||
ARG_CONTINUE=${ARG_CONTINUE:-false}
|
ARG_CONTINUE=${ARG_CONTINUE:-false}
|
||||||
ARG_DANGEROUSLY_SKIP_PERMISSIONS=${ARG_DANGEROUSLY_SKIP_PERMISSIONS:-}
|
ARG_DANGEROUSLY_SKIP_PERMISSIONS=${ARG_DANGEROUSLY_SKIP_PERMISSIONS:-}
|
||||||
@ -244,12 +245,28 @@ function start_agentapi() {
|
|||||||
BOUNDARY_CMD=("$CODER_NO_CAPS" "boundary")
|
BOUNDARY_CMD=("$CODER_NO_CAPS" "boundary")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
agentapi server --type claude --term-width 67 --term-height 1190 -- \
|
# Build properly quoted command arguments
|
||||||
"${BOUNDARY_CMD[@]}" "${BOUNDARY_ARGS[@]}" -- \
|
boundary_cmd=$(printf '%q ' "${BOUNDARY_CMD[@]}" "${BOUNDARY_ARGS[@]}")
|
||||||
claude "${ARGS[@]}"
|
claude_args=$(printf '%q ' "${ARGS[@]}")
|
||||||
|
|
||||||
|
# Write command to agent-command.sh with boundary
|
||||||
|
cat > "$MODULE_PATH/agent-command.sh" << EOF
|
||||||
|
#!/bin/bash
|
||||||
|
${BOUNDARY_CMD[@]} -- claude ${ARGS[@]}
|
||||||
|
EOF
|
||||||
else
|
else
|
||||||
agentapi server --type claude --term-width 67 --term-height 1190 -- claude "${ARGS[@]}"
|
# Build properly quoted command arguments
|
||||||
|
claude_args=$(printf '%q ' "${ARGS[@]}")
|
||||||
|
|
||||||
|
# Write command to agent-command.sh without boundary
|
||||||
|
cat > "$MODULE_PATH/agent-command.sh" << EOF
|
||||||
|
#!/bin/bash
|
||||||
|
claude ${ARGS[@]}
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
chmod +x "$MODULE_PATH/agent-command.sh"
|
||||||
|
printf "Agent command written to %s\n" "$MODULE_PATH/agent-command.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_claude_installation
|
validate_claude_installation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user