Skip to content

v0.1.2 — 健壮性修复 + bundle 级校验 + 删除模式 + 批量读取

Choose a tag to compare

@likai-hust likai-hust released this 31 Jul 10:32
· 15 commits to main since this release

opencode-okf-context v0.1.2

This release fixes two robustness issues and adds three enhancements.

High-priority fixes

  • H1: malformed YAML no longer breaks the bundle. A concept with broken frontmatter YAML used to crash discovery and disable every okf_* tool. Now it loads with empty frontmatter and okf_validate reports a yaml-error instead.
  • H2: bundle detection matches the spec. Auto-scan now also accepts a dir with index.md/log.md + at least one typed concept, even without okf_version (the spec's MAY). Plain markdown dirs are still not mis-classified.

Enhancements

  • okf_validate bundle-level checks (all:true): bundle-okf-version-missing (error, fixable), bundle-log-missing (warning, fixable), link-broken (warning, not fixable). Cross-links are normalized (dot segments; escapes dropped).
  • okf_write mode:"delete": removes the file, its parent index.md entry, appends a log.md deletion entry, refreshes the cache.
  • okf_read ids:[...]: batch loads several concepts; the batch unloads as a unit via the existing placeholder mechanism.

Tests

67 tests pass (13 new in tests/robustness.test.ts); tsc --noEmit clean.

Offline install (air-gapped)

tar -xzf opencode-okf-context-0.1.2-offline.tar.gz -C ~/.config/opencode/plugin okf.js
opencode debug agent build | grep okf    # 6 tools

Replace ~/.config/opencode/plugin/okf.js and restart opencode.


Full changes: commit history under tag v0.1.2 (0f27b9d to 802c9ce).


中文说明

opencode-okf-context v0.1.2

本次发布修复两个健壮性问题,并新增三项增强。

高优先级修复

  • H1: 坏 YAML 不再拖垮整个 bundle。 之前某个 concept 的 frontmatter YAML 语法损坏会导致发现崩溃、所有 okf_* 工具不可用。现在它降级为空 frontmatter 加载,okf_validate 会报告 yaml-error。
  • H2: bundle 识别与规范对齐。 自动扫描现在也接受"有 index.md/log.md + 至少一个带 type 的 concept"的目录,即使没有 okf_version(规范中为 MAY)。普通 markdown 目录仍不会被误判。

新增增强

  • okf_validate bundle 级校验(all:true):bundle-okf-version-missing(error,可修复)、bundle-log-missing(warning,可修复)、link-broken(warning,不可修复)。交叉链接会做点段规范化(逃逸根目录的丢弃)。
  • okf_write mode:"delete":删除文件、移除父级 index.md 条目、向 log.md 追加删除记录、刷新缓存。
  • okf_read ids:[...]:批量加载多个 concept;整个批次作为整体卸载(复用现有占位符机制)。

测试

67 个测试全部通过(tests/robustness.test.ts 新增 13 个);tsc --noEmit 干净。

离线安装(内网)

tar -xzf opencode-okf-context-0.1.2-offline.tar.gz -C ~/.config/opencode/plugin okf.js
opencode debug agent build | grep okf    # 6 个工具

替换 ~/.config/opencode/plugin/okf.js 后重启 opencode。


完整变更:见 tag v0.1.2 对应的提交历史(0f27b9d 到 802c9ce)。