@tipolink/mcp 1.0.2 → 1.0.8

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.
@@ -4,10 +4,16 @@ export interface ScanWorkspaceOptions {
4
4
  cachePath?: string;
5
5
  workspaceId?: string;
6
6
  writeCache?: boolean;
7
+ disableRootHoisting?: boolean;
8
+ }
9
+ export interface HoistedWorkspaceRoot {
10
+ canonicalRoot: string;
11
+ subScopePrefix: string | null;
7
12
  }
8
13
  export interface ScanWorkspaceResult {
9
14
  workspaceId: string;
10
15
  rootDir: string;
16
+ subScopePrefix: string | null;
11
17
  cachePath: string;
12
18
  schemaVersion: string;
13
19
  schemaInvalidated: boolean;
@@ -25,6 +31,19 @@ export interface ScanWorkspaceResult {
25
31
  */
26
32
  export declare function computeManifestSyncHash(manifest: FileAstManifest): string;
27
33
  export declare function deriveWorkspaceId(rootDir: string): string;
34
+ /**
35
+ * Walks upward from `inputDir` to locate the highest enclosing monorepo / repository root
36
+ * containing `.git` (folder or worktree file), `pnpm-workspace.yaml`, `.tipolink/cloud-sync.json`,
37
+ * or `tsconfig.base.json` (stopping at `process.env.TIPOLINK_WORKSPACE_ROOT` when `inputDir` lies inside it).
38
+ * Returns `{ canonicalRoot, subScopePrefix }` where `subScopePrefix` is e.g. `"packages/server/src/"`
39
+ * when `inputDir` is a sub-directory beneath `canonicalRoot`, or `null` when already at root.
40
+ */
41
+ export declare function hoistToCanonicalWorkspaceRoot(inputDir: string): HoistedWorkspaceRoot;
42
+ /**
43
+ * Removes orphan nested `.tipolink/` directories inside sub-directories beneath `canonicalRoot`
44
+ * while strictly preserving `<canonicalRoot>/.tipolink/`.
45
+ */
46
+ export declare function cleanupNestedTipolinkDirs(canonicalRoot: string, extraSubDir?: string): string[];
28
47
  /**
29
48
  * Strips any unexpected fields and returns a strictly privacy-safe FileAstManifest
30
49
  * containing only paths, hashes, language, import specifiers (with pre-resolved targets),
@@ -34,7 +53,8 @@ export declare function deriveWorkspaceId(rootDir: string): string;
34
53
  export declare function sanitizeManifest(manifest: FileAstManifest): FileAstManifest;
35
54
  /**
36
55
  * Privacy-safe local AST scanner using @tipolink/engine.
37
- * Reads/writes `.tipolink/cache.json`, checks mtimeMs, size, and contentSha256,
38
- * and returns only sanitized FileAstManifest[] plus the resolved WorkspaceIndex.
56
+ * Automatically hoists sub-directory paths to the canonical monorepo/workspace root,
57
+ * removes orphan nested `.tipolink/` folders, reads/writes `<canonicalRoot>/.tipolink/cache.json`,
58
+ * checks mtimeMs, size, and contentSha256, and returns only sanitized FileAstManifest[] plus WorkspaceIndex.
39
59
  */
40
60
  export declare function scanWorkspaceManifests(rootDir: string, options?: ScanWorkspaceOptions): ScanWorkspaceResult;