@kentwynn/kgraph 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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +200 -0
  3. package/dist/cli/commands/context.d.ts +2 -0
  4. package/dist/cli/commands/context.js +43 -0
  5. package/dist/cli/commands/init.d.ts +2 -0
  6. package/dist/cli/commands/init.js +10 -0
  7. package/dist/cli/commands/scan.d.ts +2 -0
  8. package/dist/cli/commands/scan.js +32 -0
  9. package/dist/cli/commands/update.d.ts +2 -0
  10. package/dist/cli/commands/update.js +19 -0
  11. package/dist/cli/errors.d.ts +5 -0
  12. package/dist/cli/errors.js +23 -0
  13. package/dist/cli/index.d.ts +3 -0
  14. package/dist/cli/index.js +21 -0
  15. package/dist/cognition/cognition-updater.d.ts +10 -0
  16. package/dist/cognition/cognition-updater.js +77 -0
  17. package/dist/cognition/markdown-note-parser.d.ts +2 -0
  18. package/dist/cognition/markdown-note-parser.js +71 -0
  19. package/dist/config/config.d.ts +5 -0
  20. package/dist/config/config.js +49 -0
  21. package/dist/context/context-query.d.ts +10 -0
  22. package/dist/context/context-query.js +42 -0
  23. package/dist/context/ranking.d.ts +10 -0
  24. package/dist/context/ranking.js +29 -0
  25. package/dist/scanner/file-classifier.d.ts +4 -0
  26. package/dist/scanner/file-classifier.js +24 -0
  27. package/dist/scanner/repo-scanner.d.ts +3 -0
  28. package/dist/scanner/repo-scanner.js +85 -0
  29. package/dist/scanner/ts-symbol-extractor.d.ts +8 -0
  30. package/dist/scanner/ts-symbol-extractor.js +99 -0
  31. package/dist/storage/cognition-store.d.ts +9 -0
  32. package/dist/storage/cognition-store.js +90 -0
  33. package/dist/storage/kgraph-paths.d.ts +7 -0
  34. package/dist/storage/kgraph-paths.js +65 -0
  35. package/dist/storage/map-store.d.ts +11 -0
  36. package/dist/storage/map-store.js +60 -0
  37. package/dist/types/cognition.d.ts +43 -0
  38. package/dist/types/cognition.js +1 -0
  39. package/dist/types/config.d.ts +24 -0
  40. package/dist/types/config.js +1 -0
  41. package/dist/types/maps.d.ts +62 -0
  42. package/dist/types/maps.js +1 -0
  43. package/package.json +54 -0
@@ -0,0 +1,62 @@
1
+ export type ScanStatus = "mapped" | "generic" | "failed";
2
+ export type DependencyKind = "local" | "package" | "unknown";
3
+ export type SymbolKind = "function" | "class" | "method" | "export" | "import";
4
+ export type RelationshipType = "import" | "contains" | "mentions" | "belongs-to-domain" | "stale-reference" | "moved-from";
5
+ export interface RepositoryFile {
6
+ id: string;
7
+ path: string;
8
+ extension: string;
9
+ language: string;
10
+ sizeBytes: number;
11
+ modifiedAt?: string;
12
+ contentHash: string;
13
+ scanStatus: ScanStatus;
14
+ warnings: string[];
15
+ }
16
+ export interface CodeSymbol {
17
+ id: string;
18
+ name: string;
19
+ kind: SymbolKind;
20
+ filePath: string;
21
+ startLine?: number;
22
+ endLine?: number;
23
+ exported: boolean;
24
+ parentName?: string;
25
+ }
26
+ export interface Dependency {
27
+ fromFile: string;
28
+ specifier: string;
29
+ resolvedFile?: string;
30
+ kind: DependencyKind;
31
+ }
32
+ export interface Relationship {
33
+ sourceType: string;
34
+ sourceId: string;
35
+ targetType: string;
36
+ targetId: string;
37
+ relationshipType: RelationshipType;
38
+ confidence: "high" | "medium" | "low";
39
+ }
40
+ export interface FileMap {
41
+ generatedAt: string;
42
+ files: RepositoryFile[];
43
+ }
44
+ export interface SymbolMap {
45
+ generatedAt: string;
46
+ symbols: CodeSymbol[];
47
+ }
48
+ export interface DependencyMap {
49
+ generatedAt: string;
50
+ dependencies: Dependency[];
51
+ }
52
+ export interface RelationshipMap {
53
+ generatedAt: string;
54
+ relationships: Relationship[];
55
+ }
56
+ export interface ScanResult {
57
+ files: RepositoryFile[];
58
+ symbols: CodeSymbol[];
59
+ dependencies: Dependency[];
60
+ relationships: Relationship[];
61
+ warnings: string[];
62
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@kentwynn/kgraph",
3
+ "version": "0.1.0",
4
+ "description": "Persistent repo intelligence for AI coding assistants.",
5
+ "type": "module",
6
+ "bin": {
7
+ "kgraph": "./dist/cli/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "clean": "node scripts/clean-dist.mjs",
16
+ "build": "npm run clean && tsc -p tsconfig.json",
17
+ "test": "vitest run",
18
+ "kgraph": "tsx src/cli/index.ts",
19
+ "check:artifacts": "node scripts/check-clean-artifacts.mjs",
20
+ "pack:dry": "npm pack --dry-run",
21
+ "release:pack": "npm run build && npm test && npm run check:artifacts && npm pack"
22
+ },
23
+ "keywords": [
24
+ "ai",
25
+ "code-intelligence",
26
+ "cli",
27
+ "repository",
28
+ "context"
29
+ ],
30
+ "author": "Kent Wynn",
31
+ "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/kentwynn/KGraph.git"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/kentwynn/KGraph/issues"
38
+ },
39
+ "homepage": "https://github.com/kentwynn/KGraph#readme",
40
+ "dependencies": {
41
+ "commander": "^12.1.0",
42
+ "fast-glob": "^3.3.2",
43
+ "yaml": "^2.5.1"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^20.17.10",
47
+ "tsx": "^4.19.2",
48
+ "typescript": "^5.7.2",
49
+ "vitest": "^2.1.8"
50
+ },
51
+ "engines": {
52
+ "node": ">=20"
53
+ }
54
+ }