Skip to content
Workbench
Esc
↑↓navigate↵open⌘Jpreview
On this page

Conversations and selected sharing

Persist audience-specific conversations and replies without exposing internal history.

Conversations belong to an existing space and optionally its existing task. Team, Client and private conversations retain the same work reference; audience is independent of task status. Creator and owner IDs come from the authenticated actor and persisted parent, including client-authored replies. UUIDs are native database UUIDs and API responses use lowercase IDs.

Task collaboration

A task page is one page beside its conversation: the title over when the task was created, its properties, its description, then Supporting files. The task-scoped Team/Client conversation stays in the side panel, with the existing Chat sheet on narrow screens. People with the matching capability edit the task on its page or delete it from the band’s Task actions menu; every reader can copy its URL. Properties show the owner’s photo and full name, the status and any labels. Supporting files are the task’s saved files as rows with their type, size, uploader and date, newest first. A file’s name opens the preview, which downloads it. An uploader who can no longer read that file’s conversation is not named. Internal viewers see Team files and client-only presentation uses authorized Client conversations. The section has no upload; people add files with + in the side conversation.

Paper’s Messages section means supporting correspondence, such as source emails, rather than the task chat. Correspondence, facts and trail sections remain absent until their persisted projections exist. Old task links with a tab open the same page.

Space channel provisioning

Space creation also saves one brief introduction from Wes in the default Team conversation, in the same transaction as the space and agent identity. It is available on the first message fetch without model configuration or a background sweep. The message records system provenance (space-created), not a generated Pi invocation. Client and private rooms do not receive it.

Creating a space atomically creates its Team and Client conversations alongside the Team agent identity and storage intent. For a client-bound space, creation also records an organization-wide read/write conversation grant for the linked client business through its current client_of relationship. Current client members can open and reply to that Client conversation immediately; people who join the client organization later receive the same access through that grant. No per-person sharing step is required for this space-level Client channel. Unbound spaces have both channels but no external client grant.

The grant opens only the Client conversation and its saved history, files and published outputs. Team/private history, task details and full-space access retain their existing checks. Membership removal, client/firm deactivation and relationship removal revoke access through the normal request-time policy. Deleting a space removes its conversation grants with its conversations. This provisioning applies to newly created spaces; existing spaces and their selected recipient grants are unchanged.

Audiences and authority

Audience Access
Team Current provider membership in the owning organization, internal-work capability and parent access.
Private The creating user, acting with current internal-work capability in the owning firm and parent access. A downgrade to a Client-only role revokes private access, including the creator’s prior history. Grants cannot open another user’s private conversation.
Client Authorized owning-team users, or an explicit conversation grant matching the current recipient user, membership and organization relationship. The exact conversation grant and current bound-business scope suffice; a separate space grant is not required.

A Client conversation grant gives access to that conversation’s entire shared history. Review its recipients before adding content. Adding a recipient deliberately grants that person access to the existing conversation, including its prior shared messages. Team and private history never becomes part of that audience through a grant.

Task conversations require a current task read grant for internal access. A restricted Client recipient uses the exact conversation grant and current bound-business scope instead of separate task or space grants; this does not grant access to task fields, task items or other conversations. A stable task ID in a response is a reference, not authorization to fetch it. Bound spaces also require an active client business and current canonical relationship to the owning firm. External clients must match that bound business, even if a space/conversation grant was placed incorrectly. Recipient grants cannot target another business for a bound space. Every read, list and write checks current authority; denied direct reads and writes return 404, and lists omit inaccessible conversations. Removing a relationship cascades its grants; recreating the relationship does not restore them.

Client recipient management requires the owning provider’s share capability, conversation access and, for task conversations, an explicit update grant on that exact task. The selected relationship must be client_of: its source is the recipient’s client business and its target is the owning firm. The recipient must belong to that client business. The grant’s organization_id identifies the recipient organization, as required by the existing grant matcher; resource ownership remains on the conversation. Recipient records use the existing access_grant model, and grant read/write access. Revocation removes that grant; another separately issued grant may still authorize the recipient. Deleting a conversation also removes its polymorphic grants, preventing access from returning through reused resource IDs.

GET /conversations discovers only conversations the actor can currently read. Discovery and direct conversation reads include a narrow space summary: ID, name, type and bound business ID. They expose an opaque task ID without task fields or history. This summary does not authorize the ordinary space or task APIs; those retain their existing grants and serializers.

Messages, sharing and retries

Messages are append-only. Each stores its author, posting user, owning organization and conversation. A reply can reference only another message in the same conversation. Public authors are a discriminated union: a human user ID, or an agent with a random opaque ID and a server-selected display name. The creator remains the initiating user for verified agent replies. Browser message payloads cannot set authorship or runtime identity.

