Phase 1: 基础设施 — 自动 bootstrap + 删除废弃命令 + 18 个 @output/* schema 注册 #69

Closed
opened 2026-05-31 12:05:19 +00:00 by xiaoju · 0 comments
Owner

Parent: #67

Scope

1. 自动 bootstrap

  • openStore() 改为:每次调用都 mkdirSync + bootstrap()(幂等)
  • 删除 openStore(shouldCreate) 参数,不再区分读写
  • 删除 validateStoreExists() — bootstrap 会自动创建目录

2. 删除废弃命令

  • 删除 init 命令(dispatch + 函数)
  • 删除 bootstrap 命令
  • 删除 cat 命令(含 --payload 逻辑)
  • 删除 schema 子命令(put/get/list/validate)
  • 更新 help 文本

3. 注册 18 个 @output/* schema

bootstrap() 中注册:

@output/put, @output/get, @output/has, @output/hash,
@output/verify, @output/refs, @output/walk, @output/list,
@output/var-set, @output/var-get, @output/var-delete, @output/var-tag, @output/var-list,
@output/template-set, @output/template-get, @output/template-list, @output/template-delete,
@output/gc

每个 schema 带 title/description 区分。别名注册到 variable store。

4. 注册 18 个默认 template

每个 @output/* schema 注册对应的默认 LiquidJS template 到 @ucas/template/text/<hash>

5. 抽取 wrapEnvelope(schemaAlias, value) 通用函数

统一信封包装逻辑,替代现有的 wrapVariableEnvelope

Verification

  • bun test 通过
  • bun run build 通过
  • bun run check 通过
  • bootstrap 后 store 中能查到所有 @output/* schema
  • 废弃命令调用报 unknown command

Ref

Implements Phase 1 of #67

## Parent: #67 ## Scope ### 1. 自动 bootstrap - `openStore()` 改为:每次调用都 `mkdirSync` + `bootstrap()`(幂等) - 删除 `openStore(shouldCreate)` 参数,不再区分读写 - 删除 `validateStoreExists()` — bootstrap 会自动创建目录 ### 2. 删除废弃命令 - 删除 `init` 命令(dispatch + 函数) - 删除 `bootstrap` 命令 - 删除 `cat` 命令(含 `--payload` 逻辑) - 删除 `schema` 子命令(put/get/list/validate) - 更新 help 文本 ### 3. 注册 18 个 @output/* schema 在 `bootstrap()` 中注册: ``` @output/put, @output/get, @output/has, @output/hash, @output/verify, @output/refs, @output/walk, @output/list, @output/var-set, @output/var-get, @output/var-delete, @output/var-tag, @output/var-list, @output/template-set, @output/template-get, @output/template-list, @output/template-delete, @output/gc ``` 每个 schema 带 title/description 区分。别名注册到 variable store。 ### 4. 注册 18 个默认 template 每个 @output/* schema 注册对应的默认 LiquidJS template 到 `@ucas/template/text/<hash>`。 ### 5. 抽取 `wrapEnvelope(schemaAlias, value)` 通用函数 统一信封包装逻辑,替代现有的 `wrapVariableEnvelope`。 ### Verification - `bun test` 通过 - `bun run build` 通过 - `bun run check` 通过 - bootstrap 后 store 中能查到所有 @output/* schema - 废弃命令调用报 unknown command ## Ref Implements Phase 1 of #67
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/json-cas#69