haiyaozhuang 0.1.0 → 0.2.1
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/README.md +21 -4
- package/dist/npm/cli.js +6985 -192
- package/dist/npm/cli.js.map +27 -9
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 还要装
|
|
2
2
|
|
|
3
|
-
Lightweight cross-platform (macOS & Windows) local web service for managing AI agent skills and native plugins across **WorkBuddy, Qoder, Claude Code, Antigravity, Codex, ZCode**, and shared `~/.agents/skills`, backed by **腾讯云开发 CloudBase PostgreSQL
|
|
3
|
+
Lightweight cross-platform (macOS & Windows) local web service for managing AI agent skills and native plugins across **WorkBuddy, Qoder, Claude Code, Antigravity, Codex, ZCode**, and shared `~/.agents/skills`, backed by **腾讯云开发 CloudBase PostgreSQL**(云端共享数据库,零搭建)或 **自有 PostgreSQL**(0.2.0 起贴连接串即用)for multi-device sync.
|
|
4
4
|
|
|
5
5
|
## 功能特性
|
|
6
6
|
|
|
@@ -41,7 +41,7 @@ npx haiyaozhuang@latest
|
|
|
41
41
|
|
|
42
42
|
- 前提:`node -v` ≥ 20(`engines` 硬要求:全局 `crypto.randomUUID` 与 @hono/node-server 的依赖面)。
|
|
43
43
|
- 首次运行 npm 会询问 `Ok to proceed? (y)`,回车确认属正常交互;已缓存旧版本时用 `haiyaozhuang@latest` 强制取最新发布版。
|
|
44
|
-
-
|
|
44
|
+
- 首次启动进入引导向导,二选一数据后端(0.2.0 双后端):**CloudBase**(零搭建,填环境 ID 与服务端 API Key,控制台「身份认证 → API Key」创建;也可用环境变量 `CLOUDBASE_ENV_ID` / `CLOUDBASE_API_KEY`)或 **自有 PostgreSQL**(贴一条 `postgresql://` 连接串,见下文「数据后端」)→ 连通校验通过后本机作为 Device 登记进 Library,功能与 mac app 完全一致(导入/安装/编辑/趋势/设备同步,非只读门户)。
|
|
45
45
|
- 服务只绑定 `127.0.0.1` 并自动打开浏览器;默认端口 4318,被占用或需改端口时设 `PORT` 环境变量(如 `PORT=5099 npx haiyaozhuang@latest`)。凭据与本地配置存于 `~/.skill-hub/`。
|
|
46
46
|
- 维护者:从源码构建等价产物 `bun run build:npm` 后 `node dist/npm/cli.js`;发布链路(pack → 清单核查 → prefix 安装 → bin 起服)由 `bun run verify:npm` 一键验证,决策记录见 `docs/adr/0003-npm-distribution.md`。
|
|
47
47
|
|
|
@@ -77,7 +77,7 @@ bun run build:bin:win
|
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
Run the compiled binary on any Mac or Windows machine and open `http://127.0.0.1:4318`:
|
|
80
|
-
- First launch guides you to
|
|
80
|
+
- First launch guides you to choose a data backend(0.2.0 双后端):**CloudBase 环境 ID + 服务端 API Key**(控制台「身份认证 → API Key」创建;也可用环境变量 `CLOUDBASE_ENV_ID` / `CLOUDBASE_API_KEY`)或 **自有 PostgreSQL 连接串**。
|
|
81
81
|
- Local settings and conflict backups are stored under `~/.skill-hub/` (`%USERPROFILE%\.skill-hub\` on Windows).
|
|
82
82
|
- 多台设备填入同一组凭据即可共享资料库与安装状态。
|
|
83
83
|
|
|
@@ -102,12 +102,29 @@ Run the compiled binary on any Mac or Windows machine and open `http://127.0.0.1
|
|
|
102
102
|
- schema 由 `cloudbase/README.md` 记录(6 张表 + 10 个函数)。该环境与其他项目共用,迁移历史由先行项目占有,本项目的对象经管理面 SQL 创建。
|
|
103
103
|
- 一次性迁移脚本:`bun scripts/migrate-local-to-cloud.ts`(本地 PostgreSQL → 云端,保留 ID/版本号/时间戳;要求云端业务表为空)。
|
|
104
104
|
|
|
105
|
+
## 数据后端(0.2.0 双后端)
|
|
106
|
+
|
|
107
|
+
0.2.0 起资料库支持两种数据后端,向导首屏二选一,老配置(0.1.0 的 CloudBase 凭据)零迁移自动保持:
|
|
108
|
+
|
|
109
|
+
- **CloudBase(默认,零搭建)**:腾讯云开发 PG 共享实例,注册即得环境 ID 与 API Key,多设备同步开箱即用;详见下文「CloudBase 云端数据库」。
|
|
110
|
+
- **自有 PostgreSQL(自托管)**:贴一条 `postgresql://` 连接串即可,例如:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
postgresql://skillhub:你的密码@db.example.com:5432/skillhub
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- 首次连接自动幂等灌入 schema(`cloudbase/sql/schema.sql`:8 表 + `api_*` 函数 + 索引,`CREATE ... IF NOT EXISTS` 语义,空库与已就绪库均可安全重放);连接串校验失败按 `auth` / `network` / `schema` 分类报错,响应与日志绝不回显连接串。
|
|
117
|
+
- 连接串仅存本机 `~/.skill-hub/config.json`(`dbBackend: "pg"` + `pgConnString`),绝不下发浏览器。
|
|
118
|
+
- **数据可达性**:跨设备同步要求**所有设备都能直达该 PG 实例**(同内网、公网白名单或 VPN 均可)——数据只落在这一个库里,设备 A 导入的包,设备 B 要能读到同一份,就必须连得上。CloudBase 路径无此要求(网关公网可达)。
|
|
119
|
+
- 0.2.0 版本变更:`haiyaozhuang` 0.2.0 新增自有 PG 后端;CloudBase 路径行为零变化(API 契约逐字段一致)。
|
|
120
|
+
|
|
105
121
|
## Verification
|
|
106
122
|
|
|
107
123
|
```bash
|
|
108
124
|
bun run typecheck
|
|
109
125
|
bun test
|
|
110
|
-
bun run verify:npm # npm 分发通道全链验收(
|
|
126
|
+
bun run verify:npm # npm 分发通道全链验收(16 步:构建产物黑盒 + 发布链闭环 + 15/16 generic-PG 全链,全程 /tmp,无发布动作)
|
|
111
127
|
```
|
|
112
128
|
|
|
113
129
|
> `bun test` 直接跑在 CloudBase 云端环境(凭据取自 `TEST_CLOUDBASE_ENV_ID` / `TEST_CLOUDBASE_API_KEY`,未设置时回退 `~/.skill-hub/config.json`),需要网络可达网关;测试数据以 slug 前缀隔离并在云端留痕,测试完可用管理面清理。
|
|
130
|
+
> pg 路径测试(`tests/pg-client.test.ts` 等)另需本机 docker PG(默认 `127.0.0.1:54329`,可用 `TEST_PG_CONN_STRING` / `TEST_PG_ADMIN_URL` 覆盖)——一次性库每轮 DROP 重建,绝不触碰实例上的旧业务数据。
|