-
Notifications
You must be signed in to change notification settings - Fork 19
fix(banner): PAI-OpenCode v3.0 branding — replace vanilla PAI 4.0.3 defaults #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -113,14 +113,14 @@ interface SystemStats { | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| function getStats(): SystemStats { | ||||||||||||||||||||||||
| let name = "PAI"; | ||||||||||||||||||||||||
| let paiVersion = "4.0.3"; | ||||||||||||||||||||||||
| let paiVersion = "3.0.0"; // PAI-OpenCode version | ||||||||||||||||||||||||
| let algorithmVersion = "3.7.0"; | ||||||||||||||||||||||||
| let catchphrase = "{name} here, ready to go"; | ||||||||||||||||||||||||
| let repoUrl = "github.com/danielmiessler/PAI"; | ||||||||||||||||||||||||
| let repoUrl = "github.com/Steffen025/pai-opencode"; // PAI-OpenCode repo | ||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||
| const settings = JSON.parse(readFileSync(join(CLAUDE_DIR, "settings.json"), "utf-8")); | ||||||||||||||||||||||||
| name = settings.daidentity?.displayName || settings.daidentity?.name || "PAI"; | ||||||||||||||||||||||||
| paiVersion = settings.pai?.version || "2.0"; | ||||||||||||||||||||||||
| paiVersion = settings.pai?.version || "3.0.0"; | ||||||||||||||||||||||||
| algorithmVersion = (settings.pai?.algorithmVersion || algorithmVersion).replace(/^v/i, ''); | ||||||||||||||||||||||||
| catchphrase = settings.daidentity?.startupCatchphrase || catchphrase; | ||||||||||||||||||||||||
| repoUrl = settings.pai?.repoUrl || repoUrl; | ||||||||||||||||||||||||
|
|
@@ -163,10 +163,10 @@ function getStats(): SystemStats { | |||||||||||||||||||||||
| const platform = process.platform === "darwin" ? "macOS" : process.platform; | ||||||||||||||||||||||||
| const arch = process.arch; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Try to get Claude Code version | ||||||||||||||||||||||||
| let ccVersion = "2.0"; | ||||||||||||||||||||||||
| // Try to get OpenCode version | ||||||||||||||||||||||||
| let ccVersion = ""; | ||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||
| const result = spawnSync("claude", ["--version"], { encoding: "utf-8" }); | ||||||||||||||||||||||||
| const result = spawnSync("opencode", ["--version"], { encoding: "utf-8" }); | ||||||||||||||||||||||||
| if (result.stdout) { | ||||||||||||||||||||||||
| const match = result.stdout.match(/(\d+\.\d+\.\d+)/); | ||||||||||||||||||||||||
| if (match) ccVersion = match[1]; | ||||||||||||||||||||||||
|
|
@@ -325,10 +325,10 @@ function createNavyBanner(stats: SystemStats, width: number): string { | |||||||||||||||||||||||
| lines.push(`${framePad}${topBorder}`); | ||||||||||||||||||||||||
| lines.push(""); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Header: PAI (in logo colors) | Personal AI Infrastructure | ||||||||||||||||||||||||
| // Header: PAI-OpenCode v3.0 | Personal AI Infrastructure | ||||||||||||||||||||||||
| const paiColored = `${C.navy}P${RESET}${C.medBlue}A${RESET}${C.lightBlue}I${RESET}`; | ||||||||||||||||||||||||
| const headerText = `${paiColored} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`; | ||||||||||||||||||||||||
| const headerLen = 33; // "PAI | Personal AI Infrastructure" | ||||||||||||||||||||||||
| const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`; | ||||||||||||||||||||||||
| const headerLen = 44; // "PAI-OpenCode v3.0.0 | Personal AI Infrastructure" | ||||||||||||||||||||||||
| const headerPad = " ".repeat(Math.floor((width - headerLen) / 2)); | ||||||||||||||||||||||||
| lines.push(`${headerPad}${headerText}`); | ||||||||||||||||||||||||
| lines.push(""); // Blank line between header and tagline | ||||||||||||||||||||||||
|
|
@@ -355,11 +355,16 @@ function createNavyBanner(stats: SystemStats, width: number): string { | |||||||||||||||||||||||
| lines.push(""); | ||||||||||||||||||||||||
| lines.push(""); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Footer: Unicode symbol + URL in medium blue (A color) | ||||||||||||||||||||||||
| // Footer: repo URL + credit line | ||||||||||||||||||||||||
| const urlLine = `${C.steel}\u2192${RESET} ${C.medBlue}${stats.repoUrl}${RESET}`; | ||||||||||||||||||||||||
| const urlLen = stats.repoUrl.length + 3; | ||||||||||||||||||||||||
| const urlPad = " ".repeat(Math.floor((width - urlLen) / 2)); | ||||||||||||||||||||||||
| lines.push(`${urlPad}${urlLine}`); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| const creditLine = `${C.muted}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`; | ||||||||||||||||||||||||
| const creditLen = 61; // visible length | ||||||||||||||||||||||||
| const creditPad = " ".repeat(Math.floor((width - creditLen) / 2)); | ||||||||||||||||||||||||
| lines.push(`${creditPad}${creditLine}`); | ||||||||||||||||||||||||
| lines.push(""); | ||||||||||||||||||||||||
|
Comment on lines
+363
to
368
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The visible length of Suggested fix- const creditLen = 61; // visible length
+ const creditLen = 63; // visible length📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Bottom border with full horizontal line and reticle corners | ||||||||||||||||||||||||
|
|
@@ -675,8 +680,8 @@ function createNavyMediumBanner(stats: SystemStats, width: number): string { | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Header (no border) | ||||||||||||||||||||||||
| const paiColored = `${C.navy}P${RESET}${C.medBlue}A${RESET}${C.lightBlue}I${RESET}`; | ||||||||||||||||||||||||
| const headerText = `${paiColored} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`; | ||||||||||||||||||||||||
| const headerPad = " ".repeat(Math.max(0, Math.floor((width - 33) / 2))); | ||||||||||||||||||||||||
| const headerText = `${paiColored}${C.slate}-OpenCode ${C.silver}v${stats.paiVersion}${RESET} ${C.steel}|${RESET} ${C.slate}Personal AI Infrastructure${RESET}`; | ||||||||||||||||||||||||
| const headerPad = " ".repeat(Math.max(0, Math.floor((width - 44) / 2))); | ||||||||||||||||||||||||
| lines.push(`${headerPad}${headerText}`); | ||||||||||||||||||||||||
| lines.push(""); | ||||||||||||||||||||||||
|
Comment on lines
+683
to
686
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same The header width used for centering (44) should be 48 to match the actual visible text length. Suggested fix- const headerPad = " ".repeat(Math.max(0, Math.floor((width - 44) / 2)));
+ const headerPad = " ".repeat(Math.max(0, Math.floor((width - 48) / 2)));📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -697,6 +702,9 @@ function createNavyMediumBanner(stats: SystemStats, width: number): string { | |||||||||||||||||||||||
| const urlLine = `${C.steel}\u2192${RESET} ${C.medBlue}${stats.repoUrl}${RESET}`; | ||||||||||||||||||||||||
| const urlPad = " ".repeat(Math.max(0, Math.floor((width - stats.repoUrl.length - 3) / 2))); | ||||||||||||||||||||||||
| lines.push(`${urlPad}${urlLine}`); | ||||||||||||||||||||||||
| const creditLine = `${C.steel}Built on PAI by Daniel Miessler \u00b7 github.com/danielmiessler/PAI${RESET}`; | ||||||||||||||||||||||||
| const creditPad = " ".repeat(Math.max(0, Math.floor((width - 61) / 2))); | ||||||||||||||||||||||||
| lines.push(`${creditPad}${creditLine}`); | ||||||||||||||||||||||||
| lines.push(""); | ||||||||||||||||||||||||
|
Comment on lines
+705
to
708
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same The credit width used for centering (61) should be 63 to match the actual visible text length. Suggested fix- const creditPad = " ".repeat(Math.max(0, Math.floor((width - 61) / 2)));
+ const creditPad = " ".repeat(Math.max(0, Math.floor((width - 63) / 2)));📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| return lines.join("\n"); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
headerLencalculation appears slightly off.The visible length of
"PAI-OpenCode v3.0.0 | Personal AI Infrastructure"is 48 characters, butheaderLenis set to 44. This will cause the header to be slightly off-center (~2 characters to the right).Note: The length varies with version string (e.g.,
v10.0.0would be 49 chars). Consider computing dynamically or adjusting to 48 for typical version strings.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents