MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / recordFreebuffInstanceOwner

Function recordFreebuffInstanceOwner

cli/src/utils/freebuff-instance-owner.ts:45–58  ·  view source on GitHub ↗
(instanceId: string)

Source from the content-addressed store, hash-verified

43}
44
45export function recordFreebuffInstanceOwner(instanceId: string): void {
46 try {
47 fs.mkdirSync(getConfigDir(), { recursive: true })
48 fs.writeFileSync(
49 getOwnerPath(),
50 JSON.stringify({ instanceId, pid: process.pid }, null, 2),
51 )
52 } catch (error) {
53 logger.debug(
54 { error: error instanceof Error ? error.message : String(error) },
55 '[freebuff-session] Failed to record local owner',
56 )
57 }
58}
59
60export function isFreebuffInstanceOwnedByDeadLocalProcess(
61 instanceId: string,

Callers 2

applyFunction · 0.90

Calls 2

getConfigDirFunction · 0.90
getOwnerPathFunction · 0.85

Tested by

no test coverage detected