Skip to content

Latest commit

 

History

History
982 lines (824 loc) · 112 KB

multiplayer.md

File metadata and controls

982 lines (824 loc) · 112 KB

Part of the Intent JSON-RPC protocol docs — §5 Method Catalog.

5.48 Multiplayer — principals, invites, membership

Shared-host extension: §5.49 specifies the additive 10.9 contract, ahead of the pinned implementation. This section describes the 10.8 workspace-guest baseline. With the new capabilities, §5.49 replaces its owner-only workspace-management rules, live-forge invitation prerequisite, implicit identity lifecycle, rotating returning-credential behavior and global event/device restrictions. The existing identity triples, proof engines, guest rights and workspace-invitation lifetime rules remain the baseline.

Guest role extension: Workspace guest roles add an owner-assigned manager role under exact integer workspaceGuestRoles: 1. The existing collaborator wire role is displayed as Participant. This extension does not grant host membership or broaden canManage.

The multi-principal surface of a daemon: who a connection is, which workspaces it may see, how an owner invites a second person and how that person joins. Introduced within protocol 10.3 by the intentd multiplayer stack — principals and caller binding (intent-hq/intentd#1868), message attribution (#1869), membership and capability enforcement (#1870, #1877, #1871), invite links and the /invite join (#1872). The join was reworked within 10.4 from a host-run GitHub device flow (invite.redeem, removed by #1969) into the identity proof — invite.challenge / invite.prove with the guest-side github.identityProof.* (§5.27) (#1965, #1967) — plus the returning guest's invite.inspect / invite.accept (#1963), the owner-self-join refusal (#1986), reusable unpinned links (#1988) and the direct member add principal.list / workspace.members.add (#2023, #2025). Protocol 10.8 (versioning) makes the identity provider-neutral — a GitLab account is an identity: the additive Principal.identity triple, the pinProvider / pinHost pin params, the invite.prove provider / host / proofId params and the sourceControl.identityProof.* generalization of the guest-side proof (§5.27). The connection principal read principal.me is also summarized in §5.46 (client boot); presence, the ephemeral roster layered on top of membership, is §5.47.

Every method below is workspace-scoped unless stated otherwise. Five are fast paths: workspace.invite.create needs the listener's own pairing snapshot to build the link (like pairing.getInfo), and invite.inspect / invite.accept / invite.challenge / invite.prove are the only methods served on the unauthenticated /invite endpoint; the rest dispatch through the router. (invite.redeem, the pre-#1965 two-phase device-flow join, keeps its §5 fast-path catalog entry only until the intentd pin advances past its removal.)

Method Params Result
principal.me — (daemon-global, no workspaceId) { id, login, displayName, avatarUrl, isAdministrator, identity? } — the principal this connection was bound to at admission (never what client.hello claimed); login / displayName / avatarUrl are null until a forge identity is linked. identity? (10.8) is the provider-neutral triple (§ "Identity model"), omitted while unlinked. On the administrator a read also kicks a rate-limited background refresh of the primary's forge profile (never awaited; failures leave the cached row untouched)
principal.list — (daemon-global) { principals: { principalId, login: string | null, displayName: string | null, avatarUrl: string | null, githubUserId: integer | null, identity? }[] } — the host's credentialed guests: every non-primary principal holding at least one active (non-revoked) credential, in createdAt order; a guest that revoked itself is omitted (it cannot connect). Owner-only: a collaborator wire caller is -32003 Forbidden; the administrator, agents and the daemon pass. The four profile keys are always present, null when the cached profile lacks them (the principal.me / Member convention, not the omitted-key convention of WorkspaceInvite). Feeds the owner's share dialog for § "Direct member add". githubUserId stays populated (integer) for a github identity and is null otherwise; identity? (10.8) is the provider-neutral triple (§ "Identity model"), omitted while unlinked
principal.revokeSelf — (daemon-global) { revoked: true, credentials, workspaces } — the bound collaborator leaves every workspace it collaborates in (workspaces = memberships dropped) and revokes all its credentials (credentials = rows revoked); the daemon then closes its connections (below). The administrator is -32602 (rotate the server token or github.revoke instead)
workspace.members.list workspaceId (req) { members: Member[], guestCount, guestLimit } — the roster, owner included, plus the guest-seat spend (guestCount = collaborators + open invites; guestLimit = sharing.maxGuestsPerWorkspace, § "Guest cap"); Member+ (a non-member is -32602 { code: "not-found" }). Each Member row carries the principal's identity? (10.8) so a client can render the provider next to login
workspace.members.add workspaceId (req), principalId (req) { added: boolean, memberCount } — owner-only; attaches an existing credentialed guest (a principal.list row) as a collaborator without an invite (§ "Direct member add"). Idempotent: an existing member is { added: false, memberCount } and nothing is published. -32602 { code: "invalid-params" } for an unknown principal, the primary principal, or a principal without an active credential; -32602 { code: "guest-limit" } when the workspace's guest cap is spent; -32602 { code: "workspace-archived" } when the workspace is archived (checked inside the add's own write transaction — unarchive first). On an add, publishes the same workspace:updated { changes: { members: true, addedPrincipalId, memberCount } } as an invite join
workspace.members.remove workspaceId (req), principalId (req) { removed: boolean } — owner-only; removing the owner is -32602; a principalId that is not a member is { removed: false } (no error). On removal the member's queued user messages on the workspace's agents are dropped and workspace:updated { changes: { members: true, removedPrincipalId, memberCount } } is published
workspace.members.leave workspaceId (req) { left: boolean } — the bound collaborator drops its own membership (same teardown + event as remove); the owner is -32602 ("cannot leave"), a non-member -32602 { code: "not-found" }
workspace.invite.create (fast path) workspaceId (req), pinLogin?: string, pinProvider?: "github" | "gitlab" (10.8), pinHost?: string (10.8), expiresInSecs?: integer { invite: WorkspaceInvite, secret, url, hosts, port, fingerprint, version, tcAddress } — owner-only; mints an expiring invite — reusable until expiry or revocation when unpinned, single-use when pinned (§ "Reusable links") — and returns the raw secret exactly once, here. url is the intent://invite link (below), stamped identically as invite.url; port / fingerprint / tcAddress are the link envelope's parts and version its payload version (1). The envelope is tunnel-only on intentd (§ "Invite links"): tcAddress is always set and hosts is always [] (the key is kept for shape compatibility; a client must not expect direct hosts). An orchestrator with public hosts sets hosts and a null tcAddress instead (§ "Invite links", public-address route). pinProvider / pinHost say which forge pinLogin names (§ "Invite links"). An archived workspace is -32602 { code: "workspace-archived" } (checked before any forge lookup and again inside the insert's write transaction — nothing is minted). Publishes workspace:updated { changes: { invites: true } }
workspace.invite.list workspaceId (req) { invites: WorkspaceInvite[] } — the open invites (not revoked, not expired, and — pinned only — not redeemed; a reusable invite stays listed across its redemptions) in createdAt order; owner-only. The raw secret is never a field, but each row carries url? — the same link create returned, rebuilt from the stored secret — so an open link can be re-copied from a list row (url is omitted only when the row predates the stored secret or no link envelope resolves right now — no listener, or the tunnel is down). A row minted before the envelope became tunnel-only is rebuilt tunnel-only too
workspace.invite.revoke workspaceId (req), inviteId (req) { revoked: boolean } — owner-only; revoked: false when the invite was already closed; an inviteId unknown to this workspace is -32602 { code: "not-found" }. Publishes workspace:updated { changes: { invites: true } } when a row changed
invite.inspect (fast path, /invite only) inviteId (req), secret (req) { workspaceId, workspaceTitle, hostname, prettyHostname, collaborationName, pinIdentity } — previews an open invite for the consent prompt: the same validation as challenge (a miss or closed link answers its § "Errors" kind), no nonce issued, no forge contacted. pinIdentity (10.8) is the required identity triple or explicit null (§ "Selecting the guest identity"). hostname / prettyHostname are the host's (same sources as system.status), added by the /invite transport (#1963)
invite.accept (fast path, /invite only) inviteId (req), secret (req), credential (req) The returning guest's join: credential is a per-principal bearer this host minted on an earlier join; its hash resolves the principal exactly like the /ws bearer gate (unknown or revoked ⇒ credential-invalid; the primary's own ⇒ owner-self-join). The invite is validated like inspect, a pin is checked against the principal's stored identity (invite-pin-mismatch) and the join commits with that identity — no forge call for the guest and no profile refresh; only the owner-forge check (after the invite and secret validate) refuses with github-identity-required, or github-unreachable, while no owner forge is connected → { status: "authorized", token, principalId, login, workspaceId } with a fresh credential (#1963). An archived workspace refuses the commit with -32602 { code: "workspace-archived" } (§ "The join commit")
invite.challenge (fast path, /invite only) inviteId (req), secret (req) { workspaceId, workspaceTitle, hostname, prettyHostname, collaborationName, pinIdentity, nonce, nonceExpiresAt } — validates the open invite like inspect and issues a single-use nonce bound to it: 32 random bytes (base64url, unpadded), valid 10 minutes, consumed by the first invite.prove that names it. pinIdentity (10.8) has the same required-triple-or-null semantics as inspect. No forge is contacted for the guest; only the owner-forge check (after the invite and secret validate) refuses with github-identity-required, or github-unreachable, while no owner forge is connected (#1965). At most 8 outstanding nonces per invite and 256 daemon-wide (invite-flow-busy past either cap)
invite.prove (fast path, /invite only) inviteId (req), secret (req), nonce (req), login (req), gistId? (github), provider?: "github" | "gitlab" (10.8, default "github"), host? (10.8), proofId? (10.8; alias of gistId — exactly one of the two is required) The guest published nonce in a proof it owns on the named forge (§ "The identity proof") and names it; the host verifies the proof, resolves the account it belongs to and commits the join → { status: "authorized", token, principalId, login, workspaceId } — the token exactly once. Refusals: proof-invalid, proof-expired, github-unreachable (the nonce survives for a retry), identity-unverifiable (10.8), owner-self-join, invite-pin-mismatch, workspace-full, workspace-archived (the shared join transaction found the workspace archived — a proof that validated before a workspace.archive and commits after it; a proof validated after the sweep fails earlier with the invite's closed state invite-revoked, § "The join commit"), or the invite's closed state (#1965, #1986)

Workspace guest roles

This extension is part of experimental Multiplayer; intentd implements it, but the desktop feature stays in Labs. Exact integer workspaceGuestRoles: 1 on both client.hello (server.capabilities) and system.capabilities advertises the complete role mutation and scoped authorization contract. Missing, malformed or unknown values disable role changes. Read support per connection, and refresh authority after reconnect before enabling controls.

Method Params Result
workspace.members.setRole workspaceId (req), principalId (req), role (req: "collaborator" | "manager") { workspaceId, principalId, role, changed: boolean } — explicit workspace owner or existing administrator authority only. Changes one existing direct guest grant; it never adds a member or transfers ownership. A repeated value returns changed: false without publishing an event.

Unknown roles and "owner" are invalid parameters. The target must be an existing direct guest member; the owner and inherited host members cannot be changed with this method. A caller lacking authority is refused before mutation; an unrelated workspace remains indistinguishable from a missing one.

A committed change publishes existing workspace:updated with changes: { members: true, rolePrincipalId, role }. Subscribers re-read the roster and caller-relative workspace projection, including on the affected guest's already open connection. This delta is an invalidation, not a grant to other subscribers. No new event name or membership-count change is introduced.

The durable workspace role is owner, collaborator or manager. Participant is the UI label for collaborator, preserving existing rows and clients. Existing guests, direct member adds and newly redeemed invitations remain Participants; joining again cannot upgrade or overwrite an existing grant. Both guest roles spend one guest seat. A role change neither changes the owner nor creates host membership. Imports do not carry authority from the exporting host.

Permission Participant Manager
Existing guest reads, discussion and agent prompting Existing behavior Same
Rename workspace-wide discussions under discussionManagement: 1 Not allowed Allowed; deletion remains Owner-only
Existing agent.setModel RPC Existing behavior retained Same
Create agents and use model/provider controls Existing UI restrictions Allowed within the granted workspace
Run and observe existing saved scripts Existing restrictions Allowed within the granted workspace
Create/edit script commands, command/environment overrides, raw terminals or host execution Existing restrictions No additional authority
Change sharing, membership, owner fields or global provider configuration Existing restrictions No additional authority

The scoped Manager grant must not satisfy general workspace-management gates: canManage stays false for a guest Manager. Existing owner and inherited host-member authority is unchanged. Clients use separate permission checks for agent creation, model/provider controls and saved-script operation; opening the shared Shell panel must not expose terminal creation/input or script editing. A selected provider must already be configured; choosing it does not authorize setup or credential writes.

For model selection, Managers may also update reasoningEffort through agent.update, alongside the existing guest-editable display fields. This narrow grant does not permit permission settings, prompts, session identity, delegation or other protected agent configuration. Saved-script scope means stored purpose: "saved", including legacy absent-purpose definitions: lists filter before pagination, ID operations recheck purpose, and live events use the same boundary. script.run supports an existing saved command ID and output/timeout options, without command or environment overrides.

The service resolves the current durable role for every protected operation, including requests on already connected sockets. A downgrade takes effect on subsequent requests without reconnecting. Script IDs and agent IDs are resolved within the authorized workspace; possessing an ID is not a grant. The transport allowlist permits attempting an operation, while the service remains the authority for the role, workspace and allowed fields. Existing Participant RPC permissions are preserved, including the historical agent.setModel allowance.

Owner-controlled role selectors belong inline on guest member rows. The owner's role is fixed, and inherited host access cannot be changed by selecting a guest role. UI state retains the confirmed role until a successful mutation; failures leave authority unchanged and surface on the affected row. Membership invalidation refreshes both the roster and the caller-relative workspace role, rather than treating a capability flag or a selected menu value as a grant.

Identity model

  • A principal is a person. The daemon's existing single user is the primary principal — minted by migration 0125 and made the owner of every workspace that already existed — and every other principal is someone who joined through an invite, identified by the stable forge account that its identity proof established at first join (§ "Joining by invite"); a returning guest is re-bound to the same principal by its credential, with no forge call for its identity (only the owner-forge check of § "Invite links"). login / displayName / avatarUrl are the cached forge profile.
  • Identity triple (10.8). A principal's forge account is the provider-neutral triple identity: { provider, host, externalUserId } — provider is "github" | "gitlab", host the bare instance host ("github.com", "gitlab.com", a self-managed GitLab host[:port]), externalUserId the forge's stable account id as a string (GitHub's numeric id stringified; provider-agnostic storage). One principal per triple (partial unique index; NULL while unlinked): a GitHub user and a GitLab user with the same numeric id or the same login are two principals. The triple is additive on every wire projection of a principal — principal.me, principal.list rows, workspace.members.list Member rows — and omitted while the principal has no linked identity. The pre-10.8 GitHub key is kept and stays populated: githubUserId? (the integer, on principal.list rows) is still served for a github identity, and the migration backfills every existing row as { provider: "github", host: "github.com", externalUserId: String(githubUserId) } with zero principal loss. Pins (WorkspaceInvite.pinIdentity?) and the owner-self-join refusal compare triples, never logins.
  • Which forge is the primary's identity (10.8). The primary principal links the forge selected by the identity.provider setting ("github" | "gitlab" | null, §5.12): set and connected ⇒ that forge; null with exactly one forge connected ⇒ that one; null with both ⇒ the current identity if any, else github (the client prompts the user to choose). The identity is read from GitHub GET /user or GitLab GET /api/v4/user. Changing the setting is an explicit re-key of the primary's triple and publishes principal:identity-changed (§6); the identity lock below still blocks implicit re-keys (a token swap to another account of the same provider without a setting change).
  • Caller binding happens at the upgrade gate, once per connection, from the presented bearer token: the legacy file token (server.auth.token) binds the primary principal as administrator; a per-principal credential (principal_credential row, matched by hex SHA-256 of the token) binds that principal as a non-administrator. An unknown token is still 401. The binding never changes for the connection's lifetime and is never taken from client.hello — principal.me reports it. Agents (MCP) and the daemon itself act as the primary principal.
  • Roles are per workspace: owner or collaborator (wire and stored spelling, lowercase). Exactly one owner per workspace — a partial unique index since migration 0126 — and there is no ownership transfer; the administrator is unconstrained by roles. workspace.create is administrator-only, so the owner is always the primary principal in v1.
  • Membership fields on every Workspace row (§5.1) served through the service layer — workspace.get, workspace.list, the workspace.subscribe snapshot and deltas: ownerPrincipalId? (absent only on a transfer-imported row whose owner has not been re-derived yet), myRole? ("owner" | "collaborator", relative to the request's bound caller; absent when the caller is not a member or no principal is bound), memberCount (the owner counts) and openInviteCount. Computed in one query per call, never per row.
  • Membership narrowing. For a non-administrator caller workspace.list returns only its member workspaces, and every workspace-scoped read or write on a workspace it is not a member of is -32602 { code: "not-found" } — indistinguishable from a workspace that does not exist, so a guest can neither enumerate nor probe the owner's other workspaces. Owner-only operations attempted by a collaborator member are -32003 Forbidden (§ "Errors").

Shapes

// principal.me — the bound principal; `identity` (10.8) omitted while no forge identity is linked
{ "id": "3f1c…", "login": "octocat", "displayName": "Octo Cat", "avatarUrl": "https://…", "isAdministrator": false,
  "identity": { "provider": "github", "host": "github.com", "externalUserId": "583231" } }

// workspace.members.list — Member rows (a GitLab guest shown; `identity` omitted on an unlinked principal) plus the guest-seat spend (both counts always present)
{ "members": [ { "principalId": "3f1c…", "login": "octocat", "displayName": "Octo Cat", "avatarUrl": "https://…",
                 "role": "owner", "addedAt": "2026-09-14T12:00:00.000Z",
                 "identity": { "provider": "github", "host": "github.com", "externalUserId": "583231" } },
               { "principalId": "7a9d…", "login": "invitee", "displayName": "In Vitee", "avatarUrl": "https://gitlab.com/…",
                 "role": "collaborator", "addedAt": "2026-09-15T09:00:00.000Z",
                 "identity": { "provider": "gitlab", "host": "gitlab.com", "externalUserId": "4711" } } ],
  "guestCount": 1, "guestLimit": 5 }

// principal.list — credentialed guests; the four profile keys are always present (null when uncached),
// `githubUserId` is an integer on a github identity and null otherwise, `identity` (10.8) on any linked one
{ "principals": [ { "principalId": "7a9d…", "login": "invitee", "displayName": "In Vitee", "avatarUrl": "https://gitlab.com/…",
                    "githubUserId": null, "identity": { "provider": "gitlab", "host": "gitlab.com", "externalUserId": "4711" } } ] }

// WorkspaceInvite — create's `invite` and list's rows; optional keys omitted when absent, never null.
// `secret` / `secretHash` are NEVER serialized as fields: the plaintext rides only inside create's
// top-level `secret` and inside `url`. `pinIdentity` (10.8) is the resolved pin triple; `pinGithubUserId`
// is kept (populated only when the pin names a github account).
{ "id": "9b2e…", "workspaceId": "ws-1", "createdByPrincipalId": "3f1c…",
  "pinGithubUserId": 583231, "pinLogin": "octocat",          // only on a pinned invite
  "pinIdentity": { "provider": "github", "host": "github.com", "externalUserId": "583231" },
  "reusable": false,                                          // always present: true iff unpinned
  "redemptionCount": 0,                                       // always present: memberships this link created
  "url": "intent://invite?…",                                 // create: always; list: when the stored secret + a link envelope are available
  "createdAt": "2026-09-14T12:00:00.000Z", "expiresAt": "2026-09-21T12:00:00.000Z",
  "redeemedAt": "…", "redeemedByPrincipalId": "…",            // the LAST redemption — on open list rows of a reusable invite too
  "revokedAt": "…" }                                          // closed rows only (never on list)

// invite.inspect — a GitLab-pinned preview (hostname / prettyHostname added by the /invite transport)
{ "workspaceId": "ws-1", "workspaceTitle": "Add dark mode", "hostname": "studio", "prettyHostname": "Studio",
  "pinIdentity": { "provider": "gitlab", "host": "gitlab.example:8443", "externalUserId": "4711" } }

// invite.challenge — an unpinned preview plus the single-use nonce the guest must publish
{ "workspaceId": "ws-1", "workspaceTitle": "Add dark mode", "hostname": "studio", "prettyHostname": "Studio",
  "pinIdentity": null, "nonce": "<43 base64url chars>", "nonceExpiresAt": "2026-09-14T12:10:00.000Z" }

// invite.prove / invite.accept — the `authorized` result; `token` is the only copy of the new credential
{ "status": "authorized", "token": "<64 hex chars>", "principalId": "7a9d…", "login": "invitee", "workspaceId": "ws-1" }

Invite links — workspace.invite.create

  • expiresInSecs defaults to 7 days (604800) and must be in [1, 2592000] (30 days), else -32602. pinLogin? restricts redemption to one forge account: it is trimmed (blank ⇒ unpinned), resolved at mint time on the forge pinProvider? / pinHost? name — GitHub GET /users/{login}, GitLab GET /api/v4/users?username= — and stored as the identity triple (pinIdentity; pinLogin is kept as the canonical login for display; pinGithubUserId is still populated for a github pin) — a login that names no account is -32602 { code: "invite-pin-unknown" }. pinProvider / pinHost (10.8) default to the host's own identity provider and host (§ "Identity model"), so a pre-10.8 client that sends pinLogin alone keeps its behavior on a GitHub-identity host; a pinProvider outside the enum is -32602. Because the pin is a triple, a GitHub user cannot redeem an invite pinned to a same-named GitLab login — the join is invite-pin-mismatch.
  • Sharing requires a connected owner forge. The primary's cached identity alone does not qualify: on every mint, GitHub (GET /user with the host's credential) or the bound GitLab instance (GET /api/v4/user) must answer for a live account — either forge suffices, whichever one the identity is linked to — else -32603 { code: "github-identity-required" } (the code is kept for compatibility from the GitHub-only era; its message is provider-neutral). When neither is connected but one could not be reached, the refusal is the retryable -32603 { code: "github-unreachable" } instead. The same check gates redemption: invite.challenge, invite.prove and invite.accept on a valid open invite (checked after the invite and secret validate, and before a prove spends its nonce) refuse the same way while no owner forge is connected, and the invite stays open until one reconnects; existing members keep access. A joined collaborator's identity was proven by its own identity proof and is accepted as cached — but workspace.invite.create is owner-only, so in v1 only the primary mints.
  • Guest cap. Every open invite reserves a guest seat: when the workspace's collaborators plus its open invites already reach sharing.maxGuestsPerWorkspace, create is -32602 { code: "guest-limit" } (so N open links can never be redeemed against one remaining seat); a join that finds the collaborators alone at the cap is workspace-full and leaves the invite open. workspace.members.list reports the spend as guestCount / guestLimit.
  • Reusable links (intent-hq/intentd#1988). An unpinned invite is reusable: any number of distinct forge accounts may join through it until it expires or is revoked (each join is one more collaborator; a member re-joining is idempotent), and its redeemedAt / redeemedByPrincipalId only record the last redemption while redemptionCount counts the memberships it created — the row stays in workspace.invite.list with reusable: true, and its url lets the owner re-share the same link. A pinned invite is single-use and closes on its redemption (invite-redeemed thereafter).
  • The link envelope is tunnel-only and is resolved exactly once per create, before the invite is minted, so a daemon nobody can dial never stores an invite that cannot be redeemed: no TCP listener is -32603 { code: "listener-down" } (the pairing.getInfo discriminator); a listener whose Tailcat tunnel is not running is -32603 { code: "tunnel-down" } (turn on Remote Access + Tailcat — server.tunnel.enabled). No invite row is stored in either case. The envelope is the intent://pair one (§5.12 pairing.getInfo) minus the bearer token and minus the direct hosts: port, certificate fingerprint and the tunnel tcAddress only — an invite never discloses the daemon's interface / bind IP addresses, whatever server.bindAddress is. hosts is always [] in the result. (intent://pair links and pairing.getInfo are unchanged: pairing an owner's own device still carries the direct hosts.)
  • Link format — intent://invite?v=1&port=<p>&fp=<sha256>&inviteId=<id>&secret=<s>&tc=<addr>, with the same query encoding as build_pairing_uri. tc is mandatory; the host parameter is omitted entirely (never an empty host=), and a client treats an absent host as an empty direct-candidate list and dials through tc. It never carries the daemon token: the holder can only redeem the invite. Links minted before the envelope became tunnel-only may still carry host=<ip[,ip…]> until they expire; clients keep parsing it.
  • Public-address route (orchestrator only). A server with no tunnel but configured public host names — intentd-orchestrator's INTENTD_ORCHESTRATOR_PUBLIC_HOSTS — mints direct links instead: intent://invite?v=1&host=<host[,host…]>&port=<p>&fp=<sha256>&inviteId=<id>&secret=<s>, no tc; the result's hosts lists those names and tcAddress is null. The hosts are the operator's public names, never interface or bind addresses. intentd has no public hosts, so its links stay tunnel-only; with neither a tunnel nor a public host, create is tunnel-down.
  • Identity lock. The first invite of a workspace also pins the workspace's legacy author (content authored before anyone else could have joined is the owner's — § "Attribution"). Once other principals or open invites exist, the primary's forge identity is load-bearing: a profile refresh that names a different account (the owner reconnected the forge as someone else) leaves the cached identity untouched and fails with -32603 { code: "primary-identity-locked" }. While the daemon is still single-user the switch is applied as before. An explicit identity.provider change (10.8) is not an implicit switch: it re-keys the primary on purpose; invites already pinned to the old identity are unaffected, new ones default to the new one.

Joining by invite — the /invite endpoint

/invite is the daemon's one unauthenticated WebSocket endpoint (beside /ws and /tunnel): the invitee holds only the link, so the upgrade skips credential resolution — the server.enabled flag and origin allow-list still apply (§2.2). It serves exactly four methods — invite.inspect, invite.accept, invite.challenge, invite.prove — and nothing else: any other method (request), workspace.invite.create included, is answered -32001 with the message the /invite endpoint serves invite.inspect, invite.accept, invite.challenge and invite.prove only; a notification is dropped without a response; and reverse RPCs, subscriptions and events never flow on it. The host never runs an OAuth flow on the guest's behalf and never holds a guest token: a first-time guest proves it owns a forge account by publishing a host-issued nonce under that account (§ "The identity proof"); a returning guest presents the per-principal credential an earlier join minted (invite.accept). Every call requires an open invite — the secret is hashed and compared against the row; a miss (unknown id or wrong secret) is -32602 { code: "invite-not-found" }, a closed invite invite-expired / invite-revoked / invite-redeemed (the last only for a pinned link), and an invite whose workspace is gone invite-not-found — after the transport has validated the required string params (a missing or blank one is -32602).

Bounds, because an anonymous peer must not exhaust the daemon or a forge: at most 32 concurrent /invite connections (excess upgrades are refused 503; the permit is taken before the 101 and returned when the connection task ends, however it ends), 16 KiB inbound frames, at most 4 requests in flight per connection (excess is -32603 { code: "invite-flow-busy" }), a listener-wide token bucket over starts — the requests that hash a secret (8 burst, one token per 5 s; a throttled start is the same invite-flow-busy, answered before any store or upstream work, so a peer cannot enumerate links by serialising attempts or reconnecting), at most 8 outstanding nonces per invite and 256 daemon-wide (a challenge past either cap is invite-flow-busy). The same bounds apply whichever forge the proof names (10.8).

Selecting the guest identity

Both invite.inspect and invite.challenge return pinIdentity: { provider, host, externalUserId } | null in 10.8. The triple uses the identity model above, including self-managed GitLab host[:port] and the stable account id as a string. It comes from the invite's stored pin, with a legacy pinGithubUserId projected as { provider: "github", host: "github.com", externalUserId: String(pinGithubUserId) }. null explicitly means unpinned; unlike the owner-facing WorkspaceInvite.pinIdentity?, the preview key is always present in this contract.

The host returns the requirement only after validating the invite id, secret and open state. A wrong secret or missing invite gives invite-not-found; expired, revoked and redeemed pinned invites keep their existing typed errors. Error responses contain no pin or preview payload. Neither preview contacts a forge or needs extra credentials, and the invitation URL gains no identity parameter.

Before publishing a proof, the guest uses the preview to select its identity:

  • Pinned: select the connected account whose provider, canonical instance authority (including any port) and authoritative account id all match. A matching login alone is insufficient; a scheme, path or non-canonical authority in pin metadata is malformed. A missing connection or wrong account requires the matching identity before proof creation; never silently fall back to another connected forge. Keep the selected provider/host through proof creation, verification, retry and cleanup, and re-check the proof's account against the selection to detect an account switch.
  • Explicitly unpinned: on a local daemon supporting the identity seam (protocol 10.8), use its chosen identity from principal.me, consistent with Settings and identity.provider. Do not change that setting or disconnect a repository connection to join, and do not introduce an identity picker as part of this flow.
  • Compatibility: an omitted key means the requirement is unknown, not that the link is unpinned. Omission from the host, or explicit null with a local sidecar older than 10.8, keeps the historical GitHub-first selection (then connected GitLab when available). A present GitHub pin still requires the authoritative numeric id from github.getUser, including on an older sidecar. A present GitLab pin requires a local sidecar with the 10.8 identity seam; an older sidecar refuses it without falling back to GitHub. Malformed non-null metadata is an error, never an unpinned invitation. The host remains authoritative and still rejects any wrong provider, instance or account during the join.

The returning guest's invite.accept continues to validate the identity bound to its existing host credential. Preview metadata does not let a client override that identity or bypass the host's final pin check.

The identity proof — invite.challenge / invite.prove
  1. Challenge — invite.challenge { inviteId, secret } → { workspaceId, workspaceTitle, hostname, prettyHostname, collaborationName, pinIdentity, nonce, nonceExpiresAt }. The host validates the open invite and issues a single-use nonce (32 random bytes, base64url unpadded, 10-minute lifetime) bound to the invite; workspaceId / workspaceTitle / hostname / prettyHostname let the guest's client name the workspace and host on its consent prompt (invite.inspect answers the same preview without spending a nonce). pinIdentity selects the required guest identity as above before publishing the proof. No forge is contacted for the guest; only the owner-forge check (after the invite and secret validate) refuses with github-identity-required, or github-unreachable, while no owner forge is connected.
  2. Publish — the guest, on its own authenticated /ws connection to its own daemon, calls sourceControl.identityProof.create { provider, host?, nonce, hostLabel } (§5.27; github.identityProof.create { nonce, hostLabel } is the pre-10.8 alias) → { proofId, login, provider, host, externalUserId, avatarUrl, gistId? } (externalUserId and avatarUrl always present, both string | null; externalUserId is the GitLab author id string and null for GitHub, whose identity the host resolves server-side from gistId / login in step 3 — clients must not depend on it for GitHub). Its daemon publishes the nonce with its stored forge token: on GitHub a secret gist with the single file intent-join-proof.txt whose first line is the nonce; on GitLab a public personal snippet (POST /api/v4/snippets, title naming Intent, one file whose first line is the nonce — public because the host verifies it anonymously; the guest's token needs the api scope). The guest's token never leaves the guest's daemon.
  3. Prove — invite.prove { inviteId, secret, nonce, login, proofId, provider?, host? } (gistId is the pre-10.8 spelling of proofId; exactly one of the two). The host reads the proof back on the named forge — GitHub GET /gists/{id}; GitLab an anonymous read of the snippet metadata and raw content, falling back to an authenticated read with the host's own connection to the same host when the anonymous read is refused (401 / 403 / a restricted 404) — and requires: the owner (author.username on GitLab) equals login case-insensitively, the file's first line is the nonce, and the proof was created no earlier than the nonce was issued. Any mismatch, an unknown proof, or a nonce this host never issued for the invite (or already consumed) is -32602 { code: "proof-invalid" }; a nonce past its lifetime proof-expired (start over with challenge); the forge unreachable -32603 { code: "github-unreachable" } (the code is kept for both providers; the nonce stays valid for a retry); a GitLab host the daemon can neither read anonymously nor with a connection of its own is -32603 { code: "identity-unverifiable", host } with the message cannot verify identity on <host> (10.8; error.data.host names the instance). The nonce is consumed by the first attempt that reaches verification, except when the forge was unreachable. The identity then comes from the proof itself (GitHub: GET /users/{login}; GitLab: the snippet's author — id, username, avatar_url — no follow-up user call) and the join commits (below) → { status: "authorized", token, principalId, login, workspaceId } — the token exactly once. The proven account being the primary principal's own is -32602 { code: "owner-self-join" }: the host owner cannot join its own host as a guest, no credential is minted and the invite stays open (#1986; compared on the identity triple in 10.8).
  4. Clean up — the guest deletes its proof: sourceControl.identityProof.delete { provider, host?, proofId } → { ok: true } (idempotent; refuses to delete anything that is not a proof of this shape).
  5. Connect. The guest reconnects through the tunnel route the link's tc names (the link carries no direct hosts; /ws directly only for a legacy link that still carries host=) with token as the bearer — the same port / fingerprint the link carried — and is bound as a non-administrator principal: principal.me names it (with its identity), workspace.list shows the joined workspace with myRole: "collaborator", and every call is subject to the collaborator allowlist below.

Returning guests — invite.inspect / invite.accept. A guest that already holds a credential from this host (another workspace's join) skips the proof: invite.inspect { inviteId, secret } previews the invite, invite.accept { inviteId, secret, credential } resolves the principal from the credential's hash exactly like the /ws bearer gate (unknown or revoked ⇒ -32602 { code: "credential-invalid" } — join through the proof instead; bound to the primary ⇒ owner-self-join), checks a pin against the principal's stored identity and commits the join with that identity — no forge call for the guest and no profile refresh; only the owner-forge check (after the invite and secret validate) refuses with github-identity-required, or github-unreachable, while no owner forge is connected — answering the prove shape with a fresh credential (the presented one is rotated out). Works for a gitlab principal exactly as for a github one (10.8).

The join commit

The host re-checks the invite (still open; a pinned invite whose identity triple differs is -32602 { code: "invite-pin-mismatch" }) and, shared by prove and accept, in one store transaction: mints or reuses the principal keyed by the identity triple (10.8; github_user_id is dual-written for a github identity so pre-10.8 lookups keep resolving the same row) — a prove refreshes its cached login / displayName / avatarUrl — stamps the invite's redemption (the conditional update is the single-use guard of a pinned invite — a concurrent join that loses it is answered with the invite's closed state, invite-redeemed; a reusable invite stays open and only its last-redemption stamp moves), refuses when the workspace's collaborators already reach the guest cap sharing.maxGuestsPerWorkspace (-32602 { code: "workspace-full" }, invite left open) or the account is the primary principal's (owner-self-join, nothing minted), or the workspace is archived (-32602 { code: "workspace-archived" }, nothing written — the transaction-level guard for a join racing workspace.archive: the archive's sweep revokes the invite in the same transaction as the flip, so a join that validated before the archive and enters this transaction after it is refused here, while a join that re-reads the invite after the sweep never gets this far and fails in the service-side validation above with the invite's closed state invite-revoked; intent-hq/intentd#2066), adds the collaborator membership (a returning principal re-joining a workspace it already belongs to keeps its row), and records a fresh per-principal credential (64 hex chars, stored as its SHA-256), consuming the accept credential when one was presented. After the commit workspace:updated { changes: { members: true, invites: true, addedPrincipalId, memberCount } } is published when a membership was added, { invites: true, memberCount } alone for a member's re-join. login in the result is the joined principal's cached forge login.

Credential revocation closes connections. principal.revokeSelf (and any future revocation of a principal's credentials) broadcasts the principal id; every non-administrator connection still bound to it — the per-principal-credential ones; a connection admitted on the legacy token never subscribes to revocation, even when bound to the same primary principal — drains its in-flight responses (so the caller's own revokeSelf result is delivered, bounded to 5 s) and is then closed with WebSocket close code 1008 (policy) and reason credential revoked. A replayed revoked token is refused at the upgrade gate (401). workspace.members.remove / members.leave do not close the connection: the removed member simply stops seeing the workspace — its later reads are not-found, its workspace-scoped subscription channels deliver nothing further, and its queued user messages on the workspace's agents are dropped.

The collaborator allowlist — methods (default-deny)

A connection bound to a non-administrator principal may only attempt the methods below; the check runs at the connection's single inbound chokepoint before every classify and dispatch path (control, server / pairing, provider setup, host, browser, client, drafts, subscription channels, events, router), so no fast path is reachable by a method outside the list. A miss is -32003 "Forbidden" (no data) echoing the request id; a notification is dropped without a response; a malformed envelope keeps its -32600. Because the gate precedes -32601, a collaborator cannot distinguish an unknown method from a refused one — see the capability probe below. Per-workspace membership is enforced in the service layer on top of this gate (§ "Identity model"); the list only says which methods a guest may reach. The list is frozen by a golden test in crates/intent-transport/src/catalog.rs (COLLABORATOR_METHODS, each entry with a vetting note), which also freezes the refused remainder, so a new method must be classified explicitly. 186 names — 174 of the 377 router + fast-path names in this baseline (subsequent additions are noted below) plus the 12 §6.9 subscription-channel methods (workspace / note / chat / comment / task / note.presence .subscribe + .unsubscribe, counted outside §5's dispatchable total) — by namespace:

Namespace Allowed methods
agent (36) appendMessage, cancelSubscriptions, dismissQuestions, editAndRegenerate, editQueuedMessage, get, getConversation, getMessageBlock, getModels, getQueue, getSession, getSessionStats, getSubscriptions, list, listActive, listInterrupted, listUserMessages, markSeen, pendingPermissions, queueMessage, removeQueuedMessage, rename, resolveInterrupted, respondPermission, restore, retry, sendMessage, sendQueuedMessageNow, sendQueuedMessagesNow, sendToTask, setModel, stop, subscribe, summary, unsubscribe, update
chat (2) subscribe, unsubscribe
client (1) hello
comment (8) add, delete, getThread, list, resolveThread, respond, subscribe, unsubscribe
crossWorkspace (3) listNotes, listSiblings, readNote
drafts (3) clear, get, set
event (3) agentActivity, query, workspaceSummary
events (2) subscribe, unsubscribe
file (16) attachmentUpload.abort, attachmentUpload.begin, attachmentUpload.chunk, attachmentUpload.commit, delete, exists, getAttachmentInfo, list, mkdir, placeAttachment, read, readChunk, rename, stat, tree, write
git (25) branchDiff, branchStatus, changes, checkMergeConflicts, checkoutBranch, commitDetails, commits, createBranch, diffs, discard, fetch, getBranches, getConfig, getRemoteUrl, numstat, pull, push, removeLockFile, renameBranch, showFile, stage, stageHunk, status, unstage, unstageHunk
gitRoot (1) list
hook (1) list
host (2) status, toolAvailability
metrics (1) getAgentStats
models (1) list
note (23) add, create, delete, edit, editLines, get, getVersion, lineAttribution.computeNow, lineAttribution.load, list, listTasks, listVersions, presence.subscribe, presence.unsubscribe, presence.update, readAsset, restoreVersion, saveAsset, setContent, subscribe, unsubscribe, update, updateMetadata
pr (1) refresh
prMonitor (1) list
presence (2) snapshot, update
primitive (4) addAgentAction, addCli, addPatch, addReference
principal (2) me, revokeSelf
providers (1) catalog
search (7) cancel, codebase, events, fileNames, inFiles, messages, notes
skill (1) list
specialist (2) get, list
stats (2) getRateHistory, getUsage
system (2) capabilities, status
task (17) assignAgent, convertBlocks, createPrerequisite, get, getMyTask, linkAgent, list, listAgentLinks, markAsTask, removeAgentFromAllTasks, setRelations, subscribe, unlinkAgent, unsubscribe, update, updateNoteStatus, updateStatus
workspace (16) dismissAttention, get, getAutoCommit, getContext, getTokenUsage, getUiContext, list, localChanges, markSeen, members.leave, members.list, subscribe, unsubscribe, update, updateContext, updateUiContext

Owner-only by design — the 205 refused dispatchable names in the same baseline, frozen alongside the list: every host.* method but the two display probes (19), browser.* (7), terminal.* (7), script.* (9); github.* (31, github.identityProof.* included — a guest proves its identity from its own daemon) / linear.* (11) / sentry.* (8) / voice.* (2) — they act with the primary user's third-party credentials; settings.* (4), repo.* (3), repoConfig.* (4), rules.* (3), mcp.* (12), providers.setup.* (4), server.* (2) / pairing.getInfo / system.* except system.capabilities and system.status (4), client.list, debug.sampleStacks, unsloth.* (2), sandbox.* (2), accept-changes.* (5), file-tracking.* (5); principal.list; workspace.* outside the 16 listed (32: create, archive / unarchive, delete / cancelDelete / restore / cleanup, duplicate, diskUsage, findRepositories, initializeRepository, detectProjectType, the setup-script four, setAutoCommit, getBrowserClient / setBrowserClient, export.* / import.* / transfer.plan, members.add / members.remove, invite.create / invite.list / invite.revoke); git.clone / git.agentCommit; agent.create / delegate / wakeOrCreate (decided 2026-09-19, intent-hq/intentd#1998: guests steer existing agents only), agent.delete / cancelDelete / completeOnce / diagnostics / enhancePrompt / memoryUsage / reportToParent / resolveProposal and agent.replaceMessages (it persists client-supplied user rows verbatim, so a non-owner could forge attribution; collaborators keep agent.editAndRegenerate for the edit flow); hook.cancel / hook.runNow; prMonitor.cancel / prMonitor.flush; specialist.create / edit / delete; and the four invite.* methods, which are served only on /invite. The reverse RPCs are never issued to a collaborator connection.

Shared global instruction read: rules.get joins the guest allowlist only for workspaceId: "global", ruleType: "base-system-prompt", with current durable host membership or a guest workspace grant required by the service. The baseline rules.* refusal above therefore retains rules.list and rules.update for guests. Other settings reads are unchanged. Rule writes and specialist mutations remain daemon administration, including direct service calls; a workspace grant cannot authorize a global override write. See §5.21.

Additive direct retirement: agent.retire joins the allowed agent steering methods above, with the same workspace membership checks as agent.restore and agent.stop. The baseline counts/list above predate this addition. It permits user-initiated retirement of an existing agent; it does not grant collaborator access to agent.delete or MCP retirement of another agent. See §5.5 Direct user retirement.

Additive resume-cost methods: agent.compact and agent.handOff join the allowed agent steering methods above. agent.compact is open to the same members as agent.sendMessage, collaborator included. agent.handOff also needs the right to create an agent (workspace Manager or owner), because its first step is an agent.create; a collaborator gets -32003. The baseline counts/list above predate this addition. See §5.5 Resume cost.

Remote machine administration: executor.mint, executor.list, executor.revoke, executor.invite.create, the seven remoteMachines.* methods and the three remoteLinkTraffic.* methods (§5.50) join the owner-only refused remainder. They are on neither the collaborator nor the member allowlist: a machine shared with you is someone else's computer, so only its owner can lend it to a backend.

Within the allowed set, four more rules apply to a collaborator caller:

  • Projected system.status. A collaborator receives a default-deny projection of the §5.7 result: running, listenMode, port, version, buildCommit, protocolVersion, fingerprint, localIps, tcAddress, hostname, prettyHostname, collaborationName and a host sub-object reduced to os / arch / locality / deviceKind / hardwareModel — every one already disclosed by the invite envelope or server.pairingInfo. The daemon-global counts (clients, agents, busyAgents, maxAgents), process / disk / file-watch / fd telemetry, the agent-memory budget, the update handshake, transports and host.hasDisplay are omitted; the administrator's snapshot is unchanged.

  • Field-restricted writes. workspace.update may touch only the workspace-card metadata title, tags, statusMessage, statusImageAssetId, workDone; agent.update only name, nameExplicitlySet, isBackground. Any other key in the delta is -32003 (data.detail names the gate). workspace.getContext / updateContext and the UI-context pair are member-editable as listed.

  • Namespaced clientId. client.hello returns (and persists) clientId as {principalId}:{presented} — idempotent, so a client that stores the returned id re-hellos to the same identity. A collaborator therefore can only ever act as a client id inside its own namespace: an id learned from another member's draft:changed never reaches that member's drafts or presence. The administrator, agents and the daemon keep the raw id.

  • Own-token cancellation. search.cancel from a collaborator flips only searches it started; an administrator cancels any.

The collaborator allowlist — event types (default-deny)

A non-administrator connection receives only the event types below — live over events.subscribe and the §6.9 subscription channels, and durably through event.query / event.agentActivity / event.workspaceSummary / search.events, whose SQL is narrowed to the same list. Every fan-out matches the event against the list and the subscriber's membership in the event's workspace at delivery time (verdicts are cached briefly and invalidated by membership-changing workspace:updated), so a type outside the list is never delivered whatever the subscription pattern asked for — an all-disallowed subscription still gets its subscriptionId and simply stays silent. Global (workspace-less) events never reach a collaborator; a workspace:updated carrying the collaborator's own removedPrincipalId is delivered as its final notification for that workspace, and the global workspace channel only discloses workspace:deleted tombstones for workspaces the subscriber has been shown. Frozen by a golden test in crates/intent-core/src/events.rs (COLLABORATOR_EVENT_TYPES, every ALL_EVENT_TYPES entry classified exactly once). 94 types:

Family Allowed types
agent agent:attention-requested, agent:completed, agent:created, agent:delete-cancelled, agent:delete-scheduled, agent:deleted, agent:failed, agent:idle, agent:last-message, agent:message, agent:process:evicted, agent:process:queued, agent:process:resumed, agent:queue:processing, agent:queue:processing-cancelled, agent:queue:stale-message, agent:queue:updated, agent:renamed, agent:restored, agent:retired, agent:session-stats-changed, agent:started, agent:status-changed, agent:stream:activity, agent:stream:end, agent:stream:start, agent:stream:status, agent:subscriptions-changed, agent:tool:call, agent:updated, agent:user-message:sent
changes changes:agent-locks, changes:git-status, changes:metrics-changed, changes:tracked
chat / comment / draft chat:stream:delta, comment:added, comment:resolved, draft:changed
file file:changed, file:created, file:deleted, file:renamed
git git:branch, git:commit, git:merge, git:pull, git:push
goal / spec goal:updated, spec:updated
hook hook:cancelled, hook:dispatched, hook:evicted, hook:expired, hook:scheduled
note line-attribution:updated, note:created, note:deleted, note:presence, note:updated
pr / prMonitor pr:linked, pr:unlinked, pr:updated, prMonitor:cancelled, prMonitor:changed, prMonitor:completed, prMonitor:emitted, prMonitor:registered
presence presence:changed
search search:done, search:result
skills / specialists skills:changed, specialists:changed
task task:agent-linked, task:agent-unlinked, task:created, task:ready-tasks-changed, task:status-changed
workspace workspace:activity, workspace:activity-changed, workspace:attention-changed, workspace:backgroundTasksRunning-changed, workspace:closed, workspace:context-changed, workspace:created, workspace:delete-cancelled, workspace:delete-scheduled, workspace:deleted, workspace:displayStatus-changed, workspace:opened, workspace:setup:completed, workspace:setup:started, workspace:tokenUsage-changed, workspace:scriptsRunning-changed, workspace:updated, workspace:waiting-changed

Owner-only (the 57 refused types at the current pin, 60 once intentd adds the three app library types app:installed / app:removed / app:approval-changed of §5.60, which join the refused set; COLLABORATOR_REFUSED_EVENT_TYPES in the intent-core golden): terminal:data / terminal:exit (raw PTY bytes) and terminal:command / terminal:cwd / terminal:process / terminal:title, host:exec:stdout / stderr / exit, script:changed / output / state, build:started / build:completed, test:started / test:completed, browser:tab-opened / tab-updated / tab-closed, client:connected / client:disconnected, hook:run-started / hook:run-completed (hook code and carried state), agent:permission:request / agent:permission:resolved, the agent delivery / subscription bookkeeping agent:message:sent / agent:message:received / agent:message:delivery-failed / agent:delivery-confirmed / agent:event-delivery-failed / agent:event-delivery-timeout / agent:subscribed / agent:unsubscribed / agent:subscriptions-restored / agent:woken-by-subscription, workspace:transfer:progress / ready / failed, git:clone:progress / git:clone:done, gitRoot:registered / updated / unregistered, app:ui-highlight / app:ui-navigate / app:workspace-open, settings:changed, github:auth-changed, mcp.servers:status-changed, mcp:notification.

App principals (prepared, §5.60)

The Intent apps contract adds a third kind of caller beside the administrator and person principals. A fresh administrator connection that sends app.session.attach { token } as its first request is bound, for the rest of its life, to { kind: "app", appId, bundleHash, level, features, sessionId }.

  • It is a non-administrator binding, but the collaborator allowlist above does not apply to it. The same inbound chokepoint checks it against the app allowlist for its level instead, with the same -32003 refusal without data on a miss.
  • An app principal is never a workspace member, holds no role, takes no guest seat and is not shown in presence or workspace.members.list.
  • principal.me on an app connection answers kind: "app" with the app's name as displayName and null profile fields. On daemons that advertise intentApps: 1, person principals also carry kind: "person"; a missing kind means "person".
  • No app.* method is on the collaborator allowlist: the app library is owner-only.

Attribution — who wrote a human message

  • fromPrincipalId stamp. Every user-origin entry point (agent.sendMessage, agent.sendToTask, agent.queueMessage, agent.editQueuedMessage, agent.appendMessage, agent.editAndRegenerate, agent.wakeOrCreate, workspace.create's initialAgent message) stamps the bound wire caller's principal id into the message metadata under fromPrincipalId before the payload is persisted or enqueued — overwriting whatever the client supplied; an agent / daemon / unbound caller strips the key instead. Metadata only: the content is never annotated, so prompts stay byte-identical. A non-object messageMetadata is -32602 (a human send must never fall back to the workspace default because its metadata had the wrong shape).
  • author projection. Every user row served by agent.getConversation (slim and full), agent.getSession, agent.getQueue, the chat.subscribe snapshot / deltas and the agent:message / agent:last-message echoes carries author: { principalId, login, displayName, avatarUrl, identity? }. For ordinary local messages, resolve it at serve time from the row's fromPrincipalId, else the workspace's legacy author (the primary principal for workspaces that predate migration 0125; pinned to the owner by the workspace's first invite otherwise), else its current owner. Profile fields are null when the principal row is gone; author is absent on non-user rows. The ordinary local projection is not persisted; a transcript page resolves its distinct authors in one batched statement. Optional identity (10.9, additive; docs lead implementation) is the canonical safe Identity triple from that same resolved principal, omitted when unlinked or the principal is unavailable. It follows the existing serve-time profile resolution and legacy fallback, without adding per-row lookups or substituting a same-handle person. Queue authors (including agent:queue:updated) use the same projection with the shared-read and separate mutation rules: all workspace participants see the queue, but a missing/null author never establishes editing or merge authority. The triple is attribution metadata, never authority or a credential source.
  • Transferred human history. §5.1 defines transfer format 2 and durable metadata.humanAuthor before export, preserved through import/re-export. Its trusted historical snapshot takes precedence over destination principal lookup and workspace-owner fallback; an all-null snapshot keeps imported unknown history unknown. The imported MessageAuthor variant is { principalId: null, login, displayName, avatarUrl, identity? }; current-local authors retain principalId: string. The snapshot's optional sourcePrincipalId is inert provenance and is never promoted to that projection's local principal ID. The exporting member is not substituted for prior contributors. Clients render the historical snapshot independently of current membership and local lookup; null does not mean the owner and cannot match own-user, presence, preamble or queue-author IDs. The safe qualified identity travels as historical presentation only. This transfer-specific persisted provenance does not grant access, live caller identity or queue ownership, and does not rewrite non-human history. Ordinary local serve-time resolution remains batched.
  • Comment authors. comment.add / comment.respond from a bound wire principal persist author = its login (else display name, else id) and authorType: "user" regardless of what the client supplied; the one pass-through is the primary principal with no GitHub identity linked (a single-user daemon keeps rendering the author its client always sent). Agents and the daemon keep their supplied values. §5.3 qualified attribution adds optional durable authorPrincipalId / authorIdentity for resulting bound-human user comments, without changing this label/type contract; unstamped comment history has no owner fallback.

Events

Membership and invite changes ride workspace:updated (§6.5) with these changes keys, and every workspace-scoped read re-derives memberCount / openInviteCount / myRole from the store:

Trigger changes
join by invite (the invite.prove / invite.accept commit) { members: true, invites: true, addedPrincipalId, memberCount }
workspace.members.remove / members.leave / principal.revokeSelf (per workspace left) / workspace.archive (one per detached collaborator) { members: true, removedPrincipalId, memberCount }
workspace.invite.create / workspace.invite.revoke (when a row changed) / workspace.archive (once, when at least one open invite was revoked) { invites: true }

The removed member receives its own removedPrincipalId event as the last frame for that workspace (a workspace.subscribe delta maps it to removedIds); every other member sees the roster change and re-reads workspace.members.list.

Archive removes guests (intent-hq/intentd#2066). workspace.archive (and a workspace.update that delegates to it, §5.1) detaches every collaborator and revokes every open invite in the same store transaction as the archived flip — atomically: a failure leaves the workspace active with its roster intact. Each detached collaborator gets the members.remove teardown (queued messages dropped) and its own removedPrincipalId delta, then one { invites: true } follows when an invite was revoked; all of these precede the { archived: true, … } delta (§5.1 archive active-work teardown). While archived, workspace.members.add, workspace.invite.create and the join commit (invite.prove / invite.accept) are -32602 { code: "workspace-archived" }. workspace.unarchive restores neither members nor invites: the owner explicitly re-adds an existing credentialed guest with workspace.members.add or issues a fresh invite.

principal:identity-changed (10.8) — the one daemon-global event of this surface: published when the primary principal's identity triple is re-keyed by an explicit identity.provider change (§ "Identity model"), payload { principalId, identity: { provider, host, externalUserId } | null }. Clients holding a cached principal.me re-read it; member rows re-derive on their next read. Not published by the ordinary profile refresh (same account, updated login / avatarUrl).

Errors

Code error.data When
-32003 Forbidden none Connection-level allowlist refusal: a non-administrator called a method outside the collaborator allowlist (unknown names included)
-32003 Forbidden { code: "forbidden", detail } Service-level capability refusal: a collaborator member attempted an owner-only operation or an owner-only field (workspace.members.remove, workspace.invite.*, restricted workspace.update / agent.update keys, …); detail names the gate
-32602 Invalid params { code: "not-found" } The caller is not a member of workspaceId (indistinguishable from a nonexistent workspace); an inviteId unknown to the workspace; workspace.members.leave by a non-member
-32602 Invalid params { code: "invalid-params" } expiresInSecs out of [1, 2592000]; removing the owner (members.remove); the owner calling members.leave; the administrator calling principal.revokeSelf; a non-object messageMetadata; workspace.members.add of a principal that is not a credentialed guest (unknown, the primary, or without an active credential)
-32602 { code: "invite-not-found" | "invite-expired" | "invite-revoked" | "invite-redeemed" | "invite-pin-mismatch" | "invite-pin-unknown" } Invite / join refusals the user can act on; message is the kind's fixed prose (invalid params: invite has expired, …). invite-not-found also covers a wrong secret and an invite whose workspace is gone
-32602 { code: "guest-limit" | "workspace-full" } workspace.invite.create / workspace.members.add when collaborators plus open invites already reach sharing.maxGuestsPerWorkspace; a join (invite.prove / invite.accept) that finds the collaborators alone at the cap — the invite stays open
-32602 { code: "workspace-archived" } workspace.members.add, workspace.invite.create, or the join commit (invite.prove / invite.accept) on an archived workspace — archiving detached every guest and closed every open invite, so nothing is minted, added or joined until it is unarchived (message: invalid params: this workspace is archived; unarchive it before inviting or adding members); checked inside each operation's own write transaction, so a join racing workspace.archive is either swept by the archive or refused, never seated afterwards — with this code when the join's validation passed before the archive and its transaction ran after it, or with the invite's closed state invite-revoked when validation itself re-read the already-swept invite (intent-hq/intentd#2066)
-32602 { code: "proof-invalid" | "proof-expired" | "credential-invalid" | "owner-self-join" } invite.prove: the proof does not prove the claimed login (unknown proof, another owner, no proof file or a first line that is not the nonce, created before the nonce was issued, or a nonce this host never issued for the invite / already consumed); the nonce's 10-minute lifetime passed (start over with invite.challenge). invite.accept: the presented credential is unknown or revoked. Both: the proven or credential-bound account is the primary principal's own — the host owner cannot join its own host as a guest
-32603 { code: "github-identity-required" | "primary-identity-locked" | "invite-flow-busy" | "github-unreachable" } | { code: "identity-unverifiable", host } Inviting, or redeeming through invite.challenge / invite.prove / invite.accept, with no owner forge connected (the code is kept from the GitHub-only era; the message is provider-neutral); the primary identity reconnect guard; the /invite caps — 4 in flight per connection, the listener-wide token bucket over starts, 8 outstanding nonces per invite / 256 daemon-wide; the forge could not be reached (or answered a server error) while checking the owner's own forge connection on create or redeem, or while verifying the proof — a prove's nonce stays valid for a retry; 10.8 — the GitLab host named by invite.prove refuses anonymous reads and the host daemon has no connection of its own to that instance to read the snippet with (message: cannot verify identity on <host>)
-32603 { code: "github-not-connected" | "github-scope-missing" | "github-unreachable" } | { code: "gitlab-not-connected" | "gitlab-scope-missing" | "gitlab-unreachable" } (10.8) | { code: "rate-limited" } sourceControl.identityProof.create / .delete (github.identityProof.* is the GitHub alias) on the guest's daemon (§5.27), keyed per provider: no stored credential for (provider, host) or the forge rejected it; the credential lacks the scope the proof needs (gist on GitHub — re-run github.connect; api on GitLab); the forge unreachable. rate-limited (provider-neutral, §9; intent-hq/intent#5627): the guest's own daemon is rate-limited by the forge (exhausted primary quota or a secondary limit) — the credential is fine, so the guest waits for the limit to lift and retries after a backoff instead of signing in again; the guest's github.getUser probe before the proof answers the same code
-32603 { code: "listener-down" } workspace.invite.create with no TCP listener to embed in the link (same discriminator as pairing.getInfo)
-32603 { code: "tunnel-down" } workspace.invite.create with a TCP listener up but the Tailcat tunnel not running — the envelope is tunnel-only, so there is no tc to embed (server.tunnel.enabled); no invite row is stored. Never raised by pairing.getInfo
-32001 Unauthorized none Any method other than the four invite.* fast paths on the /invite endpoint (message: the /invite endpoint serves invite.inspect, invite.accept, invite.challenge and invite.prove only)
HTTP 401 / 503 — Upgrade gate: unknown or revoked bearer token on /ws / /tunnel; /invite at its 32-connection cap

Storage

Three intent-store migrations back this surface — 0125_principals.sql (principal, workspace_member with the owner / collaborator role check, principal_credential keyed by token hash with revoked_at; workspace.owner_principal_id / legacy_author_principal_id; mints the primary principal and its owner rows), 0126_one_owner_per_workspace.sql (partial unique index on workspace_member (workspace_id) WHERE role = 'owner', repairing any duplicate owners first) and 0127_workspace_invites.sql (workspace_invite with secret_hash UNIQUE, the pin columns and the redeemed / revoked stamps). The legacy file token is deliberately not copied into principal_credential: it stays the primary user's credential, honored beside the hashed rows. Workspace transfer nulls both principal columns and the target daemon re-derives the owner.

Capability probe

A successful, well-shaped principal.me reply proves the multiplayer surface; isAdministrator tells the client which side of the allowlist it is on. A refusal does not prove absence: a daemon without this surface answers -32601 (the legacy token is the only credential it knows, so every connection is an administrator), while a multiplayer daemon answers a collaborator's unknown method with -32003.

invite.inspect and invite.challenge also return the nullable collaborationName on supporting daemons, for both invitation scopes. This is the owner's saved display-name override, independent of hostname / prettyHostname; null means use the existing machine-name fallback, while older daemons omit the field. Reading this projection requires the existing valid open-invite secret. invite.accept / invite.prove keep their existing result shapes; after admission, system.status supplies and refreshes the same label for guests and host members. See the setting contract.

5.55 Workspace discussions

Additive in protocol 15.1. A workspace has a default discussion for all current members. Under discussionManagement: 1, every new conversation is workspace-wide; earlier direct/group histories remain private and read-only. These are separate from agent conversations and note comments. The desktop entry point remains behind Multiplayer Labs. Replies and reactions use the independently gated message-actions extension below. Binary attachments, message edits, and changes to a conversation's participants are outside this contract; images travel as body references (see Image references).

Exactly integer discussionConversations: 1 in the server capabilities advertises the complete multiple-conversation contract. Clients must check this capability before sending non-default conversation IDs: an earlier single-discussion daemon may ignore unknown fields and send to the wrong conversation. Missing or unrecognized capability values never authorize a fallback send.

Exactly integer discussionMessageActions: 1, returned by both hello and system.capabilities, advertises replies and reactions. Clients require it before sending replyToMessageId or calling discussion.react; they must not silently drop a reply target on an older daemon. This capability grants no access and does not replace the private-conversation gate.

Method Params Result
discussion.conversations workspaceId (req), beforeId? (exclusive conversation ID), limit? (integer 1–100, default 50) { conversations: DiscussionConversation[], hasMore: boolean } — only conversations accessible to the caller
discussion.recipients workspaceId (req), query? (profile search string, at most 256 UTF-8 bytes), afterPrincipalId? (exclusive principal ID), limit? (integer 1–100, default 50) { members: DiscussionAuthor[], hasMore: boolean } — current effective workspace members, including offline members, excluding the caller
discussion.list workspaceId (req), conversationId? (default "default"), beforeSequence? (positive integer, exclusive), afterSequence? (nonnegative integer, exclusive; mutually exclusive with beforeSequence), limit? (integer 1–100, default 50) { messages: DiscussionMessage[], hasMore: boolean, conversation: DiscussionConversation }
discussion.send workspaceId (req), conversationId? (default "default"), createConversation? (boolean, default false; see management below), messageId (req, nonblank string, at most 128 UTF-8 bytes), body (req, nonblank string, at most 16384 UTF-8 bytes), replyToMessageId? (existing message in the same conversation; requires discussionMessageActions: 1), recipientAgentIds? (up to 31 distinct explicit agent recipients; requires discussionAgentMessaging: 1, see below), principalMentions? (explicit selected person identities/spans; requires discussionPrincipalMentions: 1, see below) { message: DiscussionMessage, conversation: DiscussionConversation }
discussion.rename workspaceId (req), conversationId (req), name (req, string; see management below) { conversation: DiscussionConversation }; requires discussionManagement: 1; Owner or Manager only
discussion.delete workspaceId (req), conversationId (req) { deleted: true, conversationId }; requires discussionManagement: 1; Owner only
discussion.react workspaceId (req), conversationId? (default "default"), messageId (req, server message ID), reaction (req, "👍", "👎", "👀", "✅", "🙈"; legacy "🙂" removal/retry only), active (req, boolean desired state) { messageId, reactions: DiscussionReaction[], reactionVersion }; requires discussionMessageActions: 1; expanded choices and reactor snapshots require discussionReactions: 1
discussion.stopAgent workspaceId (req), conversationId? (default "default"), messageId (req, committed server ID), agentId (req), attempt (req, positive integer) { activity: DiscussionAgentActivity }; requires discussionAgentActivity: 1; human participant only
discussion.retryAgent workspaceId (req), conversationId? (default "default"), messageId (req, committed server ID), agentId (req), attempt (req, positive integer) { activity: DiscussionAgentActivity }; requires discussionAgentActivity: 1; human participant only

DiscussionConversation is { id, workspaceId, kind, participants, createdAt, name? }. kind is "workspace", "direct", or "group". Workspace-wide conversations have participants: []: current workspace membership governs access, including members who join later. The reserved ID "default" identifies the initial workspace-wide conversation; additional workspace conversations have server-generated UUIDs. name is omitted, not null, until renamed; it never determines identity or access. createdAt is a server RFC-3339 timestamp. Legacy private conversations retain their immutable DiscussionAuthor participant snapshots and original kind.

The default conversation, unless deleted, leads the first page and counts toward limit. Other accessible conversations follow in descending ID order. beforeId: "default" skips the default, so a first page with limit: 1 can continue. Subsequent pages use the last returned ID; hasMore means another accessible conversation remains. Recipient discovery remains available for person mentions, using ascending principal ID order, search and membership filtering before the limit. Both queries are bounded in storage.

Workspace-wide creation and management

Exactly integer discussionManagement: 1 on hello and system.capabilities requires the complete workspace-wide creation, naming, deletion, and legacy privacy contract. This remains unreleased Multiplayer Labs functionality. Require exact support before enabling these operations; never drop a creation flag or retry against the default conversation when support is absent or unknown. The existing message-actions, person-mention, agent-messaging, agent-activity, and reaction capabilities remain independently required for their features.

A human sends discussion.send with createConversation: true, no conversationId or recipientPrincipalIds, and the first message's stable messageId. The daemon atomically creates a workspace-wide conversation and its first message. Opening or abandoning a composer creates no empty record. An identical retry retains the original conversation and message without repeating lifecycle or message events; a different body or target under that retry key is invalid. Use the returned conversation ID for subsequent messages. Separate intentional first sends use separate keys and create separate conversations. New direct/group creation via recipientPrincipalIds is rejected, never converted into a workspace-wide send.

Owner and Manager may rename any workspace-wide conversation, including the default; only Owner may delete one. These are authenticated human operations, with current workspace membership and role checked by the daemon. A capability or agent grant does not confer management authority. Ordinary Participants cannot rename or delete. The existing daemon administrator authority remains valid; inherited membership alone is not a management grant. Names are trimmed before storage and must then be nonblank and at most 128 UTF-8 bytes. Rename requires a string, not null; the response carries the stored name. Names are presentation metadata, not participant lists.

Deletion removes the conversation from discovery and makes its history and mutations unavailable. Deleting the default does not recreate it on the next read or send, including after daemon restart. Repeating delete or retrying a deleted conversation's first send returns -32602 { code: "not-found" }; neither can resurrect it. Clients remove its open/history panes and cached state and reject late responses or events for that deleted ID. A new conversation uses a new server identity.

Committed lifecycle changes publish transient, workspace-scoped events:

  • discussion:created and discussion:updated carry { workspaceId, conversationId, conversation }.
  • discussion:deleted carries { workspaceId, conversationId }.

discussion:created precedes the first discussion:message. These events go only to current human workspace members, never agent subscribers or event-history queries. Creation is also discoverable from the complete conversation descriptor in discussion:message. Recover missed changes through discussion.conversations and discussion.list; no message sequence or unread count advances merely because a name changed or a conversation was deleted.

Legacy direct/group histories remain readable only by their original participant grants and current workspace membership. Owners and Managers receive no bypass. They cannot be renamed, deleted, sent to, reacted to, or used for agent operations; no migration broadens their membership or destroys their history. Clients show them as read-only and retain an unsent draft rather than redirecting it elsewhere.

DiscussionMessage has the same shape in history, send replies, and events:

{
  "id": "server-generated-message-uuid",
  "workspaceId": "ws-1",
  "conversationId": "default",
  "sequence": 42,
  "body": "Let's review the sidebar together.",
  "author": {
    "principalId": "principal-1",
    "login": "sam",
    "displayName": "Sam",
    "avatarUrl": null
  },
  "createdAt": "2026-10-14T12:42:00.000Z",
  "replyToMessageId": null,
  "replyTo": null,
  "reactions": [],
  "reactionVersion": 0,
  "recipientAgentIds": [],
  "agentActivity": [],
  "agentMentions": [],
  "principalMentions": []
}
  • id is the immutable server-generated row identity. It differs from the client-supplied messageId, which is only a retry key. Two people choosing the same retry key still create distinct messages.
  • sequence is a positive, monotonically increasing server sequence. It orders messages within a conversation and is its pagination cursor; gaps are allowed. Clients do not compare sequence numbers across conversations, order by local clocks, or assume consecutive values.
  • author is a snapshot of the connection's authenticated principal, or the bound sending agent under the agent-messaging extension, at send time. The three profile fields are always present and nullable. Request fields cannot choose an author, sequence, timestamp, or workspace other than the authorized workspaceId. The snapshot is immutable; render its profile fields without resolving its principal ID against a current principal registry.
  • createdAt is a server RFC-3339 timestamp. body is plain text; line breaks are preserved. Render it as text, never HTML. Text or a navigational agent reference alone never requests agent delivery; only explicit recipientAgentIds do.
  • On a daemon advertising message actions, replyToMessageId, replyTo, reactions, and reactionVersion are always present. Older daemons may omit those fields; absence does not establish support for the extension.

Replies and reactions

replyToMessageId references an existing message in the same conversation. The daemon checks this inside the send transaction, including current membership and participation. A new conversation cannot reply to another conversation. Legacy private histories remain read-only, including replies. The committed message carries an immutable, nonrecursive quote replyTo: { id, author: DiscussionAuthor, body }, or null when not a reply. The quote uses the original author snapshot and body, bounded by the existing message-body limit. It confers no access to another conversation or principal. The reply target is part of retry identity: a changed target with the same retry key is invalid, rather than editing the committed reply.

Exactly integer discussionReactions: 1, advertised by hello and system.capabilities, enables the expanded reaction contract. It requires the existing message-actions support and grants no authority. This is a coordinated, unreleased Multiplayer Labs addition: older experimental clients only understand the old two-emoji response and must upgrade with the daemon; expanded responses are not filtered per connection. New clients use the legacy shape and controls when this capability is absent or unknown, and require exact 1 before sending expanded choices or interpreting reactor snapshots.

DiscussionReaction is { reaction, count, reacted, reactors }. The fixed order is "👍", "👎", "👀", "✅", "🙈", then legacy "🙂". The picker offers only the first five. Existing smiles remain readable/removable; active: true on an already-selected smile is a no-op, but creating a new smile is invalid. count is positive; empty aggregates are omitted. reacted is the authenticated human's or bound agent's own current selection. reactors contains at most 20 immutable DiscussionAuthor snapshots, captured server-side at insertion (old human rows are snapshotted once during migration; pre-snapshot imported rows may have null identity/profile fields when the source cannot be recovered). Samples are ordered by first-added UUIDv7 row ID, including inert imported rows; removing a sampled row refills from the next row. Counts may exceed sample length; clients can show “and N others” using count - reactors.length. Never resolve snapshots against live profiles or derive ownership from them. Source and destination snapshots may share identity strings without representing the same local selection; do not deduplicate snapshots by principal or agent ID. Samples and totals are maintained on mutation and persisted alongside the message; history reads do no roster aggregation or profile joins.

discussion.react sets the caller's desired state. Repeating it is a no-op. Inside the serialized write transaction, humans require current workspace membership; legacy private conversations reject reaction mutations. Agents require an existing explicit discussion grant and a nonretired, nondeleted session in the same workspace; under discussionManagement: 1, any workspace-wide conversation with that explicit grant is permitted. Agent identity comes exclusively from the authenticated MCP context, never arguments. ws.discussion.react exposes (conversationId, messageId, reaction, active) with the same result. Reactions never create a grant, enqueue a message, wake an agent, or subscribe agents to discussion events. Agent history and send retries project reacted from the bound agent rather than a human principal.

An actual change increments that message's nonnegative reactionVersion and publishes transient discussion:reaction with { workspaceId, conversationId, messageId, reactions, reactionVersion }. Every recipient gets its own reacted projection after a fresh access check; removed members and agents receive none. A no-op produces no event or version increment. Reactions do not change message order, sequence cursors, or unread message counts. Clients retain the greatest reaction version across events, history pages, and send replies; older responses must not overwrite a newer aggregate. Reconnect recovery must refresh reactions for displayed messages, since message-sequence catch-up alone cannot observe changes to older messages.

Workspace references may be represented by existing canonical workspace links in the plain-text body and rendered as navigable chips. The client must preserve the target workspace/backend and validate link kinds; reference text is never HTML, executable code, or permission to invoke an agent.

Image references

A message carries images as Markdown image lines at the end of its plain-text body; no field, method, or capability is added. Each line is exactly ![name](workspace-asset://<workspaceId>/<assetId>). A client uploads the bytes first with note.saveAsset and uses the returned url.

  • Only a trailing run of such lines counts as attachments. Text, if any, ends with a blank line before them. The same Markdown elsewhere in the body stays text.
  • <workspaceId> must equal the message's workspace. <assetId> must end in .png, .jpg, .jpeg, .gif, or .webp. Other lines stay text.
  • name is display text without [, ], (, ), \, or line breaks.
  • The lines count toward the 16384-byte body limit and are part of retry identity.
  • Asset reads use note.readAsset and its workspace membership check. An agent recipient gets the body unchanged and may read the asset with ws.note.readAsset(asset), passing the URL.
  • Deleting a message or conversation does not delete its assets.
  • Older clients show the lines as text.

Correlated agent activity and controls

Exactly integer discussionAgentActivity: 1 on hello and system.capabilities adds durable activity and selected mention snapshots to the unreleased Multiplayer Labs discussion feature. Every message includes agentActivity: [] and agentMentions: [], including ordinary/private messages. Old delivered messages without a trustworthy invocation receipt have empty activity, not invented status.

DiscussionAgentActivity is { agentId, attempt, version, state, updatedAt, error }. attempt is a positive integer identifying this recipient's invocation of the committed discussion message. version is a positive monotonically increasing integer across all transitions and retries for that message/recipient pair. state is queued, working, completed, failed, or stopped; updatedAt is RFC-3339 and error is a string or null. These describe this request, never an agent-wide status. Completed means the invocation ended; only an explicit discussion.send creates an agent reply. Stopping retains already produced text. A daemon restart marks interrupted work stopped; queued deliveries remain queued.

Human members with current instruction authority may Stop or Retry in the default discussion, and in named workspace-wide discussions under discussionManagement: 1. Agent callers and private discussions cannot use these controls. Stop cancels only the matching invocation, or removes its queued delivery; it must not stop another active request. Generic queue editing/removal refuses discussion requests; use this correlated Stop control. Regenerating an unrelated agent chat retains pending discussion requests. Retry applies only to failed/stopped attempts, creates the next attempt, and never inserts another human discussion message. The expected attempt is a compare-and-swap fence: a repeated or stale request returns current activity without applying again; a future or zero attempt is invalid. A retry may finish its already-committed queue handoff after reconnect, but never reconstruct completed work. Normal retirement and instruction-revocation gates still apply.

Transient discussion:activity events carry { workspaceId, conversationId, messageId, activity }. Delivery uses the same human membership/private-conversation gates as discussion messages; agents cannot subscribe. discussion.list restores the durable projection on reconnect. Clients merge by message ID plus agent ID and accept only newer version values, including when a request response races an event or a history page.

discussion.send additionally accepts agentMentions?: { agentId, name, start, end }[]. Offsets are UTF-16 code units into body; each ordered, non-overlapping span must be exactly @ plus its nonblank name, and its agent must be in recipientAgentIds. The maximum is 100 spans and 256 UTF-8 bytes per name. Spans may repeat a recipient. The daemon persists these immutable presentation snapshots and includes them in retry identity. They never grant delivery or access independently of recipients. Import preserves mention text as historical attribution but clears activity and does not restore invocation receipts, grants, or pending addressed work.

Explicit person mentions

Exactly integer discussionPrincipalMentions: 1 on client.hello server capabilities and system.capabilities enables human notification identities in unreleased Multiplayer Labs discussions. Clients require exact 1 before sending these fields or using them for notifications. Missing or unknown capability values must retain the selected draft; never silently discard its notification targets.

discussion.send accepts optional principalMentions: { principalId, name, start, end }[], defaulting to []. Every DiscussionMessage returned in send acknowledgements, history, and live events includes principalMentions, empty when none were selected. These are explicit notification identities, never inferred from matching names, @ text, reply quotes, or author snapshots. They neither add private participants nor address an agent; recipientAgentIds keeps its existing delivery semantics.

Only authenticated human sends may contain nonempty principalMentions; bound agent sends reject them as forbidden, including through MCP. Every selected principal must be a current effective workspace member. Legacy private conversations reject new sends; their historical mention snapshots remain inert. The serialized write transaction checks these conditions for new sends and retries. Unknown, removed, or inaccessible principals return not-found, without exposing membership information.

Each span uses UTF-16 code-unit offsets into body and must equal @ plus the nonblank selected name. At most 100 spans and 256 UTF-8 bytes per name are accepted; principal IDs must be nonblank. The array is sorted by ascending position and nonoverlapping, including with agentMentions. Repeated mentions of one principal at distinct positions are allowed. Invalid offsets, unknown object fields, altered text, overlap, and oversized arrays return invalid-params. Names/spans are immutable selection snapshots, not live profile lookups.

For example, sending body: "😀 @Bob" with principalMentions: [{ principalId: "principal-bob", name: "Bob", start: 3, end: 7 }] returns that exact selected array on the committed message. An identical retry returns the same server message; adding, removing, reordering, or changing mention metadata with the same messageId is invalid. A profile rename does not rewrite an existing selection or create a new notification. Live message delivery remains transient and uses the existing conversation access checks; clients deduplicate notifications by committed message ID and never notify from history replay.

Import clears all principalMentions notification identities, even when a source ID happens to equal a destination ID. The body and author/reply text remain historical content. Legacy archives with no such field import as [].

Explicit agent messaging

Exactly integer discussionAgentMessaging: 1 on both hello and system.capabilities gates explicit agent recipients and agent-authored replies. This remains part of the unreleased Multiplayer Labs discussion feature. Clients must retain an addressed draft when the capability is absent or unknown; never drop its recipients and silently post an ordinary message instead.

recipientAgentIds selects the agents to receive this message only. It is independent of human conversation participants, defaults to an empty array, and accepts at most 31 distinct, nonempty agent IDs from the same workspace. Retired or deleted agents and an agent sender's own ID are invalid targets. On a supporting daemon every message includes recipientAgentIds, including an empty array for ordinary messages. The recipient set is part of retry identity: reordering is immaterial, but adding or removing a recipient with the same retry key is invalid. Human and agent sender identities have separate retry scopes.

The initial extension addresses agents in the default workspace-wide discussion; discussionManagement: 1 extends it to every workspace-wide conversation. Private-conversation targeting and agent access remain forbidden: ordinary agent transcripts are workspace-visible, so granting private history without restricting those transcripts would expose private content. Legacy private histories remain read-only with their original access restrictions.

The daemon binds the author to the authenticated human or calling agent; no request field can impersonate either. An agent author has agentId, principalId: null, and its captured display name. Human author snapshots keep their existing shape with a nonnull principalId and no agentId. Clients identify agent authors explicitly and never compare a null principal with the signed-in human to determine ownership. Reply quotes preserve the same author snapshot. Imported snapshots are historical attribution, not an identity or permission grant on the destination.

For example, an agent-authored message carries:

{
  "principalId": null,
  "agentId": "agent-4fbdc035-e235-43f9-8c15-48d787f05e09",
  "login": null,
  "displayName": "Reviewer",
  "avatarUrl": null
}

Before being addressed, an agent cannot list or read discussion history or post into the discussion. An accepted addressed message establishes durable access for that agent to that conversation. The agent receives the addressed message and conversation identifiers, without automatically loading history. It may then explicitly fetch bounded pages with ws.discussion.list and post with ws.discussion.send; ws.discussion.conversations discovers only its authorized conversations. These tools bind the agent and workspace from the MCP session, never from a caller-supplied author. History uses the same paging bounds as human reads. Retired/deleted agents cannot use a previous grant.

The agent-facing calls are:

await ws.discussion.conversations({ limit: 50 });
await ws.discussion.list("default", { limit: 50 });
await ws.discussion.send("default", "I checked the change.", {
  messageId: "unique-reply-key",
});

The caller supplies a unique messageId for each intended post, retaining it and all message fields for a retry. To explicitly address another agent, add recipientAgentIds to the send options. List options also accept beforeSequence or afterSequence; discovery accepts beforeId.

An agent's normal turn output is not automatically posted into a discussion. It must call the discussion send tool to reply. A reply without explicit agent recipients wakes nobody. An authorized agent can explicitly address another eligible agent in its reply; merely replying to an agent-authored message or including an agent reference does not deliver a turn.

Message persistence, new grants, and pending recipient delivery records share one transaction. Delivery uses a stable identity for each message/recipient and the existing agent queue; retries preserve the original message and do not create a second delivery. Pending delivery must survive daemon restart and failed handoff. Being accepted into the queue does not mean that the agent has finished replying.

Agents remain excluded from discussion: event subscriptions, event history, and discussion typing. Addressing one message never subscribes the agent to later messages, reactions, or typing activity. Conversation grants and pending deliveries must not be reactivated by workspace import.

History and delivery

discussion.list returns only the selected conversation's messages, in ascending sequence order:

  • Without a cursor, select the newest limit messages. hasMore means older rows remain below the returned page.
  • With beforeSequence, select the newest limit messages strictly below that sequence. hasMore again means older rows remain.
  • With afterSequence, select the oldest limit messages strictly above that sequence. hasMore means newer rows remain above the returned page. Zero is accepted so an initially empty discussion can catch up from its beginning.

The cursors are mutually exclusive; supplying both is -32602 Invalid params. An empty page returns an empty messages array and hasMore: false, with the conversation descriptor still present so restored panes can recover their title and participants. Queries are bounded by the page limit; the server does not load the entire conversation.

A page is also bounded by size: when its messages would serialize past 480,000 bytes (under the daemon's 500 KiB read payload budget), the daemon returns fewer than limit messages and sets hasMore: true. A latest or beforeSequence page keeps its newest messages and an afterSequence page its oldest, so the usual cursor (the oldest or newest returned sequence) continues at the cut. A page always holds at least one message. Clients must page by hasMore, never by comparing the page length with limit.

discussion.send persists the row before replying and publishes discussion:message with data = { workspaceId, conversationId, conversation, message }. The event carries the complete conversation descriptor and committed message, allowing recipients to discover a new conversation without a refetch. It is transient: broadcast through the existing event bus without persisting a second copy in the event log. History survives daemon restarts and client reconnects in the discussion table; discussion.list is the recovery path when live delivery is missed.

The retry key is scoped to (workspaceId, authenticated principalId, messageId). Repeated sends with the same key, target, reply target, and exact body return the original conversation, message identity, body, and author snapshot, even if the person's profile has since changed. The response projects the current reaction state for the caller. First-message creation retries retain createConversation: true; they do not replace it with the returned conversation ID. A client retries an uncertain send with that same key and body. New intentional sends use new keys. Reusing a key with different text or a different conversation or creation intent is -32602 Invalid params; it does not edit the row, create a conversation, insert a new message, or publish another event.

Clients subscribe to workspace events before reading history, route by workspace and conversation ID, merge by message id, and sort by sequence. A live event, a send reply, and a history page may contain the same row. A late history reply must not erase a live row. After a reconnect, use afterSequence from the last successfully synchronized history position and advance it through each fetched page until hasMore is false. Keep this position separate from live arrivals and send replies: seeing a newer message does not prove that intervening history was fetched. An initially empty history establishes position zero. Bound catch-up work per attempt and preserve the last fetched position across interruption or retry; a live message must not advance it past unread history. Keep the older-history cursor separate, preserve scroll position when prepending history, and retain drafts and uncertain sends until their outcome is known. Discard pending replies when the workspace's backend or authenticated principal changes. Drafts, uncertain sends, pagination, and synchronized history positions are independent for every conversation. A legacy event without a conversation ID can only belong to the default discussion.

Typing indicators

Discussion typing uses the existing transient presence channel (§5.47). A human connection reports presence.update with discussionTyping: { workspaceId, conversationId }; omitting conversationId selects the default discussion. Human roster rows carry discussionTyping: [{ source, conversationId, since, pulse }], projected to conversations the recipient may access. An unsent new-conversation composer has no server conversation ID and reports no discussion typing. It carries no message text and does not change history or message sequence numbers. The existing agent typing shape remains unchanged, and agents cannot read discussion typing.

The message stream shows typing avatars and a three-dot bubble, with the other members' names in its localized accessible label. Pulses are throttled, expire after three seconds without a new pulse, and clear on send, empty draft, blur, navigation, hidden window, disconnect, or lost access. Multiple connections for one person produce one name; the current person is hidden. Only the currently displayed conversation's entries are shown. Repeated unchanged rosters cannot revive expired typing. An omitted field from an older daemon means no indicator, not a discussion failure.

Workspace transfer

Workspace exports support default discussion history. Named workspace-wide conversation export is not yet supported by the companion implementation at c576b988: its archive snapshot guard rejects messages outside default, even when admission accepts their workspace-wide conversation metadata. A workspace containing a message in a named conversation therefore fails export with the unsupported-transfer error. Do not promise named-conversation export until the snapshot guard distinguishes workspace-wide conversations from private history.

A workspace containing legacy private conversations also cannot be exported. Export returns the unsupported-transfer error; admission and the archive snapshot protect against exposing private history or participant identities to a nonparticipant owner or agent.

Import preserves message IDs, sequence order, bodies, timestamps, and author snapshots. An imported author's principalId is inert source-daemon attribution, not a destination identity or membership. A matching destination principal string must not rebind the author, change the profile, or establish an own-user comparison. Private conversation participant grants are cleared on import; their archived history remains inaccessible through discussion APIs, even to the destination owner. Workspace-wide discussion history remains available to destination workspace members.

Reply quotes retain their original inert author snapshots. Reaction counts and versions and immutable reactor snapshots remain historical data. Import retains display rows and their order but clears both local principal and agent ownership columns; no discussion-agent grant transfers. All destination viewers therefore start with reacted: false, including people whose principal string matches a source reactor. Turning off an unselected reaction is a no-op; a destination person's new reaction adds to the historical count and can remove only that new selection.

Import isolates historical retry keys from destination senders, so a new send cannot resolve to an imported message merely by reusing its source principal string and client key. This uses the existing archive format and exact daemon version compatibility gate; it does not transfer membership or credentials.

Access and compatibility

Human calls require an authenticated client connection and current workspace membership, including inherited host membership. The agent-messaging extension permits bound agents to discover granted conversations, read their history, and send replies as agents. Recipient discovery remains human-only. Under exact discussionReactions: 1, a bound agent may also react in a workspace-wide conversation (named conversations require discussionManagement: 1). An existing explicit discussion grant and a nonretired, nondeleted session in the same workspace are rechecked inside the serialized write transaction. Reactions never grant access or wake agents. Agent, daemon, and unbound callers cannot post as people. A missing or inaccessible workspace is -32602 { code: "not-found" }; an unsupported caller is -32003 Forbidden. Malformed fields and out-of-range limits are -32602 Invalid params. The author comes from the bound caller, never client.hello display metadata.

Legacy private conversation reads and discovery additionally require a stored participant grant; workspace or host ownership does not bypass this check. Sends and retries recheck the sender's effective workspace membership inside the serialized write transaction. An unknown or inaccessible conversation is indistinguishable from a missing one. Participant snapshots do not confer membership: a removed workspace member loses access even while its historical participant record remains.

discussion:message and discussion:reaction are workspace-scoped and recheck workspace membership and conversation participation at delivery time. Removed members cannot continue reading history, sending, or receiving subsequent messages. Private typing entries are projected separately for every receiving human; unrelated workspace members receive neither a private conversation ID nor its typing activity. Agent subscriptions cannot subscribe to or receive discussion: events, including subscriptions restored from storage. All event history queries exclude discussion rows before pagination, including rows stored by earlier development builds; explicit type, wildcard, and unfiltered queries cannot expose them. Only a message's explicit recipientAgentIds, under the agent-messaging extension, requests agent delivery; other sends dispatch no turn.

Older owner connections can answer -32601; an older collaborator allowlist can answer -32003. Clients must show that discussions are unavailable, retain the draft, and never substitute an agent message or note comment. Authorization errors must not be treated as successful sends. A numeric protocol version does not bypass membership or the Multiplayer Labs setting.