@anysphere/file-service 0.0.0-9fee5ff4 → 0.0.0-a03a4659

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 (3) hide show
  1. package/index.d.ts +35 -11
  2. package/index.js +2 -3
  3. package/package.json +8 -8
package/index.d.ts CHANGED
@@ -16,6 +16,12 @@ export interface WalkDirConfig {
16
16
  maxNumFiles: number
17
17
  logFilePath?: string
18
18
  blocklistPath?: string
19
+ unifiedJsonBlocklistPath?: string
20
+ }
21
+ export interface LocalCodebaseFileInfo {
22
+ unencryptedRelativePath: string
23
+ hash: string
24
+ children?: Array<LocalCodebaseFileInfo>
19
25
  }
20
26
  export interface CommitData {
21
27
  sha: string
@@ -47,11 +53,6 @@ export interface VerifyData {
47
53
  fileContent: string
48
54
  filePath: string
49
55
  }
50
- export interface Candidate {
51
- path: string
52
- locations: Array<number>
53
- weight: number
54
- }
55
56
  export declare class DiffClient {
56
57
  constructor()
57
58
  diff(text1: string, text2: string): Array<DiffChunk>
@@ -70,6 +71,7 @@ export declare class MerkleClient {
70
71
  build(allowIncremental: boolean, config: WalkDirConfig): Promise<void>
71
72
  getSubtreeHash(relativePath: string): Promise<string>
72
73
  getNumEmbeddableFiles(): Promise<number>
74
+ getSimhash(): Promise<Float32Array>
73
75
  getImportantPaths(k: number): Promise<Array<string>>
74
76
  getAllFiles(): Promise<Array<string>>
75
77
  getAllDirFilesToEmbed(absoluteFilePath: string): Promise<Array<string>>
@@ -77,6 +79,8 @@ export declare class MerkleClient {
77
79
  onDidChange(absoluteFilePath: string): void
78
80
  onDidDelete(absoluteFilePath: string): void
79
81
  static enableTracing(): void
82
+ getTreeStructure(): Promise<LocalCodebaseFileInfo | null>
83
+ quitNow(): void
80
84
  }
81
85
  export declare class GitClient {
82
86
  constructor(absoluteRootDirectory: string)
@@ -87,10 +91,30 @@ export declare class GitClient {
87
91
  getRepoHeadSha(): Promise<string | null>
88
92
  getCommitChain(hash: string, depth: number, getFiles: CommitChainGetFiles): Promise<Array<CommitData>>
89
93
  }
90
- export declare class GitFile {
91
- findSimilarFiles(lineno: number): Promise<Array<Candidate>>
92
- }
93
- export declare class LocalGitGraph {
94
- constructor(repo: string)
95
- openFile(path: string): Promise<GitFile>
94
+ export declare class GitGraph {
95
+ constructor(repo: string, globalCursorIgnoreLegacy?: string | undefined | null, globalCursorJsonUnifiedBlocklist?: string | undefined | null)
96
+ /**
97
+ * Get a list of all paths in this repository, up to a maximum depth of `max_depth`. The
98
+ * paths are returned breadth-first, meaning that all paths at depth 0 are returned before any
99
+ * paths at depth 1, and so on.
100
+ * The iteration takes into account `gitignore` and `cursorignore` rules.
101
+ *
102
+ * @param maxDepth - maximum depth to search for paths. A depth of 0 means only the root path
103
+ * is returned.
104
+ * @param limit - maximum number of paths to return. If `None`, all paths are returned.
105
+ */
106
+ getBfsPaths(maxDepth: number, limit?: number | undefined | null): Promise<Array<string>>
107
+ /**
108
+ * Get a sorted list of relevant paths in this repository, from most relevant to least
109
+ * relevant. The list is biased towards the current user, using a heuristic that takes into account
110
+ * the most recently opened/edited files in the editor, which must be passed in as
111
+ * `lastEditedFiles`. If no recent files are provided, the returned paths will be sorted
112
+ * based on the global popularity of the files in the repository (i.e. the number of times each
113
+ * file has been modified throughout the Git history).
114
+ *
115
+ * @param lastEditedFiles - list of files that were recently opened/edited in the editor.
116
+ * @param maxCommits - maximum number of commits to consider when calculating the relevant paths.
117
+ * @param maxPaths - number of relevant paths to return
118
+ */
119
+ getRelevantPaths(lastEditedFiles: Array<string>, maxCommits: number, maxPaths: number): Promise<Array<string>>
96
120
  }
package/index.js CHANGED
@@ -310,7 +310,7 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { DiffType, DiffClient, MerkleClient, GitClient, CommitFileStatus, CommitChainGetFiles, GitFile, LocalGitGraph } = nativeBinding
313
+ const { DiffType, DiffClient, MerkleClient, GitClient, CommitFileStatus, CommitChainGetFiles, GitGraph } = nativeBinding
314
314
 
315
315
  module.exports.DiffType = DiffType
316
316
  module.exports.DiffClient = DiffClient
@@ -318,5 +318,4 @@ module.exports.MerkleClient = MerkleClient
318
318
  module.exports.GitClient = GitClient
319
319
  module.exports.CommitFileStatus = CommitFileStatus
320
320
  module.exports.CommitChainGetFiles = CommitChainGetFiles
321
- module.exports.GitFile = GitFile
322
- module.exports.LocalGitGraph = LocalGitGraph
321
+ module.exports.GitGraph = GitGraph
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anysphere/file-service",
3
- "version": "0.0.0-9fee5ff4",
3
+ "version": "0.0.0-a03a4659",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "napi": {
@@ -40,12 +40,12 @@
40
40
  "version": "napi version"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@anysphere/file-service-win32-x64-msvc": "0.0.0-9fee5ff4",
44
- "@anysphere/file-service-darwin-x64": "0.0.0-9fee5ff4",
45
- "@anysphere/file-service-linux-x64-gnu": "0.0.0-9fee5ff4",
46
- "@anysphere/file-service-darwin-arm64": "0.0.0-9fee5ff4",
47
- "@anysphere/file-service-win32-arm64-msvc": "0.0.0-9fee5ff4",
48
- "@anysphere/file-service-darwin-universal": "0.0.0-9fee5ff4",
49
- "@anysphere/file-service-linux-arm64-gnu": "0.0.0-9fee5ff4"
43
+ "@anysphere/file-service-win32-x64-msvc": "0.0.0-a03a4659",
44
+ "@anysphere/file-service-darwin-x64": "0.0.0-a03a4659",
45
+ "@anysphere/file-service-linux-x64-gnu": "0.0.0-a03a4659",
46
+ "@anysphere/file-service-darwin-arm64": "0.0.0-a03a4659",
47
+ "@anysphere/file-service-win32-arm64-msvc": "0.0.0-a03a4659",
48
+ "@anysphere/file-service-darwin-universal": "0.0.0-a03a4659",
49
+ "@anysphere/file-service-linux-arm64-gnu": "0.0.0-a03a4659"
50
50
  }
51
51
  }