summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-common
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-07 10:35:09 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-07 10:35:09 +0200
commit2c0903c648e24b4e2adf20492398e8b67d033b49 (patch)
tree0435f298010f0f946362f28baebbe88337ca8768 /packages/meshbay-common
parent0ed078c92cabab1dab0f70f321562032ea549ce6 (diff)
parenteeda274d751c537f4ecef3087994a16a9517478f (diff)
downloadmeshbay-2c0903c648e24b4e2adf20492398e8b67d033b49.tar.gz
Merge branch 'refactor/groups-phase1'
Groups refactor, phases 1-3. The root model replaces the old `upload` flag and group-wide `member_upload` with per-root `writable`/`removable`/`ejected`, carried by a `RootSet` that both front doors — the loopback API and signed MNP — reach through the same `ops` functions. MNP goes to 1.1, additively: the roots table now rides on `index_delta`, so a root added, removed, ejected or plugged reaches every connected client instead of only whoever reloaded. The group UI becomes a plugin architecture: an application is a registry entry in `apps.js` plus its own files, with directories stored generically by `ops.set_app_directories` under whatever the app is called. A reference application, hidden behind `?dev=1`, is what makes that claim testable — adding it is what found the two places still naming apps by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011pvMdvLBG92jyhvD5pD6us
Diffstat (limited to 'packages/meshbay-common')
-rw-r--r--packages/meshbay-common/src/meshbay_common/__init__.py2
-rw-r--r--packages/meshbay-common/src/meshbay_common/adminop.py9
-rw-r--r--packages/meshbay-common/src/meshbay_common/protocol.py18
3 files changed, 28 insertions, 1 deletions
diff --git a/packages/meshbay-common/src/meshbay_common/__init__.py b/packages/meshbay-common/src/meshbay_common/__init__.py
index bf74052..b3e24e3 100644
--- a/packages/meshbay-common/src/meshbay_common/__init__.py
+++ b/packages/meshbay-common/src/meshbay_common/__init__.py
@@ -93,5 +93,5 @@ __version__ = "0.11.0"
# The index at rest, `index_progress` (counters only, never a path — see
# `groupbox.py` and daemon.py `_push_index_progress`), chat, and file content
# on the operator's disk are all deliberately unchanged.
-MNP_VERSION = "1.0"
+MNP_VERSION = "1.1"
MHP_VERSION = "0.1"
diff --git a/packages/meshbay-common/src/meshbay_common/adminop.py b/packages/meshbay-common/src/meshbay_common/adminop.py
index 762a2d1..9a56934 100644
--- a/packages/meshbay-common/src/meshbay_common/adminop.py
+++ b/packages/meshbay-common/src/meshbay_common/adminop.py
@@ -106,6 +106,15 @@ OP_AUDIO_ROOT = "audio_root"
OP_PHOTO_ROOTS = "photo_roots"
OP_ROOT_ADD = "root_add"
OP_ROOT_REMOVE = "root_remove"
+# One op for every application's directories. The subject is
+# "<app>:<comma-joined sorted paths>" so what the operator is shown before
+# signing names both the app and the outcome — "video_root" alone said neither.
+OP_APP_DIRECTORIES = "app_directories"
+OP_CHAT_DIRECTORY = "chat_directory"
+OP_CHAT_LINK_PREVIEW = "chat_link_preview"
+OP_ROOT_UPDATE = "root_update"
+OP_ROOT_EJECT = "root_eject"
+OP_ROOT_PLUG = "root_plug"
OP_GROUP_ATTACH = "group_attach"
OP_GROUP_DETACH = "group_detach"
# OP_GEK_BUNDLE_STORE is gone. Members no longer hand the node key material at
diff --git a/packages/meshbay-common/src/meshbay_common/protocol.py b/packages/meshbay-common/src/meshbay_common/protocol.py
index e502379..689adbf 100644
--- a/packages/meshbay-common/src/meshbay_common/protocol.py
+++ b/packages/meshbay-common/src/meshbay_common/protocol.py
@@ -164,6 +164,24 @@ class MNP:
ROOT_ADD_ACK = "root_add_ack" # node → operator: confirmed
ROOT_REMOVE = "root_remove" # operator → node: remove a root from a group
ROOT_REMOVE_ACK = "root_remove_ack" # node → operator: confirmed
+ # One message for every application's directories, keyed by the app's own
+ # name — adding an app adds no message type. VIDEO_ROOT / AUDIO_ROOT /
+ # PHOTO_ROOTS above are the same instruction under three earlier names and
+ # are still handled, for clients that predate this.
+ APP_DIRECTORIES = "app_directories" # operator → node: an app's folder(s)
+ APP_DIRECTORIES_ACK = "app_directories_ack"
+ # Chat's own two: where attachments are written (a destination, so it must
+ # be a read-write root), and whether the node unfurls links members post.
+ CHAT_DIRECTORY = "chat_directory"
+ CHAT_DIRECTORY_ACK = "chat_directory_ack"
+ CHAT_LINK_PREVIEW = "chat_link_preview"
+ CHAT_LINK_PREVIEW_ACK = "chat_link_preview_ack"
+ ROOT_UPDATE = "root_update" # operator → node: change writable/removable on a root
+ ROOT_UPDATE_ACK = "root_update_ack"
+ ROOT_EJECT = "root_eject" # operator → node: mark removable root as ejected
+ ROOT_EJECT_ACK = "root_eject_ack"
+ ROOT_PLUG = "root_plug" # operator → node: re-enable an ejected root
+ ROOT_PLUG_ACK = "root_plug_ack"
ROSTER_READ = "roster_read" # operator → node: list pinned identities + members
ROSTER_READ_ACK = "roster_read_ack"
DENYLIST_READ = "denylist_read" # operator → node: show denylist entries