rspace-online/backlog/tasks/task-67 - Context-aware-MI-...

35 lines
1.5 KiB
Markdown

---
id: TASK-67
title: Context-aware MI bar across all rspace.online headers
status: Done
assignee: []
created_date: '2026-02-27 22:46'
labels:
- ai
- ux
- mi
- header
dependencies: []
priority: medium
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Enhance rstack-mi component to gather page context (open shapes, active tab, page title) and send to /api/mi/ask for context-aware responses. Update server system prompt to use extended context. MI bar already present in header of all pages via server/shell.ts.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 rstack-mi gathers open canvas shapes, active tab, page title as context
- [ ] #2 Server /api/mi/ask accepts and uses context object in system prompt
- [ ] #3 MI identifies as 'mycelial intelligence' and references open content
- [ ] #4 Bar present in all pages: canvas, index, admin, create-space, server shell
<!-- AC:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Implemented in commit f8bd09d, merged to main as 59f2be3.\n\nshared/components/rstack-mi.ts:\n- Added #gatherContext() method collecting space, module, open shapes (type+title+snippet), active tab, page title\n- Context sent with every /api/mi/ask request\n- Updated placeholder and welcome text\n\nserver/index.ts:\n- /api/mi/ask accepts context object\n- Extended system prompt includes open shapes, active tab, page title\n- Updated MI identity to 'mi (mycelial intelligence)' with guidance about connecting knowledge
<!-- SECTION:FINAL_SUMMARY:END -->