mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 16:25:13 +08:00
🎄 Sync 2026-08-30 03:21:07
This commit is contained in:
1 parent
eea38c835c
commit
5093acfe28
30 files changed
+647
-93
No files matched your search
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# Copyright (C) 2026 jjm2473@gmail.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
AGENTFLOW_ARCH_x86_64:=amd64
|
||||
AGENTFLOW_ARCH_aarch64:=arm64
|
||||
AGENTFLOW_ARCH:=$(AGENTFLOW_ARCH_$(ARCH))
|
||||
|
||||
AGENTFLOW_HASH_x86_64:=8ba4f42dc45a38ee54d9716cbe39201bb3d9e947c4a6075d9d7af999ab5d098e
|
||||
AGENTFLOW_HASH_aarch64:=beb19ca378ea1f15a90a907c4de3244353188cf01287b85bfea68b80b1ed8925
|
||||
|
||||
PKG_NAME:=agentflow
|
||||
PKG_VERSION:=0.3.0-20260824-c588d794
|
||||
PKG_RELEASE:=1
|
||||
|
||||
AGENTFLOW_SOURCE:=agentflow-linux-$(AGENTFLOW_ARCH)
|
||||
AGENTFLOW_DOWNLOAD:=$(PKG_NAME)-$(PKG_VERSION)-linux-$(AGENTFLOW_ARCH)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
STRIP:=true
|
||||
RSTRIP:=:
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Download/agentflow
|
||||
URL:=https://fw.koolcenter.com/binary/geili/agentflow/build/
|
||||
URL_FILE:=$(AGENTFLOW_SOURCE)
|
||||
FILE:=$(AGENTFLOW_DOWNLOAD)
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=AgentFlow
|
||||
DEPENDS:=@(x86_64||aarch64) +git +mise
|
||||
URL:=https://agentflow.geili.ai/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
AgentFlow provides a Web UI for orchestrating coding agents and workflows.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/agentflow
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(INSTALL_DIR) $(PKG_BUILD_DIR)
|
||||
$(CP) $(DL_DIR)/$(AGENTFLOW_DOWNLOAD) $(PKG_BUILD_DIR)/agentflow
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/agentflow $(1)/usr/bin/agentflow
|
||||
$(INSTALL_BIN) ./files/agentflow.init $(1)/etc/init.d/agentflow
|
||||
$(INSTALL_BIN) ./files/agentflow.uci-default $(1)/etc/uci-defaults/09-agentflow
|
||||
$(INSTALL_CONF) ./files/agentflow.config $(1)/etc/config/agentflow
|
||||
endef
|
||||
|
||||
$(eval $(call Download,agentflow))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,5 @@
|
||||
config agentflow
|
||||
option enabled '0'
|
||||
option data_dir ''
|
||||
option host '0.0.0.0'
|
||||
option port '9000'
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=93
|
||||
USE_PROCD=1
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled "$1" enabled 0
|
||||
config_get data_dir "$1" data_dir ""
|
||||
config_get host "$1" host "0.0.0.0"
|
||||
config_get port "$1" port "9000"
|
||||
}
|
||||
|
||||
set_mise_env() {
|
||||
procd_set_param env \
|
||||
"$@" \
|
||||
MISE_INSTALLS_DIR="$data_dir/globalmise/mise-installs" \
|
||||
MISE_DATA_DIR="$data_dir/globalmise/mise-data" \
|
||||
MISE_CACHE_DIR="$data_dir/globalmise/mise-cache" \
|
||||
MISE_STATE_DIR="$data_dir/globalmise/mise-state" \
|
||||
NPM_CONFIG_CACHE="$data_dir/globalmise/npm-cache" \
|
||||
NPM_CONFIG_USERCONFIG="$data_dir/globalmise/.npmrc" \
|
||||
PATH="$data_dir/globalmise/mise-data/shims:$PATH"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load agentflow
|
||||
config_foreach get_config agentflow
|
||||
[ "$enabled" = 1 ] || return 1
|
||||
|
||||
[ -x /usr/bin/agentflow ] || {
|
||||
logger -t agentflow "missing executable: /usr/bin/agentflow"
|
||||
return 1
|
||||
}
|
||||
mkdir -p "$data_dir" || return 1
|
||||
|
||||
logger -t agentflow "starting AgentFlow on $host:$port"
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/bin/agentflow
|
||||
set_mise_env \
|
||||
"AGENT_FLOW_DATA=$data_dir/data" \
|
||||
"AGENT_FLOW_HOST=$host" \
|
||||
"AGENT_FLOW_PORT=$port"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "agentflow"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
[ ! -f "/usr/share/ucitrack/luci-app-agentflow.json" ] && {
|
||||
cat > /usr/share/ucitrack/luci-app-agentflow.json << EEOF
|
||||
{
|
||||
"config": "agentflow",
|
||||
"init": "agentflow"
|
||||
}
|
||||
EEOF
|
||||
}
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@agentflow[-1]
|
||||
add ucitrack agentflow
|
||||
set ucitrack.@agentflow[-1].init=agentflow
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
/etc/init.d/agentflow enable
|
||||
/etc/init.d/agentflow start
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user