@getchomp/mcp 0.0.0-stage → 0.2.42

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 (56) hide show
  1. package/README.md +15 -2
  2. package/dist/conventionsReference.d.ts +84 -0
  3. package/dist/conventionsReference.js +313 -0
  4. package/dist/designSystem/astScanner.d.ts +153 -0
  5. package/dist/designSystem/astScanner.js +2014 -0
  6. package/dist/designSystem/baseline.d.ts +65 -0
  7. package/dist/designSystem/baseline.js +136 -0
  8. package/dist/designSystem/color.d.ts +35 -0
  9. package/dist/designSystem/color.js +265 -0
  10. package/dist/designSystem/config.d.ts +183 -0
  11. package/dist/designSystem/config.js +469 -0
  12. package/dist/designSystem/contrast.d.ts +55 -0
  13. package/dist/designSystem/contrast.js +377 -0
  14. package/dist/designSystem/cssParser.d.ts +63 -0
  15. package/dist/designSystem/cssParser.js +469 -0
  16. package/dist/designSystem/merges.d.ts +57 -0
  17. package/dist/designSystem/merges.js +94 -0
  18. package/dist/designSystem/preprocessors.d.ts +46 -0
  19. package/dist/designSystem/preprocessors.js +1108 -0
  20. package/dist/designSystem/presentation.d.ts +45 -0
  21. package/dist/designSystem/presentation.js +796 -0
  22. package/dist/designSystem/styleVectors.d.ts +27 -0
  23. package/dist/designSystem/styleVectors.js +484 -0
  24. package/dist/designSystem/tokens.d.ts +39 -0
  25. package/dist/designSystem/tokens.js +409 -0
  26. package/dist/designSystem/topology.d.ts +64 -0
  27. package/dist/designSystem/topology.js +254 -0
  28. package/dist/designSystem/types.d.ts +857 -0
  29. package/dist/designSystem/types.js +113 -0
  30. package/dist/designSystem/typography.d.ts +25 -0
  31. package/dist/designSystem/typography.js +244 -0
  32. package/dist/designSystem/uiShapes.d.ts +74 -0
  33. package/dist/designSystem/uiShapes.js +285 -0
  34. package/dist/designSystem/valueClusters.d.ts +76 -0
  35. package/dist/designSystem/valueClusters.js +281 -0
  36. package/dist/designSystemPlugin.d.ts +321 -0
  37. package/dist/designSystemPlugin.js +4730 -0
  38. package/dist/enrichNodesPlugin.d.ts +160 -0
  39. package/dist/enrichNodesPlugin.js +957 -0
  40. package/dist/index.d.ts +65 -0
  41. package/dist/index.js +1298 -0
  42. package/dist/intelligence.d.ts +502 -0
  43. package/dist/intelligence.js +3058 -0
  44. package/dist/pluginRunner.d.ts +364 -0
  45. package/dist/pluginRunner.js +1096 -0
  46. package/dist/plugins/design-system/index.d.ts +14 -0
  47. package/dist/plugins/design-system/index.js +241 -0
  48. package/dist/plugins/enrich-nodes/index.d.ts +388 -0
  49. package/dist/plugins/enrich-nodes/index.js +697 -0
  50. package/dist/plugins/index.d.ts +15 -0
  51. package/dist/plugins/index.js +20 -0
  52. package/dist/plugins/local-shims/index.d.ts +121 -0
  53. package/dist/plugins/local-shims/index.js +237 -0
  54. package/dist/shimsPlugin.d.ts +134 -0
  55. package/dist/shimsPlugin.js +1392 -0
  56. package/package.json +38 -3
