* Enable biome rules: noUnusedVariables, noUnusedFunctionParameters, noUnusedImports * Apply new rules with format * remove unused currentReplaceContent * update nextTerminalId * fix all format issues * update biome config * add back applyContextOptimizations and killAllChromeBrowsers
23 lines
670 B
TypeScript
23 lines
670 B
TypeScript
import { EmptyRequest } from "@shared/proto/cline/common"
|
|
import { State } from "@shared/proto/cline/state"
|
|
import { Controller } from "../index"
|
|
|
|
/**
|
|
* Get the latest extension state
|
|
* @param controller The controller instance
|
|
* @param request The empty request
|
|
* @returns The current extension state
|
|
*/
|
|
export async function getLatestState(controller: Controller, _: EmptyRequest): Promise<State> {
|
|
// Get the state using the existing method
|
|
const state = await controller.getStateToPostToWebview()
|
|
|
|
// Convert the state to a JSON string
|
|
const stateJson = JSON.stringify(state)
|
|
|
|
// Return the state as a JSON string
|
|
return State.create({
|
|
stateJson,
|
|
})
|
|
}
|