feat(office): 本地可用——install.sh 跨平台取资产,PATH 直塞 scripts 目录
office 技能本体(SKILL.md + Node 封装层 + officecli 二进制)本来就是跨平台的, 坏在两处容器假设:install.sh 只认 linux-x64、PATH 入口只写 /usr/local/bin。 - install.sh: 按 uname -s/-m 选资产(linux x64/arm64、mac x64/arm64),校验和 pin 到 上游 release 的 SHA256SUMS(八平台齐全,linux-x64 那行与原有 pin 完全一致); mac 没有 sha256sum,补 shasum -a 256 兜底;构建阶段判定提前到平台探测之前, 避免构建机架构未被识别时中断镜像构建 - 已在且能跑就沿用:officecli 会自更新到上游 latest(实测 1.0.157 跑一次变 1.0.160, 文件大小与 latest 资产一字节不差),用 pin 去比对只会反复重拉 34MB。服务器卷 :ro、 二进制不会漂,正常仍走 sha 比对,行为不变 - local/start.sh: 起 core 时把 skills/office/scripts 塞进 PATH(服务器靠镜像里的 /usr/local/bin 软链;本地没 root 写不了系统目录)。无需复制、无需改 app/ - 封装层 ENOENT 报错带上 install.sh 绝对路径,模型看到即可自行补装 本地实测(macOS x86_64):office create / view outline 正常;启动器不预下载,首次用到时 按报错跑一次 install.sh(GitHub 慢时自动换 gh-proxy,实测 27s)。 预览仍不可用(缺 executor 的 :3100 网关),已记入文档。
This commit is contained in:
@@ -92,7 +92,8 @@ try {
|
||||
}
|
||||
if (r.error) {
|
||||
if (r.error.code === 'ENOENT') {
|
||||
err('office.core binary missing: ' + BIN + ' (skill asset not fetched: docker compose up -d agent-executor-init to retry, or place it per skills/office/install.sh)');
|
||||
err('office.core binary missing: ' + BIN + '\nInstall it: bash ' + path.resolve(__dirname, '..', 'install.sh')
|
||||
+ ' (server: docker compose up -d agent-executor-init)');
|
||||
}
|
||||
err(String(r.error.message || r.error));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user