MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / updateAutonomyFlowById

Function updateAutonomyFlowById

src/utils/autonomyFlows.ts:440–456  ·  view source on GitHub ↗
(
  flowId: string,
  updater: (current: AutonomyFlowRecord) => AutonomyFlowRecord,
  rootDir: string = getProjectRoot(),
)

Source from the content-addressed store, hash-verified

438}
439
440async function updateAutonomyFlowById(
441 flowId: string,
442 updater: (current: AutonomyFlowRecord) => AutonomyFlowRecord,
443 rootDir: string = getProjectRoot(),
444): Promise<AutonomyFlowRecord | null> {
445 return withAutonomyPersistenceLock(rootDir, async () => {
446 const flows = await listAutonomyFlows(rootDir)
447 const index = flows.findIndex(flow => flow.flowId === flowId)
448 if (index === -1) {
449 return null
450 }
451 const next = normalizeFlowRecord(updater(cloneFlowRecord(flows[index]!)))
452 flows[index] = next
453 await writeAutonomyFlows(flows, rootDir)
454 return next
455 })
456}
457
458export function createManagedAutonomyFlowKey(params: {
459 trigger: AutonomyTriggerKind

Calls 6

getProjectRootFunction · 0.85
listAutonomyFlowsFunction · 0.85
normalizeFlowRecordFunction · 0.85
cloneFlowRecordFunction · 0.85
writeAutonomyFlowsFunction · 0.85

Tested by

no test coverage detected