@@ -0,0 +1,65 @@
1
+ import { type ChompStorage } from "@getchomp/db";
2
+ import { type GraphDelta, type RepresentationGraph } from "@getchomp/core";
3
+ import "./plugins/index.js";
4
+ export { auditGraphHealth, buildActiveViewUrl, checkGraphBoundaries, computeBlastRadius, filterNodesForMcp, findGraphRedundancies, formatEnrichNodesSummary, hydrateNodeOverlays, packageMatchesFilter, resolveViewNodeIds, resolveViewTargetAltitude, type ActiveViewLevel, type CrossPkgEdgeDetail, type ImpactHop, type NodeSummaryRef, type ResolvedViewTargetAltitude, } from "./intelligence.js";
5
+ export { PLUGINS_STATE_DIR_REL, PLUGIN_LAST_RUN_FILENAME, applyActivePluginProjections, buildOverlayEvidence, collectPluginRepoFiles, collectPluginStateFiles, computeFileOverlayHash, defineChompPlugin, discoverPluginsInDir, getChompPlugin, getPluginEnvStatus, getPluginLastRunPath, getPluginMcpToolSummaries, getPluginSettingsPath, getPluginStateDir, getPluginStateDirRel, getRegisteredPluginDefaultLayers, isPluginLayerEnabled, isRegisteredStructuralPluginOverlay, listChompPlugins, loadPluginSettings, readPluginLastRun, readRepoOverlayLayerToggles, registerChompPlugin, resolveActiveUiBaseUrl, resolvePluginSecret, resolveRepoGitBranch, resolveRepoName, runAllChompPlugins, runChompPlugin, savePluginSettings, unregisterChompPlugin, writePluginActiveView, writePluginLastRun, type ChompCliAnsiHelpers, type ChompPlugin, type ChompPluginContext, type ChompPluginExtractResult, type ChompPluginMcpTool, type ChompPluginMcpToolResult, type ChompPluginProjectionContext, type ChompPluginProjectionOverlayLike, type ChompPluginToolContext, type PersistedPluginRunRecord, type PluginActiveViewRequest, type RunAllChompPluginsOptions, type RunChompPluginOptions, type RunChompPluginResult, } from "./pluginRunner.js";
6
+ export { BUILTIN_PLUGINS_DIR, discoverBuiltInPlugins } from "./plugins/index.js";
7
+ export { analyzeRepositoryDesignSystem, auditDesignSystem, classifyTokenTier, computeRelativeLuminance, computeWcagContrastRatio, createDesignSystemPlugin, designSystemPlugin, diffDesignSystem, evaluateContrast, frontendPackageLabels, parseCssColorString, parseCssStylesheet, type AtomicConsolidationCandidate, type ComponentDesignProfile, type ComponentHealthSummary, type ComponentUiKind, type ContrastAuditItem, type CssTokenDeclaration, type DesignSystemAnalysisReport, type DesignSystemDiffResult, snapshotDesignSystemBaseline, type DuplicateTokenDiagnostic, type InboundCallSiteRecord, type SimilarComponentMatch, type TokenCategory, type TokenRegistryEntry, type TokenSimilarMatch, type TypographySubCategory, type UndefinedTokenDiagnostic, } from "./designSystemPlugin.js";
8
+ export { DEFAULT_MERGE_DECISIONS_REL, buildMergeDecisionId, readMergeDecisions, removeMergeDecision, resolveMergeDecisionsPath, upsertMergeDecision, type DesignSystemMergeDecision, type DesignSystemMergeKind, type UpsertMergeDecisionInput, } from "./designSystem/merges.js";
9
+ export { LEGACY_LOCAL_SHIMS_FILE_REL, LOCAL_SHIMS_FILE_REL, LOCAL_SHIMS_PLUGIN_NAME, deriveShimId, evaluateShimsAgainstGraph, loadLocalShimsFromTexts, localShimsPlugin, manageLocalShims, type LocalGraphShim, type LocalGraphShimInput, type LocalShimsAction, type LocalShimsManifest, type LocalTargetConnectorSpec, type ManageLocalShimsOptions, type ResolvedShimRecord, type SuggestedShimCandidate, type UnmatchedShimRecord, } from "./shimsPlugin.js";
10
+ export { ENRICH_NODES_PLUGIN_NAME, SEMANTIC_OVERLAY_LAYER, SEMANTIC_SIDECAR_FILENAME, SEMANTIC_SIDECAR_FILE_REL, buildEnrichmentQueue, buildEnrichmentStatus, classifySemanticOverlayMap, enrichNodesPlugin, isEnrichmentTargetNode, mergeNodesIntoSemanticSidecar, readSemanticSidecar, writeSemanticSidecar, } from "./enrichNodesPlugin.js";
11
+ export { getConventionsReference, type BuiltInFrameworkCatalog, type ConventionSignalKind, type ConventionsReferenceReport, type GetConventionsReferenceOptions, type ShapeKeyRemediationAdvice, type SignalRemediationPlaybookEntry, type UserConventionSetStatus, } from "./conventionsReference.js";
12
+ export declare function resolveActiveMcpRepo(fallbackTargetPath?: string): {
13
+ repoPath: string;
14
+ repoName: string;
15
+ repoId: string;
16
+ dbPath: string;
17
+ };
18
+ /**
19
+ * Executes an async callback against a `ChompStorage` instance and guarantees
20
+ * `await storage.close()` in a `finally` block even when `fn` throws.
21
+ */
22
+ export declare function withStorage<T>(dbPath: string, fn: (storage: ChompStorage) => Promise<T>, storageFactory?: (dbPath: string) => ChompStorage): Promise<T>;
23
+ /**
24
+ * Invalidates the in-memory MCP `RepresentationGraph` cache (either for a
25
+ * specific `dbPath` or across all cached repositories).
26
+ */
27
+ export declare function invalidateMcpGraphCache(dbPath?: string): void;
28
+ /**
29
+ * Loads `RepresentationGraph` for `(dbPath, repoId)` with an in-memory cache
30
+ * invalidated whenever `dbPath` (or `${dbPath}-wal`) mtime changes.
31
+ */
32
+ export declare function loadActiveGraphCached(dbPath: string, repoId: string, storageFactory?: (dbPath: string) => ChompStorage): Promise<RepresentationGraph | null>;
33
+ /**
34
+ * Checks `.chomp/rules.json` to see whether the `L1_SHIMS` plugin overlay layer is enabled
35
+ * (defaults to `true` when unset or when `.chomp/rules.json` does not exist).
36
+ */
37
+ export declare function isShimLayerEnabled(repoPath: string): boolean;
38
+ /**
39
+ * Loads the persisted `RepresentationGraph` for `(dbPath, repoId)` and runs every enabled
40
+ * registered plugin's `projectGraph` hook (e.g. `local-shims` `L1_SHIMS` overlays and `.chomp/plugins/<name>/` files).
41
+ */
42
+ export declare function loadActiveGraphWithShims(repoPath: string, dbPath: string, repoId: string, storageFactory?: (dbPath: string) => ChompStorage): Promise<RepresentationGraph | null>;
43
+ /**
44
+ * Computes structural delta between the saved base graph (projected with baseline plugin files at
45
+ * `baseGraph.commitSha` when available) and the live working tree (`analyzeTarget` + active plugin projections).
46
+ * Checks staleness (`[PAT-DB-03]`, Principle of Incomplete Truth) before reporting a delta.
47
+ */
48
+ export declare function computeGraphDeltaWithShims(repoPath: string, dbPath: string, repoId: string, storageFactory?: (dbPath: string) => ChompStorage): Promise<GraphDelta>;
49
+ export declare function computeGitRefDeltaWithShims(repoPath: string, options?: {
50
+ baseRef?: string;
51
+ targetRef?: string;
52
+ dbPath?: string;
53
+ }): Promise<GraphDelta & {
54
+ baseRef: string;
55
+ targetRef: string;
56
+ isWorkingTreeSnapshot: boolean;
57
+ snapshotAt?: string;
58
+ }>;
59
+ /**
60
+ * Wraps an MCP tool handler so uncaught errors return a structured
61
+ * `{ isError: true, content: [{ type: "text", text }] }` payload rather than
62
+ * crashing the stdio transport or leaking resources.
63
+ */
64
+ export declare function withMcpToolErrorBoundary<A>(handler: (args: A) => Promise<any>): (args: A) => Promise<any>;
65
+ export declare function runMcpServer(targetPath?: string): Promise<void>;