The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
feat: add harness wordmark and columnar layout to terminal startup banner
0xken15d56938810965
diff --git a/cli/src/lib/engineLaunch.spec.ts b/cli/src/lib/engineLaunch.spec.tsindex 88be34efe..13741f699 100644--- a/cli/src/lib/engineLaunch.spec.ts+++ b/cli/src/lib/engineLaunch.spec.ts@@ -1,5 +1,5 @@import { afterAll, afterEach, beforeEach, describe, expect, it } from 'vitest'-import { chmodSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'+import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'import { execFileSync } from 'node:child_process'import { tmpdir } from 'node:os'import { join } from 'node:path'@@ -11,6 +11,7 @@ import {LAUNCH_RESUME_FLAG,NAMED_AGENT_ARGS,NamedAgentUnsupportedError,+ HARNESS_WORDMARK_LINES,PERMISSION_MODES,terminalHintLines,buildEngineCommandArgv,@@ -141,23 +142,40 @@ describe('buildEngineLaunchArgv', () => {expect(out.toString()).toContain('reached')})- it('greets every new tile with the guide — where it is, agents, `harness remote` — before its prompt', () => {+ it('greets every new tile with the banner — wordmark, where it is, agents, `harness remote` — before its prompt', () => {const argv = buildEngineLaunchArgv('terminal', { terminalHint: { machineName: 'MacbookPro.local' } }, '/bin/sh')expect(argv.slice(3)).toEqual(['harness-terminal', '', '/bin/sh'])expect(() => execFileSync('/bin/sh', ['-n', '-c', argv[2]])).not.toThrow()const run = (): string => execFileSync('/bin/sh', ['-c', argv[2], 'harness-terminal', '', '/bin/sh', '-c', 'echo prompt'], { stdio: ['ignore', 'pipe', 'pipe'] }).toString()// Every time, not once per machine: a new tile is a new person at a new prompt.for (const out of [run(), run()]) {- for (const line of terminalHintLines('MacbookPro.local')) expect(out).toContain(line)- expect(out).toContain('Terminal on MacbookPro.local.')+ // Every line as drawn — the wordmark's backslashes and backtick included.+ expect(out).toContain(terminalHintLines('MacbookPro.local').join('\n'))+ expect(out).toContain(' Terminal on MacbookPro.local')expect(out).toContain('harness remote')expect(out.trim().endsWith('prompt')).toBe(true)}})- it('the guide names the machine, falls back to "this machine", and fits an 80-column pane unwrapped', () => {- expect(terminalHintLines(' ')[0]).toBe('harness: Terminal on this machine.')+ it('the banner names the machine, falls back to "this machine", and fits an 80-column pane unwrapped', () => {+ expect(terminalHintLines(' ')).toContain(' Terminal on this machine')for (const line of terminalHintLines('office-imac')) expect(line.length).toBeLessThanOrEqual(78)+ // A hostname longer than the line has room for is cut, never wrapped.+ const long = terminalHintLines('a'.repeat(120))+ for (const line of long) expect(line.length).toBeLessThanOrEqual(78)+ expect(long.find((line) => line.startsWith(' Terminal on'))).toMatch(/^ Terminal on a{61}…$/)+ // A blank line first and last: the wordmark does not sit on the pane's top edge, nor the prompt on the guide.+ const lines = terminalHintLines('office-imac')+ expect([lines[0], lines[lines.length - 1]]).toEqual(['', ''])+ })++ it('the wordmark is the one the installer prints, line for line', () => {+ // install.sh's print_logo, run for real: what a person sees at the end of an install is what a+ // tile shows them next — two copies, held to one drawing.+ const installer = readFileSync(join(process.cwd(), 'scripts', 'install.sh'), 'utf8')+ const printLogo = installer.slice(installer.indexOf('print_logo() {'), installer.indexOf('\n}\n', installer.indexOf('print_logo() {')) + 3)+ const printed = execFileSync('/bin/sh', ['-c', `${printLogo}\nprint_logo`], { encoding: 'utf8' }).split('\n').filter((line) => line.trim() !== '')+ expect(printed).toEqual([...HARNESS_WORDMARK_LINES])})it('with no guide asked for (restore, restart, a test) the pane says nothing before its prompt', () => {diff --git a/cli/src/lib/engineLaunch.ts b/cli/src/lib/engineLaunch.tsindex f00abadf1..aa3e2a015 100644--- a/cli/src/lib/engineLaunch.ts+++ b/cli/src/lib/engineLaunch.ts@@ -210,9 +210,10 @@ export interface LaunchCommandOptions {*/firstPrompt?: string/**- * Terminal only: print the tile's guide before the first prompt — what this pane is, that an- * agent typed here becomes the tile, and `harness remote`. Every NEW terminal tile gets it- * (`agent_create`); a pane rebuilt by restore or restart is not a new tile and names nothing here.+ * Terminal only: print the tile's banner before the first prompt — the wordmark, where this pane+ * is, that an agent typed here becomes the tile, and `harness remote`. Every NEW terminal tile+ * gets it (`agent_create`); a pane rebuilt by restore or restart is not a new tile and names+ * nothing here.*/terminalHint?: { machineName: string }/**@@ -473,6 +474,47 @@ export function engineFallbackPrelude(engine: AgentEngine, shellPath: string, tm+ '}\n'}+/**+ * The wordmark, as `cli/scripts/install.sh` prints it when an install is done (its `print_logo`);+ * `engineLaunch.spec.ts` holds the two to the same five lines. Printed through `printf '%s\n'` with+ * every line single-quoted, so the backslashes and the backtick reach the pane as drawn.+ */+export const HARNESS_WORDMARK_LINES: readonly string[] = [+ ' _',+ ' | |__ __ _ _ __ _ __ ___ ___ ___',+ " | '_ \\ / _` | '__| '_ \\ / _ \\/ __/ __|",+ ' | | | | (_| | | | | | | __/\\__ \\__ \\',+ ' |_| |_|\\__,_|_| |_| |_|\\___||___/___/',+]++/**+ * What a new terminal tile says before its prompt, every time one is opened — the installer's+ * finale, in the tile: the wordmark, where this pane is, and three things to type, each explained+ * in a column. An agent typed here becomes the tile (and the shell is back when it exits);+ * `harness remote` is the one thing only a tile can act on, since it swaps the tile it is typed in.+ * Every line stays under 78 columns — a pane is 80 wide when it prints them, before the app has+ * sized it, and a wrapped line stays wrapped in the scrollback. The block ends on a blank line, so+ * the prompt does not sit against it.+ */+export function terminalHintLines(machineName: string): string[] {+ // A hostname can be long (a cloud VM's FQDN runs to 50 characters); past the width the line has+ // left it is cut with an ellipsis rather than wrapped, which is the one thing the block promises.+ const name = machineName.trim() || 'this machine'+ const where = name.length > 62 ? `${name.slice(0, 61)}…` : name+ const row = (command: string, what: string): string => ` ${command.padEnd(29)} ${what}`+ return [+ '',+ ...HARNESS_WORDMARK_LINES,+ '',+ ` Terminal on ${where}`,+ '',+ row('claude · codex · opencode …', 'run an agent here — this tile becomes it'),+ row('harness remote', 'open a terminal on another machine'),+ row('harness --help', 'everything else'),+ '',+ ]+}+/*** Full argv for a plain terminal pane: the user's login shell, nothing exec'd over it.*@@ -485,23 +527,6 @@ export function engineFallbackPrelude(engine: AgentEngine, shellPath: string, tm* `interactiveEngineShell`). Without a resolvable shell the pane runs `/bin/sh`, which at least* gives the person a prompt.*/-/**- * What a new terminal tile says before its prompt, every time one is opened: where it is, that an- * agent typed here becomes the tile (and the shell is back when it exits), and `harness remote` —- * the one thing only a tile can act on, since it swaps the tile it is typed in. Three lines, each- * under 78 columns — a pane is 80 wide when it prints them, before the app has sized it, and a- * wrapped line stays wrapped in the scrollback — in the same `harness:` voice as every other line- * a pane prints.- */-export function terminalHintLines(machineName: string): string[] {- const where = machineName.trim() || 'this machine'- return [- `harness: Terminal on ${where}.`,- 'harness: Run an agent here (claude, codex, …) and this tile becomes it.',- 'harness: Terminal on another of your machines: harness remote',- ]-}-export function buildTerminalLaunchArgv(opts: Pick<LaunchCommandOptions, 'cwd' | 'terminalHint'> = {},shell: string | undefined = undefined,@@ -513,7 +538,7 @@ export function buildTerminalLaunchArgv(? `if ! cd -- "$1"; then printf '%s\\n' 'harness: the selected working directory is unavailable.' >&2; fi\n`: ''const hintPrelude = opts.terminalHint- ? `printf '%s\\n' ${terminalHintLines(opts.terminalHint.machineName).map(shellSingleQuote).join(' ')} ''\n`+ ? `printf '%s\\n' ${terminalHintLines(opts.terminalHint.machineName).map(shellSingleQuote).join(' ')}\n`: ''return [path, '-c', RAISE_OPEN_FILES_SH + cwdPrelude + hintPrelude + 'shift\nexec "$@"', 'harness-terminal', opts.cwd ?? '', path, ...loginArgs]}