feat: add procedural flows with intake forms, navigation, and seed templates

Adds a new "procedural" tree type for linear step-by-step project workflows
(domain controller setup, M365 onboarding, VPN config, etc). Includes intake
form builder, two-panel step navigation, variable resolution, procedural
exports, 3 seed templates, and UI rename from "Trees" to "Flows".

Also archives 19 implemented plan docs and creates deferred features backlog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-14 04:13:52 -05:00
parent 303570ca2c
commit 350c977eda
58 changed files with 11686 additions and 167 deletions

View File

@@ -64,6 +64,7 @@ export interface SessionCreate {
tree_id: string
ticket_number?: string
client_name?: string
session_variables?: Record<string, string>
}
export interface SessionUpdate {

View File

@@ -56,6 +56,77 @@ export interface TreeStructure {
children?: TreeStructure[]
}
// --- Procedural Flow Types ---
export type TreeType = 'troubleshooting' | 'procedural'
export type IntakeFieldType =
| 'text' | 'textarea' | 'number' | 'ip_address' | 'email'
| 'select' | 'multi_select' | 'checkbox' | 'password'
export type StepContentType = 'action' | 'informational' | 'verification' | 'warning'
export interface IntakeFieldValidation {
min_length?: number
max_length?: number
pattern?: string
pattern_message?: string
format?: 'ipv4' | 'email'
min_value?: number
max_value?: number
min_selections?: number
max_selections?: number
}
export interface IntakeFormField {
variable_name: string
label: string
field_type: IntakeFieldType
required: boolean
options?: string[]
placeholder?: string
help_text?: string
default_value?: string
group_name?: string
display_order: number
validation?: IntakeFieldValidation
}
export interface CommandBlock {
language?: string
code: string
label?: string
}
export interface StepVerification {
type: 'checkbox' | 'text_input'
prompt: string
}
export interface ProceduralStep {
id: string
type: 'procedure_step' | 'procedure_end'
title: string
description?: string
content_type?: StepContentType
estimated_minutes?: number
warning_text?: string
// Verification — supports both flat fields and nested object
verification_prompt?: string
verification_type?: 'checkbox' | 'text_input'
verification?: StepVerification
// Commands — supports both string and array of command blocks
commands?: string | CommandBlock[]
expected_outcome?: string
notes_enabled?: boolean
section_header?: string
reference_url?: string
}
export interface ProceduralTreeStructure {
steps: ProceduralStep[]
}
// API response types
export type TreeStatus = 'draft' | 'published'
@@ -63,11 +134,14 @@ export interface Tree {
id: string
name: string
description: string | null
tree_type: TreeType
category: string | null
category_id: string | null
category_info: CategoryInfo | null
tags: string[]
tree_structure: TreeStructure
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tree_structure: TreeStructure & Record<string, any>
intake_form: IntakeFormField[] | null
author_id: string | null
account_id: string | null
is_active: boolean
@@ -84,6 +158,7 @@ export interface TreeListItem {
id: string
name: string
description: string | null
tree_type: TreeType
category: string | null
category_id: string | null
category_info: CategoryInfo | null
@@ -103,10 +178,13 @@ export interface TreeListItem {
export interface TreeCreate {
name: string
description?: string
tree_type?: TreeType
category?: string
category_id?: string | null
tags?: string[]
tree_structure: TreeStructure
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tree_structure: Record<string, any>
intake_form?: IntakeFormField[]
is_public?: boolean
is_default?: boolean
status?: TreeStatus
@@ -115,10 +193,13 @@ export interface TreeCreate {
export interface TreeUpdate {
name?: string
description?: string
tree_type?: TreeType
category?: string
category_id?: string | null
tags?: string[]
tree_structure?: TreeStructure
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tree_structure?: Record<string, any>
intake_form?: IntakeFormField[]
is_active?: boolean
is_public?: boolean
status?: TreeStatus
@@ -126,6 +207,7 @@ export interface TreeUpdate {
// Filter params for tree listing
export interface TreeFilters {
tree_type?: TreeType
category?: string
category_id?: string
tags?: string