MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / runSearchPreflight

Function runSearchPreflight

src/eval/edit-preflight-harness.ts:132–160  ·  view source on GitHub ↗
(
  task: EditPreflightTask,
  rootPath: string
)

Source from the content-addressed store, hash-verified

130}
131
132async function runSearchPreflight(
133 task: EditPreflightTask,
134 rootPath: string
135): Promise<EditPreflightResponse> {
136 const project = createProjectState(rootPath);
137 project.indexState.status = 'ready';
138
139 const response = await searchCodebaseHandle(
140 {
141 query: task.query,
142 intent: 'edit',
143 limit: task.limit ?? 5
144 },
145 {
146 indexState: project.indexState,
147 paths: project.paths,
148 rootPath: project.rootPath,
149 performIndexing: () => undefined
150 }
151 );
152 const payload = response.content?.[0]?.text ?? '{}';
153 const parsed = JSON.parse(payload) as unknown;
154
155 if (typeof parsed === 'object' && parsed !== null) {
156 return parsed as EditPreflightResponse;
157 }
158
159 return {};
160}
161
162export async function evaluateEditPreflightFixture({
163 fixture,

Callers

nothing calls this directly

Calls 1

createProjectStateFunction · 0.85

Tested by

no test coverage detected