@cero-base/cero 2.1.0 → 2.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cero-base/cero",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "The ideal p2p API — everything is a handle, handles contain refs, refs contain rows.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -18,7 +18,8 @@
18
18
  "src",
19
19
  "types",
20
20
  "README.md",
21
- "LICENSE"
21
+ "LICENSE",
22
+ "!src/**/CLAUDE.md"
22
23
  ],
23
24
  "publishConfig": {
24
25
  "access": "public"
@@ -98,7 +99,7 @@
98
99
  "test:node": "find test -name '*.test.js' | sort | xargs -P1 -n1 brittle-node"
99
100
  },
100
101
  "dependencies": {
101
- "@cero-base/core": "^2.1.0",
102
+ "@cero-base/core": "^2.1.2",
102
103
  "b4a": "^1.8.1",
103
104
  "bare-abort-controller": "^1.1.2",
104
105
  "bare-crypto": "^1.15.3",
package/src/rpc/server.js CHANGED
@@ -89,7 +89,11 @@ export class Server extends RPCServer {
89
89
  /** Wire the `init` handler that lazily constructs the root cero handle. */
90
90
  _wireInit() {
91
91
  this.rpc.onInit(async () => {
92
- if (this.me) throw CeroError.CONFLICT('already initialized')
92
+ // a reloaded UI is a new client on the same worker: it re-attaches, its old streams end
93
+ if (this.me) {
94
+ for (const handle of this._watchStreams.keys()) this._endWatches(handle)
95
+ return this._identity()
96
+ }
93
97
  this.me = await cero(this.storage, this.spec, this.opts)
94
98
  this.handles.set(this.me.id, this.me)
95
99
  await this.me.fileServer.listen()