aboutsummaryrefslogtreecommitdiffstats
path: root/Argcfile.sh
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-12-11 20:46:17 +0800
committerGitHub <noreply@github.com>2024-12-11 20:46:17 +0800
commit20d1ec47f9970caa119c3715a1c0c7a69e5aa65f (patch)
tree76b0d3585a40ce2b269fa50b54786aa865641920 /Argcfile.sh
parentc58abcbaf89f27e5e3806f4309880a1eac2b7095 (diff)
downloadllm-functions-docker-20d1ec47f9970caa119c3715a1c0c7a69e5aa65f.tar.gz
feat: support MCP bridge (#140)
Diffstat (limited to 'Argcfile.sh')
-rw-r--r--Argcfile.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/Argcfile.sh b/Argcfile.sh
index 4c0747d..7c1e859 100644
--- a/Argcfile.sh
+++ b/Argcfile.sh
@@ -2,7 +2,7 @@
set -e
BIN_DIR=bin
-TMP_DIR="cache/tmp"
+TMP_DIR="cache/__tmp__"
VENV_DIR=".venv"
LANG_CMDS=( \
@@ -421,9 +421,8 @@ test-demo@tool() {
# @cmd Test agents
# @alias agent:test
test@agent() {
- tmp_dir="cache/tmp"
- mkdir -p "$tmp_dir"
- names_file="$tmp_dir/agents.txt"
+ mkdir -p "$TMP_DIR"
+ names_file="$TMP_DIR/agents.txt"
argc list@agent > "$names_file"
argc build@agent --names-file "$names_file"
test-demo@agent
@@ -499,6 +498,12 @@ install() {
fi
}
+# @cmd Run mcp command
+# @arg args~[?`_choice_mcp_args`] The mcp command and arguments
+mcp() {
+ bash ./scripts/mcp.sh "$@"
+}
+
# @cmd Create a boilplate tool script
# @alias tool:create
# @arg args~
@@ -671,6 +676,16 @@ _choice_agent_action() {
argc generate-declarations@agent "$1" --oneline | sed "$expr"
}
+_choice_mcp_args() {
+ if [[ "$ARGC_COMPGEN" -eq 1 ]]; then
+ args=( "${argc__positionals[@]}" )
+ args[-1]="$ARGC_LAST_ARG"
+ argc --argc-compgen generic scripts/mcp.sh mcp "${args[@]}"
+ else
+ :;
+ fi
+}
+
_die() {
echo "$*" >&2
exit 1