cg-code-graph 0.11.0__tar.gz → 0.12.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.
- {cg_code_graph-0.11.0/cg_code_graph.egg-info → cg_code_graph-0.12.0}/PKG-INFO +9 -8
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/README.md +8 -7
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0/cg_code_graph.egg-info}/PKG-INFO +9 -8
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/cg_code_graph.egg-info/SOURCES.txt +39 -1
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/__init__.py +1 -1
- cg_code_graph-0.12.0/codegraph/agent_rules.py +57 -0
- cg_code_graph-0.12.0/codegraph/agents.py +150 -0
- cg_code_graph-0.12.0/codegraph/android_ipc.py +400 -0
- cg_code_graph-0.12.0/codegraph/apple_ipc.py +184 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/blindspots.py +25 -0
- cg_code_graph-0.12.0/codegraph/brokers.py +1460 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/cli.py +23 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/model.py +2 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/coverage.py +2 -1
- cg_code_graph-0.12.0/codegraph/dart_isolates.py +149 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/external.py +383 -5
- cg_code_graph-0.12.0/codegraph/graphql.py +1040 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/indexer.py +72 -0
- cg_code_graph-0.12.0/codegraph/jobs.py +997 -0
- cg_code_graph-0.12.0/codegraph/local_ipc.py +676 -0
- cg_code_graph-0.12.0/codegraph/local_sockets.py +462 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/mcp_server.py +13 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/plugin.py +34 -2
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/urls.py +134 -1
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/express/plugin.py +8 -1
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/kotlin/exact.py +33 -5
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/kotlin/plugin.py +340 -10
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/laravel/plugin.py +109 -12
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/nest/plugin.py +76 -3
- cg_code_graph-0.12.0/codegraph/plugins/nuxt/plugin.py +923 -0
- cg_code_graph-0.12.0/codegraph/plugins/php/external.py +191 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/extractor/extract.php +212 -15
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/plugin.py +3 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/socketio.py +11 -1
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/rust/plugin.py +24 -3
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/swift/plugin.py +9 -8
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/extractor/extract.mjs +317 -5
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/extractor/fw.mjs +2 -1
- cg_code_graph-0.12.0/codegraph/plugins/ts/nav.py +252 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/plugin.py +143 -2
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/tsweb/common.py +4 -3
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/tsweb/data.py +236 -3
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/django.yaml +5 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/process_runs.py +48 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/protocols/__init__.py +59 -3
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/protocols/builtin.py +72 -5
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/protocols/matchers.py +43 -2
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/protocols/view.py +65 -11
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/query.py +293 -25
- cg_code_graph-0.12.0/codegraph/realtime_events.py +470 -0
- cg_code_graph-0.12.0/codegraph/realtime_native.py +267 -0
- cg_code_graph-0.12.0/codegraph/realtime_ws.py +362 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/routes.py +16 -2
- cg_code_graph-0.12.0/codegraph/webhooks.py +598 -0
- cg_code_graph-0.12.0/tests/test_agents_install.py +123 -0
- cg_code_graph-0.12.0/tests/test_agents_md.py +17 -0
- cg_code_graph-0.12.0/tests/test_android_ipc.py +123 -0
- cg_code_graph-0.12.0/tests/test_apple_ipc.py +55 -0
- cg_code_graph-0.12.0/tests/test_brokers.py +166 -0
- cg_code_graph-0.12.0/tests/test_dart_isolates.py +65 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_django_flutter.py +112 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_external.py +140 -0
- cg_code_graph-0.12.0/tests/test_graphql.py +148 -0
- cg_code_graph-0.12.0/tests/test_jobs.py +200 -0
- cg_code_graph-0.12.0/tests/test_js_refs.py +54 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin.py +19 -1
- cg_code_graph-0.12.0/tests/test_laravel_resources.py +138 -0
- cg_code_graph-0.12.0/tests/test_local_ipc.py +119 -0
- cg_code_graph-0.12.0/tests/test_local_sockets.py +104 -0
- cg_code_graph-0.12.0/tests/test_nuxt_import_dirs.py +136 -0
- cg_code_graph-0.12.0/tests/test_plain_js.py +76 -0
- cg_code_graph-0.12.0/tests/test_process_ipc.py +72 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_protocols.py +8 -1
- cg_code_graph-0.12.0/tests/test_realtime.py +117 -0
- cg_code_graph-0.12.0/tests/test_realtime_native.py +90 -0
- cg_code_graph-0.12.0/tests/test_route_tables.py +186 -0
- cg_code_graph-0.12.0/tests/test_snippet.py +106 -0
- cg_code_graph-0.12.0/tests/test_vue_nav.py +122 -0
- cg_code_graph-0.12.0/tests/test_webhooks.py +134 -0
- cg_code_graph-0.12.0/tests/test_websockets.py +142 -0
- cg_code_graph-0.11.0/codegraph/plugins/nuxt/plugin.py +0 -308
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/LICENSE +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/MANIFEST.in +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/cg_code_graph.egg-info/dependency_links.txt +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/cg_code_graph.egg-info/entry_points.txt +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/cg_code_graph.egg-info/requires.txt +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/cg_code_graph.egg-info/top_level.txt +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/aitools.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/apps.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/bridges.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/concepts.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/config.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/cache.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/detect.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/extractors.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/fsutil.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/generated.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/paths.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/store.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/core/syntax_errors.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/doctor.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/link.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/lint_async.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/parity.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/parity_structure.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/payload.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plans.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/platform_scan.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/platforms.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/cfamily/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/cfamily/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/cfamily/syntax.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/bridges.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/extractor/bin/extract.dart +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/extractor/pubspec.lock +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/extractor/pubspec.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/http.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/models.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/dart/program.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/extras.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/models.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/schemas.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/django/shapes.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/express/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/flutter/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/flutter/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/kotlin/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/kotlin/reparse.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/laravel/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/laravel/broadcast.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/laravel/tests.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/laravel/values.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/native/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/native/gates.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/native/runner.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/native/scipread.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/native/ts.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/nest/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/nextjs/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/nextjs/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/nuxt/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/extractor/composer.json +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/extractor/composer.lock +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/gating.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/php/strings.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/aitools.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/external.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/fields.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/refs.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/roots.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/subproc.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/tests.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/python/values.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/pyweb/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/pyweb/plugin.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/pyweb/values.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/rust/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/rust/cargo.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/rust/syntax.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/scip/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/scip/importer.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/scip/scip.proto +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/scip/scip_pb2.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/stubs/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/stubs/plugins.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/swift/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/swift/baseurl.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/swift/exact.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/swift/indexstore.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/swift/packages.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/baseurl.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/extractor/package-lock.json +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/ts/extractor/package.json +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/plugins/tsweb/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/c_cpp.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/common.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/dart.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/django-ninja.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/djangorestframework.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/express.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/kotlin.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/laravel.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/nest.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/nextjs.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/nuxt.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/php.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/python.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/rust.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/swift.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/presets/typescript.yaml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/realtime.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/roundtrip.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/rpc.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/sockets.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/starters.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/tests_index.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/udp_apps.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/__init__.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/graph.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/server.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/app.css +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/app.js +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/index.html +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/layered.js +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/vendor/VERSIONS.txt +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/vendor/cose-base.js +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/vendor/cytoscape-fcose.js +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/vendor/cytoscape.min.js +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/static/vendor/layout-base.js +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/tools/package-lock.json +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/tools/package.json +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/viz/tools/shoot.mjs +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/codegraph/xcode.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/pyproject.toml +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/setup.cfg +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_ai_tools.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_bridges.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_bridges_pigeon_monorepo.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_cache_clean.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_cache_invalidation.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_channels_tests.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_cli_output.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_completeness.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_config_extras.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_coverage.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_coverage_ts_hint.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_dispatch_interfaces.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_enum_constants.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_gating.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_generated.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_impact_overrides.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_index_isolation.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_inherited_overrides.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin_binding.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin_exact.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin_fields.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin_mixed.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin_nav_consts.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_kotlin_props.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_laravel_determinism.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_lint_async.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_mcp.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_mcp_index.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_native_cfamily.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_native_concurrency.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_native_rust.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_nuxt_rootsrc.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_packaging.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_parity.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_parity_structure.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_php_props.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_plans.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_platform_gaps.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_platform_type_variants.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_platforms.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_platforms_apple.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_presets_config.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_process_runs.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_app_tests_module.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_collection_chains.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_compat.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_entry_refs.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_fields.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_infer_cycles.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_roots.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_subprocess_tests.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_tests.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_web_hosts.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_web_routes.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_python_web_routes_more.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_roundtrip.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_routes_search_explain.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_rpc.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_scip_health.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_sockets.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_starters_budget.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_binding.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_exact.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_facts.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_fields.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_modules.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_more.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_nav_values.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_parse_errors.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_props.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_sdk.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_testing.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_swift_values.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_tests_scope.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_ts_fields.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_ts_fields_js_vue.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_ts_file_specs.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_ts_frameworks.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_ts_nuxt.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_values.py +0 -0
- {cg_code_graph-0.11.0 → cg_code_graph-0.12.0}/tests/test_viz.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cg-code-graph
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.0
|
|
4
4
|
Summary: cg: a code graph of routes, calls, data access and platform boundaries for agents and humans (CLI + MCP server)
|
|
5
5
|
Author: cyberchronos00
|
|
6
6
|
License-Expression: MIT
|
|
@@ -207,7 +207,7 @@ The 7 plan gaps are the admin update path, `UpdateBookRequest`, `Book::$fillable
|
|
|
207
207
|
|
|
208
208
|
### 1. A CLI for impact questions
|
|
209
209
|
|
|
210
|
-
`reaches`, `impact`, `downstream`, `path`, `writers`, `siblings`, `routes`, `search`, `api-calls`, `channels`, `tests`
|
|
210
|
+
`reaches`, `impact`, `downstream`, `path`, `writers`, `siblings`, `routes`, `search`, `snippet`, `api-calls`, `channels`, `tests`
|
|
211
211
|
and `platforms` all work on one SQLite graph, and across repos once the frontend and backend are linked. Every hop shows its evidence:
|
|
212
212
|
|
|
213
213
|
```text
|
|
@@ -315,7 +315,7 @@ Full reference: [docs/cli.md](docs/cli.md) · value facts: [docs/value-facts.md]
|
|
|
315
315
|
|
|
316
316
|
### 2. An MCP server for AI agents
|
|
317
317
|
|
|
318
|
-
The same queries as MCP tools (`reaches`, `impact`, `callers`, `siblings`, `path`, `downstream`, `routes`, `search`, `api_calls`,
|
|
318
|
+
The same queries as MCP tools (`reaches`, `impact`, `callers`, `siblings`, `path`, `downstream`, `routes`, `search`, `snippet`, `api_calls`,
|
|
319
319
|
`channels`, `tests_covering`, `resolutions`, `plan_check`, `index`, `coverage`, `starters`, `platform_divergence`, …), so an agent can check the blast radius before it edits. Replies are compact,
|
|
320
320
|
use repo-relative paths, and `plan_check` starts with a summary (`details=true` for the full report). Every reply also
|
|
321
321
|
carries a machine-readable `completeness` object, so the agent knows when an answer covers the whole repository and
|
|
@@ -386,7 +386,7 @@ without configuration; `cg config show` lists what was applied ([docs/configurat
|
|
|
386
386
|
| Django REST Framework | resolved | routers, ViewSets (+ `@action`), APIView/generic views, `permission_classes`, serializer fields |
|
|
387
387
|
| FastAPI / Starlette | resolved | `FastAPI` / `APIRouter` / `Starlette` / `Router` objects, `include_router` / `mount` prefix chains across files (prefixes from constants and settings attributes such as `settings.API_V1_STR`), verb decorators, `api_route`, `add_api_route`, Starlette `routes=[Route, Mount, WebSocketRoute]`, websockets, path parameters, `Depends()` / `Security()` dependencies (parameters, `Annotated` aliases, `dependencies=`) as route access with what each checks (raised 401 / 403, security schemes, nested dependencies), `name=` for `url_path_for`; apps / routers received as parameters or fixtures or returned by factories, Starlette `Host`, `@cbv` / `InferringRouter`, classy-fastapi `Routable` |
|
|
388
388
|
| Flask | resolved | `Flask` / `Blueprint` objects, `register_blueprint` (`url_prefix` from the blueprint or the registration, nested blueprints), `@route` / verb decorators, `add_url_rule` incl. `MethodView.as_view()` (and its `methods`), endpoint-only rules, werkzeug `Rule` / `Submount`, the built-in static route, views defined in an app factory, apps received as parameters or pytest fixtures, flask-restful / flask-restx resources, `subdomain=` / `defaults=`, `<int:id>` parameters, `blueprint.endpoint` names for `url_for`, view decorators (`login_required`) as route access |
|
|
389
|
-
| Celery / Channels | resolved | tasks + `.delay`/`.apply_async` dispatches; websocket routing to consumers |
|
|
389
|
+
| Celery / RQ / Dramatiq / Channels | resolved | tasks + `.delay`/`.apply_async` dispatches; job and queue endpoints by task name across repos (`send_task`, RQ import paths, Dramatiq actors) with worker processes from Procfile / compose; websocket routing to consumers |
|
|
390
390
|
| Dart | resolved (package:analyzer parse, declared types) + heuristic fallback | libraries/parts, classes, methods, functions, calls with import resolution |
|
|
391
391
|
| Flutter | resolved + heuristic fallback | widgets/State, bloc/cubit events → handlers → states → UI, Navigator/go_router/auto_route pages, HTTP calls (package:http, Dio, dart:io, Retrofit/Chopper), WebSockets, json_serializable/freezed and hand-written JSON keys |
|
|
392
392
|
| Rust | **exact** with rust-analyzer (SCIP); **heuristic** without | crates, modules, `pub` API, traits → impls (dyn/generic dispatch), bins, tests, benches, examples, `build.rs`, FFI, `unsafe`, `#[cfg(feature)]` gates, env keys, `#[tokio::main]`, axum/actix routes ([docs/native.md](docs/native.md)) |
|
|
@@ -401,7 +401,7 @@ without configuration; `cg config show` lists what was applied ([docs/configurat
|
|
|
401
401
|
| Desktop processes | Electron `ipcMain` / `ipcRenderer` / `webContents.send` and `contextBridge.exposeInMainWorld`; Tauri `invoke` → `#[tauri::command]` | `endpoint:electron-ipc:<channel>`, `endpoint:electron-preload:<key>#<member>`, `endpoint:tauri:<command>` with SENDS_TO / RECEIVED_BY across the processes, process roles (main / preload / renderer, webview / core) on module nodes; checks for channels nobody receives and unregistered commands ([docs/bridges.md](docs/bridges.md#desktop-process-boundaries-electron-and-tauri)) |
|
|
402
402
|
| AI harnesses | MCP servers (FastMCP / MCPServer / low-level) and clients, OpenAI / Anthropic tool schemas, Agents SDK, LangChain, LlamaIndex tools, hand-written agent loops (Python) | `endpoint:llm_tool:<name>` / `endpoint:mcp_tool:<server>/<name>` (resources, prompts) with the handler as an `llm_tool` entry, `agent:<name>` with OFFERS_TOOL / HANDS_OFF_TO; `cg tools` lists handlers, tables reached, agents, no_receiver / no_sender, dynamic dispatch and model calls ([docs/ai-tools.md](docs/ai-tools.md)) |
|
|
403
403
|
| External systems | Laravel database connections, env keys read by code (`DB_*`, `DATABASE_URL`, `REDIS_*`, `SMTP_*`, `MONGO*`, `AMQP_*`, `LDAP_*`, `SFTP_*`, `S3_*` ...), Python settings (`DATABASES`, `CACHES`, `CELERY_BROKER_URL` ...), `.env.example` values, docker-compose services, DSNs | `external:<protocol>:<host:port>` (or `env:<KEY>`) with CONNECTS_TO from code and connections, CONFIGURED_BY, CREDENTIAL_FROM (location only, never the value), TLS; one node per system across linked repos; `cg external` ([docs/external.md](docs/external.md)) |
|
|
404
|
-
| Protocol links | HTTP calls / routes, Pusher channels, NestJS messages, Bull / Laravel / Celery jobs, application events, bridges and IPC in one view; python-socketio / Flask-SocketIO events | `endpoint:<protocol>:<name>` with SENDS_TO / RECEIVED_BY and MATCHES_ENDPOINT (path, MQTT, NATS, AMQP
|
|
404
|
+
| Protocol links | HTTP calls / routes, Pusher channels, NestJS messages, Bull / Laravel / Celery jobs, Celery / RQ / Dramatiq / Bull / Laravel / Symfony Messenger job and queue endpoints, application events, Kafka / RabbitMQ / Redis pub/sub and streams / MQTT / NATS producers and consumers, bridges and IPC in one view; python-socketio / Flask-SocketIO events | `endpoint:<protocol>:<name>` with SENDS_TO / RECEIVED_BY and MATCHES_ENDPOINT (path, MQTT, NATS, AMQP, glob and template matchers in a registry plugins extend); `cg protocols` lists senders, receivers, guards and the checks no_receiver, no_sender, ambiguous, schema_mismatch, unguarded, no_consumer; `.cg.yaml` `protocols.external` for known outside parties ([docs/protocols.md](docs/protocols.md)) |
|
|
405
405
|
| Generated and copied files | detected (`.gitattributes`, generator banners, framework build paths, generator file names, Capacitor / Cordova copy targets, `.openapi-generator/FILES`) | kept out of the graph and listed by `cg coverage` by reason; copies map back to their source; `--include-generated` indexes them labelled `attrs.generated` ([docs/generated.md](docs/generated.md)) |
|
|
406
406
|
|
|
407
407
|
## Prerequisites per language
|
|
@@ -565,7 +565,8 @@ The scope as of v0.3, so you know how far each answer reaches. The full list is
|
|
|
565
565
|
(`getattr`, DI containers, Riverpod/Provider lookups without a type) fall back to `heuristic` or stay unresolved.
|
|
566
566
|
Python dispatch tables, plugin lists, callbacks and registering decorators are followed as function references
|
|
567
567
|
([docs/python.md](docs/python.md#entry-points-and-function-references)).
|
|
568
|
-
GraphQL
|
|
568
|
+
GraphQL root fields (graphene / strawberry / ariadne) are protocol endpoints ([docs/protocols.md](docs/protocols.md#graphql-root-fields));
|
|
569
|
+
object-type fields and Django template rendering are not modelled.
|
|
569
570
|
- **Next to index:** seeders, `Artisan::command` closures, observers fired by model writes, Nuxt server routes, and
|
|
570
571
|
navigation edges (`NuxtLink`, `navigateTo`).
|
|
571
572
|
- **Broadcast channels** are read from `Broadcast::channel` and `broadcastOn()`; names cg cannot evaluate keep a
|
|
@@ -625,14 +626,14 @@ Ideas we are exploring after v0.3. Feedback on priorities is welcome.
|
|
|
625
626
|
- Swift: `URLComponents` and helper-built URLs, `Info.plist` / `.xcconfig` base URLs, OS-version conditions, App Intents /
|
|
626
627
|
widget entries, value navigation through variables ([docs/swift.md](docs/swift.md#not-covered-yet)).
|
|
627
628
|
- Protocol links: extraction for MQTT, NATS, AMQP, Kafka and Redis pub/sub (matchers registered), Socket.IO outside
|
|
628
|
-
Python, raw WebSocket / SSE message names,
|
|
629
|
+
Python, raw WebSocket / SSE message names, GraphQL object-type fields, webhooks (epic #29; [docs/protocols.md](docs/protocols.md#not-covered-yet)).
|
|
629
630
|
- AI harnesses: TypeScript MCP servers / clients and the Vercel AI SDK, LangGraph graphs, agent runners, tools declared
|
|
630
631
|
inside functions ([docs/ai-tools.md](docs/ai-tools.md#not-covered-yet)).
|
|
631
632
|
- External systems: client constructors with literal arguments (`psycopg.connect(host=)`, `new Redis()`, ...),
|
|
632
633
|
Spring / Rails / Kubernetes configuration, env reads through config schemas ([docs/external.md](docs/external.md#not-covered-yet)).
|
|
633
634
|
- Web / native bridges beyond Capacitor, React Native, Flutter channels and Pigeon: React Native events, Capacitor
|
|
634
635
|
`notifyListeners`, Cordova plugins and native UI components ([docs/bridges.md](docs/bridges.md#not-covered-yet)).
|
|
635
|
-
- More HTTP clients beyond fetch, axios, ofetch and ky, and response-field modelling for the TypeScript client (setting → API response → client state)
|
|
636
|
+
- More HTTP clients beyond fetch, axios, ofetch and ky, and response-field modelling for the TypeScript client (setting → API response → client state).
|
|
636
637
|
|
|
637
638
|
## Documentation
|
|
638
639
|
|
|
@@ -183,7 +183,7 @@ The 7 plan gaps are the admin update path, `UpdateBookRequest`, `Book::$fillable
|
|
|
183
183
|
|
|
184
184
|
### 1. A CLI for impact questions
|
|
185
185
|
|
|
186
|
-
`reaches`, `impact`, `downstream`, `path`, `writers`, `siblings`, `routes`, `search`, `api-calls`, `channels`, `tests`
|
|
186
|
+
`reaches`, `impact`, `downstream`, `path`, `writers`, `siblings`, `routes`, `search`, `snippet`, `api-calls`, `channels`, `tests`
|
|
187
187
|
and `platforms` all work on one SQLite graph, and across repos once the frontend and backend are linked. Every hop shows its evidence:
|
|
188
188
|
|
|
189
189
|
```text
|
|
@@ -291,7 +291,7 @@ Full reference: [docs/cli.md](docs/cli.md) · value facts: [docs/value-facts.md]
|
|
|
291
291
|
|
|
292
292
|
### 2. An MCP server for AI agents
|
|
293
293
|
|
|
294
|
-
The same queries as MCP tools (`reaches`, `impact`, `callers`, `siblings`, `path`, `downstream`, `routes`, `search`, `api_calls`,
|
|
294
|
+
The same queries as MCP tools (`reaches`, `impact`, `callers`, `siblings`, `path`, `downstream`, `routes`, `search`, `snippet`, `api_calls`,
|
|
295
295
|
`channels`, `tests_covering`, `resolutions`, `plan_check`, `index`, `coverage`, `starters`, `platform_divergence`, …), so an agent can check the blast radius before it edits. Replies are compact,
|
|
296
296
|
use repo-relative paths, and `plan_check` starts with a summary (`details=true` for the full report). Every reply also
|
|
297
297
|
carries a machine-readable `completeness` object, so the agent knows when an answer covers the whole repository and
|
|
@@ -362,7 +362,7 @@ without configuration; `cg config show` lists what was applied ([docs/configurat
|
|
|
362
362
|
| Django REST Framework | resolved | routers, ViewSets (+ `@action`), APIView/generic views, `permission_classes`, serializer fields |
|
|
363
363
|
| FastAPI / Starlette | resolved | `FastAPI` / `APIRouter` / `Starlette` / `Router` objects, `include_router` / `mount` prefix chains across files (prefixes from constants and settings attributes such as `settings.API_V1_STR`), verb decorators, `api_route`, `add_api_route`, Starlette `routes=[Route, Mount, WebSocketRoute]`, websockets, path parameters, `Depends()` / `Security()` dependencies (parameters, `Annotated` aliases, `dependencies=`) as route access with what each checks (raised 401 / 403, security schemes, nested dependencies), `name=` for `url_path_for`; apps / routers received as parameters or fixtures or returned by factories, Starlette `Host`, `@cbv` / `InferringRouter`, classy-fastapi `Routable` |
|
|
364
364
|
| Flask | resolved | `Flask` / `Blueprint` objects, `register_blueprint` (`url_prefix` from the blueprint or the registration, nested blueprints), `@route` / verb decorators, `add_url_rule` incl. `MethodView.as_view()` (and its `methods`), endpoint-only rules, werkzeug `Rule` / `Submount`, the built-in static route, views defined in an app factory, apps received as parameters or pytest fixtures, flask-restful / flask-restx resources, `subdomain=` / `defaults=`, `<int:id>` parameters, `blueprint.endpoint` names for `url_for`, view decorators (`login_required`) as route access |
|
|
365
|
-
| Celery / Channels | resolved | tasks + `.delay`/`.apply_async` dispatches; websocket routing to consumers |
|
|
365
|
+
| Celery / RQ / Dramatiq / Channels | resolved | tasks + `.delay`/`.apply_async` dispatches; job and queue endpoints by task name across repos (`send_task`, RQ import paths, Dramatiq actors) with worker processes from Procfile / compose; websocket routing to consumers |
|
|
366
366
|
| Dart | resolved (package:analyzer parse, declared types) + heuristic fallback | libraries/parts, classes, methods, functions, calls with import resolution |
|
|
367
367
|
| Flutter | resolved + heuristic fallback | widgets/State, bloc/cubit events → handlers → states → UI, Navigator/go_router/auto_route pages, HTTP calls (package:http, Dio, dart:io, Retrofit/Chopper), WebSockets, json_serializable/freezed and hand-written JSON keys |
|
|
368
368
|
| Rust | **exact** with rust-analyzer (SCIP); **heuristic** without | crates, modules, `pub` API, traits → impls (dyn/generic dispatch), bins, tests, benches, examples, `build.rs`, FFI, `unsafe`, `#[cfg(feature)]` gates, env keys, `#[tokio::main]`, axum/actix routes ([docs/native.md](docs/native.md)) |
|
|
@@ -377,7 +377,7 @@ without configuration; `cg config show` lists what was applied ([docs/configurat
|
|
|
377
377
|
| Desktop processes | Electron `ipcMain` / `ipcRenderer` / `webContents.send` and `contextBridge.exposeInMainWorld`; Tauri `invoke` → `#[tauri::command]` | `endpoint:electron-ipc:<channel>`, `endpoint:electron-preload:<key>#<member>`, `endpoint:tauri:<command>` with SENDS_TO / RECEIVED_BY across the processes, process roles (main / preload / renderer, webview / core) on module nodes; checks for channels nobody receives and unregistered commands ([docs/bridges.md](docs/bridges.md#desktop-process-boundaries-electron-and-tauri)) |
|
|
378
378
|
| AI harnesses | MCP servers (FastMCP / MCPServer / low-level) and clients, OpenAI / Anthropic tool schemas, Agents SDK, LangChain, LlamaIndex tools, hand-written agent loops (Python) | `endpoint:llm_tool:<name>` / `endpoint:mcp_tool:<server>/<name>` (resources, prompts) with the handler as an `llm_tool` entry, `agent:<name>` with OFFERS_TOOL / HANDS_OFF_TO; `cg tools` lists handlers, tables reached, agents, no_receiver / no_sender, dynamic dispatch and model calls ([docs/ai-tools.md](docs/ai-tools.md)) |
|
|
379
379
|
| External systems | Laravel database connections, env keys read by code (`DB_*`, `DATABASE_URL`, `REDIS_*`, `SMTP_*`, `MONGO*`, `AMQP_*`, `LDAP_*`, `SFTP_*`, `S3_*` ...), Python settings (`DATABASES`, `CACHES`, `CELERY_BROKER_URL` ...), `.env.example` values, docker-compose services, DSNs | `external:<protocol>:<host:port>` (or `env:<KEY>`) with CONNECTS_TO from code and connections, CONFIGURED_BY, CREDENTIAL_FROM (location only, never the value), TLS; one node per system across linked repos; `cg external` ([docs/external.md](docs/external.md)) |
|
|
380
|
-
| Protocol links | HTTP calls / routes, Pusher channels, NestJS messages, Bull / Laravel / Celery jobs, application events, bridges and IPC in one view; python-socketio / Flask-SocketIO events | `endpoint:<protocol>:<name>` with SENDS_TO / RECEIVED_BY and MATCHES_ENDPOINT (path, MQTT, NATS, AMQP
|
|
380
|
+
| Protocol links | HTTP calls / routes, Pusher channels, NestJS messages, Bull / Laravel / Celery jobs, Celery / RQ / Dramatiq / Bull / Laravel / Symfony Messenger job and queue endpoints, application events, Kafka / RabbitMQ / Redis pub/sub and streams / MQTT / NATS producers and consumers, bridges and IPC in one view; python-socketio / Flask-SocketIO events | `endpoint:<protocol>:<name>` with SENDS_TO / RECEIVED_BY and MATCHES_ENDPOINT (path, MQTT, NATS, AMQP, glob and template matchers in a registry plugins extend); `cg protocols` lists senders, receivers, guards and the checks no_receiver, no_sender, ambiguous, schema_mismatch, unguarded, no_consumer; `.cg.yaml` `protocols.external` for known outside parties ([docs/protocols.md](docs/protocols.md)) |
|
|
381
381
|
| Generated and copied files | detected (`.gitattributes`, generator banners, framework build paths, generator file names, Capacitor / Cordova copy targets, `.openapi-generator/FILES`) | kept out of the graph and listed by `cg coverage` by reason; copies map back to their source; `--include-generated` indexes them labelled `attrs.generated` ([docs/generated.md](docs/generated.md)) |
|
|
382
382
|
|
|
383
383
|
## Prerequisites per language
|
|
@@ -541,7 +541,8 @@ The scope as of v0.3, so you know how far each answer reaches. The full list is
|
|
|
541
541
|
(`getattr`, DI containers, Riverpod/Provider lookups without a type) fall back to `heuristic` or stay unresolved.
|
|
542
542
|
Python dispatch tables, plugin lists, callbacks and registering decorators are followed as function references
|
|
543
543
|
([docs/python.md](docs/python.md#entry-points-and-function-references)).
|
|
544
|
-
GraphQL
|
|
544
|
+
GraphQL root fields (graphene / strawberry / ariadne) are protocol endpoints ([docs/protocols.md](docs/protocols.md#graphql-root-fields));
|
|
545
|
+
object-type fields and Django template rendering are not modelled.
|
|
545
546
|
- **Next to index:** seeders, `Artisan::command` closures, observers fired by model writes, Nuxt server routes, and
|
|
546
547
|
navigation edges (`NuxtLink`, `navigateTo`).
|
|
547
548
|
- **Broadcast channels** are read from `Broadcast::channel` and `broadcastOn()`; names cg cannot evaluate keep a
|
|
@@ -601,14 +602,14 @@ Ideas we are exploring after v0.3. Feedback on priorities is welcome.
|
|
|
601
602
|
- Swift: `URLComponents` and helper-built URLs, `Info.plist` / `.xcconfig` base URLs, OS-version conditions, App Intents /
|
|
602
603
|
widget entries, value navigation through variables ([docs/swift.md](docs/swift.md#not-covered-yet)).
|
|
603
604
|
- Protocol links: extraction for MQTT, NATS, AMQP, Kafka and Redis pub/sub (matchers registered), Socket.IO outside
|
|
604
|
-
Python, raw WebSocket / SSE message names,
|
|
605
|
+
Python, raw WebSocket / SSE message names, GraphQL object-type fields, webhooks (epic #29; [docs/protocols.md](docs/protocols.md#not-covered-yet)).
|
|
605
606
|
- AI harnesses: TypeScript MCP servers / clients and the Vercel AI SDK, LangGraph graphs, agent runners, tools declared
|
|
606
607
|
inside functions ([docs/ai-tools.md](docs/ai-tools.md#not-covered-yet)).
|
|
607
608
|
- External systems: client constructors with literal arguments (`psycopg.connect(host=)`, `new Redis()`, ...),
|
|
608
609
|
Spring / Rails / Kubernetes configuration, env reads through config schemas ([docs/external.md](docs/external.md#not-covered-yet)).
|
|
609
610
|
- Web / native bridges beyond Capacitor, React Native, Flutter channels and Pigeon: React Native events, Capacitor
|
|
610
611
|
`notifyListeners`, Cordova plugins and native UI components ([docs/bridges.md](docs/bridges.md#not-covered-yet)).
|
|
611
|
-
- More HTTP clients beyond fetch, axios, ofetch and ky, and response-field modelling for the TypeScript client (setting → API response → client state)
|
|
612
|
+
- More HTTP clients beyond fetch, axios, ofetch and ky, and response-field modelling for the TypeScript client (setting → API response → client state).
|
|
612
613
|
|
|
613
614
|
## Documentation
|
|
614
615
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cg-code-graph
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.0
|
|
4
4
|
Summary: cg: a code graph of routes, calls, data access and platform boundaries for agents and humans (CLI + MCP server)
|
|
5
5
|
Author: cyberchronos00
|
|
6
6
|
License-Expression: MIT
|
|
@@ -207,7 +207,7 @@ The 7 plan gaps are the admin update path, `UpdateBookRequest`, `Book::$fillable
|
|
|
207
207
|
|
|
208
208
|
### 1. A CLI for impact questions
|
|
209
209
|
|
|
210
|
-
`reaches`, `impact`, `downstream`, `path`, `writers`, `siblings`, `routes`, `search`, `api-calls`, `channels`, `tests`
|
|
210
|
+
`reaches`, `impact`, `downstream`, `path`, `writers`, `siblings`, `routes`, `search`, `snippet`, `api-calls`, `channels`, `tests`
|
|
211
211
|
and `platforms` all work on one SQLite graph, and across repos once the frontend and backend are linked. Every hop shows its evidence:
|
|
212
212
|
|
|
213
213
|
```text
|
|
@@ -315,7 +315,7 @@ Full reference: [docs/cli.md](docs/cli.md) · value facts: [docs/value-facts.md]
|
|
|
315
315
|
|
|
316
316
|
### 2. An MCP server for AI agents
|
|
317
317
|
|
|
318
|
-
The same queries as MCP tools (`reaches`, `impact`, `callers`, `siblings`, `path`, `downstream`, `routes`, `search`, `api_calls`,
|
|
318
|
+
The same queries as MCP tools (`reaches`, `impact`, `callers`, `siblings`, `path`, `downstream`, `routes`, `search`, `snippet`, `api_calls`,
|
|
319
319
|
`channels`, `tests_covering`, `resolutions`, `plan_check`, `index`, `coverage`, `starters`, `platform_divergence`, …), so an agent can check the blast radius before it edits. Replies are compact,
|
|
320
320
|
use repo-relative paths, and `plan_check` starts with a summary (`details=true` for the full report). Every reply also
|
|
321
321
|
carries a machine-readable `completeness` object, so the agent knows when an answer covers the whole repository and
|
|
@@ -386,7 +386,7 @@ without configuration; `cg config show` lists what was applied ([docs/configurat
|
|
|
386
386
|
| Django REST Framework | resolved | routers, ViewSets (+ `@action`), APIView/generic views, `permission_classes`, serializer fields |
|
|
387
387
|
| FastAPI / Starlette | resolved | `FastAPI` / `APIRouter` / `Starlette` / `Router` objects, `include_router` / `mount` prefix chains across files (prefixes from constants and settings attributes such as `settings.API_V1_STR`), verb decorators, `api_route`, `add_api_route`, Starlette `routes=[Route, Mount, WebSocketRoute]`, websockets, path parameters, `Depends()` / `Security()` dependencies (parameters, `Annotated` aliases, `dependencies=`) as route access with what each checks (raised 401 / 403, security schemes, nested dependencies), `name=` for `url_path_for`; apps / routers received as parameters or fixtures or returned by factories, Starlette `Host`, `@cbv` / `InferringRouter`, classy-fastapi `Routable` |
|
|
388
388
|
| Flask | resolved | `Flask` / `Blueprint` objects, `register_blueprint` (`url_prefix` from the blueprint or the registration, nested blueprints), `@route` / verb decorators, `add_url_rule` incl. `MethodView.as_view()` (and its `methods`), endpoint-only rules, werkzeug `Rule` / `Submount`, the built-in static route, views defined in an app factory, apps received as parameters or pytest fixtures, flask-restful / flask-restx resources, `subdomain=` / `defaults=`, `<int:id>` parameters, `blueprint.endpoint` names for `url_for`, view decorators (`login_required`) as route access |
|
|
389
|
-
| Celery / Channels | resolved | tasks + `.delay`/`.apply_async` dispatches; websocket routing to consumers |
|
|
389
|
+
| Celery / RQ / Dramatiq / Channels | resolved | tasks + `.delay`/`.apply_async` dispatches; job and queue endpoints by task name across repos (`send_task`, RQ import paths, Dramatiq actors) with worker processes from Procfile / compose; websocket routing to consumers |
|
|
390
390
|
| Dart | resolved (package:analyzer parse, declared types) + heuristic fallback | libraries/parts, classes, methods, functions, calls with import resolution |
|
|
391
391
|
| Flutter | resolved + heuristic fallback | widgets/State, bloc/cubit events → handlers → states → UI, Navigator/go_router/auto_route pages, HTTP calls (package:http, Dio, dart:io, Retrofit/Chopper), WebSockets, json_serializable/freezed and hand-written JSON keys |
|
|
392
392
|
| Rust | **exact** with rust-analyzer (SCIP); **heuristic** without | crates, modules, `pub` API, traits → impls (dyn/generic dispatch), bins, tests, benches, examples, `build.rs`, FFI, `unsafe`, `#[cfg(feature)]` gates, env keys, `#[tokio::main]`, axum/actix routes ([docs/native.md](docs/native.md)) |
|
|
@@ -401,7 +401,7 @@ without configuration; `cg config show` lists what was applied ([docs/configurat
|
|
|
401
401
|
| Desktop processes | Electron `ipcMain` / `ipcRenderer` / `webContents.send` and `contextBridge.exposeInMainWorld`; Tauri `invoke` → `#[tauri::command]` | `endpoint:electron-ipc:<channel>`, `endpoint:electron-preload:<key>#<member>`, `endpoint:tauri:<command>` with SENDS_TO / RECEIVED_BY across the processes, process roles (main / preload / renderer, webview / core) on module nodes; checks for channels nobody receives and unregistered commands ([docs/bridges.md](docs/bridges.md#desktop-process-boundaries-electron-and-tauri)) |
|
|
402
402
|
| AI harnesses | MCP servers (FastMCP / MCPServer / low-level) and clients, OpenAI / Anthropic tool schemas, Agents SDK, LangChain, LlamaIndex tools, hand-written agent loops (Python) | `endpoint:llm_tool:<name>` / `endpoint:mcp_tool:<server>/<name>` (resources, prompts) with the handler as an `llm_tool` entry, `agent:<name>` with OFFERS_TOOL / HANDS_OFF_TO; `cg tools` lists handlers, tables reached, agents, no_receiver / no_sender, dynamic dispatch and model calls ([docs/ai-tools.md](docs/ai-tools.md)) |
|
|
403
403
|
| External systems | Laravel database connections, env keys read by code (`DB_*`, `DATABASE_URL`, `REDIS_*`, `SMTP_*`, `MONGO*`, `AMQP_*`, `LDAP_*`, `SFTP_*`, `S3_*` ...), Python settings (`DATABASES`, `CACHES`, `CELERY_BROKER_URL` ...), `.env.example` values, docker-compose services, DSNs | `external:<protocol>:<host:port>` (or `env:<KEY>`) with CONNECTS_TO from code and connections, CONFIGURED_BY, CREDENTIAL_FROM (location only, never the value), TLS; one node per system across linked repos; `cg external` ([docs/external.md](docs/external.md)) |
|
|
404
|
-
| Protocol links | HTTP calls / routes, Pusher channels, NestJS messages, Bull / Laravel / Celery jobs, application events, bridges and IPC in one view; python-socketio / Flask-SocketIO events | `endpoint:<protocol>:<name>` with SENDS_TO / RECEIVED_BY and MATCHES_ENDPOINT (path, MQTT, NATS, AMQP
|
|
404
|
+
| Protocol links | HTTP calls / routes, Pusher channels, NestJS messages, Bull / Laravel / Celery jobs, Celery / RQ / Dramatiq / Bull / Laravel / Symfony Messenger job and queue endpoints, application events, Kafka / RabbitMQ / Redis pub/sub and streams / MQTT / NATS producers and consumers, bridges and IPC in one view; python-socketio / Flask-SocketIO events | `endpoint:<protocol>:<name>` with SENDS_TO / RECEIVED_BY and MATCHES_ENDPOINT (path, MQTT, NATS, AMQP, glob and template matchers in a registry plugins extend); `cg protocols` lists senders, receivers, guards and the checks no_receiver, no_sender, ambiguous, schema_mismatch, unguarded, no_consumer; `.cg.yaml` `protocols.external` for known outside parties ([docs/protocols.md](docs/protocols.md)) |
|
|
405
405
|
| Generated and copied files | detected (`.gitattributes`, generator banners, framework build paths, generator file names, Capacitor / Cordova copy targets, `.openapi-generator/FILES`) | kept out of the graph and listed by `cg coverage` by reason; copies map back to their source; `--include-generated` indexes them labelled `attrs.generated` ([docs/generated.md](docs/generated.md)) |
|
|
406
406
|
|
|
407
407
|
## Prerequisites per language
|
|
@@ -565,7 +565,8 @@ The scope as of v0.3, so you know how far each answer reaches. The full list is
|
|
|
565
565
|
(`getattr`, DI containers, Riverpod/Provider lookups without a type) fall back to `heuristic` or stay unresolved.
|
|
566
566
|
Python dispatch tables, plugin lists, callbacks and registering decorators are followed as function references
|
|
567
567
|
([docs/python.md](docs/python.md#entry-points-and-function-references)).
|
|
568
|
-
GraphQL
|
|
568
|
+
GraphQL root fields (graphene / strawberry / ariadne) are protocol endpoints ([docs/protocols.md](docs/protocols.md#graphql-root-fields));
|
|
569
|
+
object-type fields and Django template rendering are not modelled.
|
|
569
570
|
- **Next to index:** seeders, `Artisan::command` closures, observers fired by model writes, Nuxt server routes, and
|
|
570
571
|
navigation edges (`NuxtLink`, `navigateTo`).
|
|
571
572
|
- **Broadcast channels** are read from `Broadcast::channel` and `broadcastOn()`; names cg cannot evaluate keep a
|
|
@@ -625,14 +626,14 @@ Ideas we are exploring after v0.3. Feedback on priorities is welcome.
|
|
|
625
626
|
- Swift: `URLComponents` and helper-built URLs, `Info.plist` / `.xcconfig` base URLs, OS-version conditions, App Intents /
|
|
626
627
|
widget entries, value navigation through variables ([docs/swift.md](docs/swift.md#not-covered-yet)).
|
|
627
628
|
- Protocol links: extraction for MQTT, NATS, AMQP, Kafka and Redis pub/sub (matchers registered), Socket.IO outside
|
|
628
|
-
Python, raw WebSocket / SSE message names,
|
|
629
|
+
Python, raw WebSocket / SSE message names, GraphQL object-type fields, webhooks (epic #29; [docs/protocols.md](docs/protocols.md#not-covered-yet)).
|
|
629
630
|
- AI harnesses: TypeScript MCP servers / clients and the Vercel AI SDK, LangGraph graphs, agent runners, tools declared
|
|
630
631
|
inside functions ([docs/ai-tools.md](docs/ai-tools.md#not-covered-yet)).
|
|
631
632
|
- External systems: client constructors with literal arguments (`psycopg.connect(host=)`, `new Redis()`, ...),
|
|
632
633
|
Spring / Rails / Kubernetes configuration, env reads through config schemas ([docs/external.md](docs/external.md#not-covered-yet)).
|
|
633
634
|
- Web / native bridges beyond Capacitor, React Native, Flutter channels and Pigeon: React Native events, Capacitor
|
|
634
635
|
`notifyListeners`, Cordova plugins and native UI components ([docs/bridges.md](docs/bridges.md#not-covered-yet)).
|
|
635
|
-
- More HTTP clients beyond fetch, axios, ofetch and ky, and response-field modelling for the TypeScript client (setting → API response → client state)
|
|
636
|
+
- More HTTP clients beyond fetch, axios, ofetch and ky, and response-field modelling for the TypeScript client (setting → API response → client state).
|
|
636
637
|
|
|
637
638
|
## Documentation
|
|
638
639
|
|
|
@@ -9,19 +9,29 @@ cg_code_graph.egg-info/entry_points.txt
|
|
|
9
9
|
cg_code_graph.egg-info/requires.txt
|
|
10
10
|
cg_code_graph.egg-info/top_level.txt
|
|
11
11
|
codegraph/__init__.py
|
|
12
|
+
codegraph/agent_rules.py
|
|
13
|
+
codegraph/agents.py
|
|
12
14
|
codegraph/aitools.py
|
|
15
|
+
codegraph/android_ipc.py
|
|
16
|
+
codegraph/apple_ipc.py
|
|
13
17
|
codegraph/apps.py
|
|
14
18
|
codegraph/blindspots.py
|
|
15
19
|
codegraph/bridges.py
|
|
20
|
+
codegraph/brokers.py
|
|
16
21
|
codegraph/cli.py
|
|
17
22
|
codegraph/concepts.py
|
|
18
23
|
codegraph/config.py
|
|
19
24
|
codegraph/coverage.py
|
|
25
|
+
codegraph/dart_isolates.py
|
|
20
26
|
codegraph/doctor.py
|
|
21
27
|
codegraph/external.py
|
|
28
|
+
codegraph/graphql.py
|
|
22
29
|
codegraph/indexer.py
|
|
30
|
+
codegraph/jobs.py
|
|
23
31
|
codegraph/link.py
|
|
24
32
|
codegraph/lint_async.py
|
|
33
|
+
codegraph/local_ipc.py
|
|
34
|
+
codegraph/local_sockets.py
|
|
25
35
|
codegraph/mcp_server.py
|
|
26
36
|
codegraph/parity.py
|
|
27
37
|
codegraph/parity_structure.py
|
|
@@ -32,6 +42,9 @@ codegraph/platforms.py
|
|
|
32
42
|
codegraph/process_runs.py
|
|
33
43
|
codegraph/query.py
|
|
34
44
|
codegraph/realtime.py
|
|
45
|
+
codegraph/realtime_events.py
|
|
46
|
+
codegraph/realtime_native.py
|
|
47
|
+
codegraph/realtime_ws.py
|
|
35
48
|
codegraph/roundtrip.py
|
|
36
49
|
codegraph/routes.py
|
|
37
50
|
codegraph/rpc.py
|
|
@@ -39,6 +52,7 @@ codegraph/sockets.py
|
|
|
39
52
|
codegraph/starters.py
|
|
40
53
|
codegraph/tests_index.py
|
|
41
54
|
codegraph/udp_apps.py
|
|
55
|
+
codegraph/webhooks.py
|
|
42
56
|
codegraph/xcode.py
|
|
43
57
|
codegraph/core/__init__.py
|
|
44
58
|
codegraph/core/cache.py
|
|
@@ -96,6 +110,7 @@ codegraph/plugins/nextjs/plugin.py
|
|
|
96
110
|
codegraph/plugins/nuxt/__init__.py
|
|
97
111
|
codegraph/plugins/nuxt/plugin.py
|
|
98
112
|
codegraph/plugins/php/__init__.py
|
|
113
|
+
codegraph/plugins/php/external.py
|
|
99
114
|
codegraph/plugins/php/gating.py
|
|
100
115
|
codegraph/plugins/php/plugin.py
|
|
101
116
|
codegraph/plugins/php/strings.py
|
|
@@ -134,6 +149,7 @@ codegraph/plugins/swift/packages.py
|
|
|
134
149
|
codegraph/plugins/swift/plugin.py
|
|
135
150
|
codegraph/plugins/ts/__init__.py
|
|
136
151
|
codegraph/plugins/ts/baseurl.py
|
|
152
|
+
codegraph/plugins/ts/nav.py
|
|
137
153
|
codegraph/plugins/ts/plugin.py
|
|
138
154
|
codegraph/plugins/ts/extractor/extract.mjs
|
|
139
155
|
codegraph/plugins/ts/extractor/fw.mjs
|
|
@@ -179,9 +195,14 @@ codegraph/viz/static/vendor/layout-base.js
|
|
|
179
195
|
codegraph/viz/tools/package-lock.json
|
|
180
196
|
codegraph/viz/tools/package.json
|
|
181
197
|
codegraph/viz/tools/shoot.mjs
|
|
198
|
+
tests/test_agents_install.py
|
|
199
|
+
tests/test_agents_md.py
|
|
182
200
|
tests/test_ai_tools.py
|
|
201
|
+
tests/test_android_ipc.py
|
|
202
|
+
tests/test_apple_ipc.py
|
|
183
203
|
tests/test_bridges.py
|
|
184
204
|
tests/test_bridges_pigeon_monorepo.py
|
|
205
|
+
tests/test_brokers.py
|
|
185
206
|
tests/test_cache_clean.py
|
|
186
207
|
tests/test_cache_invalidation.py
|
|
187
208
|
tests/test_channels_tests.py
|
|
@@ -190,15 +211,19 @@ tests/test_completeness.py
|
|
|
190
211
|
tests/test_config_extras.py
|
|
191
212
|
tests/test_coverage.py
|
|
192
213
|
tests/test_coverage_ts_hint.py
|
|
214
|
+
tests/test_dart_isolates.py
|
|
193
215
|
tests/test_dispatch_interfaces.py
|
|
194
216
|
tests/test_django_flutter.py
|
|
195
217
|
tests/test_enum_constants.py
|
|
196
218
|
tests/test_external.py
|
|
197
219
|
tests/test_gating.py
|
|
198
220
|
tests/test_generated.py
|
|
221
|
+
tests/test_graphql.py
|
|
199
222
|
tests/test_impact_overrides.py
|
|
200
223
|
tests/test_index_isolation.py
|
|
201
224
|
tests/test_inherited_overrides.py
|
|
225
|
+
tests/test_jobs.py
|
|
226
|
+
tests/test_js_refs.py
|
|
202
227
|
tests/test_kotlin.py
|
|
203
228
|
tests/test_kotlin_binding.py
|
|
204
229
|
tests/test_kotlin_exact.py
|
|
@@ -207,23 +232,29 @@ tests/test_kotlin_mixed.py
|
|
|
207
232
|
tests/test_kotlin_nav_consts.py
|
|
208
233
|
tests/test_kotlin_props.py
|
|
209
234
|
tests/test_laravel_determinism.py
|
|
235
|
+
tests/test_laravel_resources.py
|
|
210
236
|
tests/test_lint_async.py
|
|
237
|
+
tests/test_local_ipc.py
|
|
238
|
+
tests/test_local_sockets.py
|
|
211
239
|
tests/test_mcp.py
|
|
212
240
|
tests/test_mcp_index.py
|
|
213
241
|
tests/test_native_cfamily.py
|
|
214
242
|
tests/test_native_concurrency.py
|
|
215
243
|
tests/test_native_rust.py
|
|
244
|
+
tests/test_nuxt_import_dirs.py
|
|
216
245
|
tests/test_nuxt_rootsrc.py
|
|
217
246
|
tests/test_packaging.py
|
|
218
247
|
tests/test_parity.py
|
|
219
248
|
tests/test_parity_structure.py
|
|
220
249
|
tests/test_php_props.py
|
|
250
|
+
tests/test_plain_js.py
|
|
221
251
|
tests/test_plans.py
|
|
222
252
|
tests/test_platform_gaps.py
|
|
223
253
|
tests/test_platform_type_variants.py
|
|
224
254
|
tests/test_platforms.py
|
|
225
255
|
tests/test_platforms_apple.py
|
|
226
256
|
tests/test_presets_config.py
|
|
257
|
+
tests/test_process_ipc.py
|
|
227
258
|
tests/test_process_runs.py
|
|
228
259
|
tests/test_protocols.py
|
|
229
260
|
tests/test_python_app_tests_module.py
|
|
@@ -238,10 +269,14 @@ tests/test_python_tests.py
|
|
|
238
269
|
tests/test_python_web_hosts.py
|
|
239
270
|
tests/test_python_web_routes.py
|
|
240
271
|
tests/test_python_web_routes_more.py
|
|
272
|
+
tests/test_realtime.py
|
|
273
|
+
tests/test_realtime_native.py
|
|
241
274
|
tests/test_roundtrip.py
|
|
275
|
+
tests/test_route_tables.py
|
|
242
276
|
tests/test_routes_search_explain.py
|
|
243
277
|
tests/test_rpc.py
|
|
244
278
|
tests/test_scip_health.py
|
|
279
|
+
tests/test_snippet.py
|
|
245
280
|
tests/test_sockets.py
|
|
246
281
|
tests/test_starters_budget.py
|
|
247
282
|
tests/test_swift.py
|
|
@@ -264,4 +299,7 @@ tests/test_ts_file_specs.py
|
|
|
264
299
|
tests/test_ts_frameworks.py
|
|
265
300
|
tests/test_ts_nuxt.py
|
|
266
301
|
tests/test_values.py
|
|
267
|
-
tests/test_viz.py
|
|
302
|
+
tests/test_viz.py
|
|
303
|
+
tests/test_vue_nav.py
|
|
304
|
+
tests/test_webhooks.py
|
|
305
|
+
tests/test_websockets.py
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""code-graph: deterministic code knowledge graph (beta)."""
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.12.0"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Canonical "how to read this codebase with cg" guidance.
|
|
2
|
+
|
|
3
|
+
Single source for this repo's AGENTS.md and for the blocks that `cg agents` installs into a
|
|
4
|
+
project's AGENTS.md / CLAUDE.md / Cursor rules, so the wording never drifts. TEXT is the body;
|
|
5
|
+
wrap it between BEGIN_MARK and END_MARK to get a block that can be replaced in place."""
|
|
6
|
+
|
|
7
|
+
BEGIN_MARK = "<!-- BEGIN cg agent rules (managed by `cg agents`; edit cg, not here) -->"
|
|
8
|
+
END_MARK = "<!-- END cg agent rules -->"
|
|
9
|
+
|
|
10
|
+
TEXT = """\
|
|
11
|
+
# Reading this codebase with cg
|
|
12
|
+
|
|
13
|
+
This repository ships `cg`, a code-graph tool. Read the code by symbol through the index
|
|
14
|
+
instead of opening whole files.
|
|
15
|
+
|
|
16
|
+
## Build the index first
|
|
17
|
+
pip install -e . -q # make `cg` this checkout's version
|
|
18
|
+
cg index . --db out/graph.db --name repo
|
|
19
|
+
There is no incremental index: re-run `cg index` after large changes.
|
|
20
|
+
|
|
21
|
+
## Find code (get file:line; avoid ls / cat / broad grep)
|
|
22
|
+
cg search <name> --db out/graph.db # nodes by name or FQN substring
|
|
23
|
+
cg impact <symbol> --db out/graph.db # callers up to entry points (reverse)
|
|
24
|
+
cg downstream <symbol> --db out/graph.db # what the symbol calls and reaches (forward)
|
|
25
|
+
cg node <symbol> --db out/graph.db # one node's location, kind and edges
|
|
26
|
+
`<symbol>` is a name, an FQN, `Class.method`, or a node id. Ambiguous names list candidates.
|
|
27
|
+
|
|
28
|
+
## Read source (never cat a whole file; never more than ~200 lines at once)
|
|
29
|
+
cg snippet <symbol> --db out/graph.db # just that symbol's source, numbered
|
|
30
|
+
cg snippet <symbol> --db out/graph.db --context 5 # a few lines around it
|
|
31
|
+
sed -n '120,180p' path/to/file # a plain line range when needed
|
|
32
|
+
`cg snippet` prints a `path:start-end` header then the body; `--max-lines` caps long bodies.
|
|
33
|
+
|
|
34
|
+
## Follow an edge only when your change reaches it
|
|
35
|
+
Use `cg impact` and `cg downstream` to decide whether a caller or callee matters before
|
|
36
|
+
opening it. Chase a dependency only if your edit changes what crosses that edge.
|
|
37
|
+
|
|
38
|
+
## After editing, re-query instead of rereading
|
|
39
|
+
Re-run `cg index`, then `cg snippet` or `cg impact` on the changed spot to confirm the new
|
|
40
|
+
shape, rather than reopening files.
|
|
41
|
+
|
|
42
|
+
## Keep output small
|
|
43
|
+
Pipe long output through `head` or `tail`:
|
|
44
|
+
cg impact <symbol> --db out/graph.db | head -n 40
|
|
45
|
+
While iterating, run one file: `pytest -q -x tests/test_x.py`.
|
|
46
|
+
Run the full suite once at the end: `pytest -q 2>&1 | tail -n 30`.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def document() -> str:
|
|
51
|
+
"""The repo-root AGENTS.md content (TEXT, newline-terminated)."""
|
|
52
|
+
return TEXT
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def block() -> str:
|
|
56
|
+
"""The marked block `cg agents` writes into a project file; replaced in place on re-run."""
|
|
57
|
+
return BEGIN_MARK + "\n" + TEXT + END_MARK + "\n"
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"""`cg agents`: opt-in install of the cg usage guidance (and the cg MCP server entry) into a
|
|
2
|
+
project's AGENTS.md / CLAUDE.md / Cursor rules. It only ever writes a clearly marked block and
|
|
3
|
+
never writes silently: every run previews the exact changes and asks before writing (--dry-run
|
|
4
|
+
previews without writing, --yes skips the prompt). Re-running replaces the block in place; remove
|
|
5
|
+
deletes it and restores the surrounding bytes. MCP changes touch only the `cg` server entry."""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import difflib
|
|
9
|
+
import json
|
|
10
|
+
import re
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
from . import agent_rules as AR
|
|
14
|
+
|
|
15
|
+
# project guidance files `cg agents` can manage, by --target key
|
|
16
|
+
TARGETS = {"agents": "AGENTS.md", "claude": "CLAUDE.md", "cursor": ".cursor/rules/cg.mdc"}
|
|
17
|
+
DEFAULT_MCP_FILE = ".cursor/mcp.json"
|
|
18
|
+
MCP_ENTRY = {"command": "cg-mcp", "args": ["--db", "out/graph.db"]}
|
|
19
|
+
|
|
20
|
+
_CORE = re.compile(re.escape(AR.BEGIN_MARK) + r".*?" + re.escape(AR.END_MARK), re.S)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _core_text() -> str:
|
|
24
|
+
"""The managed block without a trailing newline (BEGIN … END)."""
|
|
25
|
+
return AR.block().rstrip("\n")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def plan_text(path: Path, remove: bool) -> dict:
|
|
29
|
+
"""Decide the new content of one guidance file. action: insert | update | remove | noop.
|
|
30
|
+
Everything outside the marked block is preserved; a re-run replaces the block in place and
|
|
31
|
+
remove restores the bytes the matching insert added (for newline-terminated files)."""
|
|
32
|
+
old = path.read_text(encoding="utf-8") if path.exists() else ""
|
|
33
|
+
m = _CORE.search(old)
|
|
34
|
+
core = _core_text()
|
|
35
|
+
if remove:
|
|
36
|
+
if not m:
|
|
37
|
+
return {"path": str(path), "kind": "text", "action": "noop", "old": old, "new": old}
|
|
38
|
+
s, e = m.start(), m.end()
|
|
39
|
+
while e < len(old) and old[e] == "\n": # drop the block's trailing newlines
|
|
40
|
+
e += 1
|
|
41
|
+
j = s
|
|
42
|
+
while j > 0 and old[j - 1] == "\n": # drop separator newlines before it
|
|
43
|
+
j -= 1
|
|
44
|
+
s = j + 1 if j > 0 else 0 # but keep one newline after real content
|
|
45
|
+
new = old[:s] + old[e:]
|
|
46
|
+
return {"path": str(path), "kind": "text", "action": "remove", "old": old, "new": new}
|
|
47
|
+
if m:
|
|
48
|
+
new = old[:m.start()] + core + old[m.end():]
|
|
49
|
+
return {"path": str(path), "kind": "text", "action": "update", "old": old, "new": new}
|
|
50
|
+
if not old:
|
|
51
|
+
new = core + "\n"
|
|
52
|
+
elif old.endswith("\n\n"):
|
|
53
|
+
new = old + core + "\n"
|
|
54
|
+
elif old.endswith("\n"):
|
|
55
|
+
new = old + "\n" + core + "\n"
|
|
56
|
+
else:
|
|
57
|
+
new = old + "\n\n" + core + "\n"
|
|
58
|
+
return {"path": str(path), "kind": "text", "action": "insert", "old": old, "new": new}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def plan_mcp(path: Path, remove: bool) -> dict:
|
|
62
|
+
"""Add / update / remove only the `cg` entry under mcpServers; every other entry and key is
|
|
63
|
+
kept. Returns action noop when there is nothing to change, or error when the file is not JSON."""
|
|
64
|
+
old = path.read_text(encoding="utf-8") if path.exists() else ""
|
|
65
|
+
if old.strip():
|
|
66
|
+
try:
|
|
67
|
+
data = json.loads(old)
|
|
68
|
+
except ValueError as ex:
|
|
69
|
+
return {"path": str(path), "kind": "mcp", "action": "error", "old": old, "new": old,
|
|
70
|
+
"error": f"not valid JSON ({ex}); left unchanged"}
|
|
71
|
+
else:
|
|
72
|
+
data = {}
|
|
73
|
+
if not isinstance(data, dict):
|
|
74
|
+
return {"path": str(path), "kind": "mcp", "action": "error", "old": old, "new": old,
|
|
75
|
+
"error": "top level is not a JSON object; left unchanged"}
|
|
76
|
+
servers = data.get("mcpServers")
|
|
77
|
+
if not isinstance(servers, dict):
|
|
78
|
+
servers = {}
|
|
79
|
+
if remove:
|
|
80
|
+
if "cg" not in servers:
|
|
81
|
+
return {"path": str(path), "kind": "mcp", "action": "noop", "old": old, "new": old}
|
|
82
|
+
servers = {k: v for k, v in servers.items() if k != "cg"}
|
|
83
|
+
action = "remove"
|
|
84
|
+
else:
|
|
85
|
+
action = "update" if "cg" in servers else "insert"
|
|
86
|
+
servers = {**servers, "cg": MCP_ENTRY}
|
|
87
|
+
data = {**data, "mcpServers": servers}
|
|
88
|
+
new = json.dumps(data, indent=2) + "\n"
|
|
89
|
+
return {"path": str(path), "kind": "mcp", "action": action, "old": old, "new": new}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def preview(plan: dict) -> str:
|
|
93
|
+
"""A unified diff of one plan (the exact proposed change), or a one-line note for noop/error."""
|
|
94
|
+
if plan["action"] == "noop":
|
|
95
|
+
return f"{plan['path']}: no change (block not present)" if plan["kind"] == "text" \
|
|
96
|
+
else f"{plan['path']}: no change (no cg entry)"
|
|
97
|
+
if plan["action"] == "error":
|
|
98
|
+
return f"{plan['path']}: {plan['error']}"
|
|
99
|
+
diff = difflib.unified_diff(plan["old"].splitlines(True), plan["new"].splitlines(True),
|
|
100
|
+
fromfile=plan["path"], tofile=plan["path"], n=1)
|
|
101
|
+
body = "".join(diff).rstrip("\n")
|
|
102
|
+
return f"{plan['path']} [{plan['action']}]\n{body}"
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def build_plans(root: Path, targets: list[str], mcp: bool, mcp_file: str | None, remove: bool) -> list[dict]:
|
|
106
|
+
plans = [plan_text(root / TARGETS[t], remove) for t in targets]
|
|
107
|
+
if mcp:
|
|
108
|
+
plans.append(plan_mcp(Path(mcp_file) if mcp_file else root / DEFAULT_MCP_FILE, remove))
|
|
109
|
+
return plans
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def run(action: str, root: str = ".", targets: list[str] | None = None, all_targets: bool = False,
|
|
113
|
+
mcp: bool = False, mcp_file: str | None = None, dry_run: bool = False, assume_yes: bool = False,
|
|
114
|
+
input_fn=input, out=print) -> int:
|
|
115
|
+
"""Entry point for the CLI. action: install | update | remove | show. Returns a process exit code."""
|
|
116
|
+
rootp = Path(root)
|
|
117
|
+
remove = action == "remove"
|
|
118
|
+
if all_targets:
|
|
119
|
+
sel = list(TARGETS)
|
|
120
|
+
elif targets:
|
|
121
|
+
sel = targets
|
|
122
|
+
else: # default: the guidance files that already exist
|
|
123
|
+
sel = [t for t, f in TARGETS.items() if (rootp / f).exists()]
|
|
124
|
+
if not sel and not mcp:
|
|
125
|
+
out("nothing selected: pass --target agents|claude|cursor (repeatable), --all, or --mcp "
|
|
126
|
+
"(none of AGENTS.md / CLAUDE.md / .cursor/rules/cg.mdc exist here)")
|
|
127
|
+
return 2
|
|
128
|
+
plans = build_plans(rootp, sel, mcp, mcp_file, remove)
|
|
129
|
+
for p in plans:
|
|
130
|
+
out(preview(p))
|
|
131
|
+
if any(p["action"] == "error" for p in plans):
|
|
132
|
+
return 2
|
|
133
|
+
changing = [p for p in plans if p["action"] not in ("noop",)]
|
|
134
|
+
if action == "show" or dry_run:
|
|
135
|
+
out("(dry run: nothing written)" if dry_run else "(show: nothing written)")
|
|
136
|
+
return 0
|
|
137
|
+
if not changing:
|
|
138
|
+
out("nothing to do")
|
|
139
|
+
return 0
|
|
140
|
+
if not assume_yes:
|
|
141
|
+
resp = input_fn(f"apply {len(changing)} change(s)? [y/N] ")
|
|
142
|
+
if (resp or "").strip().lower() not in ("y", "yes"):
|
|
143
|
+
out("aborted; nothing written")
|
|
144
|
+
return 1
|
|
145
|
+
for p in changing:
|
|
146
|
+
fp = Path(p["path"])
|
|
147
|
+
fp.parent.mkdir(parents=True, exist_ok=True)
|
|
148
|
+
fp.write_text(p["new"], encoding="utf-8")
|
|
149
|
+
out(f"wrote {p['path']} ({p['action']})")
|
|
150
|
+
return 0
|