(opts?: { image?: boolean })
| 1343 | } |
| 1344 | |
| 1345 | function footer(opts?: { image?: boolean }) { |
| 1346 | const image = (() => { |
| 1347 | if (!shareId) return "" |
| 1348 | if (!opts?.image) return "" |
| 1349 | |
| 1350 | const titleAlt = encodeURIComponent(session.title.substring(0, 50)) |
| 1351 | const title64 = Buffer.from(session.title.substring(0, 700), "utf8").toString("base64") |
| 1352 | |
| 1353 | return `<a href="${shareBaseUrl}/s/${shareId}"><img width="200" alt="${titleAlt}" src="https://social-cards.sst.dev/opencode-share/${title64}.png?model=${providerID}/${modelID}&version=${session.version}&id=${shareId}" /></a>\n` |
| 1354 | })() |
| 1355 | const shareUrl = shareId ? `[opencode session](${shareBaseUrl}/s/${shareId}) | ` : "" |
| 1356 | return `\n\n${image}${shareUrl}[github run](${runUrl})` |
| 1357 | } |
| 1358 | |
| 1359 | async function fetchRepo() { |
| 1360 | return await octoRest.rest.repos.get({ owner, repo }) |
no test coverage detected