Sharing selects one exact message ID from a conversation the actor can read. The server copies that immutable text and original author into a Client conversation for the same space and task. The posting user records who shared it. The internal source link stays in the database and is omitted from public serializers; the recipient receives no route to earlier discussion or source context. To revise selected wording or its visual answer, append a new message and select its new ID. Subsequent internal messages do not alter previously shared text.

Clients generate and retain a UUID for each conversation creation, message append, selected share and recipient grant. Retry with that same UUID and payload to retrieve the existing result. A changed payload using the same UUID returns 409; concurrent writes never overwrite the first contribution. Reads and writes use the shared authenticated Effect HTTP contract. Insert statements recheck current audience, membership and grants, and reject mismatched parent or reply references.

Generated visual answers

Verified Team replies can include a versioned display snapshot alongside their immutable text. The native render_ui tool prepares the display from bounded concrete candidates through the existing Effect Jev provider. The native operation owns the retained result; request payloads cannot supply it. Failed, canceled or unauthorized runs cannot publish that result. Exact retries compare both text and display.

Selected sharing copies the chosen message’s exact text and display into Client after the existing authority checks. It exposes no private runtime proof or source access. Source notes are prepared content, not independent verification. Follow-ups append new answers; personal chart filters and expanded views never update the saved message. Unsupported visual versions retain a readable text reply. See generation boundaries and limits.

Human conversation UI

Open a space or task and use its conversation aside. Team and Client show saved rooms for that exact space and task; multiple rooms have a conversation selector. Writable Team and Client channels show the composer immediately, including when no room exists. The first send creates a missing room before uploading attachments and saving the message; opening a page or drafting text does not create it. Creation and message retries retain their original UUIDs, and failures preserve the text and attachments. Creating a Client room does not add recipient grants. Send plain text with Enter; Shift+Enter adds a line. Messages are limited to 50,000 characters. Failed sends preserve the draft and reuse the mutation UUID for an exact manual retry. Successful sends reload saved messages and clear the field.

The UI obtains canCreateTeam, canCreateClient and writable room IDs from GET /spaces/:spaceId/conversation-capabilities, with an optional taskId. This advisory projection uses the same current creation and conversation read/write predicates as the domain operations. It excludes private room IDs. Every mutation still checks current authorization; read access alone never enables a write control. Existing Client rooms offer a human reply composer only when their exact ID appears in the writable projection. Human replies use the same native append endpoint as Team messages; they do not invoke agent publication. A Client room without write permission stays read-only. Recipient management and selected publication remain API capabilities without UI controls.

Every conversation read and write carries the rendered expected user and organization through the shared Effect client. Query keys include that actor, space, task and room. A typed actor-scope conflict enters global recovery, clears old actor data and never replays a submission. Room reads and sends verify the persisted space/task binding before requesting history or appending. Moving between actors, spaces, tasks or rooms resets the composer. Authors use the contract’s discriminated author union. Every author uses the same left-aligned message row, including the current user. Human authors and reply-summary avatars use the current authorized participant name and stored profile image, with a stable fallback avatar. Participant discovery includes relationship-scoped conversation grants and rechecks each person’s current room access before exposing their name or photo; the current user falls back to You, and other humans to Member, when their projection is unavailable. User IDs are not displayed. Author names and compact timestamps appear together above the message text. Agent replies and selected agent snapshots render the supplied display name with an accessible Agent label, independently of the human creator recorded on the message. Messages are grouped under dated separators. Times use the browser’s time zone after hydration, with full dates and time zones available on the timestamp; UTC keeps server rendering and initial hydration consistent. Padded conversation rows preserve wrapping and typed line breaks. The UI does not invent participant names or infer authorship from creator IDs.

Saved agent replies, including selected shared agent snapshots, render as Markdown with Words in static mode. Headings, lists, links, tables and fenced code are formatted in the conversation; human messages preserve literal text and mentions while rendering pasted HTTP(S) URLs as native links. The original message text remains unchanged in storage. The renderer omits embedded HTML and validates link and image URLs, without enabling executable islands or raw HTML.

Saved rooms use the shared Message primitive’s feed variant and Bubble’s ghost variant for plain message text, following the conversation design system. Consecutive messages from the same author, with the same reply target and sharing state, group within five minutes on the same local day. Grouped messages retain the avatar lane and accessible author and timestamp, while showing the name and avatar once per group. The first reply starts a fresh group beneath the thread’s reply divider. Messages over 500 characters use Coss’s paragraph-aware Show more / Show less treatment and keep the complete content available to the renderer. Reduced-motion preferences disable expansion motion. Adapted source retains Coss’s MIT notice beside the components.

