Skip to content

feat(agents): move Agents into Agent Center, its own item under Chat - #1899

Merged
gkhngyk merged 129 commits into
ansvisor:mainfrom
cihan-gyk:feature/agent-center
Oct 31, 2026
Merged

gkhngyk merged 129 commits into
ansvisor:mainfrom
cihan-gyk:feature/agent-center

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Chat › Agents becomes Agent Center, at /dashboard/agents. It is its own page, like Action Center, right under Chat on the left menu, and no longer sits inside Chat's frame. The owner chose the name and the place (2026-10-31). Agents work across the workspace (Chat, Action Center, schedules), not only in Chat.

The "Ready to use" and "Your agents" tabs, with the ready-made agents, come in the next PR.

Stacked on #1869 (W2-15 agent create) and #1887 (sidebar layout). Review only the last two commits. Everything stays behind CHAT_AGENTIC / CHAT_AGENTIC_ORGS. No migration.

Pages

  • The list, an agent's page, its Edit and New agent move to /dashboard/agents/**. The /api/chat/agents/** API stays where it is.
  • The old /dashboard/chat/agents/** addresses answer a permanent redirect to the same page, query kept (chat/agents/[[...path]]).
  • An agent's page gets "← Back to Agent Center", since Chat's breadcrumb is gone. Its Edit form is titled "Edit · {name}".

Guards, the same as Chat's pages

  • chatPageOpen() on every page: with the new Chat off for the workspace, they answer not found.
  • The dashboard layout's read-only state, roles and menu access apply as before.

Menu

  • Agent Center sits under Chat, with a Bot icon.
  • It needs the same plan feature as Chat (ai_agent) and shows only with the new Chat on (NavItem.requiresChatAgentic).
  • Menu access:
    • its section is agents;
    • no role has it hidden by default, the same rule as Chat;
    • it is listed in the six work areas Chat is in;
    • with Chat off, it isn't listed in Settings › Menu access, People, Work areas, the welcome step or onboarding's preview.
  • Chat's own menu link and Ctrl K palette say Agent Center and go to /dashboard/agents. Chat's "Go to a page" knows "agents" and "my agents".
  • The "New" tag goes once Agent Center is opened from anywhere (agents/layout.tsx + agents-seen.tsx, same browser key as before).

Words: en.json gets nav.agentCenter. "Agents" as a place reads "Agent Center"; "agents" as a common noun stays ("Agents at work", plan lists, "Create and run agents").

Help and docs: help/chat/agents.md (name, place, route: /dashboard/agents, approved: false), help/settings/menu-access.md, help/settings/work-areas.md, docs/guides/menu-access.mdx.

Related issue

None. Agents plan, Agent Center PR A.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. Set CHAT_AGENTIC=true.
  2. The left menu shows Agent Center under Chat, above Execution. It opens /dashboard/agents, with the list, filters and New agent.
  3. Open an agent: its page has "← Back to Agent Center". Its Edit says "Edit · {name}".
  4. Open /dashboard/chat/agents?x=1: it lands on /dashboard/agents?x=1.
  5. With the flag off, Agent Center isn't in the menu, and /dashboard/agents answers not found.
  6. In Settings › Menu access, hide "Agent Center" for Analysts. An Analyst doesn't see it.
  7. Unit tests:
    • the pages and the redirect;
    • _chat-page-access, dashboard-navigation, sidebar, mobile-nav;
    • menu-access, menu-access-section, menu-access-people, work-areas-*;
    • agents-list, agent-detail, agent-form, agents-seen, chat-menu;
    • onboarding layout.

Checked in the browser at 1024px, light and dark: the menu, the list and an agent's page. The user approved the screens. Screenshots are available on request.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes (0 errors; 7 old warnings in files this PR doesn't touch)
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

On this branch:

  • web: format:check and typecheck pass, and lint has 0 errors. 762 files / 7,703 tests: 7,702 pass. The one failure is chat-menu.test.tsx "Done · 08:02", a date-dependent case that fails on main today too and is fixed by fix(chat): give a chat row the menu's clock, so a run's time matches its day #1876. yarn build passes.
  • server: unchanged. format:check and lint are clean, and 333 files / 4,588 tests pass (3 skipped).

Follow-ups after merge: links in other open branches still point at /dashboard/chat/agents. The redirect covers them, and they'll be updated as those branches merge:

🤖 Generated with Claude Code

cihan-gyk and others added 30 commits October 30, 2026 01:12
…iles, Help and add-on packs

Chat's Wave 1 tables in one PR (one DB PR per wave), behind CHAT_AGENTIC:
nothing reads or writes them while the flag is off. Tables, types and the
demo's coverage only; the code that uses them comes in the Wave 1 PRs.

- 00407: chat_conversations gets shared_at (Share with team: every member
  of the workspace reads it), last_read_at (unread results), deleted_at
  (Delete with Undo; deleted chats are hidden from every member) and a
  title search column; chat_messages gets context_json (what a person's
  message was scoped to) and a text search column. 'simple' text search,
  so a chat in any language is found. The author policy now leaves deleted
  chats out, and a shared policy reads shared ones.
- 00408: chat_user_prefs gets the rest of Settings › General and the
  one-time notices: rail_open, panel_size, default_mode, answer_language,
  notify_via, show_thought, panel_on_pages, focus_prompted_at,
  usage_notice_period, legacy_imported_at.
- 00409: chat_uploads and the private bucket chat-uploads: 10 MB a file,
  the composer's 11 types, 5 a message (a trigger backs the server's
  check), kept 90 days.
- 00410: chat_tool_cache (a chat's read results by tool and scope, server
  only) and each step's and model call's measure: latency, cache hit,
  truncation, result tokens on chat_run_steps (never granted to members),
  prompt cache read/write tokens and latency on the ledger.
- 00411: chat_files (filed deliverables and saved answers, the
  workspace's, kept a year, searchable by title, summary and tags),
  chat_file_task_links, chat_storage_usage kept by a trigger, and the
  private bucket chat-files.
- 00412: help_answer_cache and help_gaps (server only, no workspace or
  person ids).
- 00413: add_on_products seeded with the owner's packs (AI credits $10,
  $50, $250, $1,000 at half their price in budget, 12 months; storage
  +25/+100/+250 GB at $5/$15/$29 a month; $50 and +25 GB Most picked),
  add_on_purchases (Admins read), ai_credit_grants and storage_grants
  (server only), and prompt_improve_usage.grant_id.

Members only ever read; every write is the server's. Tool names, tool
results and dollars stay server only. web/src/types/supabase.ts carries
the new tables and columns; schema.test.ts checks the policies, the
server-only tables, the limits and the seeded packs from the SQL;
steps.test.ts keeps the step measure out of the member columns. The demo
coverage skips chat_files and chat_tool_cache (a person's own Chat work).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CHAT-06 items 30–42, the library W1-25's Download menu will call: an
answer rendered from its stored content_md on the server, with no model
call, nothing stored and no new dependency.

- lib/chat/export.ts reads the answer: Markdown to the Content Editor's
  export blocks (headings, paragraphs with bold, italics and links, lists,
  tables, quotes, code), its tables named by the heading above them, the
  formats Download offers (CSV and Excel only with a table), and the file
  name: the question's slug, or the chat title's past 60 characters, plus
  the day it was generated in its time zone. App links are made whole with
  the app's origin; javascript: and other links are dropped.
- lib/chat/export-file.ts writes the files: Markdown as UTF-8; Word with
  draft-export's docxBlocks; CSV (byte order mark, formula-safe cells),
  and a .zip of one CSV per table when there are several (fflate); Excel
  with one sheet per table and plain numbers as numbers
  (write-excel-file/node, as the traffic export).
- lib/chat/export-pdf.tsx writes the PDF with @react-pdf/renderer on the
  server, Inter embedded from public/fonts so Turkish letters print, links
  clickable, tables as tables, page numbers.
- Every file carries the answer's "Generated … · Data as of …" line
  (item 40): first line of Markdown, Word's and PDF's header and footer,
  the first row of a CSV and of each sheet. The caller words it from
  en.json, as the app shows it under the answer.
- draft-export: docxBlocks and docxDocument are exported, and
  docxDocument takes an optional header and footer line; the Content
  Editor's exports don't change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind CHAT_AGENTIC; with it off, the Agent page and its menu link stay as
they are today.

- /dashboard/agent and every path under it answer a 301 to the matching
  /dashboard/chat path, query kept, where the new Chat is on for the
  person's workspace (CHAT-01 item 2). Sent with no-store, so turning the
  flag off again takes effect at once. The sidebar and mobile menu link
  Chat straight to /dashboard/chat.
- The chats API (CHAT-01 §1-3, 7-8, 26): GET /api/chat/conversations lists
  the person's chats and the team's shared ones (or their archived ones),
  newest first, with each row's brand name, dot and live step in words, and
  the Chats / Archived counts; POST starts an empty chat; GET .../{id} opens
  one with its messages and steps; DELETE stops a running agent, then hides
  the chat for everyone; .../restore is the Undo (one minute); .../read
  marks its result read for the author. Refusals come back as values
  (ansvisor#1777), never thrown.
- A chat that isn't there, was deleted or isn't shared says "This chat isn't
  available." with New chat (item 26); opening one marks it read.
- The engine and access requests read chats with the service role, so they
  now leave deleted chats out too (ansvisor#1812 note).
- Help: a "chat" area and its first article (approved: false).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind CHAT_AGENTIC; with it off the Chat pages have no frame, as today.

- Every Chat route now sits in a shell (CHAT-01 items 5, 9a-9f; CHAT-23
  G1): the 256px chat menu beside the page and a 52px header with the
  open chat's title and status pill, and the runs tray.
- The menu, top to bottom: the toggle and New chat (Ctrl+Shift+O / ⌘⇧O);
  Menu with Home and the count of what needs the person; Governance with
  Activity, What Chat can do and Tool policy (the governance mockup's
  menu); Agents at work (needs you, running, unread results: three rows,
  See all / Show less, the dots' legend); Chats with its count, Pinned,
  Today, Yesterday, Previous 7 days, Previous 30 days, then by month, in
  the person's own time zone. Rows show the dot, the title (bold while a
  result is unread), the live step or the result's time, or the brand, and
  a teammate's initials on a shared chat. Items whose pages aren't built
  yet stay out (Inbox, Settings, Skills, Integrations, Scheduled, Files,
  Search, All chats, Archived).
- The toggle and Ctrl+\ (⌘\) hide or show the menu and keep the choice on
  the person for every device (chat_user_prefs.menu_open, a server action
  that answers as a value, ansvisor#1777). Hidden, the header starts with a strip:
  toggle, New chat, runs pill. Below 1100px the menu is a drawer that
  leaves the saved choice alone. Ctrl+B stays Bold.
- The list is read from the chats API, again on each page change, every
  5 s while a chat works or waits and every 30 s otherwise.
- Thin, quiet scrollbars for Chat's lists (chat-scroll).
- Help: the chat menu and how to hide it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ete with Undo

Behind CHAT_AGENTIC, like the rest of the Chat shell.

- PATCH /api/chat/conversations/{id} `{ pinned?, title?, shared?,
  archived? }`: the author's own chat only (else 404), a trimmed title of
  1 to 200 characters, answered as a value (ansvisor#1777).
- Each chat row's ⋯ (CHAT-23 chatMenu.rowMore, G9), on hover and focus:
  Open, Open in new window, then for the author Pin / Unpin, Rename,
  Share with team / Stop sharing, Archive, and Delete for the author or an
  Admin on a shared chat. A teammate's shared chat only opens.
- The open chat's ⋯ in the header (G10): Chat settings, Open in new
  window, Pin, Rename (in the title), Share with team, Export chat, Activity
  log, Archive, Delete. Export chat is shown disabled ("Coming soon"):
  wiring it to the answer exports is left to W1-25.
- Rename edits the name in place, in the row or the header: Enter or
  clicking away saves, Esc cancels; double-clicking a row's title starts it.
- Every change shows at once and is then sent; a refused one is put back
  with "Couldn't save that". Archive's toast and Delete's (10 s) carry
  Undo; Delete asks first ("Delete this chat?", focus on Cancel, a red
  Delete), stops a running agent, and leaves the open chat for Chat Home.
- A pinned chat shows the pin where its dot is.
- Help: managing and sharing a chat.

Split view, Pause / Stop run, Schedule this and Save as agent come with
their pages (Wave 2 and 4).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…heir initials

Other members' profiles are hidden from the person by their policy, so a
teammate's shared chat showed no initials. Read with the service role,
kept to the person's workspace, for the name only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Behind CHAT_AGENTIC, like the rest of the Chat shell.

- Chat Home (CHAT-01 items 10-12, mockup #s-home): "Good morning /
  afternoon / evening, {first name}" by the person's own clock (switching
  at 12:00 and 18:00; no name, no comma), then one line: "Your agents
  worked while you were away. N things need you." linking to the Inbox, or
  "All caught up.". The composer stays below it.
- The Action Center line (item 12, CHAT-09 item 3): "N Action Center tasks
  are due this week" (singular at 1, hidden at 0): the active brand's open
  actions due by Sunday, overdue ones included, read as the person by a
  server action that answers as a value (ansvisor#1777). Complete with Chat asks
  Chat to complete this week's tasks in a new chat and opens it while the
  run goes on.
- The Inbox at /dashboard/chat/inbox (mockup #s-inbox): what needs the
  person (Review), what runs (its progress, Watch) and unread results
  (Open), with "1 needs you · 1 running · 1 done today"; a row opens its
  chat; one line when empty.
- The chat menu gets Inbox, with its count and an amber dot while
  something needs the person (also beside Menu when folded), and the
  collapsed strip gets an Inbox button, as in the mockup.
- Help: Chat Home and the Inbox.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… and a read-only view

Chat Wave 1, W1-10 (CHAT-02, agentic update). A copy of the mockup's
composer (compHTML), as components to be wired into the Chat pages by the
shell (W1-01).

- ChatComposer: the box, a toolbar with the run mode and Send, and the line
  under it. Variants: home (2 rows), dock and panel (1 row). The box grows
  to 240px, then scrolls.
- Enter sends, Shift+Enter adds a line. Enter during an input method's
  composition or on a touch screen is the box's own (composerKeyAction).
  Send is off for an empty box.
- While a run answers, Send is Stop, and Esc stops too. The box steers:
  "Steer while I work…". Enter stops the run, its done steps kept, and
  sends the text as the next message (onSteer; decided 2026-10-30). The
  line under reads "Enter stops this run and sends your message". A page
  without steering keeps the text until the run ends.
- ModeSwitch: Ask me first · Auto, ask before changes · Full auto, each pick
  with the mockup's toast. Full auto below Growth is locked: "Needs Growth",
  and it can't be picked.
- Analysts and Agency partners read only: no mode switch, a "Read-only ·
  Analyst" link to Your access, and "@ data · read-only" under the box.
- The model button reads "Auto · Haiku reads, Sonnet writes". Slots for
  the + / @ tools (W1-12) and the usage meter (W1-23).
- The Chat pieces preview gets a Composer section: home, a dock with a
  pretend run, and an Analyst's panel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…poser

Chat Wave 1, W1-11 (CHAT-02 items 5–10c), on the composer (W1-10).

- Context chips above the text: what Chat looks at, by name ("Ansvisor",
  "Last 30 days"), never an ID. A label over 28 characters is cut, with the
  whole name in its tooltip. × asks the page to drop it for the chat
  (onRemoveChip). A send or a steer carries the chips left
  (onSend(text, { context })).
- One ghost suggestion in the empty box, dim, with a Tab key hint. Tab, or a
  click on it, makes it the text with the cursor after it. Typing replaces
  it, and it comes back when the box is empty again. It never sends by
  itself: while only it shows, Enter does nothing and Send stays off. With
  text, Tab moves on as usual. No ghost while a run answers. The page picks
  the suggestion: the variant's starter, then a clear follow-up, and a READ
  one for Analysts and Agency partners.
- The line under reads "Tab to accept · / skills · @ data" while the ghost
  shows.
- The preview's composers get the mockup's chips and starters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chat Wave 1, W1-12 (CHAT-02 items 11–17, agentic update; mockup #slash,
#atmenu, #plusmenu), on the composer's chips (W1-11). Menus open above the
box: ↑ ↓ move, Enter picks, Esc closes and keeps the text, and a click
outside closes them.

- /: typed first in an empty box, or from the / button. It lists Wave 1's
  shortcuts, which start a message: /analyze "Analyze", /report "Create a
  report on", /create "Create content for". Typing filters them by command
  or a word of the name. From the button, the box's text stays after the
  starter. Analysts and Agency partners have no / (as the mockup). Skills
  join the menu in Wave 2.
- @: typed at the start of a word, or from the @ button at the cursor. It
  references data: the page's own charts and metrics first (references,
  for W1-08), then the brand's matches (searchReferences), up to eight. A
  pick leaves the "@…" text and shows as a chip by name. × takes it off,
  and the send carries it (references: type, id, label, scope). No ID
  shows.
- searchChatReferences (server action, CHAT_AGENTIC): the brand's tracked
  prompts, its pages and its open Action Center tasks that match, a source
  at a time. Read with the person's session; site_pages isn't in the
  generated types, so it is read with the service role for a brand the
  session can read. Template tasks are named from their keys. A search is
  made safe for PostgREST's filters. It answers { ok, failure } and never
  throws (ansvisor#1777).
- +: Attach files when the page uploads (onAttach, W1-13). Connect a tool:
  Settings › Integrations for an Admin; for others, "Ask your Admin to
  connect" sends one access request (B2). Read a page and Create an image
  stay hidden until their waves.
- The preview's composers reference the mockup's chart, metric, table,
  page and task.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Data used and its stamp

Chat Wave 1, W1-14 (CHAT-03 items 12a–14, the v2 timestamps), on the
composer's menus (W1-12). RunAnswer draws an answer from its run's events,
with the shared pieces (D1/D2):

- The agent works beside it (AgentAvatar), waits on the person, or is still.
- One status line, updated in place, in the running step's words:
  "Reading Citations…", "Opening ansvisor.com/pricing…", "Checking
  facts…". With no step running, "Writing the answer…" while text streams,
  else "Thinking…". "Reconnecting…" when the stream dropped.
- The steps under their header (RunSteps). Each step done, thinking left
  out, is a ✓ chip with its rows, and a click shows its detail. W1-21's
  "Checked facts" step (ansvisor#1822) is one of them.
- The answer streams in (Markdown).
- "Data used": one chip per source a read step read, with its largest row
  count, and per page a step opened. Skills, thinking, checks and failed
  reads are no source. The header counts these chips as its sources.
- "Generated Oct 30, 2026 · 09:14 · Data as of …" in the person's time zone,
  the GMT offset in its tooltip.
- What follows (next moves, the answer's actions) fades in once the run is
  done, and not at all with reduced motion.
- run-view.ts holds the status line, chips and Data used, from the steps
  alone.
- The Chat pieces preview plays the mockup's answer a step at a time ("Live
  answer"); its counts take the new pieces in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… days

Chat Wave 1, W1-13 (CHAT-02 items 18–22, 00409), on the live answer
(W1-14), behind CHAT_AGENTIC.

- The composer attaches files from + Attach files, a drop or a paste
  (uploader prop). Each file is a chip: type tag, name, "Uploading…", ×.
  Under the box: "This file type isn't supported.", "Files must be 10 MB or
  smaller.", "You can attach up to 5 files.", or "Upload failed." with
  Retry. Send waits while a file goes up, and a send carries the ready
  files' ids (ComposerSend.attachments).
- lib/chat/uploads.ts holds the rules the bucket and table also hold: the
  listed types (a type from the extension when the browser gives none),
  10 MB, 5 files.
- Server actions (chat-uploads.ts), which answer { ok, failure } and never
  throw:
  - prepareChatUpload checks the type, the size, Chat on, an active plan
    and the person's own chat. It keeps a pending row
    ({organization_id}/{id}) and gives a one-time upload address.
  - finishChatUpload marks the file ready once it is there.
  - removeChatUpload takes a draft's file and row away.
  - Named in the subscription guard's open actions with why.
- lib/chat/upload-client.ts sends the file to its address. A failure takes
  its row back, so Retry starts over.
- startChatRun takes attachmentIds (up to 5). Each must be the person's
  own, ready and not sent with another message, checked before anything is
  kept; then the files are linked to the message and its chat. Reading
  attachments in the run is CHAT-04's work.
- Server: sweepExpiredChatUploads deletes each attachment past its 90 days,
  file first, then row, in the daily run.
- The preview's home composer attaches files that are "up" after a moment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chat Wave 1: lane A's pages (W1-01…05) with lane B's composer and answer
(W1-10…14), merged and joined. The engine's test page goes.

- ChatThreadView (components/chat) carries the test view's run handling:
  send, streaming, reconnecting from the last event, Approve/Skip and
  Stop. ChatComposer and RunAnswer now draw it, with D2's approval and
  denial cards under each answer. Chat Home uses the home composer (2
  rows); an open chat docks it under the messages.
- The composer starts in the person's default mode (chat_user_prefs; a
  saved Full auto the plan no longer opens starts as Auto). Full auto opens
  as the plan facts say (chatComposerSetup).
- Steering stops the run, then sends the text as the next message
  (decided 2026-10-30).
- @ searches the chat's brand (searchChatReferences). Files go up with
  uploadChatFile and go with the message as attachmentIds.
- A teammate's shared chat is read only: the box says so, with Start your
  own chat (loadChatThread's new `mine`).
- The test page's title and box go, with their unused chatPage strings.
- Help: chat.md covers asking, the modes, Stop and steering, shortcuts
  and your data, attaching files, and watching the work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d pause at the limit

Chat Wave 1, W1-23 (CHAT-04 items 15–17; mockup usgHTML, limHTML), on the
wiring (ddbebf3).

- The composer's line shows the AI usage meter: the header's meter and
  its popover, drawn small by class (ComposerUsageMeter). It is amber from
  80% and red once used up. The free trial shows the meter's own words.
- From 80%, one amber line above the composer, once a period. × closes it
  until the next period (localStorage, by the period's mark).
- At the limit, Chat pauses (chatAtCap: used up, and Chat draws on the
  allowance). The red AI usage banner shows above the composer, with
  where to get more, or "ask an Admin" for other members. The box is off:
  "AI limit reached · models on your own key still work", or "Your trial
  AI limit is used up". On the workspace's own key Chat keeps working.
- A teammate's shared chat shows none of it.
- Help: chat.md's AI usage section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a person's first visit to Chat (CHAT_AGENTIC on), their Agent Chat
conversations in their workspace are copied into chat_conversations and
chat_messages with the same ids, so old chats sit in Recents by their
last message and open at /dashboard/chat/{id}. Questions and answers in
words are kept; tool rows, tool-only answers and empty conversations are
not. The default title "New conversation" becomes "New chat".

Once per person: chat_user_prefs.legacy_imported_at (00408) is set only
after a complete copy, so a copy that failed is tried again next visit.
Already-copied ids are left alone (upsert ignoring duplicates), so two
visits at once or a second run change nothing. It never throws and never
keeps Chat from opening; the old tables are only read.

The test fake learns upsert, range and ordering by several columns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Search chats (CHAT-01 item 6; CHAT-23 G2): GET
/api/chat/conversations/search finds the person's chats and the team's
shared ones whose title or messages hold every word typed (00407's
search_tsv, 'simple' configuration, words as prefixes), newest first;
`view=archived` searches their own archived chats. Input is cut to
letters and digits, so no operator reaches Postgres.

- The chat menu gets the Search chats field under Chats: typing lists the
  matches in place of the days, with "No chats match." and Clear filters.
  All chats · {n} › and Archived · {n} › close the list.
- Ctrl K (⌘K) opens the palette (mockup #msearch) under Search chats, or
  under the strip's new Search button while the menu is hidden; again
  closes it. New chat, the latest or matching chats and the Chat pages
  by name; arrows and Enter, Enter opens the first match or a new chat.
- All chats (/dashboard/chat/all, mockup #s-allchats): Active and Archived
  tabs with counts, search over names and messages, filters All, Running,
  Needs you, Done, Mine and Team, and Archive selected / Unarchive
  selected for the person's own chats, with one toast.
- Archive's toast now says "Archived · find it in All chats › Archived";
  it is brought back from All chats › Archived (CHAT-23 chat.archive).

Help: new help/chat/all-chats.md, chat.md updated. Popover passes an
anchor through; the test fake learns textSearch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l beside Chat

Chat Settings › General (/dashboard/chat/settings, mockup #s-settings;
CHAT-23 chatSettings.*): default mode, answer language, notifications,
"Thought for N s" and Ask Chat on every page, kept on chat_user_prefs
(00408) at once and put back when refused. A new server action,
saveChatGeneralSettings, checks each change against the person: no mode
for Analysts and Agency partners, Full auto only on a paid Growth plan
and where the Admin leaves it on for members (it says why when locked),
Inbox + Slack only once Slack connects (not yet). It never throws (ansvisor#1777).
Settings sits in the chat menu under Inbox with the month's AI usage in
percent, in the Ctrl K palette, and in the header ⋯ (Chat settings).

Navigation (CHAT-01 4b, 4e, 4f; CHAT-23 nav.*, rail.toggle):
- Inbox, All chats, Activity and What Chat can do show ← Back to Chat
  and the "Chat › {page}" breadcrumb; Back to Chat returns to the last
  conversation open in this tab, or Chat Home. Settings shows its name.
- Esc closes only the topmost layer and never navigates (covered by tests).
- On Chat's screens the app sidebar is the rail; the logo expands and
  collapses it, kept on the person (chat_user_prefs.rail_open) through a
  new saveChatRailOpen action. Elsewhere, and with the flag off, the
  sidebar keeps its own pinned state and the logo still goes home.

Help: new help/chat/chat-settings.md; chat.md gets "Move around Chat".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Ctrl J

Ask Chat sits at the top right of every page header (after the AI usage
meter) and Ctrl J / ⌘J opens and closes the panel from anywhere, a page
input included; on Chat's routes the key focuses the composer, and the
Content Editor is left to its own Chat. The panel hosts the chat view
(panel variant, the page's address stays) with New chat, History,
Compact / Wide / Full screen and Close; from 1100px a compact or wide
panel pushes the page aside, narrower and in full screen it overlays,
below 760px it is full width with ← back to the page. It greets the
person when empty and reopens its last chat used in the last 30 minutes.
The layout reads panel_on_pages and panel_size (00408); the panel keeps
its last size on the person.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…workspace

Creating an empty chat, deleting, restoring and marking your own chat read
start no cost; a chat's first message is a run, which the engine refuses
with 402. The read-only coverage test lists them with that reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n on a read-only workspace

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk and others added 14 commits October 30, 2026 18:54
Chat › Agents (CHAT-21 §B, §C; governance mockup #g-agents, #g-agent;
CHAT-27 items 24–25), on the agents API (W2-13):

- /dashboard/chat/agents: tabs Mine · Workspace · Paused · Archived with
  their counts, search by name or skill, and one card per agent with its
  status dot, skills and mode, triggers in short, next run, scope, last
  run, 30-day outcomes and "AI use · 30 days" as a share of the monthly
  limit with a thin bar and its runs, average and cap on hover. New agent
  (links to W2-15's create page), Run now and Pause / Resume for Admins
  and Managers; Analysts and Agency partners get a read-only line with
  Ask your Admin.
- /dashboard/chat/agents/{id}: name, state, owner, visibility and This
  period (with the monthly cap); only the buttons `can` allows (Activate,
  Pause, Resume, Restore, Run now, Open run, and Duplicate, Take over,
  Archive under ⋯); skills, mode, connections and model; triggers with
  their next run; the last 50 runs with their AI use against their cap
  ("3.2% of 10%"), state, trigger and brand, opening the run's chat; and
  Access, Scope and AI use beside them. Shares only, never dollars.
- A refused button shows the server's out-of-permission answer
  (DenialCard), a read-only workspace the upgrade dialog, a plain refusal
  its words in a toast; a failed read a plain line with Retry.
- Agents in the chat menu (with "New" until first opened), the Ctrl K
  palette and the breadcrumb ("Chat › Agents › {name}").
- Not found while CHAT_AGENTIC is off for the workspace.
- Help: help/chat/agents.md (approved: false).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om the server, races (W2-14)

- A schedule's next run and last fire are written on its own clock (its
  RRULE's time zone), as its title reads: "Every Mon 09:00 · Next run Mon
  09:00 · Europe/Istanbul time", in the list, the detail and the
  Activate toast.
- The list's Run now and Pause / Resume follow the server: each row now
  carries `can: { run, pause, resume }` from abilitiesOf, so a Manager no
  longer sees Resume while Settings › Chat keeps workspace agents to
  Admins. rowAbilities is gone.
- Races: the list reads the tab shown when a button answers, not the one
  clicked from; the detail drops an older read that comes back after a
  button's answer; Archive reads the runs again, so cancelled ones aren't
  left Queued.
- A paused, draft or archived agent's triggers say they don't fire,
  with no Next run.
- A run whose chat was deleted has no chat to open; runs show "—" for AI
  use where there is no AI limit to share; the out-of-permission answer
  is an alert scrolled into view; the trigger switch names its trigger;
  the run table has table, row, columnheader and cell roles; a search
  takes "/winback"; unused messages removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1867

# Conflicts:
#	web/src/components/chat/chat-shell.tsx
…hived one (W2-15)

Chat › Agents' create and edit flow (CHAT-21 §D, §C item 14; governance
mockup #g-agent-new; CHAT-27 item 19), on the agents API (W2-13):

- /dashboard/chat/agents/new: Skill · Trigger · Mode & approvals ·
  Connections & model, Back / Next and the live summary on the right.
  Step 1 picks the primary skill (Ansvisor skills, with the connections
  each uses), up to 2 follow-on skills and optional instructions. Step 2
  holds 1–5 triggers (Schedule, Signal created, KPI changed; a kept watch
  rule stays), each with its next run on its own clock or "Fires when …",
  Manual for none, and the scope: brands, platforms, topics, prompt tags
  and URLs. Step 3 the modes, Full auto locked below Growth with Upgrade
  and hidden when Settings › Chat turned it off, and what each kind of
  step does in the mode. Step 4 the connections (Required by the skill,
  Optional switches), the model and whose key pays, then the name (from
  the skill, §O), sharing, Max per run (Settings › Chat's default, 1–50%)
  and an Admin's monthly cap. Save as draft and Turn on.
- Each step is checked before the next opens; the server's refusals land
  on their step (a name taken, a one-off in the past, the plan's engines,
  Full auto, sharing, the plan's active agents, a save over another with
  Reload). A refused Turn on keeps the draft and turns it on next time.
- /dashboard/chat/agents/{id}/edit: the same steps filled with the
  current version; Save changes sends a PATCH of only what changed (a new
  version when what it does changed). Edit on the detail when `can.edit`.
- Delete on an archived agent's ⋯ when `can.delete`, after a dialog; then
  back to Agents. Refusals as values carry `asked`, so a denial finds its
  step.
- Analysts, Agency partners and a Manager on another's agent get the
  read-only line with Ask your Admin; Managers can't pick Workspace while
  Settings › Chat keeps workspace agents to Admins. Not found while
  CHAT_AGENTIC is off. Breadcrumb "Chat › Agents › New agent".
- Help: help/chat/agents.md gets "Create an agent" and "Edit or delete an
  agent" (approved: false).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… can open it

The run history and Open run linked every run's chat. The chat page opens
only the person's own chats and shared ones, so anyone else following the
link got "This chat isn't available". A run's chat is now given only to
its author, or to everyone once it is shared, and is read within the
workspace.
…ocus and keyboard (W2-15)

- Names: a name the person didn't type goes as the skill's title with
  autoName, and the server names it by §O against every agent of the
  workspace (private ones included). A name taken by an agent the person
  can't see is refused without saying it ("That name is taken in this
  workspace"). §O's rule moves to agent-rules.ts.
- Concurrent edits: the form sends the updatedAt it opened; the server
  refuses a save over any other save since (a name, sharing, a cap or
  triggers, which make no new version), claims the row by updated_at
  before writing, and moves updated_at on a triggers-only save too.
- Tags and URLs split on new lines only: a comma stays in its line.
- Keyboard and screen readers: Next, Save changes, Save as draft and Turn
  on are separate (keyed) buttons, so Enter pressed again can't save past
  the last step; each step opens on its title (focused, read out); a
  stopped step or a refusal puts the focus on the first problem or the
  refusal; one alert a step, field problems tied to their fields with
  aria-describedby; radio groups move with the arrow keys (roving
  tabindex); the % after Max per run is read from its note.
- Manual is its own always-on line among the triggers, no longer an
  option that removes the selected trigger; a trigger switched to another
  kind and back keeps what it had.
- A new draft's address becomes its Edit (history.replaceState): a reload
  opens it instead of making a second agent.
- Help: Managers can't change their workspace agents while workspace
  agents are kept to Admins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	help/chat/agents.md
#	help/chat/chat.md
#	help/chat/files.md
#	server/src/lib/chat-budget.test.js
#	supabase/schema.sql
#	web/messages/en.json
#	web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.test.ts
#	web/src/app/[locale]/(dashboard)/dashboard/chat/_chat-page-access.ts
#	web/src/app/[locale]/(dashboard)/dashboard/chat/agents/page.test.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/chat/layout.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx
#	web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
#	web/src/app/[locale]/(dashboard)/layout.test.tsx
#	web/src/app/[locale]/(dashboard)/layout.tsx
#	web/src/components/ai-usage/ai-usage-meter.tsx
#	web/src/components/chat/agents/agent-detail.test.tsx
#	web/src/components/chat/agents/agent-detail.tsx
#	web/src/components/chat/agents/agent-requests.ts
#	web/src/components/chat/agents/use-agent-actions.ts
#	web/src/components/chat/chat-files.test.tsx
#	web/src/components/chat/chat-files.tsx
#	web/src/components/chat/chat-menu.test.tsx
#	web/src/components/chat/chat-menus.tsx
#	web/src/components/chat/chat-shell.tsx
#	web/src/components/chat/chat-thread-view.test.tsx
#	web/src/components/chat/chat-thread-view.tsx
#	web/src/components/chat/chat-usage.test.tsx
#	web/src/components/chat/chat-usage.tsx
#	web/src/components/chat/composer/chat-composer.test.tsx
#	web/src/components/chat/composer/chat-composer.tsx
#	web/src/components/chat/composer/composer-keys.ts
#	web/src/components/chat/run/answer-actions.test.tsx
#	web/src/components/chat/run/answer-actions.tsx
#	web/src/components/chat/run/deliverable-card.test.tsx
#	web/src/components/chat/run/deliverable-card.tsx
#	web/src/components/chat/run/run-answer.test.tsx
#	web/src/components/chat/run/run-answer.tsx
#	web/src/components/chat/run/run-view.ts
#	web/src/lib/chat/agent-api.ts
#	web/src/lib/chat/agent-rules.ts
#	web/src/lib/chat/agents.test.ts
#	web/src/lib/chat/agents.ts
#	web/src/lib/chat/engine.test.ts
#	web/src/lib/chat/engine.ts
#	web/src/lib/chat/key.test.ts
#	web/src/lib/chat/key.ts
#	web/src/lib/chat/registry/define-tool.ts
#	web/src/lib/chat/run-state.test.tsx
#	web/src/lib/chat/run-state.ts
#	web/src/lib/chat/thread.ts
…e made no new version

Edit's form was keyed by the agent's version only. A rename, sharing, a cap,
triggers or Pause move updated_at but not the version, so after the
version_conflict card's Reload the page re-rendered with the new agent but
the form kept the old one, and the next save was refused again. The key now
includes updatedAt.
…and let the groups fold

Chat leaves Execution for a group of its own at the top. Competitors moves
from Analytics to right under Reports, so Prompts follows Brand Visibility.
Execution and Analytics fold under their titles: open by default, kept in
this browser, and opened again on one of their pages. Menu access lists
Chat above the headings, and the help and guides say where things are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Chat › Agents becomes Agent Center at /dashboard/agents: its own page, like
Action Center, right under Chat on the left menu, no longer inside Chat's
frame. The tabs and ready-made agents come in PR B.

- The list, an agent's page, its Edit and New agent move to
  /dashboard/agents/**; the old /dashboard/chat/agents/** addresses answer
  a permanent redirect to the same page there, query kept (as Topics'
  move did, in the old route's page). The /api/chat/agents API stays.
- Same guards as Chat's pages: only with CHAT_AGENTIC on for the
  workspace (chatPageOpen, otherwise not found); the dashboard layout's
  read-only state, roles and menu access apply as before.
- Menu: Agent Center (Bot icon) under Chat, gated by the same plan
  feature (ai_agent) and shown only with the new Chat on
  (NavItem.requiresChatAgentic). Menu access: section "agents", in the
  work areas Chat is in, every role sees it until hidden; while the new
  Chat is off it is in no menu-access list or count.
- Chat's menu and Ctrl K palette link out to Agent Center; its breadcrumb
  for agent pages and chat-crumb go; an agent's page gets Back to Agent
  Center. Chat's Go to a page opens it ("agents", "my agents").
- en.json: the place is "Agent Center"; nav.agentCenter added.
- Help: agents (name, place, route), menu access and work areas; the
  menu-access guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s, and show it in onboarding

Follow-ups to moving Agents into Agent Center:

- Onboarding's "What do you work on?" step reads whether the new Chat is
  on for the workspace (CHAT_AGENTIC), as the welcome page does, through
  a layout for the wizard: Agent Center shows there where the menu will
  have it, beside Chat.
- The chat menu's "New" beside Agent Center goes once any Agent Center
  page opens, from the left menu, the chat menu or a link: its layout
  marks it seen (agents-seen, the same browser key as before).
- Edit names the agent again in its title ("Edit · Citation win-back"),
  now that Chat's breadcrumb no longer does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 7c58818.

Approve preview

# Conflicts:
#	docs/guides/menu-access.mdx
#	help/chat/agents.md
#	help/settings/menu-access.md
#	help/settings/work-areas.md
#	web/messages/en.json
#	web/src/app/[locale]/(dashboard)/dashboard/chat/agents/page.test.tsx
#	web/src/components/chat/agents/agent-detail.test.tsx
#	web/src/components/chat/agents/agent-detail.tsx
#	web/src/components/chat/agents/agent-form.test.tsx
#	web/src/components/chat/agents/agent-form.tsx
#	web/src/components/chat/chat-menu.test.tsx
#	web/src/components/chat/chat-shell.tsx
#	web/src/components/layout/sidebar.test.tsx
#	web/src/components/settings/menu-access-section.test.tsx
#	web/src/components/settings/menu-access-section.tsx
#	web/src/config/dashboard.ts
#	web/src/lib/dashboard-navigation.test.ts
#	web/src/lib/menu-access.test.ts
Merging main into the branch adds chat/agents/new and chat/agents/[id]/edit
again (main has them, the branch moved them), next to the optional
catch-all that redirects the old addresses. A more specific page wins over
the catch-all, so /dashboard/chat/agents/new and an agent's old Edit link
would open the old page inside Chat instead of Agent Center. A test now
keeps the old folder to the redirect alone.
The agent runner (main, W2-16) gives each run's scope the page it is about,
/dashboard/chat/agents, which this branch moves to /dashboard/agents. The
skill picker reads that route with the question, so it now reads the page's
own address.
gkhngyk
gkhngyk previously approved these changes Oct 31, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, with 2 fixes on top: commit 55ade70 on this branch (your head, with main merged in, then the two fixes).

Merging main. The branch conflicts with main in 18 files. In 16 of them main's copy is the same as your base (#1869 + #1887 as they were squashed), so your side is the right one. en.json and help/chat/agents.md really do need both sides:

  • en.json: keep your titleEdit: "Edit · {name}" and back: "Back to Agent Center". Drop main's crumbEdit, which nothing reads any more.
  • help/chat/agents.md: keep your title, route and Agent Center wording, and add main's #1874 parts. That means the new keywords and sources, "When an agent runs by itself" and "How a run works", and the opening line without "when a KPI changes", because KPI triggers don't start runs yet.

Fixes

  1. 928e76713: removes the old pages that the merge brings back. The merge base is older than #1869, so a plain merge of main re-adds chat/agents/new/page.tsx and chat/agents/[id]/edit/page.tsx beside your chat/agents/[[...path]] redirect. A more specific page wins over the optional catch-all, so /dashboard/chat/agents/new?skill=… and an agent's old Edit link would open the old page inside Chat instead of redirecting. Git raises no conflict for this. The redirect test now also checks that the old folder holds only the redirect.
  2. 55ade704b: the agent runner from main (#1874, agent-driver.ts) still gave each run's scope route: '/dashboard/chat/agents'. The skill picker reads that route along with the question, so it now says /dashboard/agents. The driver test checks it.

What I checked

  • Old addresses: I searched web, server, help, docs and migrations for links to the old paths, and none are left. That covers the chat menu, the Ctrl K palette, "Go to a page", agent cards and detail, the form's Back and Save, and Duplicate. A run's chat link still goes to /dashboard/chat/{id}. The redirect is permanent and keeps every query value. /dashboard/agent/... (the old Agent page) still goes only to /dashboard/chat, because its regex doesn't match /agents.
  • Flag off: all four pages call chatPageOpen(), so they return not found. The item is off the sidebar, the mobile menu, menu access, People, work areas, the welcome page and onboarding (menuSectionsFor / requiresChatAgentic).
  • Menu access: agents comes from dashboardNav, so role hides, person shown/hidden and hiddenByAdmin all cover it, and 00374 has no list of sections to update. The page still opens from a link, as it should, since menu access only hides.
  • Roles: no guard was lost in the move. Edit and New still go through readAgentEdit / readAgentFormSetup and can.edit, the detail still takes its buttons from the server, and the API is unchanged. That means the subscription-guard and demo-gate lists don't need changes.
  • Outside Chat's frame: the agents components use no Chat context. The brand switcher, plan, flags and side panel come from the dashboard layout. The sidebar isn't drawn as the Chat rail on Agent Center, and Chat isn't highlighted there.
  • Client bundle: the new client files (agents-seen, useMenuSections) import nothing that runs only on the server.

Tests: vitest on chat (components and lib), help, layout, settings, onboarding, providers, menu-access, dashboard-navigation, subscription-guard-coverage, demo-gate-routes, billing, plan-row and the agents, chat and onboarding pages: 167 files, 2148 tests. Two failed only from the run's load, and both pass when run alone (engine.test.ts timed out at 5 s, and the PDF time limit in export-file.test.ts). tsc --noEmit is clean, and eslint and prettier are clean on the changed files. next build --webpack with dummy env builds, with no route conflicts.

Follow-ups (not blocking)

  • #1895 adds two new links to /dashboard/chat/agents/new?skill=… in run-agent-picker.tsx and its test, which only work through the redirect. It also brings back route: '/dashboard/chat/agents' in agent-driver.ts. Point both at /dashboard/agents when #1895 is rebased.
  • The onboarding dashboard preview calls shouldShowDashboardNavItem without chatAgentic, so it never shows Agent Center, even with Chat on. The wizard now has ChatAgenticProvider, so it could pass it.
  • On the demo brand, Chat shows "Soon" but Agent Center doesn't. If it should match, it needs the same badge.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging in order with the other approved PRs. This head merges current main; its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build.

@gkhngyk
gkhngyk merged commit c78860b into ansvisor:main Oct 31, 2026
5 of 6 checks passed
gkhngyk pushed a commit that referenced this pull request Nov 1, 2026
…nalytics work areas (#1947)

* fix(menu): show Agent Center in the AEO/GEO & Audit and Developers work areas

Agent Center was only in the six work areas that have Chat (#1899), so
people who picked AEO/GEO & Audit or Developers lost it from their menu.
Both areas now keep it, right after Action Center, without Chat: the
product owner approved them on 2026-11-01. Chat stays out of them.

The mapping is code (WORK_AREAS in menu-access.ts), not the database:
no migration. Everything reading it follows: the left menu, Settings ›
Account › Your work areas, Settings › Menu access's ready-made sets, and
the "What do you work on?" step in onboarding and on the welcome page.
Agent Center still shows only with the new Chat on.

Tests: the rule is now "after Chat wherever Chat is; AEO/GEO & Audit and
Developers without Chat"; the area with neither is Analytics. Help: work
areas and menu access articles, and the menu access guide's table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(menu): show Agent Center in the Analytics work area too

The product owner asked (2026-11-01) for Agent Center in Analytics as
well, right after Action Center and without Chat, as AEO/GEO & Audit and
Developers have it. Every work area now has Agent Center, so the tests
that relied on an area without it check an admin-hidden Agent Center
instead. Help (work areas, menu access) and the menu access guide's table
follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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