@omfalos/mokosh 0.5.0 → 0.5.2

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Language-agnostic source tokenizer for duplicate-code detection. Strips per-language
3
- * comment syntax, then splits what remains into a normalized token stream shared by every
3
+ * comment syntax and import/using statements, then splits what remains into a normalized token stream shared by every
4
4
  * language `DEFAULT_EXTENSIONS` covers — one generic tokenizer rather than a per-language
5
5
  * lexer, so `findDuplicates` works uniformly across TS/JS, Python, Go, Java, Kotlin, Scala,
6
6
  * Groovy, CoffeeScript, LiveScript, Lua, Gherkin, style files, and Markdown.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Language-agnostic source tokenizer for duplicate-code detection. Strips per-language
3
- * comment syntax, then splits what remains into a normalized token stream shared by every
3
+ * comment syntax and import/using statements, then splits what remains into a normalized token stream shared by every
4
4
  * language `DEFAULT_EXTENSIONS` covers — one generic tokenizer rather than a per-language
5
5
  * lexer, so `findDuplicates` works uniformly across TS/JS, Python, Go, Java, Kotlin, Scala,
6
6
  * Groovy, CoffeeScript, LiveScript, Lua, Gherkin, style files, and Markdown.
@@ -23,6 +23,10 @@ interface ImportEdge {
23
23
  isWorkspace?: boolean | undefined;
24
24
  /** The workspace package name (e.g. `"@myorg/shared"`) when `isWorkspace` is true. */
25
25
  workspacePackage?: string | undefined;
26
+ /** True for the synthetic JVM same-package sibling edge (`<own-package>.*`) — a file's implicit coupling to its package siblings, not a written `import`. Structural analyses (cycle detection) skip these; blast-radius analyses keep them. */
27
+ isSamePackage?: boolean | undefined;
28
+ /** True for an edge minted from a Markdown doc's link or code-span file reference (ADR-009), not a written `import`. Structural analyses (cycle detection) skip these by default; doc-drift enrichment keeps them. */
29
+ isDocReference?: boolean | undefined;
26
30
  /** Fraction of the target's exports consumed by this import (0–1). Only present for internal non-side-effect imports where the target has at least one export. */
27
31
  exportUsageRatio?: number;
28
32
  }
@@ -71,6 +75,9 @@ interface FileNode extends GraphNode {
71
75
  cognitiveComplexity?: number;
72
76
  /** Per-function complexity breakdown. Covers named function declarations, const-assigned arrow/function expressions, and class methods/constructors/accessors — anonymous inline callbacks are not included. Only present for TypeScript/JavaScript files. */
73
77
  functions?: FunctionComplexity[];
78
+ /** Owning workspace package name. Not set by the builder or persisted — a query/output-time
79
+ * annotation stamped by `filterGraph`/handlers when results come from a flattened workspace graph. */
80
+ package?: string;
74
81
  }
75
82
 
76
83
  interface RawCallEdge {
@@ -23,6 +23,10 @@ interface ImportEdge {
23
23
  isWorkspace?: boolean | undefined;
24
24
  /** The workspace package name (e.g. `"@myorg/shared"`) when `isWorkspace` is true. */
25
25
  workspacePackage?: string | undefined;
26
+ /** True for the synthetic JVM same-package sibling edge (`<own-package>.*`) — a file's implicit coupling to its package siblings, not a written `import`. Structural analyses (cycle detection) skip these; blast-radius analyses keep them. */
27
+ isSamePackage?: boolean | undefined;
28
+ /** True for an edge minted from a Markdown doc's link or code-span file reference (ADR-009), not a written `import`. Structural analyses (cycle detection) skip these by default; doc-drift enrichment keeps them. */
29
+ isDocReference?: boolean | undefined;
26
30
  /** Fraction of the target's exports consumed by this import (0–1). Only present for internal non-side-effect imports where the target has at least one export. */
27
31
  exportUsageRatio?: number;
28
32
  }
@@ -71,6 +75,9 @@ interface FileNode extends GraphNode {
71
75
  cognitiveComplexity?: number;
72
76
  /** Per-function complexity breakdown. Covers named function declarations, const-assigned arrow/function expressions, and class methods/constructors/accessors — anonymous inline callbacks are not included. Only present for TypeScript/JavaScript files. */
73
77
  functions?: FunctionComplexity[];
78
+ /** Owning workspace package name. Not set by the builder or persisted — a query/output-time
79
+ * annotation stamped by `filterGraph`/handlers when results come from a flattened workspace graph. */
80
+ package?: string;
74
81
  }
75
82
 
76
83
  interface RawCallEdge {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omfalos/mokosh",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "A high-performance, AST-powered dependency graph generator for frontend projects, optimized for AI context and smart test selection.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -111,7 +111,7 @@ Use with `query({ root, filter: "..." })` via MCP or `--query "..."` via CLI. Al
111
111
 
112
112
  `category` values: `logic` · `ui` · `test` · `config` · `barrel` · `type-only` · `other`.
113
113
 
114
- `query` (MCP) defaults to `slim: true` — compact nodes with flat `importsFiles`, export names, and meaningful tags only. Tags are filtered to kinds `comment-marker` and `import`; `function`/`class`/`variable`/`type`/`library` tags are dropped in slim output. Call `list_tags` for the full tag inventory, or pass `slim: false` when full edge metadata is needed.
114
+ `query` (MCP) defaults to `slim: true` — compact nodes with flat `importsFiles`, export names, and meaningful tags only. Tags are filtered to kinds `comment-marker` and `import`; `function`/`class`/`variable`/`type`/`library` tags are dropped in slim output. Call `list_tags` to discover tag names (bounded; its `byKind` histogram shows per-kind totals, `kind`/`prefix`/`minCount` narrow it), or pass `slim: false` when full edge metadata is needed.
115
115
 
116
116
  Run `mokosh --query-help` (CLI) for the full reference at any time.
117
117
 
@@ -108,7 +108,7 @@ Use with `query({ root, filter: "..." })` via MCP or `--query "..."` via CLI. Al
108
108
 
109
109
  `category` values: `logic` · `ui` · `test` · `config` · `barrel` · `type-only` · `other`.
110
110
 
111
- `query` (MCP) defaults to `slim: true` — compact nodes with flat `importsFiles`, export names, and meaningful tags only. Tags are filtered to kinds `comment-marker` and `import`; `function`/`class`/`variable`/`type`/`library` tags are dropped in slim output. Call `list_tags` for the full tag inventory, or pass `slim: false` when full edge metadata is needed.
111
+ `query` (MCP) defaults to `slim: true` — compact nodes with flat `importsFiles`, export names, and meaningful tags only. Tags are filtered to kinds `comment-marker` and `import`; `function`/`class`/`variable`/`type`/`library` tags are dropped in slim output. Call `list_tags` to discover tag names (bounded; its `byKind` histogram shows per-kind totals, `kind`/`prefix`/`minCount` narrow it), or pass `slim: false` when full edge metadata is needed.
112
112
 
113
113
  Run `mokosh --query-help` (CLI) for the full reference at any time.
114
114