Agent answers to an existing message belong to that message’s thread, including Wes’s first direct answer to a channel post. The saved replyToId determines the thread for human and agent authors alike; replies to replies resolve to the same original post. The channel shows the original post with participant avatars, the total or unread reply count, the latest reply preview and its time beneath it. Opening the thread shows the full Markdown answers as ordinary messages without repeated parent-reference cards. Standalone agent posts, such as reminders and new topics, have no reply target and remain full messages in the main conversation. Missing parents are not guessed; messages whose parent is outside loaded history remain visible as posts. Long reply previews truncate within the message column.

Saving an eligible @Wes message starts server-owned admission after commit; the page observes activity and offers explicit retry. See Team invocation and recovery.

Wes’s thinking, progress and recovery controls appear beneath the originating post in the channel’s thread-reply area; activity on a nested reply resolves to the original post. Inside an open thread, activity follows the replies.

Opening a thread shows the original post, a reply-count divider, the full replies and a Reply composer. Desktop navigation uses the space breadcrumb and Thread in the main header; mobile sheets retain their local back control. Back returns to the channel and restores focus to the post’s thread control. A thread link outside the loaded room shows an unavailable state and disables sending. Read-only rooms can open existing threads without gaining write access. Entering or leaving a thread resets its composer, while failed sends within it retain the draft and retry identity. Thread views do not mark the whole channel read.

Emoji reactions

Messages support the Coss reaction picker and count chips for 👍, ❤️, 🎉, 👀, ✅ and 🙏. Reactions are separate records with creator and owning organization, not message edits or emoji-only replies. A unique message/emoji/author key keeps retries from adding votes. A person can add or remove only their own human reaction; agent reactions remain separate. Reading reactions requires current room read access; changing them requires current room write access and a message in that exact room. Sharing a message does not copy its reactions.

The authenticated conversation API accepts only emoji and desired presence; it selects human authorship from the current account. The interaction state supplies the saved reactions. The UI disables controls while saving, displays a failure when a change is not saved, and allows read-only viewers to see existing counts. Reactor names include Wes and the current participant names. Reaction chips preserve keyboard access and pressed state through Base UI; Coss’s selection bounce respects reduced motion.

The native Team tool message_react adds a real reaction as the verified shared Wes identity. It accepts an emoji and an optional message ID, defaulting to the initiating message. It rechecks the original actor, Team binding and write access and cannot target a different room. Repeating the same reaction is safe. The tool is available during an authorized Team invocation; reactions do not themselves trigger Wes or serve as evidence that work completed. The client refreshes interaction state when Wes finishes. Personal runtime reaction tools and arbitrary emoji are outside this slice.

Owner entry and shared conversations

Client access emails use sharedConversationPath to open the existing /shared/:conversationId shell with the recipient’s organization and the conversation panel open. Sign-in retains that complete destination. A different or unselected active organization shows explicit organization selection before any conversation read; switching returns to the same URL and rechecks current access. The URL does not create membership or grants.

The Owner home shows Client conversations discovered through GET /conversations for the active actor. Its business page filters the same narrow results by the supplied business reference. Empty discovery, denied access and failed loading have distinct states. This path works without a full-space grant.

Each link opens /shared/:conversationId, a restricted shell using the persisted room and its narrow space summary. It never fetches a full client directory, space or task to open the room. A task reference does not expose its title, description, status or internal discussion. Direct links reject Team and private rooms; denied or revoked room reads show not found. The exact conversation capability enables human replies, and the ordinary append endpoint rechecks current access. Owner entry and direct-room query keys include the rendered user and nullable active organization and use global scope-conflict recovery.

The shared shell provides profile and sign-out, with no private agent, Team selector, space-management actions or Administration link. The home page retains organization selection for people with multiple legitimate memberships. The shared page lists immutable published output cards and exact conversation files. These lists use the conversation grant, without loading parent task fields.

Mentions and unread state

GET /conversations/:conversationId/interactions supplies current human participants, message attachment/mention metadata, publication targets and the viewer’s unread state. Participant names and mention choices are limited to people who can currently read that exact conversation. Picking a mention stores its user ID alongside the text; plain typed text alone does not issue a mention. Mention targets are rechecked at insertion. This does not implement external notifications.

Unread cursors are scoped to the user, active organization and exact conversation. The first incoming unread message has a New marker. The composer has no manual mark-read button, matching the Paper design. The PUT /conversations/:conversationId/read API acknowledges only a message in that conversation; older or concurrent acknowledgements cannot rewind the cursor. Opening a background page does not acknowledge messages automatically. Expected-actor conflicts use the same global recovery as other mutations.

