Skip to content

feat(assistant): AD4M AI-assistant UI (WE front end) - #95

Draft
HexaField wants to merge 3 commits into
devfrom
feat/ai-assistants
Draft

feat(assistant): AD4M AI-assistant UI (WE front end)#95
HexaField wants to merge 3 commits into
devfrom
feat/ai-assistants

Conversation

@HexaField

@HexaField HexaField commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

AD4M AI Assistants — front end (WE)

The WE half of the AD4M-embedded AI-assistant runtime. Adds an "AI Assistant" surface — a thread view with tool-call rendering, a per-neighbourhood thread list, a model selector, and a personality / skills / MCP config panel — authored via the schema/template system and rendered from AD4M perspective subject classes.

Additive and non-breaking: the existing template-editor AiStore/AiPanel is untouched. This surface makes no in-browser LLM call — it renders threads/messages from perspectives and lights up when the AD4M executor backend writes replies into the perspective. The backend (assistant-run subsystem + /v1 tool-calling) is a companion PR on coasys/ad4m (forthcoming).

What's here

  • Subject classes (packages/models/src/entities/): Assistant, Personality, Skill, McpServer, Thread, Messagewe:// predicates, registered in ROOT/SPACE models.
  • AssistantStore + components: thread list, thread view, message (collapsible tool-call blocks), config panel (Assistants / Personalities / Skills / MCP).
  • AiAssistant shell schema + sidebar nav + component/store registry wiring.
  • Streaming rides progressive Message.content updates under a live query — no separate token channel.

Backend contract (for the ad4m side)

  • Personal config (Assistant/Personality/Skill/McpServer) in we-root; conversations (Thread/Message) in the neighbourhood perspective.
  • Backend observes the perspective, resolves the thread's assistant + model, writes a role:'assistant' Message with status:'streaming', appends to content, flips to 'complete'. Tool calls as JSON on Message.toolCalls.
  • Model discovery via GET /v1/models.

Verification

  • Vite production build (app-web) PASS · @we/app-framework build + DTS PASS · app-framework tsc 0 errors · 62 unit tests pass.
  • Pre-existing (not this PR): @we/models DTS emit fails due to a @coasys/ad4m@0.13.0-test-9 typings barrel clash (verified on clean HEAD).
  • Draft: live/visual verification pending a running executor + the backend runtime.

🤖 Generated with Claude Code

Screenshots (headless-Electron renders of the real components)

Assistant surface — thread list, thread view (user bubble, get_weather tool-call block, markdown-rendered reply), composer, and the config panel:

assistant surface

Tool-call block expanded — Arguments + Result:

tool-call expanded

Config panel — Skills and MCP tabs:

config skills

config mcp

…ector)

Additive AI-assistant surface for the AD4M-embedded assistant runtime. Renders threads/messages from perspective subject classes and lights up when the executor backend (separate PR on coasys/ad4m) writes replies into the perspective; makes no in-browser LLM call. Existing template-editor AiStore is untouched.

- Subject classes: Assistant, Personality, Skill, McpServer, Thread, Message (we:// predicates)
- AssistantStore + thread list / thread view / message (collapsible tool-call rendering) / config panel (Assistants/Personalities/Skills/MCP)
- AiAssistant shell schema + sidebar nav + component/store registry wiring
- Streaming via progressive Message.content updates under a live query (no separate token channel needed)

Verified: Vite prod build of app-web PASS, @we/app-framework build+DTS PASS, app-framework tsc 0 errors, 62 unit tests pass. Live/visual verification pending a running executor + the backend runtime.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for coasys-we ready!

Name Link
🔨 Latest commit cbfcc91
🔍 Latest deploy log https://app.netlify.com/projects/coasys-we/deploys/6a68a06833605600088489c1
😎 Deploy Preview https://deploy-preview-95--coasys-we.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

HexaField added a commit to coasys/ad4m that referenced this pull request Jul 28, 2026
A Rust subsystem in rust-executor that runs AI-assistant turns server-side — persistent, concurrent, surviving client disconnect. Watches perspectives for new WE Message turns, runs the context->model->tools->persist loop reusing the /v1 tool-calling machinery in-process, streams by rewriting Message.content (auto-publishes to WE), and resumes interrupted runs from a durable RunState.

- assistant_runtime/{entities,store,sdna,context,tools,run,registry,mod}
- Subject classes match the WE contract (coasys/we#95): Assistant/Personality/Skill/McpServer in we-root, Thread/Message in the neighbourhood perspective, we:// predicates.
- Built-in perspective/neighbourhood tools in-process; MCP client behind a trait seam (explicit error until rmcp client is wired — no silent stub).
- Boots beside the MCP/REST subsystems, gated on config.enable_assistants (default on).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
HexaField and others added 2 commits July 28, 2026 22:25
Vitest + @solidjs/testing-library component tests (30) for the assistant surface: message roles + the collapsible tool-call block (Arguments/Result), thread view + model selector + composer, thread list, config panel tabs (Assistants/Personalities/Skills/MCP) + grant toggles, and AssistantStore helpers. Adds a scoped vitest 'dom' project (single solid-js instance, jsdom); exports AssistantContext + data-testids for testability; guards scrollIntoView for jsdom. Verified by rendering the real components in headless Electron (surface, expanded tool-call, config tabs all render valid + styled). Full app-framework suite: 92 tests pass; we-web Vite build green; tsc 0 errors in the assistant code.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Headless-Electron renders of the assistant surface: full three-pane view, expanded tool-call block, and config panel tabs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jhweir jhweir mentioned this pull request Aug 3, 2026
8 tasks
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.

1 participant