diff --git a/README.md b/README.md index 951f760..d9d3fc4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Graphite Dev -Graphite Dev runs a local assistant with a visual workflow trace. +Graphite Dev provides a local assistant runtime with visual workflow tracing. The tool must be executed from the project root directory to function properly. ## Installation diff --git a/grafi_dev/cli.py b/grafi_dev/cli.py index b9cc2fa..34ca2a6 100644 --- a/grafi_dev/cli.py +++ b/grafi_dev/cli.py @@ -20,17 +20,16 @@ def _load_assistant(path: Path): original_sys_path = sys.path.copy() try: - # Add both the directory containing the script AND the project root to sys.path + # current working directory is project root + project_root = str(Path.cwd()) + script_dir = str(abs_path.parent) - project_root = str(Path(__file__).parent.parent) # grafi-dev root directory if script_dir not in sys.path: sys.path.insert(0, script_dir) if project_root not in sys.path: sys.path.insert(0, project_root) - logger.debug(f"Modified sys.path: {sys.path}") - # Now load the module spec = importlib.util.spec_from_file_location("user_code", abs_path) mod = importlib.util.module_from_spec(spec) diff --git a/pyproject.toml b/pyproject.toml index 67a53d8..4252a60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,14 +12,20 @@ requires-python = ">=3.12" dependencies = [ "fastapi>=0.115.12", "grafi>=0.0.11", - "tavily-python>=0.7.1", "typer>=0.15.3", "uvicorn>=0.34.2", ] + + [project.scripts] grafi-dev = "grafi_dev.cli:app" [tool.setuptools.package-data] grafi_dev = ["frontend/*"] + +[dependency-groups] +dev = [ + "tavily-python>=0.7.2", +] diff --git a/uv.lock b/uv.lock index 8847cc3..a0b78d3 100644 --- a/uv.lock +++ b/uv.lock @@ -190,20 +190,26 @@ source = { editable = "." } dependencies = [ { name = "fastapi" }, { name = "grafi" }, - { name = "tavily-python" }, { name = "typer" }, { name = "uvicorn" }, ] +[package.dev-dependencies] +dev = [ + { name = "tavily-python" }, +] + [package.metadata] requires-dist = [ { name = "fastapi", specifier = ">=0.115.12" }, { name = "grafi", specifier = ">=0.0.11" }, - { name = "tavily-python", specifier = ">=0.7.1" }, { name = "typer", specifier = ">=0.15.3" }, { name = "uvicorn", specifier = ">=0.34.2" }, ] +[package.metadata.requires-dev] +dev = [{ name = "tavily-python", specifier = ">=0.7.2" }] + [[package]] name = "grpcio" version = "1.71.0" @@ -734,16 +740,16 @@ wheels = [ [[package]] name = "tavily-python" -version = "0.7.1" +version = "0.7.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, { name = "requests" }, { name = "tiktoken" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/64/53/9b2103156e221f00273021758b23666c7acb1462e02d9fb7e49bf9f9884d/tavily_python-0.7.1.tar.gz", hash = "sha256:ccbba587fa38d181d54670d6ce26e4f31ad9c7c7f0835d191b9bb542b085dc36", size = 16204 } +sdist = { url = "https://files.pythonhosted.org/packages/fe/27/73b4911c718453c8ed6d8c3a0e40c9114fb34e3c80b1b6573e969345fb0e/tavily_python-0.7.2.tar.gz", hash = "sha256:34f713002887df2b5e6b8d7db7bc64ae107395bdb5f53611e80a89dac9cbdf19", size = 16481 } wheels = [ - { url = "https://files.pythonhosted.org/packages/e1/ed/c861140bd072e91efce3a49ac6fc700f7bde0d696ce7fa288649859c70b6/tavily_python-0.7.1-py3-none-any.whl", hash = "sha256:a73c8e68925a62bfe08e3a8bb4434d64d4e62c82081cc8a68a071b78673e9590", size = 14638 }, + { url = "https://files.pythonhosted.org/packages/47/85/57b6f6a53a5600cc11d6713b33bac16bf8d756bf30ddba71f7a64681755d/tavily_python-0.7.2-py3-none-any.whl", hash = "sha256:0d7cc8b1a2f95ac10cf722094c3b5807aade67cc7750f7ca605edef7455d4c62", size = 14917 }, ] [[package]]