chore: upgrade pi dependencies
This commit is contained in:
+18
-2
@@ -124,7 +124,9 @@ async function extractAndValidateAnswerParams(
|
||||
selected: ExtractionSelection,
|
||||
config: Awaited<ReturnType<ReturnType<typeof getAskConfigStore>["getConfig"]>>
|
||||
): Promise<AskParams | undefined> {
|
||||
const extraction = await runExtractionUi(ctx, assistant, selected, config);
|
||||
const extraction = await withHiddenWorkingRow(ctx, () =>
|
||||
runExtractionUi(ctx, assistant, selected, config)
|
||||
);
|
||||
if ("cancelled" in extraction) {
|
||||
ctx.ui.notify("Question extraction cancelled.", "info");
|
||||
return;
|
||||
@@ -267,7 +269,9 @@ async function runAskAndSendSubmittedResult(
|
||||
params: AskParams,
|
||||
options: { allowFreeform: boolean }
|
||||
): Promise<void> {
|
||||
const result = await runAskFlow(ctx, params, options);
|
||||
const result = await withHiddenWorkingRow(ctx, () =>
|
||||
runAskFlow(ctx, params, options)
|
||||
);
|
||||
if (result.cancelled) {
|
||||
ctx.ui.notify("Ask form cancelled.", "info");
|
||||
return;
|
||||
@@ -275,6 +279,18 @@ async function runAskAndSendSubmittedResult(
|
||||
sendAskResult(pi, result, ctx);
|
||||
}
|
||||
|
||||
async function withHiddenWorkingRow<T>(
|
||||
ctx: ExtensionContext,
|
||||
run: () => Promise<T>
|
||||
): Promise<T> {
|
||||
ctx.ui.setWorkingVisible(false);
|
||||
try {
|
||||
return await run();
|
||||
} finally {
|
||||
ctx.ui.setWorkingVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
function sendAskResult(
|
||||
pi: Pick<ExtensionAPI, "sendUserMessage">,
|
||||
result: AskResult,
|
||||
|
||||
+7
-2
@@ -60,6 +60,11 @@ async function executeAskTool(
|
||||
if (!ctx.hasUI) {
|
||||
return nonInteractiveResponse(validation.state);
|
||||
}
|
||||
const result = await runAskFlow(ctx, params);
|
||||
return successfulResponse(result);
|
||||
ctx.ui.setWorkingVisible(false);
|
||||
try {
|
||||
const result = await runAskFlow(ctx, params);
|
||||
return successfulResponse(result);
|
||||
} finally {
|
||||
ctx.ui.setWorkingVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user