Files
cline/src/core/controller/state/getLatestState.ts
T
cfc133acd3 PROTOBUS: Streaming, State, Service Auto-Config (#3253)
* round 1

* round 2 - searchFiles integration attempt

* undo streaming search experiments

* Start state.proto and related migrations

* state subscription

* get the main state flow using it

* correct stream ending early, debug statements

* clean up build-proto service config

* autogenerate index.tses

* auto-generate grpc-client service exports

* rename web-content -> web to make codegen work

* cleaned up streaming flow & cancels

* v3.14.0 Release Notes

v3.14.0 Release Notes

* prettier

* uhh prettier ?

* rename GrpcRequestRegistry file

* auto-generate directory for new services in the config

* generate template proto if it doesn't exist and provide instructions

* format fix

* add models service back to new system

---------

Co-authored-by: Andrei Edell <andrei@nugbase.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-06 13:42:36 -07:00

25 lines
765 B
TypeScript

import * as vscode from "vscode"
import { Controller } from "../index"
import { EmptyRequest } from "../../../shared/proto/common"
import { State } from "../../../shared/proto/state"
import { ExtensionState } from "../../../shared/ExtensionMessage"
/**
* 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, request: 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 {
stateJson,
}
}