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

Function openThreadRuntime

desktop/runtime-host/live-runtime-service.ts:652–676  ·  view source on GitHub ↗
(request: ComposerStateRequest)

Source from the content-addressed store, hash-verified

650}
651
652export async function openThreadRuntime(request: ComposerStateRequest) {
653 const persistedSessionPath = getPersistedSessionPath(request.sessionPath)
654 if (!persistedSessionPath) {
655 const { composer } = await emitComposerUpdate({ ...request, sessionPath: null })
656 return composer
657 }
658
659 return await withRuntimeMutationLock(persistedSessionPath, async () => {
660 const runtime = await getOrCreateRuntimeForSessionPath(persistedSessionPath, {
661 suspendDisposal: true,
662 settingsCwd: request.composerSessionDir ?? null,
663 chatGroupId: request.chatGroupId ?? null,
664 })
665 if (!(runtime.session.isStreaming || isRuntimeExtensionCommandRunning(runtime))) {
666 await applyComposerModeSettings(runtime, request)
667 }
668 const composer = await buildComposerState(runtime)
669 publishComposerUpdate(composer, {
670 projectId: request.projectId ?? runtime.cwd,
671 sessionPath: persistedSessionPath,
672 })
673 scheduleRuntimeDisposal(persistedSessionPath)
674 return composer
675 })
676}

Callers 1

handleRequestFunction · 0.90

Calls 9

getPersistedSessionPathFunction · 0.90
withRuntimeMutationLockFunction · 0.90
buildComposerStateFunction · 0.90
publishComposerUpdateFunction · 0.90
scheduleRuntimeDisposalFunction · 0.90
emitComposerUpdateFunction · 0.70

Tested by

no test coverage detected