@baize-ai/core 0.3.13 → 0.3.14
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/.dockerignore +0 -2
- package/CHANGELOG.md +6 -0
- package/Dockerfile +0 -13
- package/docker/entrypoint.sh +24 -11
- package/package.json +1 -1
- package/scripts/build-push-acr.sh +4 -2
- package/scripts/docker-publish.sh +4 -11
- package/skills/web-console/public/app.js +14 -1
package/.dockerignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to baize-core will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.14] - 2026-08-30
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- A2A 容器重启自愈(D48):entrypoint 检查 A2A config.enabled → 自动启动 baize-a2a daemon——容器重启后 A2A 零手动恢复
|
|
12
|
+
- Web A2A 状态卡证书徽章(D48):显示证书链状态(certValid)——daemon 在线时"自动处理中"、离线时提示"待续签"
|
|
13
|
+
|
|
8
14
|
## [0.3.13] - 2026-08-28
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/Dockerfile
CHANGED
|
@@ -82,11 +82,6 @@ ENV WEB_CONSOLE_BIND=0.0.0.0
|
|
|
82
82
|
# build context) — source stays private, the image matches the npm version
|
|
83
83
|
# exactly. Build with: docker build --build-arg BAZE_CORE_VERSION=0.2.0 .
|
|
84
84
|
ARG BAZE_CORE_VERSION=latest
|
|
85
|
-
# Local-development override: when building from source with
|
|
86
|
-
# --build-arg BAIZE_LOCAL_SKILLS=1, copy the LOCAL skills over the npm-package
|
|
87
|
-
# skills so un-released fixes (e.g. D44) land in the image without publishing.
|
|
88
|
-
# Official builds leave this off — the published npm package is authoritative.
|
|
89
|
-
ARG BAIZE_LOCAL_SKILLS=0
|
|
90
85
|
WORKDIR /home/baize
|
|
91
86
|
RUN npm install -g @baize-ai/core@${BAZE_CORE_VERSION} \
|
|
92
87
|
&& baize --version \
|
|
@@ -129,14 +124,6 @@ RUN npm install -g @baize-ai/core@${BAZE_CORE_VERSION} \
|
|
|
129
124
|
&& node -e "const D=require('/home/baize/baize/.claude/skills/web-console/node_modules/better-sqlite3'); new D(':memory:')" \
|
|
130
125
|
&& echo "native modules OK (locally compiled, baked into runtime skills)"
|
|
131
126
|
|
|
132
|
-
# ── Local-source skills override (BAIZE_LOCAL_SKILLS=1) ─────────────────────
|
|
133
|
-
# docker-publish.sh stages the repo's skills/ into .docker-local-skills/ when
|
|
134
|
-
# BAIZE_LOCAL_SKILLS=1 (empty directory otherwise). They land in
|
|
135
|
-
# /home/baize/.local-skills and are applied by entrypoint AFTER init, because
|
|
136
|
-
# init's postinstall syncSkills uses the npm-package skills as source and
|
|
137
|
-
# would otherwise overwrite them. Official images carry an empty dir — no-op.
|
|
138
|
-
COPY --chown=baize:baize .docker-local-skills/ /home/baize/.local-skills/
|
|
139
|
-
|
|
140
127
|
# ── Workspace directories ─────────────────────────────────────────────────────
|
|
141
128
|
# ~/baize is mounted as a single volume in docker-compose.yml.
|
|
142
129
|
# Creating subdirectories here ensures correct ownership in the image.
|
package/docker/entrypoint.sh
CHANGED
|
@@ -94,18 +94,10 @@ if ! baize init ${INIT_ARGS}; then
|
|
|
94
94
|
fi
|
|
95
95
|
ok "Workspace ready"
|
|
96
96
|
mkdir -p "${BAIZE_DIR}/.baize"
|
|
97
|
-
|
|
98
|
-
# Images built with BAIZE_LOCAL_SKILLS=1 bake the repo's skills into
|
|
99
|
-
# /home/baize/.local-skills. syncSkills (npm postinstall) runs during init
|
|
100
|
-
# with the npm-package skills as source, so apply the local override AFTER
|
|
101
|
-
# init to keep un-released fixes (e.g. D44) authoritative.
|
|
102
|
-
# Official images ship an empty .local-skills — this is a no-op there.
|
|
103
|
-
if [ -d /home/baize/.local-skills ]; then
|
|
104
|
-
cp -rf /home/baize/.local-skills/. "${BAIZE_DIR}/.claude/skills/" 2>/dev/null \
|
|
105
|
-
&& ok "Local-source skills applied (BAIZE_LOCAL_SKILLS=1)"
|
|
106
|
-
fi
|
|
97
|
+
printf '{"status":"ok","at":"%s"}\n' "$(date -Iseconds)" > "${BAIZE_DIR}/.baize/init-state.json"
|
|
107
98
|
|
|
108
|
-
|
|
99
|
+
|
|
100
|
+
ok "Workspace ready"
|
|
109
101
|
|
|
110
102
|
# ── Pass through channel env vars to .env ─────────────────────────────────────
|
|
111
103
|
# baize init doesn't write channel tokens — those come from component installs.
|
|
@@ -161,6 +153,27 @@ PM2_PID=$!
|
|
|
161
153
|
sleep 3
|
|
162
154
|
ok "Services started"
|
|
163
155
|
|
|
156
|
+
# ── Step 3b: A2A self-heal (D48) ─────────────────────────────────────────────
|
|
157
|
+
# After a container restart, a previously-enabled A2A component must come back
|
|
158
|
+
# up by itself (zero manual ops). If the A2A config says enabled, start the
|
|
159
|
+
# baize-a2a daemon — it registers/renews its certificate with the admin and
|
|
160
|
+
# serves the advertise port. Idempotent: pm2 start restarts an existing entry.
|
|
161
|
+
if [ -f "${BAIZE_DIR}/components/a2a/config.json" ]; then
|
|
162
|
+
A2A_ENABLED=$(node -e "
|
|
163
|
+
try {
|
|
164
|
+
const c = JSON.parse(require('fs').readFileSync('${BAIZE_DIR}/components/a2a/config.json','utf8'));
|
|
165
|
+
process.stdout.write(c.enabled ? '1' : '0');
|
|
166
|
+
} catch { process.stdout.write('0'); }
|
|
167
|
+
" 2>/dev/null || echo "0")
|
|
168
|
+
if [ "$A2A_ENABLED" = "1" ]; then
|
|
169
|
+
ok "A2A enabled — starting baize-a2a daemon"
|
|
170
|
+
( cd "${BAIZE_DIR}/.claude/skills/a2a" && pm2 start ecosystem.config.cjs >/dev/null 2>&1 ) || \
|
|
171
|
+
warn "A2A daemon start failed — check 'docker exec <c> pm2 logs baize-a2a'"
|
|
172
|
+
fi
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# ── Step 4: Start the configured agent runtime in tmux ───────────────────────
|
|
176
|
+
|
|
164
177
|
# ── Step 4: Start the configured agent runtime in tmux ───────────────────────
|
|
165
178
|
# Determine runtime: BAIZE_RUNTIME env var always wins; fall back to config.json.
|
|
166
179
|
if [ -z "${BAIZE_RUNTIME:-}" ]; then
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Multi-platform build + push to Aliyun ACR for the mainland distribution.
|
|
3
|
-
# Usage: bash build-push-acr.sh [VERSION] (default
|
|
3
|
+
# Usage: bash build-push-acr.sh [VERSION] (default = latest published)
|
|
4
|
+
# IMPORTANT: bump this default when a new version is published — it must
|
|
5
|
+
# track @baize-ai/core latest (never point at an un-released version).
|
|
4
6
|
# Requires: docker login already done, qemu-arm64 registered
|
|
5
7
|
# (apt install qemu-user-binfmt), registry mirror configured.
|
|
6
8
|
set -euo pipefail
|
|
7
9
|
|
|
8
|
-
VERSION="${1:-0.3.
|
|
10
|
+
VERSION="${1:-0.3.13}"
|
|
9
11
|
ACR="crpi-8bg62qbrjs3cr3as.cn-hangzhou.personal.cr.aliyuncs.com/baize01/baize-core"
|
|
10
12
|
|
|
11
13
|
echo "== Configure buildkit registry mirror (mainland Docker Hub access) =="
|
|
@@ -30,22 +30,15 @@ ACR_NAMESPACE="${ACR_NAMESPACE:-baize01}"
|
|
|
30
30
|
|
|
31
31
|
# ── Build ────────────────────────────────────────────────────────────────────
|
|
32
32
|
echo "==> Building baize-core:${VERSION} (from npm @baize-ai/core@${VERSION})"
|
|
33
|
-
BUILD_ARGS=(--build-arg "BAZE_CORE_VERSION=${VERSION}")
|
|
34
|
-
rm -rf .docker-local-skills && mkdir -p .docker-local-skills
|
|
35
|
-
if [ "${BAIZE_LOCAL_SKILLS:-0}" = "1" ]; then
|
|
36
|
-
BUILD_ARGS+=(--build-arg BAIZE_LOCAL_SKILLS=1)
|
|
37
|
-
echo "==> Overriding skills with LOCAL repo source (BAIZE_LOCAL_SKILLS=1) — un-released fixes baked in"
|
|
38
|
-
cp -r skills/. .docker-local-skills/
|
|
39
|
-
# Never ship host-compiled node_modules (mac binaries break linux runtime) —
|
|
40
|
-
# dependency binaries come from the image's own npm install.
|
|
41
|
-
find .docker-local-skills -type d -name node_modules -prune -exec rm -rf {} +
|
|
42
|
-
fi
|
|
43
33
|
docker build \
|
|
34
|
+
--build-arg BAZE_CORE_VERSION="${VERSION}" \
|
|
35
|
+
-t "${GHCR_IMAGE}:${VERSION}" \
|
|
36
|
+
-t "${GHCR_IMAGE}:latest" \
|
|
37
|
+
.
|
|
44
38
|
"${BUILD_ARGS[@]}" \
|
|
45
39
|
-t "${GHCR_IMAGE}:${VERSION}" \
|
|
46
40
|
-t "${GHCR_IMAGE}:latest" \
|
|
47
41
|
.
|
|
48
|
-
rm -rf .docker-local-skills
|
|
49
42
|
|
|
50
43
|
if [ -n "${ACR_REGISTRY}" ] && [ -n "${ACR_NAMESPACE}" ]; then
|
|
51
44
|
ACR_IMAGE="${ACR_REGISTRY}/${ACR_NAMESPACE}/baize-core"
|
|
@@ -1655,6 +1655,19 @@ async function loadA2aStatus(basePath) {
|
|
|
1655
1655
|
state.textContent = enabled ? '已启用' : '未启用';
|
|
1656
1656
|
state.className = `channel-state ${enabled ? 'ok' : 'warn'}`;
|
|
1657
1657
|
}
|
|
1658
|
+
// D48: certificate health — the daemon self-heals (re-registers) when the
|
|
1659
|
+
// admin rotated its CA. Only claim "auto-healing" when the daemon is
|
|
1660
|
+
// actually alive to run the 5-min renewal check; otherwise the user must
|
|
1661
|
+
// act (daemon down / renewals exhausted).
|
|
1662
|
+
const certValid = body.certValid === true;
|
|
1663
|
+
const daemonUp = body.daemonHealthy === true;
|
|
1664
|
+
let certLabel = '正常';
|
|
1665
|
+
if (!certValid) {
|
|
1666
|
+
certLabel = daemonUp ? '需续签(自动处理中)' : '证书待续签(daemon 未运行)';
|
|
1667
|
+
}
|
|
1668
|
+
const certRow = body.enabled === true
|
|
1669
|
+
? `<div class="conn-summary-row"><span class="conn-summary-name">证书状态</span><span class="conn-summary-detail"><span class="channel-state ${certValid ? 'ok' : 'warn'}">${certLabel}</span></span></div>`
|
|
1670
|
+
: '';
|
|
1658
1671
|
const rows = [
|
|
1659
1672
|
['启用', enabled ? '是' : '否'],
|
|
1660
1673
|
['Agent ID', body.agentId],
|
|
@@ -1664,7 +1677,7 @@ async function loadA2aStatus(basePath) {
|
|
|
1664
1677
|
['Endpoint', body.endpoint],
|
|
1665
1678
|
['版本', body.version],
|
|
1666
1679
|
].filter(([, v]) => v !== undefined && v !== null && v !== '');
|
|
1667
|
-
el.innerHTML = rows.map(([k, v]) => `<div class="conn-summary-row"><span class="conn-summary-name">${escapeHtml(k)}</span><span class="conn-summary-detail">${escapeHtml(String(v))}</span></div>`).join('');
|
|
1680
|
+
el.innerHTML = rows.map(([k, v]) => `<div class="conn-summary-row"><span class="conn-summary-name">${escapeHtml(k)}</span><span class="conn-summary-detail">${escapeHtml(String(v))}</span></div>`).join('') + certRow;
|
|
1668
1681
|
updateA2aInstallArea(body);
|
|
1669
1682
|
updateA2aModeCard(body);
|
|
1670
1683
|
updateA2aConfigArea(body);
|