feat: add live progress streaming to init/reinit tools
- InitOptions.onProgress callback for directory-level progress - generateDirectoryMap reports per-file progress (→ filename) - initProject reports [N/M] Analyzing <path> (X files)... - pi-extension wires _onUpdate to onProgress for live Pi UI updates - User sees real-time feedback instead of silent long waits
This commit is contained in:
+12
-2
@@ -78,7 +78,12 @@ export default function (pi: ExtensionAPI) {
|
||||
try {
|
||||
const targetPath = params.path || ctx.cwd;
|
||||
const client = getPiLLMClient(ctx);
|
||||
await initProject(targetPath, { verbose: false, llmClient: client, cacheDir: ctx.cwd });
|
||||
await initProject(targetPath, {
|
||||
verbose: false,
|
||||
llmClient: client,
|
||||
cacheDir: ctx.cwd,
|
||||
onProgress: (msg) => _onUpdate?.({ content: [{ type: "text", text: msg }] }),
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
@@ -199,7 +204,12 @@ export default function (pi: ExtensionAPI) {
|
||||
try {
|
||||
const targetPath = params.path || ctx.cwd;
|
||||
const client = getPiLLMClient(ctx);
|
||||
await reinitPath(targetPath, { verbose: false, llmClient: client, cacheDir: ctx.cwd });
|
||||
await reinitPath(targetPath, {
|
||||
verbose: false,
|
||||
llmClient: client,
|
||||
cacheDir: ctx.cwd,
|
||||
onProgress: (msg) => _onUpdate?.({ content: [{ type: "text", text: msg }] }),
|
||||
});
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user