@clawos-dev/clawd 0.2.130 → 0.2.131-beta.258.3b226c3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/persona-defaults/persona-app-builder/CLAUDE.md +1 -1
- package/dist/persona-defaults/persona-app-builder/extension-kit/scripts/publish.sh +5 -8
- package/dist/persona-defaults/persona-app-builder/extension-kit/scripts/remove-extension.sh +0 -4
- package/package.json +1 -1
- package/dist/persona-defaults/persona-app-builder/extension-kit/scripts/ensure-toolchain.sh +0 -62
|
@@ -168,7 +168,7 @@ createProject 成功后 daemon 自动:
|
|
|
168
168
|
|
|
169
169
|
- 一律走 **FC(函数计算,serverless)**:免 Docker、闲置缩到 0 按量、适合海量小 extension。
|
|
170
170
|
- Node web 应用走 `custom.debian12` + 官方 Node 层 + `bootstrap` + `fc3-domain` 自定义域名(否则 fcapp.run 默认 URL 强制下载、浏览器不渲染)。
|
|
171
|
-
- 工具链:**`aliyun` CLI + Serverless Devs(`s`)**——即 `publish.sh`
|
|
171
|
+
- 工具链:**`aliyun` CLI + Serverless Devs(`s`)**——即 `publish.sh` 内部做的事。
|
|
172
172
|
- 实时推送用 Supabase Realtime(FC 不维持长连接)。
|
|
173
173
|
|
|
174
174
|
## 后端:supabase MCP
|
|
@@ -20,15 +20,12 @@ CODE_DIR="${CODE_DIR:-./server}"
|
|
|
20
20
|
FC_ENTRY="${FC_ENTRY:-dist/main.js}"
|
|
21
21
|
BUILD_CMD="${BUILD_CMD:-}"
|
|
22
22
|
|
|
23
|
-
# 2)
|
|
24
|
-
source "$KIT_DIR/scripts/ensure-toolchain.sh"
|
|
25
|
-
ensure_toolchain
|
|
26
|
-
|
|
27
|
-
# 阿里云凭证(现读)+ Serverless Devs 认证(必须含 AccountID,SK 走 heredoc 不进命令行)
|
|
23
|
+
# 2) 阿里云凭证(现读)+ Serverless Devs 认证(必须含 AccountID,SK 走 heredoc 不进命令行)
|
|
28
24
|
set -a; . "$PERSONA_DIR/.secrets/aliyun.env"; set +a
|
|
29
|
-
# aliyun
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
# aliyun CLI 需要 region;新机器没跑过 `aliyun configure`(无 ~/.aliyun/config.json) → "region can't be empty"。
|
|
26
|
+
# 用 env 给 region(REGION 来自 config.env):一处覆盖脚本里所有 aliyun 调用,不进 argv,和 AK/SK 走 env 的方式对称。
|
|
27
|
+
export ALIBABA_CLOUD_REGION_ID="$REGION"
|
|
28
|
+
ACC="$(aliyun sts GetCallerIdentity 2>/dev/null | python3 -c 'import sys,json;print(json.load(sys.stdin)["AccountId"])')"
|
|
32
29
|
mkdir -p ~/.s
|
|
33
30
|
cat > ~/.s/access.yaml <<EOF
|
|
34
31
|
default:
|
|
@@ -18,10 +18,6 @@ source "$KIT_DIR/config.env"
|
|
|
18
18
|
APP_NAME="${APP_NAME:-$(basename "$EXT_DIR")}"
|
|
19
19
|
SUPABASE_TABLES="${SUPABASE_TABLES:-}"
|
|
20
20
|
|
|
21
|
-
# 确保工具链就绪(缺 s / aliyun 则装,已装跳过)—— 下面 s remove 依赖它
|
|
22
|
-
source "$KIT_DIR/scripts/ensure-toolchain.sh"
|
|
23
|
-
ensure_toolchain
|
|
24
|
-
|
|
25
21
|
set -a; . "$PERSONA_DIR/.secrets/aliyun.env"; set +a
|
|
26
22
|
|
|
27
23
|
# 1) 删 FC 侧(函数 + 触发器 + 自定义域名)
|
package/package.json
CHANGED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# ============================================================
|
|
3
|
-
# 确保发布/清理用到的工具链就绪:Serverless Devs (s) + 阿里云 CLI (aliyun)。
|
|
4
|
-
# 检测环境、缺啥装啥、已装则跳过(幂等)。被 publish.sh / remove-extension.sh
|
|
5
|
-
# 在调用 aliyun/s 之前 `source` 进来,再调 ensure_toolchain。
|
|
6
|
-
#
|
|
7
|
-
# 为什么需要它:FC 发布全靠 aliyun CLI + s 两个外部命令,二者都不随 clawd 安装。
|
|
8
|
-
# 新机器上它们不在 PATH → publish.sh 第一条 `aliyun sts ...` stdout 为空 →
|
|
9
|
-
# python json.load 空串 → `Expecting value: line 1 column 1`,且死在第一个
|
|
10
|
-
# ::stage:: marker 之前 → daemon 只能报 [unknown] 阶段。这个脚本补的就是这一环。
|
|
11
|
-
# ============================================================
|
|
12
|
-
|
|
13
|
-
# aliyun CLI 官方 release 兜底版本(仅在无 brew、走二进制下载时用;brew 路径不读它)。
|
|
14
|
-
CLAWD_ALIYUN_CLI_VERSION="${CLAWD_ALIYUN_CLI_VERSION:-3.3.21}"
|
|
15
|
-
|
|
16
|
-
ensure_s() {
|
|
17
|
-
command -v s >/dev/null 2>&1 && return 0
|
|
18
|
-
echo "==> 安装 Serverless Devs (s)…"
|
|
19
|
-
command -v npm >/dev/null 2>&1 || { echo "❌ 缺 npm,无法安装 @serverless-devs/s" >&2; return 1; }
|
|
20
|
-
npm install -g @serverless-devs/s
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
ensure_aliyun() {
|
|
24
|
-
command -v aliyun >/dev/null 2>&1 && return 0
|
|
25
|
-
echo "==> 安装阿里云 CLI (aliyun)…"
|
|
26
|
-
# 优先 brew(有 brew 的 mac 最省事,装到已在 PATH 的 /opt/homebrew/bin | /usr/local/bin)
|
|
27
|
-
if command -v brew >/dev/null 2>&1; then
|
|
28
|
-
brew install aliyun-cli
|
|
29
|
-
return 0
|
|
30
|
-
fi
|
|
31
|
-
# 兜底:官方 release 二进制(没装 brew 的新机器 / Linux server)。
|
|
32
|
-
local os arch bindir="$HOME/.clawd/bin"
|
|
33
|
-
case "$(uname -s)" in
|
|
34
|
-
Darwin) os=macosx ;;
|
|
35
|
-
Linux) os=linux ;;
|
|
36
|
-
*) echo "❌ 不支持的系统 $(uname -s),请手动安装 aliyun CLI" >&2; return 1 ;;
|
|
37
|
-
esac
|
|
38
|
-
case "$(uname -m)" in
|
|
39
|
-
arm64|aarch64) arch=arm64 ;;
|
|
40
|
-
x86_64|amd64) arch=amd64 ;;
|
|
41
|
-
*) echo "❌ 不支持的架构 $(uname -m),请手动安装 aliyun CLI" >&2; return 1 ;;
|
|
42
|
-
esac
|
|
43
|
-
local ver="$CLAWD_ALIYUN_CLI_VERSION"
|
|
44
|
-
local url="https://github.com/aliyun/aliyun-cli/releases/download/v${ver}/aliyun-cli-${os}-${ver}-${arch}.tgz"
|
|
45
|
-
echo " 无 brew,下载官方二进制: $url"
|
|
46
|
-
mkdir -p "$bindir"
|
|
47
|
-
curl -fsSL "$url" | tar xz -C "$bindir"
|
|
48
|
-
chmod +x "$bindir/aliyun"
|
|
49
|
-
export PATH="$bindir:$PATH"
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
ensure_toolchain() {
|
|
53
|
-
ensure_s
|
|
54
|
-
ensure_aliyun
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
# 直接执行(bash ensure-toolchain.sh)= 自检;被 source 时不自动跑,留给调用方显式 ensure_toolchain。
|
|
58
|
-
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
|
|
59
|
-
set -euo pipefail
|
|
60
|
-
ensure_toolchain
|
|
61
|
-
echo "✅ 工具链就绪: s=$(command -v s) aliyun=$(command -v aliyun)"
|
|
62
|
-
fi
|