SurfSense/surfsense_web/components/tool-ui
CREDO23 2e572d7818 feat(web): create_automation HITL approval card in chat
Closes the create loop in chat: the agent describes user intent → the
drafter sub-LLM produces an AutomationCreate JSON → this card surfaces
a structured preview → approve persists; reject cancels. Edits flow
through chat refinement (re-call with a refined intent), not in-card,
so the card stays simple and the multi-turn checkpointer carries the
context.

Tool UI (components/tool-ui/automation/):
- create-automation.tsx — entry dispatcher + ApprovalCard chrome
  (pending/processing/complete/rejected via useHitlPhase) + SavedCard
  (links to the detail page) + InvalidCard (lists drafter validation
  issues) + ErrorCard (verbatim message). Rejection result is hidden
  because the approval card itself shows the rejected phase inline.
- automation-draft-preview.tsx — structured preview body: name +
  description + goal, triggers (humanised cron + tz + static-input
  keys), plan steps (step_id → action), and a collapsible raw JSON
  for power users.

Wiring:
- components/tool-ui/index.ts — re-export.
- features/chat-messages/timeline/tool-registry/registry.ts —
  register create_automation → CreateAutomationToolUI (dynamic import,
  same pattern as other connector tools).
- contracts/enums/toolIcons.tsx — Workflow icon + "Create automation"
  display name so fallback chrome (and timeline headers) are honest.

Shared util:
- lib/automations/describe-cron.ts — lifted from the route slice's
  lib/ folder since both the dashboard slice and the new approval card
  now render schedule descriptions. Slice imports updated; the now-
  empty slice lib/ folder is gone.

Backend prompt fragments:
- main_agent/system_prompt/.../create_automation/description.md and
  the tool's docstring no longer promise in-card edits. They make the
  refinement path explicit: if the user wants changes after seeing the
  draft, they reply in chat and the agent calls the tool again with a
  refined intent.

v1 deliberately excludes:
- In-card edit form / right-side edit panel — defer until we see real
  demand. The chat refinement loop covers the common case.
- approve_always / persistent allow rules — automations are a single
  artifact, not a repeated mutation, so the "trust this kind of call"
  affordance doesn't apply.
2026-05-28 01:32:04 +02:00
..
automation feat(web): create_automation HITL approval card in chat 2026-05-28 01:32:04 +02:00
citation chore: ran linting 2026-05-19 21:02:07 +05:30
confluence tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
dropbox tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
gmail tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
google-calendar tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
google-drive tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
image perf: optimize next/image sizes with dynamic maxWidth (#1089) 2026-04-14 17:58:45 +09:30
jira tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
linear tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
notion tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
onedrive tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
plan refactor: update UI components to enhance hover effects and color consistency 2026-05-13 23:53:09 +05:30
shared chore: linting 2026-03-31 21:42:03 -07:00
video-presentation refactor(env): replace inline process.env reads with BACKEND_URL in tool-ui generators 2026-05-20 03:38:32 +05:30
audio.tsx fix: replace transition-all with specific transition properties for better performance 2026-04-08 05:36:19 +05:30
generate-image.tsx chore: ran linting 2026-03-25 00:27:24 +05:30
generate-podcast.tsx refactor(env): replace inline process.env reads with BACKEND_URL in tool-ui generators 2026-05-20 03:38:32 +05:30
generate-report.tsx refactor: replace button elements with Button component for improved consistency and styling across additional UI components 2026-05-14 15:02:46 +05:30
generate-resume.tsx refactor(env): replace inline process.env reads with BACKEND_URL in tool-ui generators 2026-05-20 03:38:32 +05:30
index.ts feat(web): create_automation HITL approval card in chat 2026-05-28 01:32:04 +02:00
sandbox-execute.tsx refactor: update UI components to enhance hover effects and color consistency 2026-05-13 23:53:09 +05:30
user-memory.tsx chore: ran linting 2026-04-09 18:10:34 +05:30
write-todos.tsx refactor: update dependencies and streamline assistant-ui package usages 2026-03-24 02:22:51 +05:30