SurfSense/surfsense_web/app/dashboard/[search_space_id]
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
..
automations feat(web): create_automation HITL approval card in chat 2026-05-28 01:32:04 +02:00
buy-more refactor: implement tab navigation in BuyMorePage and enhance button styles in BuyPagesContent and BuyTokensContent 2026-05-17 23:29:41 +05:30
buy-pages feat: no login experience and prem tokens 2026-04-15 17:02:00 -07:00
buy-tokens feat: no login experience and prem tokens 2026-04-15 17:02:00 -07:00
connectors/callback refactor(web): centralize OAuth callback cookie contract (fixes #1362) 2026-05-23 23:22:18 +07:00
logs chore: ran linting 2026-05-19 21:02:07 +05:30
more-pages refactor: implement tab navigation in BuyMorePage and enhance button styles in BuyPagesContent and BuyTokensContent 2026-05-17 23:29:41 +05:30
new-chat refactor(env): replace inline process.env reads with BACKEND_URL in editor, chat, dashboard and settings 2026-05-20 03:34:22 +05:30
onboard refactor: update OnboardPage styling for consistency with main panel design 2026-05-13 18:22:52 +05:30
purchase-cancel feat: no login experience and prem tokens 2026-04-15 17:02:00 -07:00
purchase-success chore: linting 2026-05-05 17:08:34 -07:00
search-space-settings refactor: remove team memory components and related settings from user and search space settings 2026-05-20 12:01:26 +05:30
team refactor: extract shared hasPermission helper (MODSetter/SurfSense#1366) 2026-05-22 12:08:05 +08:00
user-settings refactor: remove team memory components and related settings from user and search space settings 2026-05-20 12:01:26 +05:30
client-layout.tsx refactor(layout): implement background color management in DashboardClientLayout; streamline RightPanel and LayoutShell styles for consistency 2026-05-04 02:05:20 +05:30
layout.tsx chore: ran linting 2026-03-06 12:17:57 +05:30
page.tsx chore: linting 2026-03-27 03:17:05 -07:00