@getchomp/core 0.0.0-stage → 0.2.43

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.
Files changed (135) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -2
  3. package/dist/diagnostics/frameworkCoverage.d.ts +72 -0
  4. package/dist/diagnostics/frameworkCoverage.js +588 -0
  5. package/dist/diagnostics/healthMetrics.d.ts +50 -0
  6. package/dist/diagnostics/healthMetrics.js +123 -0
  7. package/dist/diagnostics/receptorClassifier.d.ts +56 -0
  8. package/dist/diagnostics/receptorClassifier.js +402 -0
  9. package/dist/diagnostics/scoutSanity.d.ts +82 -0
  10. package/dist/diagnostics/scoutSanity.js +811 -0
  11. package/dist/diagnostics/shapeResolution.d.ts +145 -0
  12. package/dist/diagnostics/shapeResolution.js +672 -0
  13. package/dist/diagnostics/signalClusters.d.ts +65 -0
  14. package/dist/diagnostics/signalClusters.js +88 -0
  15. package/dist/diagnostics/unresolvedClassifier.d.ts +31 -0
  16. package/dist/diagnostics/unresolvedClassifier.js +525 -0
  17. package/dist/differ/index.d.ts +10 -0
  18. package/dist/differ/index.js +199 -0
  19. package/dist/extractor/adapters/drizzleAdapter.d.ts +25 -0
  20. package/dist/extractor/adapters/drizzleAdapter.js +156 -0
  21. package/dist/extractor/adapters/expressAdapter.d.ts +124 -0
  22. package/dist/extractor/adapters/expressAdapter.js +150 -0
  23. package/dist/extractor/adapters/mcpAdapter.d.ts +7 -0
  24. package/dist/extractor/adapters/mcpAdapter.js +17 -0
  25. package/dist/extractor/adapters/nextjsAdapter.d.ts +67 -0
  26. package/dist/extractor/adapters/nextjsAdapter.js +132 -0
  27. package/dist/extractor/adapters/payloadAdapter.d.ts +10 -0
  28. package/dist/extractor/adapters/payloadAdapter.js +39 -0
  29. package/dist/extractor/adapters/reactAdapter.d.ts +22 -0
  30. package/dist/extractor/adapters/reactAdapter.js +50 -0
  31. package/dist/extractor/conventions/astro.d.ts +22 -0
  32. package/dist/extractor/conventions/astro.js +106 -0
  33. package/dist/extractor/conventions/config.d.ts +20 -0
  34. package/dist/extractor/conventions/config.js +150 -0
  35. package/dist/extractor/conventions/core.d.ts +2 -0
  36. package/dist/extractor/conventions/core.js +222 -0
  37. package/dist/extractor/conventions/drizzle.d.ts +9 -0
  38. package/dist/extractor/conventions/drizzle.js +100 -0
  39. package/dist/extractor/conventions/engine.d.ts +139 -0
  40. package/dist/extractor/conventions/engine.js +2918 -0
  41. package/dist/extractor/conventions/express.d.ts +6 -0
  42. package/dist/extractor/conventions/express.js +284 -0
  43. package/dist/extractor/conventions/frameworks.d.ts +340 -0
  44. package/dist/extractor/conventions/frameworks.js +1754 -0
  45. package/dist/extractor/conventions/index.d.ts +34 -0
  46. package/dist/extractor/conventions/index.js +95 -0
  47. package/dist/extractor/conventions/mcp.d.ts +2 -0
  48. package/dist/extractor/conventions/mcp.js +40 -0
  49. package/dist/extractor/conventions/nextjs.d.ts +27 -0
  50. package/dist/extractor/conventions/nextjs.js +263 -0
  51. package/dist/extractor/conventions/payload.d.ts +10 -0
  52. package/dist/extractor/conventions/payload.js +420 -0
  53. package/dist/extractor/conventions/portConventions.d.ts +26 -0
  54. package/dist/extractor/conventions/portConventions.js +405 -0
  55. package/dist/extractor/conventions/react.d.ts +13 -0
  56. package/dist/extractor/conventions/react.js +152 -0
  57. package/dist/extractor/conventions/sveltekit.d.ts +52 -0
  58. package/dist/extractor/conventions/sveltekit.js +272 -0
  59. package/dist/extractor/conventions/types.d.ts +398 -0
  60. package/dist/extractor/conventions/types.js +17 -0
  61. package/dist/extractor/index.d.ts +45 -0
  62. package/dist/extractor/index.js +1535 -0
  63. package/dist/extractor/pathResolver.d.ts +18 -0
  64. package/dist/extractor/pathResolver.js +475 -0
  65. package/dist/extractor/sourcePreprocessor.d.ts +43 -0
  66. package/dist/extractor/sourcePreprocessor.js +529 -0
  67. package/dist/extractor/visitors/boundaryVisitor.d.ts +3 -0
  68. package/dist/extractor/visitors/boundaryVisitor.js +74 -0
  69. package/dist/extractor/visitors/commonjsExportVisitor.d.ts +7 -0
  70. package/dist/extractor/visitors/commonjsExportVisitor.js +18 -0
  71. package/dist/extractor/visitors/contractVisitor.d.ts +30 -0
  72. package/dist/extractor/visitors/contractVisitor.js +1220 -0
  73. package/dist/extractor/visitors/definePropertyVisitor.d.ts +7 -0
  74. package/dist/extractor/visitors/definePropertyVisitor.js +12 -0
  75. package/dist/extractor/visitors/directiveVisitor.d.ts +22 -0
  76. package/dist/extractor/visitors/directiveVisitor.js +50 -0
  77. package/dist/extractor/visitors/eventEmitterVisitor.d.ts +64 -0
  78. package/dist/extractor/visitors/eventEmitterVisitor.js +157 -0
  79. package/dist/extractor/visitors/factoryExportVisitor.d.ts +7 -0
  80. package/dist/extractor/visitors/factoryExportVisitor.js +126 -0
  81. package/dist/extractor/visitors/frameworkRelationshipVisitor.d.ts +141 -0
  82. package/dist/extractor/visitors/frameworkRelationshipVisitor.js +2611 -0
  83. package/dist/extractor/visitors/initBlockVisitor.d.ts +71 -0
  84. package/dist/extractor/visitors/initBlockVisitor.js +575 -0
  85. package/dist/extractor/visitors/openConnectorVisitor.d.ts +126 -0
  86. package/dist/extractor/visitors/openConnectorVisitor.js +1708 -0
  87. package/dist/extractor/visitors/portValveVisitor.d.ts +49 -0
  88. package/dist/extractor/visitors/portValveVisitor.js +440 -0
  89. package/dist/extractor/visitors/publicMethodVisitor.d.ts +28 -0
  90. package/dist/extractor/visitors/publicMethodVisitor.js +242 -0
  91. package/dist/extractor/visitors/relationshipVisitor.d.ts +81 -0
  92. package/dist/extractor/visitors/relationshipVisitor.js +5249 -0
  93. package/dist/extractor/visitors/shapeKeyVisitor.d.ts +52 -0
  94. package/dist/extractor/visitors/shapeKeyVisitor.js +623 -0
  95. package/dist/extractor/visitors/targetResolver.d.ts +252 -0
  96. package/dist/extractor/visitors/targetResolver.js +4850 -0
  97. package/dist/extractor/visitors/unresolvedConnectionVisitor.d.ts +53 -0
  98. package/dist/extractor/visitors/unresolvedConnectionVisitor.js +1850 -0
  99. package/dist/extractor/workspaceResolver.d.ts +70 -0
  100. package/dist/extractor/workspaceResolver.js +678 -0
  101. package/dist/index.d.ts +26 -0
  102. package/dist/index.js +26 -0
  103. package/dist/layout/entityVocabulary.d.ts +70 -0
  104. package/dist/layout/entityVocabulary.js +212 -0
  105. package/dist/layout/healthMetrics.d.ts +10 -0
  106. package/dist/layout/healthMetrics.js +194 -0
  107. package/dist/layout/index.d.ts +5 -0
  108. package/dist/layout/index.js +5 -0
  109. package/dist/layout/ruleMatcher.d.ts +71 -0
  110. package/dist/layout/ruleMatcher.js +193 -0
  111. package/dist/layout/types.d.ts +337 -0
  112. package/dist/layout/types.js +9 -0
  113. package/dist/layout/visualLinter.d.ts +94 -0
  114. package/dist/layout/visualLinter.js +378 -0
  115. package/dist/shims/applyShimOverlays.d.ts +50 -0
  116. package/dist/shims/applyShimOverlays.js +209 -0
  117. package/dist/types/diff.d.ts +27 -0
  118. package/dist/types/diff.js +1 -0
  119. package/dist/types/index.d.ts +10 -0
  120. package/dist/types/index.js +10 -0
  121. package/dist/types/ledger.d.ts +120 -0
  122. package/dist/types/ledger.js +3 -0
  123. package/dist/types/ontology.d.ts +251 -0
  124. package/dist/types/ontology.js +31 -0
  125. package/dist/types/pluginPresentation.d.ts +374 -0
  126. package/dist/types/pluginPresentation.js +626 -0
  127. package/dist/types/ports.d.ts +34 -0
  128. package/dist/types/ports.js +308 -0
  129. package/dist/utils/entityHash.d.ts +17 -0
  130. package/dist/utils/entityHash.js +26 -0
  131. package/dist/utils/id.d.ts +83 -0
  132. package/dist/utils/id.js +159 -0
  133. package/dist/version.d.ts +2 -0
  134. package/dist/version.js +29 -0
  135. package/package.json +85 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chomp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,11 @@
