session messaging
This commit is contained in:
parent
9c9b4dd616
commit
23d985b847
6 changed files with 11 additions and 11 deletions
|
|
@ -640,6 +640,9 @@ export class Core {
|
|||
await this.configHandler.updateControlPlaneSessionInfo(
|
||||
msg.data.sessionInfo,
|
||||
);
|
||||
this.messenger.send("sessionUpdate", {
|
||||
sessionInfo: msg.data.sessionInfo,
|
||||
});
|
||||
});
|
||||
|
||||
on("auth/getAuthUrl", async (msg) => {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import type {
|
|||
ToolCall,
|
||||
} from "../";
|
||||
import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager";
|
||||
import { ControlPlaneSessionInfo } from "../control-plane/client";
|
||||
|
||||
export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart";
|
||||
|
||||
|
|
@ -210,4 +211,8 @@ export type ToCoreFromIdeOrWebviewProtocol = {
|
|||
{ item: ContextItemWithId; selectedModelTitle: string | undefined },
|
||||
boolean,
|
||||
];
|
||||
didChangeControlPlaneSessionInfo: [
|
||||
{ sessionInfo: ControlPlaneSessionInfo | undefined },
|
||||
void,
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,8 +103,4 @@ export type ToIdeFromWebviewOrCoreProtocol = {
|
|||
|
||||
export type ToWebviewOrCoreFromIdeProtocol = {
|
||||
didChangeActiveTextEditor: [{ filepath: string }, void];
|
||||
didChangeControlPlaneSessionInfo: [
|
||||
{ sessionInfo: ControlPlaneSessionInfo | undefined },
|
||||
void,
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { ConfigResult } from "@continuedev/config-yaml";
|
||||
import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager.js";
|
||||
import { ControlPlaneSessionInfo } from "../control-plane/client.js";
|
||||
import type {
|
||||
BrowserSerializedContinueConfig,
|
||||
ContextItemWithId,
|
||||
|
|
@ -40,4 +41,5 @@ export type ToWebviewFromIdeOrCoreProtocol = {
|
|||
getWebviewHistoryLength: [undefined, number];
|
||||
getCurrentSessionId: [undefined, string];
|
||||
"jetbrains/setColors": [Record<string, string>, void];
|
||||
sessionUpdate: [{ sessionInfo: ControlPlaneSessionInfo | undefined }, void];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -114,12 +114,6 @@ class IdeProtocolClient(
|
|||
ApplicationManager.getApplication().messageBus.syncPublisher(AuthListener.TOPIC)
|
||||
.handleUpdatedSessionInfo(null)
|
||||
|
||||
// Tell the webview that session info changed
|
||||
val data = mapOf(
|
||||
"sessionInfo" to null
|
||||
)
|
||||
continuePluginService.coreMessenger?.request("didChangeControlPlaneSessionInfo", data, null) { _ -> }
|
||||
|
||||
respond(null)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||
}, []);
|
||||
|
||||
useWebviewListener(
|
||||
"didChangeControlPlaneSessionInfo",
|
||||
"sessionUpdate",
|
||||
async (data) => {
|
||||
setSession(data.sessionInfo);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue