@cero-base/cero 3.4.1 → 3.6.0

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/README.md CHANGED
@@ -67,17 +67,17 @@ That is a working, encrypted, offline-first, peer-to-peer app. Your phrase, `awa
67
67
 
68
68
  ## Exports
69
69
 
70
- | Subpath | What it gives you |
71
- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
72
- | `@cero-base/cero` | `cero`, `t`, `schema`, `restore`, `peek`, the 24 operators, `Handle`, `Ref`, `Local` |
73
- | `@cero-base/cero/build` | `build(specDir, schema, opts)` |
74
- | `@cero-base/cero/server` | `serve(ipc, spec, opts)` and `Server`, the worker that owns the data |
75
- | `@cero-base/cero/client` | `cero(ipc, spec)` (also `connect`), `Client`, `restore`, `t`, `schema` and every operator but `before`, `after` and `tx`, for a UI process |
76
- | `@cero-base/cero/extensions` | `profileSync`, `handleSync`, `bundled`, `extensionsOf`, and a light `cero` with `t`, `schema` and the operators, for extension modules |
70
+ | Subpath | What it gives you |
71
+ | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
72
+ | `@cero-base/cero` | `cero`, `t`, `schema`, `restore`, `peek`, the 30 operators, `Handle`, `Ref`, `Local` |
73
+ | `@cero-base/cero/build` | `build(specDir, schema, opts)` |
74
+ | `@cero-base/cero/server` | `serve(ipc, spec, opts)` and `Server`, the worker that owns the data |
75
+ | `@cero-base/cero/client` | `cero(ipc, spec)` (also `connect`), `Client`, `restore`, `t`, `schema` and every operator but `before`, `after` and `tx`, for a UI process |
76
+ | `@cero-base/cero/extensions` | `profileSync`, `handleSync`, `calls`, `bundled`, `extensionsOf`, and a light `cero` with `t`, `schema` and the operators, for extension modules |
77
77
 
78
- The 24 operators, each also on the facade as `cero.put` and so on: `put`, `set`, `get`, `del`, `watch`, `call`, `open`, `tx`, `invite`, `revoke`, `rotate`, `accept`, `deny`, `leave`, `close`, `cancel`, `suspend`, `resume`, `activate`, `deactivate`, `phrase`, `nearby`, `before`, `after`.
78
+ The 30 operators, each also on the facade as `cero.put` and so on: `put`, `set`, `get`, `del`, `watch`, `call`, `open`, `tx`, `invite`, `revoke`, `rotate`, `accept`, `deny`, `leave`, `close`, `cancel`, `suspend`, `resume`, `activate`, `deactivate`, `phrase`, `nearby`, `before`, `after`, `dial`, `end`, `mute`, `unmute`, `share`, `unshare`.
79
79
 
80
- Built on the [Pear](https://pears.com) stack: Hypercore, Autobee, HyperDB, Hyperblobs, Hyperswarm, blind-peering and Bare. Runs on Node and Bare, with TypeScript declarations.
80
+ Built on the [Pear](https://pears.com) stack: Hypercore, Autobee, HyperDB, Hyperblobs, Hyperjoin, blind-peering and Bare. Runs on Node and Bare, with TypeScript declarations.
81
81
 
82
82
  ## License
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cero-base/cero",
3
- "version": "3.4.1",
3
+ "version": "3.6.0",
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,
@@ -52,6 +52,11 @@
52
52
  "./push/firebase": {
53
53
  "types": "./types/push/firebase.d.ts",
54
54
  "default": "./src/push/firebase.js"
55
+ },
56
+ "./internal/pulse": {
57
+ "bare": "./src/lib/pulse.js",
58
+ "node": "./src/lib/pulse.js",
59
+ "default": "./src/lib/pulse-ui.js"
55
60
  }
56
61
  },
57
62
  "typesVersions": {
@@ -100,6 +105,10 @@
100
105
  "process": {
101
106
  "bare": "bare-process",
102
107
  "default": "process"
108
+ },
109
+ "child_process": {
110
+ "bare": "bare-subprocess",
111
+ "default": "child_process"
103
112
  }
104
113
  },
105
114
  "scripts": {
@@ -113,27 +122,29 @@
113
122
  "test:node": "find test -name '*.test.js' | sort | xargs -P4 -n1 brittle-node"
114
123
  },
115
124
  "dependencies": {
116
- "@cero-base/core": "^3.4.1",
125
+ "@cero-base/core": "^3.6.0",
117
126
  "b4a": "^1.9.0",
118
127
  "bare-abort-controller": "^1.1.2",
119
128
  "bare-crypto": "^1.16.1",
120
- "bare-fs": "^4.8.5",
129
+ "bare-fs": "^4.8.7",
121
130
  "bare-path": "^3.1.3",
122
131
  "ble-swarm": "^2.4.0",
123
- "compact-encoding": "^3.7.0",
132
+ "compact-encoding": "^3.7.1",
124
133
  "corestore": "^7.16.1",
125
134
  "fd-lock": "^2.2.0",
126
135
  "hrpc": "^4.3.2",
127
- "hypercore": "^11.40.4",
136
+ "hypercore": "^11.40.5",
128
137
  "hypercore-crypto": "^3.7.0",
129
138
  "hypercore-id-encoding": "^1.3.0",
130
139
  "hypercore-storage": "^3.4.0",
131
140
  "hyperdb": "^6.11.2",
132
141
  "hyperdispatch": "^1.6.0",
133
142
  "hyperschema": "^1.26.2",
143
+ "hypertracker": "^2.4.4",
134
144
  "protomux": "^3.13.1",
135
145
  "ready-resource": "^1.2.0",
136
146
  "safety-catch": "^1.0.3",
147
+ "sdp-transform": "^3.0.0",
137
148
  "streamx": "^2.28.1",
138
149
  "suspendify": "^1.7.2",
139
150
  "z32": "^1.1.0"
@@ -143,9 +154,10 @@
143
154
  "bare-events": "^2.9.2",
144
155
  "bare-fetch": "^3.5.0",
145
156
  "bare-process": "^4.5.1",
157
+ "bare-subprocess": "^6.2.3",
146
158
  "bare-url": "^2.5.8",
147
- "blind-peer": "^3.18.3",
148
- "brittle": "^4.5.0",
159
+ "blind-peer": "^3.20.1",
160
+ "brittle": "^4.6.0",
149
161
  "typescript": "^7.0.2"
150
162
  },
151
163
  "license": "Apache-2.0"
@@ -60,7 +60,12 @@ export async function build(specDir, schema, { ns = NS, extensions } = {}) {
60
60
  }
61
61
  }
62
62
  fold(raw, defs, false)
63
- for (const ext of exts) if (ext.schema) fold(ext.schema, defs, true)
63
+ for (const ext of exts) {
64
+ // a schema that is a function reaches the handle types the app has
65
+ const types = Object.keys(defs).filter((k) => k !== 'local' && isPlainHandle(defs[k]))
66
+ const schema = typeof ext.schema === 'function' ? ext.schema(types) : ext.schema
67
+ if (schema) fold(schema, defs, true)
68
+ }
64
69
 
65
70
  const main = compile(splitMain(defs), ns, 'main', true)
66
71
  const local = compile(defs.local || {}, ns, 'local')
@@ -235,6 +235,31 @@ export const main = {
235
235
  by: string,
236
236
  pass: required(bytes),
237
237
  createdAt: uint
238
+ },
239
+ // another device on a call, as a line's `peers` gives it: computed on read, never stored
240
+ 'line-peer': {
241
+ id: required(string),
242
+ member: string,
243
+ audio: bool,
244
+ video: bool,
245
+ sharing: bool,
246
+ connected: bool,
247
+ reconnecting: bool
248
+ },
249
+ // this device's microphone, camera and screen as its row shows them
250
+ 'line-lanes': {
251
+ id: required(string),
252
+ audio: bool,
253
+ video: bool,
254
+ screen: bool
255
+ },
256
+ // for the UI's WebRTC: the local port a device's media crosses, and the description it sent last
257
+ 'line-port': {
258
+ id: required(string),
259
+ port: required(uint),
260
+ seq: uint,
261
+ type: string,
262
+ sdp: string
238
263
  }
239
264
  }
240
265