Skip to content

feat: collaboration - #3058

Merged
kunal0137 merged 68 commits into
devfrom
feat-collaboration-db
Oct 2, 2026
Merged

kunal0137 merged 68 commits into
devfrom
feat-collaboration-db

Conversation

@kunal0137

Copy link
Copy Markdown
Collaborator

Description

Changes Made

How to Test

  1. Steps to reproduce/test the behavior
  2. Expected outcomes

Notes

Fixed patterns v1 (Outlook/Gmail html markers, then text rules). Not yet validated on real mail.
Work items with views, history, and undo; review entries with resolve and
reopen; open rooms and thread goals. Adds the Work and review reactors and
BrainListThreads detail for the front end load.
…es automated mail no topic; mailbox look defaults to 30 days
…rs, org domains, model topics

Import loads people, threads and messages once and saves in batches of 25; mail to more than
25 people adds no new people. Sender typing marks automated and list senders and their threads
before ranking, topics and classify. COLLAB_ORG_DOMAINS and subdomains count as the owner's org.
Topics come from COLLAB_LLM_ENGINE_ID when set (access checked, headers only), rules otherwise.
Mail not addressed to the owner is FYI; a VIP's ask moves up. inTransaction rolls back on any error.
…rified domains, follow list

Import reads the tenant's verified domains and looks the busiest people up in the directory
(20 per $batch): colleague, guest, shared mailbox or distribution list, with title and department.
A directory answer wins over the header rules; without a directory the rules apply as before.
Brain suggests people to follow from the org chart and two-way mail; follow, VIP and decline save
on the person, and BrainListPeople filters by follow state. COLLAB_ORG_DOMAINS is gone.
…LAB_THREAD_AGENT_ID)

BrainGetSettings returns assistantAgent {id, name, modelId} when the setting is set and the user can
view the agent. With that agent bound, a thread room keeps the agent's prompt, skills and read/draft
tools; tools marked ask (send, post, upload, calendar changes) are dropped from the list and refused
instead of paused. Without it the thread room behaves as before (no tools, same prompt text).
…ot have

Graph uniqueBody leaves out what was forwarded, so a forward (FW: subject) or the oldest message we hold
in a thread reads the full body. The header block becomes "Forwarded from X, date:" (or "Earlier message
from"), > quoting is unwrapped, a footer above the kept part (Sent from my iPhone) no longer cuts it, Apple
"Begin forwarded message:" is recognised, and text is capped at 12000 chars. Such messages carry
history=true so the UI does not trim them again. Replies further down a thread are unchanged.
kunal0137 and others added 7 commits September 29, 2026 09:12
* feat: collaboration reactor updates

* chore: code formatting

---------

Co-authored-by: Maher Khalil <themaherkhalil@gmail.com>
Candidate A saves its grouping as thread-topic links, so sorting only asks about the rest and never
refiles them. Topic descriptions are sample subjects, not the pipeline note. The classifier always gets
a "Something else" choice, and a topic choice links both candidates. Calendar mail (Graph eventMessage)
is flagged at import (BRAIN_MESSAGE.MEETING), is FYI in Work and does not count as writing. Urgency
caps by message age. Asks from followed people move up half a level. People strength is a log scale.
Top senders list people only. Outside domains are pre-ticked only on a reply or a VIP. A topic takes an
account, or kind client, only when at least half its threads involve them. COLLAB_CLASSIFY_PARALLEL
sets how many threads sort at once.
themaherkhalil and others added 18 commits September 30, 2026 19:36
…engine window; topics from sorted mail

- from is "Name <address>"; the footer the cleaner cut rides along as its own field
- COLLAB_CLASSIFIER_WINDOW {engineId: tokens}: more messages and longer text for a large-window engine
- topic step after the sort: wide seeding from real mail, model-written description, key people and
  domains on each suggestion, no pre-filing, no name-word keywords
- BrainClassifyThreads(topics=[true], async=[true]) files sorted mail under the kept topics
- the classifier's topic definition includes key people and domains
…oposer

Comment what each topic onboarding stage owns, and remove the unused
header-only topic proposer from BrainTopicModel.
- BrainSync imports new mail since the last check and classifies threads
  whose newest message is newer than their verdict; Refresh runs it as a job
  and reports what each thread became.
- New messages on a thread with Work update, clear, or follow up on the item
  (ingestOnThread) instead of being skipped.
- WorkUpdateItem takes closedReason; no_response_needed (with dismissed)
  records the owner's correction for the classifier.
…ntacts, email draft block

- Every agent in a collaboration room gets the mail, calendar, Teams and
  OneDrive tools from collaboration_tools_mcp.json; ask tools pause for approval.
- Unknown tool argument names are refused instead of silently dropped.
- FindPerson searches the owner's contacts and Microsoft directory, then platform accounts.
- The thread prompt owns the semoss-email-draft rules; the body field is "message".
- DelegateToPerson is described as hand-off, not email.
- Drop collaboration_tools_mcp.json; each tool comes from its reactor's
  asMcpTool() under a short name, so reactor description changes reach rooms.
- References to other reactors in descriptions use the tool names rooms see.
- Reactor text: cc/bcc are optional, includeDisplayBody reads like the other
  booleans, attachment urls no longer name a tool rooms do not have.
…ail editor

- ComposeEmail writes or changes the open editor email (only changed fields
  with openEmailId); SendEmail is an ask tool that sends the editor email, or
  the saved draft the approving UI names with draftId.
- Mail goes through prerna.collaboration.email (MailProvider, Outlook today),
  so Work tools never name a provider; Gmail plugs in there later.
- Work rooms drop Microsoft SaveDraft, SendDraft, and SendMail; the reactors stay.
- Tools declare a UI component in _meta.SMSS_MCP_UI (email-compose,
  email-draft, email-send, calendar-event); supplied MCP JSON still wins.
- THREAD_PROMPT is joined at runtime so the harness no longer inlines a stale
  copy; email rules: changes are tool calls, new emails get a real subject.
- Replying to a message sent only to yourself addresses you.
…cipients

- ComposeEmail takes forward (a message id): Outlook writes the forward with the
  original and its attachments; message is only a short note.
- Prompt and tool text: a reply leaves to and cc out unless the owner asks to
  change who gets it; never guess an address, not even from a name.
@kunal0137
kunal0137 marked this pull request as ready for review October 2, 2026 15:18
@kunal0137
kunal0137 requested a review from a team as a code owner October 2, 2026 15:18
@kunal0137
kunal0137 merged commit 2a77730 into dev Oct 2, 2026
5 checks passed
@kunal0137
kunal0137 deleted the feat-collaboration-db branch October 2, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants