MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / getComposerState

Function getComposerState

desktop/runtime-host/live-runtime-service.ts:257–275  ·  view source on GitHub ↗
(request: ComposerStateRequest = {})

Source from the content-addressed store, hash-verified

255}
256
257export async function getComposerState(request: ComposerStateRequest = {}) {
258 const persistedSessionPath = getPersistedSessionPath(request.sessionPath)
259 if (persistedSessionPath) {
260 return await withRuntimeMutationLock(persistedSessionPath, async () => {
261 const runtime = await getOrCreateRuntimeForSessionPath(persistedSessionPath, {
262 suspendDisposal: true,
263 settingsCwd: request.composerSessionDir ?? null,
264 chatGroupId: request.chatGroupId ?? null,
265 })
266 if (!(runtime.session.isStreaming || isRuntimeExtensionCommandRunning(runtime))) {
267 await applyComposerModeSettings(runtime, request)
268 }
269 scheduleRuntimeDisposal(persistedSessionPath)
270 return await buildComposerState(runtime)
271 })
272 }
273
274 return await buildComposerStateSnapshot({ ...request, sessionPath: null })
275}
276
277export async function setComposerModel(
278 request: ComposerStateRequest,

Callers 1

handleRequestFunction · 0.90

Calls 8

getPersistedSessionPathFunction · 0.90
withRuntimeMutationLockFunction · 0.90
scheduleRuntimeDisposalFunction · 0.90
buildComposerStateFunction · 0.90

Tested by

no test coverage detected