Files and shared output cards

Connected Team and Client conversations accept files through Add files, a drop onto the composer, or a file paste. Ordinary text paste keeps its native behavior. Clients can also upload directly in Apps & Files. Selected files show as chips inside the message box, in the private agent chat too, and remain in the draft until saved, with an uploading state on each pending chip. Selection and removal are disabled while sending; a failed batch waits for every file before enabling a retry. Each upload retains its own UUID for an exact manual retry; successful uploads can be reused when a later message save fails. Message attachment references must match ready files in the exact conversation. Read-only clients can download authorized files without receiving upload controls. An authorized upload retries pending shared-storage verification automatically. Unavailable storage produces an explicit failure and never a saved acknowledgement. File validation and storage behavior remain authoritative.

Partial upload success refreshes saved files and storage status even when another file in the batch fails. A space’s Apps & Files uploads files as soon as they are chosen. Saved files join the list, newest first; failed ones stay as chips with Retry upload, which keeps each file’s UUID. They stay bound to their selected conversation: switching rooms hides that room’s failed files and returning restores them.

An authorized provider can choose Share output card on a saved attachment and select an authorized Client conversation for the same work. POST /conversations/:conversationId/cards pins an exact readable source file/version/hash, verifies its bytes, and saves a separate immutable copy for Client. Source read authority and target share authority are rechecked when reserving and finishing that copy, including after storage I/O. A revoked publication cannot become a ready Client file. Publication retries preserve the same card and file; changed content, source or summary conflicts.

GET /conversations/:conversationId/cards exposes only the Client copy and plain display text. Private source references stay server-side. Owner cards do not open firm app pages. They are publications of real output files, not app/job definitions, schedules, run state or fabricated figures. Agent runtime integration can call domain/conversations/publications.ts; output production remains a separate workstream.

Verified agent replies

The server-only VerifiedConversationInvocation context carries the original actor, immutable human instruction ID, exact conversation/principal, stable operation/output UUIDs and the actual settled Pi output text. The runtime verifier must independently resolve and verify persisted native invocation settlement before supplying this context; naming an object a receipt does not verify it. No HTTP endpoint accepts its fields.

appendAgentReply() takes no arguments. It rechecks the original human instruction and current actor standing, role, grants, relationship and actual business binding at both insertion and retry read. Personal replies stay in the creator’s authorized private conversation; Finance replies stay in Team. A reply, shared-space participation or an agent author label grants no tool/provider authority. A banned or revoked actor cannot retrieve a saved operation through an append retry.

Each operation has one canonical output message. An exact retry returns it; changed text or output identity conflicts, and reuse in another conversation returns an opaque denial rather than another room’s result. Runtime principals and native invocation/operation references stay private in the original database row. Selected sharing copies only exact text and the safe author projection, with no runtime metadata copied into Client. The public agent UUID is randomly allocated and persisted by the runtime, never derived from a private namespace.

Team execution

The shared Team agent provisions a stable identity and default space-level Team room. Its explicit Ask Wes control starts a native Pi operation from an already saved human message; canonical settlement uses the verified appender described above. Task-level agent admission remains separate.

Integration limits

This is the initial persisted conversation slice of WB-81. It supplies human request/reply storage and selected immutable message sharing. The typed appender is an internal persistence boundary; each runtime must independently verify its own persisted native settlement before calling it. External notifications and invitation delivery remain separate integrations; conversation files, attachments, mentions and explicit unread state are connected as described above. Retained document/task-item revisions, approvals pinned to exact proposal versions, and independent delivery attempts require later layers. A persisted message or share is neither approval nor evidence of notification or external delivery.

The default Team chat includes a member-owned Reply to me without @Wes switch. It enables server-side invitation decisions for that member’s new messages and preserves explicit mentions. See replies without mentions for scope, context, fallback and authority.

Access addition intent

Direct organization-member additions and new user-specific Client conversation grants persist one notification_event per source transition and recipient. The native member operation uses the installed organization plugin’s real hooks and membership limit, with server-only creator attribution. Database triggers commit intent with the membership or grant insert. Invitation acceptance and organization creation omit that attribution; repeated membership or access does not notify again. Historical rows are not backfilled.

Eligibility checks the recipient’s current membership, ban state, active organizations and live Client conversation access. An old event cannot substitute for a removed membership or grant. This layer records durable intent. The access addition email consumer sends eligible membership and Client-share notifications.

Was this page helpful?