chadtmiller.com/group-host
atmosphere group host
0
0
A group takes a handle on its own domain from the console or command
crates/group-host-mcp/src/lib.rs+10−0
| @@ -41,6 +41,7 @@ const LEXICONS: &[(&str, &str)] = &[ | ||
lexicon!("getGroup"), | ||
lexicon!("deactivateGroup"), | ||
lexicon!("activateGroup"), | ||
lexicon!("updateGroupHandle"), | ||
lexicon!("listMembers"), | ||
lexicon!("listJoinRequests"), | ||
lexicon!("denyJoinRequest"), | ||
| @@ -325,6 +326,15 @@ const TOOLS: &[(&str, &[&str], &str, Made)] = &[ | ||
could switch it off switches it back on. With undo, switches it back on.", | ||
Made::Method("deactivateGroup", Some("activateGroup")), | ||
), | ||
( | ||
"group_handle", | ||
&["handle"], | ||
"Gives the group a handle on a domain of its own, once the domain names the group: an \ | ||
_atproto TXT record there saying did=<the group's DID>, or the DID at the domain's \ | ||
/.well-known/atproto-did. Given the group's own address, gives it that back. The \ | ||
group's site stays at its address either way.", | ||
Made::Method("updateGroupHandle", None), | ||
), | ||
( | ||
"profile_set", | ||
&[], | ||
crates/group-host-mcp/tests/protocol.rs+1−0
| @@ -32,6 +32,7 @@ fn names_each_tool_for_its_command() { | ||
[ | ||
"group_show", | ||
"group_deactivate", | ||
"group_handle", | ||
"profile_set", | ||
"rule_set", | ||
"rule_delete", | ||
crates/opensocial/src/lib.rs+3−0
| @@ -33,6 +33,9 @@ group | ||
group deactivate <group> [--undo] | ||
switch a group off, so nothing reads or writes it, or with | ||
--undo switch it back on | ||
group handle <group> <handle> | ||
give a group a handle on a domain of its own, once the domain | ||
names it, or its own address back | ||
group delete <group> delete a group, its spaces and its identity, for good | ||
profile | ||
profile set <group> [--display-name <name>] [--join-policy <policy>] [--description <words>] … | ||
crates/opensocial/tests/commands.rs+21−0
| @@ -429,6 +429,27 @@ async fn writes_the_groups_rules_roles_and_profile() { | ||
assert_eq!(resolved["subject"]["did"], bob.as_str(), "{resolved}"); | ||
} | ||
| ||
#[tokio::test] | ||
async fn gives_a_group_a_handle_only_on_a_domain_that_names_it() { | ||
let h = host().await; | ||
let (alice, bob) = (env(&h, 0), env(&h, 1)); | ||
let made = ok(&alice, &["group", "create", "riders.groups.test"]).await; | ||
let did = made.split_whitespace().nth(2).unwrap().to_string(); | ||
// Only one who runs it; a domain that doesn't name the group, refused | ||
// with what its record should say. | ||
let said_so = fails(&bob, &["group", "handle", &did, "riders.test"]).await; | ||
assert!(said_so.contains("403"), "{said_so}"); | ||
let said_so = fails(&alice, &["group", "handle", &did, "riders.test"]).await; | ||
assert!(said_so.contains("NotPointing"), "{said_so}"); | ||
assert!(said_so.contains(&format!("did={did}")), "{said_so}"); | ||
// Its own address is always its own. | ||
let kept = ok(&alice, &["group", "handle", &did, "riders.groups.test"]).await; | ||
assert!( | ||
kept.contains("\"handle\": \"riders.groups.test\""), | ||
"{kept}" | ||
); | ||
} | ||
| ||
#[tokio::test] | ||
async fn switches_a_group_off_and_on_and_deletes_it() { | ||
let h = host().await; | ||
docs/design/groups.md+8−0
| @@ -249,6 +249,14 @@ host's own record, updates the group's DID document with the host's | ||
rotation key, and tells relays. If the directory refuses the update, the | ||
host puts the group's previous handle back. It fails when the domain does not name the group, or when | ||
the host's key no longer controls the DID. Both are for `group.configure`. | ||
The group's site stays at its address whatever its handle ([sites](sites.md)). | ||
| ||
In the console, the profile page of a group's settings shows its handle, | ||
and, while it is a domain of its own, whether the domain still names it. | ||
"Use your own domain" takes the domain, showing the `_atproto` TXT record | ||
to add there, `did=` and the group's DID; "Go back" gives it its address | ||
back, asked to be sure of. The command is `group | ||
handle`; an MCP client's tool is `group_handle`. | ||
| ||
## Switching off, on and deleting | ||
| ||
docs/guides/shots/apps-activity-dark.png+0−0
A binary file, not shown.
docs/guides/shots/apps-activity.png+0−0
A binary file, not shown.
docs/guides/shots/apps-made-dark.png+0−0
A binary file, not shown.
docs/guides/shots/apps-made.png+0−0
A binary file, not shown.
docs/guides/shots/apps-revoke-access-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-remove-dialog-dark.png+0−0
A binary file, not shown.
docs/guides/shots/moderating-remove-dialog.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-added-dark.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-added.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-dialog-dark.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-dialog.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-refused-dark.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-refused.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-removed-dark.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-removed.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-tab-dark.png+0−0
A binary file, not shown.
docs/guides/shots/recovery-tab.png+0−0
A binary file, not shown.
docs/guides/shots/rules-add-dark.png+0−0
A binary file, not shown.
docs/guides/shots/rules-create-role-dark.png+0−0
A binary file, not shown.
docs/guides/shots/rules-delete-dark.png+0−0
A binary file, not shown.
docs/guides/shots/rules-give-dark.png+0−0
A binary file, not shown.
docs/guides/shots/rules-member-dark.png+0−0
A binary file, not shown.
docs/guides/shots/starting-avatar-dark.png+0−0
A binary file, not shown.
docs/guides/shots/starting-avatar.png+0−0
A binary file, not shown.
docs/guides/shots/starting-card-done-dark.png+0−0
A binary file, not shown.
docs/guides/shots/starting-words.txt+7−0
| @@ -310,6 +310,13 @@ | ||
- paragraph: Hiding it stops new people finding it. It can't undo what people have already seen. | ||
- button "Save who sees it": Save | ||
- status | ||
- heading "Handle" [level=2] | ||
- button "Use your own domain" | ||
- paragraph: The name the group goes by in Bluesky and other apps. Its address here, bookclub.groups.test, and its site keep working whichever you use. | ||
- list: | ||
- listitem: | ||
- strong: bookclub.groups.test | ||
- text: The address this host gave it. | ||
- heading "Switch off or delete the group" [level=2] | ||
- paragraph: Switching the group off hides it from everyone until an admin switches it back on. Deleting it can't be undone. | ||
- button "Switch off" | ||
docs/reference/cli.md+1−0
| @@ -54,6 +54,7 @@ an MCP client acts in one group. | ||
| `group seed <handle>` | a group to try things on, joined by approval: two rules, a moderator role (`mod.read`, `mod.resolve`, `label`) that the founder may give, written as the group, and an invite for each of `OPENSOCIAL_SEED_INVITE` | | ||
| `group move <group> --to <address> [--to-did <did>]` | moves a group, whole, from this host to another, making the four calls in turn; run again after a run that handed it over but could not switch it on, it switches it on; `--to-did` is the did:web of `--to` if not given ([moving](../design/moving.md)) | | ||
| `group deactivate <group> [--undo]` | switches the group off, so nothing reads its spaces or writes as it; with `--undo`, switches it back on, for one who held `group.configure` when it went off ([switching off](../design/groups.md#switching-off-on-and-deleting)) | | ||
| `group handle <group> <handle>` | gives the group a handle on a domain of its own, once the domain names it, or its own address back; refused with `NotPointing`, saying what the domain's `_atproto` record should be, until it does ([a handle on its own domain](../design/groups.md#a-handle-on-its-own-domain)) | | ||
| `group delete <group>` | deletes the group, its spaces and its account here, for good, and prints whether its DID was ended or left to the holders of its recovery keys | | ||
| ||
### profile | ||
docs/reference/mcp.md+1−0
| @@ -69,6 +69,7 @@ its icon. | ||
| --- | --- | --- | --- | | ||
| `group_show` | `group show` | `fyi.opensocial.getGroup` | the group as the member may see it: its profile, rules, how many are in it, roles and spaces | | ||
| `group_deactivate` | `group deactivate` | `fyi.opensocial.deactivateGroup` | switches the group off; with `undo`, `fyi.opensocial.activateGroup` switches it back on | | ||
| `group_handle` | `group handle` | `fyi.opensocial.updateGroupHandle` | gives the group a handle on a domain that names it, or its own address back | | ||
| ||
## profile | ||
| ||
harness/e2e/flows.spec.mjs+24−0
| @@ -695,6 +695,30 @@ test("hiding a group's profile, and showing it again", async () => { | ||
await expect.poll(listed).toBe(true); | ||
}); | ||
| ||
test("asking for a handle on a domain that doesn't point to the group yet", async () => { | ||
await page.goto(url('/g/hikers.groups.test/settings')); | ||
const handles = page.locator('.handles'); | ||
await expect(handles.getByText('hikers.groups.test', { exact: true })).toBeVisible(); | ||
await page.getByRole('button', { name: 'Use your own domain' }).click(); | ||
const using = page.getByRole('dialog', { name: 'Use your own domain' }); | ||
// The record to add points to the group, at the domain as it is typed. | ||
const { did } = await fetch( | ||
`${world.host}/xrpc/com.atproto.identity.resolveHandle?handle=hikers.groups.test` | ||
).then((r) => r.json()); | ||
await expect(using.getByText(`did=${did}`, { exact: true })).toBeVisible(); | ||
await using.getByLabel('Domain').fill('Hikers.test'); | ||
const name = using.getByText('_atproto.hikers.test', { exact: true }); | ||
await expect(name).toBeVisible(); | ||
// Refused in the reader's words, the dialog open with what was typed, | ||
// and the record's name with it. | ||
await using.getByRole('button', { name: 'Use', exact: true }).click(); | ||
await expect( | ||
using.getByText("hikers.test doesn't point to this group yet.", { exact: false }) | ||
).toBeVisible(); | ||
await expect(using.getByLabel('Domain')).toHaveValue('Hikers.test'); | ||
await expect(name).toBeVisible(); | ||
}); | ||
| ||
test('adding a rule, and taking it away', async () => { | ||
// Settings has a page for each part, reached by its tabs. | ||
await page.goto(url('/g/hikers.groups.test/settings')); | ||
web/src/lib/organisms/ConnectAiApp.svelte+1−1
| @@ -18,7 +18,7 @@ | ||
<span class="ordinal">1</span> | ||
<div class="step"> | ||
<strong>Add this address to your AI app as a connector</strong> | ||
<div class="address"><code>{mcp}</code><Copy text={mcp} /></div> | ||
<div class="copyable"><code>{mcp}</code><Copy text={mcp} /></div> | ||
</div> | ||
</li> | ||
<li> | ||