Skip to content

workspaces.find_file

Files across the workspace folder and its git working trees: strict name/path lookup or fuzzy path search (DMN-092).

/** `workspaces.find_file` params (DMN-092). */
export type FindFileParams = {
/** Search every eligible workspace file before applying the result limit; empty query lists candidates. */
fuzzy?: boolean;
/** A bare/partial path, or with `fuzzy`, a case-insensitive subsequence of a workspace-relative path. */
query: string;
/** A thread of the workspace: files its tool cards name rank first among candidates of the same match. */
threadId?: string | null;
workspaceId: string;
};
/** The result of `workspaces.find_file` (DMN-092): the candidates, best first. */
export type FileCandidates = {
/** At most 50. */
candidates: FileCandidate[];
/** More files matched than were returned. */
truncated?: boolean;
};
/** A file found by `workspaces.find_file` (DMN-092). */
export type FileCandidate = {
match: FileMatch;
/** A tool card of the given thread names the file. */
mentioned?: boolean;
/** Relative to the workspace folder (what `workspaces.read_file` takes). */
path: string;
/** The name of the git working tree holding the file, as in `FileContent`; absent outside every repository. */
repo?: string | null;
};
/** How a candidate of `workspaces.find_file` matches the query (DMN-092), best first. */
export type FileMatch =
/** The query is the file's path relative to the workspace folder or to the git working tree holding it. */
| "exact"
/** The file's path ends with the query, which has a `/`. */
| "suffix"
/** The file's name is the query's last component. */
| "basename"
/** The query's non-whitespace characters are a case-insensitive subsequence of the workspace-relative path. */
| "fuzzy";