| 2004 | } |
| 2005 | |
| 2006 | private static toSessionMetadata(raw: { |
| 2007 | sessionId: string; |
| 2008 | startTime: string; |
| 2009 | modifiedTime: string; |
| 2010 | summary?: string; |
| 2011 | isRemote: boolean; |
| 2012 | context?: { cwd: string; gitRoot?: string; repository?: string; branch?: string }; |
| 2013 | }): SessionMetadata { |
| 2014 | const { context } = raw; |
| 2015 | return { |
| 2016 | sessionId: raw.sessionId, |
| 2017 | startTime: new Date(raw.startTime), |
| 2018 | modifiedTime: new Date(raw.modifiedTime), |
| 2019 | summary: raw.summary, |
| 2020 | isRemote: raw.isRemote, |
| 2021 | context: context |
| 2022 | ? { |
| 2023 | workingDirectory: context.cwd, |
| 2024 | gitRoot: context.gitRoot, |
| 2025 | repository: context.repository, |
| 2026 | branch: context.branch, |
| 2027 | } |
| 2028 | : undefined, |
| 2029 | }; |
| 2030 | } |
| 2031 | |
| 2032 | /** |
| 2033 | * Gets the foreground session ID in TUI+server mode. |