From 037610f95bcc66c3ffa7f49e9fcce58f0f782678 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Wed, 6 Aug 2025 08:38:33 -0700 Subject: [PATCH 01/17] Initial pass on adding language picker/version --- README.md | 9 +- pipeline/core/builder.py | 199 +++++-- src/docs.json | 1182 +++++++++++++++++++++++++++----------- src/docs.json.backup | 541 +++++++++++++++++ 4 files changed, 1543 insertions(+), 388 deletions(-) create mode 100644 src/docs.json.backup diff --git a/README.md b/README.md index ca0044fd..398440da 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,14 @@ README.md # This file uv sync --all-groups ``` -4. **Use the docs CLI tool:** +4. **Install Mintlify CLI** + + The docs CLI uses parts of the Mintlify CLI so you need to install that too. + ```bash + npm i -g mint + ``` + +5. **Use the docs CLI tool:** After setup, you'll have access to the `docs` command: ```bash diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index f73b3fb6..84dd306e 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -54,59 +54,38 @@ def __init__(self, src_dir: Path, build_dir: Path) -> None: def build_all(self) -> None: """Build all documentation files from source to build directory. - This method clears the build directory and copies all supported files - from the source directory, maintaining the directory structure. + This method clears the build directory and creates version-specific builds + for both Python and JavaScript documentation. The process includes: 1. Clearing the existing build directory - 2. Recreating the build directory - 3. Collecting all files to process - 4. Processing files with a progress bar - 5. Copying only files with supported extensions + 2. Building Python version with python/ prefix + 3. Building JavaScript version with javascript/ prefix + 4. Copying shared files (images, configs, etc.) Displays: - A progress bar showing build progress and file counts. + Progress bars showing build progress for each version. """ - logger.info("Building from %s to %s", self.src_dir, self.build_dir) + logger.info("Building versioned documentation from %s to %s", self.src_dir, self.build_dir) # Clear build directory if self.build_dir.exists(): shutil.rmtree(self.build_dir) self.build_dir.mkdir(parents=True, exist_ok=True) - # Collect all files to process - all_files = [ - file_path for file_path in self.src_dir.rglob("*") if file_path.is_file() - ] + # Build Python version + logger.info("Building Python version...") + self._build_version("python", "python") - if not all_files: - logger.info("No files found to build") - return + # Build JavaScript version + logger.info("Building JavaScript version...") + self._build_version("javascript", "js") - # Process files with progress bar - copied_count: int = 0 - skipped_count: int = 0 + # Copy shared files (docs.json, images, etc.) + logger.info("Copying shared files...") + self._copy_shared_files() - with tqdm( - total=len(all_files), - desc="Building files", - unit="file", - ncols=80, - bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]", - ) as pbar: - for file_path in all_files: - result = self._build_file_with_progress(file_path, pbar) - if result: - copied_count += 1 - else: - skipped_count += 1 - pbar.update(1) - - logger.info( - "✅ Build complete: %d files copied, %d files skipped", - copied_count, - skipped_count, - ) + logger.info("✅ Versioned build complete") def _convert_yaml_to_json(self, yaml_file_path: Path, output_path: Path) -> None: """Convert a YAML file to JSON format. @@ -137,7 +116,7 @@ def _convert_yaml_to_json(self, yaml_file_path: Path, output_path: Path) -> None logger.exception("Failed to convert %s to JSON", yaml_file_path) raise - def _process_markdown_content(self, content: str, file_path: Path) -> str: + def _process_markdown_content(self, content: str, file_path: Path, target_language: str = None) -> str: """Process markdown content with preprocessing. This method applies preprocessing (cross-reference resolution and @@ -146,18 +125,19 @@ def _process_markdown_content(self, content: str, file_path: Path) -> str: Args: content: The markdown content to process. file_path: Path to the source file (for error reporting). + target_language: Target language for conditional blocks ("python" or "js"). Returns: The processed markdown content. """ try: # Apply markdown preprocessing - return preprocess_markdown(content, file_path) + return preprocess_markdown(content, file_path, target_language=target_language) except Exception: logger.exception("Failed to process markdown content from %s", file_path) raise - def _process_markdown_file(self, input_path: Path, output_path: Path) -> None: + def _process_markdown_file(self, input_path: Path, output_path: Path, target_language: str = None) -> None: """Process a markdown file with preprocessing and copy to output. This method reads a markdown file, applies preprocessing (cross-reference @@ -167,6 +147,7 @@ def _process_markdown_file(self, input_path: Path, output_path: Path) -> None: Args: input_path: Path to the source markdown file. output_path: Path where the processed file should be written. + target_language: Target language for conditional blocks ("python" or "js"). """ try: # Read the source markdown content @@ -174,7 +155,7 @@ def _process_markdown_file(self, input_path: Path, output_path: Path) -> None: content = f.read() # Apply markdown preprocessing - processed_content = self._process_markdown_content(content, input_path) + processed_content = self._process_markdown_content(content, input_path, target_language) # Convert .md to .mdx if needed if input_path.suffix.lower() == ".md": @@ -318,3 +299,137 @@ def build_files(self, file_paths: list[Path]) -> None: copied_count, skipped_count, ) + + def _build_version(self, version_dir: str, target_language: str) -> None: + """Build a version-specific copy of the documentation. + + Args: + version_dir: Directory name for this version (e.g., "python", "javascript"). + target_language: Target language for conditional blocks ("python" or "js"). + """ + # Collect all files to process (excluding shared files) + all_files = [ + file_path for file_path in self.src_dir.rglob("*") + if file_path.is_file() and not self._is_shared_file(file_path) + ] + + if not all_files: + logger.info("No files found to build for %s version", version_dir) + return + + # Process files with progress bar + copied_count: int = 0 + skipped_count: int = 0 + + with tqdm( + total=len(all_files), + desc=f"Building {version_dir} files", + unit="file", + ncols=80, + bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]", + ) as pbar: + for file_path in all_files: + result = self._build_version_file_with_progress( + file_path, version_dir, target_language, pbar + ) + if result: + copied_count += 1 + else: + skipped_count += 1 + pbar.update(1) + + logger.info( + "✅ %s version complete: %d files copied, %d files skipped", + version_dir.capitalize(), + copied_count, + skipped_count, + ) + + def _build_version_file_with_progress( + self, file_path: Path, version_dir: str, target_language: str, pbar: tqdm + ) -> bool: + """Build a single file for a specific version with progress bar integration. + + Args: + file_path: Path to the source file to be built. + version_dir: Directory name for this version (e.g., "python", "javascript"). + target_language: Target language for conditional blocks ("python" or "js"). + pbar: tqdm progress bar instance for updating the description. + + Returns: + True if the file was copied, False if it was skipped. + """ + relative_path = file_path.relative_to(self.src_dir) + # Add version prefix to the output path + output_path = self.build_dir / version_dir / relative_path + + # Update progress bar description with current file + pbar.set_postfix_str(f"{version_dir}/{relative_path}") + + # Create output directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Handle special case for docs.yml files + if file_path.name == "docs.yml" and file_path.suffix.lower() in { + ".yml", + ".yaml", + }: + self._convert_yaml_to_json(file_path, output_path) + return True + # Copy other supported files + if file_path.suffix.lower() in self.copy_extensions: + # Handle markdown files with preprocessing + if file_path.suffix.lower() in {".md", ".mdx"}: + self._process_markdown_file(file_path, output_path, target_language) + return True + shutil.copy2(file_path, output_path) + return True + return False + + def _is_shared_file(self, file_path: Path) -> bool: + """Check if a file should be shared between versions rather than duplicated. + + Args: + file_path: Path to check. + + Returns: + True if the file should be shared, False if it should be version-specific. + """ + # Shared files: docs.json, images directory + relative_path = file_path.relative_to(self.src_dir) + + # docs.json should be shared + if file_path.name == "docs.json": + return True + + # Images directory should be shared + if "images" in relative_path.parts: + return True + + return False + + def _copy_shared_files(self) -> None: + """Copy files that should be shared between versions.""" + # Collect shared files + shared_files = [ + file_path for file_path in self.src_dir.rglob("*") + if file_path.is_file() and self._is_shared_file(file_path) + ] + + if not shared_files: + logger.info("No shared files found") + return + + copied_count = 0 + for file_path in shared_files: + relative_path = file_path.relative_to(self.src_dir) + output_path = self.build_dir / relative_path + + # Create output directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + if file_path.suffix.lower() in self.copy_extensions: + shutil.copy2(file_path, output_path) + copied_count += 1 + + logger.info("✅ Shared files copied: %d files", copied_count) diff --git a/src/docs.json b/src/docs.json index 1eead6d7..71ab1f5e 100644 --- a/src/docs.json +++ b/src/docs.json @@ -33,117 +33,242 @@ "family": "Manrope" }, "styling": { - "eyebrows": "breadcrumbs" - }, + "eyebrows": "breadcrumbs" + }, "contextual": { "options": [ "copy", - "view", - { - "title": "llms.txt", - "description": "Open llms.txt for this site", - "icon": "file", - "href": "https://docs.langchain.com/llms.txt" - }, - "chatgpt", + "view", + { + "title": "llms.txt", + "description": "Open llms.txt for this site", + "icon": "file", + "href": "https://docs.langchain.com/llms.txt" + }, + "chatgpt", "claude" - ] + ] }, "integrations": { "gtm": { - "tagId": "GTM-MBBX68ST" + "tagId": "GTM-MBBX68ST" } }, "navigation": { - "dropdowns": [ + "versions": [ { - "dropdown": "LangGraph", - "icon": "/images/brand/langgraph-pill.svg", - "description": "Framework for building reliable agents and workflows", - "tabs": [ + "version": "Python", + "dropdowns": [ { - "tab": "Get started", - "groups": [ + "dropdown": "LangGraph", + "icon": "/images/brand/langgraph-pill.svg", + "description": "Framework for building reliable agents and workflows", + "tabs": [ { - "group": "Get started", - "pages": [ - "oss/overview", - "oss/quickstart", - "oss/run-an-agent", - "oss/template-applications" - ] - }, - { - "group": "General concepts", - "pages": [ - "oss/workflows-and-agents", - "oss/prebuilt-vs-low-level", + "tab": "Get started", + "groups": [ + { + "group": "Get started", + "pages": [ + "python/oss/overview", + "python/oss/quickstart", + "python/oss/run-an-agent", + "python/oss/template-applications" + ] + }, + { + "group": "General concepts", + "pages": [ + "python/oss/workflows-and-agents", + "python/oss/prebuilt-vs-low-level", + { + "group": "Common agent architectures", + "pages": [ + "python/oss/agentic-architectures", + "python/oss/agentic-rag", + "python/oss/agent-supervisor", + "python/oss/sql-agent" + ] + } + ] + }, { - "group": "Common agent architectures", + "group": "Additional resources", "pages": [ - "oss/agentic-architectures", - "oss/agentic-rag", - "oss/agent-supervisor", - "oss/sql-agent" + "python/oss/case-studies", + "python/oss/faq", + "python/oss/langgraph-academy" ] } ] }, { - "group": "Additional resources", - "pages": [ - "oss/case-studies", - "oss/faq", - "oss/langgraph-academy" - ] - } - ] - }, - { - "tab": "Build agents", - "groups": [ - { - "group": "Basic configuration", - "pages": [ - "oss/prebuilts" + "tab": "Build agents", + "groups": [ + { + "group": "Basic configuration", + "pages": [ + "python/oss/prebuilts" + ] + }, + { + "group": "Low-level configuration", + "pages": [ + "python/oss/why-langgraph", + "python/oss/1-build-basic-chatbot", + "python/oss/2-add-tools", + "python/oss/3-add-memory", + "python/oss/4-human-in-the-loop", + "python/oss/5-customize-state", + "python/oss/6-time-travel" + ] + }, + { + "group": "Components", + "pages": [ + "python/oss/models", + { + "group": "Tools", + "pages": [ + "python/oss/tools", + "python/oss/call-tools" + ] + }, + { + "group": "MCP", + "pages": [ + "python/oss/mcp", + "python/oss/use-mcp" + ] + }, + { + "group": "Multi-agent", + "pages": [ + "python/oss/multi-agent", + "python/oss/multi-agent-prebuilts", + "python/oss/multi-agent-custom" + ] + } + ] + } ] }, { - "group": "Low-level configuration", - "pages": [ - "oss/why-langgraph", - "oss/1-build-basic-chatbot", - "oss/2-add-tools", - "oss/3-add-memory", - "oss/4-human-in-the-loop", - "oss/5-customize-state", - "oss/6-time-travel" + "tab": "Agent runtime", + "groups": [ + { + "group": "Capabilities", + "pages": [ + "python/oss/persistence", + "python/oss/durable-execution", + { + "group": "Streaming", + "pages": [ + "python/oss/streaming", + "python/oss/use-streaming" + ] + }, + { + "group": "Human-in-the-loop", + "pages": [ + "python/oss/human-in-the-loop", + "python/oss/add-human-in-the-loop" + ] + }, + { + "group": "Time travel", + "pages": [ + "python/oss/time-travel", + "python/oss/use-time-travel" + ] + }, + { + "group": "Memory and context", + "pages": [ + "python/oss/memory", + "python/oss/context", + "python/oss/add-memory" + ] + }, + { + "group": "Subgraphs", + "pages": [ + "python/oss/subgraphs", + "python/oss/use-subgraphs" + ] + } + ] + }, + { + "group": "Run and debug", + "pages": [ + "python/oss/local-server", + "python/oss/ui", + "python/oss/trace-agent", + "python/oss/evals" + ] + }, + { + "group": "LangGraph APIs", + "pages": [ + { + "group": "Graph API", + "pages": [ + "python/oss/graph-api", + "python/oss/use-graph-api" + ] + }, + { + "group": "Functional API", + "pages": [ + "python/oss/functional-api", + "python/oss/use-functional-api" + ] + }, + "python/oss/pregel" + ] + } ] }, { - "group": "Components", - "pages": [ - "oss/models", + "tab": "Reference", + "groups": [ { - "group": "Tools", + "group": "LangGraph reference", "pages": [ - "oss/tools", - "oss/call-tools" + "python/oss/reference/overview", + "python/oss/reference/graphs", + "python/oss/reference/functional-api", + "python/oss/reference/pregel", + "python/oss/reference/checkpointers", + "python/oss/reference/storage", + "python/oss/reference/caching", + "python/oss/reference/types", + "python/oss/reference/runtime", + "python/oss/reference/config", + "python/oss/reference/errors", + "python/oss/reference/constants", + "python/oss/reference/channels" ] }, { - "group": "MCP", + "group": "Prebuilt reference", "pages": [ - "oss/mcp", - "oss/use-mcp" + "python/oss/reference/agents", + "python/oss/reference/supervisor", + "python/oss/reference/swarm", + "python/oss/reference/mcp" ] }, { - "group": "Multi-agent", + "group": "Error troubleshooting", "pages": [ - "oss/multi-agent", - "oss/multi-agent-prebuilts", - "oss/multi-agent-custom" + "python/oss/common-errors", + "python/oss/GRAPH_RECURSION_LIMIT", + "python/oss/INVALID_CHAT_HISTORY", + "python/oss/INVALID_CONCURRENT_GRAPH_UPDATE", + "python/oss/INVALID_GRAPH_NODE_RETURN_VALUE", + "python/oss/MULTIPLE_SUBGRAPHS" ] } ] @@ -151,121 +276,266 @@ ] }, { - "tab": "Agent runtime", - "groups": [ + "dropdown": "LangGraph Platform", + "icon": "/images/brand/langgraph-platform-pill.svg", + "description": "Platform for building and deploying AI agents", + "tabs": [ { - "group": "Capabilities", - "pages": [ - "oss/persistence", - "oss/durable-execution", + "tab": "Get started", + "groups": [ { - "group": "Streaming", + "group": "Overview", "pages": [ - "oss/streaming", - "oss/use-streaming" + "python/langgraph-platform/index", + { + "group": "Components", + "pages": [ + "python/langgraph-platform/components", + "python/langgraph-platform/langgraph-server", + "python/langgraph-platform/data-plane", + "python/langgraph-platform/control-plane" + ] + }, + "python/langgraph-platform/application-structure" ] }, { - "group": "Human-in-the-loop", + "group": "Quickstarts", "pages": [ - "oss/human-in-the-loop", - "oss/add-human-in-the-loop" + "python/langgraph-platform/local-server", + "python/langgraph-platform/deployment-quickstart", + "python/langgraph-platform/quick-start-studio" ] }, { - "group": "Time travel", + "group": "Plans and deployment", + "pages": [ + "python/langgraph-platform/plans" + ] + } + ] + }, + { + "tab": "Build", + "groups": [ + { + "group": "Build an app with the LangGraph basics", "pages": [ - "oss/time-travel", - "oss/use-time-travel" + "python/langgraph-platform/langgraph-basics/why-langgraph", + "python/langgraph-platform/langgraph-basics/1-build-basic-chatbot", + "python/langgraph-platform/langgraph-basics/2-add-tools", + "python/langgraph-platform/langgraph-basics/3-add-memory", + "python/langgraph-platform/langgraph-basics/4-human-in-the-loop", + "python/langgraph-platform/langgraph-basics/5-customize-state", + "python/langgraph-platform/langgraph-basics/6-time-travel" ] }, { - "group": "Memory and context", + "group": "Data models", "pages": [ - "oss/memory", - "oss/context", - "oss/add-memory" + { + "group": "Assistants", + "pages": [ + "python/langgraph-platform/assistants", + "python/langgraph-platform/configuration-cloud", + "python/langgraph-platform/use-threads" + ] + }, + { + "group": "Runs", + "pages": [ + "python/langgraph-platform/background-run", + "python/langgraph-platform/same-thread", + "python/langgraph-platform/cron-jobs", + "python/langgraph-platform/stateless-runs", + "python/langgraph-platform/configurable-headers" + ] + } ] }, { - "group": "Subgraphs", + "group": "Core capabilities", "pages": [ - "oss/subgraphs", - "oss/use-subgraphs" + "python/langgraph-platform/streaming", + "python/langgraph-platform/add-human-in-the-loop", + "python/langgraph-platform/human-in-the-loop-time-travel", + "python/langgraph-platform/server-mcp", + "python/langgraph-platform/use-webhooks", + { + "group": "Double-texting", + "pages": [ + "python/langgraph-platform/double-texting", + "python/langgraph-platform/interrupt-concurrent", + "python/langgraph-platform/rollback-concurrent", + "python/langgraph-platform/reject-concurrent", + "python/langgraph-platform/enqueue-concurrent" + ] + } + ] + }, + { + "group": "LangGraph Studio", + "pages": [ + "python/langgraph-platform/langgraph-studio", + "python/langgraph-platform/invoke-studio", + "python/langgraph-platform/manage-assistants-studio", + "python/langgraph-platform/threads-studio", + "python/langgraph-platform/iterate-graph-studio", + "python/langgraph-platform/run-evals-studio", + "python/langgraph-platform/clone-traces-studio", + "python/langgraph-platform/datasets-studio", + "python/langgraph-platform/troubleshooting-studio" ] } ] }, { - "group": "Run and debug", - "pages": [ - "oss/local-server", - "oss/ui", - "oss/trace-agent", - "oss/evals" + "tab": "Deploy", + "groups": [ + { + "group": "Overview", + "pages": [ + "python/langgraph-platform/deployment-options", + "python/langgraph-platform/cloud", + "python/langgraph-platform/hybrid", + "python/langgraph-platform/self-hosted" + ] + }, + { + "group": "Guides for deployment", + "pages": [ + "python/langgraph-platform/deploy-to-cloud", + "python/langgraph-platform/deploy-hybrid", + "python/langgraph-platform/deploy-self-hosted-full-platform", + "python/langgraph-platform/deploy-data-plane-only", + "python/langgraph-platform/use-remote-graph" + ] + }, + { + "group": "Configure your application for deployment", + "pages": [ + "python/langgraph-platform/setup-app-requirements-txt", + "python/langgraph-platform/setup-pyproject", + "python/langgraph-platform/setup-javascript", + "python/langgraph-platform/custom-docker", + "python/langgraph-platform/graph-rebuild", + "python/langgraph-platform/langgraph-cli", + "python/langgraph-platform/sdk", + "python/langgraph-platform/egress-metrics-metadata" + ] + } ] }, { - "group": "LangGraph APIs", - "pages": [ + "tab": "Manage", + "groups": [ + { + "group": "Authentication & access control", + "pages": [ + "python/langgraph-platform/auth", + "python/langgraph-platform/custom-auth", + "python/langgraph-platform/set-up-custom-auth", + "python/langgraph-platform/resource-auth", + "python/langgraph-platform/add-auth-server", + "python/langgraph-platform/openapi-security" + ] + }, + { + "group": "Scalability & resilience", + "pages": [ + "python/langgraph-platform/scalability-and-resilience" + ] + }, { - "group": "Graph API", + "group": "Server customization", "pages": [ - "oss/graph-api", - "oss/use-graph-api" + "python/langgraph-platform/custom-lifespan", + "python/langgraph-platform/custom-middleware", + "python/langgraph-platform/custom-routes" ] }, { - "group": "Functional API", + "group": "Data management", "pages": [ - "oss/functional-api", - "oss/use-functional-api" + "python/langgraph-platform/data-storage-and-privacy", + "python/langgraph-platform/semantic-search", + "python/langgraph-platform/configure-ttl" ] }, - "oss/pregel" + { + "group": "Tutorials", + "pages": [ + "python/langgraph-platform/autogen-integration", + "python/langgraph-platform/use-stream-react", + "python/langgraph-platform/generative-ui-react" + ] + } + ] + }, + { + "tab": "Reference", + "pages": [ + "langgraph-platform/reference-overview", + "langgraph-platform/server-api-ref", + "langgraph-platform/langgraph-server-changelog", + "langgraph-platform/api-ref-control-plane", + "langgraph-platform/cli", + "langgraph-platform/env-var", + "langgraph-platform/python-sdk", + "langgraph-platform/js-ts-sdk", + "langgraph-platform/remote-graph", + "langgraph-platform/faq" ] } ] }, { - "tab": "Reference", - "groups": [ + "dropdown": "LangChain Labs", + "icon": "/images/brand/langchain-labs-pill.svg", + "description": "Experimental AI products from LangChain", + "tabs": [ { - "group": "LangGraph reference", + "tab": "Overview", "pages": [ - "oss/reference/overview", - "oss/reference/graphs", - "oss/reference/functional-api", - "oss/reference/pregel", - "oss/reference/checkpointers", - "oss/reference/storage", - "oss/reference/caching", - "oss/reference/types", - "oss/reference/runtime", - "oss/reference/config", - "oss/reference/errors", - "oss/reference/constants", - "oss/reference/channels" + "labs/index" ] }, { - "group": "Prebuilt reference", + "tab": "Open SWE", "pages": [ - "oss/reference/agents", - "oss/reference/supervisor", - "oss/reference/swarm", - "oss/reference/mcp" - ] - }, - { - "group": "Error troubleshooting", - "pages": [ - "oss/common-errors", - "oss/GRAPH_RECURSION_LIMIT", - "oss/INVALID_CHAT_HISTORY", - "oss/INVALID_CONCURRENT_GRAPH_UPDATE", - "oss/INVALID_GRAPH_NODE_RETURN_VALUE", - "oss/MULTIPLE_SUBGRAPHS" + { + "group": "Get Started", + "pages": [ + "labs/swe/index" + ] + }, + { + "group": "Usage", + "pages": [ + "labs/swe/usage/intro", + "labs/swe/usage/ui", + "labs/swe/usage/github", + "labs/swe/usage/best-practices", + "labs/swe/usage/custom-rules", + "labs/swe/usage/examples" + ] + }, + { + "group": "Development Setup", + "pages": [ + "labs/swe/setup/intro", + "labs/swe/setup/development", + "labs/swe/setup/authentication", + "labs/swe/setup/monorepo", + "labs/swe/setup/ci" + ] + }, + { + "group": "FAQ", + "pages": [ + "labs/swe/faq" + ] + } ] } ] @@ -273,263 +543,485 @@ ] }, { - "dropdown": "LangGraph Platform", - "icon": "/images/brand/langgraph-platform-pill.svg", - "description": "Platform for building and deploying AI agents", - "tabs": [ + "version": "JavaScript", + "dropdowns": [ { - "tab": "Get started", - "groups": [ + "dropdown": "LangGraph", + "icon": "/images/brand/langgraph-pill.svg", + "description": "Framework for building reliable agents and workflows", + "tabs": [ { - "group": "Overview", - "pages": [ - "langgraph-platform/index", + "tab": "Get started", + "groups": [ { - "group": "Components", + "group": "Get started", "pages": [ - "langgraph-platform/components", - "langgraph-platform/langgraph-server", - "langgraph-platform/data-plane", - "langgraph-platform/control-plane" + "javascript/oss/overview", + "javascript/oss/quickstart", + "javascript/oss/run-an-agent", + "javascript/oss/template-applications" ] }, - "langgraph-platform/application-structure" - ] - }, - { - "group": "Quickstarts", - "pages": [ - "langgraph-platform/local-server", - "langgraph-platform/deployment-quickstart", - "langgraph-platform/quick-start-studio" + { + "group": "General concepts", + "pages": [ + "javascript/oss/workflows-and-agents", + "javascript/oss/prebuilt-vs-low-level", + { + "group": "Common agent architectures", + "pages": [ + "javascript/oss/agentic-architectures", + "javascript/oss/agentic-rag", + "javascript/oss/agent-supervisor", + "javascript/oss/sql-agent" + ] + } + ] + }, + { + "group": "Additional resources", + "pages": [ + "javascript/oss/case-studies", + "javascript/oss/faq", + "javascript/oss/langgraph-academy" + ] + } ] }, { - "group": "Plans and deployment", - "pages": [ - "langgraph-platform/plans" - ] - } - ] - }, - { - "tab": "Build", - "groups": [ - { - "group": "Build an app with the LangGraph basics", - "pages": [ - "langgraph-platform/langgraph-basics/why-langgraph", - "langgraph-platform/langgraph-basics/1-build-basic-chatbot", - "langgraph-platform/langgraph-basics/2-add-tools", - "langgraph-platform/langgraph-basics/3-add-memory", - "langgraph-platform/langgraph-basics/4-human-in-the-loop", - "langgraph-platform/langgraph-basics/5-customize-state", - "langgraph-platform/langgraph-basics/6-time-travel" + "tab": "Build agents", + "groups": [ + { + "group": "Basic configuration", + "pages": [ + "javascript/oss/prebuilts" + ] + }, + { + "group": "Low-level configuration", + "pages": [ + "javascript/oss/why-langgraph", + "javascript/oss/1-build-basic-chatbot", + "javascript/oss/2-add-tools", + "javascript/oss/3-add-memory", + "javascript/oss/4-human-in-the-loop", + "javascript/oss/5-customize-state", + "javascript/oss/6-time-travel" + ] + }, + { + "group": "Components", + "pages": [ + "javascript/oss/models", + { + "group": "Tools", + "pages": [ + "javascript/oss/tools", + "javascript/oss/call-tools" + ] + }, + { + "group": "MCP", + "pages": [ + "javascript/oss/mcp", + "javascript/oss/use-mcp" + ] + }, + { + "group": "Multi-agent", + "pages": [ + "javascript/oss/multi-agent", + "javascript/oss/multi-agent-prebuilts", + "javascript/oss/multi-agent-custom" + ] + } + ] + } ] }, { - "group": "Data models", - "pages": [ + "tab": "Agent runtime", + "groups": [ + { + "group": "Capabilities", + "pages": [ + "javascript/oss/persistence", + "javascript/oss/durable-execution", + { + "group": "Streaming", + "pages": [ + "javascript/oss/streaming", + "javascript/oss/use-streaming" + ] + }, + { + "group": "Human-in-the-loop", + "pages": [ + "javascript/oss/human-in-the-loop", + "javascript/oss/add-human-in-the-loop" + ] + }, + { + "group": "Time travel", + "pages": [ + "javascript/oss/time-travel", + "javascript/oss/use-time-travel" + ] + }, + { + "group": "Memory and context", + "pages": [ + "javascript/oss/memory", + "javascript/oss/context", + "javascript/oss/add-memory" + ] + }, + { + "group": "Subgraphs", + "pages": [ + "javascript/oss/subgraphs", + "javascript/oss/use-subgraphs" + ] + } + ] + }, { - "group": "Assistants", + "group": "Run and debug", "pages": [ - "langgraph-platform/assistants", - "langgraph-platform/configuration-cloud", - "langgraph-platform/use-threads" + "javascript/oss/local-server", + "javascript/oss/ui", + "javascript/oss/trace-agent", + "javascript/oss/evals" ] }, { - "group": "Runs", + "group": "LangGraph APIs", "pages": [ - "langgraph-platform/background-run", - "langgraph-platform/same-thread", - "langgraph-platform/cron-jobs", - "langgraph-platform/stateless-runs", - "langgraph-platform/configurable-headers" + { + "group": "Graph API", + "pages": [ + "javascript/oss/graph-api", + "javascript/oss/use-graph-api" + ] + }, + { + "group": "Functional API", + "pages": [ + "javascript/oss/functional-api", + "javascript/oss/use-functional-api" + ] + }, + "javascript/oss/pregel" ] } ] }, { - "group": "Core capabilities", - "pages": [ - "langgraph-platform/streaming", - "langgraph-platform/add-human-in-the-loop", - "langgraph-platform/human-in-the-loop-time-travel", - "langgraph-platform/server-mcp", - "langgraph-platform/use-webhooks", + "tab": "Reference", + "groups": [ { - "group": "Double-texting", + "group": "LangGraph reference", "pages": [ - "langgraph-platform/double-texting", - "langgraph-platform/interrupt-concurrent", - "langgraph-platform/rollback-concurrent", - "langgraph-platform/reject-concurrent", - "langgraph-platform/enqueue-concurrent" + "javascript/oss/reference/overview", + "javascript/oss/reference/graphs", + "javascript/oss/reference/functional-api", + "javascript/oss/reference/pregel", + "javascript/oss/reference/checkpointers", + "javascript/oss/reference/storage", + "javascript/oss/reference/caching", + "javascript/oss/reference/types", + "javascript/oss/reference/runtime", + "javascript/oss/reference/config", + "javascript/oss/reference/errors", + "javascript/oss/reference/constants", + "javascript/oss/reference/channels" + ] + }, + { + "group": "Prebuilt reference", + "pages": [ + "javascript/oss/reference/agents", + "javascript/oss/reference/supervisor", + "javascript/oss/reference/swarm", + "javascript/oss/reference/mcp" + ] + }, + { + "group": "Error troubleshooting", + "pages": [ + "javascript/oss/common-errors", + "javascript/oss/GRAPH_RECURSION_LIMIT", + "javascript/oss/INVALID_CHAT_HISTORY", + "javascript/oss/INVALID_CONCURRENT_GRAPH_UPDATE", + "javascript/oss/INVALID_GRAPH_NODE_RETURN_VALUE", + "javascript/oss/MULTIPLE_SUBGRAPHS" ] } ] - }, - { - "group": "LangGraph Studio", - "pages": [ - "langgraph-platform/langgraph-studio", - "langgraph-platform/invoke-studio", - "langgraph-platform/manage-assistants-studio", - "langgraph-platform/threads-studio", - "langgraph-platform/iterate-graph-studio", - "langgraph-platform/run-evals-studio", - "langgraph-platform/clone-traces-studio", - "langgraph-platform/datasets-studio", - "langgraph-platform/troubleshooting-studio" - ] } ] }, { - "tab": "Deploy", - "groups": [ + "dropdown": "LangGraph Platform", + "icon": "/images/brand/langgraph-platform-pill.svg", + "description": "Platform for building and deploying AI agents", + "tabs": [ { - "group": "Overview", - "pages": [ - "langgraph-platform/deployment-options", - "langgraph-platform/cloud", - "langgraph-platform/hybrid", - "langgraph-platform/self-hosted" + "tab": "Get started", + "groups": [ + { + "group": "Overview", + "pages": [ + "javascript/langgraph-platform/index", + { + "group": "Components", + "pages": [ + "javascript/langgraph-platform/components", + "javascript/langgraph-platform/langgraph-server", + "javascript/langgraph-platform/data-plane", + "javascript/langgraph-platform/control-plane" + ] + }, + "javascript/langgraph-platform/application-structure" + ] + }, + { + "group": "Quickstarts", + "pages": [ + "javascript/langgraph-platform/local-server", + "javascript/langgraph-platform/deployment-quickstart", + "javascript/langgraph-platform/quick-start-studio" + ] + }, + { + "group": "Plans and deployment", + "pages": [ + "javascript/langgraph-platform/plans" + ] + } ] }, { - "group": "Guides for deployment", - "pages": [ - "langgraph-platform/deploy-to-cloud", - "langgraph-platform/deploy-hybrid", - "langgraph-platform/deploy-self-hosted-full-platform", - "langgraph-platform/deploy-data-plane-only", - "langgraph-platform/use-remote-graph" + "tab": "Build", + "groups": [ + { + "group": "Build an app with the LangGraph basics", + "pages": [ + "javascript/langgraph-platform/langgraph-basics/why-langgraph", + "javascript/langgraph-platform/langgraph-basics/1-build-basic-chatbot", + "javascript/langgraph-platform/langgraph-basics/2-add-tools", + "javascript/langgraph-platform/langgraph-basics/3-add-memory", + "javascript/langgraph-platform/langgraph-basics/4-human-in-the-loop", + "javascript/langgraph-platform/langgraph-basics/5-customize-state", + "javascript/langgraph-platform/langgraph-basics/6-time-travel" + ] + }, + { + "group": "Data models", + "pages": [ + { + "group": "Assistants", + "pages": [ + "javascript/langgraph-platform/assistants", + "javascript/langgraph-platform/configuration-cloud", + "javascript/langgraph-platform/use-threads" + ] + }, + { + "group": "Runs", + "pages": [ + "javascript/langgraph-platform/background-run", + "javascript/langgraph-platform/same-thread", + "javascript/langgraph-platform/cron-jobs", + "javascript/langgraph-platform/stateless-runs", + "javascript/langgraph-platform/configurable-headers" + ] + } + ] + }, + { + "group": "Core capabilities", + "pages": [ + "javascript/langgraph-platform/streaming", + "javascript/langgraph-platform/add-human-in-the-loop", + "javascript/langgraph-platform/human-in-the-loop-time-travel", + "javascript/langgraph-platform/server-mcp", + "javascript/langgraph-platform/use-webhooks", + { + "group": "Double-texting", + "pages": [ + "javascript/langgraph-platform/double-texting", + "javascript/langgraph-platform/interrupt-concurrent", + "javascript/langgraph-platform/rollback-concurrent", + "javascript/langgraph-platform/reject-concurrent", + "javascript/langgraph-platform/enqueue-concurrent" + ] + } + ] + }, + { + "group": "LangGraph Studio", + "pages": [ + "javascript/langgraph-platform/langgraph-studio", + "javascript/langgraph-platform/invoke-studio", + "javascript/langgraph-platform/manage-assistants-studio", + "javascript/langgraph-platform/threads-studio", + "javascript/langgraph-platform/iterate-graph-studio", + "javascript/langgraph-platform/run-evals-studio", + "javascript/langgraph-platform/clone-traces-studio", + "javascript/langgraph-platform/datasets-studio", + "javascript/langgraph-platform/troubleshooting-studio" + ] + } ] }, { - "group": "Configure your application for deployment", - "pages": [ - "langgraph-platform/setup-app-requirements-txt", - "langgraph-platform/setup-pyproject", - "langgraph-platform/setup-javascript", - "langgraph-platform/custom-docker", - "langgraph-platform/graph-rebuild", - "langgraph-platform/langgraph-cli", - "langgraph-platform/sdk", - "langgraph-platform/egress-metrics-metadata" - ] - } - ] - }, - { - "tab": "Manage", - "groups": [ - - { - "group": "Authentication & access control", - "pages": [ - "langgraph-platform/auth", - "langgraph-platform/custom-auth", - "langgraph-platform/set-up-custom-auth", - "langgraph-platform/resource-auth", - "langgraph-platform/add-auth-server", - "langgraph-platform/openapi-security" + "tab": "Deploy", + "groups": [ + { + "group": "Overview", + "pages": [ + "javascript/langgraph-platform/deployment-options", + "javascript/langgraph-platform/cloud", + "javascript/langgraph-platform/hybrid", + "javascript/langgraph-platform/self-hosted" + ] + }, + { + "group": "Guides for deployment", + "pages": [ + "javascript/langgraph-platform/deploy-to-cloud", + "javascript/langgraph-platform/deploy-hybrid", + "javascript/langgraph-platform/deploy-self-hosted-full-platform", + "javascript/langgraph-platform/deploy-data-plane-only", + "javascript/langgraph-platform/use-remote-graph" + ] + }, + { + "group": "Configure your application for deployment", + "pages": [ + "javascript/langgraph-platform/setup-app-requirements-txt", + "javascript/langgraph-platform/setup-pyproject", + "javascript/langgraph-platform/setup-javascript", + "javascript/langgraph-platform/custom-docker", + "javascript/langgraph-platform/graph-rebuild", + "javascript/langgraph-platform/langgraph-cli", + "javascript/langgraph-platform/sdk", + "javascript/langgraph-platform/egress-metrics-metadata" + ] + } ] }, { - "group": "Scalability & resilience", - "pages": [ - "langgraph-platform/scalability-and-resilience" + "tab": "Manage", + "groups": [ + { + "group": "Authentication & access control", + "pages": [ + "javascript/langgraph-platform/auth", + "javascript/langgraph-platform/custom-auth", + "javascript/langgraph-platform/set-up-custom-auth", + "javascript/langgraph-platform/resource-auth", + "javascript/langgraph-platform/add-auth-server", + "javascript/langgraph-platform/openapi-security" + ] + }, + { + "group": "Scalability & resilience", + "pages": [ + "javascript/langgraph-platform/scalability-and-resilience" + ] + }, + { + "group": "Server customization", + "pages": [ + "javascript/langgraph-platform/custom-lifespan", + "javascript/langgraph-platform/custom-middleware", + "javascript/langgraph-platform/custom-routes" + ] + }, + { + "group": "Data management", + "pages": [ + "javascript/langgraph-platform/data-storage-and-privacy", + "javascript/langgraph-platform/semantic-search", + "javascript/langgraph-platform/configure-ttl" + ] + }, + { + "group": "Tutorials", + "pages": [ + "javascript/langgraph-platform/autogen-integration", + "javascript/langgraph-platform/use-stream-react", + "javascript/langgraph-platform/generative-ui-react" + ] + } ] }, - { - "group": "Server customization", - "pages": [ - "langgraph-platform/custom-lifespan", - "langgraph-platform/custom-middleware", - "langgraph-platform/custom-routes" - ] - }, - { - "group": "Data management", - "pages": [ - "langgraph-platform/data-storage-and-privacy", - "langgraph-platform/semantic-search", - "langgraph-platform/configure-ttl" - ] - }, { - "group": "Tutorials", + "tab": "Reference", "pages": [ - "langgraph-platform/autogen-integration", - "langgraph-platform/use-stream-react", - "langgraph-platform/generative-ui-react" + "langgraph-platform/reference-overview", + "langgraph-platform/server-api-ref", + "langgraph-platform/langgraph-server-changelog", + "langgraph-platform/api-ref-control-plane", + "langgraph-platform/cli", + "langgraph-platform/env-var", + "langgraph-platform/python-sdk", + "langgraph-platform/js-ts-sdk", + "langgraph-platform/remote-graph", + "langgraph-platform/faq" ] } ] }, { - "tab": "Reference", - "pages": [ - "langgraph-platform/reference-overview", - "langgraph-platform/server-api-ref", - "langgraph-platform/langgraph-server-changelog", - "langgraph-platform/api-ref-control-plane", - "langgraph-platform/cli", - "langgraph-platform/env-var", - "langgraph-platform/python-sdk", - "langgraph-platform/js-ts-sdk", - "langgraph-platform/remote-graph", - "langgraph-platform/faq" - ] - } - ] - }, - { - "dropdown": "LangChain Labs", - "icon": "/images/brand/langchain-labs-pill.svg", - "description": "Experimental AI products from LangChain", - "tabs": [ - { - "tab": "Overview", - "pages": ["labs/index"] - }, - { - "tab": "Open SWE", - "pages": [ - { - "group": "Get Started", - "pages": [ - "labs/swe/index" - ] - }, - { - "group": "Usage", - "pages": [ - "labs/swe/usage/intro", - "labs/swe/usage/ui", - "labs/swe/usage/github", - "labs/swe/usage/best-practices", - "labs/swe/usage/custom-rules", - "labs/swe/usage/examples" - ] - }, + "dropdown": "LangChain Labs", + "icon": "/images/brand/langchain-labs-pill.svg", + "description": "Experimental AI products from LangChain", + "tabs": [ { - "group": "Development Setup", + "tab": "Overview", "pages": [ - "labs/swe/setup/intro", - "labs/swe/setup/development", - "labs/swe/setup/authentication", - "labs/swe/setup/monorepo", - "labs/swe/setup/ci" + "labs/index" ] }, { - "group": "FAQ", + "tab": "Open SWE", "pages": [ - "labs/swe/faq" + { + "group": "Get Started", + "pages": [ + "labs/swe/index" + ] + }, + { + "group": "Usage", + "pages": [ + "labs/swe/usage/intro", + "labs/swe/usage/ui", + "labs/swe/usage/github", + "labs/swe/usage/best-practices", + "labs/swe/usage/custom-rules", + "labs/swe/usage/examples" + ] + }, + { + "group": "Development Setup", + "pages": [ + "labs/swe/setup/intro", + "labs/swe/setup/development", + "labs/swe/setup/authentication", + "labs/swe/setup/monorepo", + "labs/swe/setup/ci" + ] + }, + { + "group": "FAQ", + "pages": [ + "labs/swe/faq" + ] + } ] } ] @@ -538,4 +1030,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/docs.json.backup b/src/docs.json.backup new file mode 100644 index 00000000..1eead6d7 --- /dev/null +++ b/src/docs.json.backup @@ -0,0 +1,541 @@ +{ + "$schema": "https://mintlify.com/docs.json", + "theme": "maple", + "name": "Docs by LangChain", + "description": "Documentation for LangChain, LangGraph, LangGraph Platform, LangSmith, and more.", + "colors": { + "primary": "#beb4fd", + "light": "#beb4fd", + "dark": "#1d3d3c" + }, + "logo": { + "light": "/images/brand/langchain-docs-teal.svg", + "dark": "/images/brand/langchain-docs-lilac.svg", + "href": "https://docs.langchain.com/langgraph-platform" + }, + "favicon": { + "light": "/images/brand/favicon.svg", + "dark": "/images/brand/favicon-dark-mode.svg" + }, + "navbar": { + "links": [ + { + "label": "Forum", + "href": "https://forum.langchain.com/" + }, + { + "label": "Trust center", + "href": "https://trust.langchain.com/" + } + ] + }, + "fonts": { + "family": "Manrope" + }, + "styling": { + "eyebrows": "breadcrumbs" + }, + "contextual": { + "options": [ + "copy", + "view", + { + "title": "llms.txt", + "description": "Open llms.txt for this site", + "icon": "file", + "href": "https://docs.langchain.com/llms.txt" + }, + "chatgpt", + "claude" + ] + }, + "integrations": { + "gtm": { + "tagId": "GTM-MBBX68ST" + } + }, + "navigation": { + "dropdowns": [ + { + "dropdown": "LangGraph", + "icon": "/images/brand/langgraph-pill.svg", + "description": "Framework for building reliable agents and workflows", + "tabs": [ + { + "tab": "Get started", + "groups": [ + { + "group": "Get started", + "pages": [ + "oss/overview", + "oss/quickstart", + "oss/run-an-agent", + "oss/template-applications" + ] + }, + { + "group": "General concepts", + "pages": [ + "oss/workflows-and-agents", + "oss/prebuilt-vs-low-level", + { + "group": "Common agent architectures", + "pages": [ + "oss/agentic-architectures", + "oss/agentic-rag", + "oss/agent-supervisor", + "oss/sql-agent" + ] + } + ] + }, + { + "group": "Additional resources", + "pages": [ + "oss/case-studies", + "oss/faq", + "oss/langgraph-academy" + ] + } + ] + }, + { + "tab": "Build agents", + "groups": [ + { + "group": "Basic configuration", + "pages": [ + "oss/prebuilts" + ] + }, + { + "group": "Low-level configuration", + "pages": [ + "oss/why-langgraph", + "oss/1-build-basic-chatbot", + "oss/2-add-tools", + "oss/3-add-memory", + "oss/4-human-in-the-loop", + "oss/5-customize-state", + "oss/6-time-travel" + ] + }, + { + "group": "Components", + "pages": [ + "oss/models", + { + "group": "Tools", + "pages": [ + "oss/tools", + "oss/call-tools" + ] + }, + { + "group": "MCP", + "pages": [ + "oss/mcp", + "oss/use-mcp" + ] + }, + { + "group": "Multi-agent", + "pages": [ + "oss/multi-agent", + "oss/multi-agent-prebuilts", + "oss/multi-agent-custom" + ] + } + ] + } + ] + }, + { + "tab": "Agent runtime", + "groups": [ + { + "group": "Capabilities", + "pages": [ + "oss/persistence", + "oss/durable-execution", + { + "group": "Streaming", + "pages": [ + "oss/streaming", + "oss/use-streaming" + ] + }, + { + "group": "Human-in-the-loop", + "pages": [ + "oss/human-in-the-loop", + "oss/add-human-in-the-loop" + ] + }, + { + "group": "Time travel", + "pages": [ + "oss/time-travel", + "oss/use-time-travel" + ] + }, + { + "group": "Memory and context", + "pages": [ + "oss/memory", + "oss/context", + "oss/add-memory" + ] + }, + { + "group": "Subgraphs", + "pages": [ + "oss/subgraphs", + "oss/use-subgraphs" + ] + } + ] + }, + { + "group": "Run and debug", + "pages": [ + "oss/local-server", + "oss/ui", + "oss/trace-agent", + "oss/evals" + ] + }, + { + "group": "LangGraph APIs", + "pages": [ + { + "group": "Graph API", + "pages": [ + "oss/graph-api", + "oss/use-graph-api" + ] + }, + { + "group": "Functional API", + "pages": [ + "oss/functional-api", + "oss/use-functional-api" + ] + }, + "oss/pregel" + ] + } + ] + }, + { + "tab": "Reference", + "groups": [ + { + "group": "LangGraph reference", + "pages": [ + "oss/reference/overview", + "oss/reference/graphs", + "oss/reference/functional-api", + "oss/reference/pregel", + "oss/reference/checkpointers", + "oss/reference/storage", + "oss/reference/caching", + "oss/reference/types", + "oss/reference/runtime", + "oss/reference/config", + "oss/reference/errors", + "oss/reference/constants", + "oss/reference/channels" + ] + }, + { + "group": "Prebuilt reference", + "pages": [ + "oss/reference/agents", + "oss/reference/supervisor", + "oss/reference/swarm", + "oss/reference/mcp" + ] + }, + { + "group": "Error troubleshooting", + "pages": [ + "oss/common-errors", + "oss/GRAPH_RECURSION_LIMIT", + "oss/INVALID_CHAT_HISTORY", + "oss/INVALID_CONCURRENT_GRAPH_UPDATE", + "oss/INVALID_GRAPH_NODE_RETURN_VALUE", + "oss/MULTIPLE_SUBGRAPHS" + ] + } + ] + } + ] + }, + { + "dropdown": "LangGraph Platform", + "icon": "/images/brand/langgraph-platform-pill.svg", + "description": "Platform for building and deploying AI agents", + "tabs": [ + { + "tab": "Get started", + "groups": [ + { + "group": "Overview", + "pages": [ + "langgraph-platform/index", + { + "group": "Components", + "pages": [ + "langgraph-platform/components", + "langgraph-platform/langgraph-server", + "langgraph-platform/data-plane", + "langgraph-platform/control-plane" + ] + }, + "langgraph-platform/application-structure" + ] + }, + { + "group": "Quickstarts", + "pages": [ + "langgraph-platform/local-server", + "langgraph-platform/deployment-quickstart", + "langgraph-platform/quick-start-studio" + ] + }, + { + "group": "Plans and deployment", + "pages": [ + "langgraph-platform/plans" + ] + } + ] + }, + { + "tab": "Build", + "groups": [ + { + "group": "Build an app with the LangGraph basics", + "pages": [ + "langgraph-platform/langgraph-basics/why-langgraph", + "langgraph-platform/langgraph-basics/1-build-basic-chatbot", + "langgraph-platform/langgraph-basics/2-add-tools", + "langgraph-platform/langgraph-basics/3-add-memory", + "langgraph-platform/langgraph-basics/4-human-in-the-loop", + "langgraph-platform/langgraph-basics/5-customize-state", + "langgraph-platform/langgraph-basics/6-time-travel" + ] + }, + { + "group": "Data models", + "pages": [ + { + "group": "Assistants", + "pages": [ + "langgraph-platform/assistants", + "langgraph-platform/configuration-cloud", + "langgraph-platform/use-threads" + ] + }, + { + "group": "Runs", + "pages": [ + "langgraph-platform/background-run", + "langgraph-platform/same-thread", + "langgraph-platform/cron-jobs", + "langgraph-platform/stateless-runs", + "langgraph-platform/configurable-headers" + ] + } + ] + }, + { + "group": "Core capabilities", + "pages": [ + "langgraph-platform/streaming", + "langgraph-platform/add-human-in-the-loop", + "langgraph-platform/human-in-the-loop-time-travel", + "langgraph-platform/server-mcp", + "langgraph-platform/use-webhooks", + { + "group": "Double-texting", + "pages": [ + "langgraph-platform/double-texting", + "langgraph-platform/interrupt-concurrent", + "langgraph-platform/rollback-concurrent", + "langgraph-platform/reject-concurrent", + "langgraph-platform/enqueue-concurrent" + ] + } + ] + }, + { + "group": "LangGraph Studio", + "pages": [ + "langgraph-platform/langgraph-studio", + "langgraph-platform/invoke-studio", + "langgraph-platform/manage-assistants-studio", + "langgraph-platform/threads-studio", + "langgraph-platform/iterate-graph-studio", + "langgraph-platform/run-evals-studio", + "langgraph-platform/clone-traces-studio", + "langgraph-platform/datasets-studio", + "langgraph-platform/troubleshooting-studio" + ] + } + ] + }, + { + "tab": "Deploy", + "groups": [ + { + "group": "Overview", + "pages": [ + "langgraph-platform/deployment-options", + "langgraph-platform/cloud", + "langgraph-platform/hybrid", + "langgraph-platform/self-hosted" + ] + }, + { + "group": "Guides for deployment", + "pages": [ + "langgraph-platform/deploy-to-cloud", + "langgraph-platform/deploy-hybrid", + "langgraph-platform/deploy-self-hosted-full-platform", + "langgraph-platform/deploy-data-plane-only", + "langgraph-platform/use-remote-graph" + ] + }, + { + "group": "Configure your application for deployment", + "pages": [ + "langgraph-platform/setup-app-requirements-txt", + "langgraph-platform/setup-pyproject", + "langgraph-platform/setup-javascript", + "langgraph-platform/custom-docker", + "langgraph-platform/graph-rebuild", + "langgraph-platform/langgraph-cli", + "langgraph-platform/sdk", + "langgraph-platform/egress-metrics-metadata" + ] + } + ] + }, + { + "tab": "Manage", + "groups": [ + + { + "group": "Authentication & access control", + "pages": [ + "langgraph-platform/auth", + "langgraph-platform/custom-auth", + "langgraph-platform/set-up-custom-auth", + "langgraph-platform/resource-auth", + "langgraph-platform/add-auth-server", + "langgraph-platform/openapi-security" + ] + }, + { + "group": "Scalability & resilience", + "pages": [ + "langgraph-platform/scalability-and-resilience" + ] + }, + { + "group": "Server customization", + "pages": [ + "langgraph-platform/custom-lifespan", + "langgraph-platform/custom-middleware", + "langgraph-platform/custom-routes" + ] + }, + { + "group": "Data management", + "pages": [ + "langgraph-platform/data-storage-and-privacy", + "langgraph-platform/semantic-search", + "langgraph-platform/configure-ttl" + ] + }, + { + "group": "Tutorials", + "pages": [ + "langgraph-platform/autogen-integration", + "langgraph-platform/use-stream-react", + "langgraph-platform/generative-ui-react" + ] + } + ] + }, + { + "tab": "Reference", + "pages": [ + "langgraph-platform/reference-overview", + "langgraph-platform/server-api-ref", + "langgraph-platform/langgraph-server-changelog", + "langgraph-platform/api-ref-control-plane", + "langgraph-platform/cli", + "langgraph-platform/env-var", + "langgraph-platform/python-sdk", + "langgraph-platform/js-ts-sdk", + "langgraph-platform/remote-graph", + "langgraph-platform/faq" + ] + } + ] + }, + { + "dropdown": "LangChain Labs", + "icon": "/images/brand/langchain-labs-pill.svg", + "description": "Experimental AI products from LangChain", + "tabs": [ + { + "tab": "Overview", + "pages": ["labs/index"] + }, + { + "tab": "Open SWE", + "pages": [ + { + "group": "Get Started", + "pages": [ + "labs/swe/index" + ] + }, + { + "group": "Usage", + "pages": [ + "labs/swe/usage/intro", + "labs/swe/usage/ui", + "labs/swe/usage/github", + "labs/swe/usage/best-practices", + "labs/swe/usage/custom-rules", + "labs/swe/usage/examples" + ] + }, + { + "group": "Development Setup", + "pages": [ + "labs/swe/setup/intro", + "labs/swe/setup/development", + "labs/swe/setup/authentication", + "labs/swe/setup/monorepo", + "labs/swe/setup/ci" + ] + }, + { + "group": "FAQ", + "pages": [ + "labs/swe/faq" + ] + } + ] + } + ] + } + ] + } +} From ee7d177ee7714c8891bb1abb35a357dd37513407 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Wed, 6 Aug 2025 10:22:52 -0700 Subject: [PATCH 02/17] Remove backup file --- src/docs.json.backup | 541 ------------------------------------------- 1 file changed, 541 deletions(-) delete mode 100644 src/docs.json.backup diff --git a/src/docs.json.backup b/src/docs.json.backup deleted file mode 100644 index 1eead6d7..00000000 --- a/src/docs.json.backup +++ /dev/null @@ -1,541 +0,0 @@ -{ - "$schema": "https://mintlify.com/docs.json", - "theme": "maple", - "name": "Docs by LangChain", - "description": "Documentation for LangChain, LangGraph, LangGraph Platform, LangSmith, and more.", - "colors": { - "primary": "#beb4fd", - "light": "#beb4fd", - "dark": "#1d3d3c" - }, - "logo": { - "light": "/images/brand/langchain-docs-teal.svg", - "dark": "/images/brand/langchain-docs-lilac.svg", - "href": "https://docs.langchain.com/langgraph-platform" - }, - "favicon": { - "light": "/images/brand/favicon.svg", - "dark": "/images/brand/favicon-dark-mode.svg" - }, - "navbar": { - "links": [ - { - "label": "Forum", - "href": "https://forum.langchain.com/" - }, - { - "label": "Trust center", - "href": "https://trust.langchain.com/" - } - ] - }, - "fonts": { - "family": "Manrope" - }, - "styling": { - "eyebrows": "breadcrumbs" - }, - "contextual": { - "options": [ - "copy", - "view", - { - "title": "llms.txt", - "description": "Open llms.txt for this site", - "icon": "file", - "href": "https://docs.langchain.com/llms.txt" - }, - "chatgpt", - "claude" - ] - }, - "integrations": { - "gtm": { - "tagId": "GTM-MBBX68ST" - } - }, - "navigation": { - "dropdowns": [ - { - "dropdown": "LangGraph", - "icon": "/images/brand/langgraph-pill.svg", - "description": "Framework for building reliable agents and workflows", - "tabs": [ - { - "tab": "Get started", - "groups": [ - { - "group": "Get started", - "pages": [ - "oss/overview", - "oss/quickstart", - "oss/run-an-agent", - "oss/template-applications" - ] - }, - { - "group": "General concepts", - "pages": [ - "oss/workflows-and-agents", - "oss/prebuilt-vs-low-level", - { - "group": "Common agent architectures", - "pages": [ - "oss/agentic-architectures", - "oss/agentic-rag", - "oss/agent-supervisor", - "oss/sql-agent" - ] - } - ] - }, - { - "group": "Additional resources", - "pages": [ - "oss/case-studies", - "oss/faq", - "oss/langgraph-academy" - ] - } - ] - }, - { - "tab": "Build agents", - "groups": [ - { - "group": "Basic configuration", - "pages": [ - "oss/prebuilts" - ] - }, - { - "group": "Low-level configuration", - "pages": [ - "oss/why-langgraph", - "oss/1-build-basic-chatbot", - "oss/2-add-tools", - "oss/3-add-memory", - "oss/4-human-in-the-loop", - "oss/5-customize-state", - "oss/6-time-travel" - ] - }, - { - "group": "Components", - "pages": [ - "oss/models", - { - "group": "Tools", - "pages": [ - "oss/tools", - "oss/call-tools" - ] - }, - { - "group": "MCP", - "pages": [ - "oss/mcp", - "oss/use-mcp" - ] - }, - { - "group": "Multi-agent", - "pages": [ - "oss/multi-agent", - "oss/multi-agent-prebuilts", - "oss/multi-agent-custom" - ] - } - ] - } - ] - }, - { - "tab": "Agent runtime", - "groups": [ - { - "group": "Capabilities", - "pages": [ - "oss/persistence", - "oss/durable-execution", - { - "group": "Streaming", - "pages": [ - "oss/streaming", - "oss/use-streaming" - ] - }, - { - "group": "Human-in-the-loop", - "pages": [ - "oss/human-in-the-loop", - "oss/add-human-in-the-loop" - ] - }, - { - "group": "Time travel", - "pages": [ - "oss/time-travel", - "oss/use-time-travel" - ] - }, - { - "group": "Memory and context", - "pages": [ - "oss/memory", - "oss/context", - "oss/add-memory" - ] - }, - { - "group": "Subgraphs", - "pages": [ - "oss/subgraphs", - "oss/use-subgraphs" - ] - } - ] - }, - { - "group": "Run and debug", - "pages": [ - "oss/local-server", - "oss/ui", - "oss/trace-agent", - "oss/evals" - ] - }, - { - "group": "LangGraph APIs", - "pages": [ - { - "group": "Graph API", - "pages": [ - "oss/graph-api", - "oss/use-graph-api" - ] - }, - { - "group": "Functional API", - "pages": [ - "oss/functional-api", - "oss/use-functional-api" - ] - }, - "oss/pregel" - ] - } - ] - }, - { - "tab": "Reference", - "groups": [ - { - "group": "LangGraph reference", - "pages": [ - "oss/reference/overview", - "oss/reference/graphs", - "oss/reference/functional-api", - "oss/reference/pregel", - "oss/reference/checkpointers", - "oss/reference/storage", - "oss/reference/caching", - "oss/reference/types", - "oss/reference/runtime", - "oss/reference/config", - "oss/reference/errors", - "oss/reference/constants", - "oss/reference/channels" - ] - }, - { - "group": "Prebuilt reference", - "pages": [ - "oss/reference/agents", - "oss/reference/supervisor", - "oss/reference/swarm", - "oss/reference/mcp" - ] - }, - { - "group": "Error troubleshooting", - "pages": [ - "oss/common-errors", - "oss/GRAPH_RECURSION_LIMIT", - "oss/INVALID_CHAT_HISTORY", - "oss/INVALID_CONCURRENT_GRAPH_UPDATE", - "oss/INVALID_GRAPH_NODE_RETURN_VALUE", - "oss/MULTIPLE_SUBGRAPHS" - ] - } - ] - } - ] - }, - { - "dropdown": "LangGraph Platform", - "icon": "/images/brand/langgraph-platform-pill.svg", - "description": "Platform for building and deploying AI agents", - "tabs": [ - { - "tab": "Get started", - "groups": [ - { - "group": "Overview", - "pages": [ - "langgraph-platform/index", - { - "group": "Components", - "pages": [ - "langgraph-platform/components", - "langgraph-platform/langgraph-server", - "langgraph-platform/data-plane", - "langgraph-platform/control-plane" - ] - }, - "langgraph-platform/application-structure" - ] - }, - { - "group": "Quickstarts", - "pages": [ - "langgraph-platform/local-server", - "langgraph-platform/deployment-quickstart", - "langgraph-platform/quick-start-studio" - ] - }, - { - "group": "Plans and deployment", - "pages": [ - "langgraph-platform/plans" - ] - } - ] - }, - { - "tab": "Build", - "groups": [ - { - "group": "Build an app with the LangGraph basics", - "pages": [ - "langgraph-platform/langgraph-basics/why-langgraph", - "langgraph-platform/langgraph-basics/1-build-basic-chatbot", - "langgraph-platform/langgraph-basics/2-add-tools", - "langgraph-platform/langgraph-basics/3-add-memory", - "langgraph-platform/langgraph-basics/4-human-in-the-loop", - "langgraph-platform/langgraph-basics/5-customize-state", - "langgraph-platform/langgraph-basics/6-time-travel" - ] - }, - { - "group": "Data models", - "pages": [ - { - "group": "Assistants", - "pages": [ - "langgraph-platform/assistants", - "langgraph-platform/configuration-cloud", - "langgraph-platform/use-threads" - ] - }, - { - "group": "Runs", - "pages": [ - "langgraph-platform/background-run", - "langgraph-platform/same-thread", - "langgraph-platform/cron-jobs", - "langgraph-platform/stateless-runs", - "langgraph-platform/configurable-headers" - ] - } - ] - }, - { - "group": "Core capabilities", - "pages": [ - "langgraph-platform/streaming", - "langgraph-platform/add-human-in-the-loop", - "langgraph-platform/human-in-the-loop-time-travel", - "langgraph-platform/server-mcp", - "langgraph-platform/use-webhooks", - { - "group": "Double-texting", - "pages": [ - "langgraph-platform/double-texting", - "langgraph-platform/interrupt-concurrent", - "langgraph-platform/rollback-concurrent", - "langgraph-platform/reject-concurrent", - "langgraph-platform/enqueue-concurrent" - ] - } - ] - }, - { - "group": "LangGraph Studio", - "pages": [ - "langgraph-platform/langgraph-studio", - "langgraph-platform/invoke-studio", - "langgraph-platform/manage-assistants-studio", - "langgraph-platform/threads-studio", - "langgraph-platform/iterate-graph-studio", - "langgraph-platform/run-evals-studio", - "langgraph-platform/clone-traces-studio", - "langgraph-platform/datasets-studio", - "langgraph-platform/troubleshooting-studio" - ] - } - ] - }, - { - "tab": "Deploy", - "groups": [ - { - "group": "Overview", - "pages": [ - "langgraph-platform/deployment-options", - "langgraph-platform/cloud", - "langgraph-platform/hybrid", - "langgraph-platform/self-hosted" - ] - }, - { - "group": "Guides for deployment", - "pages": [ - "langgraph-platform/deploy-to-cloud", - "langgraph-platform/deploy-hybrid", - "langgraph-platform/deploy-self-hosted-full-platform", - "langgraph-platform/deploy-data-plane-only", - "langgraph-platform/use-remote-graph" - ] - }, - { - "group": "Configure your application for deployment", - "pages": [ - "langgraph-platform/setup-app-requirements-txt", - "langgraph-platform/setup-pyproject", - "langgraph-platform/setup-javascript", - "langgraph-platform/custom-docker", - "langgraph-platform/graph-rebuild", - "langgraph-platform/langgraph-cli", - "langgraph-platform/sdk", - "langgraph-platform/egress-metrics-metadata" - ] - } - ] - }, - { - "tab": "Manage", - "groups": [ - - { - "group": "Authentication & access control", - "pages": [ - "langgraph-platform/auth", - "langgraph-platform/custom-auth", - "langgraph-platform/set-up-custom-auth", - "langgraph-platform/resource-auth", - "langgraph-platform/add-auth-server", - "langgraph-platform/openapi-security" - ] - }, - { - "group": "Scalability & resilience", - "pages": [ - "langgraph-platform/scalability-and-resilience" - ] - }, - { - "group": "Server customization", - "pages": [ - "langgraph-platform/custom-lifespan", - "langgraph-platform/custom-middleware", - "langgraph-platform/custom-routes" - ] - }, - { - "group": "Data management", - "pages": [ - "langgraph-platform/data-storage-and-privacy", - "langgraph-platform/semantic-search", - "langgraph-platform/configure-ttl" - ] - }, - { - "group": "Tutorials", - "pages": [ - "langgraph-platform/autogen-integration", - "langgraph-platform/use-stream-react", - "langgraph-platform/generative-ui-react" - ] - } - ] - }, - { - "tab": "Reference", - "pages": [ - "langgraph-platform/reference-overview", - "langgraph-platform/server-api-ref", - "langgraph-platform/langgraph-server-changelog", - "langgraph-platform/api-ref-control-plane", - "langgraph-platform/cli", - "langgraph-platform/env-var", - "langgraph-platform/python-sdk", - "langgraph-platform/js-ts-sdk", - "langgraph-platform/remote-graph", - "langgraph-platform/faq" - ] - } - ] - }, - { - "dropdown": "LangChain Labs", - "icon": "/images/brand/langchain-labs-pill.svg", - "description": "Experimental AI products from LangChain", - "tabs": [ - { - "tab": "Overview", - "pages": ["labs/index"] - }, - { - "tab": "Open SWE", - "pages": [ - { - "group": "Get Started", - "pages": [ - "labs/swe/index" - ] - }, - { - "group": "Usage", - "pages": [ - "labs/swe/usage/intro", - "labs/swe/usage/ui", - "labs/swe/usage/github", - "labs/swe/usage/best-practices", - "labs/swe/usage/custom-rules", - "labs/swe/usage/examples" - ] - }, - { - "group": "Development Setup", - "pages": [ - "labs/swe/setup/intro", - "labs/swe/setup/development", - "labs/swe/setup/authentication", - "labs/swe/setup/monorepo", - "labs/swe/setup/ci" - ] - }, - { - "group": "FAQ", - "pages": [ - "labs/swe/faq" - ] - } - ] - } - ] - } - ] - } -} From 85b50fd4e6a0b1e2968a4bb80789e514c55ba67b Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Wed, 6 Aug 2025 11:03:33 -0700 Subject: [PATCH 03/17] Fix LangChain Labs dropdown --- src/docs.json | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/docs.json b/src/docs.json index 71ab1f5e..65cced8f 100644 --- a/src/docs.json +++ b/src/docs.json @@ -497,7 +497,7 @@ { "tab": "Overview", "pages": [ - "labs/index" + "python/labs/index" ] }, { @@ -506,34 +506,34 @@ { "group": "Get Started", "pages": [ - "labs/swe/index" + "python/labs/swe/index" ] }, { "group": "Usage", "pages": [ - "labs/swe/usage/intro", - "labs/swe/usage/ui", - "labs/swe/usage/github", - "labs/swe/usage/best-practices", - "labs/swe/usage/custom-rules", - "labs/swe/usage/examples" + "python/labs/swe/usage/intro", + "python/labs/swe/usage/ui", + "python/labs/swe/usage/github", + "python/labs/swe/usage/best-practices", + "python/labs/swe/usage/custom-rules", + "python/labs/swe/usage/examples" ] }, { "group": "Development Setup", "pages": [ - "labs/swe/setup/intro", - "labs/swe/setup/development", - "labs/swe/setup/authentication", - "labs/swe/setup/monorepo", - "labs/swe/setup/ci" + "python/labs/swe/setup/intro", + "python/labs/swe/setup/development", + "python/labs/swe/setup/authentication", + "python/labs/swe/setup/monorepo", + "python/labs/swe/setup/ci" ] }, { "group": "FAQ", "pages": [ - "labs/swe/faq" + "python/labs/swe/faq" ] } ] @@ -983,7 +983,7 @@ { "tab": "Overview", "pages": [ - "labs/index" + "javascript/labs/index" ] }, { @@ -992,34 +992,34 @@ { "group": "Get Started", "pages": [ - "labs/swe/index" + "javascript/labs/swe/index" ] }, { "group": "Usage", "pages": [ - "labs/swe/usage/intro", - "labs/swe/usage/ui", - "labs/swe/usage/github", - "labs/swe/usage/best-practices", - "labs/swe/usage/custom-rules", - "labs/swe/usage/examples" + "javascript/labs/swe/usage/intro", + "javascript/labs/swe/usage/ui", + "javascript/labs/swe/usage/github", + "javascript/labs/swe/usage/best-practices", + "javascript/labs/swe/usage/custom-rules", + "javascript/labs/swe/usage/examples" ] }, { "group": "Development Setup", "pages": [ - "labs/swe/setup/intro", - "labs/swe/setup/development", - "labs/swe/setup/authentication", - "labs/swe/setup/monorepo", - "labs/swe/setup/ci" + "javascript/labs/swe/setup/intro", + "javascript/labs/swe/setup/development", + "javascript/labs/swe/setup/authentication", + "javascript/labs/swe/setup/monorepo", + "javascript/labs/swe/setup/ci" ] }, { "group": "FAQ", "pages": [ - "labs/swe/faq" + "javascript/labs/swe/faq" ] } ] From 8b9b7cc5d5d9ddd6434d9a7a97c948e1d2dcb670 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Wed, 6 Aug 2025 12:56:32 -0700 Subject: [PATCH 04/17] Change build and URL structure so only LangGraph has JS and Python versions --- pipeline/core/builder.py | 144 +++++++-- src/docs.json | 660 +++++++++++++++++++-------------------- 2 files changed, 456 insertions(+), 348 deletions(-) diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index 84dd306e..e8074a89 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -73,19 +73,25 @@ def build_all(self) -> None: shutil.rmtree(self.build_dir) self.build_dir.mkdir(parents=True, exist_ok=True) - # Build Python version - logger.info("Building Python version...") - self._build_version("python", "python") + # Build LangGraph versioned content (oss/ -> langgraph/python/ and langgraph/javascript/) + logger.info("Building LangGraph Python version...") + self._build_langgraph_version("langgraph/python", "python") + + logger.info("Building LangGraph JavaScript version...") + self._build_langgraph_version("langgraph/javascript", "js") - # Build JavaScript version - logger.info("Building JavaScript version...") - self._build_version("javascript", "js") + # Build unversioned content (same content regardless of version) + logger.info("Building LangGraph Platform content...") + self._build_unversioned_content("langgraph-platform", "langgraph-platform") + + logger.info("Building LangChain Labs content...") + self._build_unversioned_content("labs", "labs") # Copy shared files (docs.json, images, etc.) logger.info("Copying shared files...") self._copy_shared_files() - logger.info("✅ Versioned build complete") + logger.info("✅ New structure build complete") def _convert_yaml_to_json(self, yaml_file_path: Path, output_path: Path) -> None: """Convert a YAML file to JSON format. @@ -300,21 +306,80 @@ def build_files(self, file_paths: list[Path]) -> None: skipped_count, ) - def _build_version(self, version_dir: str, target_language: str) -> None: - """Build a version-specific copy of the documentation. + def _build_langgraph_version(self, output_dir: str, target_language: str) -> None: + """Build LangGraph (oss/) content for a specific version. Args: - version_dir: Directory name for this version (e.g., "python", "javascript"). + output_dir: Output directory (e.g., "langgraph/python", "langgraph/javascript"). target_language: Target language for conditional blocks ("python" or "js"). """ - # Collect all files to process (excluding shared files) + # Only process files in the oss/ directory + oss_dir = self.src_dir / "oss" + if not oss_dir.exists(): + logger.warning("oss/ directory not found, skipping LangGraph build") + return + all_files = [ - file_path for file_path in self.src_dir.rglob("*") + file_path for file_path in oss_dir.rglob("*") + if file_path.is_file() and not self._is_shared_file(file_path) + ] + + if not all_files: + logger.info("No files found in oss/ directory for %s", output_dir) + return + + # Process files with progress bar + copied_count: int = 0 + skipped_count: int = 0 + + with tqdm( + total=len(all_files), + desc=f"Building {output_dir} files", + unit="file", + ncols=80, + bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]", + ) as pbar: + for file_path in all_files: + # Calculate relative path from oss/ directory + relative_path = file_path.relative_to(oss_dir) + # Build to output_dir/ (not output_dir/oss/) + output_path = self.build_dir / output_dir / relative_path + + result = self._build_single_file( + file_path, output_path, target_language, pbar, f"{output_dir}/{relative_path}" + ) + if result: + copied_count += 1 + else: + skipped_count += 1 + pbar.update(1) + + logger.info( + "✅ %s complete: %d files copied, %d files skipped", + output_dir, + copied_count, + skipped_count, + ) + + def _build_unversioned_content(self, source_dir: str, output_dir: str) -> None: + """Build unversioned content (langgraph-platform/ or labs/). + + Args: + source_dir: Source directory name (e.g., "langgraph-platform", "labs"). + output_dir: Output directory name (same as source_dir). + """ + src_path = self.src_dir / source_dir + if not src_path.exists(): + logger.warning("%s/ directory not found, skipping", source_dir) + return + + all_files = [ + file_path for file_path in src_path.rglob("*") if file_path.is_file() and not self._is_shared_file(file_path) ] if not all_files: - logger.info("No files found to build for %s version", version_dir) + logger.info("No files found in %s/ directory", source_dir) return # Process files with progress bar @@ -323,14 +388,19 @@ def _build_version(self, version_dir: str, target_language: str) -> None: with tqdm( total=len(all_files), - desc=f"Building {version_dir} files", + desc=f"Building {output_dir} files", unit="file", ncols=80, bar_format="{l_bar}{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]", ) as pbar: for file_path in all_files: - result = self._build_version_file_with_progress( - file_path, version_dir, target_language, pbar + # Calculate relative path from source directory + relative_path = file_path.relative_to(src_path) + # Build directly to output_dir/ + output_path = self.build_dir / output_dir / relative_path + + result = self._build_single_file( + file_path, output_path, "python", pbar, f"{output_dir}/{relative_path}" ) if result: copied_count += 1 @@ -339,12 +409,50 @@ def _build_version(self, version_dir: str, target_language: str) -> None: pbar.update(1) logger.info( - "✅ %s version complete: %d files copied, %d files skipped", - version_dir.capitalize(), + "✅ %s complete: %d files copied, %d files skipped", + output_dir, copied_count, skipped_count, ) + def _build_single_file( + self, file_path: Path, output_path: Path, target_language: str, pbar: tqdm, display_path: str + ) -> bool: + """Build a single file with progress bar integration. + + Args: + file_path: Path to the source file to be built. + output_path: Full output path for the file. + target_language: Target language for conditional blocks ("python" or "js"). + pbar: tqdm progress bar instance for updating the description. + display_path: Path to display in progress bar. + + Returns: + True if the file was copied, False if it was skipped. + """ + # Update progress bar description with current file + pbar.set_postfix_str(display_path) + + # Create output directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Handle special case for docs.yml files + if file_path.name == "docs.yml" and file_path.suffix.lower() in { + ".yml", + ".yaml", + }: + self._convert_yaml_to_json(file_path, output_path) + return True + # Copy other supported files + if file_path.suffix.lower() in self.copy_extensions: + # Handle markdown files with preprocessing + if file_path.suffix.lower() in {".md", ".mdx"}: + self._process_markdown_file(file_path, output_path, target_language) + return True + shutil.copy2(file_path, output_path) + return True + return False + def _build_version_file_with_progress( self, file_path: Path, version_dir: str, target_language: str, pbar: tqdm ) -> bool: diff --git a/src/docs.json b/src/docs.json index 65cced8f..717b9341 100644 --- a/src/docs.json +++ b/src/docs.json @@ -70,24 +70,24 @@ { "group": "Get started", "pages": [ - "python/oss/overview", - "python/oss/quickstart", - "python/oss/run-an-agent", - "python/oss/template-applications" + "langgraph/python/overview", + "langgraph/python/quickstart", + "langgraph/python/run-an-agent", + "langgraph/python/template-applications" ] }, { "group": "General concepts", "pages": [ - "python/oss/workflows-and-agents", - "python/oss/prebuilt-vs-low-level", + "langgraph/python/workflows-and-agents", + "langgraph/python/prebuilt-vs-low-level", { "group": "Common agent architectures", "pages": [ - "python/oss/agentic-architectures", - "python/oss/agentic-rag", - "python/oss/agent-supervisor", - "python/oss/sql-agent" + "langgraph/python/agentic-architectures", + "langgraph/python/agentic-rag", + "langgraph/python/agent-supervisor", + "langgraph/python/sql-agent" ] } ] @@ -95,9 +95,9 @@ { "group": "Additional resources", "pages": [ - "python/oss/case-studies", - "python/oss/faq", - "python/oss/langgraph-academy" + "langgraph/python/case-studies", + "langgraph/python/faq", + "langgraph/python/langgraph-academy" ] } ] @@ -108,45 +108,45 @@ { "group": "Basic configuration", "pages": [ - "python/oss/prebuilts" + "langgraph/python/prebuilts" ] }, { "group": "Low-level configuration", "pages": [ - "python/oss/why-langgraph", - "python/oss/1-build-basic-chatbot", - "python/oss/2-add-tools", - "python/oss/3-add-memory", - "python/oss/4-human-in-the-loop", - "python/oss/5-customize-state", - "python/oss/6-time-travel" + "langgraph/python/why-langgraph", + "langgraph/python/1-build-basic-chatbot", + "langgraph/python/2-add-tools", + "langgraph/python/3-add-memory", + "langgraph/python/4-human-in-the-loop", + "langgraph/python/5-customize-state", + "langgraph/python/6-time-travel" ] }, { "group": "Components", "pages": [ - "python/oss/models", + "langgraph/python/models", { "group": "Tools", "pages": [ - "python/oss/tools", - "python/oss/call-tools" + "langgraph/python/tools", + "langgraph/python/call-tools" ] }, { "group": "MCP", "pages": [ - "python/oss/mcp", - "python/oss/use-mcp" + "langgraph/python/mcp", + "langgraph/python/use-mcp" ] }, { "group": "Multi-agent", "pages": [ - "python/oss/multi-agent", - "python/oss/multi-agent-prebuilts", - "python/oss/multi-agent-custom" + "langgraph/python/multi-agent", + "langgraph/python/multi-agent-prebuilts", + "langgraph/python/multi-agent-custom" ] } ] @@ -159,42 +159,42 @@ { "group": "Capabilities", "pages": [ - "python/oss/persistence", - "python/oss/durable-execution", + "langgraph/python/persistence", + "langgraph/python/durable-execution", { "group": "Streaming", "pages": [ - "python/oss/streaming", - "python/oss/use-streaming" + "langgraph/python/streaming", + "langgraph/python/use-streaming" ] }, { "group": "Human-in-the-loop", "pages": [ - "python/oss/human-in-the-loop", - "python/oss/add-human-in-the-loop" + "langgraph/python/human-in-the-loop", + "langgraph/python/add-human-in-the-loop" ] }, { "group": "Time travel", "pages": [ - "python/oss/time-travel", - "python/oss/use-time-travel" + "langgraph/python/time-travel", + "langgraph/python/use-time-travel" ] }, { "group": "Memory and context", "pages": [ - "python/oss/memory", - "python/oss/context", - "python/oss/add-memory" + "langgraph/python/memory", + "langgraph/python/context", + "langgraph/python/add-memory" ] }, { "group": "Subgraphs", "pages": [ - "python/oss/subgraphs", - "python/oss/use-subgraphs" + "langgraph/python/subgraphs", + "langgraph/python/use-subgraphs" ] } ] @@ -202,10 +202,10 @@ { "group": "Run and debug", "pages": [ - "python/oss/local-server", - "python/oss/ui", - "python/oss/trace-agent", - "python/oss/evals" + "langgraph/python/local-server", + "langgraph/python/ui", + "langgraph/python/trace-agent", + "langgraph/python/evals" ] }, { @@ -214,18 +214,18 @@ { "group": "Graph API", "pages": [ - "python/oss/graph-api", - "python/oss/use-graph-api" + "langgraph/python/graph-api", + "langgraph/python/use-graph-api" ] }, { "group": "Functional API", "pages": [ - "python/oss/functional-api", - "python/oss/use-functional-api" + "langgraph/python/functional-api", + "langgraph/python/use-functional-api" ] }, - "python/oss/pregel" + "langgraph/python/pregel" ] } ] @@ -236,39 +236,39 @@ { "group": "LangGraph reference", "pages": [ - "python/oss/reference/overview", - "python/oss/reference/graphs", - "python/oss/reference/functional-api", - "python/oss/reference/pregel", - "python/oss/reference/checkpointers", - "python/oss/reference/storage", - "python/oss/reference/caching", - "python/oss/reference/types", - "python/oss/reference/runtime", - "python/oss/reference/config", - "python/oss/reference/errors", - "python/oss/reference/constants", - "python/oss/reference/channels" + "langgraph/python/reference/overview", + "langgraph/python/reference/graphs", + "langgraph/python/reference/functional-api", + "langgraph/python/reference/pregel", + "langgraph/python/reference/checkpointers", + "langgraph/python/reference/storage", + "langgraph/python/reference/caching", + "langgraph/python/reference/types", + "langgraph/python/reference/runtime", + "langgraph/python/reference/config", + "langgraph/python/reference/errors", + "langgraph/python/reference/constants", + "langgraph/python/reference/channels" ] }, { "group": "Prebuilt reference", "pages": [ - "python/oss/reference/agents", - "python/oss/reference/supervisor", - "python/oss/reference/swarm", - "python/oss/reference/mcp" + "langgraph/python/reference/agents", + "langgraph/python/reference/supervisor", + "langgraph/python/reference/swarm", + "langgraph/python/reference/mcp" ] }, { "group": "Error troubleshooting", "pages": [ - "python/oss/common-errors", - "python/oss/GRAPH_RECURSION_LIMIT", - "python/oss/INVALID_CHAT_HISTORY", - "python/oss/INVALID_CONCURRENT_GRAPH_UPDATE", - "python/oss/INVALID_GRAPH_NODE_RETURN_VALUE", - "python/oss/MULTIPLE_SUBGRAPHS" + "langgraph/python/common-errors", + "langgraph/python/GRAPH_RECURSION_LIMIT", + "langgraph/python/INVALID_CHAT_HISTORY", + "langgraph/python/INVALID_CONCURRENT_GRAPH_UPDATE", + "langgraph/python/INVALID_GRAPH_NODE_RETURN_VALUE", + "langgraph/python/MULTIPLE_SUBGRAPHS" ] } ] @@ -286,31 +286,31 @@ { "group": "Overview", "pages": [ - "python/langgraph-platform/index", + "langgraph-platform/index", { "group": "Components", "pages": [ - "python/langgraph-platform/components", - "python/langgraph-platform/langgraph-server", - "python/langgraph-platform/data-plane", - "python/langgraph-platform/control-plane" + "langgraph-platform/components", + "langgraph-platform/langgraph-server", + "langgraph-platform/data-plane", + "langgraph-platform/control-plane" ] }, - "python/langgraph-platform/application-structure" + "langgraph-platform/application-structure" ] }, { "group": "Quickstarts", "pages": [ - "python/langgraph-platform/local-server", - "python/langgraph-platform/deployment-quickstart", - "python/langgraph-platform/quick-start-studio" + "langgraph-platform/local-server", + "langgraph-platform/deployment-quickstart", + "langgraph-platform/quick-start-studio" ] }, { "group": "Plans and deployment", "pages": [ - "python/langgraph-platform/plans" + "langgraph-platform/plans" ] } ] @@ -321,13 +321,13 @@ { "group": "Build an app with the LangGraph basics", "pages": [ - "python/langgraph-platform/langgraph-basics/why-langgraph", - "python/langgraph-platform/langgraph-basics/1-build-basic-chatbot", - "python/langgraph-platform/langgraph-basics/2-add-tools", - "python/langgraph-platform/langgraph-basics/3-add-memory", - "python/langgraph-platform/langgraph-basics/4-human-in-the-loop", - "python/langgraph-platform/langgraph-basics/5-customize-state", - "python/langgraph-platform/langgraph-basics/6-time-travel" + "langgraph-platform/langgraph-basics/why-langgraph", + "langgraph-platform/langgraph-basics/1-build-basic-chatbot", + "langgraph-platform/langgraph-basics/2-add-tools", + "langgraph-platform/langgraph-basics/3-add-memory", + "langgraph-platform/langgraph-basics/4-human-in-the-loop", + "langgraph-platform/langgraph-basics/5-customize-state", + "langgraph-platform/langgraph-basics/6-time-travel" ] }, { @@ -336,19 +336,19 @@ { "group": "Assistants", "pages": [ - "python/langgraph-platform/assistants", - "python/langgraph-platform/configuration-cloud", - "python/langgraph-platform/use-threads" + "langgraph-platform/assistants", + "langgraph-platform/configuration-cloud", + "langgraph-platform/use-threads" ] }, { "group": "Runs", "pages": [ - "python/langgraph-platform/background-run", - "python/langgraph-platform/same-thread", - "python/langgraph-platform/cron-jobs", - "python/langgraph-platform/stateless-runs", - "python/langgraph-platform/configurable-headers" + "langgraph-platform/background-run", + "langgraph-platform/same-thread", + "langgraph-platform/cron-jobs", + "langgraph-platform/stateless-runs", + "langgraph-platform/configurable-headers" ] } ] @@ -356,19 +356,19 @@ { "group": "Core capabilities", "pages": [ - "python/langgraph-platform/streaming", - "python/langgraph-platform/add-human-in-the-loop", - "python/langgraph-platform/human-in-the-loop-time-travel", - "python/langgraph-platform/server-mcp", - "python/langgraph-platform/use-webhooks", + "langgraph-platform/streaming", + "langgraph-platform/add-human-in-the-loop", + "langgraph-platform/human-in-the-loop-time-travel", + "langgraph-platform/server-mcp", + "langgraph-platform/use-webhooks", { "group": "Double-texting", "pages": [ - "python/langgraph-platform/double-texting", - "python/langgraph-platform/interrupt-concurrent", - "python/langgraph-platform/rollback-concurrent", - "python/langgraph-platform/reject-concurrent", - "python/langgraph-platform/enqueue-concurrent" + "langgraph-platform/double-texting", + "langgraph-platform/interrupt-concurrent", + "langgraph-platform/rollback-concurrent", + "langgraph-platform/reject-concurrent", + "langgraph-platform/enqueue-concurrent" ] } ] @@ -376,15 +376,15 @@ { "group": "LangGraph Studio", "pages": [ - "python/langgraph-platform/langgraph-studio", - "python/langgraph-platform/invoke-studio", - "python/langgraph-platform/manage-assistants-studio", - "python/langgraph-platform/threads-studio", - "python/langgraph-platform/iterate-graph-studio", - "python/langgraph-platform/run-evals-studio", - "python/langgraph-platform/clone-traces-studio", - "python/langgraph-platform/datasets-studio", - "python/langgraph-platform/troubleshooting-studio" + "langgraph-platform/langgraph-studio", + "langgraph-platform/invoke-studio", + "langgraph-platform/manage-assistants-studio", + "langgraph-platform/threads-studio", + "langgraph-platform/iterate-graph-studio", + "langgraph-platform/run-evals-studio", + "langgraph-platform/clone-traces-studio", + "langgraph-platform/datasets-studio", + "langgraph-platform/troubleshooting-studio" ] } ] @@ -395,33 +395,33 @@ { "group": "Overview", "pages": [ - "python/langgraph-platform/deployment-options", - "python/langgraph-platform/cloud", - "python/langgraph-platform/hybrid", - "python/langgraph-platform/self-hosted" + "langgraph-platform/deployment-options", + "langgraph-platform/cloud", + "langgraph-platform/hybrid", + "langgraph-platform/self-hosted" ] }, { "group": "Guides for deployment", "pages": [ - "python/langgraph-platform/deploy-to-cloud", - "python/langgraph-platform/deploy-hybrid", - "python/langgraph-platform/deploy-self-hosted-full-platform", - "python/langgraph-platform/deploy-data-plane-only", - "python/langgraph-platform/use-remote-graph" + "langgraph-platform/deploy-to-cloud", + "langgraph-platform/deploy-hybrid", + "langgraph-platform/deploy-self-hosted-full-platform", + "langgraph-platform/deploy-data-plane-only", + "langgraph-platform/use-remote-graph" ] }, { "group": "Configure your application for deployment", "pages": [ - "python/langgraph-platform/setup-app-requirements-txt", - "python/langgraph-platform/setup-pyproject", - "python/langgraph-platform/setup-javascript", - "python/langgraph-platform/custom-docker", - "python/langgraph-platform/graph-rebuild", - "python/langgraph-platform/langgraph-cli", - "python/langgraph-platform/sdk", - "python/langgraph-platform/egress-metrics-metadata" + "langgraph-platform/setup-app-requirements-txt", + "langgraph-platform/setup-pyproject", + "langgraph-platform/setup-javascript", + "langgraph-platform/custom-docker", + "langgraph-platform/graph-rebuild", + "langgraph-platform/langgraph-cli", + "langgraph-platform/sdk", + "langgraph-platform/egress-metrics-metadata" ] } ] @@ -432,42 +432,42 @@ { "group": "Authentication & access control", "pages": [ - "python/langgraph-platform/auth", - "python/langgraph-platform/custom-auth", - "python/langgraph-platform/set-up-custom-auth", - "python/langgraph-platform/resource-auth", - "python/langgraph-platform/add-auth-server", - "python/langgraph-platform/openapi-security" + "langgraph-platform/auth", + "langgraph-platform/custom-auth", + "langgraph-platform/set-up-custom-auth", + "langgraph-platform/resource-auth", + "langgraph-platform/add-auth-server", + "langgraph-platform/openapi-security" ] }, { "group": "Scalability & resilience", "pages": [ - "python/langgraph-platform/scalability-and-resilience" + "langgraph-platform/scalability-and-resilience" ] }, { "group": "Server customization", "pages": [ - "python/langgraph-platform/custom-lifespan", - "python/langgraph-platform/custom-middleware", - "python/langgraph-platform/custom-routes" + "langgraph-platform/custom-lifespan", + "langgraph-platform/custom-middleware", + "langgraph-platform/custom-routes" ] }, { "group": "Data management", "pages": [ - "python/langgraph-platform/data-storage-and-privacy", - "python/langgraph-platform/semantic-search", - "python/langgraph-platform/configure-ttl" + "langgraph-platform/data-storage-and-privacy", + "langgraph-platform/semantic-search", + "langgraph-platform/configure-ttl" ] }, { "group": "Tutorials", "pages": [ - "python/langgraph-platform/autogen-integration", - "python/langgraph-platform/use-stream-react", - "python/langgraph-platform/generative-ui-react" + "langgraph-platform/autogen-integration", + "langgraph-platform/use-stream-react", + "langgraph-platform/generative-ui-react" ] } ] @@ -497,7 +497,7 @@ { "tab": "Overview", "pages": [ - "python/labs/index" + "labs/index" ] }, { @@ -506,34 +506,34 @@ { "group": "Get Started", "pages": [ - "python/labs/swe/index" + "labs/swe/index" ] }, { "group": "Usage", "pages": [ - "python/labs/swe/usage/intro", - "python/labs/swe/usage/ui", - "python/labs/swe/usage/github", - "python/labs/swe/usage/best-practices", - "python/labs/swe/usage/custom-rules", - "python/labs/swe/usage/examples" + "labs/swe/usage/intro", + "labs/swe/usage/ui", + "labs/swe/usage/github", + "labs/swe/usage/best-practices", + "labs/swe/usage/custom-rules", + "labs/swe/usage/examples" ] }, { "group": "Development Setup", "pages": [ - "python/labs/swe/setup/intro", - "python/labs/swe/setup/development", - "python/labs/swe/setup/authentication", - "python/labs/swe/setup/monorepo", - "python/labs/swe/setup/ci" + "labs/swe/setup/intro", + "labs/swe/setup/development", + "labs/swe/setup/authentication", + "labs/swe/setup/monorepo", + "labs/swe/setup/ci" ] }, { "group": "FAQ", "pages": [ - "python/labs/swe/faq" + "labs/swe/faq" ] } ] @@ -556,24 +556,24 @@ { "group": "Get started", "pages": [ - "javascript/oss/overview", - "javascript/oss/quickstart", - "javascript/oss/run-an-agent", - "javascript/oss/template-applications" + "langgraph/javascript/overview", + "langgraph/javascript/quickstart", + "langgraph/javascript/run-an-agent", + "langgraph/javascript/template-applications" ] }, { "group": "General concepts", "pages": [ - "javascript/oss/workflows-and-agents", - "javascript/oss/prebuilt-vs-low-level", + "langgraph/javascript/workflows-and-agents", + "langgraph/javascript/prebuilt-vs-low-level", { "group": "Common agent architectures", "pages": [ - "javascript/oss/agentic-architectures", - "javascript/oss/agentic-rag", - "javascript/oss/agent-supervisor", - "javascript/oss/sql-agent" + "langgraph/javascript/agentic-architectures", + "langgraph/javascript/agentic-rag", + "langgraph/javascript/agent-supervisor", + "langgraph/javascript/sql-agent" ] } ] @@ -581,9 +581,9 @@ { "group": "Additional resources", "pages": [ - "javascript/oss/case-studies", - "javascript/oss/faq", - "javascript/oss/langgraph-academy" + "langgraph/javascript/case-studies", + "langgraph/javascript/faq", + "langgraph/javascript/langgraph-academy" ] } ] @@ -594,45 +594,45 @@ { "group": "Basic configuration", "pages": [ - "javascript/oss/prebuilts" + "langgraph/javascript/prebuilts" ] }, { "group": "Low-level configuration", "pages": [ - "javascript/oss/why-langgraph", - "javascript/oss/1-build-basic-chatbot", - "javascript/oss/2-add-tools", - "javascript/oss/3-add-memory", - "javascript/oss/4-human-in-the-loop", - "javascript/oss/5-customize-state", - "javascript/oss/6-time-travel" + "langgraph/javascript/why-langgraph", + "langgraph/javascript/1-build-basic-chatbot", + "langgraph/javascript/2-add-tools", + "langgraph/javascript/3-add-memory", + "langgraph/javascript/4-human-in-the-loop", + "langgraph/javascript/5-customize-state", + "langgraph/javascript/6-time-travel" ] }, { "group": "Components", "pages": [ - "javascript/oss/models", + "langgraph/javascript/models", { "group": "Tools", "pages": [ - "javascript/oss/tools", - "javascript/oss/call-tools" + "langgraph/javascript/tools", + "langgraph/javascript/call-tools" ] }, { "group": "MCP", "pages": [ - "javascript/oss/mcp", - "javascript/oss/use-mcp" + "langgraph/javascript/mcp", + "langgraph/javascript/use-mcp" ] }, { "group": "Multi-agent", "pages": [ - "javascript/oss/multi-agent", - "javascript/oss/multi-agent-prebuilts", - "javascript/oss/multi-agent-custom" + "langgraph/javascript/multi-agent", + "langgraph/javascript/multi-agent-prebuilts", + "langgraph/javascript/multi-agent-custom" ] } ] @@ -645,42 +645,42 @@ { "group": "Capabilities", "pages": [ - "javascript/oss/persistence", - "javascript/oss/durable-execution", + "langgraph/javascript/persistence", + "langgraph/javascript/durable-execution", { "group": "Streaming", "pages": [ - "javascript/oss/streaming", - "javascript/oss/use-streaming" + "langgraph/javascript/streaming", + "langgraph/javascript/use-streaming" ] }, { "group": "Human-in-the-loop", "pages": [ - "javascript/oss/human-in-the-loop", - "javascript/oss/add-human-in-the-loop" + "langgraph/javascript/human-in-the-loop", + "langgraph/javascript/add-human-in-the-loop" ] }, { "group": "Time travel", "pages": [ - "javascript/oss/time-travel", - "javascript/oss/use-time-travel" + "langgraph/javascript/time-travel", + "langgraph/javascript/use-time-travel" ] }, { "group": "Memory and context", "pages": [ - "javascript/oss/memory", - "javascript/oss/context", - "javascript/oss/add-memory" + "langgraph/javascript/memory", + "langgraph/javascript/context", + "langgraph/javascript/add-memory" ] }, { "group": "Subgraphs", "pages": [ - "javascript/oss/subgraphs", - "javascript/oss/use-subgraphs" + "langgraph/javascript/subgraphs", + "langgraph/javascript/use-subgraphs" ] } ] @@ -688,10 +688,10 @@ { "group": "Run and debug", "pages": [ - "javascript/oss/local-server", - "javascript/oss/ui", - "javascript/oss/trace-agent", - "javascript/oss/evals" + "langgraph/javascript/local-server", + "langgraph/javascript/ui", + "langgraph/javascript/trace-agent", + "langgraph/javascript/evals" ] }, { @@ -700,18 +700,18 @@ { "group": "Graph API", "pages": [ - "javascript/oss/graph-api", - "javascript/oss/use-graph-api" + "langgraph/javascript/graph-api", + "langgraph/javascript/use-graph-api" ] }, { "group": "Functional API", "pages": [ - "javascript/oss/functional-api", - "javascript/oss/use-functional-api" + "langgraph/javascript/functional-api", + "langgraph/javascript/use-functional-api" ] }, - "javascript/oss/pregel" + "langgraph/javascript/pregel" ] } ] @@ -722,39 +722,39 @@ { "group": "LangGraph reference", "pages": [ - "javascript/oss/reference/overview", - "javascript/oss/reference/graphs", - "javascript/oss/reference/functional-api", - "javascript/oss/reference/pregel", - "javascript/oss/reference/checkpointers", - "javascript/oss/reference/storage", - "javascript/oss/reference/caching", - "javascript/oss/reference/types", - "javascript/oss/reference/runtime", - "javascript/oss/reference/config", - "javascript/oss/reference/errors", - "javascript/oss/reference/constants", - "javascript/oss/reference/channels" + "langgraph/javascript/reference/overview", + "langgraph/javascript/reference/graphs", + "langgraph/javascript/reference/functional-api", + "langgraph/javascript/reference/pregel", + "langgraph/javascript/reference/checkpointers", + "langgraph/javascript/reference/storage", + "langgraph/javascript/reference/caching", + "langgraph/javascript/reference/types", + "langgraph/javascript/reference/runtime", + "langgraph/javascript/reference/config", + "langgraph/javascript/reference/errors", + "langgraph/javascript/reference/constants", + "langgraph/javascript/reference/channels" ] }, { "group": "Prebuilt reference", "pages": [ - "javascript/oss/reference/agents", - "javascript/oss/reference/supervisor", - "javascript/oss/reference/swarm", - "javascript/oss/reference/mcp" + "langgraph/javascript/reference/agents", + "langgraph/javascript/reference/supervisor", + "langgraph/javascript/reference/swarm", + "langgraph/javascript/reference/mcp" ] }, { "group": "Error troubleshooting", "pages": [ - "javascript/oss/common-errors", - "javascript/oss/GRAPH_RECURSION_LIMIT", - "javascript/oss/INVALID_CHAT_HISTORY", - "javascript/oss/INVALID_CONCURRENT_GRAPH_UPDATE", - "javascript/oss/INVALID_GRAPH_NODE_RETURN_VALUE", - "javascript/oss/MULTIPLE_SUBGRAPHS" + "langgraph/javascript/common-errors", + "langgraph/javascript/GRAPH_RECURSION_LIMIT", + "langgraph/javascript/INVALID_CHAT_HISTORY", + "langgraph/javascript/INVALID_CONCURRENT_GRAPH_UPDATE", + "langgraph/javascript/INVALID_GRAPH_NODE_RETURN_VALUE", + "langgraph/javascript/MULTIPLE_SUBGRAPHS" ] } ] @@ -772,31 +772,31 @@ { "group": "Overview", "pages": [ - "javascript/langgraph-platform/index", + "langgraph-platform/index", { "group": "Components", "pages": [ - "javascript/langgraph-platform/components", - "javascript/langgraph-platform/langgraph-server", - "javascript/langgraph-platform/data-plane", - "javascript/langgraph-platform/control-plane" + "langgraph-platform/components", + "langgraph-platform/langgraph-server", + "langgraph-platform/data-plane", + "langgraph-platform/control-plane" ] }, - "javascript/langgraph-platform/application-structure" + "langgraph-platform/application-structure" ] }, { "group": "Quickstarts", "pages": [ - "javascript/langgraph-platform/local-server", - "javascript/langgraph-platform/deployment-quickstart", - "javascript/langgraph-platform/quick-start-studio" + "langgraph-platform/local-server", + "langgraph-platform/deployment-quickstart", + "langgraph-platform/quick-start-studio" ] }, { "group": "Plans and deployment", "pages": [ - "javascript/langgraph-platform/plans" + "langgraph-platform/plans" ] } ] @@ -807,13 +807,13 @@ { "group": "Build an app with the LangGraph basics", "pages": [ - "javascript/langgraph-platform/langgraph-basics/why-langgraph", - "javascript/langgraph-platform/langgraph-basics/1-build-basic-chatbot", - "javascript/langgraph-platform/langgraph-basics/2-add-tools", - "javascript/langgraph-platform/langgraph-basics/3-add-memory", - "javascript/langgraph-platform/langgraph-basics/4-human-in-the-loop", - "javascript/langgraph-platform/langgraph-basics/5-customize-state", - "javascript/langgraph-platform/langgraph-basics/6-time-travel" + "langgraph-platform/langgraph-basics/why-langgraph", + "langgraph-platform/langgraph-basics/1-build-basic-chatbot", + "langgraph-platform/langgraph-basics/2-add-tools", + "langgraph-platform/langgraph-basics/3-add-memory", + "langgraph-platform/langgraph-basics/4-human-in-the-loop", + "langgraph-platform/langgraph-basics/5-customize-state", + "langgraph-platform/langgraph-basics/6-time-travel" ] }, { @@ -822,19 +822,19 @@ { "group": "Assistants", "pages": [ - "javascript/langgraph-platform/assistants", - "javascript/langgraph-platform/configuration-cloud", - "javascript/langgraph-platform/use-threads" + "langgraph-platform/assistants", + "langgraph-platform/configuration-cloud", + "langgraph-platform/use-threads" ] }, { "group": "Runs", "pages": [ - "javascript/langgraph-platform/background-run", - "javascript/langgraph-platform/same-thread", - "javascript/langgraph-platform/cron-jobs", - "javascript/langgraph-platform/stateless-runs", - "javascript/langgraph-platform/configurable-headers" + "langgraph-platform/background-run", + "langgraph-platform/same-thread", + "langgraph-platform/cron-jobs", + "langgraph-platform/stateless-runs", + "langgraph-platform/configurable-headers" ] } ] @@ -842,19 +842,19 @@ { "group": "Core capabilities", "pages": [ - "javascript/langgraph-platform/streaming", - "javascript/langgraph-platform/add-human-in-the-loop", - "javascript/langgraph-platform/human-in-the-loop-time-travel", - "javascript/langgraph-platform/server-mcp", - "javascript/langgraph-platform/use-webhooks", + "langgraph-platform/streaming", + "langgraph-platform/add-human-in-the-loop", + "langgraph-platform/human-in-the-loop-time-travel", + "langgraph-platform/server-mcp", + "langgraph-platform/use-webhooks", { "group": "Double-texting", "pages": [ - "javascript/langgraph-platform/double-texting", - "javascript/langgraph-platform/interrupt-concurrent", - "javascript/langgraph-platform/rollback-concurrent", - "javascript/langgraph-platform/reject-concurrent", - "javascript/langgraph-platform/enqueue-concurrent" + "langgraph-platform/double-texting", + "langgraph-platform/interrupt-concurrent", + "langgraph-platform/rollback-concurrent", + "langgraph-platform/reject-concurrent", + "langgraph-platform/enqueue-concurrent" ] } ] @@ -862,15 +862,15 @@ { "group": "LangGraph Studio", "pages": [ - "javascript/langgraph-platform/langgraph-studio", - "javascript/langgraph-platform/invoke-studio", - "javascript/langgraph-platform/manage-assistants-studio", - "javascript/langgraph-platform/threads-studio", - "javascript/langgraph-platform/iterate-graph-studio", - "javascript/langgraph-platform/run-evals-studio", - "javascript/langgraph-platform/clone-traces-studio", - "javascript/langgraph-platform/datasets-studio", - "javascript/langgraph-platform/troubleshooting-studio" + "langgraph-platform/langgraph-studio", + "langgraph-platform/invoke-studio", + "langgraph-platform/manage-assistants-studio", + "langgraph-platform/threads-studio", + "langgraph-platform/iterate-graph-studio", + "langgraph-platform/run-evals-studio", + "langgraph-platform/clone-traces-studio", + "langgraph-platform/datasets-studio", + "langgraph-platform/troubleshooting-studio" ] } ] @@ -881,33 +881,33 @@ { "group": "Overview", "pages": [ - "javascript/langgraph-platform/deployment-options", - "javascript/langgraph-platform/cloud", - "javascript/langgraph-platform/hybrid", - "javascript/langgraph-platform/self-hosted" + "langgraph-platform/deployment-options", + "langgraph-platform/cloud", + "langgraph-platform/hybrid", + "langgraph-platform/self-hosted" ] }, { "group": "Guides for deployment", "pages": [ - "javascript/langgraph-platform/deploy-to-cloud", - "javascript/langgraph-platform/deploy-hybrid", - "javascript/langgraph-platform/deploy-self-hosted-full-platform", - "javascript/langgraph-platform/deploy-data-plane-only", - "javascript/langgraph-platform/use-remote-graph" + "langgraph-platform/deploy-to-cloud", + "langgraph-platform/deploy-hybrid", + "langgraph-platform/deploy-self-hosted-full-platform", + "langgraph-platform/deploy-data-plane-only", + "langgraph-platform/use-remote-graph" ] }, { "group": "Configure your application for deployment", "pages": [ - "javascript/langgraph-platform/setup-app-requirements-txt", - "javascript/langgraph-platform/setup-pyproject", - "javascript/langgraph-platform/setup-javascript", - "javascript/langgraph-platform/custom-docker", - "javascript/langgraph-platform/graph-rebuild", - "javascript/langgraph-platform/langgraph-cli", - "javascript/langgraph-platform/sdk", - "javascript/langgraph-platform/egress-metrics-metadata" + "langgraph-platform/setup-app-requirements-txt", + "langgraph-platform/setup-pyproject", + "langgraph-platform/setup-javascript", + "langgraph-platform/custom-docker", + "langgraph-platform/graph-rebuild", + "langgraph-platform/langgraph-cli", + "langgraph-platform/sdk", + "langgraph-platform/egress-metrics-metadata" ] } ] @@ -918,42 +918,42 @@ { "group": "Authentication & access control", "pages": [ - "javascript/langgraph-platform/auth", - "javascript/langgraph-platform/custom-auth", - "javascript/langgraph-platform/set-up-custom-auth", - "javascript/langgraph-platform/resource-auth", - "javascript/langgraph-platform/add-auth-server", - "javascript/langgraph-platform/openapi-security" + "langgraph-platform/auth", + "langgraph-platform/custom-auth", + "langgraph-platform/set-up-custom-auth", + "langgraph-platform/resource-auth", + "langgraph-platform/add-auth-server", + "langgraph-platform/openapi-security" ] }, { "group": "Scalability & resilience", "pages": [ - "javascript/langgraph-platform/scalability-and-resilience" + "langgraph-platform/scalability-and-resilience" ] }, { "group": "Server customization", "pages": [ - "javascript/langgraph-platform/custom-lifespan", - "javascript/langgraph-platform/custom-middleware", - "javascript/langgraph-platform/custom-routes" + "langgraph-platform/custom-lifespan", + "langgraph-platform/custom-middleware", + "langgraph-platform/custom-routes" ] }, { "group": "Data management", "pages": [ - "javascript/langgraph-platform/data-storage-and-privacy", - "javascript/langgraph-platform/semantic-search", - "javascript/langgraph-platform/configure-ttl" + "langgraph-platform/data-storage-and-privacy", + "langgraph-platform/semantic-search", + "langgraph-platform/configure-ttl" ] }, { "group": "Tutorials", "pages": [ - "javascript/langgraph-platform/autogen-integration", - "javascript/langgraph-platform/use-stream-react", - "javascript/langgraph-platform/generative-ui-react" + "langgraph-platform/autogen-integration", + "langgraph-platform/use-stream-react", + "langgraph-platform/generative-ui-react" ] } ] @@ -983,7 +983,7 @@ { "tab": "Overview", "pages": [ - "javascript/labs/index" + "labs/index" ] }, { @@ -992,34 +992,34 @@ { "group": "Get Started", "pages": [ - "javascript/labs/swe/index" + "labs/swe/index" ] }, { "group": "Usage", "pages": [ - "javascript/labs/swe/usage/intro", - "javascript/labs/swe/usage/ui", - "javascript/labs/swe/usage/github", - "javascript/labs/swe/usage/best-practices", - "javascript/labs/swe/usage/custom-rules", - "javascript/labs/swe/usage/examples" + "labs/swe/usage/intro", + "labs/swe/usage/ui", + "labs/swe/usage/github", + "labs/swe/usage/best-practices", + "labs/swe/usage/custom-rules", + "labs/swe/usage/examples" ] }, { "group": "Development Setup", "pages": [ - "javascript/labs/swe/setup/intro", - "javascript/labs/swe/setup/development", - "javascript/labs/swe/setup/authentication", - "javascript/labs/swe/setup/monorepo", - "javascript/labs/swe/setup/ci" + "labs/swe/setup/intro", + "labs/swe/setup/development", + "labs/swe/setup/authentication", + "labs/swe/setup/monorepo", + "labs/swe/setup/ci" ] }, { "group": "FAQ", "pages": [ - "javascript/labs/swe/faq" + "labs/swe/faq" ] } ] From dd1586e24c5cc407ad6d7537c7d70a5cc44d8e01 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Wed, 6 Aug 2025 14:16:00 -0700 Subject: [PATCH 05/17] Only show version selection for langgraph docs --- pipeline/core/builder.py | 7 ++- src/docs.json | 6 ++ src/hide-version-picker.css | 121 ++++++++++++++++++++++++++++++++++++ src/hide-version-picker.js | 85 +++++++++++++++++++++++++ 4 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 src/hide-version-picker.css create mode 100644 src/hide-version-picker.js diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index e8074a89..7f39581d 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -49,6 +49,7 @@ def __init__(self, src_dir: Path, build_dir: Path) -> None: ".yml", ".yaml", ".css", + ".js", } def build_all(self) -> None: @@ -503,7 +504,7 @@ def _is_shared_file(self, file_path: Path) -> bool: Returns: True if the file should be shared, False if it should be version-specific. """ - # Shared files: docs.json, images directory + # Shared files: docs.json, images directory, JavaScript files relative_path = file_path.relative_to(self.src_dir) # docs.json should be shared @@ -513,6 +514,10 @@ def _is_shared_file(self, file_path: Path) -> bool: # Images directory should be shared if "images" in relative_path.parts: return True + + # JavaScript and CSS files should be shared (used for custom scripts/styles) + if file_path.suffix.lower() in {".js", ".css"}: + return True return False diff --git a/src/docs.json b/src/docs.json index 717b9341..c58ae4fa 100644 --- a/src/docs.json +++ b/src/docs.json @@ -54,6 +54,12 @@ "tagId": "GTM-MBBX68ST" } }, + "scripts": [ + "/hide-version-picker.js" + ], + "styles": [ + "/hide-version-picker.css" + ], "navigation": { "versions": [ { diff --git a/src/hide-version-picker.css b/src/hide-version-picker.css new file mode 100644 index 00000000..2b419059 --- /dev/null +++ b/src/hide-version-picker.css @@ -0,0 +1,121 @@ +/** + * Hide version picker on unversioned content pages. + * + * This CSS hides the Mintlify version picker when users are viewing + * LangGraph Platform or LangChain Labs pages, since these sections + * have the same content regardless of Python/JavaScript version. + * + * Target element: + */ + +/* PRIMARY: Target version picker by specific styling classes (text-xs + gap-1.5) */ +body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"], +body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"], +.hide-version-picker-platform button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"], +.hide-version-picker-labs button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"] { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* SECONDARY: Target by content - JavaScript will add these classes */ +body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"].version-picker-python, +body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"].version-picker-javascript, +body[data-path*="/labs/"] button[aria-haspopup="menu"].version-picker-python, +body[data-path*="/labs/"] button[aria-haspopup="menu"].version-picker-javascript, +.hide-version-picker-platform button[aria-haspopup="menu"].version-picker-python, +.hide-version-picker-platform button[aria-haspopup="menu"].version-picker-javascript, +.hide-version-picker-labs button[aria-haspopup="menu"].version-picker-python, +.hide-version-picker-labs button[aria-haspopup="menu"].version-picker-javascript { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* FALLBACK 1: More specific class combination targeting */ +body[data-path*="/langgraph-platform/"] button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"], +body[data-path*="/labs/"] button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"], +.hide-version-picker-platform button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"], +.hide-version-picker-labs button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"] { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* FALLBACK 2: Target by chevron SVG + specific text styling */ +body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down), +body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down), +.hide-version-picker-platform button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down), +.hide-version-picker-labs button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down) { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* FALLBACK 3: Target buttons with version-specific text content pattern */ +body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]), +body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]), +.hide-version-picker-platform button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]), +.hide-version-picker-labs button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]) { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* CONSERVATIVE APPROACH: Only hide on specific unversioned pages */ +/* Target Platform pages specifically */ +body[data-path*="/langgraph-platform"] button.version-picker-python, +body[data-path*="/langgraph-platform"] button.version-picker-javascript, +body[data-pathname*="/langgraph-platform"] button.version-picker-python, +body[data-pathname*="/langgraph-platform"] button.version-picker-javascript, +.hide-version-picker-platform button.version-picker-python, +.hide-version-picker-platform button.version-picker-javascript { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* Target Labs pages specifically - multiple URL patterns */ +body[data-path*="/labs"] button.version-picker-python, +body[data-path*="/labs"] button.version-picker-javascript, +body[data-path*="/labs/"] button.version-picker-python, +body[data-path*="/labs/"] button.version-picker-javascript, +body[data-pathname*="/labs"] button.version-picker-python, +body[data-pathname*="/labs"] button.version-picker-javascript, +body[data-pathname*="/labs/"] button.version-picker-python, +body[data-pathname*="/labs/"] button.version-picker-javascript, +.hide-version-picker-labs button.version-picker-python, +.hide-version-picker-labs button.version-picker-javascript { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* Stronger Labs targeting - any button with version picker classes on Labs pages */ +body.hide-version-picker-labs button[class*="version-picker-"], +body[data-path*="/labs"] button[aria-haspopup="menu"][class*="text-xs"], +body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"], +body[data-pathname*="/labs"] button[aria-haspopup="menu"][class*="text-xs"], +body[data-pathname*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"] { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} + +/* Additional targeting with URL path variations */ +body.hide-version-picker-platform button[class*="text-xs"][class*="gap-1.5"][aria-haspopup="menu"], +body.hide-version-picker-labs button[class*="text-xs"][class*="gap-1.5"][aria-haspopup="menu"] { + display: none !important; + visibility: hidden !important; + opacity: 0 !important; + pointer-events: none !important; +} \ No newline at end of file diff --git a/src/hide-version-picker.js b/src/hide-version-picker.js new file mode 100644 index 00000000..1047aef2 --- /dev/null +++ b/src/hide-version-picker.js @@ -0,0 +1,85 @@ +/** + * Fallback script to add CSS classes for version picker hiding. + * + * This minimal script adds CSS classes to the body element based on URL, + * which works with the CSS file to hide the version picker on unversioned pages. + */ +(function() { + 'use strict'; + + function addVersionPickerClasses() { + const currentPath = window.location.pathname; + const body = document.body; + + // Debug logging + console.log('🔍 Version picker debug:', { + currentPath, + bodyClasses: body.className, + isLangGraphPython: currentPath.includes('/langgraph/python/'), + isLangGraphJavaScript: currentPath.includes('/langgraph/javascript/'), + isPlatform: currentPath.includes('/langgraph-platform/'), + isLabs: currentPath.includes('/labs/') + }); + + // Remove existing classes from body + body.classList.remove('hide-version-picker-platform', 'hide-version-picker-labs', 'langgraph-python', 'langgraph-javascript'); + + // Add appropriate class based on URL - check multiple patterns + if (currentPath.includes('/langgraph/python/')) { + body.classList.add('langgraph-python'); + console.log('✅ Added langgraph-python class'); + } else if (currentPath.includes('/langgraph/javascript/')) { + body.classList.add('langgraph-javascript'); + console.log('✅ Added langgraph-javascript class'); + } else if (currentPath.includes('/langgraph-platform/') || currentPath.includes('/langgraph-platform')) { + body.classList.add('hide-version-picker-platform'); + console.log('❌ Added hide-version-picker-platform class'); + } else if (currentPath.includes('/labs/') || currentPath.includes('/labs') || currentPath.match(/\/labs(?:\/|$)/)) { + body.classList.add('hide-version-picker-labs'); + console.log('❌ Added hide-version-picker-labs class'); + } else { + console.log('⚠️ No matching URL pattern found for:', currentPath); + } + + // Also add content-based classes to version picker buttons + const buttons = document.querySelectorAll('button[aria-haspopup="menu"]'); + console.log('🔘 Found buttons with aria-haspopup="menu":', buttons.length); + + buttons.forEach((button, index) => { + // Remove existing version picker classes + button.classList.remove('version-picker-python', 'version-picker-javascript'); + + // Add class based on button text content + const buttonText = button.textContent.trim().toLowerCase(); + console.log(`🔘 Button ${index}: "${buttonText}"`); + + if (buttonText === 'python') { + button.classList.add('version-picker-python'); + console.log(`✅ Added version-picker-python to button ${index}`); + } else if (buttonText === 'javascript') { + button.classList.add('version-picker-javascript'); + console.log(`✅ Added version-picker-javascript to button ${index}`); + } + }); + } + + // Run immediately + addVersionPickerClasses(); + + // Run on page load + document.addEventListener('DOMContentLoaded', addVersionPickerClasses); + + // Run on navigation + window.addEventListener('popstate', addVersionPickerClasses); + + // Watch for URL changes (SPA navigation) + let lastUrl = location.href; + new MutationObserver(() => { + const url = location.href; + if (url !== lastUrl) { + lastUrl = url; + addVersionPickerClasses(); + } + }).observe(document, { subtree: true, childList: true }); + +})(); \ No newline at end of file From ca5887e9c1071daebf1f8256b011712cd46baa66 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Thu, 7 Aug 2025 09:47:01 -0700 Subject: [PATCH 06/17] Put language docs at root, move oss folder and put docs in there to fix URL path --- pipeline/core/builder.py | 12 +- src/docs.json | 296 +++++++++++++++++++-------------------- 2 files changed, 156 insertions(+), 152 deletions(-) diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index 7f39581d..29f11bc4 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -74,12 +74,12 @@ def build_all(self) -> None: shutil.rmtree(self.build_dir) self.build_dir.mkdir(parents=True, exist_ok=True) - # Build LangGraph versioned content (oss/ -> langgraph/python/ and langgraph/javascript/) + # Build LangGraph versioned content (oss/ -> python/oss/ and javascript/oss/) logger.info("Building LangGraph Python version...") - self._build_langgraph_version("langgraph/python", "python") + self._build_langgraph_version("python/oss", "python") logger.info("Building LangGraph JavaScript version...") - self._build_langgraph_version("langgraph/javascript", "js") + self._build_langgraph_version("javascript/oss", "js") # Build unversioned content (same content regardless of version) logger.info("Building LangGraph Platform content...") @@ -504,7 +504,7 @@ def _is_shared_file(self, file_path: Path) -> bool: Returns: True if the file should be shared, False if it should be version-specific. """ - # Shared files: docs.json, images directory, JavaScript files + # Shared files: docs.json, images directory, JavaScript files, snippets relative_path = file_path.relative_to(self.src_dir) # docs.json should be shared @@ -515,6 +515,10 @@ def _is_shared_file(self, file_path: Path) -> bool: if "images" in relative_path.parts: return True + # Snippets directory should be shared + if "snippets" in relative_path.parts: + return True + # JavaScript and CSS files should be shared (used for custom scripts/styles) if file_path.suffix.lower() in {".js", ".css"}: return True diff --git a/src/docs.json b/src/docs.json index c58ae4fa..0da72220 100644 --- a/src/docs.json +++ b/src/docs.json @@ -76,24 +76,24 @@ { "group": "Get started", "pages": [ - "langgraph/python/overview", - "langgraph/python/quickstart", - "langgraph/python/run-an-agent", - "langgraph/python/template-applications" + "python/oss/overview", + "python/oss/quickstart", + "python/oss/run-an-agent", + "python/oss/template-applications" ] }, { "group": "General concepts", "pages": [ - "langgraph/python/workflows-and-agents", - "langgraph/python/prebuilt-vs-low-level", + "python/oss/workflows-and-agents", + "python/oss/prebuilt-vs-low-level", { "group": "Common agent architectures", "pages": [ - "langgraph/python/agentic-architectures", - "langgraph/python/agentic-rag", - "langgraph/python/agent-supervisor", - "langgraph/python/sql-agent" + "python/oss/agentic-architectures", + "python/oss/agentic-rag", + "python/oss/agent-supervisor", + "python/oss/sql-agent" ] } ] @@ -101,9 +101,9 @@ { "group": "Additional resources", "pages": [ - "langgraph/python/case-studies", - "langgraph/python/faq", - "langgraph/python/langgraph-academy" + "python/oss/case-studies", + "python/oss/faq", + "python/oss/langgraph-academy" ] } ] @@ -114,45 +114,45 @@ { "group": "Basic configuration", "pages": [ - "langgraph/python/prebuilts" + "python/oss/prebuilts" ] }, { "group": "Low-level configuration", "pages": [ - "langgraph/python/why-langgraph", - "langgraph/python/1-build-basic-chatbot", - "langgraph/python/2-add-tools", - "langgraph/python/3-add-memory", - "langgraph/python/4-human-in-the-loop", - "langgraph/python/5-customize-state", - "langgraph/python/6-time-travel" + "python/oss/why-langgraph", + "python/oss/1-build-basic-chatbot", + "python/oss/2-add-tools", + "python/oss/3-add-memory", + "python/oss/4-human-in-the-loop", + "python/oss/5-customize-state", + "python/oss/6-time-travel" ] }, { "group": "Components", "pages": [ - "langgraph/python/models", + "python/oss/models", { "group": "Tools", "pages": [ - "langgraph/python/tools", - "langgraph/python/call-tools" + "python/oss/tools", + "python/oss/call-tools" ] }, { "group": "MCP", "pages": [ - "langgraph/python/mcp", - "langgraph/python/use-mcp" + "python/oss/mcp", + "python/oss/use-mcp" ] }, { "group": "Multi-agent", "pages": [ - "langgraph/python/multi-agent", - "langgraph/python/multi-agent-prebuilts", - "langgraph/python/multi-agent-custom" + "python/oss/multi-agent", + "python/oss/multi-agent-prebuilts", + "python/oss/multi-agent-custom" ] } ] @@ -165,42 +165,42 @@ { "group": "Capabilities", "pages": [ - "langgraph/python/persistence", - "langgraph/python/durable-execution", + "python/oss/persistence", + "python/oss/durable-execution", { "group": "Streaming", "pages": [ - "langgraph/python/streaming", - "langgraph/python/use-streaming" + "python/oss/streaming", + "python/oss/use-streaming" ] }, { "group": "Human-in-the-loop", "pages": [ - "langgraph/python/human-in-the-loop", - "langgraph/python/add-human-in-the-loop" + "python/oss/human-in-the-loop", + "python/oss/add-human-in-the-loop" ] }, { "group": "Time travel", "pages": [ - "langgraph/python/time-travel", - "langgraph/python/use-time-travel" + "python/oss/time-travel", + "python/oss/use-time-travel" ] }, { "group": "Memory and context", "pages": [ - "langgraph/python/memory", - "langgraph/python/context", - "langgraph/python/add-memory" + "python/oss/memory", + "python/oss/context", + "python/oss/add-memory" ] }, { "group": "Subgraphs", "pages": [ - "langgraph/python/subgraphs", - "langgraph/python/use-subgraphs" + "python/oss/subgraphs", + "python/oss/use-subgraphs" ] } ] @@ -208,10 +208,10 @@ { "group": "Run and debug", "pages": [ - "langgraph/python/local-server", - "langgraph/python/ui", - "langgraph/python/trace-agent", - "langgraph/python/evals" + "python/oss/local-server", + "python/oss/ui", + "python/oss/trace-agent", + "python/oss/evals" ] }, { @@ -220,18 +220,18 @@ { "group": "Graph API", "pages": [ - "langgraph/python/graph-api", - "langgraph/python/use-graph-api" + "python/oss/graph-api", + "python/oss/use-graph-api" ] }, { "group": "Functional API", "pages": [ - "langgraph/python/functional-api", - "langgraph/python/use-functional-api" + "python/oss/functional-api", + "python/oss/use-functional-api" ] }, - "langgraph/python/pregel" + "python/oss/pregel" ] } ] @@ -242,39 +242,39 @@ { "group": "LangGraph reference", "pages": [ - "langgraph/python/reference/overview", - "langgraph/python/reference/graphs", - "langgraph/python/reference/functional-api", - "langgraph/python/reference/pregel", - "langgraph/python/reference/checkpointers", - "langgraph/python/reference/storage", - "langgraph/python/reference/caching", - "langgraph/python/reference/types", - "langgraph/python/reference/runtime", - "langgraph/python/reference/config", - "langgraph/python/reference/errors", - "langgraph/python/reference/constants", - "langgraph/python/reference/channels" + "python/oss/reference/overview", + "python/oss/reference/graphs", + "python/oss/reference/functional-api", + "python/oss/reference/pregel", + "python/oss/reference/checkpointers", + "python/oss/reference/storage", + "python/oss/reference/caching", + "python/oss/reference/types", + "python/oss/reference/runtime", + "python/oss/reference/config", + "python/oss/reference/errors", + "python/oss/reference/constants", + "python/oss/reference/channels" ] }, { "group": "Prebuilt reference", "pages": [ - "langgraph/python/reference/agents", - "langgraph/python/reference/supervisor", - "langgraph/python/reference/swarm", - "langgraph/python/reference/mcp" + "python/oss/reference/agents", + "python/oss/reference/supervisor", + "python/oss/reference/swarm", + "python/oss/reference/mcp" ] }, { "group": "Error troubleshooting", "pages": [ - "langgraph/python/common-errors", - "langgraph/python/GRAPH_RECURSION_LIMIT", - "langgraph/python/INVALID_CHAT_HISTORY", - "langgraph/python/INVALID_CONCURRENT_GRAPH_UPDATE", - "langgraph/python/INVALID_GRAPH_NODE_RETURN_VALUE", - "langgraph/python/MULTIPLE_SUBGRAPHS" + "python/oss/common-errors", + "python/oss/GRAPH_RECURSION_LIMIT", + "python/oss/INVALID_CHAT_HISTORY", + "python/oss/INVALID_CONCURRENT_GRAPH_UPDATE", + "python/oss/INVALID_GRAPH_NODE_RETURN_VALUE", + "python/oss/MULTIPLE_SUBGRAPHS" ] } ] @@ -562,24 +562,24 @@ { "group": "Get started", "pages": [ - "langgraph/javascript/overview", - "langgraph/javascript/quickstart", - "langgraph/javascript/run-an-agent", - "langgraph/javascript/template-applications" + "javascript/oss/overview", + "javascript/oss/quickstart", + "javascript/oss/run-an-agent", + "javascript/oss/template-applications" ] }, { "group": "General concepts", "pages": [ - "langgraph/javascript/workflows-and-agents", - "langgraph/javascript/prebuilt-vs-low-level", + "javascript/oss/workflows-and-agents", + "javascript/oss/prebuilt-vs-low-level", { "group": "Common agent architectures", "pages": [ - "langgraph/javascript/agentic-architectures", - "langgraph/javascript/agentic-rag", - "langgraph/javascript/agent-supervisor", - "langgraph/javascript/sql-agent" + "javascript/oss/agentic-architectures", + "javascript/oss/agentic-rag", + "javascript/oss/agent-supervisor", + "javascript/oss/sql-agent" ] } ] @@ -587,9 +587,9 @@ { "group": "Additional resources", "pages": [ - "langgraph/javascript/case-studies", - "langgraph/javascript/faq", - "langgraph/javascript/langgraph-academy" + "javascript/oss/case-studies", + "javascript/oss/faq", + "javascript/oss/langgraph-academy" ] } ] @@ -600,45 +600,45 @@ { "group": "Basic configuration", "pages": [ - "langgraph/javascript/prebuilts" + "javascript/oss/prebuilts" ] }, { "group": "Low-level configuration", "pages": [ - "langgraph/javascript/why-langgraph", - "langgraph/javascript/1-build-basic-chatbot", - "langgraph/javascript/2-add-tools", - "langgraph/javascript/3-add-memory", - "langgraph/javascript/4-human-in-the-loop", - "langgraph/javascript/5-customize-state", - "langgraph/javascript/6-time-travel" + "javascript/oss/why-langgraph", + "javascript/oss/1-build-basic-chatbot", + "javascript/oss/2-add-tools", + "javascript/oss/3-add-memory", + "javascript/oss/4-human-in-the-loop", + "javascript/oss/5-customize-state", + "javascript/oss/6-time-travel" ] }, { "group": "Components", "pages": [ - "langgraph/javascript/models", + "javascript/oss/models", { "group": "Tools", "pages": [ - "langgraph/javascript/tools", - "langgraph/javascript/call-tools" + "javascript/oss/tools", + "javascript/oss/call-tools" ] }, { "group": "MCP", "pages": [ - "langgraph/javascript/mcp", - "langgraph/javascript/use-mcp" + "javascript/oss/mcp", + "javascript/oss/use-mcp" ] }, { "group": "Multi-agent", "pages": [ - "langgraph/javascript/multi-agent", - "langgraph/javascript/multi-agent-prebuilts", - "langgraph/javascript/multi-agent-custom" + "javascript/oss/multi-agent", + "javascript/oss/multi-agent-prebuilts", + "javascript/oss/multi-agent-custom" ] } ] @@ -651,42 +651,42 @@ { "group": "Capabilities", "pages": [ - "langgraph/javascript/persistence", - "langgraph/javascript/durable-execution", + "javascript/oss/persistence", + "javascript/oss/durable-execution", { "group": "Streaming", "pages": [ - "langgraph/javascript/streaming", - "langgraph/javascript/use-streaming" + "javascript/oss/streaming", + "javascript/oss/use-streaming" ] }, { "group": "Human-in-the-loop", "pages": [ - "langgraph/javascript/human-in-the-loop", - "langgraph/javascript/add-human-in-the-loop" + "javascript/oss/human-in-the-loop", + "javascript/oss/add-human-in-the-loop" ] }, { "group": "Time travel", "pages": [ - "langgraph/javascript/time-travel", - "langgraph/javascript/use-time-travel" + "javascript/oss/time-travel", + "javascript/oss/use-time-travel" ] }, { "group": "Memory and context", "pages": [ - "langgraph/javascript/memory", - "langgraph/javascript/context", - "langgraph/javascript/add-memory" + "javascript/oss/memory", + "javascript/oss/context", + "javascript/oss/add-memory" ] }, { "group": "Subgraphs", "pages": [ - "langgraph/javascript/subgraphs", - "langgraph/javascript/use-subgraphs" + "javascript/oss/subgraphs", + "javascript/oss/use-subgraphs" ] } ] @@ -694,10 +694,10 @@ { "group": "Run and debug", "pages": [ - "langgraph/javascript/local-server", - "langgraph/javascript/ui", - "langgraph/javascript/trace-agent", - "langgraph/javascript/evals" + "javascript/oss/local-server", + "javascript/oss/ui", + "javascript/oss/trace-agent", + "javascript/oss/evals" ] }, { @@ -706,18 +706,18 @@ { "group": "Graph API", "pages": [ - "langgraph/javascript/graph-api", - "langgraph/javascript/use-graph-api" + "javascript/oss/graph-api", + "javascript/oss/use-graph-api" ] }, { "group": "Functional API", "pages": [ - "langgraph/javascript/functional-api", - "langgraph/javascript/use-functional-api" + "javascript/oss/functional-api", + "javascript/oss/use-functional-api" ] }, - "langgraph/javascript/pregel" + "javascript/oss/pregel" ] } ] @@ -728,39 +728,39 @@ { "group": "LangGraph reference", "pages": [ - "langgraph/javascript/reference/overview", - "langgraph/javascript/reference/graphs", - "langgraph/javascript/reference/functional-api", - "langgraph/javascript/reference/pregel", - "langgraph/javascript/reference/checkpointers", - "langgraph/javascript/reference/storage", - "langgraph/javascript/reference/caching", - "langgraph/javascript/reference/types", - "langgraph/javascript/reference/runtime", - "langgraph/javascript/reference/config", - "langgraph/javascript/reference/errors", - "langgraph/javascript/reference/constants", - "langgraph/javascript/reference/channels" + "javascript/oss/reference/overview", + "javascript/oss/reference/graphs", + "javascript/oss/reference/functional-api", + "javascript/oss/reference/pregel", + "javascript/oss/reference/checkpointers", + "javascript/oss/reference/storage", + "javascript/oss/reference/caching", + "javascript/oss/reference/types", + "javascript/oss/reference/runtime", + "javascript/oss/reference/config", + "javascript/oss/reference/errors", + "javascript/oss/reference/constants", + "javascript/oss/reference/channels" ] }, { "group": "Prebuilt reference", "pages": [ - "langgraph/javascript/reference/agents", - "langgraph/javascript/reference/supervisor", - "langgraph/javascript/reference/swarm", - "langgraph/javascript/reference/mcp" + "javascript/oss/reference/agents", + "javascript/oss/reference/supervisor", + "javascript/oss/reference/swarm", + "javascript/oss/reference/mcp" ] }, { "group": "Error troubleshooting", "pages": [ - "langgraph/javascript/common-errors", - "langgraph/javascript/GRAPH_RECURSION_LIMIT", - "langgraph/javascript/INVALID_CHAT_HISTORY", - "langgraph/javascript/INVALID_CONCURRENT_GRAPH_UPDATE", - "langgraph/javascript/INVALID_GRAPH_NODE_RETURN_VALUE", - "langgraph/javascript/MULTIPLE_SUBGRAPHS" + "javascript/oss/common-errors", + "javascript/oss/GRAPH_RECURSION_LIMIT", + "javascript/oss/INVALID_CHAT_HISTORY", + "javascript/oss/INVALID_CONCURRENT_GRAPH_UPDATE", + "javascript/oss/INVALID_GRAPH_NODE_RETURN_VALUE", + "javascript/oss/MULTIPLE_SUBGRAPHS" ] } ] From fa472f75a92fa3377d38460e70b7bc7e3d3e19cd Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Thu, 7 Aug 2025 10:11:49 -0700 Subject: [PATCH 07/17] Simplify show/hiding logic --- src/hide-version-picker.css | 108 +++--------------------------------- src/hide-version-picker.js | 62 +++++---------------- 2 files changed, 21 insertions(+), 149 deletions(-) diff --git a/src/hide-version-picker.css b/src/hide-version-picker.css index 2b419059..df1036f8 100644 --- a/src/hide-version-picker.css +++ b/src/hide-version-picker.css @@ -5,115 +5,21 @@ * LangGraph Platform or LangChain Labs pages, since these sections * have the same content regardless of Python/JavaScript version. * - * Target element: + * Two-layer approach: + * 1. Primary: Match buttons marked by our JavaScript + * 2. Fallback: Match by Mintlify's specific styling */ -/* PRIMARY: Target version picker by specific styling classes (text-xs + gap-1.5) */ -body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"], -body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"], -.hide-version-picker-platform button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"], -.hide-version-picker-labs button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"] { +/* Primary selector: Match version picker buttons on unversioned pages */ +.hide-version-picker button.version-picker-button { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; } -/* SECONDARY: Target by content - JavaScript will add these classes */ -body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"].version-picker-python, -body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"].version-picker-javascript, -body[data-path*="/labs/"] button[aria-haspopup="menu"].version-picker-python, -body[data-path*="/labs/"] button[aria-haspopup="menu"].version-picker-javascript, -.hide-version-picker-platform button[aria-haspopup="menu"].version-picker-python, -.hide-version-picker-platform button[aria-haspopup="menu"].version-picker-javascript, -.hide-version-picker-labs button[aria-haspopup="menu"].version-picker-python, -.hide-version-picker-labs button[aria-haspopup="menu"].version-picker-javascript { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* FALLBACK 1: More specific class combination targeting */ -body[data-path*="/langgraph-platform/"] button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"], -body[data-path*="/labs/"] button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"], -.hide-version-picker-platform button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"], -.hide-version-picker-labs button.group[class*="bg-background-light"][class*="text-xs"][class*="gap-1.5"] { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* FALLBACK 2: Target by chevron SVG + specific text styling */ -body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down), -body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down), -.hide-version-picker-platform button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down), -.hide-version-picker-labs button[aria-haspopup="menu"][class*="text-xs"]:has(svg.lucide-chevron-down) { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* FALLBACK 3: Target buttons with version-specific text content pattern */ -body[data-path*="/langgraph-platform/"] button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]), -body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]), -.hide-version-picker-platform button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]), -.hide-version-picker-labs button[aria-haspopup="menu"][class*="font-semibold"]:has(svg path[d*="m6 9 6 6 6-6"]) { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* CONSERVATIVE APPROACH: Only hide on specific unversioned pages */ -/* Target Platform pages specifically */ -body[data-path*="/langgraph-platform"] button.version-picker-python, -body[data-path*="/langgraph-platform"] button.version-picker-javascript, -body[data-pathname*="/langgraph-platform"] button.version-picker-python, -body[data-pathname*="/langgraph-platform"] button.version-picker-javascript, -.hide-version-picker-platform button.version-picker-python, -.hide-version-picker-platform button.version-picker-javascript { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* Target Labs pages specifically - multiple URL patterns */ -body[data-path*="/labs"] button.version-picker-python, -body[data-path*="/labs"] button.version-picker-javascript, -body[data-path*="/labs/"] button.version-picker-python, -body[data-path*="/labs/"] button.version-picker-javascript, -body[data-pathname*="/labs"] button.version-picker-python, -body[data-pathname*="/labs"] button.version-picker-javascript, -body[data-pathname*="/labs/"] button.version-picker-python, -body[data-pathname*="/labs/"] button.version-picker-javascript, -.hide-version-picker-labs button.version-picker-python, -.hide-version-picker-labs button.version-picker-javascript { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* Stronger Labs targeting - any button with version picker classes on Labs pages */ -body.hide-version-picker-labs button[class*="version-picker-"], -body[data-path*="/labs"] button[aria-haspopup="menu"][class*="text-xs"], -body[data-path*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"], -body[data-pathname*="/labs"] button[aria-haspopup="menu"][class*="text-xs"], -body[data-pathname*="/labs/"] button[aria-haspopup="menu"][class*="text-xs"] { - display: none !important; - visibility: hidden !important; - opacity: 0 !important; - pointer-events: none !important; -} - -/* Additional targeting with URL path variations */ -body.hide-version-picker-platform button[class*="text-xs"][class*="gap-1.5"][aria-haspopup="menu"], -body.hide-version-picker-labs button[class*="text-xs"][class*="gap-1.5"][aria-haspopup="menu"] { +/* Fallback: Match by Mintlify's specific styling */ +.hide-version-picker button[aria-haspopup="menu"][class*="text-xs"][class*="gap-1.5"] { display: none !important; visibility: hidden !important; opacity: 0 !important; diff --git a/src/hide-version-picker.js b/src/hide-version-picker.js index 1047aef2..57384d7b 100644 --- a/src/hide-version-picker.js +++ b/src/hide-version-picker.js @@ -1,8 +1,8 @@ /** - * Fallback script to add CSS classes for version picker hiding. + * Minimal script to add CSS classes for version picker hiding. * - * This minimal script adds CSS classes to the body element based on URL, - * which works with the CSS file to hide the version picker on unversioned pages. + * This script adds CSS classes to the body element based on URL, + * and to version picker buttons based on their content. */ (function() { 'use strict'; @@ -11,54 +11,21 @@ const currentPath = window.location.pathname; const body = document.body; - // Debug logging - console.log('🔍 Version picker debug:', { - currentPath, - bodyClasses: body.className, - isLangGraphPython: currentPath.includes('/langgraph/python/'), - isLangGraphJavaScript: currentPath.includes('/langgraph/javascript/'), - isPlatform: currentPath.includes('/langgraph-platform/'), - isLabs: currentPath.includes('/labs/') - }); - - // Remove existing classes from body - body.classList.remove('hide-version-picker-platform', 'hide-version-picker-labs', 'langgraph-python', 'langgraph-javascript'); + // Remove existing classes + body.classList.remove('hide-version-picker'); - // Add appropriate class based on URL - check multiple patterns - if (currentPath.includes('/langgraph/python/')) { - body.classList.add('langgraph-python'); - console.log('✅ Added langgraph-python class'); - } else if (currentPath.includes('/langgraph/javascript/')) { - body.classList.add('langgraph-javascript'); - console.log('✅ Added langgraph-javascript class'); - } else if (currentPath.includes('/langgraph-platform/') || currentPath.includes('/langgraph-platform')) { - body.classList.add('hide-version-picker-platform'); - console.log('❌ Added hide-version-picker-platform class'); - } else if (currentPath.includes('/labs/') || currentPath.includes('/labs') || currentPath.match(/\/labs(?:\/|$)/)) { - body.classList.add('hide-version-picker-labs'); - console.log('❌ Added hide-version-picker-labs class'); - } else { - console.log('⚠️ No matching URL pattern found for:', currentPath); + // Add appropriate class based on URL + if (currentPath.includes('/langgraph-platform/') || currentPath.includes('/langgraph-platform')) { + body.classList.add('hide-version-picker'); + } else if (currentPath.match(/\/labs(?:\/|$)/)) { + body.classList.add('hide-version-picker'); } - // Also add content-based classes to version picker buttons - const buttons = document.querySelectorAll('button[aria-haspopup="menu"]'); - console.log('🔘 Found buttons with aria-haspopup="menu":', buttons.length); - - buttons.forEach((button, index) => { - // Remove existing version picker classes - button.classList.remove('version-picker-python', 'version-picker-javascript'); - - // Add class based on button text content + // Add classes to version picker buttons + document.querySelectorAll('button[aria-haspopup="menu"]').forEach(button => { const buttonText = button.textContent.trim().toLowerCase(); - console.log(`🔘 Button ${index}: "${buttonText}"`); - - if (buttonText === 'python') { - button.classList.add('version-picker-python'); - console.log(`✅ Added version-picker-python to button ${index}`); - } else if (buttonText === 'javascript') { - button.classList.add('version-picker-javascript'); - console.log(`✅ Added version-picker-javascript to button ${index}`); + if (buttonText === 'python' || buttonText === 'javascript') { + button.classList.add('version-picker-button'); } }); } @@ -81,5 +48,4 @@ addVersionPickerClasses(); } }).observe(document, { subtree: true, childList: true }); - })(); \ No newline at end of file From fac1b99fe9929574cb710653c948d2455fc2658e Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Thu, 7 Aug 2025 10:45:58 -0700 Subject: [PATCH 08/17] Bookmark changes to move version picker location --- src/docs.json | 3 ++- src/version-picker-position.css | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/version-picker-position.css diff --git a/src/docs.json b/src/docs.json index 0da72220..47e97ac2 100644 --- a/src/docs.json +++ b/src/docs.json @@ -58,7 +58,8 @@ "/hide-version-picker.js" ], "styles": [ - "/hide-version-picker.css" + "/hide-version-picker.css", + "/version-picker-position.css" ], "navigation": { "versions": [ diff --git a/src/version-picker-position.css b/src/version-picker-position.css new file mode 100644 index 00000000..76579b64 --- /dev/null +++ b/src/version-picker-position.css @@ -0,0 +1,35 @@ +/** + * Position version picker between docs dropdown and navigation. + * + * This CSS moves the version picker button to appear between + * the main docs dropdown and the start of the navigation sections, + * preserving its appearance and functionality. + */ + +/* Target the version picker button */ +button[aria-haspopup="menu"].version-picker-button { + /* Position absolutely within the sidebar */ + position: absolute; + /* Increase top spacing to avoid overlap with dropdown */ + top: 200px; + /* Ensure proper width */ + width: 247px; + /* Keep centered */ + margin-left: 12px; + margin-right: 16px; + /* Ensure it's above content but below dropdown */ + z-index: 30; +} + +/* Add space at the top of the navigation to make room for picker */ +nav[aria-label="Sidebar"] .sidebar-content { + margin-top: 64px; +} + +/* Ensure dropdown retains its position */ +button.nav-dropdown-trigger { + position: relative; + z-index: 40; + /* Add bottom margin to create more space */ + margin-bottom: 50px !important; +} \ No newline at end of file From cbb3fe33efd72c0387e13cd75454d87a3ddd9a4f Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Thu, 7 Aug 2025 15:06:41 -0700 Subject: [PATCH 09/17] Revert picker position changes, fix test --- src/docs.json | 3 +-- src/version-picker-position.css | 35 -------------------------------- tests/unit_tests/test_builder.py | 1 + 3 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 src/version-picker-position.css diff --git a/src/docs.json b/src/docs.json index 47e97ac2..0da72220 100644 --- a/src/docs.json +++ b/src/docs.json @@ -58,8 +58,7 @@ "/hide-version-picker.js" ], "styles": [ - "/hide-version-picker.css", - "/version-picker-position.css" + "/hide-version-picker.css" ], "navigation": { "versions": [ diff --git a/src/version-picker-position.css b/src/version-picker-position.css deleted file mode 100644 index 76579b64..00000000 --- a/src/version-picker-position.css +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Position version picker between docs dropdown and navigation. - * - * This CSS moves the version picker button to appear between - * the main docs dropdown and the start of the navigation sections, - * preserving its appearance and functionality. - */ - -/* Target the version picker button */ -button[aria-haspopup="menu"].version-picker-button { - /* Position absolutely within the sidebar */ - position: absolute; - /* Increase top spacing to avoid overlap with dropdown */ - top: 200px; - /* Ensure proper width */ - width: 247px; - /* Keep centered */ - margin-left: 12px; - margin-right: 16px; - /* Ensure it's above content but below dropdown */ - z-index: 30; -} - -/* Add space at the top of the navigation to make room for picker */ -nav[aria-label="Sidebar"] .sidebar-content { - margin-top: 64px; -} - -/* Ensure dropdown retains its position */ -button.nav-dropdown-trigger { - position: relative; - z-index: 40; - /* Add bottom margin to create more space */ - margin-bottom: 50px !important; -} \ No newline at end of file diff --git a/tests/unit_tests/test_builder.py b/tests/unit_tests/test_builder.py index e90506c3..68b3e60f 100644 --- a/tests/unit_tests/test_builder.py +++ b/tests/unit_tests/test_builder.py @@ -36,6 +36,7 @@ def test_builder_initialization() -> None: ".yml", ".yaml", ".css", + ".js", } From cb28747901b802cdb45b9c85fb99567bff1bfbea Mon Sep 17 00:00:00 2001 From: Lauren Hirata Singh Date: Fri, 8 Aug 2025 12:47:22 -0400 Subject: [PATCH 10/17] fix nav --- src/docs.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/docs.json b/src/docs.json index 2ac2aa12..e3e82ba4 100644 --- a/src/docs.json +++ b/src/docs.json @@ -98,7 +98,6 @@ "/hide-version-picker.css" ], "navigation": { - "versions": [ "global": { "anchors": [ { @@ -108,7 +107,7 @@ } ] }, - "dropdowns": [ + "versions": [ { "version": "Python", "dropdowns": [ From d4d1162a207aa718f45fc5fa30704eefa42d8f12 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Mon, 11 Aug 2025 08:10:38 -0700 Subject: [PATCH 11/17] Update build output, update docs JSON accordingly --- pipeline/core/builder.py | 6 +- src/docs.json | 296 +++++++++++++++++++-------------------- 2 files changed, 151 insertions(+), 151 deletions(-) diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index 29f11bc4..3d90db09 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -74,12 +74,12 @@ def build_all(self) -> None: shutil.rmtree(self.build_dir) self.build_dir.mkdir(parents=True, exist_ok=True) - # Build LangGraph versioned content (oss/ -> python/oss/ and javascript/oss/) + # Build LangGraph versioned content (oss/ -> oss/python/ and oss/javascript/) logger.info("Building LangGraph Python version...") - self._build_langgraph_version("python/oss", "python") + self._build_langgraph_version("oss/python", "python") logger.info("Building LangGraph JavaScript version...") - self._build_langgraph_version("javascript/oss", "js") + self._build_langgraph_version("oss/javascript", "js") # Build unversioned content (same content regardless of version) logger.info("Building LangGraph Platform content...") diff --git a/src/docs.json b/src/docs.json index 0da72220..1a6ec58f 100644 --- a/src/docs.json +++ b/src/docs.json @@ -76,24 +76,24 @@ { "group": "Get started", "pages": [ - "python/oss/overview", - "python/oss/quickstart", - "python/oss/run-an-agent", - "python/oss/template-applications" + "oss/python/overview", + "oss/python/quickstart", + "oss/python/run-an-agent", + "oss/python/template-applications" ] }, { "group": "General concepts", "pages": [ - "python/oss/workflows-and-agents", - "python/oss/prebuilt-vs-low-level", + "oss/python/workflows-and-agents", + "oss/python/prebuilt-vs-low-level", { "group": "Common agent architectures", "pages": [ - "python/oss/agentic-architectures", - "python/oss/agentic-rag", - "python/oss/agent-supervisor", - "python/oss/sql-agent" + "oss/python/agentic-architectures", + "oss/python/agentic-rag", + "oss/python/agent-supervisor", + "oss/python/sql-agent" ] } ] @@ -101,9 +101,9 @@ { "group": "Additional resources", "pages": [ - "python/oss/case-studies", - "python/oss/faq", - "python/oss/langgraph-academy" + "oss/python/case-studies", + "oss/python/faq", + "oss/python/langgraph-academy" ] } ] @@ -114,45 +114,45 @@ { "group": "Basic configuration", "pages": [ - "python/oss/prebuilts" + "oss/python/prebuilts" ] }, { "group": "Low-level configuration", "pages": [ - "python/oss/why-langgraph", - "python/oss/1-build-basic-chatbot", - "python/oss/2-add-tools", - "python/oss/3-add-memory", - "python/oss/4-human-in-the-loop", - "python/oss/5-customize-state", - "python/oss/6-time-travel" + "oss/python/why-langgraph", + "oss/python/1-build-basic-chatbot", + "oss/python/2-add-tools", + "oss/python/3-add-memory", + "oss/python/4-human-in-the-loop", + "oss/python/5-customize-state", + "oss/python/6-time-travel" ] }, { "group": "Components", "pages": [ - "python/oss/models", + "oss/python/models", { "group": "Tools", "pages": [ - "python/oss/tools", - "python/oss/call-tools" + "oss/python/tools", + "oss/python/call-tools" ] }, { "group": "MCP", "pages": [ - "python/oss/mcp", - "python/oss/use-mcp" + "oss/python/mcp", + "oss/python/use-mcp" ] }, { "group": "Multi-agent", "pages": [ - "python/oss/multi-agent", - "python/oss/multi-agent-prebuilts", - "python/oss/multi-agent-custom" + "oss/python/multi-agent", + "oss/python/multi-agent-prebuilts", + "oss/python/multi-agent-custom" ] } ] @@ -165,42 +165,42 @@ { "group": "Capabilities", "pages": [ - "python/oss/persistence", - "python/oss/durable-execution", + "oss/python/persistence", + "oss/python/durable-execution", { "group": "Streaming", "pages": [ - "python/oss/streaming", - "python/oss/use-streaming" + "oss/python/streaming", + "oss/python/use-streaming" ] }, { "group": "Human-in-the-loop", "pages": [ - "python/oss/human-in-the-loop", - "python/oss/add-human-in-the-loop" + "oss/python/human-in-the-loop", + "oss/python/add-human-in-the-loop" ] }, { "group": "Time travel", "pages": [ - "python/oss/time-travel", - "python/oss/use-time-travel" + "oss/python/time-travel", + "oss/python/use-time-travel" ] }, { "group": "Memory and context", "pages": [ - "python/oss/memory", - "python/oss/context", - "python/oss/add-memory" + "oss/python/memory", + "oss/python/context", + "oss/python/add-memory" ] }, { "group": "Subgraphs", "pages": [ - "python/oss/subgraphs", - "python/oss/use-subgraphs" + "oss/python/subgraphs", + "oss/python/use-subgraphs" ] } ] @@ -208,10 +208,10 @@ { "group": "Run and debug", "pages": [ - "python/oss/local-server", - "python/oss/ui", - "python/oss/trace-agent", - "python/oss/evals" + "oss/python/local-server", + "oss/python/ui", + "oss/python/trace-agent", + "oss/python/evals" ] }, { @@ -220,18 +220,18 @@ { "group": "Graph API", "pages": [ - "python/oss/graph-api", - "python/oss/use-graph-api" + "oss/python/graph-api", + "oss/python/use-graph-api" ] }, { "group": "Functional API", "pages": [ - "python/oss/functional-api", - "python/oss/use-functional-api" + "oss/python/functional-api", + "oss/python/use-functional-api" ] }, - "python/oss/pregel" + "oss/python/pregel" ] } ] @@ -242,39 +242,39 @@ { "group": "LangGraph reference", "pages": [ - "python/oss/reference/overview", - "python/oss/reference/graphs", - "python/oss/reference/functional-api", - "python/oss/reference/pregel", - "python/oss/reference/checkpointers", - "python/oss/reference/storage", - "python/oss/reference/caching", - "python/oss/reference/types", - "python/oss/reference/runtime", - "python/oss/reference/config", - "python/oss/reference/errors", - "python/oss/reference/constants", - "python/oss/reference/channels" + "oss/python/reference/overview", + "oss/python/reference/graphs", + "oss/python/reference/functional-api", + "oss/python/reference/pregel", + "oss/python/reference/checkpointers", + "oss/python/reference/storage", + "oss/python/reference/caching", + "oss/python/reference/types", + "oss/python/reference/runtime", + "oss/python/reference/config", + "oss/python/reference/errors", + "oss/python/reference/constants", + "oss/python/reference/channels" ] }, { "group": "Prebuilt reference", "pages": [ - "python/oss/reference/agents", - "python/oss/reference/supervisor", - "python/oss/reference/swarm", - "python/oss/reference/mcp" + "oss/python/reference/agents", + "oss/python/reference/supervisor", + "oss/python/reference/swarm", + "oss/python/reference/mcp" ] }, { "group": "Error troubleshooting", "pages": [ - "python/oss/common-errors", - "python/oss/GRAPH_RECURSION_LIMIT", - "python/oss/INVALID_CHAT_HISTORY", - "python/oss/INVALID_CONCURRENT_GRAPH_UPDATE", - "python/oss/INVALID_GRAPH_NODE_RETURN_VALUE", - "python/oss/MULTIPLE_SUBGRAPHS" + "oss/python/common-errors", + "oss/python/GRAPH_RECURSION_LIMIT", + "oss/python/INVALID_CHAT_HISTORY", + "oss/python/INVALID_CONCURRENT_GRAPH_UPDATE", + "oss/python/INVALID_GRAPH_NODE_RETURN_VALUE", + "oss/python/MULTIPLE_SUBGRAPHS" ] } ] @@ -562,24 +562,24 @@ { "group": "Get started", "pages": [ - "javascript/oss/overview", - "javascript/oss/quickstart", - "javascript/oss/run-an-agent", - "javascript/oss/template-applications" + "oss/javascript/overview", + "oss/javascript/quickstart", + "oss/javascript/run-an-agent", + "oss/javascript/template-applications" ] }, { "group": "General concepts", "pages": [ - "javascript/oss/workflows-and-agents", - "javascript/oss/prebuilt-vs-low-level", + "oss/javascript/workflows-and-agents", + "oss/javascript/prebuilt-vs-low-level", { "group": "Common agent architectures", "pages": [ - "javascript/oss/agentic-architectures", - "javascript/oss/agentic-rag", - "javascript/oss/agent-supervisor", - "javascript/oss/sql-agent" + "oss/javascript/agentic-architectures", + "oss/javascript/agentic-rag", + "oss/javascript/agent-supervisor", + "oss/javascript/sql-agent" ] } ] @@ -587,9 +587,9 @@ { "group": "Additional resources", "pages": [ - "javascript/oss/case-studies", - "javascript/oss/faq", - "javascript/oss/langgraph-academy" + "oss/javascript/case-studies", + "oss/javascript/faq", + "oss/javascript/langgraph-academy" ] } ] @@ -600,45 +600,45 @@ { "group": "Basic configuration", "pages": [ - "javascript/oss/prebuilts" + "oss/javascript/prebuilts" ] }, { "group": "Low-level configuration", "pages": [ - "javascript/oss/why-langgraph", - "javascript/oss/1-build-basic-chatbot", - "javascript/oss/2-add-tools", - "javascript/oss/3-add-memory", - "javascript/oss/4-human-in-the-loop", - "javascript/oss/5-customize-state", - "javascript/oss/6-time-travel" + "oss/javascript/why-langgraph", + "oss/javascript/1-build-basic-chatbot", + "oss/javascript/2-add-tools", + "oss/javascript/3-add-memory", + "oss/javascript/4-human-in-the-loop", + "oss/javascript/5-customize-state", + "oss/javascript/6-time-travel" ] }, { "group": "Components", "pages": [ - "javascript/oss/models", + "oss/javascript/models", { "group": "Tools", "pages": [ - "javascript/oss/tools", - "javascript/oss/call-tools" + "oss/javascript/tools", + "oss/javascript/call-tools" ] }, { "group": "MCP", "pages": [ - "javascript/oss/mcp", - "javascript/oss/use-mcp" + "oss/javascript/mcp", + "oss/javascript/use-mcp" ] }, { "group": "Multi-agent", "pages": [ - "javascript/oss/multi-agent", - "javascript/oss/multi-agent-prebuilts", - "javascript/oss/multi-agent-custom" + "oss/javascript/multi-agent", + "oss/javascript/multi-agent-prebuilts", + "oss/javascript/multi-agent-custom" ] } ] @@ -651,42 +651,42 @@ { "group": "Capabilities", "pages": [ - "javascript/oss/persistence", - "javascript/oss/durable-execution", + "oss/javascript/persistence", + "oss/javascript/durable-execution", { "group": "Streaming", "pages": [ - "javascript/oss/streaming", - "javascript/oss/use-streaming" + "oss/javascript/streaming", + "oss/javascript/use-streaming" ] }, { "group": "Human-in-the-loop", "pages": [ - "javascript/oss/human-in-the-loop", - "javascript/oss/add-human-in-the-loop" + "oss/javascript/human-in-the-loop", + "oss/javascript/add-human-in-the-loop" ] }, { "group": "Time travel", "pages": [ - "javascript/oss/time-travel", - "javascript/oss/use-time-travel" + "oss/javascript/time-travel", + "oss/javascript/use-time-travel" ] }, { "group": "Memory and context", "pages": [ - "javascript/oss/memory", - "javascript/oss/context", - "javascript/oss/add-memory" + "oss/javascript/memory", + "oss/javascript/context", + "oss/javascript/add-memory" ] }, { "group": "Subgraphs", "pages": [ - "javascript/oss/subgraphs", - "javascript/oss/use-subgraphs" + "oss/javascript/subgraphs", + "oss/javascript/use-subgraphs" ] } ] @@ -694,10 +694,10 @@ { "group": "Run and debug", "pages": [ - "javascript/oss/local-server", - "javascript/oss/ui", - "javascript/oss/trace-agent", - "javascript/oss/evals" + "oss/javascript/local-server", + "oss/javascript/ui", + "oss/javascript/trace-agent", + "oss/javascript/evals" ] }, { @@ -706,18 +706,18 @@ { "group": "Graph API", "pages": [ - "javascript/oss/graph-api", - "javascript/oss/use-graph-api" + "oss/javascript/graph-api", + "oss/javascript/use-graph-api" ] }, { "group": "Functional API", "pages": [ - "javascript/oss/functional-api", - "javascript/oss/use-functional-api" + "oss/javascript/functional-api", + "oss/javascript/use-functional-api" ] }, - "javascript/oss/pregel" + "oss/javascript/pregel" ] } ] @@ -728,39 +728,39 @@ { "group": "LangGraph reference", "pages": [ - "javascript/oss/reference/overview", - "javascript/oss/reference/graphs", - "javascript/oss/reference/functional-api", - "javascript/oss/reference/pregel", - "javascript/oss/reference/checkpointers", - "javascript/oss/reference/storage", - "javascript/oss/reference/caching", - "javascript/oss/reference/types", - "javascript/oss/reference/runtime", - "javascript/oss/reference/config", - "javascript/oss/reference/errors", - "javascript/oss/reference/constants", - "javascript/oss/reference/channels" + "oss/javascript/reference/overview", + "oss/javascript/reference/graphs", + "oss/javascript/reference/functional-api", + "oss/javascript/reference/pregel", + "oss/javascript/reference/checkpointers", + "oss/javascript/reference/storage", + "oss/javascript/reference/caching", + "oss/javascript/reference/types", + "oss/javascript/reference/runtime", + "oss/javascript/reference/config", + "oss/javascript/reference/errors", + "oss/javascript/reference/constants", + "oss/javascript/reference/channels" ] }, { "group": "Prebuilt reference", "pages": [ - "javascript/oss/reference/agents", - "javascript/oss/reference/supervisor", - "javascript/oss/reference/swarm", - "javascript/oss/reference/mcp" + "oss/javascript/reference/agents", + "oss/javascript/reference/supervisor", + "oss/javascript/reference/swarm", + "oss/javascript/reference/mcp" ] }, { "group": "Error troubleshooting", "pages": [ - "javascript/oss/common-errors", - "javascript/oss/GRAPH_RECURSION_LIMIT", - "javascript/oss/INVALID_CHAT_HISTORY", - "javascript/oss/INVALID_CONCURRENT_GRAPH_UPDATE", - "javascript/oss/INVALID_GRAPH_NODE_RETURN_VALUE", - "javascript/oss/MULTIPLE_SUBGRAPHS" + "oss/javascript/common-errors", + "oss/javascript/GRAPH_RECURSION_LIMIT", + "oss/javascript/INVALID_CHAT_HISTORY", + "oss/javascript/INVALID_CONCURRENT_GRAPH_UPDATE", + "oss/javascript/INVALID_GRAPH_NODE_RETURN_VALUE", + "oss/javascript/MULTIPLE_SUBGRAPHS" ] } ] From d030437822ba9f960d72735ca7963e58c4f7ad3b Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Tue, 12 Aug 2025 11:25:42 -0700 Subject: [PATCH 12/17] Update docs.json to match --- src/docs.json | 113 ++++++++++++++------------------------------------ 1 file changed, 30 insertions(+), 83 deletions(-) diff --git a/src/docs.json b/src/docs.json index 4c6d17bd..8eb20ff7 100644 --- a/src/docs.json +++ b/src/docs.json @@ -117,92 +117,39 @@ "description": "Framework for building reliable agents and workflows", "tabs": [ { - "tab": "Get started", - "groups": [ - { - "group": "Get started", - "pages": [ - "oss/python/overview", - "oss/python/quickstart", - "oss/python/run-an-agent", - "oss/python/template-applications" - ] - }, - { - "group": "General concepts", - "pages": [ - "oss/python/workflows-and-agents", - "oss/python/prebuilt-vs-low-level", - { - "group": "Common agent architectures", - "pages": [ - "oss/python/agentic-architectures", - "oss/python/agentic-rag", - "oss/python/agent-supervisor", - "oss/python/sql-agent" - ] - } - ] - }, - { - "group": "Additional resources", - "pages": [ - "oss/python/case-studies", - "oss/python/faq", - "oss/python/langgraph-academy" - ] - } + "group": "Get started", + "pages": [ + "oss/python/overview", + "oss/python/quickstart", + "oss/python/run-an-agent", + "oss/python/prebuilt-vs-low-level" ] }, { - "tab": "Build agents", - "groups": [ - { - "group": "Basic configuration", - "pages": [ - "oss/python/prebuilts" - ] - }, - { - "group": "Low-level configuration", - "pages": [ - "oss/python/why-langgraph", - "oss/python/1-build-basic-chatbot", - "oss/python/2-add-tools", - "oss/python/3-add-memory", - "oss/python/4-human-in-the-loop", - "oss/python/5-customize-state", - "oss/python/6-time-travel" - ] - }, - { - "group": "Components", - "pages": [ - "oss/python/models", - { - "group": "Tools", - "pages": [ - "oss/python/tools", - "oss/python/call-tools" - ] - }, - { - "group": "MCP", - "pages": [ - "oss/python/mcp", - "oss/python/use-mcp" - ] - }, - { - "group": "Multi-agent", - "pages": [ - "oss/python/multi-agent", - "oss/python/multi-agent-prebuilts", - "oss/python/multi-agent-custom" - ] - } - ] - } + "group": "Common architectures", + "pages": [ + "oss/python/agentic-architectures", + "oss/python/agentic-rag", + "oss/python/agent-supervisor", + "oss/python/sql-agent" + ] + }, + { + "group": "Additional resources", + "pages": [ + "oss/python/case-studies", + "oss/python/template-applications" + ] + } + ] + }, + { + "tab": "Build agents", + "groups": [ + { + "group": "Basic configuration", + "pages": [ + "oss/python/prebuilts" ] }, { From 63522ed3fdbc9126b9496835a58899799ec9de79 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Tue, 12 Aug 2025 15:41:17 -0700 Subject: [PATCH 13/17] Fix linting errors --- pipeline/core/builder.py | 68 ++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index 3d90db09..482ad6e7 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -67,7 +67,11 @@ def build_all(self) -> None: Displays: Progress bars showing build progress for each version. """ - logger.info("Building versioned documentation from %s to %s", self.src_dir, self.build_dir) + logger.info( + "Building versioned documentation from %s to %s", + self.src_dir, + self.build_dir, + ) # Clear build directory if self.build_dir.exists(): @@ -77,14 +81,14 @@ def build_all(self) -> None: # Build LangGraph versioned content (oss/ -> oss/python/ and oss/javascript/) logger.info("Building LangGraph Python version...") self._build_langgraph_version("oss/python", "python") - + logger.info("Building LangGraph JavaScript version...") self._build_langgraph_version("oss/javascript", "js") # Build unversioned content (same content regardless of version) logger.info("Building LangGraph Platform content...") self._build_unversioned_content("langgraph-platform", "langgraph-platform") - + logger.info("Building LangChain Labs content...") self._build_unversioned_content("labs", "labs") @@ -123,7 +127,9 @@ def _convert_yaml_to_json(self, yaml_file_path: Path, output_path: Path) -> None logger.exception("Failed to convert %s to JSON", yaml_file_path) raise - def _process_markdown_content(self, content: str, file_path: Path, target_language: str = None) -> str: + def _process_markdown_content( + self, content: str, file_path: Path, target_language: str | None = None + ) -> str: """Process markdown content with preprocessing. This method applies preprocessing (cross-reference resolution and @@ -139,12 +145,16 @@ def _process_markdown_content(self, content: str, file_path: Path, target_langua """ try: # Apply markdown preprocessing - return preprocess_markdown(content, file_path, target_language=target_language) + return preprocess_markdown( + content, file_path, target_language=target_language + ) except Exception: logger.exception("Failed to process markdown content from %s", file_path) raise - def _process_markdown_file(self, input_path: Path, output_path: Path, target_language: str = None) -> None: + def _process_markdown_file( + self, input_path: Path, output_path: Path, target_language: str | None = None + ) -> None: """Process a markdown file with preprocessing and copy to output. This method reads a markdown file, applies preprocessing (cross-reference @@ -162,7 +172,9 @@ def _process_markdown_file(self, input_path: Path, output_path: Path, target_lan content = f.read() # Apply markdown preprocessing - processed_content = self._process_markdown_content(content, input_path, target_language) + processed_content = self._process_markdown_content( + content, input_path, target_language + ) # Convert .md to .mdx if needed if input_path.suffix.lower() == ".md": @@ -321,7 +333,8 @@ def _build_langgraph_version(self, output_dir: str, target_language: str) -> Non return all_files = [ - file_path for file_path in oss_dir.rglob("*") + file_path + for file_path in oss_dir.rglob("*") if file_path.is_file() and not self._is_shared_file(file_path) ] @@ -345,9 +358,13 @@ def _build_langgraph_version(self, output_dir: str, target_language: str) -> Non relative_path = file_path.relative_to(oss_dir) # Build to output_dir/ (not output_dir/oss/) output_path = self.build_dir / output_dir / relative_path - + result = self._build_single_file( - file_path, output_path, target_language, pbar, f"{output_dir}/{relative_path}" + file_path, + output_path, + target_language, + pbar, + f"{output_dir}/{relative_path}", ) if result: copied_count += 1 @@ -375,7 +392,8 @@ def _build_unversioned_content(self, source_dir: str, output_dir: str) -> None: return all_files = [ - file_path for file_path in src_path.rglob("*") + file_path + for file_path in src_path.rglob("*") if file_path.is_file() and not self._is_shared_file(file_path) ] @@ -399,9 +417,13 @@ def _build_unversioned_content(self, source_dir: str, output_dir: str) -> None: relative_path = file_path.relative_to(src_path) # Build directly to output_dir/ output_path = self.build_dir / output_dir / relative_path - + result = self._build_single_file( - file_path, output_path, "python", pbar, f"{output_dir}/{relative_path}" + file_path, + output_path, + "python", + pbar, + f"{output_dir}/{relative_path}", ) if result: copied_count += 1 @@ -417,7 +439,12 @@ def _build_unversioned_content(self, source_dir: str, output_dir: str) -> None: ) def _build_single_file( - self, file_path: Path, output_path: Path, target_language: str, pbar: tqdm, display_path: str + self, + file_path: Path, + output_path: Path, + target_language: str, + pbar: tqdm, + display_path: str, ) -> bool: """Build a single file with progress bar integration. @@ -506,30 +533,31 @@ def _is_shared_file(self, file_path: Path) -> bool: """ # Shared files: docs.json, images directory, JavaScript files, snippets relative_path = file_path.relative_to(self.src_dir) - + # docs.json should be shared if file_path.name == "docs.json": return True - + # Images directory should be shared if "images" in relative_path.parts: return True - + # Snippets directory should be shared if "snippets" in relative_path.parts: return True - + # JavaScript and CSS files should be shared (used for custom scripts/styles) if file_path.suffix.lower() in {".js", ".css"}: return True - + return False def _copy_shared_files(self) -> None: """Copy files that should be shared between versions.""" # Collect shared files shared_files = [ - file_path for file_path in self.src_dir.rglob("*") + file_path + for file_path in self.src_dir.rglob("*") if file_path.is_file() and self._is_shared_file(file_path) ] From 50529220f7fd4056ef50160e84497c1248c214fc Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Tue, 12 Aug 2025 15:46:59 -0700 Subject: [PATCH 14/17] Fix first error --- tests/unit_tests/test_builder.py | 197 +++++++++++++++++++++++-------- 1 file changed, 147 insertions(+), 50 deletions(-) diff --git a/tests/unit_tests/test_builder.py b/tests/unit_tests/test_builder.py index 68b3e60f..dcbf6511 100644 --- a/tests/unit_tests/test_builder.py +++ b/tests/unit_tests/test_builder.py @@ -51,57 +51,154 @@ def test_build_all_empty_directory() -> None: assert not fs.list_build_files() -def test_build_all_supported_files() -> None: - """Test building all supported file types. + def test_build_all_supported_files() -> None: + """Test building all supported file types. + + Verifies that the builder correctly copies all supported file types + while maintaining directory structure. + """ + files = [ + # LangGraph (oss) files - both Python and JavaScript versions + File(path="oss/index.mdx", content="# Welcome"), + File(path="oss/config.json", content='{"name": "test"}'), + File(path="oss/guides/setup.md", content="# Setup Guide"), + + # LangGraph Platform files + File(path="langgraph-platform/index.mdx", content="# Platform"), + File(path="langgraph-platform/guide.md", content="# Guide"), + + # LangChain Labs files + File(path="labs/index.mdx", content="# Labs"), + + # Shared files + File(path="images/logo.png", bytes=b"PNG_DATA"), + File(path="docs.json", content='{"name": "test"}'), + ] + + with file_system(files) as fs: + builder = DocumentationBuilder(fs.src_dir, fs.build_dir) + builder.build_all() + + # Verify all files were copied with correct structure + build_files = set(str(p) for p in fs.list_build_files()) + + # Python version of LangGraph files + assert "oss/python/index.mdx" in build_files + assert "oss/python/config.json" in build_files + assert "oss/python/guides/setup.md" in build_files + + # JavaScript version of LangGraph files + assert "oss/javascript/index.mdx" in build_files + assert "oss/javascript/config.json" in build_files + assert "oss/javascript/guides/setup.md" in build_files + + # LangGraph Platform files + assert "langgraph-platform/index.mdx" in build_files + assert "langgraph-platform/guide.md" in build_files + + # LangChain Labs files + assert "labs/index.mdx" in build_files + + # Shared files + assert "images/logo.png" in build_files + assert "docs.json" in build_files + + # Total number of files should be: + # - 3 files * 2 versions (Python/JavaScript) for LangGraph + # - 2 files for Platform + # - 1 file for Labs + # - 2 shared files + assert len(build_files) == 11 + + + + def test_build_all_unsupported_files() -> None: + """Test building with unsupported file types. + + Verifies that the builder skips unsupported file types. + """ + files = [ + # LangGraph files with supported and unsupported types + File( + path="oss/index.mdx", + content="# Welcome", + ), + File( + path="oss/ignored.txt", + content="This should be ignored", + ), + File( + path="oss/data.csv", + content="col1,col2\n1,2", + ), + + # Platform files with supported and unsupported types + File( + path="langgraph-platform/guide.md", + content="# Guide", + ), + File( + path="langgraph-platform/ignored.txt", + content="This should be ignored", + ), + + # Labs files with supported and unsupported types + File( + path="labs/index.mdx", + content="# Labs", + ), + File( + path="labs/data.csv", + content="col1,col2\n1,2", + ), + + # Shared files with supported and unsupported types + File( + path="images/logo.png", + bytes=b"PNG_DATA", + ), + File( + path="ignored.txt", + content="This should be ignored", + ), + ] + + with file_system(files) as fs: + builder = DocumentationBuilder(fs.src_dir, fs.build_dir) + builder.build_all() + + # Verify only supported files were copied + build_files = set(str(p) for p in fs.list_build_files()) + + # Python version of LangGraph files (only .mdx) + assert "oss/python/index.mdx" in build_files + assert "oss/python/ignored.txt" not in build_files + assert "oss/python/data.csv" not in build_files + + # JavaScript version of LangGraph files (only .mdx) + assert "oss/javascript/index.mdx" in build_files + assert "oss/javascript/ignored.txt" not in build_files + assert "oss/javascript/data.csv" not in build_files + + # Platform files (only .md) + assert "langgraph-platform/guide.md" in build_files + assert "langgraph-platform/ignored.txt" not in build_files + + # Labs files (only .mdx) + assert "labs/index.mdx" in build_files + assert "labs/data.csv" not in build_files + + # Shared files (only .png) + assert "images/logo.png" in build_files + assert "ignored.txt" not in build_files + + # Total number of files should be: + # - 1 file * 2 versions (Python/JavaScript) for LangGraph + # - 1 file for Platform + # - 1 file for Labs + # - 1 shared file + assert len(build_files) == 4 - Verifies that the builder correctly copies all supported file types - while maintaining directory structure. - """ - files = [ - File(path="index.mdx", content="# Welcome"), - File(path="config.json", content='{"name": "test"}'), - File(path="images/logo.png", bytes=b"PNG_DATA"), - File(path="guides/setup.md", content="# Setup Guide"), - ] - - with file_system(files) as fs: - builder = DocumentationBuilder(fs.src_dir, fs.build_dir) - builder.build_all() - - # Verify all files were copied - build_files = fs.list_build_files() - assert len(build_files) == 4 - assert Path("index.mdx") in build_files - assert Path("config.json") in build_files - assert Path("images/logo.png") in build_files - assert Path("guides/setup.mdx") in build_files - - -def test_build_all_unsupported_files() -> None: - """Test building with unsupported file types. - - Verifies that the builder skips unsupported file types. - """ - files = [ - File( - path="index.mdx", - content="# Welcome", - ), - File( - path="ignored.txt", - content="This should be ignored", - ), - ] - - with file_system(files) as fs: - builder = DocumentationBuilder(fs.src_dir, fs.build_dir) - builder.build_all() - - # Verify only supported files were copied - build_files = fs.list_build_files() - assert len(build_files) == 1 - assert Path("index.mdx") in build_files - assert not fs.build_file_exists("ignored.txt") def test_build_single_file() -> None: From 5debbaa8c4c51fdd25bc6ee68c5598af99194d2a Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Tue, 12 Aug 2025 15:52:37 -0700 Subject: [PATCH 15/17] Fix lint issue after making other changes --- tests/unit_tests/test_builder.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/tests/unit_tests/test_builder.py b/tests/unit_tests/test_builder.py index dcbf6511..63fe6080 100644 --- a/tests/unit_tests/test_builder.py +++ b/tests/unit_tests/test_builder.py @@ -50,7 +50,6 @@ def test_build_all_empty_directory() -> None: builder.build_all() assert not fs.list_build_files() - def test_build_all_supported_files() -> None: """Test building all supported file types. @@ -62,14 +61,11 @@ def test_build_all_supported_files() -> None: File(path="oss/index.mdx", content="# Welcome"), File(path="oss/config.json", content='{"name": "test"}'), File(path="oss/guides/setup.md", content="# Setup Guide"), - # LangGraph Platform files File(path="langgraph-platform/index.mdx", content="# Platform"), File(path="langgraph-platform/guide.md", content="# Guide"), - # LangChain Labs files File(path="labs/index.mdx", content="# Labs"), - # Shared files File(path="images/logo.png", bytes=b"PNG_DATA"), File(path="docs.json", content='{"name": "test"}'), @@ -81,28 +77,28 @@ def test_build_all_supported_files() -> None: # Verify all files were copied with correct structure build_files = set(str(p) for p in fs.list_build_files()) - + # Python version of LangGraph files assert "oss/python/index.mdx" in build_files assert "oss/python/config.json" in build_files assert "oss/python/guides/setup.md" in build_files - + # JavaScript version of LangGraph files assert "oss/javascript/index.mdx" in build_files assert "oss/javascript/config.json" in build_files assert "oss/javascript/guides/setup.md" in build_files - + # LangGraph Platform files assert "langgraph-platform/index.mdx" in build_files assert "langgraph-platform/guide.md" in build_files - + # LangChain Labs files assert "labs/index.mdx" in build_files - + # Shared files assert "images/logo.png" in build_files assert "docs.json" in build_files - + # Total number of files should be: # - 3 files * 2 versions (Python/JavaScript) for LangGraph # - 2 files for Platform @@ -110,8 +106,6 @@ def test_build_all_supported_files() -> None: # - 2 shared files assert len(build_files) == 11 - - def test_build_all_unsupported_files() -> None: """Test building with unsupported file types. @@ -131,7 +125,6 @@ def test_build_all_unsupported_files() -> None: path="oss/data.csv", content="col1,col2\n1,2", ), - # Platform files with supported and unsupported types File( path="langgraph-platform/guide.md", @@ -141,7 +134,6 @@ def test_build_all_unsupported_files() -> None: path="langgraph-platform/ignored.txt", content="This should be ignored", ), - # Labs files with supported and unsupported types File( path="labs/index.mdx", @@ -151,7 +143,6 @@ def test_build_all_unsupported_files() -> None: path="labs/data.csv", content="col1,col2\n1,2", ), - # Shared files with supported and unsupported types File( path="images/logo.png", @@ -200,7 +191,6 @@ def test_build_all_unsupported_files() -> None: assert len(build_files) == 4 - def test_build_single_file() -> None: """Test building a single file. From 878ab2283dccdcda45973d913a91d50b8ce211c7 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Tue, 12 Aug 2025 16:09:15 -0700 Subject: [PATCH 16/17] Update Python sidebar --- src/docs.json | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/docs.json b/src/docs.json index acf01301..eea0299a 100644 --- a/src/docs.json +++ b/src/docs.json @@ -125,31 +125,23 @@ "oss/python/overview", "oss/python/quickstart", "oss/python/run-an-agent", - "oss/python/template-applications" + "oss/python/prebuilt-vs-low-level" ] }, { - "group": "General concepts", + "group": "Common architectures", "pages": [ - "oss/python/workflows-and-agents", - "oss/python/prebuilt-vs-low-level", - { - "group": "Common agent architectures", - "pages": [ - "oss/python/agentic-architectures", - "oss/python/agentic-rag", - "oss/python/agent-supervisor", - "oss/python/sql-agent" - ] - } + "oss/python/agentic-architectures", + "oss/python/agentic-rag", + "oss/python/agent-supervisor", + "oss/python/sql-agent" ] }, { "group": "Additional resources", "pages": [ "oss/python/case-studies", - "oss/python/faq", - "oss/python/langgraph-academy" + "oss/python/template-applications" ] } ] @@ -611,7 +603,7 @@ "oss/javascript/overview", "oss/javascript/quickstart", "oss/javascript/run-an-agent", - "oss/javascript/template-applications" + "oss/javascript/prebuilt-vs-low-level" ] }, { @@ -634,8 +626,7 @@ "group": "Additional resources", "pages": [ "oss/javascript/case-studies", - "oss/javascript/faq", - "oss/javascript/langgraph-academy" + "oss/javascript/template-applications" ] } ] From bfd36be486e9b2c873ae9883a4b2dd1875e2b054 Mon Sep 17 00:00:00 2001 From: Brody Klapko Date: Tue, 12 Aug 2025 16:15:22 -0700 Subject: [PATCH 17/17] Make JS and Python get started sidebars the same --- src/docs.json | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/docs.json b/src/docs.json index eea0299a..131c57c9 100644 --- a/src/docs.json +++ b/src/docs.json @@ -607,19 +607,12 @@ ] }, { - "group": "General concepts", + "group": "Common architectures", "pages": [ - "oss/javascript/workflows-and-agents", - "oss/javascript/prebuilt-vs-low-level", - { - "group": "Common agent architectures", - "pages": [ - "oss/javascript/agentic-architectures", - "oss/javascript/agentic-rag", - "oss/javascript/agent-supervisor", - "oss/javascript/sql-agent" - ] - } + "oss/javascript/agentic-architectures", + "oss/javascript/agentic-rag", + "oss/javascript/agent-supervisor", + "oss/javascript/sql-agent" ] }, {