feat(pi-natives): added unified picker coordination for file search operations
- Added `wait_for_picker_scan()` function to search_db module with cancellation token support for polling picker scan completion. - Integrated picker-based file search into glob matching logic with `collect_files_from_picker()` helper to reuse shared SearchDb picker results. - Refactored fff and grep modules to use centralized `wait_for_picker_scan()` wrapper instead of direct FilePicker calls, improving cancellation handling. - Propagated SearchDb instance through agent session initialization and input controller to enable unified file picker coordination across search operations.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
import path from "node:path";
|
||||
import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
||||
import type { SearchDb } from "@oh-my-pi/pi-natives";
|
||||
import { logger, untilAborted } from "@oh-my-pi/pi-utils";
|
||||
import type { TSchema } from "@sinclair/typebox";
|
||||
import Ajv, { type ValidateFunction } from "ajv";
|
||||
@@ -147,6 +148,7 @@ export interface ExecutorOptions {
|
||||
mcpManager?: MCPManager;
|
||||
authStorage?: AuthStorage;
|
||||
modelRegistry?: ModelRegistry;
|
||||
searchDb?: SearchDb;
|
||||
settings?: Settings;
|
||||
}
|
||||
|
||||
@@ -950,6 +952,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
cwd: worktree ?? cwd,
|
||||
authStorage,
|
||||
modelRegistry,
|
||||
searchDb: options.searchDb,
|
||||
settings: subagentSettings,
|
||||
model,
|
||||
thinkingLevel: effectiveThinkingLevel,
|
||||
@@ -1042,6 +1045,7 @@ export async function runSubprocess(options: ExecutorOptions): Promise<SingleRes
|
||||
},
|
||||
{
|
||||
getModel: () => session.model,
|
||||
getSearchDb: () => session.searchDb,
|
||||
isIdle: () => !session.isStreaming,
|
||||
abort: () => session.abort(),
|
||||
hasPendingMessages: () => session.queuedMessageCount > 0,
|
||||
|
||||
Reference in New Issue
Block a user