SurfSense/surfsense_backend/app/agents/new_chat
CREDO23 2b7d91aa03 feat(automations): add create_automation HITL tool (NL → draft → approve → save)
Single tool exposed to the main agent. The main agent passes a natural-language
`intent`; a focused drafter sub-LLM turns it into a full AutomationCreate JSON;
that JSON is surfaced via request_approval (action_type "automation_create") so
the user can edit/approve it on a frontend card; on approval the tool persists
via AutomationService. Three phases, one tool call.

Scope split:
- main agent sees only `intent: str` (no schema knowledge leaks into the calling
  graph) — prompt fragments scoped accordingly.
- drafter sub-LLM owns the schema + few-shot intent→JSON examples — lives in
  the generating graph's prompt (tools/automation/prompt.py).

Files:
- main_agent/tools/automation/{create.py, prompt.py, __init__.py}: new tool
  + drafter system prompt with two few-shot intent→JSON examples.
- system_prompt/prompts/tools/create_automation/{description.md, example.md}:
  intent-only guidance for the main agent.
- main_agent/tools/index.py: add create_automation to the main-agent allowlist.
- new_chat/tools/registry.py: deferred-import factory to break the
  multi_agent_chat ↔ registry cycle; one ToolDefinition entry.
2026-05-28 00:12:02 +02:00
..
middleware feat(chat): add model retry and stream lifecycle events 2026-05-22 17:48:43 +05:30
plugins chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
prompts feat: refine private and team memory protocols 2026-05-20 02:02:10 +05:30
skills feat: updated agent harness 2026-04-28 09:22:19 -07:00
subagents Merge upstream/dev into feature/multi-agent 2026-05-05 01:44:46 +02:00
tools feat(automations): add create_automation HITL tool (NL → draft → approve → save) 2026-05-28 00:12:02 +02:00
__init__.py cloud: added openrouter integration with global configs 2026-04-15 23:46:29 -07:00
agent_cache.py feat: implement agent caches and fix invalid prompt cache configs 2026-05-03 06:03:40 -07:00
chat_deepagent.py perf(kb-planner): route internal planner calls to dedicated small/fast LLM 2026-05-20 11:42:52 +02:00
checkpointer.py feat: implement connection pooling for AsyncPostgresSaver in checkpointer 2026-02-05 17:32:43 -08:00
context.py feat: improved document, folder mentions rendering 2026-05-09 22:15:51 -07:00
document_xml.py feat: updated file management for main agent 2026-04-28 04:32:52 -07:00
errors.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
feature_flags.py refactor(chat): stream agent events via stream_output and remove parity v2 flag 2026-05-07 19:40:10 +02:00
filesystem_backends.py feat: updated file management for main agent 2026-04-28 04:32:52 -07:00
filesystem_selection.py feat(filesystem): refactor local filesystem handling to use mounts instead of root paths, enhancing mount management and path normalization 2026-04-24 05:59:21 +05:30
filesystem_state.py subagents/knowledge_base: wire KB specialist into orchestrator (renderer/projector split, FS middleware stack, cloud-mode gating) 2026-05-11 20:43:44 +02:00
llm_config.py feat: fixed vision/image provider specific errors and fixed podcast/video streaming 2026-05-02 19:18:53 -07:00
mention_resolver.py feat: improved document, folder mentions rendering 2026-05-09 22:15:51 -07:00
path_resolver.py feat: updated file management for main agent 2026-04-28 04:32:52 -07:00
permissions.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
plugin_loader.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
prompt_caching.py perf(prompt-cache): enable Azure prompt_cache_key routing hint 2026-05-20 11:58:15 +02:00
sandbox.py feat: added ai file sorting 2026-04-14 01:43:30 -07:00
state_reducers.py feat: improved agent streaming 2026-04-29 07:20:31 -07:00
system_prompt.py Wire Linear and Slack specialists and prompt routing. 2026-04-29 20:51:06 +02:00
utils.py inject tools at runtime 2025-12-20 18:35:39 +02:00