INNER CODE UNIT · TypeScript

getWorkflowState

agent-sh/agentsys · adapters/opencode-plugin/index.ts:93

async function getWorkflowState(directory: string): Promise<{
  phase?: string
  task?: { id: string; title: string }
  worktree?: string
} | null> {
  const stateDir = getStateDir(directory)
  const flowPath = join(stateDir, "flow.json")

  try {
    if (!existsSync(flowPath)) return null
    const content = await readFile(flowPath, "utf-8")
    return JSON.parse(content)
  } catch {
    return null
  }
}

// Save workflow context for compaction

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…