Files
gyxx-flow/workbench/bin/start-workbench.sh
T
wangyunlong 01218b2907 feat: add deepseek-harness workbench plugin and console diagnosis API
- console: GET /api/workflows/{id}, /runs/{run_id}, /runs/{run_id}/diagnosis
  (journal trace + sanitized bounded log tails, workflow/run pairing enforced)
- workbench/: dsh 宿主插件(7 个工作流工具、中文系统提示词、失败监控器、
  本机回环桥接服务)+ 侧边栏面板客户端包(sidebar.footer.action 与
  shell.overlay 追加插槽)+ 降级独立面板 + 一键启动脚本
- adapters/browser: 收敛 looks_like_login_url 到共享层,修复
  jd_main_image_collector 对 gyxx_flow.accounts 的越层导入
- tests: 新端点覆盖;replay_policy 断言对齐已迁移的 catalog(repeatable)
2026-09-04 11:10:16 +08:00

43 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# GYXX 智能工作台一键启动(Linux/macOS
# 用法:bash workbench/bin/start-workbench.sh [console_env_file]
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
WORKBENCH_DIR="$REPO_ROOT/workbench"
LOCAL_YML="$WORKBENCH_DIR/cordis.local.yml"
CONSOLE_ENV_FILE="${1:-${GYXX_CONSOLE_ENV_FILE:-/etc/gyxx/flow.env}}"
CONSOLE_PORT="${GYXX_CONSOLE_PORT:-8765}"
BRIDGE_PORT="${GYXX_WB_BRIDGE_PORT:-8790}"
# 1) 渲染 cordis.local.yml(插件路径必须为绝对路径)
sed \
-e "s|__PLUGIN_DIR__|$WORKBENCH_DIR/plugin|g" \
-e "s|__PROJECT_ROOT__|$REPO_ROOT|g" \
-e "s|bridgePort: 8790|bridgePort: $BRIDGE_PORT|g" \
-e "s|http://127.0.0.1:8765|http://127.0.0.1:$CONSOLE_PORT|g" \
"$WORKBENCH_DIR/cordis.template.yml" > "$LOCAL_YML"
echo "[workbench] 已生成 $LOCAL_YML"
# 2) 确保 gyxx console 在运行
if ! curl -fsS -m 3 "http://127.0.0.1:$CONSOLE_PORT/api/overview" >/dev/null 2>&1; then
if [ ! -f "$CONSOLE_ENV_FILE" ]; then
echo "[workbench] 警告:缺少 $CONSOLE_ENV_FILE —— 正式执行将无法注入云端凭据(AGENTS.md 约定)。" >&2
fi
echo "[workbench] 启动 gyxx console(端口 $CONSOLE_PORT"
(cd "$REPO_ROOT" && nohup uv run gyxx console --port "$CONSOLE_PORT" --env-file "$CONSOLE_ENV_FILE" >/dev/null 2>&1 &)
for _ in $(seq 1 30); do
sleep 1
if curl -fsS -m 2 "http://127.0.0.1:$CONSOLE_PORT/api/overview" >/dev/null 2>&1; then break; fi
done
fi
# 3) 启动 dsh Web UI
if [ -n "${DSH_HOME:-}" ] && [ -f "$DSH_HOME/package.json" ]; then
echo "[workbench] 使用源码版 dsh: $DSH_HOME"
(cd "$DSH_HOME" && pnpm dsh web --patch "$LOCAL_YML")
else
echo "[workbench] 使用 npm 版 dshnpx @deepseek-ai/dsh"
npx -y @deepseek-ai/dsh web --patch "$LOCAL_YML"
fi