MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / build_port_context

Function build_port_context

claw-code/src/context.py:19–34  ·  view source on GitHub ↗
(base: Path | None = None)

Source from the content-addressed store, hash-verified

17
18
19def build_port_context(base: Path | None = None) -> PortContext:
20 root = base or Path(__file__).resolve().parent.parent
21 source_root = root / 'src'
22 tests_root = root / 'tests'
23 assets_root = root / 'assets'
24 archive_root = root / 'archive' / 'claude_code_ts_snapshot' / 'src'
25 return PortContext(
26 source_root=source_root,
27 tests_root=tests_root,
28 assets_root=assets_root,
29 archive_root=archive_root,
30 python_file_count=sum(1 for path in source_root.rglob('*.py') if path.is_file()),
31 test_file_count=sum(1 for path in tests_root.rglob('*.py') if path.is_file()),
32 asset_file_count=sum(1 for path in assets_root.rglob('*') if path.is_file()),
33 archive_available=archive_root.exists(),
34 )
35
36
37def render_context(context: PortContext) -> str:

Callers 1

bootstrap_sessionMethod · 0.85

Calls 1

PortContextClass · 0.85

Tested by

no test coverage detected