1
- # Temporary Holding Version
1
+ # `@getchomp/core`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Deterministic, single-pass TypeScript & JavaScript AST structural extraction engine for [Chomp](https://getchomp.dev).
4
+
5
+ - Extracts **Boundaries** (`DEPLOYMENT_UNIT`, `CLASS`, `NAMESPACE`, `INIT_BLOCK`), **Contracts**, **Relationships**, and **Open Connectors** with line-level source traceability and SHA-256 identity.
6
+ - Structural graph diffing (`compareGraphs`), unresolved call classification, and declarative framework conventions.
7
+ - Zero database imports and zero network calls.
8
+
9
+ ## Documentation
10
+
11
+ See [https://getchomp.dev/docs](https://getchomp.dev/docs).
@@ -0,0 +1,72 @@
1
+ import type { RepresentationGraph } from '../types/index.js';
2
+ export type FrameworkRuleCategory = 'framework-adapter' | 'unhandled-framework' | 'library';
3
+ export interface FrameworkDetectionRule {
4
+ label: string;
5
+ deps: readonly string[];
6
+ category: FrameworkRuleCategory;
7
+ /** Matches `ConventionSet.framework` when `category === 'framework-adapter'`. */
8
+ conventionSetId?: string;
9
+ }
10
+ export declare const FRAMEWORK_DETECTION_RULES: readonly FrameworkDetectionRule[];
11
+ export declare function detectFrameworkRulesFromDependencies(deps: Iterable<string>): FrameworkDetectionRule[];
12
+ export declare function detectFrameworkRulesFromPackageJson(pkgJsonPath: string): FrameworkDetectionRule[];
13
+ export declare function detectFrameworksFromPackageJson(pkgJsonPath: string): string[];
14
+ export type FrameworkWarningKind = 'UNHANDLED_FRAMEWORK' | 'SUSPECTED_CUSTOM_CONVENTION' | 'UNRESOLVED_CONVENTION_CONFIG';
15
+ export interface FrameworkCoverageWarning {
16
+ kind: FrameworkWarningKind;
17
+ packageName: string;
18
+ packagePath: string;
19
+ framework: string;
20
+ conventionSetId?: string;
21
+ configFile?: string;
22
+ configKey?: string;
23
+ message: string;
24
+ }
25
+ export interface PackageFrameworkCoverage {
26
+ packageName: string;
27
+ packagePath: string;
28
+ frameworks: string[];
29
+ supportedAdapters: string[];
30
+ unhandledFrameworks: string[];
31
+ }
32
+ export interface UnextractedExportRecord {
33
+ filePath: string;
34
+ lineNumber: number;
35
+ exportName: string;
36
+ exportSyntax: string;
37
+ snippet: string;
38
+ }
39
+ export interface FrameworkCoverageReport {
40
+ packages: PackageFrameworkCoverage[];
41
+ warnings: FrameworkCoverageWarning[];
42
+ /**
43
+ * Source files in USER scope (`analyzedFiles`) that produced 0 extracted Contracts,
44
+ * 0 Class/Namespace boundaries, and 0 originating Relationships (Signal 4: Dark Files).
45
+ */
46
+ darkFiles: string[];
47
+ /**
48
+ * Top-level non-type, non-scalar `export` declarations in USER-scope source files that did not
49
+ * produce any `CONTRACT` or `CLASS`/`NAMESPACE` `BOUNDARY` node (even if the file is only
50
+ * partially dark or no other file imports the export).
51
+ */
52
+ unextractedExports: UnextractedExportRecord[];
53
+ }
54
+ import { findDarkFiles } from './shapeResolution.js';
55
+ export { findDarkFiles };
56
+ /**
57
+ * Inspects every USER-scope source file (`analyzedFiles`) and returns top-level non-type,
58
+ * non-scalar `export` declarations (`export const x = factory(...)`, `export const cfg = { ... }`,
59
+ * `export default ...`) that did not produce any `CONTRACT` or `CLASS`/`NAMESPACE` `BOUNDARY` node.
60
+ *
61
+ * Catches unhandled export patterns even when:
62
+ * 1. The file is only partially dark (another export or `INIT_BLOCK` edge made the file active).
63
+ * 2. No other file in the repository imports the export yet.
64
+ */
65
+ export declare function findUnextractedExports(repoRoot: string, graph: Pick<RepresentationGraph, 'nodes' | 'edges' | 'analyzedFiles'>): UnextractedExportRecord[];
66
+ /**
67
+ * Evaluates a repository's `package.json` dependencies and convention configs against the extracted
68
+ * `RepresentationGraph` to surface accuracy warnings for unhandled frameworks, suspected custom
69
+ * conventions (0 framework contracts extracted despite the framework dependency), and dynamic
70
+ * convention config values.
71
+ */
72
+ export declare function auditFrameworkCoverage(repoRoot: string, graph: Pick<RepresentationGraph, 'nodes' | 'edges' | 'analyzedFiles'>, excludeWorkspaces?: readonly string[]): FrameworkCoverageReport;