{"_id":"@buckeyestudio/toh-storage-domain","name":"@buckeyestudio/toh-storage-domain","dist-tags":{"next":"0.1.1-rc.2","latest":"0.1.1-rc.2"},"versions":{"0.1.1-rc.2":{"name":"@buckeyestudio/toh-storage-domain","description":"Domain data form (ctx.storage.domain): schema-validated, event-emitting KV domains over storage backends 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-domain"},"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/toh-storage":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"dependencies":{"zod":"^4.4.3","@buckeyestudio/schemastery":"^3.18.1"},"devDependencies":{"@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/toh-storage":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"_id":"@buckeyestudio/toh-storage-domain@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-Fot/3F5KtrguPkuSAmmjF/Gs2U3yN1rGB04vm8txgslFMNn76Lz1IEuIwlHB77LGBTwBFtZhBBe8iNov5oxLjA==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-storage-domain-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-storage-domain-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-Fot/3F5KtrguPkuSAmmjF/Gs2U3yN1rGB04vm8txgslFMNn76Lz1IEuIwlHB77LGBTwBFtZhBBe8iNov5oxLjA==","shasum":"858d01be941fe6448c7e4791a80470ce2f32881d","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-storage-domain/-/toh-storage-domain-0.1.1-rc.2.tgz","fileCount":13,"unpackedSize":46345,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFK2NqAmkLCyIJcB3RMQ1ZigPxCKmcNTDlChBGExJ4nKAiEAlcWcUKTeed/854jljvVl6o+U0jcRv6XUID7u6p6kMu4="}]},"_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-domain_0.1.1-rc.2_1787489059867_0.7139707474093195"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:44:19.703Z","0.1.1-rc.2":"2026-08-23T12:44:20.022Z","modified":"2026-08-23T12:44:20.230Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"Domain data form (ctx.storage.domain): schema-validated, event-emitting KV domains over storage backends 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-domain"},"author":{"name":"buckeyestudio"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# @buckeyestudio/toh-storage-domain\n\n[English](README.md) | 中文\n\nTheOpen Harness 存储中心的领域数据形式：在所有已配置的后端注册后，公开可注入的 `ctx.storageDomain` 服务及对应的 `ctx.storage.domain` 投影。一个领域通过 `defineDomain`（zod 记录 schema、从 `z.infer` 派生的类型）声明一次，通过 `DomainFacility.open` 打开，并由具有最终决定权的内存状态提供服务：读取同步执行；写入在每个领域各自的一条链上串行化，先在已路由后端达到持久状态，再更新内存并发出 `domain/changed`。打开领域的消费方负责管理句柄的生命周期，并通过 `Domain.close()` 释放它（幂等；通常作为其自身的 `ctx.effect` 资源释放函数）；插件卸载时，该设施会关闭仍处于打开状态的领域。\n\n设计原理、打开语义和存储／领域分层见 [Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)。\n\n## 配置\n\n| key | 含义 |\n| --- | --- |\n| `backend` | 每个领域的默认后端名称（必填；不存在普遍适用的存储介质）。 |\n| `routes` | 逐领域覆盖：领域名称 → 后端名称。 |\n\n## 模型体验\n\n### 持久领域状态\n\n#### 模型看到的内容\n\n无。该包不注册工具、不注入提示词，也不追加会话事件；它在 `ctx.storageDomain` 后面存储非会话数据（工作区记录、未来的会话伴随数据），只发出进程内 `domain/changed` 事件。只有 Consumer 包通过自身有文档说明的接口呈现该事件时，它才会到达模型。\n\n#### Token 影响\n\n为零。该包的文本不会进入任何模型请求。\n\n#### KV Cache 影响\n\n相互独立：领域读写绝不触碰请求前缀，因此这里没有任何内容能使提供方缓存复用失效。\n\n## 已知限制与暂缓事项\n\n- **变更只在单进程内可见**：`domain/changed` 是进程内事件；在 Agent Note 暂缓的跨进程修订模式落地前，第二个主机进程或重新连接的 GUI 无法观察变更。\n- **没有跨表事务、二级索引或多段键**：每次写入只触碰一条记录；这些扩展的触发点和返工点列在 Agent Note 的暂缓工作清单中。\n","readmeFilename":"README.zh.md","_rev":"1-eba07de0743e3e914a8882c3195c6e44"}