chore: import upstream snapshot with attribution
CI / changes (push) Has been cancelled
CI / cd libs/checkpoint (push) Has been cancelled
CI / cd libs/checkpoint-conformance (push) Has been cancelled
CI / cd libs/checkpoint-postgres (push) Has been cancelled
CI / cd libs/checkpoint-sqlite (push) Has been cancelled
CI / cd libs/cli (push) Has been cancelled
CI / cd libs/prebuilt (push) Has been cancelled
CI / cd libs/sdk-py (push) Has been cancelled
CI / cd libs/langgraph (push) Has been cancelled
CI / Check SDK methods matching (push) Has been cancelled
CI / Check CLI schema hasn't changed #3.13 (push) Has been cancelled
CI / CLI integration test (push) Has been cancelled
CI / sdk-py integration test (push) Has been cancelled
CI / CI Success (push) Has been cancelled
baseline / benchmark (push) Has been cancelled
Deploy Redirects to GitHub Pages / deploy (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:37:18 +08:00
commit a7d6d88f6f
667 changed files with 232986 additions and 0 deletions
@@ -0,0 +1,8 @@
{
"$schema": "https://langgra.ph/schema.json",
"dependencies": [".", "../../libs/shared", "../../libs/common"],
"graphs": {
"agent": "./src/agent/graph.py:graph"
},
"env": ".env"
}
@@ -0,0 +1,19 @@
[project]
name = "agent"
version = "0.0.1"
description = "Agent for the Python monorepo"
authors = [
{ name = "Developer", email = "dev@example.com" },
]
license = { text = "MIT" }
requires-python = ">=3.11,<4.0"
[build-system]
requires = ["setuptools>=73.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["agent"]
[tool.setuptools.package-dir]
"agent" = "src/agent"
@@ -0,0 +1 @@
"""Agent package."""
@@ -0,0 +1,40 @@
"""Simple LangGraph agent for monorepo testing."""
from common import get_common_prefix
from langchain_core.messages import AIMessage
from langgraph.graph import END, START, StateGraph
from shared import get_dummy_message
from agent.state import State
def call_model(state: State) -> dict:
"""Simple node that uses the shared libraries."""
# Use functions from both shared packages
dummy_message = get_dummy_message()
prefix = get_common_prefix()
message = AIMessage(content=f"{prefix} Agent says: {dummy_message}")
return {"messages": [message]}
def should_continue(state: State):
"""Conditional edge - end after first message."""
messages = state["messages"]
if len(messages) > 0:
return END
return "call_model"
# Build the graph
workflow = StateGraph(State)
# Add the node
workflow.add_node("call_model", call_model)
# Add edges
workflow.add_edge(START, "call_model")
workflow.add_conditional_edges("call_model", should_continue)
graph = workflow.compile()
@@ -0,0 +1,13 @@
"""State definition for the agent."""
from collections.abc import Sequence
from typing import Annotated, TypedDict
from langchain_core.messages import BaseMessage
from langgraph.graph.message import add_messages
class State(TypedDict):
"""The state of the agent."""
messages: Annotated[Sequence[BaseMessage], add_messages]
@@ -0,0 +1,5 @@
"""Common helper functions package."""
from .helpers import get_common_prefix
__all__ = ["get_common_prefix"]
@@ -0,0 +1,6 @@
"""Common helper functions."""
def get_common_prefix() -> str:
"""Get a common prefix for messages."""
return "[COMMON]"
@@ -0,0 +1,20 @@
[project]
name = "shared"
version = "0.0.1"
description = "Shared utilities for the Python monorepo"
authors = [
{ name = "Developer", email = "dev@example.com" },
]
license = { text = "MIT" }
requires-python = ">=3.11,<4.0"
dependencies = []
[build-system]
requires = ["setuptools>=73.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["shared"]
[tool.setuptools.package-dir]
"shared" = "src/shared"
@@ -0,0 +1,5 @@
"""Shared utilities package."""
from .utils import get_dummy_message
__all__ = ["get_dummy_message"]
@@ -0,0 +1,6 @@
"""Shared utility functions."""
def get_dummy_message() -> str:
"""Get a dummy message for testing."""
return "Hello from shared library!"
@@ -0,0 +1,46 @@
[project]
name = "python-monorepo-example"
version = "0.0.1"
description = "A Python monorepo example with LangGraph agents and shared packages"
authors = [
{ name = "Developer", email = "dev@example.com" },
]
license = { text = "MIT" }
requires-python = ">=3.11,<4.0"
dependencies = [
"langgraph>=0.6.0,<2",
"langchain-core>=0.2.14",
]
[tool.uv.workspace]
members = ["apps/*", "libs/shared"]
[tool.uv.sources]
shared = { workspace = true }
[project.optional-dependencies]
dev = ["ruff>=0.6.1", "ty"]
[build-system]
requires = ["setuptools>=73.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.ruff]
lint.select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"D", # pydocstyle
"UP",
]
lint.ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
]
[tool.ruff.lint.pydocstyle]
convention = "google"