| … | … | @@ -38,8 +38,9 @@ NEW (1 Autobase type, all keet-core): |
| 38 | 38 | |
| 39 | 39 | | Capability | How | Multi-writer? | |
| 40 | 40 | |-----------|-----|--------------| |
| 41 | | | Arbitrary key-value metadata | `setConfig(roomId, key, value)` | Yes (any admin) | |
| 42 | | | Structured data exchange | Messages with JSON payloads | Yes (any member) | |
| 41 | | Built-in metadata | `setConfig(roomId, key, value)` — 5 keys: title, description, avatar, supportedLanguages, blindPeers | Yes (any moderator+) | |
| 42 | | Custom metadata | Pinned `_hs:room-meta` message (topics, type, discoverable, etc.) | Yes (any admin can edit) | |
| 43 | | Structured data exchange | Messages with `_hs` JSON payloads | Yes (any member) | |
| 43 | 44 | | Access control | Roles: admin, moderator, peer, read-only | Yes (admin manages) | |
| 44 | 45 | | Identity | Member profiles: name, avatar, username | Yes (each member) | |
| 45 | 46 | | Replication | Hyperswarm + Autobase | Automatic | |
| … | … | @@ -47,6 +48,8 @@ NEW (1 Autobase type, all keet-core): |
| 47 | 48 | | Invites | `createInvitation(roomId)` | Yes (admin) | |
| 48 | 49 | | Real-time updates | Push events via subscription | Automatic | |
| 49 | 50 | |
| 51 | **Note on config:** keet-core's `setConfig` only supports 5 predefined keys. Custom metadata (topics, type, discoverable, bridgedTo, etc.) is stored as a pinned `_hs:room-meta` message in the room. This is consistent with all other hyper-social conventions — everything custom goes through `_hs` messages. |
| 52 | |
| 50 | 53 | Every feature that a "discovery registry Autobase" provides is already available through room primitives. The registry was a room with extra steps. |
| 51 | 54 | |
| 52 | 55 | ## Room Types (Convention, Not Code) |
| … | … | @@ -56,17 +59,15 @@ A room's purpose is declared by a config key. No new Autobase schemas. No new da |
| 56 | 59 | ### Chat Room (default) |
| 57 | 60 | |
| 58 | 61 | ```javascript |
| 62 | // keet-core built-in config (5 keys only): |
| 59 | 63 | room.config = { |
| 60 | | type: "chat", // or absent — default behavior |
| 61 | 64 | title: "Rust P2P Dev", |
| 62 | 65 | description: "Building distributed systems in Rust", |
| 63 | | topics: ["rust", "p2p", "systems"], |
| 64 | | discoverable: true, // opt-in to DHT topic announcement |
| 65 | | bridgedTo: [ // set by bridge bots when they connect |
| 66 | | { platform: "irc", network: "libera", channel: "#rust-p2p" } |
| 67 | | ], |
| 68 | | relatedRooms: ["roomId1", "roomId2"] // admin-curated links |
| 66 | avatar: { small: "...", ... } |
| 69 | 67 | } |
| 68 | |
| 69 | // Pinned _hs:room-meta message (custom metadata): |
| 70 | {"_hs":"room-meta","type":"chat","topics":["rust","p2p","systems"],"discoverable":true,"bridgedTo":[{"platform":"irc","network":"libera","channel":"#rust-p2p"}],"relatedRooms":["roomId1","roomId2"]} |
| 70 | 71 | ``` |
| 71 | 72 | |
| 72 | 73 | ### Registry Room |
| … | … | @@ -74,15 +75,16 @@ room.config = { |
| 74 | 75 | A room whose purpose is listing other rooms. Members post structured messages as room listings. The room's membership and roles control who can list rooms. |
| 75 | 76 | |
| 76 | 77 | ```javascript |
| 78 | // keet-core built-in config: |
| 77 | 79 | room.config = { |
| 78 | | type: "registry", |
| 79 | 80 | title: "Berlin P2P Meetup", |
| 80 | 81 | description: "Rooms for the Berlin Hypercore community", |
| 81 | | topics: ["berlin", "p2p", "meetup"], |
| 82 | | avatar_small: "base64...", // group icon |
| 83 | | avatar_large: "base64..." |
| 82 | avatar: { small: "base64...", ... } |
| 84 | 83 | } |
| 85 | 84 | |
| 85 | // Pinned _hs:room-meta message: |
| 86 | {"_hs":"room-meta","type":"registry","topics":["berlin","p2p","meetup"]} |
| 87 | |
| 86 | 88 | // Listing a room = posting a structured message: |
| 87 | 89 | { |
| 88 | 90 | type: "room-listing", |
| … | … | @@ -178,7 +180,18 @@ The client provides a "Share Room" action: pick a room, pick contacts from your |
| 178 | 180 | |
| 179 | 181 | ## Room Metadata Vocabulary |
| 180 | 182 | |
| 181 | | These are conventions for `setConfig` keys. No code changes to keet-core needed. Any room can use any of these. |
| 183 | Room metadata lives in two places: |
| 184 | |
| 185 | **keet-core config** (5 built-in keys, moderator+ can write): |
| 186 | ``` |
| 187 | title : string — Room title (built-in) |
| 188 | description : string — Room description (built-in) |
| 189 | avatar : object — Room avatar with small/large (built-in) |
| 190 | supportedLanguages : string — Language codes (built-in) |
| 191 | blindPeers : array — Blind peer mirrors (built-in) |
| 192 | ``` |
| 193 | |
| 194 | **`_hs:room-meta` pinned message** (unlimited custom keys, admin can edit): |
| 182 | 195 | |
| 183 | 196 | ### Content Metadata |
| 184 | 197 | |
| … | … | @@ -195,7 +208,7 @@ Enables: content-based clustering, DHT topic discovery, search. |
| 195 | 208 | ``` |
| 196 | 209 | relatedRooms : string[] — ["roomId1", "roomId2"] (admin-curated links) |
| 197 | 210 | parentRoom : string — "roomIdX" (thread/sub-room relationship) |
| 198 | | bridgedTo : object[] — [{platform, network, channel}] (set by bridge bots) |
| 211 | bridgedTo : object[] — [{platform, network, channel}] (admin sets after bridge announces) |
| 199 | 212 | ``` |
| 200 | 213 | |
| 201 | 214 | Enables: explicit graph edges, hierarchy, cross-platform topology. |
| … | … | @@ -203,7 +216,7 @@ Enables: explicit graph edges, hierarchy, cross-platform topology. |
| 203 | 216 | ### Discovery Metadata |
| 204 | 217 | |
| 205 | 218 | ``` |
| 206 | | discoverable : "true" — opt-in to DHT topic announcement |
| 219 | discoverable : boolean — opt-in to DHT topic announcement |
| 207 | 220 | invitePolicy : string — "open" | "invite-only" | "approval" |
| 208 | 221 | publicDescription : string — what non-members see (may differ from description) |
| 209 | 222 | ``` |
| … | … | @@ -213,7 +226,7 @@ Enables: DHT discovery, invite flow, privacy control. |
| 213 | 226 | ### Type Metadata |
| 214 | 227 | |
| 215 | 228 | ``` |
| 216 | | type : string — "chat" | "registry" | "dm" (RoomType=2, set by keet-core) |
| 229 | type : string — "chat" | "registry" (DMs are RoomType=2, set by keet-core) |
| 217 | 230 | ``` |
| 218 | 231 | |
| 219 | 232 | Enables: room type conventions, UI behavior switching. |
| … | … | @@ -551,7 +564,7 @@ Each step is independently deployable. The existing app works at every stage. |
| 551 | 564 | |
| 552 | 565 | ### Step 1: Add room metadata conventions |
| 553 | 566 | |
| 554 | | Set `topics`, `discoverable`, `type` on rooms via `setConfig`. No Autobase changes. No UI changes. Just establishing conventions. |
| 567 | Add `_hs:room-meta` message support to keet-daemon. A room's custom metadata (topics, type, discoverable, etc.) is stored as a pinned `_hs:room-meta` message. keet-core's built-in config (title, description, avatar) stays as-is — only 5 predefined keys are supported by keet-core. New daemon routes: `meta.get(roomId)`, `meta.set(roomId, metadata)`. No Autobase changes. No UI changes yet. Just establishing conventions and the message-based metadata layer. |
| 555 | 568 | |
| 556 | 569 | ### Step 2: Add DM support to godot-keet |
| 557 | 570 | |
| … | … | @@ -629,6 +642,9 @@ Rendering: clients that understand _hs render type-specific UI cards |
| 629 | 642 | **Message types:** |
| 630 | 643 | |
| 631 | 644 | ```javascript |
| 645 | // Room metadata (pinned in any room — the room's custom config) |
| 646 | {"_hs":"room-meta","type":"chat","topics":["rust","p2p"],"discoverable":true,"category":"development","language":"en","relatedRooms":["roomId1"],"bridgedTo":[{"platform":"irc","network":"libera","channel":"#rust-p2p"}]} |
| 647 | |
| 632 | 648 | // Room share (posted in DMs) |
| 633 | 649 | {"_hs":"room-share","roomId":"abc123","title":"Rust P2P Dev","topics":["rust","p2p"],"inviteToken":"xyz789","sharedAt":1708402400000} |
| 634 | 650 | |
| … | … | @@ -640,6 +656,9 @@ Rendering: clients that understand _hs render type-specific UI cards |
| 640 | 656 | |
| 641 | 657 | // Wiki entry (posted in any room, pinnable) |
| 642 | 658 | {"_hs":"wiki","title":"How to set up Hyperswarm","content":"## Step 1\n\nInstall the package...","editedBy":"member:alice0","editedAt":1708402400000} |
| 659 | |
| 660 | // Bridge announcement (posted by bridge bot, admin endorses via room-meta) |
| 661 | {"_hs":"bridge-announce","platform":"irc","network":"libera","channel":"#rust-p2p","botMember":"member:bridge-irc-bot0"} |
| 643 | 662 | ``` |
| 644 | 663 | |
| 645 | 664 | **Operations map to existing message APIs:** |