@yagni-app/code-staging 0.2.1-staging.1032.1 → 0.2.1-staging.1033.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,11 +69,21 @@ export interface MastheadTheme {
69
69
  bold(s: string): string;
70
70
  fg(color: string, s: string): string;
71
71
  }
72
+ export interface MastheadOptions {
73
+ /** CLI version (e.g. "0.2.1") shown next to the title; omitted when absent. */
74
+ version?: string;
75
+ /** Working directory shown on the third line (already home-collapsed). */
76
+ cwd?: string;
77
+ }
72
78
  /**
73
79
  * Build the YAGNI Code startup masthead string, rendered into a header that
74
80
  * REPLACES pi's built-in startup banner (which otherwise shows "pi v<version>"
75
81
  * and a "Pi can explain its own features…" onboarding line). Kept here as a
76
82
  * pure string builder so its content is unit-testable without a terminal.
83
+ *
84
+ * Layout: the YAGNI art on the left, and to its right a three-line block —
85
+ * bold white "YAGNI Code" + version, the tagline, and the cwd. Art rows are
86
+ * padded to a uniform width so the right column stays straight.
77
87
  */
78
- export declare function buildMastheadString(theme: MastheadTheme): string;
88
+ export declare function buildMastheadString(theme: MastheadTheme, opts?: MastheadOptions): string;
79
89
  //# sourceMappingURL=branding.d.ts.map
