Commit graph

10 commits

Author SHA1 Message Date
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
Anish Sarkar
5bcda6b83b refactor: replace action log sheet with dialog component and update related references 2026-05-18 01:34:41 +05:30
Anish Sarkar
f65bc81509 Merge remote-tracking branch 'upstream/dev' into feat/ui-revamp 2026-05-16 19:26:36 +05:30
Anish Sarkar
c77babf39b refactor: replace button elements with Button component for improved consistency and styling across additional UI components 2026-05-14 15:02:46 +05:30
CREDO23
1bb9f435e5 chat-messages: render and batch-submit multiple HITL approval cards 2026-05-13 21:00:01 +02:00
Anish Sarkar
75b7a9cc6c refactor: update UI components to enhance hover effects and color consistency 2026-05-13 23:53:09 +05:30
CREDO23
932bf22a34 chat: fix mixed-decision HITL crash and fold resumed assistant messages into the interrupted bubble. 2026-05-09 22:54:07 +02:00
CREDO23
2e132513be chat: unify HITL approval UX behind a single paginated card and harden timeline supersede. 2026-05-09 21:44:54 +02:00
CREDO23
97a7626179 chat-messages: add timeline tool registry with HITL-aware fallback. 2026-05-09 18:31:45 +02:00
CREDO23
48c4df822a chat-messages: add timeline module with builder, grouping, items, and rendering. 2026-05-09 18:31:33 +02:00