feat: send live flow context to AI Assist for full editor awareness

The AI panel now sends the current tree structure (troubleshooting) or
steps + intake form (procedural/maintenance) with each message. This
gives the AI full visibility into node details, questions, descriptions,
options, and intake form fields — not just the node ID.

- Backend: add flow_context param to schema, endpoint, and service
- Frontend: add getFlowContext callback to useEditorAI hook
- TreeEditorPage: passes treeStructure as flow context
- ProceduralEditorPage: passes steps + intakeForm as flow context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-07 01:08:21 -05:00
parent dfd7fc1f10
commit d6258ae9d8
7 changed files with 43 additions and 3 deletions

View File

@@ -43,6 +43,10 @@ class AIChatMessageRequest(BaseModel):
default=None,
description="ID of the node/step being acted on",
)
flow_context: Optional[dict[str, Any]] = Field(
default=None,
description="Live flow structure from the editor (tree structure, steps, intake form)",
)
class AIChatImportRequest(BaseModel):