Fix navigateTree API: add missing type updates, handler passthrough, and docs
- Update ExtensionCommandContext.navigateTree type signature - Pass new options through in print-mode and rpc-mode handlers - Update docs/extensions.md, docs/sdk.md, docs/tree.md - Add changelog entry
This commit is contained in:
@@ -237,7 +237,10 @@ export interface ExtensionCommandContext extends ExtensionContext {
|
||||
fork(entryId: string): Promise<{ cancelled: boolean }>;
|
||||
|
||||
/** Navigate to a different point in the session tree. */
|
||||
navigateTree(targetId: string, options?: { summarize?: boolean }): Promise<{ cancelled: boolean }>;
|
||||
navigateTree(
|
||||
targetId: string,
|
||||
options?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string },
|
||||
): Promise<{ cancelled: boolean }>;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -95,7 +95,12 @@ export async function runPrintMode(session: AgentSession, options: PrintModeOpti
|
||||
return { cancelled: result.cancelled };
|
||||
},
|
||||
navigateTree: async (targetId, options) => {
|
||||
const result = await session.navigateTree(targetId, { summarize: options?.summarize });
|
||||
const result = await session.navigateTree(targetId, {
|
||||
summarize: options?.summarize,
|
||||
customInstructions: options?.customInstructions,
|
||||
replaceInstructions: options?.replaceInstructions,
|
||||
label: options?.label,
|
||||
});
|
||||
return { cancelled: result.cancelled };
|
||||
},
|
||||
},
|
||||
|
||||
@@ -311,7 +311,12 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
||||
return { cancelled: result.cancelled };
|
||||
},
|
||||
navigateTree: async (targetId, options) => {
|
||||
const result = await session.navigateTree(targetId, { summarize: options?.summarize });
|
||||
const result = await session.navigateTree(targetId, {
|
||||
summarize: options?.summarize,
|
||||
customInstructions: options?.customInstructions,
|
||||
replaceInstructions: options?.replaceInstructions,
|
||||
label: options?.label,
|
||||
});
|
||||
return { cancelled: result.cancelled };
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user