feat: add allow_all variable to enable all tools without prompting
This commit is contained in:
parent
45d3d8ee19
commit
b5e79685e6
@ -155,6 +155,12 @@ variable "cli_app_display_name" {
|
|||||||
default = "Copilot"
|
default = "Copilot"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "allow_all" {
|
||||||
|
type = bool
|
||||||
|
description = "Allow all tools without prompting (equivalent to --allow-all)."
|
||||||
|
default = true
|
||||||
|
}
|
||||||
|
|
||||||
variable "resume_session" {
|
variable "resume_session" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Whether to automatically resume the latest Copilot session on workspace restart."
|
description = "Whether to automatically resume the latest Copilot session on workspace restart."
|
||||||
@ -299,6 +305,7 @@ module "agentapi" {
|
|||||||
chmod +x /tmp/start.sh
|
chmod +x /tmp/start.sh
|
||||||
|
|
||||||
ARG_WORKDIR='${local.workdir}' \
|
ARG_WORKDIR='${local.workdir}' \
|
||||||
|
ARG_ALLOW_ALL='${var.allow_all}' \
|
||||||
ARG_AI_PROMPT='${base64encode(var.ai_prompt)}' \
|
ARG_AI_PROMPT='${base64encode(var.ai_prompt)}' \
|
||||||
ARG_SYSTEM_PROMPT='${base64encode(local.final_system_prompt)}' \
|
ARG_SYSTEM_PROMPT='${base64encode(local.final_system_prompt)}' \
|
||||||
ARG_COPILOT_MODEL='${var.copilot_model}' \
|
ARG_COPILOT_MODEL='${var.copilot_model}' \
|
||||||
|
|||||||
@ -13,6 +13,7 @@ command_exists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ARG_WORKDIR=${ARG_WORKDIR:-"$HOME"}
|
ARG_WORKDIR=${ARG_WORKDIR:-"$HOME"}
|
||||||
|
ARG_ALLOW_ALL=${ARG_ALLOW_ALL:-true}
|
||||||
ARG_AI_PROMPT=$(echo -n "${ARG_AI_PROMPT:-}" | base64 -d 2> /dev/null || echo "")
|
ARG_AI_PROMPT=$(echo -n "${ARG_AI_PROMPT:-}" | base64 -d 2> /dev/null || echo "")
|
||||||
ARG_SYSTEM_PROMPT=$(echo -n "${ARG_SYSTEM_PROMPT:-}" | base64 -d 2> /dev/null || echo "")
|
ARG_SYSTEM_PROMPT=$(echo -n "${ARG_SYSTEM_PROMPT:-}" | base64 -d 2> /dev/null || echo "")
|
||||||
ARG_COPILOT_MODEL=${ARG_COPILOT_MODEL:-}
|
ARG_COPILOT_MODEL=${ARG_COPILOT_MODEL:-}
|
||||||
@ -73,6 +74,10 @@ build_copilot_args() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$ARG_ALLOW_ALL" = "true" ]; then
|
||||||
|
COPILOT_ARGS+=(--allow-all)
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_existing_session() {
|
check_existing_session() {
|
||||||
@ -183,14 +188,9 @@ start_agentapi() {
|
|||||||
initial_prompt=$(build_initial_prompt)
|
initial_prompt=$(build_initial_prompt)
|
||||||
|
|
||||||
if [ -n "$initial_prompt" ]; then
|
if [ -n "$initial_prompt" ]; then
|
||||||
echo "Using initial prompt with system context"
|
COPILOT_ARGS+=(-i "$initial_prompt")
|
||||||
if [ ${#COPILOT_ARGS[@]} -gt 0 ]; then
|
|
||||||
echo "Copilot arguments: ${COPILOT_ARGS[*]}"
|
|
||||||
agentapi server -I="$initial_prompt" --type copilot --term-width 67 --term-height 1190 -- copilot "${COPILOT_ARGS[@]}"
|
|
||||||
else
|
|
||||||
agentapi server -I="$initial_prompt" --type copilot --term-width 67 --term-height 1190 -- copilot
|
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
if [ ${#COPILOT_ARGS[@]} -gt 0 ]; then
|
if [ ${#COPILOT_ARGS[@]} -gt 0 ]; then
|
||||||
echo "Copilot arguments: ${COPILOT_ARGS[*]}"
|
echo "Copilot arguments: ${COPILOT_ARGS[*]}"
|
||||||
agentapi server --type copilot --term-width 67 --term-height 1190 -- copilot "${COPILOT_ARGS[@]}"
|
agentapi server --type copilot --term-width 67 --term-height 1190 -- copilot "${COPILOT_ARGS[@]}"
|
||||||
@ -198,7 +198,6 @@ start_agentapi() {
|
|||||||
agentapi server --type copilot --term-width 67 --term-height 1190 -- copilot
|
agentapi server --type copilot --term-width 67 --term-height 1190 -- copilot
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_github_authentication
|
setup_github_authentication
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user