SurfSense/surfsense_backend/app
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
..
agents feat(web): create_automation HITL approval card in chat 2026-05-28 01:32:04 +02:00
automations refactor(automations): park manual trigger pending Run-now redesign 2026-05-27 22:29:51 +02:00
config perf(kb-planner): route internal planner calls to dedicated small/fast LLM 2026-05-20 11:42:52 +02:00
connectors chore: linting 2026-04-27 14:04:50 -07:00
etl_pipeline feat(pipeline): enrich ETL and indexing failure telemetry 2026-05-22 17:49:46 +05:30
indexing_pipeline feat(pipeline): enrich ETL and indexing failure telemetry 2026-05-22 17:49:46 +05:30
observability feat(env): add SURFSENSE_ENV variable for deployment environment and update observability resource attributes 2026-05-23 02:13:24 +05:30
prompts feat: add PDF preview and export functionality for Typst-based reports, enhance report content handling 2026-04-15 21:11:27 +05:30
retriever feat(retriever): instrument knowledge base search 2026-05-21 23:03:31 +05:30
routes rbac: surface automations permissions in the UI 2026-05-28 00:30:40 +02:00
schemas feat: add team memory routes 2026-05-20 02:02:27 +05:30
services Merge remote-tracking branch 'upstream/dev' into improvement-agent-speed 2026-05-20 21:23:48 +02:00
tasks refactor(chat): add streaming/flows/resume_chat/orchestrator + flows public API 2026-05-25 21:50:09 +02:00
templates feat: update report generation and export capabilities to support multiple formats (PDF, DOCX, HTML, LaTeX, EPUB, ODT, plain text) across documentation and backend 2026-03-09 18:41:21 -07:00
utils feat(observability): add SurfSense metric helpers 2026-05-21 23:02:20 +05:30
__init__.py feat: SurfSense v0.0.6 init 2025-03-14 18:53:14 -07:00
app.py feat(observability): add OpenTelemetry process bootstrap 2026-05-21 23:01:54 +05:30
celery_app.py add schedule tick task and beat entry 2026-05-27 17:56:07 +02:00
db.py feat(rbac): add automations permission family 2026-05-27 15:30:34 +02:00
exceptions.py feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
rate_limiter.py try: ip fix for cludflare 2026-04-16 02:13:52 -07:00
users.py Seed default prompts on registration and for existing users 2026-03-31 18:12:09 +02:00