pi-compass 0.2.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/README.md +74 -0
- package/dist/analyzers/build-script-detector.d.ts +3 -0
- package/dist/analyzers/build-script-detector.d.ts.map +1 -0
- package/dist/analyzers/build-script-detector.js +75 -0
- package/dist/analyzers/build-script-detector.js.map +1 -0
- package/dist/analyzers/convention-detector.d.ts +3 -0
- package/dist/analyzers/convention-detector.d.ts.map +1 -0
- package/dist/analyzers/convention-detector.js +47 -0
- package/dist/analyzers/convention-detector.js.map +1 -0
- package/dist/analyzers/directory-tree.d.ts +4 -0
- package/dist/analyzers/directory-tree.d.ts.map +1 -0
- package/dist/analyzers/directory-tree.js +60 -0
- package/dist/analyzers/directory-tree.js.map +1 -0
- package/dist/analyzers/entry-point-detector.d.ts +3 -0
- package/dist/analyzers/entry-point-detector.d.ts.map +1 -0
- package/dist/analyzers/entry-point-detector.js +87 -0
- package/dist/analyzers/entry-point-detector.js.map +1 -0
- package/dist/analyzers/framework-detector.d.ts +3 -0
- package/dist/analyzers/framework-detector.d.ts.map +1 -0
- package/dist/analyzers/framework-detector.js +63 -0
- package/dist/analyzers/framework-detector.js.map +1 -0
- package/dist/analyzers/index.d.ts +8 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +8 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/analyzers/key-file-detector.d.ts +3 -0
- package/dist/analyzers/key-file-detector.d.ts.map +1 -0
- package/dist/analyzers/key-file-detector.js +32 -0
- package/dist/analyzers/key-file-detector.js.map +1 -0
- package/dist/analyzers/package-detector.d.ts +3 -0
- package/dist/analyzers/package-detector.d.ts.map +1 -0
- package/dist/analyzers/package-detector.js +78 -0
- package/dist/analyzers/package-detector.js.map +1 -0
- package/dist/codemap-formatter.d.ts +4 -0
- package/dist/codemap-formatter.d.ts.map +1 -0
- package/dist/codemap-formatter.js +72 -0
- package/dist/codemap-formatter.js.map +1 -0
- package/dist/codemap-generator.d.ts +10 -0
- package/dist/codemap-generator.d.ts.map +1 -0
- package/dist/codemap-generator.js +80 -0
- package/dist/codemap-generator.js.map +1 -0
- package/dist/codemap-injector.d.ts +12 -0
- package/dist/codemap-injector.d.ts.map +1 -0
- package/dist/codemap-injector.js +20 -0
- package/dist/codemap-injector.js.map +1 -0
- package/dist/fs-utils.d.ts +3 -0
- package/dist/fs-utils.d.ts.map +1 -0
- package/dist/fs-utils.js +21 -0
- package/dist/fs-utils.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/onboard-command.d.ts +5 -0
- package/dist/onboard-command.d.ts.map +1 -0
- package/dist/onboard-command.js +33 -0
- package/dist/onboard-command.js.map +1 -0
- package/dist/onboard-tools.d.ts +4 -0
- package/dist/onboard-tools.d.ts.map +1 -0
- package/dist/onboard-tools.js +77 -0
- package/dist/onboard-tools.js.map +1 -0
- package/dist/project.d.ts +4 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +20 -0
- package/dist/project.js.map +1 -0
- package/dist/storage.d.ts +12 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +46 -0
- package/dist/storage.js.map +1 -0
- package/dist/tour-command.d.ts +5 -0
- package/dist/tour-command.d.ts.map +1 -0
- package/dist/tour-command.js +26 -0
- package/dist/tour-command.js.map +1 -0
- package/dist/tour-generator.d.ts +6 -0
- package/dist/tour-generator.d.ts.map +1 -0
- package/dist/tour-generator.js +204 -0
- package/dist/tour-generator.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +71 -0
- package/src/analyzers/build-script-detector.ts +85 -0
- package/src/analyzers/convention-detector.ts +52 -0
- package/src/analyzers/directory-tree.ts +65 -0
- package/src/analyzers/entry-point-detector.ts +98 -0
- package/src/analyzers/framework-detector.ts +76 -0
- package/src/analyzers/index.ts +7 -0
- package/src/analyzers/key-file-detector.ts +36 -0
- package/src/analyzers/package-detector.ts +87 -0
- package/src/codemap-formatter.ts +90 -0
- package/src/codemap-generator.ts +110 -0
- package/src/codemap-injector.ts +44 -0
- package/src/fs-utils.ts +19 -0
- package/src/index.ts +90 -0
- package/src/onboard-command.ts +60 -0
- package/src/onboard-tools.ts +116 -0
- package/src/project.ts +29 -0
- package/src/storage.ts +82 -0
- package/src/tour-command.ts +50 -0
- package/src/tour-generator.ts +237 -0
- package/src/types.ts +104 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export interface ProjectInfo {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly root: string;
|
|
5
|
+
readonly remote: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface DirectoryEntry {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly type: "file" | "dir";
|
|
11
|
+
readonly children?: readonly DirectoryEntry[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type PackageManager = "npm" | "cargo" | "go" | "pip" | "poetry" | "gradle" | "maven" | "composer" | "bundler" | "mix";
|
|
15
|
+
|
|
16
|
+
export interface PackageInfo {
|
|
17
|
+
readonly manager: PackageManager;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly version?: string;
|
|
20
|
+
readonly dependencies: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface FrameworkDetection {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly version?: string;
|
|
26
|
+
readonly confidence: "definite" | "likely";
|
|
27
|
+
readonly source: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type EntryPointKind = "main" | "index" | "route" | "handler" | "config";
|
|
31
|
+
|
|
32
|
+
export interface EntryPoint {
|
|
33
|
+
readonly path: string;
|
|
34
|
+
readonly kind: EntryPointKind;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface BuildScript {
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly command: string;
|
|
40
|
+
readonly source: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface Convention {
|
|
44
|
+
readonly source: string;
|
|
45
|
+
readonly content: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface KeyFile {
|
|
49
|
+
readonly path: string;
|
|
50
|
+
readonly description: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface CodeMap {
|
|
54
|
+
readonly projectId: string;
|
|
55
|
+
readonly projectName: string;
|
|
56
|
+
readonly generatedAt: string;
|
|
57
|
+
readonly contentHash: string;
|
|
58
|
+
readonly directoryTree: readonly DirectoryEntry[];
|
|
59
|
+
readonly packages: readonly PackageInfo[];
|
|
60
|
+
readonly frameworks: readonly FrameworkDetection[];
|
|
61
|
+
readonly entryPoints: readonly EntryPoint[];
|
|
62
|
+
readonly buildScripts: readonly BuildScript[];
|
|
63
|
+
readonly conventions: readonly Convention[];
|
|
64
|
+
readonly keyFiles: readonly KeyFile[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface TourStep {
|
|
68
|
+
readonly file: string;
|
|
69
|
+
readonly startLine?: number;
|
|
70
|
+
readonly endLine?: number;
|
|
71
|
+
readonly description: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface CodeTour {
|
|
75
|
+
readonly projectId: string;
|
|
76
|
+
readonly topic: string;
|
|
77
|
+
readonly generatedAt: string;
|
|
78
|
+
readonly steps: readonly TourStep[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface CacheEntry<T> {
|
|
82
|
+
readonly data: T;
|
|
83
|
+
readonly contentHash: string;
|
|
84
|
+
readonly createdAt: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface CompassConfig {
|
|
88
|
+
readonly max_injection_chars: number;
|
|
89
|
+
readonly inject_on_first_turn: boolean;
|
|
90
|
+
readonly cache_enabled: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface StateRef {
|
|
94
|
+
get: () => CompassState;
|
|
95
|
+
set: (s: CompassState) => void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface CompassState {
|
|
99
|
+
readonly project: ProjectInfo | null;
|
|
100
|
+
readonly turnCount: number;
|
|
101
|
+
readonly codemapInjected: boolean;
|
|
102
|
+
readonly cachedCodemap: CacheEntry<CodeMap> | null;
|
|
103
|
+
readonly stale: boolean;
|
|
104
|
+
}
|