feat: collaboration - #3058
Merged
Merged
feat: collaboration#3058
Conversation
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.
…cutoffs and dry runs
…view, people ranking, and background jobs
…inClassifyThreads async)
…es automated mail no topic; mailbox look defaults to 30 days
…ion data, keeping the Microsoft link
…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.
…even when marked auto
* 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.
…s, keep-out clears Work
…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
… throttled reads, per-thread progress
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes Made
How to Test
Notes