{"_id":"@buckeyestudio/toh-storage","name":"@buckeyestudio/toh-storage","dist-tags":{"next":"0.1.1-rc.2","latest":"0.1.1-rc.2"},"versions":{"0.1.1-rc.2":{"name":"@buckeyestudio/toh-storage","description":"Storage hub (ctx.storage): named backend registry plus mounted data-form facilities for the TheOpen Harness","version":"0.1.1-rc.2","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/storage/storage"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","author":{"name":"buckeyestudio"},"peerDependencies":{"@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"devDependencies":{"@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"_id":"@buckeyestudio/toh-storage@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-rr09XdWQBOaUYi8eAgM7e8+E4YxOJPYDSDxjZWPRiB1DLFL+o0qQm3e85yXGgKQjjmsjbtHAVj93MFQqAYWxgA==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-storage-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-storage-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-rr09XdWQBOaUYi8eAgM7e8+E4YxOJPYDSDxjZWPRiB1DLFL+o0qQm3e85yXGgKQjjmsjbtHAVj93MFQqAYWxgA==","shasum":"f396acfb58f5b45c38d9ed6e47a56039a4403530","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-storage/-/toh-storage-0.1.1-rc.2.tgz","fileCount":12,"unpackedSize":22483,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICfkEi9MUraIXXtS9uSdrIBbFRG+LolrIYf2F3uLmBV4AiAOsj8ksI5KEw/z/CcUYJ+wVc8dpX8Qa5CjpNzNxzZjdg=="}]},"_npmUser":{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"},"directories":{},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toh-storage_0.1.1-rc.2_1787489055572_0.21859102724044543"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:44:15.385Z","0.1.1-rc.2":"2026-08-23T12:44:15.720Z","modified":"2026-08-23T12:44:15.905Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"Storage hub (ctx.storage): named backend registry plus mounted data-form facilities for the TheOpen Harness","homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/storage/storage"},"author":{"name":"buckeyestudio"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# @buckeyestudio/toh-storage\n\n[English](README.md) | 中文\n\n非会话数据的存储中心（`ctx.storage`）：具名后端注册表加已挂载的数据形式设施。中心自身不执行 IO：后端拥有介质，数据形式拥有语义。[存储家族概述](../README.zh.md)列出了这些包；[领域 KV 存储 Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)记录了设计理由。\n\n## 结构\n\n- `ctx.storage.backend`：名称 → 后端表。多个后端并排保持挂载（`json`、`sqlite`）；为消费方提供服务的后端由该消费方自身的配置决定（领域层的路由表），绝非中心的全局选择。`register()` 返回资源释放函数；注册重复名称或查找未知名称时都会明确报错。\n- `ctx.storage.mount(form, facility)`／`ctx.storage.form(form)`：数据形式挂载。`StorageForms` 可通过合并扩展；领域层合并 `domain`，并通过 `ctx.storage.domain` 访问。\n- 后端拥有一种介质，并公开其支持的数据形状**分面**。当前分面为 `kv`；`src/backend.ts` 负责定义其确切约定。\n\n## 模型体验\n\n### 后端与形式注册\n\n#### 模型看到的内容\n\n无。`ctx.storage` 是主机侧注册表；中心不注册工具、不注入提示词，也不写入会话事件。\n\n#### Token 影响\n\n每次请求都不会直接增加 token。\n\n#### KV Cache 影响\n\n与实时请求相互独立：中心绝不触碰请求前缀，因此无法使提供方缓存复用失效。\n\n## 已知限制与暂缓事项\n\n- **`kv` 是唯一的数据形状**：后端目前只有一个分面需要实现。\n- **数据形式按需解析**：在领域插件挂载前读取 `ctx.storage.domain` 会抛出 `form-not-mounted`；组装会按相应顺序排列插件（错误配置会明确报错，而不是静默推迟处理）。\n","readmeFilename":"README.zh.md","_rev":"1-0a136fb6646eac297ba4910faf187b98"}