11import cbws from '../core/websocket' ;
2- import { AddToAgentStateResponse , GetAgentStateResponse } from '../types/socketMessageTypes' ;
2+ import { AddToAgentStateResponse , GetAgentStateResponse , GetProjectStateResponse , UpdateProjectStateResponse } from '../types/socketMessageTypes' ;
33import { ApplicationState } from '../types/commonTypes' ;
44
55const cbstate = {
@@ -57,7 +57,7 @@ const cbstate = {
5757 * Retrieves the current project state from the server via WebSocket.
5858 * @returns {Promise<GetProjectStateResponse> } A promise that resolves with the project's state.
5959 */
60- getProjectState : async ( ) : Promise < any > => {
60+ getProjectState : async ( ) : Promise < GetProjectStateResponse > => {
6161 return cbws . messageManager . sendAndWaitForResponse (
6262 {
6363 "type" : "projectStateEvent" ,
@@ -69,9 +69,11 @@ const cbstate = {
6969
7070 /**
7171 * Updates the project state on the server via WebSocket.
72+ * @param {string } key - The key to update in the project state.
73+ * @param {any } value - The value to set for the key.
7274 * @returns {Promise<UpdateProjectStateResponse> } A promise that resolves with the response to the update request.
7375 */
74- updateProjectState : async ( key :string , value :any ) : Promise < any > => {
76+ updateProjectState : async ( key :string , value :any ) : Promise < UpdateProjectStateResponse > => {
7577 return cbws . messageManager . sendAndWaitForResponse (
7678 {
7779 "type" : "projectStateEvent" ,
0 commit comments