Skip to content

feat(ui): readable tool calls and pre-filled edit-on-approve in every chat - #1301

Merged
ginccc merged 8 commits into
mainfrom
feat/chats-670-tool-display-and-hitl
Nov 15, 2026
Merged

ginccc merged 8 commits into
mainfrom
feat/chats-670-tool-display-and-hitl

Conversation

@ginccc

@ginccc ginccc commented Nov 6, 2026

Copy link
Copy Markdown
Member

The problem

6.7.0 sends more with a tool call than its name, but the chats ignored it:

  • the SSE tool_call event now carries displayName and display (from the LLM task's toolDisplay);
  • there is a new tool_result event;
  • tool-call pauses accept amendedArguments (edit-on-approve).

So every chat and approval card still showed raw method names (getAgentDescriptors, apicalls_xyz_call) and arguments as a JSON blob. The edit box on a tool approval started empty, and the tool spinner never stopped on tool_result.

What changed

Surface Before After
Manager chat page and drawer (chat-activity, use-chat) raw names; displayName and tool_result ignored; JSON blob; hard-coded "Args"/"Result" name in words, or the toolDisplay phrase as written; tool_result stops the spinner; arguments as label/value rows with a JSON toggle; translated
Approval card (conversation page, Approvals inbox, operator) raw name; JSON/Raw; empty amend box name in words with the exact identifier beside it; Fields (default) / JSON / Raw, with a nested requestBody expanded; amend box pre-filled with the arguments as sent; whitespace-only edits count as a plain approval; a leftover <REDACTED> is refused before submit
Confirmation dialog, decision receipt, pause notice, Approvals list and search raw names names in words; search matches both forms
Platform Operator chat raw names same as the chat page (shared components)
Group / Workforce transcripts "using web_search…" name in words
Chat UI (sse-events, Indicators, PausedCard, ChatWidget) "Using calculator…", raw names, no tool_result names in words; the toolDisplay phrase; tool_result returns to "Thinking…"; paused card lists names in words, de-duplicated

Names are put into words by one helper per app: ui/manager/src/lib/tool-labels.ts and ui/chat/src/tool-labels.ts. They split camelCase/snake_case and use sentence case. The backend's own displayName takes precedence.

Operator (separate commit): a prompt section teaching toolDisplay, ApiCall.argumentSchema/unknownFields and answerMode: "tool". The operator revision moves from 60 to 61. The allow-list, gate-guard.ts and self-guard.ts are unchanged.

What this breaks

Nothing on the wire. The UI now reads fields the backend already emits (RestAgentEngineStreaming.ToolCallEvent, tool_result, buildToolCallPauseDetails) and sends toolDecisions[].amendedArguments as before. Existing deployments get the usual operator upgrade notice because of the revision bump.

Where to look hardest

  • Edit-on-approve pre-fill (hitl-format-args.ts: argumentsForEditing, sameJsonText): an untouched pre-filled copy must stay a plain approval and never become an amendment. A redacted value must never be sent back as <REDACTED>.
  • Operator prompt text: it describes features only and grants no endpoint.

Not in this PR (backend gaps)

  • Group task / synthesis edit-on-approve in the Manager: the group approval-status exposes neither review.allowResultEdits nor the drafts to edit. It needs an editable block like pauseDetails.editableAnswer.
  • member_tool_call carries only agentId and tool, so group transcripts cannot show toolDisplay labels.
  • Reason codes on operator approval cards are dropped by the operator chat's onDecide wrapper. It is a small follow-up, but it touches the security-reviewed decision path, so it is left alone here.

Verification

  • Manager: typecheck, lint and i18n:check all exit 0. Vitest ran over lib, hitl, chat, operator, groups, the approvals and operator pages, hooks, i18n and src/lib/operator (including operator-revision.test.ts): 255 files, 3824 passed. The src/test plus hitl re-run passed 181.
  • Chat UI: typecheck, lint and test all exit 0, with 629 passed.
  • Mutation checks, all six caught:
Mutant Tests failed
Manager humanising disabled 14
Untouched pre-fill counted as an amendment 1
<REDACTED> refusal disabled 1
Pre-fill removed 1
Chat UI humanising disabled 10
Chat UI tool_result no longer clears the tool line 1
  • Changelog: python scripts/collate-changelog.py --check passes. ChangelogFragmentTest was not run locally because the machine ran out of disk space for a Maven build. CI's Build & Test covers it.
  • No visual check: MSW could not register in the preview browser. The MSW fixture conv-toolcall-1 is shaped like buildToolCallPauseDetails, for a look at /manage/conversationview/conv-toolcall-1?awaiting=1.

…erMode tool

The 6.7 prompt had no word on toolDisplay (readable tool calls in chats), ApiCall.argumentSchema/unknownFields (calls refused before the approval gate) or answerMode: tool. Prompt only; the allow-list and the guards are unchanged. Revision 60 -> 61.
… chat

Manager and Chat UI name tools in words (shared tool-labels helper per app), use the 6.7 tool_call displayName/display (toolDisplay) and tool_result events, and show gated-call arguments as label/value rows with JSON and Raw views. Amending a gated call starts from its arguments; an untouched copy is a plain approval and a leftover <REDACTED> marker is refused before submit.
@ginccc
ginccc requested a review from rolandpickl as a code owner November 6, 2026 00:52
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
eddi-docs Ignored Ignored Preview Nov 15, 2026 3:34pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b9bf714 and e36e1df.

Files selected for processing: 53

  • docs/changelog.d/2026-11-06-chats-670-tool-display-and-hitl.md
  • ui/chat/AGENTS.md
  • ui/chat/src/api/hitl-api.test.ts
  • ui/chat/src/api/hitl-api.ts
  • ui/chat/src/api/sse-events.test.ts
  • ui/chat/src/api/sse-events.ts
  • ui/chat/src/components/ChatWidget.test.tsx
  • ui/chat/src/components/ChatWidget.tsx
  • ui/chat/src/components/Indicators.tsx
  • ui/chat/src/components/PausedCard.test.tsx
  • ui/chat/src/components/responsiveness-review.test.tsx
  • ui/chat/src/store/chat-store.test.tsx
  • ui/chat/src/store/chat-store.tsx
  • ui/chat/src/tool-labels.ts
  • ui/chat/src/types.ts
  • ui/manager/src/components/chat/__tests__/chat-activity.test.tsx
  • ui/manager/src/components/chat/chat-activity.tsx
  • ui/manager/src/components/groups/agent-response-card.tsx
  • ui/manager/src/components/hitl/__tests__/approval-banner.test.tsx
  • ui/manager/src/components/hitl/__tests__/pause-notice.test.tsx
  • ui/manager/src/components/hitl/approval-banner.tsx
  • ui/manager/src/components/hitl/decision-summary.tsx
  • ui/manager/src/components/hitl/pause-notice.tsx
  • ui/manager/src/components/operator/__tests__/operator-chat.test.tsx
  • ui/manager/src/components/operator/operator-chat.tsx
  • ui/manager/src/components/shared/tool-argument-fields.tsx
  • ui/manager/src/hooks/__tests__/use-chat-sse-handling.test.tsx
  • ui/manager/src/hooks/use-chat.ts
  • ui/manager/src/hooks/use-debug-events.ts
  • ui/manager/src/hooks/use-operator-chat.ts
  • ui/manager/src/i18n/locales/ar.json
  • ui/manager/src/i18n/locales/de.json
  • ui/manager/src/i18n/locales/en.json
  • ui/manager/src/i18n/locales/es.json
  • ui/manager/src/i18n/locales/fr.json
  • ui/manager/src/i18n/locales/hi.json
  • ui/manager/src/i18n/locales/ja.json
  • ui/manager/src/i18n/locales/ko.json
  • ui/manager/src/i18n/locales/pt.json
  • ui/manager/src/i18n/locales/th.json
  • ui/manager/src/i18n/locales/zh.json
  • ui/manager/src/lib/__tests__/tool-labels.test.ts
  • ui/manager/src/lib/api/chat.ts
  • ui/manager/src/lib/hitl-decision.ts
  • ui/manager/src/lib/hitl-format-args.ts
  • ui/manager/src/lib/operator/operator-revision.json
  • ui/manager/src/lib/operator/system-prompt.ts
  • ui/manager/src/lib/tool-labels.ts
  • ui/manager/src/pages/__tests__/approvals.test.tsx
  • ui/manager/src/pages/__tests__/conversation-detail-pause-race.test.tsx
  • ui/manager/src/pages/__tests__/operator.test.tsx
  • ui/manager/src/pages/approvals.tsx
  • ui/manager/src/test/mocks/hitl-review-handlers.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

The receipt now reads the call's name in words; keep the identifier as
its tooltip, as the approval card does, and update the pause-race test
that still expected the raw name.
…essing it from the string's shape

A one-word toolDisplay label such as Searching matched the identifier pattern and was shown as 'Using Searching…'. The tool_call parser knows whether it holds a designer phrase or an identifier, so it now records { text, phrase } and the status lines read the flag. isToolIdentifier is removed from both apps.
…isplay-and-hitl

Conflicts:
use-operator-chat.ts: kept both imports (tool-labels from this branch, abortableSleep from main).
operator-revision.json: both sides changed the prompt since the merge base, so revision 62 with the merged fingerprint.
…isplay-and-hitl

# Conflicts:
#	ui/manager/src/lib/operator/operator-revision.json
…isplay-and-hitl

# Conflicts:
#	ui/chat/AGENTS.md
@ginccc

ginccc commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ginccc

ginccc commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ginccc
ginccc merged commit 1d5e74d into main Nov 15, 2026
44 checks passed
ginccc added a commit that referenced this pull request Nov 15, 2026
The 2026-11-06 fragment (from main, #1301) linked the Chat UI's
tool-labels.ts, which this branch moved into ui/packages/core.
DocumentationLinksTest failed on it.
ginccc added a commit that referenced this pull request Nov 16, 2026
#1276)

* perf(manager): load script fonts with their locale

main.tsx imported all eight Noto families, whose @font-face rules were
about 128 KB gz of the main stylesheet for every user. Only Noto Sans stays
eager; Arabic, Thai, Devanagari, JP, KR, SC and TC load as CSS chunks when
their locale is active (zh-TW/HK/MO and Hant get TC). Other-script text in a
Latin UI falls back to the system font. First load 743.8 -> 616.4 KB gz.

* perf(chat-ui): drop react-router, parse the three URL shapes directly

react-router was 92 KB of the widget's first load for three path patterns and
one query-string rewrite. src/location.ts parses /chat/managed/:intent/:userId,
/chat/:environment/:agentId/:userId and /chat/:environment/:agentId with the
router's matching rules; unknown paths still go to /chat/production/default
and ?token= is still stripped in place. ChatLocationProvider replaces
BrowserRouter, and its initialPath mode replaces MemoryRouter in tests.
location.test.tsx pins every URL shape for embedders.

* perf(chat-ui): load the raw-HTML parser only for replies with HTML

rehype-raw pulls in parse5, about as large as the widget's own code, but only
does anything when a reply contains HTML. It is now a lazy chunk like KaTeX
and highlight.js, loaded when a message contains '<' followed by a letter, /,
! or ?. Output is unchanged once it is in (raw-html-lazy.test.tsx); HTML is
still rendered and sanitised for every agent until the per-agent rawHtml
setting exists (plan D9). AGENTS.md describes the router-free routing.

* perf(ui): check first-load bundle budgets in CI

ui/scripts/check-bundle-budget.mjs sums the gzip -9 sizes of the scripts and
stylesheets each HTML shell loads before any lazy chunk and compares them
with ui/bundle-budget.json. UI Manager Checks and UI Chat now build and run
it (npm run budget). Before phase 0 on main: 743.8 KB (manage, workforce,
welcome) and 224.8 KB (chat); now 616.4 and 160.6, budgets 630 and 170.

* docs: recommend Open WebUI over /v1 for generic chat, and say what it lacks

Per decision D10 of the frontend unification plan: a deployment that only
wants generic chat can use Open WebUI. The guide and the README now list what
it then goes without: approvals in the chat, quick replies and inputField,
secret input, ratings, review notices, group discussions, memory
transparency and branding.

* test(ui): record the conversation feature matrix per surface

One cell per capability (KaTeX, highlight.js, output images, quick replies,
inputField, secret input, history, inline HITL, i18n) and surface, tagged
@surface:/@capability:. The Manager's ChatPanel, Operator and Workforce
thread are a Playwright spec over MSW; unsupported cells are test.fixme with
the reason, and cells MSW cannot reach are skipped naming their unit tests.
The widget's column is a Vitest spec, since ui/chat has no Playwright tier.

* docs(changelog): frontend unification phase 0

Records the before/after first-load numbers, the budgets, the font fallback
for other scripts in a Latin UI, and what was not verified locally. Also
marks the feature-matrix skip/fixme cells as deliberate for the E2E lint
rule.

* chore(ui): npm workspaces root with one lockfile for both UIs

ui/package.json declares manager, chat and packages/* as workspaces and
ui/package-lock.json replaces the two per-app lockfiles. The lock was seeded
from the old ones so CI-accepted versions are kept, then resolved on Linux so
the wasm32-wasi children Windows prunes are present. lucide-react is aligned
to ^1.59 in the Chat UI and the shared toolchain versions in the Manager;
overrides move to the root, where npm reads them.

Maven runs one npm ci at ui/; the per-app builds and the jar layout are
unchanged. ui/scripts/check-lockfile-platforms.mjs checks the lock still
carries every platform's packages.

* ci(ui): install at the workspace root, check the lock, one Dependabot entry

Every UI job and Build Image install at ui/ and key the npm cache on
ui/package-lock.json. UI Manager Checks runs npm run lockfile:check after
npm ci. The CycloneDX step keeps bom-ui-manager.json and bom-ui-chat.json,
read from ui/package.json with --workspace. Dependabot's /ui/manager and
/ui/chat entries become /ui (BuildQualityGatesTest now expects one npm entry
grouping vitest), CodeQL's UI config adds ui/packages, and the auto-approve
policy protects the workspace root's manifests and configs.

* refactor(ui): shared tsconfig and ESLint bases for both apps

ui/tsconfig.base.json holds the eight compiler options every app tsconfig
set identically; tsc --showConfig is unchanged for all six projects.
ui/eslint.config.base.js holds the recommended presets, browser globals, the
two hook rules and the toBeGreaterThanOrEqual(0) guard; eslint --print-config
is unchanged apart from the Chat UI now using the Manager's longer message.

* docs(ui): npm ci runs at the ui/ workspace root

The root, Manager and Chat UI AGENTS.md, both READMEs, CONTRIBUTING.md,
agent-manager-gui.md and developer-quickstart.md say to install once at ui/
and run app scripts from each app. The Manager's Windows lockfile note now
points at ui/package-lock.json and npm run lockfile:check. Changelog
fragment for phase 1a.

* feat(ui): add @eddi/core, the framework-free conversation contract package

HTTP (HttpClient with injected auth, transport and error factory; ApiError; the {error, code} envelope; one 401 retry), the one SSE frame parser and stream reader for agent and group streams, the agent conversation API, HITL status/cancel/resume, attachments, ratings, rating steps, snapshot-to-messages and the contract types. Derived from the Chat UI's api/ modules and the Manager's lib/api/chat.ts, sse-utils.ts and the group SSE reader; consumed as source through the workspace link (exports -> src/index.ts).

Tests: the Chat UI's protocol suites and the Manager's parse-sse-frame suite are ported, plus turn-protocol.test.ts (the union of the five turn loops' protocol cases) and boundaries.test.ts (no app/React import, no import cycle across ui/packages/*). Lint: sharedPackage() in the ESLint base.

* ci(ui): run @eddi/core's checks and cover ui/packages in i18n:check and auto-approve

The UI Chat job runs the package's type check, lint (package boundaries) and tests before the app's. check-i18n.mjs also walks ui/packages/*/src, which the Manager compiles as source. auto-approve-copilot protects a package's vitest, ESLint and tsconfig files the way it protects an app's (the existing ui/*/ globs stop one segment short).

* refactor(chat-ui): move the widget onto @eddi/core

ChatWidget, ChatInput, PausedCard, the HITL polling and rating hooks and the store now take HTTP, the SSE reader, the conversation API, HITL status, attachments, ratings, rating steps and snapshot-to-messages from @eddi/core. Deleted: api/http.ts, api/chat-api.ts, api/sse-events.ts, api/snapshot.ts, api/attachments-api.ts and rating-steps.ts, with their tests (ported to the package). What stays is the widget's own: embed-auth, the brand, the demo, pauseHeadline (api/hitl-api.ts), the rating channel and error copy (api/rating-api.ts) and skippedTurnMessage (turn-notices.ts). Consumer tests changed only in import paths; vite-proxy.test.ts also scans the package for the prefixes it calls. AGENTS.md: the backend contract list moved to ui/packages/core/README.md.

* refactor(manager): move ChatPanel's conversation API and the group reader onto @eddi/core

lib/api/chat.ts is now the Manager's binding of the package's conversation API: same signatures and message types (the Operator and the Workforce member thread import it unchanged), an HttpClient built on the new ApiClient.authorizedFetch (pre-flight refresh, one 401 retry, network failures as ApiClientError status 0, aborts left alone) and apiErrorFromResponse, and the seg() refusal of traversal ids kept. startConversation stays an api.post (ApiClient also reads a body location, which the MSW fixtures use). groups.ts reads group streams with readSseStream. use-chat.ts takes UNCONSUMED_STREAM_ERROR_CODES and parseErrorEvent from the package; ChatPanel and use-chat-ratings take the rating steps. Deleted: lib/api/sse-utils.ts (test ported) and lib/chat-rating-steps.ts. Consumer tests changed in import paths only. AGENTS.md says where the protocol lives.

* docs(changelog): @eddi/core and the 1:1 turn loops on it

Fragment for phase 1b. Eight links in the September and October archives named files this branch deletes; they now point at the package module the code moved to.

* fix(ui): type bare-string output entries in ConversationOutput

HITL writes its pending-approval placeholder and rejection message into
output[] as bare strings; OutputItem[] could not express them. The
extractors already take unknown, so no consumer changes.

* docs(changelog): point the tool-labels link at its home in @eddi/core

The 2026-11-06 fragment (from main, #1301) linked the Chat UI's
tool-labels.ts, which this branch moved into ui/packages/core.
DocumentationLinksTest failed on it.

* fix(core): a WAIT_INDEFINITELY pause reports no approval deadline
ginccc added a commit that referenced this pull request Nov 16, 2026
* perf(manager): load script fonts with their locale

main.tsx imported all eight Noto families, whose @font-face rules were
about 128 KB gz of the main stylesheet for every user. Only Noto Sans stays
eager; Arabic, Thai, Devanagari, JP, KR, SC and TC load as CSS chunks when
their locale is active (zh-TW/HK/MO and Hant get TC). Other-script text in a
Latin UI falls back to the system font. First load 743.8 -> 616.4 KB gz.

* perf(chat-ui): drop react-router, parse the three URL shapes directly

react-router was 92 KB of the widget's first load for three path patterns and
one query-string rewrite. src/location.ts parses /chat/managed/:intent/:userId,
/chat/:environment/:agentId/:userId and /chat/:environment/:agentId with the
router's matching rules; unknown paths still go to /chat/production/default
and ?token= is still stripped in place. ChatLocationProvider replaces
BrowserRouter, and its initialPath mode replaces MemoryRouter in tests.
location.test.tsx pins every URL shape for embedders.

* perf(chat-ui): load the raw-HTML parser only for replies with HTML

rehype-raw pulls in parse5, about as large as the widget's own code, but only
does anything when a reply contains HTML. It is now a lazy chunk like KaTeX
and highlight.js, loaded when a message contains '<' followed by a letter, /,
! or ?. Output is unchanged once it is in (raw-html-lazy.test.tsx); HTML is
still rendered and sanitised for every agent until the per-agent rawHtml
setting exists (plan D9). AGENTS.md describes the router-free routing.

* perf(ui): check first-load bundle budgets in CI

ui/scripts/check-bundle-budget.mjs sums the gzip -9 sizes of the scripts and
stylesheets each HTML shell loads before any lazy chunk and compares them
with ui/bundle-budget.json. UI Manager Checks and UI Chat now build and run
it (npm run budget). Before phase 0 on main: 743.8 KB (manage, workforce,
welcome) and 224.8 KB (chat); now 616.4 and 160.6, budgets 630 and 170.

* docs: recommend Open WebUI over /v1 for generic chat, and say what it lacks

Per decision D10 of the frontend unification plan: a deployment that only
wants generic chat can use Open WebUI. The guide and the README now list what
it then goes without: approvals in the chat, quick replies and inputField,
secret input, ratings, review notices, group discussions, memory
transparency and branding.

* test(ui): record the conversation feature matrix per surface

One cell per capability (KaTeX, highlight.js, output images, quick replies,
inputField, secret input, history, inline HITL, i18n) and surface, tagged
@surface:/@capability:. The Manager's ChatPanel, Operator and Workforce
thread are a Playwright spec over MSW; unsupported cells are test.fixme with
the reason, and cells MSW cannot reach are skipped naming their unit tests.
The widget's column is a Vitest spec, since ui/chat has no Playwright tier.

* docs(changelog): frontend unification phase 0

Records the before/after first-load numbers, the budgets, the font fallback
for other scripts in a Latin UI, and what was not verified locally. Also
marks the feature-matrix skip/fixme cells as deliberate for the E2E lint
rule.

* chore(ui): npm workspaces root with one lockfile for both UIs

ui/package.json declares manager, chat and packages/* as workspaces and
ui/package-lock.json replaces the two per-app lockfiles. The lock was seeded
from the old ones so CI-accepted versions are kept, then resolved on Linux so
the wasm32-wasi children Windows prunes are present. lucide-react is aligned
to ^1.59 in the Chat UI and the shared toolchain versions in the Manager;
overrides move to the root, where npm reads them.

Maven runs one npm ci at ui/; the per-app builds and the jar layout are
unchanged. ui/scripts/check-lockfile-platforms.mjs checks the lock still
carries every platform's packages.

* ci(ui): install at the workspace root, check the lock, one Dependabot entry

Every UI job and Build Image install at ui/ and key the npm cache on
ui/package-lock.json. UI Manager Checks runs npm run lockfile:check after
npm ci. The CycloneDX step keeps bom-ui-manager.json and bom-ui-chat.json,
read from ui/package.json with --workspace. Dependabot's /ui/manager and
/ui/chat entries become /ui (BuildQualityGatesTest now expects one npm entry
grouping vitest), CodeQL's UI config adds ui/packages, and the auto-approve
policy protects the workspace root's manifests and configs.

* refactor(ui): shared tsconfig and ESLint bases for both apps

ui/tsconfig.base.json holds the eight compiler options every app tsconfig
set identically; tsc --showConfig is unchanged for all six projects.
ui/eslint.config.base.js holds the recommended presets, browser globals, the
two hook rules and the toBeGreaterThanOrEqual(0) guard; eslint --print-config
is unchanged apart from the Chat UI now using the Manager's longer message.

* docs(ui): npm ci runs at the ui/ workspace root

The root, Manager and Chat UI AGENTS.md, both READMEs, CONTRIBUTING.md,
agent-manager-gui.md and developer-quickstart.md say to install once at ui/
and run app scripts from each app. The Manager's Windows lockfile note now
points at ui/package-lock.json and npm run lockfile:check. Changelog
fragment for phase 1a.

* feat(ui): add @eddi/core, the framework-free conversation contract package

HTTP (HttpClient with injected auth, transport and error factory; ApiError; the {error, code} envelope; one 401 retry), the one SSE frame parser and stream reader for agent and group streams, the agent conversation API, HITL status/cancel/resume, attachments, ratings, rating steps, snapshot-to-messages and the contract types. Derived from the Chat UI's api/ modules and the Manager's lib/api/chat.ts, sse-utils.ts and the group SSE reader; consumed as source through the workspace link (exports -> src/index.ts).

Tests: the Chat UI's protocol suites and the Manager's parse-sse-frame suite are ported, plus turn-protocol.test.ts (the union of the five turn loops' protocol cases) and boundaries.test.ts (no app/React import, no import cycle across ui/packages/*). Lint: sharedPackage() in the ESLint base.

* ci(ui): run @eddi/core's checks and cover ui/packages in i18n:check and auto-approve

The UI Chat job runs the package's type check, lint (package boundaries) and tests before the app's. check-i18n.mjs also walks ui/packages/*/src, which the Manager compiles as source. auto-approve-copilot protects a package's vitest, ESLint and tsconfig files the way it protects an app's (the existing ui/*/ globs stop one segment short).

* refactor(chat-ui): move the widget onto @eddi/core

ChatWidget, ChatInput, PausedCard, the HITL polling and rating hooks and the store now take HTTP, the SSE reader, the conversation API, HITL status, attachments, ratings, rating steps and snapshot-to-messages from @eddi/core. Deleted: api/http.ts, api/chat-api.ts, api/sse-events.ts, api/snapshot.ts, api/attachments-api.ts and rating-steps.ts, with their tests (ported to the package). What stays is the widget's own: embed-auth, the brand, the demo, pauseHeadline (api/hitl-api.ts), the rating channel and error copy (api/rating-api.ts) and skippedTurnMessage (turn-notices.ts). Consumer tests changed only in import paths; vite-proxy.test.ts also scans the package for the prefixes it calls. AGENTS.md: the backend contract list moved to ui/packages/core/README.md.

* refactor(manager): move ChatPanel's conversation API and the group reader onto @eddi/core

lib/api/chat.ts is now the Manager's binding of the package's conversation API: same signatures and message types (the Operator and the Workforce member thread import it unchanged), an HttpClient built on the new ApiClient.authorizedFetch (pre-flight refresh, one 401 retry, network failures as ApiClientError status 0, aborts left alone) and apiErrorFromResponse, and the seg() refusal of traversal ids kept. startConversation stays an api.post (ApiClient also reads a body location, which the MSW fixtures use). groups.ts reads group streams with readSseStream. use-chat.ts takes UNCONSUMED_STREAM_ERROR_CODES and parseErrorEvent from the package; ChatPanel and use-chat-ratings take the rating steps. Deleted: lib/api/sse-utils.ts (test ported) and lib/chat-rating-steps.ts. Consumer tests changed in import paths only. AGENTS.md says where the protocol lives.

* docs(changelog): @eddi/core and the 1:1 turn loops on it

Fragment for phase 1b. Eight links in the September and October archives named files this branch deletes; they now point at the package module the code moved to.

* feat(ui): add @eddi/ui and move the Manager onto its tokens, theme and i18n

Phase 3a of the frontend unification plan. ui/packages/ui is the second
shared package, consumed as source like @eddi/core:

- theme.css: the Manager's Tailwind v4 @theme (semantic colours, the
  brand/warn/ochre scales, radius, font, light and .dark), moved
  verbatim out of index.css, which now imports it. Plain @theme, so
  /branding/brand.css still reaches the utilities.
- CHAT_TOKEN_ALIASES / SEMANTIC_TOKENS: the --chat-* names the widget
  will declare as aliases of the shared tokens.
- ThemeProvider/useTheme (moved from the Manager) and the helpers under
  them, marking <html> with a class or data-theme.
- setupI18n: English bundled, one lazily loaded locale at a time,
  region tags matched, productName default variables, dir/lang from the
  resolved language. The Manager's i18n/config.ts is now its loaders
  plus one call.
- @eddi/ui/fonts: phase 0's per-locale script fonts, a separate entry
  so an app that does not load them never bundles their chunks.
- Button, buttonVariants, cn and the direction-aware ThemedToaster; the
  Manager imports them from the package (AppToaster passes rtl).

sharedPackage({ react, noApi }) keeps the package free of app imports,
@eddi/core, fetch and window.__EDDI_*__; the boundaries test checks the
same. CI's UI Chat job runs its typecheck, lint and tests; the policy
test covers its config files. The script-font dependencies moved from
the Manager to the package; the lock was regenerated on Linux.

* feat(chat-ui): move the widget onto @eddi/ui — i18next in 11 locales, token aliases

- i18n: the widget's own t() and four string tables become i18next
  bundles in src/i18n/locales, set up through @eddi/ui's setupI18n
  without react-i18next: English bundled, each other locale a 2.8-3.4
  KB gz chunk, only the active one loaded. main.tsx awaits initLocale
  before the first render, so t() still works outside React. The seven
  new locales (ar, zh, th, ja, ko, pt, hi) follow the Manager's
  terminology; ?lang=ar lays the widget out right to left. Placeholders
  are {{name}}; a missing value stays visible and a value is never
  interpolated twice. i18n.test.ts checks parity, placeholders, real
  translation and every key the code passes to t().
- Tokens: variables.css gives the shared tokens the widget's own values
  per theme and declares fifteen --chat-* names as documented aliases of
  them (CHAT_TOKEN_ALIASES). The URL colour parameters and brand.css's
  --chat-accent still win. chat-aliases.test.ts pins the table, every
  name's colour as it was before in both themes, and the names the
  colour parameters write.
- Theme: useTheme keeps its ?theme= precedence on @eddi/ui's helpers.

First load 169.1 KB gz of the 170 budget (from 162.2). Docs: Chat UI
README and AGENTS.md, chat-ui-embedding.md; one archived changelog link
repointed at the moved i18n module. Changelog fragment for phase 3a.

* fix(ui): type bare-string output entries in ConversationOutput

HITL writes its pending-approval placeholder and rejection message into
output[] as bare strings; OutputItem[] could not express them. The
extractors already take unknown, so no consumer changes.

* fix(chat-ui): keep the input focus ring on the chat accent under a brand

--chat-input-focus aliased --color-ring, but /branding/brand.css
(BrandDelivery.stylesheet) writes the Manager's --color-ring, its
primary, on :root, and the widget loads that stylesheet: a branded
widget's focus ring followed the Manager primary instead of the chat
accent. Alias it to --chat-accent, as --chat-user-bg is (?accentColor=
already set all three). chat-aliases.test.ts applies the brand
stylesheet's output and checks the accent, user bubble and focus ring
take the chat accent in both themes and nothing else moves.

* fix(chat-ui): use logical sides in chat.css so dir=rtl mirrors the widget

The accent stripes (border-left) become border-inline-start, the
absolutely placed eye toggles and copy/close buttons (right) become
inset-inline-end, and the paddings that reserve their room become
padding-inline. LTR renders as before; the toast's 50%/translateX
centring stays physical.

* chore(chat-ui): declare i18next, which src/i18n/index.ts imports

It resolved only because @eddi/ui's copy is hoisted. Same range as the
Manager and @eddi/ui (^26.4.7); the lock's chat entry lists it.

* docs(changelog): the review fixes and the main merge on @eddi/ui

* docs(changelog): point the tool-labels link at its home in @eddi/core

The 2026-11-06 fragment (from main, #1301) linked the Chat UI's
tool-labels.ts, which this branch moved into ui/packages/core.
DocumentationLinksTest failed on it.

* fix(ui): a large attachment reaches the assistant as a reference; toaster tests start clean

* fix(manager): import Button from @eddi/ui in the signing-key section merged from main
ginccc added a commit that referenced this pull request Nov 16, 2026
* perf(manager): load script fonts with their locale

main.tsx imported all eight Noto families, whose @font-face rules were
about 128 KB gz of the main stylesheet for every user. Only Noto Sans stays
eager; Arabic, Thai, Devanagari, JP, KR, SC and TC load as CSS chunks when
their locale is active (zh-TW/HK/MO and Hant get TC). Other-script text in a
Latin UI falls back to the system font. First load 743.8 -> 616.4 KB gz.

* perf(chat-ui): drop react-router, parse the three URL shapes directly

react-router was 92 KB of the widget's first load for three path patterns and
one query-string rewrite. src/location.ts parses /chat/managed/:intent/:userId,
/chat/:environment/:agentId/:userId and /chat/:environment/:agentId with the
router's matching rules; unknown paths still go to /chat/production/default
and ?token= is still stripped in place. ChatLocationProvider replaces
BrowserRouter, and its initialPath mode replaces MemoryRouter in tests.
location.test.tsx pins every URL shape for embedders.

* perf(chat-ui): load the raw-HTML parser only for replies with HTML

rehype-raw pulls in parse5, about as large as the widget's own code, but only
does anything when a reply contains HTML. It is now a lazy chunk like KaTeX
and highlight.js, loaded when a message contains '<' followed by a letter, /,
! or ?. Output is unchanged once it is in (raw-html-lazy.test.tsx); HTML is
still rendered and sanitised for every agent until the per-agent rawHtml
setting exists (plan D9). AGENTS.md describes the router-free routing.

* perf(ui): check first-load bundle budgets in CI

ui/scripts/check-bundle-budget.mjs sums the gzip -9 sizes of the scripts and
stylesheets each HTML shell loads before any lazy chunk and compares them
with ui/bundle-budget.json. UI Manager Checks and UI Chat now build and run
it (npm run budget). Before phase 0 on main: 743.8 KB (manage, workforce,
welcome) and 224.8 KB (chat); now 616.4 and 160.6, budgets 630 and 170.

* docs: recommend Open WebUI over /v1 for generic chat, and say what it lacks

Per decision D10 of the frontend unification plan: a deployment that only
wants generic chat can use Open WebUI. The guide and the README now list what
it then goes without: approvals in the chat, quick replies and inputField,
secret input, ratings, review notices, group discussions, memory
transparency and branding.

* test(ui): record the conversation feature matrix per surface

One cell per capability (KaTeX, highlight.js, output images, quick replies,
inputField, secret input, history, inline HITL, i18n) and surface, tagged
@surface:/@capability:. The Manager's ChatPanel, Operator and Workforce
thread are a Playwright spec over MSW; unsupported cells are test.fixme with
the reason, and cells MSW cannot reach are skipped naming their unit tests.
The widget's column is a Vitest spec, since ui/chat has no Playwright tier.

* docs(changelog): frontend unification phase 0

Records the before/after first-load numbers, the budgets, the font fallback
for other scripts in a Latin UI, and what was not verified locally. Also
marks the feature-matrix skip/fixme cells as deliberate for the E2E lint
rule.

* chore(ui): npm workspaces root with one lockfile for both UIs

ui/package.json declares manager, chat and packages/* as workspaces and
ui/package-lock.json replaces the two per-app lockfiles. The lock was seeded
from the old ones so CI-accepted versions are kept, then resolved on Linux so
the wasm32-wasi children Windows prunes are present. lucide-react is aligned
to ^1.59 in the Chat UI and the shared toolchain versions in the Manager;
overrides move to the root, where npm reads them.

Maven runs one npm ci at ui/; the per-app builds and the jar layout are
unchanged. ui/scripts/check-lockfile-platforms.mjs checks the lock still
carries every platform's packages.

* ci(ui): install at the workspace root, check the lock, one Dependabot entry

Every UI job and Build Image install at ui/ and key the npm cache on
ui/package-lock.json. UI Manager Checks runs npm run lockfile:check after
npm ci. The CycloneDX step keeps bom-ui-manager.json and bom-ui-chat.json,
read from ui/package.json with --workspace. Dependabot's /ui/manager and
/ui/chat entries become /ui (BuildQualityGatesTest now expects one npm entry
grouping vitest), CodeQL's UI config adds ui/packages, and the auto-approve
policy protects the workspace root's manifests and configs.

* refactor(ui): shared tsconfig and ESLint bases for both apps

ui/tsconfig.base.json holds the eight compiler options every app tsconfig
set identically; tsc --showConfig is unchanged for all six projects.
ui/eslint.config.base.js holds the recommended presets, browser globals, the
two hook rules and the toBeGreaterThanOrEqual(0) guard; eslint --print-config
is unchanged apart from the Chat UI now using the Manager's longer message.

* docs(ui): npm ci runs at the ui/ workspace root

The root, Manager and Chat UI AGENTS.md, both READMEs, CONTRIBUTING.md,
agent-manager-gui.md and developer-quickstart.md say to install once at ui/
and run app scripts from each app. The Manager's Windows lockfile note now
points at ui/package-lock.json and npm run lockfile:check. Changelog
fragment for phase 1a.

* feat(ui): add @eddi/core, the framework-free conversation contract package

HTTP (HttpClient with injected auth, transport and error factory; ApiError; the {error, code} envelope; one 401 retry), the one SSE frame parser and stream reader for agent and group streams, the agent conversation API, HITL status/cancel/resume, attachments, ratings, rating steps, snapshot-to-messages and the contract types. Derived from the Chat UI's api/ modules and the Manager's lib/api/chat.ts, sse-utils.ts and the group SSE reader; consumed as source through the workspace link (exports -> src/index.ts).

Tests: the Chat UI's protocol suites and the Manager's parse-sse-frame suite are ported, plus turn-protocol.test.ts (the union of the five turn loops' protocol cases) and boundaries.test.ts (no app/React import, no import cycle across ui/packages/*). Lint: sharedPackage() in the ESLint base.

* ci(ui): run @eddi/core's checks and cover ui/packages in i18n:check and auto-approve

The UI Chat job runs the package's type check, lint (package boundaries) and tests before the app's. check-i18n.mjs also walks ui/packages/*/src, which the Manager compiles as source. auto-approve-copilot protects a package's vitest, ESLint and tsconfig files the way it protects an app's (the existing ui/*/ globs stop one segment short).

* refactor(chat-ui): move the widget onto @eddi/core

ChatWidget, ChatInput, PausedCard, the HITL polling and rating hooks and the store now take HTTP, the SSE reader, the conversation API, HITL status, attachments, ratings, rating steps and snapshot-to-messages from @eddi/core. Deleted: api/http.ts, api/chat-api.ts, api/sse-events.ts, api/snapshot.ts, api/attachments-api.ts and rating-steps.ts, with their tests (ported to the package). What stays is the widget's own: embed-auth, the brand, the demo, pauseHeadline (api/hitl-api.ts), the rating channel and error copy (api/rating-api.ts) and skippedTurnMessage (turn-notices.ts). Consumer tests changed only in import paths; vite-proxy.test.ts also scans the package for the prefixes it calls. AGENTS.md: the backend contract list moved to ui/packages/core/README.md.

* refactor(manager): move ChatPanel's conversation API and the group reader onto @eddi/core

lib/api/chat.ts is now the Manager's binding of the package's conversation API: same signatures and message types (the Operator and the Workforce member thread import it unchanged), an HttpClient built on the new ApiClient.authorizedFetch (pre-flight refresh, one 401 retry, network failures as ApiClientError status 0, aborts left alone) and apiErrorFromResponse, and the seg() refusal of traversal ids kept. startConversation stays an api.post (ApiClient also reads a body location, which the MSW fixtures use). groups.ts reads group streams with readSseStream. use-chat.ts takes UNCONSUMED_STREAM_ERROR_CODES and parseErrorEvent from the package; ChatPanel and use-chat-ratings take the rating steps. Deleted: lib/api/sse-utils.ts (test ported) and lib/chat-rating-steps.ts. Consumer tests changed in import paths only. AGENTS.md says where the protocol lives.

* docs(changelog): @eddi/core and the 1:1 turn loops on it

Fragment for phase 1b. Eight links in the September and October archives named files this branch deletes; they now point at the package module the code moved to.

* feat(ui): add @eddi/ui and move the Manager onto its tokens, theme and i18n

Phase 3a of the frontend unification plan. ui/packages/ui is the second
shared package, consumed as source like @eddi/core:

- theme.css: the Manager's Tailwind v4 @theme (semantic colours, the
  brand/warn/ochre scales, radius, font, light and .dark), moved
  verbatim out of index.css, which now imports it. Plain @theme, so
  /branding/brand.css still reaches the utilities.
- CHAT_TOKEN_ALIASES / SEMANTIC_TOKENS: the --chat-* names the widget
  will declare as aliases of the shared tokens.
- ThemeProvider/useTheme (moved from the Manager) and the helpers under
  them, marking <html> with a class or data-theme.
- setupI18n: English bundled, one lazily loaded locale at a time,
  region tags matched, productName default variables, dir/lang from the
  resolved language. The Manager's i18n/config.ts is now its loaders
  plus one call.
- @eddi/ui/fonts: phase 0's per-locale script fonts, a separate entry
  so an app that does not load them never bundles their chunks.
- Button, buttonVariants, cn and the direction-aware ThemedToaster; the
  Manager imports them from the package (AppToaster passes rtl).

sharedPackage({ react, noApi }) keeps the package free of app imports,
@eddi/core, fetch and window.__EDDI_*__; the boundaries test checks the
same. CI's UI Chat job runs its typecheck, lint and tests; the policy
test covers its config files. The script-font dependencies moved from
the Manager to the package; the lock was regenerated on Linux.

* feat(chat-ui): move the widget onto @eddi/ui — i18next in 11 locales, token aliases

- i18n: the widget's own t() and four string tables become i18next
  bundles in src/i18n/locales, set up through @eddi/ui's setupI18n
  without react-i18next: English bundled, each other locale a 2.8-3.4
  KB gz chunk, only the active one loaded. main.tsx awaits initLocale
  before the first render, so t() still works outside React. The seven
  new locales (ar, zh, th, ja, ko, pt, hi) follow the Manager's
  terminology; ?lang=ar lays the widget out right to left. Placeholders
  are {{name}}; a missing value stays visible and a value is never
  interpolated twice. i18n.test.ts checks parity, placeholders, real
  translation and every key the code passes to t().
- Tokens: variables.css gives the shared tokens the widget's own values
  per theme and declares fifteen --chat-* names as documented aliases of
  them (CHAT_TOKEN_ALIASES). The URL colour parameters and brand.css's
  --chat-accent still win. chat-aliases.test.ts pins the table, every
  name's colour as it was before in both themes, and the names the
  colour parameters write.
- Theme: useTheme keeps its ?theme= precedence on @eddi/ui's helpers.

First load 169.1 KB gz of the 170 budget (from 162.2). Docs: Chat UI
README and AGENTS.md, chat-ui-embedding.md; one archived changelog link
repointed at the moved i18n module. Changelog fragment for phase 3a.

* feat(ui): add @eddi/conversation with the AgentConversation controller

The 1:1 turn state machine of the widget's loop as a framework-free store on @eddi/core, with a transport per route kind (conversation, managed, local), the shared conversation.* strings in eleven locales, and a suite holding the union of the loops' turn rules. resume() restores the last output's quick replies. CI runs its checks; lint and the boundaries test keep it router-free and off window.__EDDI_*__; the Manager's i18n:check reads package locale files.

* feat(chat-ui): move the widget onto @eddi/conversation

ChatProvider owns an AgentConversation; ChatWidget keeps the embedding (route, token hand-off, URL colours, hide flags, profile gate, ratings, HITL polling) and hands the route to the controller as a transport. The message bubble, composer, requested field, quick replies, indicators, paused and rating cards and the scroll button move into the package as the shared components with their history, with the one markdown renderer and the conversation.* strings. GFM is parsed without its serialiser, which takes the first load to 167.7 KB gz (was 169.3).

* feat(manager): render chat replies through the shared markdown renderer

chat-message.tsx (Chat page, Studio, test drawer, Workforce chat) uses @eddi/conversation's MarkdownContent: KaTeX, highlighted code with a copy button, sanitised raw HTML, images as links. The shared conversation.* strings are merged into the Manager's bundles. A resumed conversation offers the last reply's quick replies again. The feature matrix asserts KaTeX and highlighting on the chat panel, and a fullstack spec checks the widget right to left.

* fix(ui): type bare-string output entries in ConversationOutput

HITL writes its pending-approval placeholder and rejection message into
output[] as bare strings; OutputItem[] could not express them. The
extractors already take unknown, so no consumer changes.

* fix(chat-ui): keep the input focus ring on the chat accent under a brand

--chat-input-focus aliased --color-ring, but /branding/brand.css
(BrandDelivery.stylesheet) writes the Manager's --color-ring, its
primary, on :root, and the widget loads that stylesheet: a branded
widget's focus ring followed the Manager primary instead of the chat
accent. Alias it to --chat-accent, as --chat-user-bg is (?accentColor=
already set all three). chat-aliases.test.ts applies the brand
stylesheet's output and checks the accent, user bubble and focus ring
take the chat accent in both themes and nothing else moves.

* fix(chat-ui): use logical sides in chat.css so dir=rtl mirrors the widget

The accent stripes (border-left) become border-inline-start, the
absolutely placed eye toggles and copy/close buttons (right) become
inset-inline-end, and the paddings that reserve their room become
padding-inline. LTR renders as before; the toast's 50%/translateX
centring stays physical.

* chore(chat-ui): declare i18next, which src/i18n/index.ts imports

It resolved only because @eddi/ui's copy is hoisted. Same range as the
Manager and @eddi/ui (^26.4.7); the lock's chat entry lists it.

* docs(changelog): the review fixes and the main merge on @eddi/ui

* docs(changelog): point the tool-labels link at its home in @eddi/core

The 2026-11-06 fragment (from main, #1301) linked the Chat UI's
tool-labels.ts, which this branch moved into ui/packages/core.
DocumentationLinksTest failed on it.

* fix(ui): a large attachment reaches the assistant as a reference; toaster tests start clean

* fix(manager): import Button from @eddi/ui in the signing-key section merged from main

* test(ui): the controller's active tool is a ToolActivity after the main merge

* fix(ui): linear markdown detectors and the #1280 review findings

looksLikeMath and looksLikeCode no longer backtrack polynomially (CodeQL
js/polynomial-redos). The controller keeps new images on a re-read, applies
the restored step's state on undo, gives resume its own generation, and stops
a late re-read or cancel from overwriting a newer turn. Snapshot dedupe
matches whole entries, the provider moves the upload-ownership ref with the
conversation, footnote links resolve after sanitizing, and the demo stream
honours Stop.

* chore(ui): raise the Manager first-load budget to 700 KB for the frontend stack
ginccc added a commit that referenced this pull request Nov 16, 2026
…on AgentConversation (#1283)

* perf(manager): load script fonts with their locale

main.tsx imported all eight Noto families, whose @font-face rules were
about 128 KB gz of the main stylesheet for every user. Only Noto Sans stays
eager; Arabic, Thai, Devanagari, JP, KR, SC and TC load as CSS chunks when
their locale is active (zh-TW/HK/MO and Hant get TC). Other-script text in a
Latin UI falls back to the system font. First load 743.8 -> 616.4 KB gz.

* perf(chat-ui): drop react-router, parse the three URL shapes directly

react-router was 92 KB of the widget's first load for three path patterns and
one query-string rewrite. src/location.ts parses /chat/managed/:intent/:userId,
/chat/:environment/:agentId/:userId and /chat/:environment/:agentId with the
router's matching rules; unknown paths still go to /chat/production/default
and ?token= is still stripped in place. ChatLocationProvider replaces
BrowserRouter, and its initialPath mode replaces MemoryRouter in tests.
location.test.tsx pins every URL shape for embedders.

* perf(chat-ui): load the raw-HTML parser only for replies with HTML

rehype-raw pulls in parse5, about as large as the widget's own code, but only
does anything when a reply contains HTML. It is now a lazy chunk like KaTeX
and highlight.js, loaded when a message contains '<' followed by a letter, /,
! or ?. Output is unchanged once it is in (raw-html-lazy.test.tsx); HTML is
still rendered and sanitised for every agent until the per-agent rawHtml
setting exists (plan D9). AGENTS.md describes the router-free routing.

* perf(ui): check first-load bundle budgets in CI

ui/scripts/check-bundle-budget.mjs sums the gzip -9 sizes of the scripts and
stylesheets each HTML shell loads before any lazy chunk and compares them
with ui/bundle-budget.json. UI Manager Checks and UI Chat now build and run
it (npm run budget). Before phase 0 on main: 743.8 KB (manage, workforce,
welcome) and 224.8 KB (chat); now 616.4 and 160.6, budgets 630 and 170.

* docs: recommend Open WebUI over /v1 for generic chat, and say what it lacks

Per decision D10 of the frontend unification plan: a deployment that only
wants generic chat can use Open WebUI. The guide and the README now list what
it then goes without: approvals in the chat, quick replies and inputField,
secret input, ratings, review notices, group discussions, memory
transparency and branding.

* test(ui): record the conversation feature matrix per surface

One cell per capability (KaTeX, highlight.js, output images, quick replies,
inputField, secret input, history, inline HITL, i18n) and surface, tagged
@surface:/@capability:. The Manager's ChatPanel, Operator and Workforce
thread are a Playwright spec over MSW; unsupported cells are test.fixme with
the reason, and cells MSW cannot reach are skipped naming their unit tests.
The widget's column is a Vitest spec, since ui/chat has no Playwright tier.

* docs(changelog): frontend unification phase 0

Records the before/after first-load numbers, the budgets, the font fallback
for other scripts in a Latin UI, and what was not verified locally. Also
marks the feature-matrix skip/fixme cells as deliberate for the E2E lint
rule.

* chore(ui): npm workspaces root with one lockfile for both UIs

ui/package.json declares manager, chat and packages/* as workspaces and
ui/package-lock.json replaces the two per-app lockfiles. The lock was seeded
from the old ones so CI-accepted versions are kept, then resolved on Linux so
the wasm32-wasi children Windows prunes are present. lucide-react is aligned
to ^1.59 in the Chat UI and the shared toolchain versions in the Manager;
overrides move to the root, where npm reads them.

Maven runs one npm ci at ui/; the per-app builds and the jar layout are
unchanged. ui/scripts/check-lockfile-platforms.mjs checks the lock still
carries every platform's packages.

* ci(ui): install at the workspace root, check the lock, one Dependabot entry

Every UI job and Build Image install at ui/ and key the npm cache on
ui/package-lock.json. UI Manager Checks runs npm run lockfile:check after
npm ci. The CycloneDX step keeps bom-ui-manager.json and bom-ui-chat.json,
read from ui/package.json with --workspace. Dependabot's /ui/manager and
/ui/chat entries become /ui (BuildQualityGatesTest now expects one npm entry
grouping vitest), CodeQL's UI config adds ui/packages, and the auto-approve
policy protects the workspace root's manifests and configs.

* refactor(ui): shared tsconfig and ESLint bases for both apps

ui/tsconfig.base.json holds the eight compiler options every app tsconfig
set identically; tsc --showConfig is unchanged for all six projects.
ui/eslint.config.base.js holds the recommended presets, browser globals, the
two hook rules and the toBeGreaterThanOrEqual(0) guard; eslint --print-config
is unchanged apart from the Chat UI now using the Manager's longer message.

* docs(ui): npm ci runs at the ui/ workspace root

The root, Manager and Chat UI AGENTS.md, both READMEs, CONTRIBUTING.md,
agent-manager-gui.md and developer-quickstart.md say to install once at ui/
and run app scripts from each app. The Manager's Windows lockfile note now
points at ui/package-lock.json and npm run lockfile:check. Changelog
fragment for phase 1a.

* feat(ui): add @eddi/core, the framework-free conversation contract package

HTTP (HttpClient with injected auth, transport and error factory; ApiError; the {error, code} envelope; one 401 retry), the one SSE frame parser and stream reader for agent and group streams, the agent conversation API, HITL status/cancel/resume, attachments, ratings, rating steps, snapshot-to-messages and the contract types. Derived from the Chat UI's api/ modules and the Manager's lib/api/chat.ts, sse-utils.ts and the group SSE reader; consumed as source through the workspace link (exports -> src/index.ts).

Tests: the Chat UI's protocol suites and the Manager's parse-sse-frame suite are ported, plus turn-protocol.test.ts (the union of the five turn loops' protocol cases) and boundaries.test.ts (no app/React import, no import cycle across ui/packages/*). Lint: sharedPackage() in the ESLint base.

* ci(ui): run @eddi/core's checks and cover ui/packages in i18n:check and auto-approve

The UI Chat job runs the package's type check, lint (package boundaries) and tests before the app's. check-i18n.mjs also walks ui/packages/*/src, which the Manager compiles as source. auto-approve-copilot protects a package's vitest, ESLint and tsconfig files the way it protects an app's (the existing ui/*/ globs stop one segment short).

* refactor(chat-ui): move the widget onto @eddi/core

ChatWidget, ChatInput, PausedCard, the HITL polling and rating hooks and the store now take HTTP, the SSE reader, the conversation API, HITL status, attachments, ratings, rating steps and snapshot-to-messages from @eddi/core. Deleted: api/http.ts, api/chat-api.ts, api/sse-events.ts, api/snapshot.ts, api/attachments-api.ts and rating-steps.ts, with their tests (ported to the package). What stays is the widget's own: embed-auth, the brand, the demo, pauseHeadline (api/hitl-api.ts), the rating channel and error copy (api/rating-api.ts) and skippedTurnMessage (turn-notices.ts). Consumer tests changed only in import paths; vite-proxy.test.ts also scans the package for the prefixes it calls. AGENTS.md: the backend contract list moved to ui/packages/core/README.md.

* refactor(manager): move ChatPanel's conversation API and the group reader onto @eddi/core

lib/api/chat.ts is now the Manager's binding of the package's conversation API: same signatures and message types (the Operator and the Workforce member thread import it unchanged), an HttpClient built on the new ApiClient.authorizedFetch (pre-flight refresh, one 401 retry, network failures as ApiClientError status 0, aborts left alone) and apiErrorFromResponse, and the seg() refusal of traversal ids kept. startConversation stays an api.post (ApiClient also reads a body location, which the MSW fixtures use). groups.ts reads group streams with readSseStream. use-chat.ts takes UNCONSUMED_STREAM_ERROR_CODES and parseErrorEvent from the package; ChatPanel and use-chat-ratings take the rating steps. Deleted: lib/api/sse-utils.ts (test ported) and lib/chat-rating-steps.ts. Consumer tests changed in import paths only. AGENTS.md says where the protocol lives.

* docs(changelog): @eddi/core and the 1:1 turn loops on it

Fragment for phase 1b. Eight links in the September and October archives named files this branch deletes; they now point at the package module the code moved to.

* feat(ui): add @eddi/ui and move the Manager onto its tokens, theme and i18n

Phase 3a of the frontend unification plan. ui/packages/ui is the second
shared package, consumed as source like @eddi/core:

- theme.css: the Manager's Tailwind v4 @theme (semantic colours, the
  brand/warn/ochre scales, radius, font, light and .dark), moved
  verbatim out of index.css, which now imports it. Plain @theme, so
  /branding/brand.css still reaches the utilities.
- CHAT_TOKEN_ALIASES / SEMANTIC_TOKENS: the --chat-* names the widget
  will declare as aliases of the shared tokens.
- ThemeProvider/useTheme (moved from the Manager) and the helpers under
  them, marking <html> with a class or data-theme.
- setupI18n: English bundled, one lazily loaded locale at a time,
  region tags matched, productName default variables, dir/lang from the
  resolved language. The Manager's i18n/config.ts is now its loaders
  plus one call.
- @eddi/ui/fonts: phase 0's per-locale script fonts, a separate entry
  so an app that does not load them never bundles their chunks.
- Button, buttonVariants, cn and the direction-aware ThemedToaster; the
  Manager imports them from the package (AppToaster passes rtl).

sharedPackage({ react, noApi }) keeps the package free of app imports,
@eddi/core, fetch and window.__EDDI_*__; the boundaries test checks the
same. CI's UI Chat job runs its typecheck, lint and tests; the policy
test covers its config files. The script-font dependencies moved from
the Manager to the package; the lock was regenerated on Linux.

* feat(chat-ui): move the widget onto @eddi/ui — i18next in 11 locales, token aliases

- i18n: the widget's own t() and four string tables become i18next
  bundles in src/i18n/locales, set up through @eddi/ui's setupI18n
  without react-i18next: English bundled, each other locale a 2.8-3.4
  KB gz chunk, only the active one loaded. main.tsx awaits initLocale
  before the first render, so t() still works outside React. The seven
  new locales (ar, zh, th, ja, ko, pt, hi) follow the Manager's
  terminology; ?lang=ar lays the widget out right to left. Placeholders
  are {{name}}; a missing value stays visible and a value is never
  interpolated twice. i18n.test.ts checks parity, placeholders, real
  translation and every key the code passes to t().
- Tokens: variables.css gives the shared tokens the widget's own values
  per theme and declares fifteen --chat-* names as documented aliases of
  them (CHAT_TOKEN_ALIASES). The URL colour parameters and brand.css's
  --chat-accent still win. chat-aliases.test.ts pins the table, every
  name's colour as it was before in both themes, and the names the
  colour parameters write.
- Theme: useTheme keeps its ?theme= precedence on @eddi/ui's helpers.

First load 169.1 KB gz of the 170 budget (from 162.2). Docs: Chat UI
README and AGENTS.md, chat-ui-embedding.md; one archived changelog link
repointed at the moved i18n module. Changelog fragment for phase 3a.

* feat(ui): add @eddi/conversation with the AgentConversation controller

The 1:1 turn state machine of the widget's loop as a framework-free store on @eddi/core, with a transport per route kind (conversation, managed, local), the shared conversation.* strings in eleven locales, and a suite holding the union of the loops' turn rules. resume() restores the last output's quick replies. CI runs its checks; lint and the boundaries test keep it router-free and off window.__EDDI_*__; the Manager's i18n:check reads package locale files.

* feat(chat-ui): move the widget onto @eddi/conversation

ChatProvider owns an AgentConversation; ChatWidget keeps the embedding (route, token hand-off, URL colours, hide flags, profile gate, ratings, HITL polling) and hands the route to the controller as a transport. The message bubble, composer, requested field, quick replies, indicators, paused and rating cards and the scroll button move into the package as the shared components with their history, with the one markdown renderer and the conversation.* strings. GFM is parsed without its serialiser, which takes the first load to 167.7 KB gz (was 169.3).

* feat(manager): render chat replies through the shared markdown renderer

chat-message.tsx (Chat page, Studio, test drawer, Workforce chat) uses @eddi/conversation's MarkdownContent: KaTeX, highlighted code with a copy button, sanitised raw HTML, images as links. The shared conversation.* strings are merged into the Manager's bundles. A resumed conversation offers the last reply's quick replies again. The feature matrix asserts KaTeX and highlighting on the chat panel, and a fullstack spec checks the widget right to left.

* feat(conversation): host hooks on AgentConversation, attachments and guardrail notes in Message

AgentConversation can keep its state in a host's store, follow a host's
conversation generation, drain a replaced conversation's stream for a grace
period, show files as chips, read outputs a host's way, and hand events,
turn boundaries, the finished snapshot, a failed turn's reason and every
refusal or failure to the host. send() resolves { outcome }. Without the
hooks it behaves as before; a secret turn never forwards an attachment.

Message renders a sent message's attachments and a reply's guardrail notes;
ThinkingIndicator has a guardrail state, which the widget now shows.
MarkdownContent gains escapeRawHtml for third-party text.

* refactor(manager): run ChatPanel on AgentConversation

use-chat's send is the shared controller's: streaming and snapshot turns,
the done reconcile, refusals and the detached-stream grace. The Zustand chat
store stays what every component reads; the controller writes it through a
store adapter and follows its conversation epoch. The Manager keeps its copy
through the controller's hooks (toasts, error bubbles, the pause banner, the
debug drawer's events), and its own start, load/resume, executing-turn
follow, undo/redo/rerun and end.

Every use-chat, use-send and ChatPanel suite passes unmodified. The bubble
renders designer images; the panel says when a guardrail is at work.

* feat(manager): the test drawer shows the guardrail activity line

The drawer sends through useSendMessage and reads the chat store, so it runs
on AgentConversation with ChatPanel; it now also says when a guardrail is at
work on the reply, and shows designer images through ChatMessage.

* refactor(ui): render every markdown surface through MarkdownContent

The thirteen Manager files that called ReactMarkdown themselves (group and
Workforce transcripts and cards, the conversation viewer, the member thread,
the Operator chat, the update check's release notes) render through
ConversationMarkdown. Each keeps raw HTML escaped as before (escapeRawHtml)
and gains KaTeX, highlighted code with a copy button and scrolling tables.

A test in @eddi/conversation fails on any react-markdown, remark-gfm,
rehype-raw, rehype-sanitize or rehype-katex import outside the renderer, in
either app or any package. markdownImageAsLink is gone; the renderer applies
the same image rule.

* test(manager): flip the feature-matrix cells phase 3c supports

output-images on the chat panel (an MSW reply with an image item), and
katex and highlight on the Workforce member thread, now assertions. The
operator's katex and highlight cells move to unit: it renders through the
shared renderer, but the MSW tier has no activated operator.

* refactor(workforce): run the member thread on AgentConversation

The thread's own stream loop gives way to one AgentConversation per
advisor, read through useAgentConversation. Its error banner and Retry,
the pause notice and the stopped-stream report stay the thread's, through
presentFailure, onTurnSnapshot and the send result. Designer images render;
Stop also asks the server to stop the turn. Every thread suite passes
unmodified; the feature matrix's output-images cell for the thread is an
assertion.

* docs(chat-ui): the guardrail notes and state the widget shows

* fix(ui): keep a second pause a pause, render notices as system lines, forget secrets

- A pause resolved elsewhere left the controller at AWAITING_HUMAN, so the
  next turn that paused again was taken for one the server dropped: its
  message withdrawn as "not sent", no pause banner or thread notice, and a
  re-send got a 409. New AgentConversation.pauseResolved(state); the Manager
  calls it via clearChatPause from ChatPanel's PauseNotice and the approvals
  resume/cancel, the member thread from its notice. Undo/redo (controller and
  use-chat), snapshot installs and rerun now write the snapshot's
  conversationState; rerun re-establishes the pause banner.
- kind "notice" messages render as a plain role="note" line (ChatNotice) in
  ChatMessage and the member thread: no markdown, avatar, copy or rating.
- reset() drops the raw texts of secret turns; forgetSecrets() does it alone
  and the chat store's setSelectedAgent, clearMessages and reset call it.

* fix(ui): type bare-string output entries in ConversationOutput

HITL writes its pending-approval placeholder and rejection message into
output[] as bare strings; OutputItem[] could not express them. The
extractors already take unknown, so no consumer changes.

* fix(chat-ui): keep the input focus ring on the chat accent under a brand

--chat-input-focus aliased --color-ring, but /branding/brand.css
(BrandDelivery.stylesheet) writes the Manager's --color-ring, its
primary, on :root, and the widget loads that stylesheet: a branded
widget's focus ring followed the Manager primary instead of the chat
accent. Alias it to --chat-accent, as --chat-user-bg is (?accentColor=
already set all three). chat-aliases.test.ts applies the brand
stylesheet's output and checks the accent, user bubble and focus ring
take the chat accent in both themes and nothing else moves.

* fix(chat-ui): use logical sides in chat.css so dir=rtl mirrors the widget

The accent stripes (border-left) become border-inline-start, the
absolutely placed eye toggles and copy/close buttons (right) become
inset-inline-end, and the paddings that reserve their room become
padding-inline. LTR renders as before; the toast's 50%/translateX
centring stays physical.

* chore(chat-ui): declare i18next, which src/i18n/index.ts imports

It resolved only because @eddi/ui's copy is hoisted. Same range as the
Manager and @eddi/ui (^26.4.7); the lock's chat entry lists it.

* docs(changelog): the review fixes and the main merge on @eddi/ui

* docs(changelog): point the tool-labels link at its home in @eddi/core

The 2026-11-06 fragment (from main, #1301) linked the Chat UI's
tool-labels.ts, which this branch moved into ui/packages/core.
DocumentationLinksTest failed on it.

* fix(ui): a large attachment reaches the assistant as a reference; toaster tests start clean

* fix(conversation): default stream-error notices when the host declines; keep send locked while the failure presenter runs

* fix(manager): import Button from @eddi/ui in the signing-key section merged from main

* test(ui): the controller's active tool is a ToolActivity after the main merge

* fix(ui): linear markdown detectors and the #1280 review findings

looksLikeMath and looksLikeCode no longer backtrack polynomially (CodeQL
js/polynomial-redos). The controller keeps new images on a re-read, applies
the restored step's state on undo, gives resume its own generation, and stops
a late re-read or cancel from overwriting a newer turn. Snapshot dedupe
matches whole entries, the provider moves the upload-ownership ref with the
conversation, footnote links resolve after sanitizing, and the demo stream
honours Stop.

* chore(ui): raise the Manager first-load budget to 700 KB for the frontend stack

* test(manager): the tool indicator takes a ToolActivity after the #1280 merge; test ids for the no-response state and the thread's Send

Message.test.tsx passed a bare tool name to ThinkingIndicator, which now takes @eddi/core's ToolActivity. The CodeRabbit nitpicks on chat-message and the member thread: message-no-response, thread-no-response and thread-send ids, and the image and pause-resolution tests query by them instead of copy.

* chore(ui): raise the chat widget first-load budget to 180 KB
ginccc added a commit that referenced this pull request Nov 16, 2026
…l gating (phase 4) (#1284)

* perf(manager): load script fonts with their locale

main.tsx imported all eight Noto families, whose @font-face rules were
about 128 KB gz of the main stylesheet for every user. Only Noto Sans stays
eager; Arabic, Thai, Devanagari, JP, KR, SC and TC load as CSS chunks when
their locale is active (zh-TW/HK/MO and Hant get TC). Other-script text in a
Latin UI falls back to the system font. First load 743.8 -> 616.4 KB gz.

* perf(chat-ui): drop react-router, parse the three URL shapes directly

react-router was 92 KB of the widget's first load for three path patterns and
one query-string rewrite. src/location.ts parses /chat/managed/:intent/:userId,
/chat/:environment/:agentId/:userId and /chat/:environment/:agentId with the
router's matching rules; unknown paths still go to /chat/production/default
and ?token= is still stripped in place. ChatLocationProvider replaces
BrowserRouter, and its initialPath mode replaces MemoryRouter in tests.
location.test.tsx pins every URL shape for embedders.

* perf(chat-ui): load the raw-HTML parser only for replies with HTML

rehype-raw pulls in parse5, about as large as the widget's own code, but only
does anything when a reply contains HTML. It is now a lazy chunk like KaTeX
and highlight.js, loaded when a message contains '<' followed by a letter, /,
! or ?. Output is unchanged once it is in (raw-html-lazy.test.tsx); HTML is
still rendered and sanitised for every agent until the per-agent rawHtml
setting exists (plan D9). AGENTS.md describes the router-free routing.

* perf(ui): check first-load bundle budgets in CI

ui/scripts/check-bundle-budget.mjs sums the gzip -9 sizes of the scripts and
stylesheets each HTML shell loads before any lazy chunk and compares them
with ui/bundle-budget.json. UI Manager Checks and UI Chat now build and run
it (npm run budget). Before phase 0 on main: 743.8 KB (manage, workforce,
welcome) and 224.8 KB (chat); now 616.4 and 160.6, budgets 630 and 170.

* docs: recommend Open WebUI over /v1 for generic chat, and say what it lacks

Per decision D10 of the frontend unification plan: a deployment that only
wants generic chat can use Open WebUI. The guide and the README now list what
it then goes without: approvals in the chat, quick replies and inputField,
secret input, ratings, review notices, group discussions, memory
transparency and branding.

* test(ui): record the conversation feature matrix per surface

One cell per capability (KaTeX, highlight.js, output images, quick replies,
inputField, secret input, history, inline HITL, i18n) and surface, tagged
@surface:/@capability:. The Manager's ChatPanel, Operator and Workforce
thread are a Playwright spec over MSW; unsupported cells are test.fixme with
the reason, and cells MSW cannot reach are skipped naming their unit tests.
The widget's column is a Vitest spec, since ui/chat has no Playwright tier.

* docs(changelog): frontend unification phase 0

Records the before/after first-load numbers, the budgets, the font fallback
for other scripts in a Latin UI, and what was not verified locally. Also
marks the feature-matrix skip/fixme cells as deliberate for the E2E lint
rule.

* feat(catalog): add the end-user catalog and the opt-in listed flag

GET /catalog/agents and GET /catalog/groups (eddi-user and above) return what the caller may USE and that is listed: listed=true on the agent or group configuration (default false), or published/internal visibility while workspaces are enforced. Agents must be READY in production. Access is decided by the existing ResourceAccessGuard; the Platform Operator is listed only by its explicit flag.

* test(memory): pin that an eddi-user cannot read or change another user's memories

* feat(workforce): make Workforce work for eddi-user on the catalog

Workforce is role-aware: an end user's dashboard, sidebar, chat picker and board/thread/history pages read /catalog/* instead of the authoring stores, and the wizard, team settings and analytics redirect. D5: admins get a link to /manage/operator instead of the Operator drawer. D6: /welcome sends an eddi-user to /workforce, and landing-redirect.js no longer jumps straight to /manage. Adds the 'Listed in the catalog' switch to the agent page, the group panel and team settings, catalog empty states, i18n in 11 locales, MSW handlers, unit tests and an eddi-user e2e spec.

* feat(operator): teach the Platform Operator about the catalog and the listed flag

Prompt explains listing and how to diagnose 'my users don't see agent X'; the allow-list gains GET /catalog/agents and GET /catalog/groups; revision 53.

* docs(catalog): document the end-user catalog and record phase 2

* chore(ui): npm workspaces root with one lockfile for both UIs

ui/package.json declares manager, chat and packages/* as workspaces and
ui/package-lock.json replaces the two per-app lockfiles. The lock was seeded
from the old ones so CI-accepted versions are kept, then resolved on Linux so
the wasm32-wasi children Windows prunes are present. lucide-react is aligned
to ^1.59 in the Chat UI and the shared toolchain versions in the Manager;
overrides move to the root, where npm reads them.

Maven runs one npm ci at ui/; the per-app builds and the jar layout are
unchanged. ui/scripts/check-lockfile-platforms.mjs checks the lock still
carries every platform's packages.

* ci(ui): install at the workspace root, check the lock, one Dependabot entry

Every UI job and Build Image install at ui/ and key the npm cache on
ui/package-lock.json. UI Manager Checks runs npm run lockfile:check after
npm ci. The CycloneDX step keeps bom-ui-manager.json and bom-ui-chat.json,
read from ui/package.json with --workspace. Dependabot's /ui/manager and
/ui/chat entries become /ui (BuildQualityGatesTest now expects one npm entry
grouping vitest), CodeQL's UI config adds ui/packages, and the auto-approve
policy protects the workspace root's manifests and configs.

* refactor(ui): shared tsconfig and ESLint bases for both apps

ui/tsconfig.base.json holds the eight compiler options every app tsconfig
set identically; tsc --showConfig is unchanged for all six projects.
ui/eslint.config.base.js holds the recommended presets, browser globals, the
two hook rules and the toBeGreaterThanOrEqual(0) guard; eslint --print-config
is unchanged apart from the Chat UI now using the Manager's longer message.

* docs(ui): npm ci runs at the ui/ workspace root

The root, Manager and Chat UI AGENTS.md, both READMEs, CONTRIBUTING.md,
agent-manager-gui.md and developer-quickstart.md say to install once at ui/
and run app scripts from each app. The Manager's Windows lockfile note now
points at ui/package-lock.json and npm run lockfile:check. Changelog
fragment for phase 1a.

* fix(manager-e2e): load the catalog fixtures without the MSW handlers

The Workforce end-user spec imported MOCK_CATALOG_* from handlers.ts, whose
imports reach api-client.ts and read window.location at module load. Playwright
loads spec files in Node, so the whole UI Manager E2E job failed before running
a test. The fixtures now live in a module with no imports, re-exported from
handlers.ts for the unit tier.

* feat(ui): add @eddi/core, the framework-free conversation contract package

HTTP (HttpClient with injected auth, transport and error factory; ApiError; the {error, code} envelope; one 401 retry), the one SSE frame parser and stream reader for agent and group streams, the agent conversation API, HITL status/cancel/resume, attachments, ratings, rating steps, snapshot-to-messages and the contract types. Derived from the Chat UI's api/ modules and the Manager's lib/api/chat.ts, sse-utils.ts and the group SSE reader; consumed as source through the workspace link (exports -> src/index.ts).

Tests: the Chat UI's protocol suites and the Manager's parse-sse-frame suite are ported, plus turn-protocol.test.ts (the union of the five turn loops' protocol cases) and boundaries.test.ts (no app/React import, no import cycle across ui/packages/*). Lint: sharedPackage() in the ESLint base.

* ci(ui): run @eddi/core's checks and cover ui/packages in i18n:check and auto-approve

The UI Chat job runs the package's type check, lint (package boundaries) and tests before the app's. check-i18n.mjs also walks ui/packages/*/src, which the Manager compiles as source. auto-approve-copilot protects a package's vitest, ESLint and tsconfig files the way it protects an app's (the existing ui/*/ globs stop one segment short).

* refactor(chat-ui): move the widget onto @eddi/core

ChatWidget, ChatInput, PausedCard, the HITL polling and rating hooks and the store now take HTTP, the SSE reader, the conversation API, HITL status, attachments, ratings, rating steps and snapshot-to-messages from @eddi/core. Deleted: api/http.ts, api/chat-api.ts, api/sse-events.ts, api/snapshot.ts, api/attachments-api.ts and rating-steps.ts, with their tests (ported to the package). What stays is the widget's own: embed-auth, the brand, the demo, pauseHeadline (api/hitl-api.ts), the rating channel and error copy (api/rating-api.ts) and skippedTurnMessage (turn-notices.ts). Consumer tests changed only in import paths; vite-proxy.test.ts also scans the package for the prefixes it calls. AGENTS.md: the backend contract list moved to ui/packages/core/README.md.

* refactor(manager): move ChatPanel's conversation API and the group reader onto @eddi/core

lib/api/chat.ts is now the Manager's binding of the package's conversation API: same signatures and message types (the Operator and the Workforce member thread import it unchanged), an HttpClient built on the new ApiClient.authorizedFetch (pre-flight refresh, one 401 retry, network failures as ApiClientError status 0, aborts left alone) and apiErrorFromResponse, and the seg() refusal of traversal ids kept. startConversation stays an api.post (ApiClient also reads a body location, which the MSW fixtures use). groups.ts reads group streams with readSseStream. use-chat.ts takes UNCONSUMED_STREAM_ERROR_CODES and parseErrorEvent from the package; ChatPanel and use-chat-ratings take the rating steps. Deleted: lib/api/sse-utils.ts (test ported) and lib/chat-rating-steps.ts. Consumer tests changed in import paths only. AGENTS.md says where the protocol lives.

* docs(changelog): @eddi/core and the 1:1 turn loops on it

Fragment for phase 1b. Eight links in the September and October archives named files this branch deletes; they now point at the package module the code moved to.

* feat(ui): add @eddi/ui and move the Manager onto its tokens, theme and i18n

Phase 3a of the frontend unification plan. ui/packages/ui is the second
shared package, consumed as source like @eddi/core:

- theme.css: the Manager's Tailwind v4 @theme (semantic colours, the
  brand/warn/ochre scales, radius, font, light and .dark), moved
  verbatim out of index.css, which now imports it. Plain @theme, so
  /branding/brand.css still reaches the utilities.
- CHAT_TOKEN_ALIASES / SEMANTIC_TOKENS: the --chat-* names the widget
  will declare as aliases of the shared tokens.
- ThemeProvider/useTheme (moved from the Manager) and the helpers under
  them, marking <html> with a class or data-theme.
- setupI18n: English bundled, one lazily loaded locale at a time,
  region tags matched, productName default variables, dir/lang from the
  resolved language. The Manager's i18n/config.ts is now its loaders
  plus one call.
- @eddi/ui/fonts: phase 0's per-locale script fonts, a separate entry
  so an app that does not load them never bundles their chunks.
- Button, buttonVariants, cn and the direction-aware ThemedToaster; the
  Manager imports them from the package (AppToaster passes rtl).

sharedPackage({ react, noApi }) keeps the package free of app imports,
@eddi/core, fetch and window.__EDDI_*__; the boundaries test checks the
same. CI's UI Chat job runs its typecheck, lint and tests; the policy
test covers its config files. The script-font dependencies moved from
the Manager to the package; the lock was regenerated on Linux.

* feat(chat-ui): move the widget onto @eddi/ui — i18next in 11 locales, token aliases

- i18n: the widget's own t() and four string tables become i18next
  bundles in src/i18n/locales, set up through @eddi/ui's setupI18n
  without react-i18next: English bundled, each other locale a 2.8-3.4
  KB gz chunk, only the active one loaded. main.tsx awaits initLocale
  before the first render, so t() still works outside React. The seven
  new locales (ar, zh, th, ja, ko, pt, hi) follow the Manager's
  terminology; ?lang=ar lays the widget out right to left. Placeholders
  are {{name}}; a missing value stays visible and a value is never
  interpolated twice. i18n.test.ts checks parity, placeholders, real
  translation and every key the code passes to t().
- Tokens: variables.css gives the shared tokens the widget's own values
  per theme and declares fifteen --chat-* names as documented aliases of
  them (CHAT_TOKEN_ALIASES). The URL colour parameters and brand.css's
  --chat-accent still win. chat-aliases.test.ts pins the table, every
  name's colour as it was before in both themes, and the names the
  colour parameters write.
- Theme: useTheme keeps its ?theme= precedence on @eddi/ui's helpers.

First load 169.1 KB gz of the 170 budget (from 162.2). Docs: Chat UI
README and AGENTS.md, chat-ui-embedding.md; one archived changelog link
repointed at the moved i18n module. Changelog fragment for phase 3a.

* feat(ui): add @eddi/conversation with the AgentConversation controller

The 1:1 turn state machine of the widget's loop as a framework-free store on @eddi/core, with a transport per route kind (conversation, managed, local), the shared conversation.* strings in eleven locales, and a suite holding the union of the loops' turn rules. resume() restores the last output's quick replies. CI runs its checks; lint and the boundaries test keep it router-free and off window.__EDDI_*__; the Manager's i18n:check reads package locale files.

* feat(chat-ui): move the widget onto @eddi/conversation

ChatProvider owns an AgentConversation; ChatWidget keeps the embedding (route, token hand-off, URL colours, hide flags, profile gate, ratings, HITL polling) and hands the route to the controller as a transport. The message bubble, composer, requested field, quick replies, indicators, paused and rating cards and the scroll button move into the package as the shared components with their history, with the one markdown renderer and the conversation.* strings. GFM is parsed without its serialiser, which takes the first load to 167.7 KB gz (was 169.3).

* feat(manager): render chat replies through the shared markdown renderer

chat-message.tsx (Chat page, Studio, test drawer, Workforce chat) uses @eddi/conversation's MarkdownContent: KaTeX, highlighted code with a copy button, sanitised raw HTML, images as links. The shared conversation.* strings are merged into the Manager's bundles. A resumed conversation offers the last reply's quick replies again. The feature matrix asserts KaTeX and highlighting on the chat panel, and a fullstack spec checks the widget right to left.

* feat(conversation): host hooks on AgentConversation, attachments and guardrail notes in Message

AgentConversation can keep its state in a host's store, follow a host's
conversation generation, drain a replaced conversation's stream for a grace
period, show files as chips, read outputs a host's way, and hand events,
turn boundaries, the finished snapshot, a failed turn's reason and every
refusal or failure to the host. send() resolves { outcome }. Without the
hooks it behaves as before; a secret turn never forwards an attachment.

Message renders a sent message's attachments and a reply's guardrail notes;
ThinkingIndicator has a guardrail state, which the widget now shows.
MarkdownContent gains escapeRawHtml for third-party text.

* refactor(manager): run ChatPanel on AgentConversation

use-chat's send is the shared controller's: streaming and snapshot turns,
the done reconcile, refusals and the detached-stream grace. The Zustand chat
store stays what every component reads; the controller writes it through a
store adapter and follows its conversation epoch. The Manager keeps its copy
through the controller's hooks (toasts, error bubbles, the pause banner, the
debug drawer's events), and its own start, load/resume, executing-turn
follow, undo/redo/rerun and end.

Every use-chat, use-send and ChatPanel suite passes unmodified. The bubble
renders designer images; the panel says when a guardrail is at work.

* feat(manager): the test drawer shows the guardrail activity line

The drawer sends through useSendMessage and reads the chat store, so it runs
on AgentConversation with ChatPanel; it now also says when a guardrail is at
work on the reply, and shows designer images through ChatMessage.

* refactor(ui): render every markdown surface through MarkdownContent

The thirteen Manager files that called ReactMarkdown themselves (group and
Workforce transcripts and cards, the conversation viewer, the member thread,
the Operator chat, the update check's release notes) render through
ConversationMarkdown. Each keeps raw HTML escaped as before (escapeRawHtml)
and gains KaTeX, highlighted code with a copy button and scrolling tables.

A test in @eddi/conversation fails on any react-markdown, remark-gfm,
rehype-raw, rehype-sanitize or rehype-katex import outside the renderer, in
either app or any package. markdownImageAsLink is gone; the renderer applies
the same image rule.

* test(manager): flip the feature-matrix cells phase 3c supports

output-images on the chat panel (an MSW reply with an image item), and
katex and highlight on the Workforce member thread, now assertions. The
operator's katex and highlight cells move to unit: it renders through the
shared renderer, but the MSW tier has no activated operator.

* refactor(workforce): run the member thread on AgentConversation

The thread's own stream loop gives way to one AgentConversation per
advisor, read through useAgentConversation. Its error banner and Retry,
the pause notice and the stopped-stream report stay the thread's, through
presentFailure, onTurnSnapshot and the send result. Designer images render;
Stop also asks the server to stop the turn. Every thread suite passes
unmodified; the feature matrix's output-images cell for the thread is an
assertion.

* docs(chat-ui): the guardrail notes and state the widget shows

* feat(storage): conditional single-field update; title and pin on the conversation descriptor

IResourceStorage.setFieldsIf sets top-level string/boolean fields of the
live document in one write, optionally only when a guard field is absent or
holds an allowed value (Mongo updateOne with the guard in the filter,
PostgreSQL data || jsonb with the guard in the WHERE). ConversationDescriptor
gains title, titleSource (AUTO, LLM, USER) and pinned. Parity test against
real MongoDB and PostgreSQL.

* feat(agents): appearance, conversationControls and titleGeneration on the agent

Optional agent fields for how chat windows present an agent (displayName,
avatar, accentColor, starters), which controls they offer (undo, redo,
attachments, rating, quickReplies, streaming, rawHtml) and opt-in
model-written conversation titles. AgentPresentationValidator checks them on
every agent write path (https or small raster data:image avatar, hex colour,
capped starters and name). GET /agents/{agentId}/profile serves appearance
and the resolved controls of the deployed version; rawHtml is false unless
the agent enables it. JSON round-trip tests cover ZIP export (incl. the
secret scrub), sync and the store.

* feat(conversations): titles from the first non-secret message, owner rename and pin

- Default title: the first user message that was not secret (no secretInput,
  nothing vaulted by a scope:secret property, no secret context placeholder,
  not guardrail-withheld), read after the turn-end scrub and cut at a word to
  eddi.conversations.title-max-length (80). Written once, from the turn's
  completion callback, with a guarded single-field update.
- PATCH /conversationstore/conversations/{id} {title, pinned}: owner or
  eddi-admin (strict owner check, as delete); 400 on empty/blank/overlong,
  404 when deleted. A title the owner set is never replaced: USER > LLM > AUTO.
- titleGeneration (agent opt-in): one background model call after the first
  exchange via SummarizationService, refused by the unpriced policy and the
  tenant budget, charged to the tenant and reported as
  SpendEvent.Kind.CONVERSATION_TITLE. Metric eddi.conversation.titles{outcome}
  with a Full Metrics dashboard panel.
- GDPR export carries title and pinned; erasure removes them with the
  descriptor (tested).

* feat(manager): presentation and titles section; operator and skill learn the new agent fields

- Agent page: "Presentation & titles" section editing appearance,
  conversationControls (rawHtml unchecked by default) and titleGeneration;
  keys in all 11 locales.
- Platform Operator prompt explains appearance, controls, the rawHtml
  default and conversation titles; revision 53. The rename/pin PATCH is not
  in its allow-list (the owner's act).
- eddi-admin skill names the fields.
- Changelog fragment.

* docs(catalog): say that only a group's listed flag can be set over MCP

update_resource does not take the agent type and update_agent edits only the
name and description, so the skill and the catalog page no longer tell an
admin to list an agent through MCP; they point at the Manager switch.

* refactor(conversations): drop a null check the early return already rules out

* test(catalog): cover the degraded paths of CatalogService

Null and failing factory, store and descriptor reads, duplicate and null
entries, an unreadable operator variable, paging, older versions after newer
ones, and sparse group configurations. Missed branches in CatalogService go
from 35 to 9.

* feat(catalog): serve each agent's appearance and conversation controls

GET /catalog/agents now carries the deployed version's appearance and
resolved conversationControls, built with AppearanceProfile.of and
ControlsProfile.of from the configuration CatalogService already reads,
so Workforce Home can draw its cards and starters without a profile call
per agent. A six-argument constructor keeps the old shape (no appearance,
default controls). catalog.md shows the fields.

* feat(chat-ui): render raw HTML only for agents that enable it (D9) and honour conversationControls

The widget now reads conversationControls from the agent profile
(parseConversationControls in @eddi/core: every switch on unless false,
rawHtml off unless true). Message renders raw HTML only when the host
passes enableRawHtml - default off - and otherwise shows it as text; the
parser stays a lazy chunk. ChatWidget passes the agent's rawHtml, and also
drops undo, redo, attachments (new Composer attachments prop), quick
replies and ratings the agent switched off, and streaming when
streaming is false. The hide* URL parameters can only hide more.

Behaviour change: an agent whose replies contain HTML shows it as text
until it sets "conversationControls": {"rawHtml": true}.
chat-ui-embedding.md's upgrade section says so. First load 170.0 KB gz of
the 170 budget.

* feat(workforce): sidebar of conversations, Home with starters, the chat in the URL

Phase 4 of the frontend unification plan (T1.1, T1.2, T1.4, T1.15), for
every Workforce role.

- Sidebar: the person's chats and team sessions grouped Pinned / Today /
  Yesterday / Previous 7 / Previous 30 days / by month, by B2 title (agent
  name and date before there is one). Chats are renamed inline, pinned and
  deleted through the owner endpoints, optimistically with rollback; team
  sessions can be deleted. Members' own conversations inside a team session
  are not listed as chats; an admin's list is narrowed to their own. The
  list is a lazy chunk, so the Manager's first load stays within budget.
- Home: a composer first (agent picker defaulting to the most recent chat's
  agent), the agent's starters, its review notice, the five most recent
  conversations, then the catalog with B4 appearance. The first message
  goes to the chat in router state, never the URL.
- T1.15: ChatPanel urlSync keeps ?agentId&conversationId in the address
  bar so a reload or a second tab returns to the conversation; the
  Manager's chat still clears the parameters.
- conversationControls honoured in ChatPanel (undo, redo, attachments,
  ratings, quick replies, streaming); the chat history shows titles.
- Platform Operator: prompt learns catalog appearance and the sidebar;
  revision stays 54 (set by the merge of #1273 and #1282), new fingerprint.
- i18n in all eleven locales; MSW titles, pin, PATCH, DELETE and catalog
  appearance; unit tests and Playwright specs for sidebar, Home and reload;
  a Workforce end-user guide; changelog fragment.

* docs(catalog): separate anonymous access by auth mode, qualify the upgrade and unlisting rules

* fix(catalog): land viewer-only and approver-only users in the Manager, correct the catalog OpenAPI text

The welcome page sent every non-author to /workforce, whose /catalog reads admit only admin, editor and user, so a dedicated eddi-viewer or eddi-approver saw nothing but 403s. They now go to /manage and /manage/approvals. The GET /catalog/agents description claimed an anonymous caller sees published agents; with authorization on it is refused, with it off visibility is not consulted. The fragment no longer restates the operator revision.

* fix(ui): keep a second pause a pause, render notices as system lines, forget secrets

- A pause resolved elsewhere left the controller at AWAITING_HUMAN, so the
  next turn that paused again was taken for one the server dropped: its
  message withdrawn as "not sent", no pause banner or thread notice, and a
  re-send got a 409. New AgentConversation.pauseResolved(state); the Manager
  calls it via clearChatPause from ChatPanel's PauseNotice and the approvals
  resume/cancel, the member thread from its notice. Undo/redo (controller and
  use-chat), snapshot installs and rerun now write the snapshot's
  conversationState; rerun re-establishes the pause banner.
- kind "notice" messages render as a plain role="note" line (ChatNotice) in
  ChatMessage and the member thread: no markdown, avatar, copy or rating.
- reset() drops the raw texts of secret turns; forgetSecrets() does it alone
  and the chat store's setSelectedAgent, clearMessages and reset call it.

* fix(ui): type bare-string output entries in ConversationOutput

HITL writes its pending-approval placeholder and rejection message into
output[] as bare strings; OutputItem[] could not express them. The
extractors already take unknown, so no consumer changes.

* docs(catalog): state that listing takes effect once the listed version is deployed

* test(schedule): use ResourceAccessGuard.isAdmin() in McpScheduleParityTest, as on main

* fix(chat-ui): keep the input focus ring on the chat accent under a brand

--chat-input-focus aliased --color-ring, but /branding/brand.css
(BrandDelivery.stylesheet) writes the Manager's --color-ring, its
primary, on :root, and the widget loads that stylesheet: a branded
widget's focus ring followed the Manager primary instead of the chat
accent. Alias it to --chat-accent, as --chat-user-bg is (?accentColor=
already set all three). chat-aliases.test.ts applies the brand
stylesheet's output and checks the accent, user bubble and focus ring
take the chat accent in both themes and nothing else moves.

* fix(chat-ui): use logical sides in chat.css so dir=rtl mirrors the widget

The accent stripes (border-left) become border-inline-start, the
absolutely placed eye toggles and copy/close buttons (right) become
inset-inline-end, and the paddings that reserve their room become
padding-inline. LTR renders as before; the toast's 50%/translateX
centring stays physical.

* chore(chat-ui): declare i18next, which src/i18n/index.ts imports

It resolved only because @eddi/ui's copy is hoisted. Same range as the
Manager and @eddi/ui (^26.4.7); the lock's chat entry lists it.

* docs(changelog): the review fixes and the main merge on @eddi/ui

* docs(changelog): point the tool-labels link at its home in @eddi/core

The 2026-11-06 fragment (from main, #1301) linked the Chat UI's
tool-labels.ts, which this branch moved into ui/packages/core.
DocumentationLinksTest failed on it.

* chore(operator): revision 72 after merging main

* fix(ui): a large attachment reaches the assistant as a reference; toaster tests start clean

* fix(manager): the catalog listing toggle is read-only for viewers

* fix(conversation): default stream-error notices when the host declines; keep send locked while the failure presenter runs

* feat(conversations): mine and excludeGroupMembers listing filters; member conversations record their group

GET /conversationstore/conversations?mine=true applies the owner filter for an
admin too, in the descriptor query (MongoDB and PostgreSQL), and admits a row
only if the caller is its owner. excludeGroupMembers=true leaves out the
member threads a group discussion starts, which now record
groupConversationId on their descriptor. GET /groups/{id}/conversations gains
mine=true as well. Review follow-up for the Workforce sidebar.

* fix(workforce): sidebar reads the backend's own-chats listing; delete leaves the open chat; Home fixes

The sidebar asks for mine=true&excludeGroupMembers=true (and mine=true per
team) instead of comparing owners with user.username client-side. Deleting
the open chat or team session returns to Home and clears the chat store.
ChatPanel's first message waits on this render's agent profile. Home's
starters fall back to the profile appearance. The Shift+Enter test waits for
send to be enabled first.

* fix(manager): import Button from @eddi/ui in the signing-key section merged from main

* test(ui): the controller's active tool is a ToolActivity after the main merge

* fix(ui): linear markdown detectors and the #1280 review findings

looksLikeMath and looksLikeCode no longer backtrack polynomially (CodeQL
js/polynomial-redos). The controller keeps new images on a re-read, applies
the restored step's state on undo, gives resume its own generation, and stops
a late re-read or cancel from overwriting a newer turn. Snapshot dedupe
matches whole entries, the provider moves the upload-ownership ref with the
conversation, footnote links resolve after sanitizing, and the demo stream
honours Stop.

* chore(ui): raise the Manager first-load budget to 700 KB for the frontend stack

* test(manager): the tool indicator takes a ToolActivity after the #1280 merge; test ids for the no-response state and the thread's Send

Message.test.tsx passed a bare tool name to ThinkingIndicator, which now takes @eddi/core's ToolActivity. The CodeRabbit nitpicks on chat-message and the member thread: message-no-response, thread-no-response and thread-send ids, and the image and pause-resolution tests query by them instead of copy.

* chore(ui): raise the chat widget first-load budget to 180 KB

* fix(merge): operator revision 76 with the merged prompt's fingerprint; format and type-narrow after the #1283 merge

The merged system prompt has a new fingerprint (revision 76 until #1273 and
#1375 land). IRestConversationStore's Javadoc reflowed by the formatter.
use-workforce-sessions.test reads the recorded URL through a destructure, which
main's stricter index typing requires.

* fix(operator): fingerprint for the prompt after merging main with #1375 (revision stays 76)

* chore(operator): revision 75 after merging main

* fix(manager): import Button and ThemeProvider from @eddi/ui in the catalog files

* fix(manager): route a remembered Workforce preference through the role check

landing-redirect.js sent such visitors straight to /workforce, so a dedicated
eddi-viewer or eddi-approver reached the end-user catalog. It now always goes
to /welcome, where LandingPage applies the role decision.

* fix(ui): the shared packages ask for @types/node 26 like the apps, so npm ci accepts the lock again

* chore(operator): revision 76 after merging main
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.

2 participants