ph-code-graph 0.7.0__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: ph-code-graph
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: pH plugin: `code_index` and `code_graph`, a Python-native tree-sitter code graph with line-accurate answers.
5
5
  Project-URL: Homepage, https://github.com/chastabor/pH
6
6
  Project-URL: Repository, https://github.com/chastabor/pH
@@ -21,7 +21,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
21
  Classifier: Topic :: Software Development
22
22
  Classifier: Typing :: Typed
23
23
  Requires-Python: >=3.12
24
- Requires-Dist: ph-core==0.7.0
24
+ Requires-Dist: ph-core==0.9.0
25
25
  Requires-Dist: tree-sitter-language-pack>=1.16
26
26
  Requires-Dist: tree-sitter>=0.25
27
27
  Description-Content-Type: text/markdown
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ph-code-graph"
7
- version = "0.7.0"
7
+ version = "0.9.0"
8
8
  description = "pH plugin: `code_index` and `code_graph`, a Python-native tree-sitter code graph with line-accurate answers."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -29,7 +29,7 @@ classifiers = [
29
29
  # in (371 available, the rest fetched on demand — which this row never does
30
30
  # implicitly; see `_extract.indexable`). No Rust toolchain, no Node, no
31
31
  # submodule: the graph itself is stdlib `sqlite3`.
32
- dependencies = ["ph-core==0.7.0", "tree-sitter>=0.25", "tree-sitter-language-pack>=1.16"]
32
+ dependencies = ["ph-core==0.9.0", "tree-sitter>=0.25", "tree-sitter-language-pack>=1.16"]
33
33
 
34
34
  [project.urls]
35
35
  Homepage = "https://github.com/chastabor/pH"
@@ -53,7 +53,7 @@ from pydantic import Field
53
53
 
54
54
  from ph.cordis import Context, MountRefusal, ServiceKey, plugin
55
55
  from ph.json import JsonObject, as_int
56
- from ph.keys import COMMANDS, FS, SKILLS, TOOLS
56
+ from ph.keys import COMMANDS, FS, TOOLS
57
57
  from ph.llm.types import ContentBlock
58
58
  from ph.paths import default_cache_path, resolve_roots
59
59
  from ph.seams._registry import contribute_item
@@ -61,7 +61,7 @@ from ph.seams.changes import tree_state
61
61
  from ph.seams.commands import Provisioning, install_or_status
62
62
  from ph.seams.diagnostics import Diagnostic, contribute
63
63
  from ph.seams.fs import FsService
64
- from ph.seams.skills import discover_skills
64
+ from ph.seams.skills import offer_skills as offer_package_skills
65
65
  from ph.text import count_of
66
66
  from ph.tools.definition import ToolModel, ToolOutput, ToolRunContext, define_tool, text_content
67
67
  from ph.tools.errors import HarnessError
@@ -473,26 +473,8 @@ list still works when the pack has it.
473
473
 
474
474
 
475
475
  def offer_skills(ctx: Context) -> None:
476
- """Install this package's `SKILL.md` files, if a skills registry is mounted.
477
-
478
- `discover_skills` already globs `<root>/*/SKILL.md`, validates each one and
479
- skips a malformed one with a logged reason — the whole of what a
480
- hand-written loader was doing here in 28 lines, duplicated byte-for-byte
481
- into the sibling package. Reaching for the seam's own reader instead is the
482
- rule `contribute_via`'s docstring states about itself.
483
-
484
- **Through `contribute_via`, so the skill arrives exactly when the plugin
485
- does** and leaves with it. `skills-progressive` ships an empty `paths` on
486
- purpose — scanning a well-known directory would make "install a skill" mean
487
- "drop a file somewhere", and a skill is something a distribution installs
488
- deliberately (I7). A distribution registering its own is that act.
489
-
490
- Only the one-line description rides the prompt every turn; the body stays on
491
- disk until the model asks for it by name (G9).
492
- """
493
- root = Path(__file__).parent / "skills"
494
- for skill in discover_skills([str(root)], source="ph-code-graph"):
495
- contribute_item(ctx, SKILLS, skill, label=f"skill({skill.name})")
476
+ """Install this package's `SKILL.md` files (`ph.seams.skills.offer_skills`)."""
477
+ offer_package_skills(ctx, Path(__file__).parent / "skills", source="ph-code-graph")
496
478
 
497
479
 
498
480
  @plugin("code-graph", affects="environment", inject=[TOOLS, FS], config=Config)
@@ -47,6 +47,7 @@ from ph.llm.types import text_of
47
47
  from ph.testing import FAKE_OPTIONS, MountProfile, report_section, run_tool
48
48
  from ph.testing.git import git, git_repo
49
49
  from ph.testing.jj import jj_repo
50
+ from ph.tools.registry import RUN_CODE
50
51
  from ph.workspace_caches import WORKSPACE_FILE
51
52
  from ph_code_graph import CODE_GRAPH
52
53
  from ph_code_graph._extract import (
@@ -895,7 +896,9 @@ async def test_code_mode_hands_the_model_both_tools_through_the_sdk(
895
896
 
896
897
  view = ctx.require(TOOLS).view(scope=agent.ctx)
897
898
  assert view.mode == "code"
898
- assert view.schemas == (), "Code Mode offers one callable, not schemas"
899
+ assert [schema.name for schema in view.schemas] == [RUN_CODE], (
900
+ "Code Mode offers one callable, the transport, not a schema per tool"
901
+ )
899
902
  assert {"code_index", "code_graph"} <= set(view.visible)
900
903
 
901
904
  prompt = await ctx.require(SYSTEM_PROMPT).assemble(agent=agent, scope=agent.ctx)
File without changes
File without changes
File without changes