MCPcopy Create free account
hub / github.com/anomalyco/opencode / getForkedTitle

Function getForkedTitle

packages/opencode/src/session/session.ts:161–169  ·  view source on GitHub ↗
(title: string)

Source from the content-addressed store, hash-verified

159}
160
161function getForkedTitle(title: string): string {
162 const match = title.match(/^(.+) \(fork #(\d+)\)$/)
163 if (match) {
164 const base = match[1]
165 const num = parseInt(match[2], 10)
166 return `${base} (fork #${num + 1})`
167 }
168 return `${title} (fork #1)`
169}
170
171function sessionPath(worktree: string, cwd: string) {
172 return path.relative(path.resolve(worktree), cwd).replaceAll("\\", "/")

Callers 1

session.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected