Kanshō/Terminal

Terminal

Sandbox shell surface: streamed stdout and stderr, timestamps, an active prompt row, and copy.

Included in the single kansho full pack. Components are not offered as separate installs.

Build output with timestamps

Build
14:02:01▶ bun run build
14:02:01$ next build
14:02:01 ▲ Next.js 15.3.2
14:02:02 Creating an optimized production build ...
14:02:18 ✓ Compiled successfully
14:02:19 ✓ Linting and checking validity of types
14:02:19 ✓ Collecting page data
14:02:22 ✓ Generating static pages (81/81)
14:02:23 ✓ Collecting build traces
14:02:24 ✓ Finalizing page optimization
14:02:24Route (app) Size First Load JS
14:02:24┌ ○ / 4.2 kB 142 kB
14:02:24├ ○ /samples/agent-dashboard 12.8 kB 150 kB
14:02:24└ ○ /samples/code-agent 9.1 kB 147 kB
14:02:24Build complete — 81 static routes

TypeScript error output

tsc
▶ bunx tsc --noEmit
src/auth/session.ts(20,5): error TS2322: Type 'null' is not assignable to type 'JWTPayload'.
src/auth/session.ts(20,5): Expected: JWTPayload
src/auth/session.ts(20,5): Received: null
Found 1 error.

Test run with failure

Test
▶ bun run test
PASS tests/auth.test.ts
✓ createSession returns a signed JWT (48ms)
✓ verifySession validates a good token (12ms)
✗ verifySession returns null on tampered token (8ms)
● verifySession › returns null on tampered token
Expected: AuthError
Received: null
Tests: 1 failed, 2 passed, 3 total — 68ms

With active prompt

~/project
14:02:01▶ bun run build
14:02:01$ next build
14:02:01 ▲ Next.js 15.3.2
~/code/example-agent-app $bun run lint

Component documentation

Terminal

components/sandbox/terminal.tsx

Purpose

Displays scrollable terminal output, optional timestamps, a decorative prompt, and clipboard copy feedback.

Appropriate use

Use for read-only build, test, or command output where input and execution happen elsewhere.

Example

components/sandbox/terminal.tsx has a representative live example in the "Build output with timestamps" section on /components/terminal.

States

Line kinds are stdout, stderr, system, prompt, and input; title, timestamps, prompt, promptValue, and maximum height are optional.

API and props

Terminal accepts title, lines, prompt, promptValue, maxHeight, and className; TerminalLine supplies kind, text, and optional timestamp.

Dependencies

Direct imports are React, Lucide icons, and cn.

Accessibility

Copy output is a named button with visible and polite copied feedback; stderr and system meaning is repeated through text, while the prompt cursor is decorative motion.

Limitations

It is not an emulator or input field, copies only line text, does not report clipboard failure, and uses array indexes for rendered line identity.

Source

Source: components/sandbox/terminal.tsx.

Full pack

components/sandbox/terminal.tsx is documented at /components/terminal and installs only through the single Kansho full pack; no individual component install is offered.