more merge and typescript fixes

This commit is contained in:
chezsmithy 2025-04-12 00:24:25 -07:00
parent bb90e7870b
commit 3399fbe7b1
4 changed files with 27 additions and 16 deletions

View file

@ -252,6 +252,7 @@ export class Core {
this.registerMessageHandlers(ideSettingsPromise);
}
/* eslint-disable max-lines-per-function */
private registerMessageHandlers(ideSettingsPromise: Promise<IdeSettings>) {
const on = this.messenger.on.bind(this.messenger);
@ -626,14 +627,18 @@ export class Core {
});
on("didChangeSelectedProfile", async (msg) => {
await this.configHandler.setSelectedProfileId(msg.data.id);
if (msg.data.id) {
await this.configHandler.setSelectedProfileId(msg.data.id);
}
});
on("didChangeSelectedOrg", async (msg) => {
await this.configHandler.setSelectedOrgId(
msg.data.id,
msg.data.profileId,
);
if (msg.data.id) {
await this.configHandler.setSelectedOrgId(
msg.data.id,
msg.data.profileId || undefined,
);
}
});
on("didChangeControlPlaneSessionInfo", async (msg) => {
@ -686,7 +691,7 @@ export class Core {
toolCallId: string,
contextItems: any[]
}) => {
this.messenger.send("toolCallPartialOutput", params);
this.messenger.send("toolCallPartialOutput" as any, params);
};
const contextItems = await callTool(

View file

@ -8,6 +8,7 @@ import {
// extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/toolWindow/ContinueBrowser.kt
export const WEBVIEW_TO_CORE_PASS_THROUGH: (keyof ToCoreFromWebviewProtocol)[] =
[
"toolCallPartialOutput",
"ping",
"abort",
"history/list",

View file

@ -40,4 +40,8 @@ export type ToWebviewFromIdeOrCoreProtocol = {
getWebviewHistoryLength: [undefined, number];
getCurrentSessionId: [undefined, string];
"jetbrains/setColors": [Record<string, string>, void];
toolCallPartialOutput: [
{ toolCallId: string; contextItems: any[] },
void,
];
};

View file

@ -37,8 +37,7 @@ import {
newSession,
selectIsInEditMode,
selectIsSingleRangeEditOrInsertion,
setInactive,
updateToolCallOutput,
updateToolCallOutput
} from "../../redux/slices/sessionSlice";
import {
setDialogEntryOn,
@ -278,14 +277,16 @@ export function Chat() {
useWebviewListener(
"toolCallPartialOutput",
async (data) => {
console.log("toolCallPartialOutput", data);
// Update tool call output in Redux store
dispatch(
updateToolCallOutput({
toolCallId: data.toolCallId,
contextItems: data.contextItems,
}),
);
if (data && typeof data === "object" && "toolCallId" in data && "contextItems" in data) {
console.log("toolCallPartialOutput", data);
// Update tool call output in Redux store
dispatch(
updateToolCallOutput({
toolCallId: data.toolCallId,
contextItems: data.contextItems,
}),
);
}
},
[dispatch],
);