SurfSense/surfsense_web/lib
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
..
announcements feat(announcements): rename "Announcements" to "What's New" across the application; add AnnouncementsDialog component for displaying updates; update empty state messaging; remove unused AnnouncementsSidebar component. 2026-05-03 18:42:29 +05:30
apis feat(web): automations contracts, API client, atoms and hooks 2026-05-28 00:55:57 +02:00
automations feat(web): create_automation HITL approval card in chat 2026-05-28 01:32:04 +02:00
chat refactor(env): replace inline process.env reads with BACKEND_URL in lib/ 2026-05-20 03:12:02 +05:30
citations chore: linting 2026-04-30 18:42:38 -07:00
comments refactor: move pure utility functions out of UI components (#1194) 2026-04-14 17:39:11 +09:30
connectors refactor: completely remove Local Folder connector references and update folder sync logic 2026-04-02 22:21:16 +05:30
documents refactor: move pure utility functions out of UI components (#1194) 2026-04-14 17:39:11 +09:30
markdown feat(markdown): enable citation rendering in MarkdownViewer and related components 2026-04-30 18:40:55 -07:00
posthog fix: move getConnectorTelemetryMeta from components/ to lib/ to fix dependency inversion 2026-05-22 12:15:20 +08:00
query-client feat(web): automations contracts, API client, atoms and hooks 2026-05-28 00:55:57 +02:00
remotion chore: ran linting 2026-03-25 00:27:24 +05:30
agent-filesystem.ts feat: moved most things behind correct feature flag 2026-05-02 23:10:48 -07:00
auth-errors.ts refactor: update authentication error handling to prevent user enumeration and improve error messages 2026-02-09 12:57:32 +05:30
auth-utils.ts refactor(env): replace inline process.env reads with BACKEND_URL in lib/ 2026-05-20 03:12:02 +05:30
blog-faq.ts fix: update URLs to use the "www" subdomain across the application 2026-05-15 12:35:15 -07:00
connector-telemetry.ts fix: move getConnectorTelemetryMeta from components/ to lib/ to fix dependency inversion 2026-05-22 12:15:20 +08:00
desktop-download-utils.ts feat: implement download functionality for different OS in SidebarUserProfile and DownloadButton components, enhance user experience with localized download messages 2026-04-10 19:53:13 +05:30
editor-language.ts feat(editor): integrate Monaco Editor for local file editing and enhance language inference 2026-04-23 18:00:51 +05:30
env-config.ts refactor: make Azure Document Intelligence an internal LLAMACLOUD accelerator instead of a standalone ETL service 2026-04-08 03:26:24 +05:30
error-toast.ts feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
error.ts feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
folder-sync-upload.ts feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
format-date.ts feat(shared): extract formatThreadTimestamp helper for chats sidebars (fixes #1376) 2026-05-10 12:05:10 +08:00
layout-events.ts refactor(web): use last-seen-tick comparison for slideout listener 2026-05-24 18:13:36 +07:00
provider-icons.tsx feat: enhance model selector UI abd added github models icon 2026-04-14 20:35:16 +05:30
source.ts feat(docs): add observability documentation 2026-05-23 03:18:25 +05:30
supported-extensions.ts chore: ran linting 2026-04-08 05:20:03 +05:30
url.ts chore: ran linting 2026-05-19 21:02:07 +05:30
user-avatar.ts refactor: extract user avatar color and initials logic into a new utility module, update related components to use the new functions 2026-05-18 21:40:23 +05:30
utils.ts Add clipboard utility with fallback and show selectable URLs 2026-02-04 18:54:59 +02:00