108108 "guardrails" : "shield" ,
109109 "policy" : "scale" ,
110110 "permissions" : "lock" ,
111- "approval" : "check- circle" ,
112- "escalation" : "alert- triangle" ,
111+ "approval" : "circle-check " ,
112+ "escalation" : "triangle-alert " ,
113113
114114 # Planning and thinking
115115 "planning" : "clipboard-list" ,
120120 "plugins" : "puzzle" ,
121121
122122 # Observability
123- "telemetry" : "bar-chart-2 " ,
123+ "telemetry" : "bar-chart-3 " ,
124124 "trace" : "activity" ,
125125 "eval" : "flask-conical" ,
126126
150150 "audio_agent" : "mic" ,
151151 "ocr_agent" : "scan" ,
152152 "deep_research_agent" : "microscope" ,
153- "query_rewriter_agent" : "edit " ,
153+ "query_rewriter_agent" : "pencil " ,
154154 "prompt_expander_agent" : "maximize" ,
155155 "context_agent" : "file-text" ,
156156 "router_agent" : "route" ,
186186 "version" : "tag" ,
187187 "upload_vision" : "upload" ,
188188 "train_vision" : "eye" ,
189- "agents_generator" : "wand" ,
189+ "agents_generator" : "wand-2 " ,
190190 "agent_scheduler" : "calendar-clock" ,
191191
192192 # TypeScript modules
193193 "ai" : "brain-circuit" ,
194194 "cache" : "database" ,
195195 "events" : "bell" ,
196196 "observability" : "eye" ,
197+ "db" : "database" ,
197198
198199 # Misc
199200 "main" : "home" ,
200201 "server" : "server" ,
201202 "lsp" : "code-2" ,
202203 "obs" : "eye" ,
203204 "output" : "file-output" ,
204- "compaction" : "minimize" ,
205+ "compaction" : "minimize-2 " ,
205206 "background" : "layers" ,
206207 "models" : "box" ,
207208 "result" : "check-square" ,
216217
217218 # Default
218219 "default" : "file-code" ,
219- "main" : "home" ,
220220 "index" : "home" ,
221- "context" : "folder-open" ,
222- "config" : "settings" ,
223- "utils" : "wrench" ,
224221 "types" : "tag" ,
225222 "base" : "database" ,
226223 "decorator" : "sparkles" ,
224+ "utils" : "wrench" ,
227225}
228226
229227
228+
229+
230230SKIP_MODULES = {
231231 "__pycache__" , "_config" , "_lazy" , "_logging" , "_warning_patch" ,
232232 "_resolver_helpers" , "audit" , "lite" , "profiling" , "utils" , "__init__" ,
@@ -456,29 +456,39 @@ def sanitize_description(text: str, max_length: int = 150) -> str:
456456 return first_line
457457
458458
459+
459460def get_icon_for_module (module_name : str ) -> str :
460- """Get the appropriate Lucide icon for a module.
461+ """Get the icon name for a module.
461462
462463 Args:
463- module_name: The module name
464+ module_name: Name of the module
464465
465466 Returns:
466- Lucide icon name
467+ String icon name (Lucide/FontAwesome)
467468 """
469+ module_name = module_name .lower ()
470+
468471 # Try exact match first
469472 if module_name in ICON_MAP :
470473 return ICON_MAP [module_name ]
471474
472- # Try lowercase
473- if module_name .lower () in ICON_MAP :
474- return ICON_MAP [module_name .lower ()]
475-
476- # Try partial matches
477- for key , icon in ICON_MAP .items ():
478- if key in module_name or module_name in key :
479- return icon
480-
481- return ICON_MAP .get ("default" , "file-code" )
475+ # Try partial match (keywords)
476+ if "agent" in module_name :
477+ return ICON_MAP ["agent" ]
478+ if "tool" in module_name :
479+ return ICON_MAP ["tool" ]
480+ if "task" in module_name :
481+ return ICON_MAP ["task" ]
482+ if "llm" in module_name :
483+ return ICON_MAP ["llm" ]
484+ if "config" in module_name :
485+ return ICON_MAP ["config" ]
486+ if "memory" in module_name :
487+ return ICON_MAP ["memory" ]
488+ if "knowledge" in module_name :
489+ return ICON_MAP ["knowledge" ]
490+
491+ return ICON_MAP ["default" ]
482492
483493
484494def generate_mermaid_diagram (info : ModuleInfo ) -> str :
@@ -988,24 +998,29 @@ def _render_module(self, info: ModuleInfo) -> str:
988998 if info .classes :
989999 lines .append ("## Classes" )
9901000 lines .append ("" )
991- lines .append ("<AccordionGroup>" )
9921001 for cls in info .classes :
9931002 lines .extend (self ._render_class (cls , info .package ))
994- lines .append ("</AccordionGroup>" )
995- lines .append ("" )
9961003
9971004 # Functions section
9981005 if info .functions :
9991006 lines .append ("## Functions" )
10001007 lines .append ("" )
1001- lines .append ("<AccordionGroup>" )
10021008 for func in info .functions :
10031009 lines .extend (self ._render_function (func , info .package ))
1004- lines .append ("</AccordionGroup>" )
1010+
1011+ # Constants section
1012+ if info .constants :
1013+ lines .append ("## Constants" )
1014+ lines .append ("" )
1015+ lines .append ("| Name | Value |" )
1016+ lines .append ("|------|-------|" )
1017+ for name , value in info .constants :
1018+ safe_value = escape_for_table (str (value )[:50 ])
1019+ lines .append (f"| `{ name } ` | `{ safe_value } ` |" )
10051020 lines .append ("" )
1006-
10071021
10081022 return "\n " .join (lines )
1023+
10091024
10101025 def _render_class (self , cls : ClassInfo , package : str ) -> List [str ]:
10111026 """Render class documentation."""
@@ -1027,47 +1042,51 @@ def _render_class(self, cls: ClassInfo, package: str) -> List[str]:
10271042
10281043 # Constructor parameters
10291044 if cls .init_params :
1030- lines .append ('<Expandable title="Constructor Parameters">' )
1045+ lines .append ('<Accordion title="Constructor Parameters">' )
10311046 lines .append ("" )
1047+ lines .append ("| Parameter | Type | Required | Default |" )
1048+ lines .append ("|-----------|------|----------|---------|" )
10321049 for p in cls .init_params :
10331050 safe_type = escape_for_table (p .type )
1034- default = f" (default: `{ escape_for_table (p .default )} `)" if p .default else ""
1035- required = " (Required)" if p .required else ""
1036- lines .append (f'<ParamField query="{ p .name } " type="{ safe_type } ">' )
1037- lines .append (f" { required } { default } " )
1038- lines .append ('</ParamField>' )
1051+ default = escape_for_table (p .default ) if p .default else "-"
1052+ required = "Yes" if p .required else "No"
1053+ lines .append (f"| `{ p .name } ` | `{ safe_type } ` | { required } | `{ default } ` |" )
10391054 lines .append ("" )
1040- lines .append ("</Expandable >" )
1055+ lines .append ("</Accordion >" )
10411056 lines .append ("" )
10421057
10431058 # Properties
10441059 if cls .properties :
1045- lines .append ('<Expandable title="Properties">' )
1060+ lines .append ('<Accordion title="Properties">' )
10461061 lines .append ("" )
1062+ lines .append ("| Property | Type |" )
1063+ lines .append ("|----------|------|" )
10471064 for p in cls .properties :
10481065 safe_type = escape_for_table (p .type )
1049- lines .append (f'<ResponseField name="{ p .name } " type="{ safe_type } ">' )
1050- lines .append ('</ResponseField>' )
1066+ lines .append (f"| `{ p .name } ` | `{ safe_type } ` |" )
10511067 lines .append ("" )
1052- lines .append ("</Expandable >" )
1068+ lines .append ("</Accordion >" )
10531069 lines .append ("" )
10541070
10551071 # Methods
10561072 if cls .methods :
1057- lines .append ("<AccordionGroup>" )
1073+ lines .append ('<Accordion title="Methods">' )
1074+ lines .append ("" )
10581075 for m in cls .methods :
10591076 async_prefix = "async " if m .is_async else ""
10601077 safe_sig = escape_for_table (m .signature )
10611078 safe_ret = escape_for_table (m .return_type )
1062- lines .append (f'<Accordion title=" { async_prefix } { m .name } ( { safe_sig } ) -> { safe_ret } ">' )
1079+ lines .append (f"- ** { async_prefix } { m .name } **(` { safe_sig } `) → ` { safe_ret } `" )
10631080 if m .docstring :
1064- lines .append (f" { escape_mdx (m .docstring )} " )
1065- lines .append ('</Accordion>' )
1066- lines .append ("</AccordionGroup>" )
1081+ first_line = m .docstring .split ('\n ' )[0 ][:80 ]
1082+ safe_doc = escape_mdx (first_line )
1083+ lines .append (f" { safe_doc } " )
1084+ lines .append ("" )
1085+ lines .append ("</Accordion>" )
10671086 lines .append ("" )
1068-
10691087
10701088 return lines
1089+
10711090
10721091 def _render_function (self , func : FunctionInfo , package : str ) -> List [str ]:
10731092 """Render function documentation."""
@@ -1109,18 +1128,17 @@ def _render_function(self, func: FunctionInfo, package: str) -> List[str]:
11091128 lines .append ("" )
11101129 for p in func .params :
11111130 safe_type = escape_for_table (p .type )
1112- lines .append (f'<ParamField query=" { p .name } " type=" { safe_type } ">' )
1131+ lines .append (f"- ** { p .name } ** (` { safe_type } `)" )
11131132 if p .description :
11141133 lines .append (f" { escape_mdx (p .description )} " )
1115- lines .append ('</ParamField>' )
11161134 lines .append ("" )
11171135 lines .append ("</Expandable>" )
11181136 lines .append ("" )
1119-
11201137
11211138 return lines
11221139
11231140
1141+
11241142# =============================================================================
11251143# DOCS.JSON UPDATER
11261144# =============================================================================
@@ -1237,18 +1255,18 @@ def update_docs_json(package_name: str, generated_pages: List[str], dry_run: boo
12371255 }
12381256 ref_group ['pages' ].append (package_group )
12391257
1240- # Update pages with icons
1258+ # Update pages
12411259 new_page_objects = []
1242- # Deduplicate pages
1260+ # Deduplicate and filter out common index/utility modules that shouldn't be in main reference
12431261 unique_pages = sorted (list (set (generated_pages )))
12441262 for page_path in unique_pages :
1245-
12461263 module_name = page_path .split ('/' )[- 1 ]
1247- icon = get_icon_for_module (module_name )
1248- new_page_objects .append ({
1249- "page" : page_path ,
1250- "icon" : icon
1251- })
1264+ if module_name .lower () == "index" or module_name .lower () == "__init__" :
1265+ continue
1266+
1267+ # Use string paths to rely on MDX frontmatter icons and fix redirection issues
1268+ new_page_objects .append (page_path )
1269+
12521270
12531271 # Merge with existing if necessary, or just overwrite for reference docs
12541272 # Since these are auto-generated reference docs, overwriting is safer to keep it clean
0 commit comments