@backthread/extractor 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/cluster/domain-grouping.d.ts +113 -0
- package/dist/cluster/domain-grouping.d.ts.map +1 -0
- package/dist/cluster/domain-grouping.js +277 -0
- package/dist/cluster/domain-grouping.js.map +1 -0
- package/dist/cluster/grouping-gate.d.ts +54 -0
- package/dist/cluster/grouping-gate.d.ts.map +1 -0
- package/dist/cluster/grouping-gate.js +0 -0
- package/dist/cluster/grouping-gate.js.map +1 -0
- package/dist/cluster/louvain.d.ts +88 -0
- package/dist/cluster/louvain.d.ts.map +1 -0
- package/dist/cluster/louvain.js +674 -0
- package/dist/cluster/louvain.js.map +1 -0
- package/dist/cluster/overrides.d.ts +19 -0
- package/dist/cluster/overrides.d.ts.map +1 -0
- package/dist/cluster/overrides.js +32 -0
- package/dist/cluster/overrides.js.map +1 -0
- package/dist/cluster/subsystem.d.ts +45 -0
- package/dist/cluster/subsystem.d.ts.map +1 -0
- package/dist/cluster/subsystem.js +299 -0
- package/dist/cluster/subsystem.js.map +1 -0
- package/dist/cluster/workspaces.d.ts +64 -0
- package/dist/cluster/workspaces.d.ts.map +1 -0
- package/dist/cluster/workspaces.js +739 -0
- package/dist/cluster/workspaces.js.map +1 -0
- package/dist/extract.d.ts +52 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +48 -0
- package/dist/extract.js.map +1 -0
- package/dist/framework/celery/celery.d.ts +17 -0
- package/dist/framework/celery/celery.d.ts.map +1 -0
- package/dist/framework/celery/celery.js +524 -0
- package/dist/framework/celery/celery.js.map +1 -0
- package/dist/framework/contribute-step.d.ts +38 -0
- package/dist/framework/contribute-step.d.ts.map +1 -0
- package/dist/framework/contribute-step.js +403 -0
- package/dist/framework/contribute-step.js.map +1 -0
- package/dist/framework/detect-step.d.ts +8 -0
- package/dist/framework/detect-step.d.ts.map +1 -0
- package/dist/framework/detect-step.js +54 -0
- package/dist/framework/detect-step.js.map +1 -0
- package/dist/framework/detect-util.d.ts +24 -0
- package/dist/framework/detect-util.d.ts.map +1 -0
- package/dist/framework/detect-util.js +59 -0
- package/dist/framework/detect-util.js.map +1 -0
- package/dist/framework/django/django.d.ts +22 -0
- package/dist/framework/django/django.d.ts.map +1 -0
- package/dist/framework/django/django.js +940 -0
- package/dist/framework/django/django.js.map +1 -0
- package/dist/framework/fastapi/fastapi.d.ts +27 -0
- package/dist/framework/fastapi/fastapi.d.ts.map +1 -0
- package/dist/framework/fastapi/fastapi.js +477 -0
- package/dist/framework/fastapi/fastapi.js.map +1 -0
- package/dist/framework/faststream/faststream.d.ts +19 -0
- package/dist/framework/faststream/faststream.d.ts.map +1 -0
- package/dist/framework/faststream/faststream.js +765 -0
- package/dist/framework/faststream/faststream.js.map +1 -0
- package/dist/framework/flask/flask.d.ts +17 -0
- package/dist/framework/flask/flask.d.ts.map +1 -0
- package/dist/framework/flask/flask.js +507 -0
- package/dist/framework/flask/flask.js.map +1 -0
- package/dist/framework/graphql/graphql.d.ts +17 -0
- package/dist/framework/graphql/graphql.d.ts.map +1 -0
- package/dist/framework/graphql/graphql.js +708 -0
- package/dist/framework/graphql/graphql.js.map +1 -0
- package/dist/framework/grpc/grpc.d.ts +22 -0
- package/dist/framework/grpc/grpc.d.ts.map +1 -0
- package/dist/framework/grpc/grpc.js +618 -0
- package/dist/framework/grpc/grpc.js.map +1 -0
- package/dist/framework/litestar/litestar.d.ts +17 -0
- package/dist/framework/litestar/litestar.d.ts.map +1 -0
- package/dist/framework/litestar/litestar.js +536 -0
- package/dist/framework/litestar/litestar.js.map +1 -0
- package/dist/framework/nest/nest.d.ts +19 -0
- package/dist/framework/nest/nest.d.ts.map +1 -0
- package/dist/framework/nest/nest.js +613 -0
- package/dist/framework/nest/nest.js.map +1 -0
- package/dist/framework/next/next.d.ts +22 -0
- package/dist/framework/next/next.d.ts.map +1 -0
- package/dist/framework/next/next.js +449 -0
- package/dist/framework/next/next.js.map +1 -0
- package/dist/framework/node/node.d.ts +24 -0
- package/dist/framework/node/node.d.ts.map +1 -0
- package/dist/framework/node/node.js +1009 -0
- package/dist/framework/node/node.js.map +1 -0
- package/dist/framework/orchestrator/orchestrator.d.ts +34 -0
- package/dist/framework/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/framework/orchestrator/orchestrator.js +691 -0
- package/dist/framework/orchestrator/orchestrator.js.map +1 -0
- package/dist/framework/orm/orm.d.ts +61 -0
- package/dist/framework/orm/orm.d.ts.map +1 -0
- package/dist/framework/orm/orm.js +620 -0
- package/dist/framework/orm/orm.js.map +1 -0
- package/dist/framework/python/analyze.d.ts +38 -0
- package/dist/framework/python/analyze.d.ts.map +1 -0
- package/dist/framework/python/analyze.js +98 -0
- package/dist/framework/python/analyze.js.map +1 -0
- package/dist/framework/python/py-ast.d.ts +130 -0
- package/dist/framework/python/py-ast.d.ts.map +1 -0
- package/dist/framework/python/py-ast.js +344 -0
- package/dist/framework/python/py-ast.js.map +1 -0
- package/dist/framework/python-orm/python-orm.d.ts +19 -0
- package/dist/framework/python-orm/python-orm.d.ts.map +1 -0
- package/dist/framework/python-orm/python-orm.js +516 -0
- package/dist/framework/python-orm/python-orm.js.map +1 -0
- package/dist/framework/react-native/react-native.d.ts +35 -0
- package/dist/framework/react-native/react-native.d.ts.map +1 -0
- package/dist/framework/react-native/react-native.js +1181 -0
- package/dist/framework/react-native/react-native.js.map +1 -0
- package/dist/framework/register.d.ts +2 -0
- package/dist/framework/register.d.ts.map +1 -0
- package/dist/framework/register.js +59 -0
- package/dist/framework/register.js.map +1 -0
- package/dist/framework/registry.d.ts +31 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +70 -0
- package/dist/framework/registry.js.map +1 -0
- package/dist/framework/routing/expo-router.d.ts +31 -0
- package/dist/framework/routing/expo-router.d.ts.map +1 -0
- package/dist/framework/routing/expo-router.js +356 -0
- package/dist/framework/routing/expo-router.js.map +1 -0
- package/dist/framework/routing/index.d.ts +4 -0
- package/dist/framework/routing/index.d.ts.map +1 -0
- package/dist/framework/routing/index.js +16 -0
- package/dist/framework/routing/index.js.map +1 -0
- package/dist/framework/routing/next-router.d.ts +45 -0
- package/dist/framework/routing/next-router.d.ts.map +1 -0
- package/dist/framework/routing/next-router.js +378 -0
- package/dist/framework/routing/next-router.js.map +1 -0
- package/dist/framework/routing/route-tree.d.ts +73 -0
- package/dist/framework/routing/route-tree.d.ts.map +1 -0
- package/dist/framework/routing/route-tree.js +120 -0
- package/dist/framework/routing/route-tree.js.map +1 -0
- package/dist/framework/types.d.ts +230 -0
- package/dist/framework/types.d.ts.map +1 -0
- package/dist/framework/types.js +25 -0
- package/dist/framework/types.js.map +1 -0
- package/dist/graph/cross-language.d.ts +11 -0
- package/dist/graph/cross-language.d.ts.map +1 -0
- package/dist/graph/cross-language.js +123 -0
- package/dist/graph/cross-language.js.map +1 -0
- package/dist/graph/extract.d.ts +13 -0
- package/dist/graph/extract.d.ts.map +1 -0
- package/dist/graph/extract.js +79 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/file-graph.d.ts +186 -0
- package/dist/graph/file-graph.d.ts.map +1 -0
- package/dist/graph/file-graph.js +427 -0
- package/dist/graph/file-graph.js.map +1 -0
- package/dist/graph/http-callsites.d.ts +14 -0
- package/dist/graph/http-callsites.d.ts.map +1 -0
- package/dist/graph/http-callsites.js +107 -0
- package/dist/graph/http-callsites.js.map +1 -0
- package/dist/graph/incremental.d.ts +122 -0
- package/dist/graph/incremental.d.ts.map +1 -0
- package/dist/graph/incremental.js +448 -0
- package/dist/graph/incremental.js.map +1 -0
- package/dist/graph/language.d.ts +31 -0
- package/dist/graph/language.d.ts.map +1 -0
- package/dist/graph/language.js +146 -0
- package/dist/graph/language.js.map +1 -0
- package/dist/graph/noise-filter.d.ts +46 -0
- package/dist/graph/noise-filter.d.ts.map +1 -0
- package/dist/graph/noise-filter.js +199 -0
- package/dist/graph/noise-filter.js.map +1 -0
- package/dist/graph/python-adapter.d.ts +36 -0
- package/dist/graph/python-adapter.d.ts.map +1 -0
- package/dist/graph/python-adapter.js +402 -0
- package/dist/graph/python-adapter.js.map +1 -0
- package/dist/graph/python-manifest.d.ts +22 -0
- package/dist/graph/python-manifest.d.ts.map +1 -0
- package/dist/graph/python-manifest.js +137 -0
- package/dist/graph/python-manifest.js.map +1 -0
- package/dist/graph/python-stdlib.d.ts +2 -0
- package/dist/graph/python-stdlib.d.ts.map +1 -0
- package/dist/graph/python-stdlib.js +53 -0
- package/dist/graph/python-stdlib.js.map +1 -0
- package/dist/graph/ts-morph-adapter.d.ts +65 -0
- package/dist/graph/ts-morph-adapter.d.ts.map +1 -0
- package/dist/graph/ts-morph-adapter.js +265 -0
- package/dist/graph/ts-morph-adapter.js.map +1 -0
- package/dist/graph/types.d.ts +37 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +50 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/infra/aws/aws-parse.d.ts +39 -0
- package/dist/infra/aws/aws-parse.d.ts.map +1 -0
- package/dist/infra/aws/aws-parse.js +149 -0
- package/dist/infra/aws/aws-parse.js.map +1 -0
- package/dist/infra/aws/aws.d.ts +6 -0
- package/dist/infra/aws/aws.d.ts.map +1 -0
- package/dist/infra/aws/aws.js +425 -0
- package/dist/infra/aws/aws.js.map +1 -0
- package/dist/infra/azure/azure-parse.d.ts +73 -0
- package/dist/infra/azure/azure-parse.d.ts.map +1 -0
- package/dist/infra/azure/azure-parse.js +178 -0
- package/dist/infra/azure/azure-parse.js.map +1 -0
- package/dist/infra/azure/azure.d.ts +12 -0
- package/dist/infra/azure/azure.d.ts.map +1 -0
- package/dist/infra/azure/azure.js +673 -0
- package/dist/infra/azure/azure.js.map +1 -0
- package/dist/infra/cloudflare/cloudflare.d.ts +50 -0
- package/dist/infra/cloudflare/cloudflare.d.ts.map +1 -0
- package/dist/infra/cloudflare/cloudflare.js +382 -0
- package/dist/infra/cloudflare/cloudflare.js.map +1 -0
- package/dist/infra/cloudflare/wrangler-parse.d.ts +6 -0
- package/dist/infra/cloudflare/wrangler-parse.d.ts.map +1 -0
- package/dist/infra/cloudflare/wrangler-parse.js +278 -0
- package/dist/infra/cloudflare/wrangler-parse.js.map +1 -0
- package/dist/infra/compose/compose-parse.d.ts +24 -0
- package/dist/infra/compose/compose-parse.d.ts.map +1 -0
- package/dist/infra/compose/compose-parse.js +77 -0
- package/dist/infra/compose/compose-parse.js.map +1 -0
- package/dist/infra/compose/compose.d.ts +12 -0
- package/dist/infra/compose/compose.d.ts.map +1 -0
- package/dist/infra/compose/compose.js +201 -0
- package/dist/infra/compose/compose.js.map +1 -0
- package/dist/infra/convex/convex-parse.d.ts +28 -0
- package/dist/infra/convex/convex-parse.d.ts.map +1 -0
- package/dist/infra/convex/convex-parse.js +74 -0
- package/dist/infra/convex/convex-parse.js.map +1 -0
- package/dist/infra/convex/convex.d.ts +18 -0
- package/dist/infra/convex/convex.d.ts.map +1 -0
- package/dist/infra/convex/convex.js +199 -0
- package/dist/infra/convex/convex.js.map +1 -0
- package/dist/infra/digitalocean/digitalocean.d.ts +33 -0
- package/dist/infra/digitalocean/digitalocean.d.ts.map +1 -0
- package/dist/infra/digitalocean/digitalocean.js +204 -0
- package/dist/infra/digitalocean/digitalocean.js.map +1 -0
- package/dist/infra/firebase/firebase.d.ts +43 -0
- package/dist/infra/firebase/firebase.d.ts.map +1 -0
- package/dist/infra/firebase/firebase.js +271 -0
- package/dist/infra/firebase/firebase.js.map +1 -0
- package/dist/infra/fly/fly-parse.d.ts +52 -0
- package/dist/infra/fly/fly-parse.d.ts.map +1 -0
- package/dist/infra/fly/fly-parse.js +114 -0
- package/dist/infra/fly/fly-parse.js.map +1 -0
- package/dist/infra/fly/fly.d.ts +15 -0
- package/dist/infra/fly/fly.d.ts.map +1 -0
- package/dist/infra/fly/fly.js +265 -0
- package/dist/infra/fly/fly.js.map +1 -0
- package/dist/infra/gcp/gcp-parse.d.ts +24 -0
- package/dist/infra/gcp/gcp-parse.d.ts.map +1 -0
- package/dist/infra/gcp/gcp-parse.js +123 -0
- package/dist/infra/gcp/gcp-parse.js.map +1 -0
- package/dist/infra/gcp/gcp.d.ts +10 -0
- package/dist/infra/gcp/gcp.d.ts.map +1 -0
- package/dist/infra/gcp/gcp.js +502 -0
- package/dist/infra/gcp/gcp.js.map +1 -0
- package/dist/infra/heroku/heroku-parse.d.ts +33 -0
- package/dist/infra/heroku/heroku-parse.d.ts.map +1 -0
- package/dist/infra/heroku/heroku-parse.js +63 -0
- package/dist/infra/heroku/heroku-parse.js.map +1 -0
- package/dist/infra/heroku/heroku.d.ts +24 -0
- package/dist/infra/heroku/heroku.d.ts.map +1 -0
- package/dist/infra/heroku/heroku.js +253 -0
- package/dist/infra/heroku/heroku.js.map +1 -0
- package/dist/infra/image-resolve.d.ts +56 -0
- package/dist/infra/image-resolve.d.ts.map +1 -0
- package/dist/infra/image-resolve.js +229 -0
- package/dist/infra/image-resolve.js.map +1 -0
- package/dist/infra/infra-step.d.ts +39 -0
- package/dist/infra/infra-step.d.ts.map +1 -0
- package/dist/infra/infra-step.js +57 -0
- package/dist/infra/infra-step.js.map +1 -0
- package/dist/infra/k8s/index.d.ts +78 -0
- package/dist/infra/k8s/index.d.ts.map +1 -0
- package/dist/infra/k8s/index.js +251 -0
- package/dist/infra/k8s/index.js.map +1 -0
- package/dist/infra/kamal/kamal-parse.d.ts +23 -0
- package/dist/infra/kamal/kamal-parse.d.ts.map +1 -0
- package/dist/infra/kamal/kamal-parse.js +66 -0
- package/dist/infra/kamal/kamal-parse.js.map +1 -0
- package/dist/infra/kamal/kamal.d.ts +17 -0
- package/dist/infra/kamal/kamal.d.ts.map +1 -0
- package/dist/infra/kamal/kamal.js +162 -0
- package/dist/infra/kamal/kamal.js.map +1 -0
- package/dist/infra/netlify/netlify.d.ts +33 -0
- package/dist/infra/netlify/netlify.d.ts.map +1 -0
- package/dist/infra/netlify/netlify.js +247 -0
- package/dist/infra/netlify/netlify.js.map +1 -0
- package/dist/infra/opentofu/opentofu.d.ts +3 -0
- package/dist/infra/opentofu/opentofu.d.ts.map +1 -0
- package/dist/infra/opentofu/opentofu.js +157 -0
- package/dist/infra/opentofu/opentofu.js.map +1 -0
- package/dist/infra/pulumi/pulumi-parse.d.ts +60 -0
- package/dist/infra/pulumi/pulumi-parse.d.ts.map +1 -0
- package/dist/infra/pulumi/pulumi-parse.js +155 -0
- package/dist/infra/pulumi/pulumi-parse.js.map +1 -0
- package/dist/infra/pulumi/pulumi.d.ts +23 -0
- package/dist/infra/pulumi/pulumi.d.ts.map +1 -0
- package/dist/infra/pulumi/pulumi.js +260 -0
- package/dist/infra/pulumi/pulumi.js.map +1 -0
- package/dist/infra/railway/railway-parse.d.ts +54 -0
- package/dist/infra/railway/railway-parse.d.ts.map +1 -0
- package/dist/infra/railway/railway-parse.js +200 -0
- package/dist/infra/railway/railway-parse.js.map +1 -0
- package/dist/infra/railway/railway.d.ts +19 -0
- package/dist/infra/railway/railway.d.ts.map +1 -0
- package/dist/infra/railway/railway.js +397 -0
- package/dist/infra/railway/railway.js.map +1 -0
- package/dist/infra/register.d.ts +2 -0
- package/dist/infra/register.d.ts.map +1 -0
- package/dist/infra/register.js +81 -0
- package/dist/infra/register.js.map +1 -0
- package/dist/infra/registry.d.ts +64 -0
- package/dist/infra/registry.d.ts.map +1 -0
- package/dist/infra/registry.js +205 -0
- package/dist/infra/registry.js.map +1 -0
- package/dist/infra/relevance.d.ts +16 -0
- package/dist/infra/relevance.d.ts.map +1 -0
- package/dist/infra/relevance.js +132 -0
- package/dist/infra/relevance.js.map +1 -0
- package/dist/infra/render/render-parse.d.ts +76 -0
- package/dist/infra/render/render-parse.d.ts.map +1 -0
- package/dist/infra/render/render-parse.js +155 -0
- package/dist/infra/render/render-parse.js.map +1 -0
- package/dist/infra/render/render.d.ts +11 -0
- package/dist/infra/render/render.d.ts.map +1 -0
- package/dist/infra/render/render.js +303 -0
- package/dist/infra/render/render.js.map +1 -0
- package/dist/infra/sst/sst-parse.d.ts +25 -0
- package/dist/infra/sst/sst-parse.d.ts.map +1 -0
- package/dist/infra/sst/sst-parse.js +45 -0
- package/dist/infra/sst/sst-parse.js.map +1 -0
- package/dist/infra/sst/sst.d.ts +19 -0
- package/dist/infra/sst/sst.d.ts.map +1 -0
- package/dist/infra/sst/sst.js +236 -0
- package/dist/infra/sst/sst.js.map +1 -0
- package/dist/infra/supabase/supabase-parse.d.ts +34 -0
- package/dist/infra/supabase/supabase-parse.d.ts.map +1 -0
- package/dist/infra/supabase/supabase-parse.js +113 -0
- package/dist/infra/supabase/supabase-parse.js.map +1 -0
- package/dist/infra/supabase/supabase.d.ts +15 -0
- package/dist/infra/supabase/supabase.d.ts.map +1 -0
- package/dist/infra/supabase/supabase.js +198 -0
- package/dist/infra/supabase/supabase.js.map +1 -0
- package/dist/infra/terraform/hcl-parse.d.ts +34 -0
- package/dist/infra/terraform/hcl-parse.d.ts.map +1 -0
- package/dist/infra/terraform/hcl-parse.js +203 -0
- package/dist/infra/terraform/hcl-parse.js.map +1 -0
- package/dist/infra/terraform/terraform.d.ts +14 -0
- package/dist/infra/terraform/terraform.d.ts.map +1 -0
- package/dist/infra/terraform/terraform.js +264 -0
- package/dist/infra/terraform/terraform.js.map +1 -0
- package/dist/infra/types.d.ts +151 -0
- package/dist/infra/types.d.ts.map +1 -0
- package/dist/infra/types.js +14 -0
- package/dist/infra/types.js.map +1 -0
- package/dist/infra/vercel/vercel-parse.d.ts +70 -0
- package/dist/infra/vercel/vercel-parse.d.ts.map +1 -0
- package/dist/infra/vercel/vercel-parse.js +194 -0
- package/dist/infra/vercel/vercel-parse.js.map +1 -0
- package/dist/infra/vercel/vercel.d.ts +30 -0
- package/dist/infra/vercel/vercel.d.ts.map +1 -0
- package/dist/infra/vercel/vercel.js +523 -0
- package/dist/infra/vercel/vercel.js.map +1 -0
- package/dist/infra/walk.d.ts +36 -0
- package/dist/infra/walk.d.ts.map +1 -0
- package/dist/infra/walk.js +85 -0
- package/dist/infra/walk.js.map +1 -0
- package/dist/safety.d.ts +13 -0
- package/dist/safety.d.ts.map +1 -0
- package/dist/safety.js +67 -0
- package/dist/safety.js.map +1 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +111 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +35 -0
- package/dist/version.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.js","sourceRoot":"","sources":["../../src/graph/language.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,kEAAkE;AAClE,8EAA8E;AAC9E,sDAAsD;AACtD,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,wCAAwC;AAExC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,GAEb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,gBAAgB,GAAG,CAAC,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,SAAS,CAAC,CAAC;AACpG,MAAM,YAAY,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,CAAC,CAAC;AAE9F;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,IAAgB;IAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAS,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC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
|
|
|
1
|
+
import type { NormalizedGraph } from './types.js';
|
|
2
|
+
export type NoiseCategory = 'test' | 'generated' | 'stories' | 'mocks' | 'config' | 'types' | 'build';
|
|
3
|
+
/** Every category, in a stable order (drives empty-count init + log order). */
|
|
4
|
+
export declare const NOISE_CATEGORIES: readonly NoiseCategory[];
|
|
5
|
+
export interface NoiseRule {
|
|
6
|
+
category: NoiseCategory;
|
|
7
|
+
/** Human-readable description of what this rule targets (logs/docs). */
|
|
8
|
+
description: string;
|
|
9
|
+
/** True when a repo-relative POSIX path is noise of this category. */
|
|
10
|
+
match: (path: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const NOISE_RULES: readonly NoiseRule[];
|
|
13
|
+
/**
|
|
14
|
+
* The noise category of a repo-relative posix path, or null if it is legitimate
|
|
15
|
+
* source. Pure; first matching rule wins. Exported for unit tests + callers that
|
|
16
|
+
* want to classify without filtering a whole graph.
|
|
17
|
+
*/
|
|
18
|
+
export declare function classifyNoise(path: string): NoiseCategory | null;
|
|
19
|
+
export interface DroppedNoise {
|
|
20
|
+
/** Total files dropped. */
|
|
21
|
+
total: number;
|
|
22
|
+
/** Per-category drop counts (every category present, 0 when none). */
|
|
23
|
+
byCategory: Record<NoiseCategory, number>;
|
|
24
|
+
/** Internal/external edges removed because an endpoint was dropped. */
|
|
25
|
+
edgesDropped: number;
|
|
26
|
+
/** The dropped files (queryable side list): path + the category that claimed it. */
|
|
27
|
+
files: {
|
|
28
|
+
path: string;
|
|
29
|
+
category: NoiseCategory;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Drop noise nodes (tests/generated/build/config/stories/mocks/types) from a
|
|
34
|
+
* NormalizedGraph, along with any edge whose endpoint left, and any external
|
|
35
|
+
* referenced ONLY by dropped files. Pure + deterministic (output order follows
|
|
36
|
+
* the input's file/edge order). Returns the filtered graph plus an auditable
|
|
37
|
+
* drop summary. When nothing matches, the SAME graph object is returned
|
|
38
|
+
* (referential stability for the common no-noise case).
|
|
39
|
+
*/
|
|
40
|
+
export declare function filterNoise(graph: NormalizedGraph): {
|
|
41
|
+
graph: NormalizedGraph;
|
|
42
|
+
dropped: DroppedNoise;
|
|
43
|
+
};
|
|
44
|
+
/** One-line log summary of a drop result (only meaningful when total > 0). */
|
|
45
|
+
export declare function summarizeNoise(dropped: DroppedNoise): string;
|
|
46
|
+
//# sourceMappingURL=noise-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noise-filter.d.ts","sourceRoot":"","sources":["../../src/graph/noise-filter.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,WAAW,GACX,SAAS,GACT,OAAO,GACP,QAAQ,GACR,OAAO,GACP,OAAO,CAAC;AAEZ,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,aAAa,EAQ3C,CAAC;AAEX,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,wEAAwE;IACxE,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAClC;AA6CD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAmD3C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAKhE;AAID,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC1C,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,aAAa,CAAA;KAAE,EAAE,CAAC;CACpD;AAQD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CA8CrG;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAK5D"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// deterministic NOISE FILTERING before clustering.
|
|
2
|
+
//
|
|
3
|
+
// The module graph should describe ARCHITECTURE, not the scaffolding around it.
|
|
4
|
+
// Tests, generated code, build output, config, stories, and mocks ingested as
|
|
5
|
+
// modules inflate boxes, blur domains, and pull the directory-primary subsystem
|
|
6
|
+
// grouping toward meaningless buckets. This pass classifies every file
|
|
7
|
+
// by its repo-relative POSIX path and drops the noise BEFORE clustering —
|
|
8
|
+
// config-driven (one ordered rule table below), deterministic, and LOGGED by
|
|
9
|
+
// category at the call sites (house rule: never a silent cap).
|
|
10
|
+
//
|
|
11
|
+
// WHERE IT RUNS (the graph stage, never the twins): applied to the assembled
|
|
12
|
+
// NormalizedGraph at every graph-stage exit toward clustering — extractGraph
|
|
13
|
+
// (the full-extract path: cli + container single-window + changelog A/B) and the
|
|
14
|
+
// incremental engine's seed/patch returns (the merge-walk path). It is NOT
|
|
15
|
+
// applied inside graphFromState or the ts-morph adapter: those stay PURE
|
|
16
|
+
// assemblers, and the carried FileGraphState keeps ALL files (filtering is an
|
|
17
|
+
// OUTPUT concern only). That keeps incremental patching + the blob parse-cache
|
|
18
|
+
// unaffected, and preserves the Stage-A/B equivalence contract by construction —
|
|
19
|
+
// filterNoise is a PURE, DETERMINISTIC function of the (identical) unfiltered
|
|
20
|
+
// graph, so applying it identically on both the incremental and full-extract
|
|
21
|
+
// sides cannot break their equality.
|
|
22
|
+
//
|
|
23
|
+
// Dropped files are RETAINED in the returned summary's `files` list (a cheap,
|
|
24
|
+
// queryable side channel) so the drop is auditable, not just a count.
|
|
25
|
+
/** Every category, in a stable order (drives empty-count init + log order). */
|
|
26
|
+
export const NOISE_CATEGORIES = [
|
|
27
|
+
'test',
|
|
28
|
+
'generated',
|
|
29
|
+
'stories',
|
|
30
|
+
'mocks',
|
|
31
|
+
'config',
|
|
32
|
+
'types',
|
|
33
|
+
'build',
|
|
34
|
+
];
|
|
35
|
+
// --- path helpers ----------------------------------------------------------
|
|
36
|
+
/** Directory segments of a repo-relative posix path (excludes the basename). */
|
|
37
|
+
function dirSegments(path) {
|
|
38
|
+
return path.split('/').slice(0, -1);
|
|
39
|
+
}
|
|
40
|
+
function hasDirSegment(path, dirs) {
|
|
41
|
+
return dirSegments(path).some((s) => dirs.has(s));
|
|
42
|
+
}
|
|
43
|
+
// Source-file extension class shared by the basename matchers: ts/tsx/js/jsx +
|
|
44
|
+
// the m*/c* ESM/CJS variants (mts/cts/mjs/cjs). Mirrors SOURCE_EXTENSIONS.
|
|
45
|
+
const SRC_EXT = '[cm]?[jt]sx?';
|
|
46
|
+
const TEST_DIRS = new Set(['__tests__']);
|
|
47
|
+
const GENERATED_DIRS = new Set(['__generated__']);
|
|
48
|
+
const MOCK_DIRS = new Set(['__mocks__', '__fixtures__']);
|
|
49
|
+
// Build output. Most are already skipped upstream (the adapter's EXCLUDE_DIRS /
|
|
50
|
+
// dot-segment glob), but the rule is explicit + defensive so the policy is
|
|
51
|
+
// self-contained and robust to glob changes.
|
|
52
|
+
const BUILD_DIRS = new Set(['dist', 'build', 'out', 'coverage', '.next', '.expo']);
|
|
53
|
+
const TEST_FILE_RE = new RegExp(`\\.(test|spec)\\.${SRC_EXT}$`);
|
|
54
|
+
const GENERATED_FILE_RE = new RegExp(`\\.(gen|generated)\\.${SRC_EXT}$`);
|
|
55
|
+
const STORIES_FILE_RE = new RegExp(`\\.(stories|story)\\.${SRC_EXT}$`);
|
|
56
|
+
const MOCK_FILE_RE = new RegExp(`\\.(mock|fixture)s?\\.${SRC_EXT}$`);
|
|
57
|
+
const CONFIG_FILE_RE = new RegExp(`\\.config\\.${SRC_EXT}$`);
|
|
58
|
+
const DTS_FILE_RE = /\.d\.[cm]?ts$/;
|
|
59
|
+
// Python noise. The regexes above are all `.<ext>`-suffixed with the
|
|
60
|
+
// TS SRC_EXT class, so a `.py` path never matches any of them — Python needs its
|
|
61
|
+
// own rule shapes. Conventions: pytest/unittest use `tests/` + `test/` dirs and
|
|
62
|
+
// `test_*.py` / `*_test.py` / `conftest.py`; Django + Alembic emit schema
|
|
63
|
+
// migrations into `migrations/`; `setup.py` is packaging config, not architecture.
|
|
64
|
+
const PYTHON_TEST_DIRS = new Set(['tests', 'test']);
|
|
65
|
+
const PYTHON_MIGRATION_DIRS = new Set(['migrations']);
|
|
66
|
+
const PYTHON_TEST_FILE_RE = /(^|\/)(test_[^/]*|[^/]*_test|conftest)\.pyi?$/;
|
|
67
|
+
const PYTHON_SETUP_RE = /(^|\/)setup\.py$/;
|
|
68
|
+
// --- the rule table (config-driven; ORDERED — first match wins for the
|
|
69
|
+
// category label; a file is dropped regardless of which rule claims it) -------
|
|
70
|
+
export const NOISE_RULES = [
|
|
71
|
+
{
|
|
72
|
+
category: 'test',
|
|
73
|
+
description: '__tests__/ dirs and *.test.* / *.spec.* files',
|
|
74
|
+
match: (p) => hasDirSegment(p, TEST_DIRS) || TEST_FILE_RE.test(p),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
category: 'generated',
|
|
78
|
+
description: '__generated__/ dirs and *.gen.* / *.generated.* codegen output',
|
|
79
|
+
match: (p) => hasDirSegment(p, GENERATED_DIRS) || GENERATED_FILE_RE.test(p),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
category: 'stories',
|
|
83
|
+
description: '*.stories.* / *.story.* component stories',
|
|
84
|
+
match: (p) => STORIES_FILE_RE.test(p),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
category: 'mocks',
|
|
88
|
+
description: '__mocks__/ + __fixtures__/ dirs and *.mock.* / *.fixture.* files',
|
|
89
|
+
match: (p) => hasDirSegment(p, MOCK_DIRS) || MOCK_FILE_RE.test(p),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
category: 'config',
|
|
93
|
+
description: '*.config.* tool config (vite/jest/tailwind/… config modules)',
|
|
94
|
+
match: (p) => CONFIG_FILE_RE.test(p),
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
category: 'types',
|
|
98
|
+
description: 'redundant *.d.ts / *.d.mts / *.d.cts declaration files',
|
|
99
|
+
match: (p) => DTS_FILE_RE.test(p),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
category: 'build',
|
|
103
|
+
description: 'build output dirs (dist/ build/ out/ coverage/ .next/ .expo/)',
|
|
104
|
+
match: (p) => hasDirSegment(p, BUILD_DIRS),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
category: 'test',
|
|
108
|
+
description: 'Python tests: tests/ + test/ dirs and test_*.py / *_test.py / conftest.py',
|
|
109
|
+
match: (p) => hasDirSegment(p, PYTHON_TEST_DIRS) || PYTHON_TEST_FILE_RE.test(p),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
category: 'generated',
|
|
113
|
+
description: 'Python migrations/ dirs (Django + Alembic schema migrations)',
|
|
114
|
+
match: (p) => hasDirSegment(p, PYTHON_MIGRATION_DIRS),
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
category: 'config',
|
|
118
|
+
description: 'Python setup.py packaging config',
|
|
119
|
+
match: (p) => PYTHON_SETUP_RE.test(p),
|
|
120
|
+
},
|
|
121
|
+
];
|
|
122
|
+
/**
|
|
123
|
+
* The noise category of a repo-relative posix path, or null if it is legitimate
|
|
124
|
+
* source. Pure; first matching rule wins. Exported for unit tests + callers that
|
|
125
|
+
* want to classify without filtering a whole graph.
|
|
126
|
+
*/
|
|
127
|
+
export function classifyNoise(path) {
|
|
128
|
+
for (const rule of NOISE_RULES) {
|
|
129
|
+
if (rule.match(path))
|
|
130
|
+
return rule.category;
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
function emptyCounts() {
|
|
135
|
+
const c = {};
|
|
136
|
+
for (const cat of NOISE_CATEGORIES)
|
|
137
|
+
c[cat] = 0;
|
|
138
|
+
return c;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Drop noise nodes (tests/generated/build/config/stories/mocks/types) from a
|
|
142
|
+
* NormalizedGraph, along with any edge whose endpoint left, and any external
|
|
143
|
+
* referenced ONLY by dropped files. Pure + deterministic (output order follows
|
|
144
|
+
* the input's file/edge order). Returns the filtered graph plus an auditable
|
|
145
|
+
* drop summary. When nothing matches, the SAME graph object is returned
|
|
146
|
+
* (referential stability for the common no-noise case).
|
|
147
|
+
*/
|
|
148
|
+
export function filterNoise(graph) {
|
|
149
|
+
const byCategory = emptyCounts();
|
|
150
|
+
const droppedFiles = [];
|
|
151
|
+
const keep = new Set();
|
|
152
|
+
for (const f of graph.files) {
|
|
153
|
+
const cat = classifyNoise(f.id);
|
|
154
|
+
if (cat) {
|
|
155
|
+
byCategory[cat] += 1;
|
|
156
|
+
droppedFiles.push({ path: f.id, category: cat });
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
keep.add(f.id);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (droppedFiles.length === 0) {
|
|
163
|
+
return { graph, dropped: { total: 0, byCategory, edgesDropped: 0, files: [] } };
|
|
164
|
+
}
|
|
165
|
+
const files = graph.files.filter((f) => keep.has(f.id));
|
|
166
|
+
const edges = [];
|
|
167
|
+
const usedExternals = new Set();
|
|
168
|
+
let edgesDropped = 0;
|
|
169
|
+
for (const e of graph.edges) {
|
|
170
|
+
if (!keep.has(e.from)) {
|
|
171
|
+
edgesDropped += 1;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (e.external) {
|
|
175
|
+
usedExternals.add(e.to);
|
|
176
|
+
edges.push(e);
|
|
177
|
+
}
|
|
178
|
+
else if (keep.has(e.to)) {
|
|
179
|
+
edges.push(e);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
// internal edge into a dropped node — remove cleanly (no dangling endpoint)
|
|
183
|
+
edgesDropped += 1;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Prune externals nothing kept references anymore (e.g. vitest / testing-library
|
|
187
|
+
// imported only from tests) — keeps the externals list dangle-free + meaningful.
|
|
188
|
+
const externals = graph.externals.filter((x) => usedExternals.has(x.id));
|
|
189
|
+
return {
|
|
190
|
+
graph: { root: graph.root, files, edges, externals },
|
|
191
|
+
dropped: { total: droppedFiles.length, byCategory, edgesDropped, files: droppedFiles },
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** One-line log summary of a drop result (only meaningful when total > 0). */
|
|
195
|
+
export function summarizeNoise(dropped) {
|
|
196
|
+
const parts = NOISE_CATEGORIES.filter((c) => dropped.byCategory[c] > 0).map((c) => `${c}: ${dropped.byCategory[c]}`);
|
|
197
|
+
return `noise filter dropped ${dropped.total} file(s) [${parts.join(', ')}] + ${dropped.edgesDropped} edge(s)`;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=noise-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noise-filter.js","sourceRoot":"","sources":["../../src/graph/noise-filter.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,uEAAuE;AACvE,0EAA0E;AAC1E,6EAA6E;AAC7E,+DAA+D;AAC/D,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,iFAAiF;AACjF,2EAA2E;AAC3E,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,iFAAiF;AACjF,8EAA8E;AAC9E,6EAA6E;AAC7E,qCAAqC;AACrC,EAAE;AACF,8EAA8E;AAC9E,sEAAsE;AAatE,+EAA+E;AAC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,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CACxC,CAAC;IACF,OAAO,wBAAwB,OAAO,CAAC,KAAK,aAAa,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,YAAY,UAAU,CAAC;AACjH,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Uri } from '@zzzen/pyright-internal/dist/common/uri/uri.js';
|
|
2
|
+
import type { ModuleNode, ParseNode } from '@zzzen/pyright-internal/dist/parser/parseNodes.js';
|
|
3
|
+
import { type GraphExtractor, type NormalizedGraph } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The first-party source roots for a Python file set — every default root plus
|
|
6
|
+
* each directory that CONTAINS a top-level package (a dir with `__init__.py`
|
|
7
|
+
* whose parent is not itself a package). For `backend/app/__init__.py` the
|
|
8
|
+
* top-level package is `backend/app` and its containing root is `backend`, so
|
|
9
|
+
* `from app.x import y` resolves against `backend/app/x/y.py`. Additive: a
|
|
10
|
+
* root-layout repo already infers `''` and a src-layout `'src'` (both defaults),
|
|
11
|
+
* so single-package output is unchanged; only a NESTED package gains a root.
|
|
12
|
+
* Deterministic (sorted).
|
|
13
|
+
*/
|
|
14
|
+
export declare function inferSourceRoots(internalIds: ReadonlySet<string>): string[];
|
|
15
|
+
export declare function syntacticResolve(importName: string, fromId: string, internalIds: ReadonlySet<string>, roots?: readonly string[]): string | undefined;
|
|
16
|
+
interface DeclResolver {
|
|
17
|
+
getDeclInfoForNameNode(node: ParseNode): {
|
|
18
|
+
decls: Array<{
|
|
19
|
+
uri: Uri;
|
|
20
|
+
}>;
|
|
21
|
+
} | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The internal call-edge targets (target file id → weight) for one file: each
|
|
25
|
+
* call site's callee resolved to its declaring in-repo file. Never throws — a
|
|
26
|
+
* single unresolvable call is skipped, and a broken evaluator degrades the whole
|
|
27
|
+
* file to no call edges. Self-calls (same file) + external/stdlib targets are
|
|
28
|
+
* dropped; a call resolving to several decls in ONE file counts once.
|
|
29
|
+
*/
|
|
30
|
+
export declare function extractCallTargets(fromId: string, tree: ModuleNode, evaluator: DeclResolver, internalIds: ReadonlySet<string>, relOf: (uri: Uri) => string): Map<string, number>;
|
|
31
|
+
export declare class PythonExtractor implements GraphExtractor {
|
|
32
|
+
readonly language = "python";
|
|
33
|
+
extract(repoDir: string): Promise<NormalizedGraph>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=python-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-adapter.d.ts","sourceRoot":"","sources":["../../src/graph/python-adapter.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,GAAG,EAAE,MAAM,gDAAgD,CAAC;AAIrE,OAAO,KAAK,EAAY,UAAU,EAAE,SAAS,EAAE,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAuB,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAkB5F;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAgB3E;AA0CD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,KAAK,GAAE,SAAS,MAAM,EAAmB,GACxC,MAAM,GAAG,SAAS,CAgCpB;AA6HD,UAAU,YAAY;IACpB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG;QAAE,KAAK,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,GAAG,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;CACrF;AAmCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,YAAY,EACvB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,EAChC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAC1B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BrB;AAYD,qBAAa,eAAgB,YAAW,cAAc;IACpD,QAAQ,CAAC,QAAQ,YAAY;IAEvB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CA0DzD"}
|