@@ -142,15 +142,60 @@ export function brandSystemPrompt(original, opts = {}) {
142
142
  const CLOSING_REMINDER = "Reminder: you are YAGNI Code. If any text above names another coding agent, " +
143
143
  "assistant, or harness, it is not what you are or what you run on.";
144
144
  const BRIEF_HEADER = "=== HOW THIS COMPANY WORKS (live context from the YAGNI app) ===";
145
+ /** The YAGNI brand blue used for the masthead art (truecolor #345cb8). */
146
+ const BRAND_HEX = "#345cb8";
147
+ /**
148
+ * Wrap a string in a 24-bit truecolor foreground. The pi Theme only paints
149
+ * named palette colors and can't express our exact brand hex, so the masthead
150
+ * art emits its own ANSI truecolor escape (matching every modern terminal).
151
+ */
152
+ function paintBrand(s) {
153
+ const n = BRAND_HEX.replace("#", "");
154
+ const r = parseInt(n.slice(0, 2), 16);
155
+ const g = parseInt(n.slice(2, 4), 16);
156
+ const b = parseInt(n.slice(4, 6), 16);
157
+ return `\u001b[38;2;${r};${g};${b}m${s}\u001b[0m`;
158
+ }
159
+ /**
160
+ * The YAGNI wordmark as filled block-art: solid letter interiors (like the
161
+ * Claude robot silhouette), four rows, hand-tuned spacing. Each letter keeps
162
+ * its full form — A's carved counter, G's bowl, N's diagonal.
163
+ */
164
+ const MASTHEAD_ART = [
165
+ "█ █ ▄▀▀▀▄ ▄▀▀▀▄ █▄ █ ▀█▀",
166
+ " ▀▄▀ █▄▄▄█ █ ▄▄▄ █ █ █ █",
167
+ " █ █ █ ▀▄▄▄▀ █ ██ ▄█▄",
168
+ ];
145
169
  /**
146
170
  * Build the YAGNI Code startup masthead string, rendered into a header that
147
171
  * REPLACES pi's built-in startup banner (which otherwise shows "pi v<version>"
148
172
  * and a "Pi can explain its own features…" onboarding line). Kept here as a
149
173
  * pure string builder so its content is unit-testable without a terminal.
174
+ *
175
+ * Layout: the YAGNI art on the left, and to its right a three-line block —
176
+ * bold white "YAGNI Code" + version, the tagline, and the cwd. Art rows are
177
+ * padded to a uniform width so the right column stays straight.
150
178
  */
151
- export function buildMastheadString(theme) {
152
- const wordmark = theme.bold(theme.fg("accent", "YAGNI CODE"));
153
- const tagline = theme.fg("dim", "a terminal coding agent that knows your company");
154
- return `${wordmark}\n${tagline}`;
179
+ export function buildMastheadString(theme, opts = {}) {
180
+ const title = theme.bold(theme.fg("text", "YAGNI Code"));
181
+ const version = opts.version?.trim();
182
+ const line1 = version ? `${title} ${theme.fg("dim", `v${version}`)}` : title;
183
+ const right = [
184
+ line1,
185
+ theme.fg("dim", "a terminal coding agent that knows your company"),
186
+ ...(opts.cwd ? [theme.fg("dim", opts.cwd)] : []),
187
+ ];
188
+ const artW = Math.max(...MASTHEAD_ART.map((l) => [...l].length));
189
+ const gap = " ";
190
+ const rows = Math.max(MASTHEAD_ART.length, right.length);
191
+ const lines = [];
192
+ for (let i = 0; i < rows; i++) {
193
+ const rawArt = MASTHEAD_ART[i] ?? "";
194
+ const pad = " ".repeat(Math.max(0, artW - [...rawArt].length));
195
+ const left = rawArt ? paintBrand(rawArt) + pad : " ".repeat(artW);
196
+ const r = right[i] ?? "";
197
+ lines.push(r ? `${left}${gap}${r}` : left);
198
+ }
199
+ return lines.join("\n");
155
200
  }
156
201
  //# sourceMappingURL=branding.js.map
@@ -14,7 +14,7 @@ import { registerCostCommand } from "./costHud.js";
14
14
  import { isDebug } from "./diagnostics.js";
15
15
  import { droppedSessionRuns, sessionRunIds } from "./sessionRuns.js";
16
16
  import { codeStateHome } from "./stateHome.js";
17
- import { createYagniFooterFactory } from "./footer.js";
17
+ import { createYagniFooterFactory, formatCwd } from "./footer.js";
18
18
  import { RerouteNotifier } from "./rerouteNotice.js";
19
19
  import { isFreshWorkspace, registerTeamSetupCommand, runInitPass as defaultRunInitPass } from "./initPass.js";
20
20
  import { isInitDone as defaultIsInitDone, markInitDone as defaultMarkInitDone } from "./initDone.js";
@@ -481,7 +481,11 @@ export async function registerYagni(pi, deps = {}) {
481
481
  ctx.ui?.setStatus?.("brand", BRAND_NAME);
482
482
  // setHeader replaces the built-in header in place (verified against pi
483
483
  // 0.80.2 setExtensionHeader); the factory returns a simple Text component.
484
- ctx.ui?.setHeader?.((_tui, theme) => new Text(buildMastheadString(theme)));
484
+ // Pass the launcher-forwarded CLI version (YAGNI_CODE_VERSION) and the
485
+ // home-collapsed cwd so the masthead shows them like the reference.
486
+ const mastheadVersion = process.env.YAGNI_CODE_VERSION?.trim() || undefined;
487
+ const mastheadCwd = formatCwd(process.cwd(), process.env.HOME);
488
+ ctx.ui?.setHeader?.((_tui, theme) => new Text(buildMastheadString(theme, { version: mastheadVersion, cwd: mastheadCwd })));
485
489
  // Replace the built-in footer with the YAGNI status bar: folder +
486
490
  // [worktree] + branch on line 1, model + token/cost stats + integer
487
491
  // context % on line 2, and extension statuses (brand, todos, mode) on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code-staging",
3
- "version": "0.2.1-staging.1032.1",
3
+ "version": "0.2.1-staging.1033.1",
4
4
  "description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
@@ -38,5 +38,5 @@
38
38
  "@earendil-works/pi-tui": "0.83.0",
39
39
  "typebox": "^1.1.38"
40
40
  },
41
- "yagniSourceSha": "7629e1f12b3d8e06e68101daadd2d8258dd271e9"
41
+ "yagniSourceSha": "42e45669472777af680dce047ce01490793d6712"
42
42
  }